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alone|sync","components/Footer/index.tsx","components/Markdown/Hyperlink.tsx","components/Markdown/index.tsx","pages/home/index.tsx"],"sourcesContent":["function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = () => ([]);\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = 256;\nmodule.exports = webpackEmptyContext;","import styled from 'styled-components';\n\nconst Wrapper = styled.div`\n padding: 20px 23px 60px 23px;\n a {\n color: #ced1d4;\n text-decoration: none;\n transition: color 0.3s;\n margin: 0 3px;\n &:hover {\n color: black;\n }\n & + a {\n margin-left: 10px;\n }\n &::after {\n content: ' ';\n height: 13px;\n width: 1px;\n margin-left: 10px;\n display: inline-block;\n vertical-align: middle;\n background-color: #e5e9ec;\n }\n &:last-child::after {\n display: none;\n }\n }\n`;\n\ntype FooterProps = {\n editorUrl?: string;\n};\n\nconst Footer = (props: FooterProps) => {\n const { editorUrl } = props || {};\n return (\n \n {editorUrl && (\n \n 编辑当前页面\n \n )}\n \n 提交 Bug\n \n \n GitHub\n \n \n kkt\n \n \n uiwjs\n \n \n 百度地图 React 版本\n \n \n );\n};\n\nexport default Footer;\n","import React, { useEffect, useRef } from 'react';\nimport { styled } from 'styled-components';\n\ntype HeadingType = { id: string; text: string; level: number };\nfunction useHeadings(mdStr?: string) {\n const [headings, setHeadings] = React.useState([]);\n React.useEffect(() => {\n const elements = Array.from(document.querySelectorAll('h2, h3, h4, h5, h6'))\n .filter((element) => element.id)\n .map((element) => ({\n id: element.id,\n text: element.textContent ?? '',\n level: Number(element.tagName.substring(1)),\n }));\n setHeadings(elements);\n }, [mdStr]);\n return headings;\n}\n\nfunction useScrollSpy(ids: string[], options: IntersectionObserverInit) {\n const [activeId, setActiveId] = React.useState();\n const observer = React.useRef();\n React.useEffect(() => {\n const elements = ids.map((id) => document.getElementById(id));\n observer.current?.disconnect();\n observer.current = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n if (entry?.isIntersecting) {\n setActiveId(entry.target.id);\n }\n });\n }, options);\n elements.forEach((el) => {\n if (el) {\n observer.current?.observe(el);\n }\n });\n return () => observer.current?.disconnect();\n }, [ids, options]);\n return activeId;\n}\n\nconst Nav = styled.nav`\n ul,\n ul li {\n list-style: none;\n padding-left: 0;\n }\n`;\n\nconst Aside = styled.aside`\n position: sticky;\n right: 0;\n top: 0px;\n z-index: 999;\n max-height: calc(100vh - 6px);\n overflow: auto;\n li {\n height: 22px;\n line-height: 22px;\n }\n .active::before {\n content: ' ';\n display: block;\n background-color: #f38701;\n border-radius: 2px;\n height: 18px;\n margin-top: 3px;\n position: absolute;\n transition: top 0.3s;\n width: 5px;\n }\n`;\n\nexport function useHyperClickToTop(props: { dom: HTMLElement | null; mdStr: string | undefined }) {\n const { dom, mdStr } = props;\n useEffect(() => {\n const doms = dom?.querySelectorAll('a.anchor[href^=\"#\"]');\n if (doms && doms.length > 0) {\n doms.forEach((elm) => {\n elm.onclick = (e: MouseEvent) => {\n e.preventDefault();\n const id = elm.parentElement!.id;\n if (id) {\n document.querySelector(`#${id}`)?.scrollIntoView({\n behavior: 'smooth',\n });\n }\n };\n });\n }\n }, [dom, mdStr]);\n}\n\nexport const Hyperlink = ({ dom, mdStr }: any) => {\n useHyperClickToTop({ dom: dom, mdStr });\n const $dom = useRef(null);\n const headings = useHeadings(mdStr);\n const activeId = useScrollSpy(\n headings.map(({ id }) => id),\n {\n rootMargin: '0% 0% -50% 0%',\n threshold: 1,\n },\n );\n return (\n \n );\n};\n","import { useEffect, useState, useRef, Component } from 'react';\nimport MarkdownPreviewExample from '@uiw/react-markdown-preview-example/markdown';\nimport type { CodeBlockData } from 'markdown-react-code-preview-loader';\nimport styled from 'styled-components';\nimport BackToUp from '@uiw/react-back-to-top';\nimport Footer from '../Footer';\nimport { Hyperlink } from './Hyperlink';\n\nconst Wrapper = styled.div`\n width: 100%;\n height: 100%;\n position: relative;\n`;\n\nconst MarkdownPreview = styled(MarkdownPreviewExample)`\n max-width: none;\n margin: inherit;\n box-shadow: 0 0 0;\n border: 0;\n pre[data-type='rehyp'] {\n overflow: initial;\n }\n`;\n\nconst Main = styled.main`\n padding: 20px 30px 120px 30px;\n display: grid;\n grid-template-columns: minmax(0, 3.5fr) 240px;\n grid-template-areas: 'main toc';\n border: 0;\n &::after,\n &::before {\n content: none;\n }\n`;\n\ninterface MarkdownProps {\n path?: () => Promise<{ default: CodeBlockData }>;\n editorUrl?: string;\n}\n\nfunction MarkdownInstance(props: MarkdownProps) {\n const $dom = useRef(null);\n const [mdStr, setMdStr] = useState('');\n const [data, setData] = useState();\n const path = props.path;\n useEffect(() => {\n if (path) {\n path().then((str) => {\n setMdStr(str.default.source);\n setData(str.default);\n });\n }\n }, [path]);\n return (\n \n {mdStr && (\n \n \n \n \n )}\n Top\n \n \n );\n}\n\nexport default class Markdown extends Component {\n editorUrl?: string;\n getMdStr?: () => Promise<{ default: CodeBlockData }>;\n componentDidMount() {\n if (this.getMdStr) {\n this.getMdStr().then((str) => {\n this.setState({\n data: str.default,\n mdStr: str.default.source,\n });\n });\n }\n }\n render() {\n return ;\n }\n}\n","import Markdown from '../../components/Markdown';\n\nexport default class Page extends Markdown {\n editorUrl = '/packages/amap/README.md';\n getMdStr = () => import('@uiw/react-amap/README.md');\n}\n"],"names":["webpackEmptyContext","req","e","Error","code","keys","resolve","id","module","exports","Wrapper","styled","div","props","editorUrl","_jsxs","children","_jsx","title","target","rel","href","Nav","nav","Aside","aside","Hyperlink","_ref","dom","mdStr","useEffect","doms","querySelectorAll","length","forEach","elm","onclick","preventDefault","parentElement","_document$querySelect","document","querySelector","scrollIntoView","behavior","useHyperClickToTop","$dom","useRef","headings","setHeadings","React","elements","Array","from","filter","element","map","_element$textContent","text","textContent","level","Number","tagName","substring","useHeadings","activeId","ids","options","setActiveId","observer","_observer$current","getElementById","current","disconnect","IntersectionObserver","entries","entry","isIntersecting","el","_observer$current2","observe","_observer$current3","useScrollSpy","_ref2","rootMargin","threshold","ref","className","heading","style","marginLeft","fontWeight","onClick","_document$querySelect2","console","log","MarkdownPreview","MarkdownPreviewExample","Main","main","MarkdownInstance","setMdStr","useState","data","setData","path","then","str","default","source","BackToUp","float","Footer","Markdown","Component","constructor","arguments","getMdStr","componentDidMount","this","setState","render","Page"],"sourceRoot":""}