cloud-native-app-initializer/initializer-page/public/chunk-9be511ceaf27e232c205.js.map
2023-04-06 14:03:24 +08:00

1 line
36 KiB
Plaintext

{"version":3,"sources":["webpack:///./src/styles/explore.scss?bf98","webpack:///./src/styles/explore.scss","webpack:///./src/components/common/explore/Code.js","webpack:///./src/components/common/explore/Loading.js","webpack:///./src/components/common/explore/Tree.js","webpack:///./src/components/utils/Zip.js","webpack:///./src/components/common/explore/Explore.js"],"names":["api","content","__esModule","default","module","i","options","exports","locals","___CSS_LOADER_API_IMPORT___","push","ReactMarkdown","require","Code","item","code","get","replace","language","Prism","theme","className","style","tokens","getLineProps","getTokenProps","groupLine","length","map","line","props","key","data-value","token","props2","linkTarget","source","global","defaultProps","force","propTypes","PropTypes","shape","string","bool","Loading","onClose","href","onClick","e","preventDefault","width","type","func","isRequired","Tree","tree","selected","onClickItem","useState","folders","setFolders","useEffect","recursive","mapRec","acc","forEach","filename","path","hidden","children","renderItem","depth","folder","find","f","isHidden","newFolders","newFolder","it","isDisabled","isSelected","tabIndex","arrayOf","FILE_EXTENSION","js","md","kt","kts","gradle","gitignore","java","xml","properties","groovy","html","css","createTree","files","fileName","zip","Promise","resolve","pfiles","ppath","pfileName","pzip","pdepth","dir","relativePath","file","pathArray","split","sort","a","b","substring","includes","extension","pop","getLanguage","async","then","indexOf","findRoot","root","Object","keys","filter","Explore","open","projectName","blob","button","setButton","setTree","setSelected","useContext","AppContext","dispatch","explore","zipJs","JSZip","loadAsync","catch","Error","result","payload","toast","error","message","load","showCloseIcon","classNames","modal","overlay","FileSaver","saveAs","blobFile","Blob","onCopy","setTimeout","text","newSelected","onChange","instanceOf"],"mappings":"6EAAA,IAAIA,EAAM,EAAQ,IACFC,EAAU,EAAQ,KAIC,iBAFvBA,EAAUA,EAAQC,WAAaD,EAAQE,QAAUF,KAG/CA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAG9C,IAAIK,EAAU,CAEd,OAAiB,OACjB,WAAoB,GAEPN,EAAIC,EAAS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AETgH,IAG0B,aAA9BrH,IAAIyC,EAAU,aACb,oCACE,0BAAMpC,UAAU,WAAhB,KACA,uBACE0B,KAAK,KACLC,QAAS,SAAAC,GACPA,EAAEC,iBACF,IAAMiH,E,iWAAc,CAAH,GAAQ1G,GACzB0G,EAAY5H,OAASvB,IAAIyC,EAAU,SAAS,GAC5C+E,EAAY2B,IAEd9I,UAAU,UAETL,IAAIyC,EAAU,SAAS,GACpB,UACA,iBAKZ,uBACEV,KAAK,KACLC,QAAS,SAAAC,GACPA,EAAEC,iBACFJ,KAEFzB,UAAU,SAEV,kBAAC,IAAD,QAGJ,yBAAKA,UAAU,oBACb,kBAACR,EAAA,EAAD,CAAMC,KAAM2C,EAAU2G,SAAU,mBAO1C,kBAAC,EAAD,CAAStH,QAASA,MAO5BmF,EAAQ3F,aAAe,CACrB6F,YAAa,GACbC,KAAM,MAGRH,EAAQzF,UAAY,CAClB0F,KAAMzF,IAAUG,KAAKU,WACrBR,QAASL,IAAUY,KAAKC,WACxB6E,YAAa1F,IAAUE,OACvByF,KAAM3F,IAAU4H,WAAWN,OAGd9B","file":"chunk-9be511ceaf27e232c205.js","sourcesContent":["var api = require(\"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./explore.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"code[class*='language-'],pre[class*='language-']{color:#393a34;font-family:'Consolas', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;font-size:14px}pre[class*='language-']::-moz-selection,pre[class*='language-'] ::-moz-selection,code[class*='language-']::-moz-selection,code[class*='language-'] ::-moz-selection{background:#b3d4fc}pre[class*='language-']::selection,pre[class*='language-'] ::selection,code[class*='language-']::selection,code[class*='language-'] ::selection{background:#b3d4fc}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#999988;font-style:italic}.token.namespace{opacity:0.7}.token.string,.token.attr-value{color:#e3116c}.token.punctuation,.token.operator{color:#393a34}.token.entity,.token.url,.token.symbol,.token.number,.token.boolean,.token.variable,.token.constant,.token.property,.token.regex,.token.inserted{color:#36acaa}.token.atrule,.token.keyword,.token.attr-name,.language-autohotkey .token.selector{color:#00bfff}.token.function,.token.deleted,.language-autohotkey .token.tag{color:#f14f00}.token.tag,.token.selector,.language-autohotkey .token.keyword{color:#00009f}.token.important,.token.function,.token.bold{font-weight:bold}.token.italic{font-style:italic}.language-java .token.annotation{color:#e3116c}.gatsby-highlight-code-line{background-color:#f9f9f9;display:block;margin-right:-1em;margin-left:-1em;padding-right:1em;padding-left:1em}pre.language-xml .token.tag,pre.language-xml .token.selector,pre.language-xml .language-autohotkey .token.keyword{color:#e3116c}pre.language-xml .token.attr-value{color:#50a14f}pre.language-xml .token.attr-name{color:#c18401}pre.language-xml .token.punctuation{color:#888}.modal-explorer{width:98%;max-width:1320px;top:40px;height:80%;box-shadow:0 10px 40px rgba(0,0,0,0.2);padding:0;min-width:960px}.modal-explorer>div{height:100%}.modal-explorer .close{display:block;position:absolute;top:0;right:0;padding:6px 12px;height:28px;cursor:pointer;opacity:0.7;color:#222}.modal-explorer .close svg{width:14px}.modal-explorer .close:hover{opacity:1}.modal-explorer .colset-explorer{padding:0;height:100%;display:flex}.modal-explorer .colset-explorer .right,.modal-explorer .colset-explorer .left{max-width:none;padding:0;text-align:left;font-weight:normal;height:100%;position:relative}.modal-explorer .colset-explorer .left{flex:0 0 400px;border-right:1px solid #e4e4e4}.modal-explorer .colset-explorer .head{border-bottom:1px solid #e4e4e4;line-height:40px;padding:0 16px;position:absolute;top:0;left:0;height:40px;right:0}.modal-explorer .colset-explorer .head .divider{display:inline-block}.modal-explorer .colset-explorer .head .actions{display:inline-block;height:40px;margin-left:16px;color:rgba(0,0,0,0.2)}.modal-explorer .colset-explorer .head .actions .placeholder-text{margin:13px 13px}.modal-explorer .colset-explorer .head a{outline:1px solid transparent;height:40px}.modal-explorer .colset-explorer .head a:focus{outline:1px dotted rgba(0,0,0,0.2)}.modal-explorer .colset-explorer .head .placeholder-text{margin:14px 0}.modal-explorer .colset-explorer .head .placeholder-title .placeholder-text{margin-right:5px}.modal-explorer .colset-explorer .foot{position:absolute;bottom:0;left:0;right:0;line-height:40px;height:40px;border-top:1px solid #e4e4e4}.modal-explorer .colset-explorer .foot .action{position:relative;padding-left:5px;padding-right:20px;margin-left:10px;outline:1px solid transparent}.modal-explorer .colset-explorer .foot .action .icon-download{position:absolute;top:14px;left:5px}.modal-explorer .colset-explorer .foot .action:focus{outline:1px dotted rgba(0,0,0,0.2)}.modal-explorer .colset-explorer .foot .placeholder-text{position:absolute;top:13px;left:14px;padding:0;margin:0}.modal-explorer .colset-explorer .action{display:inline-block;cursor:pointer;color:#0188ff;padding:0 16px;text-decoration:underline}.modal-explorer .colset-explorer .action:hover{text-decoration:none}.modal-explorer .colset-explorer .explorer-content{position:absolute;top:41px;bottom:40px;right:0;left:0;overflow:auto}.modal-explorer .colset-explorer .right{flex:1}.modal-explorer .colset-explorer .right .head strong{position:relative;padding-left:20px}.modal-explorer .colset-explorer .right .head strong svg{position:absolute;top:3px;left:0;width:13px}.modal-explorer .colset-explorer .right .placeholder-text{background:#f7f7f7}.modal-explorer .colset-explorer .right .explorer-content{bottom:0}.modal-explorer .colset-explorer .right .explorer-content::-webkit-scrollbar{height:6px;width:6px;background:transparent}.modal-explorer .colset-explorer .right .explorer-content::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.3)}.modal-explorer .icon-download{width:16px}.overlay{background:rgba(255,255,255,0.6)}.explorer-ul,.explorer-ul ul{padding:0;margin:0;list-style:none;font-size:14px;line-height:30px}.explorer-ul span{display:block}.explorer-ul .file,.explorer-ul .folder{position:relative;display:block;cursor:pointer;text-decoration:none;color:#222;word-wrap:normal;white-space:nowrap;outline:1px dotted transparent}.explorer-ul .file:hover,.explorer-ul .folder:hover{background:rgba(0,0,0,0.03)}.explorer-ul .file .text,.explorer-ul .folder .text{position:relative;padding-left:44px;margin:0 8px}.explorer-ul .file .icon,.explorer-ul .folder .icon{display:block;position:absolute;top:4px;left:18px;height:20px;width:20px}.explorer-ul .file .icon-caret-down,.explorer-ul .folder .icon-caret-down{display:block;position:absolute;z-index:1000;top:6px;left:0;height:16px;width:16px}.explorer-ul .file:focus,.explorer-ul .folder:focus{outline:1px dotted rgba(0,0,0,0.2)}.explorer-ul .file.disabled,.explorer-ul .folder.disabled{opacity:0.4;cursor:not-allowed}.explorer-ul .file.disabled:hover,.explorer-ul .folder.disabled:hover{background:transparent}.explorer-ul .file.disabled:focus,.explorer-ul .folder.disabled:focus{outline:1px dotted rgba(0,0,0,0.2)}.explorer-ul .file.selected,.explorer-ul .folder.selected{background:rgba(0,0,0,0.05);font-weight:bold}.explorer-ul .folder-hide>ul{display:none}.explorer-ul .folder-hide>.folder>.text>.icon-caret-down{transform:rotate(-90deg)}.explorer-ul .level-0 .text{margin-left:6px}.explorer-ul .level-1 .text{margin-left:18px}.explorer-ul .level-2 .text{margin-left:30px}.explorer-ul .level-3 .text{margin-left:42px}.explorer-ul .level-4 .text{margin-left:54px}.explorer-ul .level-5 .text{margin-left:66px}.explorer-ul .level-6 .text{margin-left:78px}.explorer-ul .level-7 .text{margin-left:90px}.explorer-ul .level-8 .text{margin-left:102px}.explorer-ul .level-9 .text{margin-left:114px}.explorer-ul .level-10 .text{margin-left:126px}.explorer-ul .icon-folder{width:20px}.explorer-ul .icon-file{position:absolute;top:3px;left:4px;width:13px}ul.explorer-ul-placeholder{list-style:none;margin:0;padding:0}ul.explorer-ul-placeholder li{list-style:none;height:30px}ul.explorer-ul-placeholder li .placeholder-text{margin-left:28px;margin-top:8px}ul.explorer-ul-placeholder li .placeholder-text+.placeholder-text{margin-left:5px;margin-top:8px}pre.prism-code{margin:0;padding:0;line-height:24px;font-size:13px;font-family:Monaco, Menlo, Consolas, 'courier new', monospace}pre.prism-code span.explorer-number{position:relative;display:inline-block;width:20px;padding-right:10px;text-align:right;margin-right:10px;font-size:11px;height:25px}pre.prism-code span.explorer-number:before{display:block;content:attr(data-value);color:rgba(0,0,0,0.2);position:absolute;width:20px;left:0;top:9px;background-color:#f7f7f7;padding-right:10px;height:25px}pre.prism-code .token-line{height:25px}pre.prism-code.line-3{width:28px}pre.prism-code.line-3 span.explorer-number{width:28px}pre.prism-code.line-3 span.explorer-number:before{width:28px}pre.prism-code.line-3:before{width:38px}pre.prism-code:before{position:absolute;top:0;bottom:0;display:block;width:30px;content:'';background-color:#f7f7f7}.markdown,.markdown-source{position:relative;padding:8px 32px}.markdown a,.markdown-source a{color:#0188ff}.markdown a:hover,.markdown-source a:hover{text-decoration:none}.markdown .button-source,.markdown-source .button-source{position:absolute;right:0;top:0;line-height:20px;margin:10px 15px;color:rgba(0,0,0,0.6);text-decoration:none;font-size:13px;padding:2px 12px}.markdown-source{padding:0;height:100%}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","import Highlight from 'prism-react-renderer'\nimport Prism from 'prism-react-renderer/prism'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport get from 'lodash.get'\n\nconst ReactMarkdown = require('react-markdown')\n\nif (typeof global !== 'undefined') {\n global.Prism = Prism\n require('prismjs/components/prism-java') // eslint-disable-line\n require('prismjs/components/prism-kotlin') // eslint-disable-line\n require('prismjs/components/prism-properties') // eslint-disable-line\n require('prismjs/components/prism-groovy') // eslint-disable-line\n require('prismjs/components/prism-git') // eslint-disable-line\n}\n\nfunction Code({ item }) {\n const code = get(item, 'content', '').replace(/\\t/g, ' ')\n const language = get(item, 'language')\n if (language === 'markdown' && !get(item, 'force', false)) {\n return (\n <div className='markdown'>\n <ReactMarkdown linkTarget='_blank' source={code} />\n </div>\n )\n }\n return (\n <Highlight Prism={Prism} code={code} language={language} theme={null}>\n {({ className, style, tokens, getLineProps, getTokenProps }) => {\n let groupLine = tokens.length > 9 ? '2' : '1'\n groupLine = tokens.length > 99 ? '3' : groupLine\n groupLine = tokens.length > 999 ? '4' : groupLine\n return (\n <pre className={`${className} line-${groupLine}`} style={style}>\n {tokens.map((line, i) => {\n const props = getLineProps({ line, key: i })\n return (\n <div\n key={get(props, 'key')}\n className={get(props, 'className')}\n >\n <span data-value={i + 1} className='explorer-number' />\n {line.map((token, key) => {\n const props2 = getTokenProps({ token, key })\n return (\n <span\n className={get(props2, 'className')}\n style={get(props2, 'style')}\n key={get(props2, 'key')}\n >\n {get(props2, 'children')}\n </span>\n )\n })}\n </div>\n )\n })}\n </pre>\n )\n }}\n </Highlight>\n )\n}\n\nCode.defaultProps = {\n item: {\n content: '',\n force: false,\n language: 'md',\n },\n}\n\nCode.propTypes = {\n item: PropTypes.shape({\n content: PropTypes.string,\n force: PropTypes.bool,\n language: PropTypes.string,\n }),\n}\n\nexport default Code\n","import PropTypes from 'prop-types'\nimport React from 'react'\n\nimport {IconTimes} from '../icons'\nimport {Placeholder} from '../form'\n\nfunction Loading({ onClose }) {\n return (\n <>\n <a\n href='/#'\n onClick={e => {\n e.preventDefault()\n onClose()\n }}\n >\n {' '}\n </a>\n <div className='colset-explorer'>\n <div className='left'>\n <div className='head'>\n <Placeholder width='70px' type='text' />\n </div>\n <div className='explorer-content'>\n <ul className='explorer-ul-placeholder'>\n <li>\n <Placeholder type='text' width='66px' />\n </li>\n <li>\n <Placeholder type='text' width='60px' />\n </li>\n <li>\n <Placeholder type='text' width='45px' />\n </li>\n <li>\n <Placeholder type='text' width='87px' />\n </li>\n <li>\n <Placeholder type='text' width='80px' />\n </li>\n <li>\n <Placeholder type='text' width='94px' />\n </li>\n <li>\n <Placeholder type='text' width='86px' />\n </li>\n </ul>\n </div>\n <div className='foot'>\n <Placeholder type='text' width='120px' />\n </div>\n </div>\n <div className='right'>\n <>\n <div className='head'>\n <Placeholder width='86px' type='text' />\n <div className='actions'>\n <Placeholder width='74px' type='text' />\n <Placeholder width='43px' type='text' />\n </div>\n <a\n href='/#'\n onClick={e => {\n e.preventDefault()\n onClose()\n }}\n className='close'\n >\n <IconTimes />\n </a>\n </div>\n <div className='content' />\n </>\n </div>\n </div>\n </>\n )\n}\n\nLoading.propTypes = {\n onClose: PropTypes.func.isRequired,\n}\n\nexport default Loading\n","import PropTypes from 'prop-types'\nimport get from 'lodash.get'\nimport React, {useEffect, useState} from 'react'\n\nimport {IconCaretDown, IconFile, IconFolder} from '../icons'\n\nfunction Tree({ tree, selected, onClickItem }) {\n const [folders, setFolders] = useState([])\n\n useEffect(() => {\n const treeToArray = map => {\n const recursive = (mapRec, acc) => {\n mapRec.forEach(item => {\n if (item.type === 'folder') {\n acc.push({\n filename: get(item, 'filename'),\n path: get(item, 'path'),\n hidden: get(item, 'hidden', false),\n })\n if (get(item, 'children')) {\n recursive(item.children, acc)\n }\n }\n })\n return acc\n }\n return recursive(map, [])\n }\n setFolders(treeToArray(tree.children))\n }, [tree, setFolders])\n\n const renderItem = (item, depth = 0) => {\n if (item.type === 'folder') {\n const folder = folders.find(f => f.path === item.path)\n const isHidden = get(folder, `hidden`, true)\n return (\n <li\n key={`li${item.path}`}\n className={`li-folder ${isHidden ? 'folder-hide' : ''}`}\n >\n <a\n href='/#'\n key={`s1${item.path}`}\n className={`folder level-${depth}`}\n onClick={e => {\n e.preventDefault()\n const newFolders = [...folders]\n const newFolder = newFolders.find(f => f.path === item.path)\n if (newFolder) {\n newFolder.hidden = !get(newFolder, `hidden`, true)\n setFolders(newFolders)\n }\n }}\n >\n <span key={`s2${item.path}`} className='text'>\n {get(item, 'children.length', 0) > 0 && <IconCaretDown />}\n <span key={`s3${item.path}`} className='icon'>\n <IconFolder key={`s4${item.path}`} />\n </span>\n {item.filename}\n </span>\n </a>\n {get(item, 'children') && (\n <ul className='ul' key={`ul${item.path}`}>\n {item.children.map(it => renderItem(it, depth + 1))}\n </ul>\n )}\n </li>\n )\n }\n // File\n const isDisabled = get(item, 'language') === null\n const isSelected = get(selected, 'path') === get(item, 'path')\n return (\n <li key={`li${item.path}`} className='li-file'>\n <a\n href='/#'\n key={`s1${item.path}`}\n tabIndex={`${isDisabled ? -1 : ''}`}\n className={`file level-${depth} ${isDisabled ? 'disabled' : ''} ${\n isSelected ? 'selected' : ''\n }`}\n onClick={e => {\n e.preventDefault()\n if (!isDisabled) {\n onClickItem(item)\n }\n }}\n >\n <span key={`s2${item.path}`} className='text'>\n <span key={`s3${item.path}`} className='icon'>\n <IconFile key={`s4${item.path}`} />\n </span>\n {item.filename}\n </span>\n </a>\n </li>\n )\n }\n\n return (\n <ul className='explorer-ul'>\n {tree.children.map(item => renderItem(item, 0))}\n </ul>\n )\n}\n\nTree.propTypes = {\n tree: PropTypes.shape({\n children: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.string,\n })\n ),\n }).isRequired,\n selected: PropTypes.shape({\n path: PropTypes.string.isRequired,\n }).isRequired,\n onClickItem: PropTypes.func.isRequired,\n}\n\nexport default Tree\n","import get from 'lodash.get'\n\nconst FILE_EXTENSION = {\n js: 'javascript',\n md: 'markdown',\n kt: 'kotlin',\n kts: 'kotlin',\n gradle: 'groovy',\n gitignore: 'git',\n java: 'java',\n xml: 'xml',\n properties: 'properties',\n groovy: 'groovy',\n html: 'html',\n css: 'css',\n}\n\nexport const getLanguage = file => {\n if (!file.includes(`.`)) {\n return null\n }\n const extension = file.split(`.`).pop()\n return get(FILE_EXTENSION, extension, null)\n}\n\nexport const createTree = (files, path, fileName, zip) => {\n return new Promise(resolve => {\n const recursive = (pfiles, ppath, pfileName, pzip, pdepth) => {\n const type = pfiles[ppath].dir ? 'folder' : 'file'\n const item = {\n type,\n filename: pfileName,\n path: `/${ppath}`,\n hidden: pdepth === 1 && type === 'folder' ? true : null,\n }\n if (type === 'folder') {\n const children = []\n pzip.folder(ppath).forEach((relativePath, file) => {\n const pathArray = relativePath.split('/')\n if (pathArray.length === 1 || (file.dir && pathArray.length === 2)) {\n children.push(\n recursive(\n pfiles,\n ppath + relativePath,\n relativePath,\n pzip,\n pdepth + 1\n )\n )\n }\n })\n item.children = children.sort((a, b) => (a.path > b.path ? 1 : -1))\n item.filename = pfileName.substring(0, pfileName.length - 1)\n } else {\n item.language = getLanguage(item.filename)\n if (item.language) {\n pfiles[ppath].async('string').then(content => {\n item.content = content\n })\n }\n }\n return item\n }\n const tree = recursive(files, path, fileName, zip, 0)\n const selected = tree.children.find(\n item =>\n ['pom.xml', 'build.gradle', 'build.gradle.kts','settings.gradle','settings.gradle.kts',].indexOf(item.filename) >\n -1\n )\n if (selected) {\n files[selected.path.substring(1)].async('string').then(content => {\n selected.content = content\n resolve({ tree, selected })\n })\n } else {\n resolve({ tree, selected: null })\n }\n })\n}\n\nexport const findRoot = zip => {\n const root = Object.keys(zip.files).filter(filename => {\n const pathArray = filename.split('/')\n if (zip.files[filename].dir && pathArray.length === 2) {\n return true\n }\n return false\n })[0]\n return root.substring(0, root.length - 1)\n}\n","import '../../../styles/explore.scss'\n\nimport FileSaver from 'file-saver'\nimport JSZip from 'jszip'\nimport Modal from 'react-responsive-modal'\nimport PropTypes from 'prop-types'\nimport get from 'lodash.get'\nimport React, {useContext, useEffect, useState} from 'react'\nimport {CopyToClipboard} from 'react-copy-to-clipboard'\nimport {toast} from 'react-toastify'\n\nimport Code from './Code'\nimport Loading from './Loading'\nimport Tree from './Tree'\nimport {AppContext} from '../../reducer/App'\nimport {IconFile, IconTimes} from '../icons'\nimport {createTree, findRoot} from '../../utils/Zip'\n\nfunction Explore({ open, onClose, projectName, blob }) {\n const [button, setButton] = useState('Copy')\n const [tree, setTree] = useState(null)\n const [selected, setSelected] = useState(null)\n const { dispatch, explore } = useContext(AppContext)\n\n useEffect(() => {\n const load = async () => {\n try {\n const zipJs = new JSZip()\n const { files } = await zipJs.loadAsync(blob).catch(() => {\n throw Error(`Could not load the ZIP project.`)\n })\n const path = `${findRoot({ files })}/`\n const result = await createTree(files, path, path, zipJs).catch(() => {\n throw Error(`Could not read the ZIP project.`)\n })\n setSelected(result.selected)\n setTree(result.tree)\n } catch (e) {\n dispatch({ type: 'EXPLORE_UPDATE', payload: { open: false } })\n toast.error(e.message)\n }\n }\n if (explore && blob) {\n load()\n }\n }, [explore, blob, dispatch])\n\n const onCopy = () => {\n setButton('Copied!')\n setTimeout(() => {\n setButton('Copy!')\n }, 3000)\n }\n\n const download = file => {\n const blobFile = new Blob([file.content], {\n type: 'text/plain;charset=utf-8',\n })\n FileSaver.saveAs(blobFile, file.filename)\n }\n\n const downloadZip = () => {\n FileSaver.saveAs(blob, projectName)\n }\n\n return (\n <div>\n <Modal\n open={open}\n onClose={() => {\n setSelected(null)\n onClose()\n }}\n showCloseIcon={false}\n classNames={{ modal: 'modal-explorer', overlay: 'overlay' }}\n >\n {tree && selected ? (\n <div className='colset-explorer'>\n <div className='left'>\n <div className='head'>\n <strong>{projectName}</strong>\n </div>\n <div className='explorer-content'>\n <Tree\n selected={selected}\n onClickItem={item => {\n setSelected(item)\n // onSelected(item)\n }}\n tree={tree}\n />\n </div>\n <div className='foot'>\n <a\n href='/#'\n onClick={e => {\n e.preventDefault()\n downloadZip()\n }}\n className='action'\n >\n 下载源码包\n </a>\n </div>\n </div>\n <div className='right'>\n {selected && (\n <>\n <div className='head'>\n <strong>\n <IconFile />\n {get(selected, 'filename')}\n </strong>\n <div className='actions'>\n <span className='divider'>|</span>\n <a\n href='/#'\n onClick={e => {\n e.preventDefault()\n download(selected)\n }}\n className='action'\n >\n Download\n </a>\n <span className='divider'>|</span>\n <CopyToClipboard\n onCopy={onCopy}\n text={get(selected, 'content', '')}\n >\n <a\n href='/#'\n onClick={e => {\n e.preventDefault()\n }}\n className='action'\n >\n {button}\n </a>\n </CopyToClipboard>\n {get(selected, 'language') === 'markdown' && (\n <>\n <span className='divider'>|</span>\n <a\n href='/#'\n onClick={e => {\n e.preventDefault()\n const newSelected = { ...selected }\n newSelected.force = !get(selected, 'force', false)\n setSelected(newSelected)\n }}\n className='action'\n >\n {get(selected, 'force', false)\n ? 'Preview'\n : 'View source'}\n </a>\n </>\n )}\n </div>\n <a\n href='/#'\n onClick={e => {\n e.preventDefault()\n onClose()\n }}\n className='close'\n >\n <IconTimes />\n </a>\n </div>\n <div className='explorer-content'>\n <Code item={selected} onChange={() => {}} />\n </div>\n </>\n )}\n </div>\n </div>\n ) : (\n <Loading onClose={onClose} />\n )}\n </Modal>\n </div>\n )\n}\n\nExplore.defaultProps = {\n projectName: '',\n blob: null,\n}\n\nExplore.propTypes = {\n open: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired,\n projectName: PropTypes.string,\n blob: PropTypes.instanceOf(Blob),\n}\n\nexport default Explore\n"],"sourceRoot":""}