diff --git a/asset-manifest.json b/asset-manifest.json index 6677c74b..8f9fe850 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "/react-code-preview/static/css/main.8036ca4a.css", - "main.js": "/react-code-preview/static/js/main.be9fe940.js", + "main.js": "/react-code-preview/static/js/main.19920c0d.js", "babel_vendors.js": "/react-code-preview/static/js/babel_vendors.f87158ba.js", "refractor-vendors.js": "/react-code-preview/static/js/refractor-vendors.4d929d76.js", "codemirror-vendors.js": "/react-code-preview/static/js/codemirror-vendors.66e75ab1.js", @@ -11,7 +11,7 @@ "static/js/499.25d3fdb3.js": "/react-code-preview/static/js/499.25d3fdb3.js", "index.html": "/react-code-preview/index.html", "main.8036ca4a.css.map": "/react-code-preview/static/css/main.8036ca4a.css.map", - "main.be9fe940.js.map": "/react-code-preview/static/js/main.be9fe940.js.map", + "main.19920c0d.js.map": "/react-code-preview/static/js/main.19920c0d.js.map", "babel_vendors.f87158ba.js.map": "/react-code-preview/static/js/babel_vendors.f87158ba.js.map", "refractor-vendors.4d929d76.js.map": "/react-code-preview/static/js/refractor-vendors.4d929d76.js.map", "codemirror-vendors.66e75ab1.js.map": "/react-code-preview/static/js/codemirror-vendors.66e75ab1.js.map", @@ -29,6 +29,6 @@ "static/js/react-vendors.f1f024a0.js", "static/js/499.25d3fdb3.js", "static/css/main.8036ca4a.css", - "static/js/main.be9fe940.js" + "static/js/main.19920c0d.js" ] } \ No newline at end of file diff --git a/coverage/badges.svg b/coverage/badges.svg index 0e6220fa..73319694 100644 --- a/coverage/badges.svg +++ b/coverage/badges.svg @@ -1,14 +1,14 @@ coverage: 0% - + - - + + - +

All files ErrorMessage.tsx

\ No newline at end of file +React Code Preview
\ No newline at end of file diff --git a/static/js/main.be9fe940.js b/static/js/main.19920c0d.js similarity index 99% rename from static/js/main.be9fe940.js rename to static/js/main.19920c0d.js index 27545b72..3e72460c 100644 --- a/static/js/main.be9fe940.js +++ b/static/js/main.19920c0d.js @@ -1,2 +1,2 @@ -(()=>{var e={5764:e=>{function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=()=>[],n.resolve=n,n.id=5764,e.exports=n},6609:(e,n,t)=>{"use strict";var o=t(350),r=t(1480),i=(t(9319),t(68)),d=t(2016);t(2695);const s="## React Code Preview\n\n\x3c!--dividing--\x3e\n\n[![Build & Deploy](https://github.com/uiwjs/react-code-preview/workflows/Build%20&%20Deploy/badge.svg)](https://github.com/uiwjs/react-code-preview/actions)\n[![Release](https://img.shields.io/github/release/uiwjs/react-code-preview)](https://github.com/uiwjs/react-code-preview/releases)\n[![npm version](https://img.shields.io/npm/v/@uiw/react-code-preview.svg)](https://www.npmjs.com/package/@uiw/react-code-preview)\n[![Gitee](https://jaywcjlove.github.io/sb/ico/gitee.svg)](https://uiw.gitee.io/react-code-preview/)\n\nCode edit preview for React. Preview Demo: https://uiwjs.github.io/react-code-preview\n\nThere are often a lot of sample code in the documentation. We hope that you can run the sample code to view the rendering interface as you read the document.\n\n## Install\n\n```bash\nnpm install @uiw/react-code-preview --save\n```\n\n## Usage\n\n### In React 18\n\n[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/uiw-react-code-preview-react-18-1bmhhd?fontsize=14&hidenavigation=1&theme=dark)\n\n```jsx\nimport Button from '@uiw/react-button';\nimport CodePreview from '@uiw/react-code-preview';\n\nconst code = `import Button from '@uiw/react-button';\nimport ReactDOM from 'react-dom/client';\n\nReactDOM.createRoot(_mount_).render(\n
\n \n \n
,\n);`;\n\nexport default function App() {\n return ;\n}\n```\n\n### In React 17\n\n[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/uiw-react-code-preview-react-17-t6ro9?fontsize=14&hidenavigation=1&theme=dark)\n\n```jsx\nimport Button from '@uiw/react-button';\nimport CodePreview from '@uiw/react-code-preview';\n\nconst code = `import Button from '@uiw/react-button';\nimport ReactDOM from 'react-dom';\n\nReactDOM.render(\n
\n \n \n
,\n _mount_\n);`;\n\nexport default function App() {\n return ;\n}\n```\n\n- `_mount_` Special strings, the compilation will be replaced.\n\n### Props\n\n```typescript\ninterface CodePreviewProps extends SplitProps {\n prefixCls?: string;\n style?: React.CSSProperties;\n /**\n * To specify a CSS class, use the className attribute.\n */\n className?: string;\n /**\n * Whether to display the border.\n */\n bordered?: boolean;\n /**\n * `JSX` source code\n */\n code?: string;\n /**\n * Whether to display the code interface.\n */\n noCode?: boolean;\n /**\n * Is the background white or plaid?\n */\n bgWhite?: boolean;\n /**\n * Only show Edit\n */\n onlyEdit?: boolean;\n /**\n * Whether to display the preview interface.\n */\n noPreview?: boolean;\n /**\n * Preview area does not display scroll bars\n */\n noScroll?: boolean;\n /**\n * Modify ReactCodemirror props.\n */\n editProps?: ReactCodeMirrorProps;\n /**\n * Dependent component\n */\n dependencies?: Record;\n codePenOption?: CodepenProps & {\n /**\n * Packages that do not require comments.\n * @example ['uiw']\n */\n includeModule?: string[];\n };\n codeSandboxOption?: CodeSandboxProps;\n /** @default 'Code' */\n btnText?: string;\n /** @default 'Hide Editor' */\n btnHideText?: string;\n /**\n * `light` / `dark` / `Extension` Defaults to `light`.\n * @default light\n */\n theme?: ReactCodeMirrorProps['theme'];\n}\n```\n\n```typescript\ntype CodePenOption = {\n title?: string;\n html?: string;\n js?: string;\n css?: string;\n editors?: string;\n css_external?: string;\n js_external?: string;\n js_pre_processor?: string;\n};\ntype CodepenProps = CodePenOption & React.FormHTMLAttributes;\n```\n\n```typescript\ntype CodeSandboxProps = React.FormHTMLAttributes & {\n /**\n * Whether we should redirect to the embed instead of the editor.\n */\n embed?: boolean;\n /**\n * The query that will be used in the redirect url. `embed` must be equal to `true`, `embed=true`.\n * [CodeSandbox Embed Options](https://codesandbox.io/docs/embedding#embed-options)\n * @example `view=preview&runonclick=1`\n */\n query?: string;\n /**\n * Instead of redirecting we will send a JSON reponse with `{\"sandbox_id\": sandboxId}`.\n */\n json?: boolean;\n /**\n * Parameters used to define how the sandbox should be created.\n */\n files?: Record<\n string,\n {\n content?: string | Record;\n isBinary?: boolean;\n }\n >;\n};\n```\n\n## Development\n\nThe components are placed in the [`src`](./src) directory.\n\n```bash\nnpm run watch # Listen compile .tsx files.\nnpm run build # compile .tsx files.\n\nnpm run doc\n```\n\n### Related\n\n- [@uiw/react-markdown-preview](https://github.com/uiwjs/react-markdown-preview): React component preview markdown text in web browser.\n- [@uiw/react-codemirror](https://github.com/uiwjs/react-codemirror): CodeMirror component for React. @codemirror\n- [@uiw/react-monacoeditor](https://github.com/jaywcjlove/react-monacoeditor): Monaco Editor component for React.\n- [@uiw/react-markdown-editor](https://github.com/uiwjs/react-markdown-editor): A markdown editor with preview, implemented with React.js and TypeScript.\n- [@uiw/react-md-editor](https://github.com/uiwjs/react-md-editor): A simple markdown editor with preview, implemented with React.js and TypeScript.\n\n## Contributors\n\nAs always, thanks to our amazing contributors!\n\n\n \n\n\nMade with [github-action-contributors](https://github.com/jaywcjlove/github-action-contributors).\n\n### License\n\nLicensed under the MIT License.\n",c="App_warpper__3j1r1",a="App_title__Uj2m0";var l=t(8168),u=t(8587),p=t(119),h=t(2716),m=t.n(h),w=t(9554),C=t(7267),b=t(4973),v=t(8021),g=t(382),L=["includeModule"];const x=e=>{var{codePenOption:n,codeSandboxOption:t,prefixCls:o}=e||{},r=n||{},{includeModule:i}=r,d=(0,u.A)(r,L);if(d&&d.js){var s=(i||[]).join("|");d.js=d.js.replace(/import([\s\S]*?)(?=['"])['"].*['"]( *;|;)?/gm,(e=>s&&new RegExp("from\\s+['\"]("+s+")['\"](s.+)?;?").test(e)?e:"/** "+e+" **/"))}return(0,g.jsxs)("div",{className:o+"-thirdparty",children:[n&&(0,g.jsx)(v.A,(0,l.A)({},d,{children:(0,g.jsx)("svg",{height:"12",fill:"currentColor",viewBox:"0 0 69 69",children:(0,g.jsx)("path",{d:"M68.974125,23.6022271 C68.9669375,23.556228 68.956875,23.5159788 68.951125,23.4728545 C68.9369583,23.3892382 68.9192128,23.3062677 68.8979375,23.2241717 C68.885,23.1752977 68.8663125,23.127861 68.8505,23.0804244 C68.8278442,23.0077868 68.8029153,22.9358778 68.77575,22.8648035 C68.7562939,22.8157401 68.7342205,22.7677555 68.709625,22.7210562 C68.6804108,22.6530301 68.6463004,22.5872128 68.6075625,22.5241224 C68.5816874,22.4766857 68.5515,22.4321241 68.52275,22.386125 C68.4142531,22.2169066 68.2885197,22.0593814 68.1475625,21.9160713 C68.10875,21.8772595 68.0728125,21.8355728 68.0325625,21.8010735 C67.9775701,21.7523865 67.9214935,21.704938 67.864375,21.6587636 C67.818375,21.6242643 67.77525,21.589765 67.72925,21.5581406 L67.680375,21.5207662 L36.1445,0.497723998 C35.1485978,-0.165907999 33.8514022,-0.165907999 32.8555,0.497723998 L1.32106248,21.5207662 L1.27218748,21.5581406 C1.16574994,21.6321432 1.06485681,21.713817 0.970312494,21.8025109 C0.928625004,21.8355728 0.891249961,21.8772595 0.850999999,21.9160713 C0.800687478,21.9678203 0.750375025,22.0224443 0.704374952,22.0770683 C0.618968308,22.1722554 0.543358166,22.275796 0.47868744,22.386125 L0.392437472,22.5241224 C0.355916851,22.587711 0.322339729,22.6529454 0.291812498,22.7196187 C0.235417041,22.8356642 0.187844895,22.9557936 0.149499967,23.0789869 C0.133687434,23.127861 0.11643744,23.1752977 0.103499962,23.2241717 C0.0819374527,23.3046702 0.0675624468,23.3880436 0.0517499808,23.4728545 C0.0431249503,23.5159787 0.0330624597,23.5562279 0.0273124842,23.6022271 C0.0114999508,23.7272873 0,23.8566599 0,23.9874699 L0,45.0105121 C0,45.1398847 0.0115000182,45.2692572 0.0287499444,45.3986298 C0.0330624597,45.4403165 0.0431249503,45.4834407 0.0517499808,45.5265649 C0.0661249867,45.6113758 0.0819374527,45.6918743 0.103499962,45.7752478 C0.11643744,45.8241218 0.133687434,45.8715585 0.149499967,45.918995 C0.172499936,45.9908687 0.195499972,46.0627423 0.227124972,46.1360534 C0.245812493,46.1849275 0.27024999,46.2309267 0.290374971,46.2798007 C0.323437498,46.3459245 0.355062497,46.4106108 0.392437472,46.478172 C0.421187484,46.5227337 0.448499968,46.5687328 0.47868744,46.6132945 C0.585037244,46.7827707 0.710436736,46.9395172 0.852437459,47.0804732 C0.979968483,47.2145679 1.12112666,47.3350078 1.27362494,47.4398414 L1.32106248,47.4786532 L32.8555,68.5016954 C33.8511677,69.1661015 35.1488322,69.1661015 36.1445,68.5016954 L67.680375,47.4786532 L67.72925,47.4412789 C67.77525,47.4096545 67.818375,47.3751552 67.864375,47.3406558 C67.9215088,47.2940078 67.9775854,47.2460798 68.0325625,47.1969085 C68.0728125,47.1609716 68.10875,47.1221599 68.1475625,47.0819107 C68.2902677,46.9406867 68.4161661,46.7834372 68.52275,46.6132945 C68.5515,46.5672953 68.5816874,46.5227337 68.6075625,46.478172 C68.646375,46.4106108 68.6794375,46.3459245 68.7081875,46.2798007 C68.732625,46.2309267 68.7570625,46.1849275 68.77575,46.1360534 C68.8045,46.0641798 68.8275,45.9908687 68.8505,45.918995 C68.8663125,45.8715584 68.885,45.8241218 68.8979375,45.7752478 C68.9195,45.6918743 68.9353125,45.6113759 68.951125,45.5265649 C68.956875,45.4834407 68.9669375,45.4403165 68.974125,45.4000673 C68.991375,45.2706947 69,45.1413222 69,45.0119496 L69,23.9889074 C69,23.8566599 68.991375,23.7272873 68.974125,23.6022271 Z M38,9 L61,24.1907448 L50.7281277,31 L38.0014231,22.5649276 L38.0014231,9 L38,9 Z M30.997154,9 L30.997154,22.5649276 L18.2740828,31 L8,24.1907448 L31,9 L30.997154,9 Z M6,29 L13,34 L6,39 L6,29 L6,29 Z M31,60 L8,44.8082815 L18.2732954,38 L30.9971538,46.434203 L30.9971538,60 L31,60 Z M34.4985607,41 L24,34 L34.4985607,27 L45,34 L34.4985607,41 Z M38,60 L38,46.4333333 L50.7268564,38 L61,44.8073077 L38,60 L38,60 Z M63,39 L56,34 L63,29 L63,39 L63,39 Z"})})})),t&&(0,g.jsx)(b.A,(0,l.A)({},t,{children:(0,g.jsx)("svg",{height:"12",fill:"currentColor",viewBox:"0 0 69 69",children:(0,g.jsx)("path",{d:"M32,38.2764838 L11,24 L11,35.7160031 L22.0526316,43.2306536 L22.0526316,54.3200601 L32,60 L32,38.2764838 Z M38,38.2764838 L38,60 L47.9473684,54.3200601 L47.9473684,43.2306536 L59,35.7160031 L59,24 L38,38.2764838 Z M46.296506,13 L35.5021904,21.0761293 L24.7078748,13.004586 L15,18.6913552 L35.5021904,33 L56,18.6913552 L46.296506,13.004586 L46.296506,13 Z M37.1676303,0.571217481 L63.7371606,15.5989936 C65.1342563,16.3900364 66,17.8813846 66,19.4990592 L66,49.4964682 C66.0011469,51.1157433 65.1356391,52.6091811 63.7371606,53.4010064 L37.1676303,68.4287825 C35.8224939,69.1904058 34.1819333,69.1904058 32.8367968,68.4287825 L6.26726663,53.4010064 C4.86707992,52.6103421 4,51.1166819 4,49.4964682 L4,19.4990592 C4,17.8813846 4.86574257,16.3900364 6.26283836,15.5989936 L32.8323686,0.571217481 C34.1775051,-0.190405827 35.8180656,-0.190405827 37.1632021,0.571217481 L37.1676303,0.571217481 Z"})})}))]})};var f=(0,g.jsx)("svg",{viewBox:"0 0 176 176",children:(0,g.jsx)("path",{d:"M40.25 8.8817842e-15 5.25 8.8817842e-15C2.35 8.8817842e-15 0 2.35 0 5.25L0 40.15C0 40.175 0 40.2 0 40.225 0 43.1375 2.35 45.4875 5.25 45.4875 8.15 45.4875 10.525 43.1375 10.525 40.225 10.525 39.925 10.475 39.6125 10.425 39.325L10.425 11.35C10.425 10.8625 10.8125 10.475 11.2875 10.475L39.6875 10.475C39.875 10.4875 40.0625 10.525 40.25 10.525 43.15 10.525 45.5125 8.175 45.5125 5.2625 45.5125 2.35 43.15 8.8817842e-15 40.25 8.8817842e-15ZM143.136561 140.373919C143.136561 142.009731 141.787547 143.3375 140.162358 143.3375L34.0895201 143.3375C32.4537083 143.3375 31.1259389 142.009731 31.1259389 140.373919L31.1259389 34.3117033C31.1259389 32.6652693 32.4537083 31.3375 34.0895201 31.3375L140.162358 31.3375C141.787547 31.3375 143.136561 32.6652693 143.136561 34.3117033L143.136561 140.373919ZM134.725 3.55271368e-15 169.725 3.55271368e-15C172.625 3.55271368e-15 174.975 2.35 174.975 5.25L174.975 40.15C174.975 40.175 175 40.2 175 40.225 175 43.1375 172.6375 45.4875 169.725 45.4875 166.8125 45.4875 164.4625 43.1375 164.4625 40.225 164.4625 39.925 164.5125 39.6125 164.55 39.325L164.55 11.35C164.55 10.8625 164.175 10.475 163.675 10.475L135.2875 10.475C135.0875 10.4875 134.925 10.525 134.725 10.525 131.825 10.525 129.475 8.175 129.475 5.2625 129.475 2.35 131.825 3.55271368e-15 134.725 3.55271368e-15ZM40.25 174.975 5.25 174.975C2.35 174.975 0 172.6375 0 169.7375L0 134.825C0 134.8 0 134.775 0 134.75 0 131.8375 2.35 129.475 5.25 129.475 8.15 129.475 10.525 131.825 10.525 134.75 10.525 135.05 10.475 135.3625 10.425 135.65L10.425 163.6125C10.425 164.1 10.8125 164.4875 11.2875 164.4875L39.6875 164.4875C39.875 164.475 40.05 164.4375 40.2375 164.4375 43.1375 164.4375 45.5 166.7875 45.5 169.7 45.5 172.6125 43.15 174.975 40.25 174.975ZM134.725 174.975 169.725 174.975C172.625 174.975 174.975 172.625 174.975 169.7375L174.975 134.825C174.975 134.8 175 134.775 175 134.75 175 131.8375 172.6375 129.475 169.725 129.475 166.8125 129.475 164.4625 131.825 164.4625 134.75 164.4625 135.05 164.5125 135.3625 164.55 135.65L164.55 163.6125C164.55 164.1 164.175 164.4875 163.675 164.4875L135.2875 164.4875C135.0875 164.475 134.925 164.4375 134.725 164.4375 131.825 164.4375 129.475 166.7875 129.475 169.7 129.475 172.6125 131.825 174.975 134.725 174.975Z",transform:"translate(.5 .512)"})}),j=(0,g.jsx)("svg",{viewBox:"0 0 170 185",children:(0,g.jsx)("path",{d:"M153.846154,-3.55271368e-15 L53.8461537,-3.55271368e-15 C45.3846152,-3.55271368e-15 38.4615385,6.92307695 38.4615385,15.3846154 L38.4615385,23.0769232 L130.769231,23.0769232 C139.230769,23.0769232 146.153846,30 146.153846,38.4615385 L146.153846,146.153846 L153.846154,146.153846 C162.307692,146.153846 169.230769,139.230769 169.230769,130.769231 L169.230769,15.3846154 C169.230769,6.92307695 162.307692,-3.55271368e-15 153.846154,-3.55271368e-15 Z M130.769231,53.8461539 C130.769231,45.3846154 123.846154,38.4615385 115.384615,38.4615385 L15.3846154,38.4615385 C6.92307695,38.4615385 3.55271368e-15,45.3846154 3.55271368e-15,53.8461539 L3.55271368e-15,169.230769 C3.55271368e-15,177.692308 6.92307695,184.615385 15.3846154,184.615385 L115.384615,184.615385 C123.846154,184.615385 130.769231,177.692308 130.769231,169.230769 L130.769231,53.8461539 Z M61.5384615,80.7692309 C61.5384615,83.0769232 60,84.6153848 57.6923076,84.6153848 L26.923077,84.6153848 C24.6153846,84.6153848 23.076923,83.0769232 23.076923,80.7692309 L23.076923,73.0769232 C23.076923,70.7692309 24.6153846,69.2307693 26.923077,69.2307693 L57.6923076,69.2307693 C60,69.2307693 61.5384615,70.7692309 61.5384615,73.0769232 L61.5384615,80.7692309 Z M92.3076922,142.307692 C92.3076922,144.615385 90.7692307,146.153846 88.4615385,146.153846 L26.923077,146.153846 C24.6153846,146.153846 23.076923,144.615385 23.076923,142.307692 L23.076923,134.615385 C23.076923,132.307692 24.6153846,130.769231 26.923077,130.769231 L88.4615385,130.769231 C90.7692309,130.769231 92.3076922,132.307692 92.3076922,134.615385 L92.3076922,142.307692 L92.3076922,142.307692 Z M107.692308,111.538462 C107.692308,113.846154 106.153846,115.384615 103.846154,115.384615 L26.923077,115.384615 C24.6153846,115.384615 23.076923,113.846154 23.076923,111.538462 L23.076923,103.846154 C23.076923,101.538462 24.6153846,100 26.923077,100 L103.846154,100 C106.153846,100 107.692308,101.538462 107.692308,103.846154 L107.692308,111.538462 L107.692308,111.538462 Z"})}),S=(0,g.jsx)("svg",{viewBox:"0 0 170 185",children:(0,g.jsx)("path",{d:"M153.846154,-3.55271368e-15 L53.8461537,-3.55271368e-15 C45.3846152,-3.55271368e-15 38.4615385,6.92307695 38.4615385,15.3846154 L38.4615385,23.0769232 L130.769231,23.0769232 C139.230769,23.0769232 146.153846,30 146.153846,38.4615385 L146.153846,146.153846 L153.846154,146.153846 C162.307692,146.153846 169.230769,139.230769 169.230769,130.769231 L169.230769,15.3846154 C169.230769,6.92307695 162.307692,-3.55271368e-15 153.846154,-3.55271368e-15 Z M130.769231,53.8461539 C130.769231,45.3846154 123.846154,38.4615385 115.384615,38.4615385 L15.3846154,38.4615385 C6.92307695,38.4615385 3.55271368e-15,45.3846154 3.55271368e-15,53.8461539 L3.55271368e-15,169.230769 C3.55271368e-15,177.692308 6.92307695,184.615385 15.3846154,184.615385 L115.384615,184.615385 C123.846154,184.615385 130.769231,177.692308 130.769231,169.230769 L130.769231,53.8461539 Z M106.941858,105.608333 C110.211682,102.450235 115.409229,102.495402 118.623676,105.709849 C121.838122,108.924296 121.883289,114.121842 118.725191,117.391667 L118.725191,117.391667 L72.8918576,163.225 C69.6376921,166.478183 64.3626897,166.478183 61.1085242,163.225 L61.1085242,163.225 L31.9418576,134.058333 C28.7837592,130.788509 28.828926,125.590962 32.0433729,122.376515 C35.2578198,119.162069 40.4553662,119.116902 43.7251908,122.275 L43.7251908,122.275 L67.0001908,145.55 Z M57.6923076,69.2307693 C60,69.2307693 61.5384615,70.7692309 61.5384615,73.0769232 L61.5384615,80.7692309 C61.5384615,83.0769232 60,84.6153848 57.6923076,84.6153848 L26.923077,84.6153848 C24.6153846,84.6153848 23.076923,83.0769232 23.076923,80.7692309 L23.076923,73.0769232 C23.076923,70.7692309 24.6153846,69.2307693 26.923077,69.2307693 L57.6923076,69.2307693 Z",transform:"translate(1)"})});function y(e){var{message:n}=e;return(0,o.useMemo)((()=>n?(0,g.jsx)("pre",{children:(0,g.jsx)("code",{children:n})}):null),[n])}var M=t(6900),k=t(9126);var P=t(6271),O=["React","ReactDOM","ReactDOMClient"];function R(e){var[n,r]=(0,o.useState)(),i=(0,o.useRef)(""+parseInt(String(1e9*Math.random()),10).toString(36)),[d,s]=(0,o.useState)(!1),[c,a]=(0,o.useState)(""),[p,h]=(0,o.useState)(!1),[m,w]=(0,o.useState)(1),[C,b]=(0,o.useState)(!1),[v,g]=(0,o.useState)(e.code||""),L=o.useMemo((()=>window.ReactDOM?window.ReactDOM:(()=>{var e;try{e=t(1480)}catch(n){}return e})()),[]),x=o.useRef(new Map([])),f=n=>{var t=e.dependencies||{},{React:r,ReactDOM:d,ReactDOMClient:s}=t,c=(0,u.A)(t,O),p=s||L||d||P,h=Reflect.has(p,"createRoot"),m=h?(e=>({createRoot:n=>({render:t=>{var o=x.current,r=o.get(n);r?r.render(t):((r=e.createRoot(document.getElementById(n))).render(t),o.set(n,r)),x.current=o}})}))(p):p;try{var w=(0,l.A)({React:r||o},c,{ReactDOM:m}),C=[],b=[];for(var v in w)C.push(v),b.push(w[v]);var g=""+(n=h?(n=(n=n.replace("ReactDOM.render",'ReactDOM.createRoot("'+i.current+'").render')).replace("ReactDOM.createRoot(_mount_)",'ReactDOM.createRoot("'+i.current+'")')).replace("_mount_",""):n.replace("_mount_","document.getElementById('"+i.current+"')")),{code:f}=function(e){return(0,M.transform)(e,{presets:["env","es2015","react"],plugins:[[k.A,{removeAll:!0}]]})}(g);C.push(f||""),new Function(...C).apply(null,b),a("")}catch(S){var j="";j=S&&S.message?S.message:JSON.stringify(S),a(j)}};return(0,o.useEffect)((()=>f(v)),[v,e.noPreview,n]),{playerId:i,demoDom:n,setDemoDom:r,fullScreen:d,setFullScreen:s,errorMessage:c,setErrorMessage:a,width:m,setWidth:w,showEdit:p,setShowEdit:h,copied:C,setCopied:b,code:v,setCode:g,executeCode:f}}var _=["style","prefixCls","className","theme","editProps","codePenOption","codeSandboxOption","code","dependencies","btnText","btnHideText","onlyEdit","bordered","noCode","noPreview","noScroll","bgWhite"],B=o.forwardRef(((e,n)=>{var{style:t,prefixCls:r="w-code-preview",className:i,theme:d="light",editProps:s={},codePenOption:c,codeSandboxOption:a,code:h="",dependencies:b={},btnText:v="Code",btnHideText:L="Hide Editor",onlyEdit:M=!1,bordered:k=!0,noCode:P=!1,noPreview:O=!1,noScroll:B=!1,bgWhite:E=!1}=e,D=(0,u.A)(e,_),{playerId:A,setDemoDom:T,code:Z,setCode:N,fullScreen:I,setFullScreen:W,errorMessage:F,width:H,setWidth:q,showEdit:U,setShowEdit:z,copied:J,setCopied:G}=R((0,l.A)({code:h,dependencies:b},e)),Q=(0,o.useRef)(null),X=(0,o.useRef)(null);(0,o.useImperativeHandle)(n,(()=>({editor:X,demo:Q.current})),[X,Q]);var $=!(!P&&!O)&&(!P||!O),K=1!==H&&[$?1:2],V=[i,r,B?r+"-noScroll":null,$?r+"-OneItem":null,k?r+"-bordered":null,I?r+"-fullScreen":null].filter(Boolean).join(" ").trim();(0,o.useEffect)((()=>N(h)),[h]),(0,o.useEffect)((()=>{Q.current&&T(Q.current),window.addEventListener("popstate",(e=>{document.body.style.overflow="inherit"}),!1)}),[]);var Y=()=>z(1!==H);(0,o.useEffect)((()=>{var e=Q.current;return e&&e.addEventListener("transitionend",Y),()=>{e&&e.removeEventListener("transitionend",Y)}}),[H]);return(0,g.jsxs)(C.A,(0,l.A)({"data-color-mode":d,visiable:K,className:V,style:(0,l.A)({flex:1},t)},D,{children:[!O&&!M&&(0,g.jsxs)("div",{className:[r+"-demo",E?null:r+"-demo-bgPlaid",F?r+"-demo-error":null].filter(Boolean).join(" ").trim(),style:(0,l.A)({flex:1},1===H?{width:"100%"}:{}),children:[(0,g.jsx)(y,{message:F}),(0,g.jsx)("div",{className:[r+"-demo-source",F?"error":null].filter(Boolean).join(" ").trim(),id:A.current})]}),(!P||M)&&(0,g.jsx)("div",{ref:Q,style:{overflow:"hidden",width:M?"100%":H},children:(U||M)&&(0,g.jsx)(p.Ay,(0,l.A)({value:(Z||"").replace(/\n$/,""),ref:X,theme:d,extensions:[(0,w.Q2)({jsx:!0})]},s,{style:{height:"100%"},height:"100%",onChange:(e,n)=>{N(e),s&&s.onChange&&s.onChange(e,n)}}))}),!$&&!(P&&O)&&!M&&(0,g.jsxs)("div",{style:{flex:1,width:29},className:r+"-bar",children:[(0,g.jsx)(x,{prefixCls:r,codePenOption:c,codeSandboxOption:a}),(0,g.jsx)("div",{className:r+"-bar-btn",onClick:()=>{q(1===H?"50%":1),z(!0)},children:1===H?v:L}),(0,g.jsx)("div",{className:[r+"-bar-iconbtns",J?r+"-bar-copied":null].filter(Boolean).join(" ").trim(),onClick:()=>{m()(Z||"",(e=>G(e))),setTimeout((()=>G(!1)),2e3)},children:J?S:j}),(0,g.jsx)("div",{className:[r+"-bar-iconbtns",I?r+"-bar-copied":null].filter(Boolean).join(" ").trim(),onClick:()=>{W(!I),document.body.style.overflow=I?"inherit":"hidden",!I&&Q.current&&(Q.current.style.maxWidth="inherit")},children:f})]})]}))}));B.displayName="CodePreview";const E=B;var D=t(8406);const A=()=>{const[e,n]=(0,o.useState)("light"),[t]=(0,o.useState)('\nimport { Button, Divider, Icon } from \'uiw\';\nimport ReactDOM from \'react-dom/client\';\n\nReactDOM.createRoot(_mount_).render(\n
\n \n \n \n \n \n \n
,\n);'),[r,i]=(0,o.useState)({bgWhite:!1,noCode:!1,noScroll:!1,noPreview:!1,bordered:!0,codeSandbox:{files:{"sandbox.config.json":{content:'{\n "template": "node",\n "container": {\n "startScript": "start",\n "node": "14"\n }\n }'},"public/index.html":{content:'
'},"src/index.js":{content:t.replace("_mount_",'document.getElementById("root")')},"src/index.less":{content:""},".kktrc.js":{content:'import webpack from "webpack";\nimport lessModules from "@kkt/less-modules";\nexport default (conf, env, options) => {\nconf = lessModules(conf, env, options);\nreturn conf;\n};'},"package.json":{content:{dependencies:{react:"latest","react-dom":"latest",uiw:"latest"},devDependencies:{"@kkt/less-modules":"6.0.11",kkt:"6.0.11",typescript:"4.1.3"},scripts:{start:"kkt start",build:"kkt build",test:"kkt test --env=jsdom"},browserslist:[">0.2%","not dead","not ie <= 11","not op_mini all"]}}}},codeSandboxShow:!0,codePenShow:!0,codePen:{includeModule:["uiw"],title:"React Code Preview - demo",html:'
',js:t.replace("_mount_",'document.getElementById("root")'),css_external:"https://unpkg.com/uiw@3.2.6/dist/uiw.min.css",js_external:"https://unpkg.com/react@18.x/umd/react.development.js;https://unpkg.com/react-dom@18.x/umd/react-dom.development.js;https://unpkg.com/uiw@4.7.2/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.12/index.js"}});function d(e,n){const t={...r,["".concat(e)]:n.target.checked};i({...t})}return(0,o.useEffect)((()=>{n("dark"===document.documentElement.getAttribute("data-color-mode")?"dark":"light"),document.addEventListener("colorschemechange",(e=>{n(e.detail.colorScheme)}))}),[]),(0,g.jsxs)(o.Fragment,{children:[(0,g.jsx)(E,{code:t,theme:e,dependencies:{...D},bordered:r.bordered,noScroll:r.noScroll,bgWhite:r.bgWhite,noCode:r.noCode,editProps:{onChange:e=>{i({...r,codeSandbox:{...r.codeSandbox,files:{...r.codeSandbox.files,"src/index.js":{content:e}}},codePen:{...r.codePen,js:e}})}},noPreview:r.noPreview,codeSandboxOption:r.codeSandboxShow?r.codeSandbox:void 0,codePenOption:r.codePenShow?r.codePen:void 0}),(0,g.jsxs)("div",{children:[(0,g.jsxs)(D.Switch,{"data-checked":"\u683c\u7eb9","data-unchecked":"\u767d\u8272",checked:r.bgWhite,onChange:d.bind(void 0,"bgWhite"),children:["\u80cc\u666f `bgWhite=",r.bgWhite.toString(),"`"]}),(0,g.jsx)("br",{}),(0,g.jsxs)(D.Switch,{"data-checked":"\u663e\u793a","data-unchecked":"\u9690\u85cf",checked:r.noCode,onChange:d.bind(void 0,"noCode"),children:["\u662f\u5426\u663e\u793a\u4ee3\u7801 `noCode=",r.noCode.toString(),"`"]}),(0,g.jsx)("br",{}),(0,g.jsxs)(D.Switch,{"data-checked":"\u663e\u793a","data-unchecked":"\u9690\u85cf",checked:r.noPreview,onChange:d.bind(void 0,"noPreview"),children:["\u662f\u5426\u663e\u793a\u5b9e\u4f8b\u9884\u89c8 `noPreview=",r.noPreview.toString(),"`"]}),(0,g.jsx)("br",{}),(0,g.jsxs)(D.Switch,{"data-checked":"\u8d85\u51fa\u6eda\u52a8","data-unchecked":"\u9ad8\u5ea6\u81ea\u9002\u5e94",checked:r.noScroll,onChange:d.bind(void 0,"noScroll"),children:["\u662f\u5426\u663e\u793a\u6eda\u52a8\u6761 `noScroll=",r.noScroll.toString(),"`"]}),(0,g.jsx)("br",{}),(0,g.jsxs)(D.Switch,{checked:r.bordered,onChange:d.bind(void 0,"bordered"),children:["\u662f\u5426\u663e\u793a\u8fb9\u6846 `bordered=",r.bordered.toString(),"`"]}),(0,g.jsx)("br",{}),(0,g.jsxs)(D.Switch,{checked:r.codePenShow,onChange:d.bind(void 0,"codePenShow"),children:["\u662f\u5426\u663e\u793a CodePen \u6309\u94ae `codePenOption=",r.codePenShow?"{...}":"undefined","`"]}),(0,g.jsx)("br",{}),(0,g.jsxs)(D.Switch,{checked:r.codeSandboxShow,onChange:d.bind(void 0,"codeSandboxShow"),children:["\u662f\u5426\u663e\u793a CodeSandbox \u6309\u94ae `codeSandboxOption=",r.codeSandboxShow?"{...}":"undefined","`"]})]})]})},T="5.1.2";function Z(){const e=T;let n=s;return n&&(n=s.replace(/([\s\S]*)/,"")),(0,g.jsxs)("div",{className:c,children:[(0,g.jsx)("dark-mode",{light:"Light",dark:"Dark",style:{position:"fixed",left:10,top:5}}),(0,g.jsx)(i.A,{fixed:!0,href:"https://github.com/uiwjs/react-code-preview",target:"__blank"}),(0,g.jsxs)("h1",{className:a,children:["React Code Preview ",(0,g.jsx)("sup",{children:e})]}),(0,g.jsx)(A,{}),(0,g.jsx)(d.A,{style:{paddingTop:25},source:n})]})}r.createRoot(document.getElementById("root")).render((0,g.jsx)(o.StrictMode,{children:(0,g.jsx)(Z,{})}))}},n={};function t(o){var r=n[o];if(void 0!==r)return r.exports;var i=n[o]={exports:{}};return e[o].call(i.exports,i,i.exports,t),i.exports}t.m=e,(()=>{var e=[];t.O=(n,o,r,i)=>{if(!o){var d=1/0;for(l=0;l=i)&&Object.keys(t.O).every((e=>t.O[e](o[c])))?o.splice(c--,1):(s=!1,i0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[o,r,i]}})(),t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},t.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={792:0};t.O.j=n=>0===e[n];var n=(n,o)=>{var r,i,d=o[0],s=o[1],c=o[2],a=0;if(d.some((n=>0!==e[n]))){for(r in s)t.o(s,r)&&(t.m[r]=s[r]);if(c)var l=c(t)}for(n&&n(o);at(6609)));o=t.O(o)})(); -//# sourceMappingURL=main.be9fe940.js.map \ No newline at end of file +(()=>{var e={5764:e=>{function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=()=>[],n.resolve=n,n.id=5764,e.exports=n},6609:(e,n,t)=>{"use strict";var o=t(350),r=t(1480),i=(t(9319),t(68)),d=t(2016);t(2695);const s="## React Code Preview\n\n\x3c!--dividing--\x3e\n\n[![Build & Deploy](https://github.com/uiwjs/react-code-preview/workflows/Build%20&%20Deploy/badge.svg)](https://github.com/uiwjs/react-code-preview/actions)\n[![Release](https://img.shields.io/github/release/uiwjs/react-code-preview)](https://github.com/uiwjs/react-code-preview/releases)\n[![npm version](https://img.shields.io/npm/v/@uiw/react-code-preview.svg)](https://www.npmjs.com/package/@uiw/react-code-preview)\n[![Gitee](https://jaywcjlove.github.io/sb/ico/gitee.svg)](https://uiw.gitee.io/react-code-preview/)\n\nCode edit preview for React. Preview Demo: https://uiwjs.github.io/react-code-preview\n\nThere are often a lot of sample code in the documentation. We hope that you can run the sample code to view the rendering interface as you read the document.\n\n## Install\n\n```bash\nnpm install @uiw/react-code-preview --save\n```\n\n## Usage\n\n### In React 18\n\n[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/uiw-react-code-preview-react-18-1bmhhd?fontsize=14&hidenavigation=1&theme=dark)\n\n```jsx\nimport Button from '@uiw/react-button';\nimport CodePreview from '@uiw/react-code-preview';\n\nconst code = `import Button from '@uiw/react-button';\nimport ReactDOM from 'react-dom/client';\n\nReactDOM.createRoot(_mount_).render(\n
\n \n \n
,\n);`;\n\nexport default function App() {\n return ;\n}\n```\n\n### In React 17\n\n[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/uiw-react-code-preview-react-17-t6ro9?fontsize=14&hidenavigation=1&theme=dark)\n\n```jsx\nimport Button from '@uiw/react-button';\nimport CodePreview from '@uiw/react-code-preview';\n\nconst code = `import Button from '@uiw/react-button';\nimport ReactDOM from 'react-dom';\n\nReactDOM.render(\n
\n \n \n
,\n _mount_\n);`;\n\nexport default function App() {\n return ;\n}\n```\n\n- `_mount_` Special strings, the compilation will be replaced.\n\n### Props\n\n```typescript\ninterface CodePreviewProps extends SplitProps {\n prefixCls?: string;\n style?: React.CSSProperties;\n /**\n * To specify a CSS class, use the className attribute.\n */\n className?: string;\n /**\n * Whether to display the border.\n */\n bordered?: boolean;\n /**\n * `JSX` source code\n */\n code?: string;\n /**\n * Whether to display the code interface.\n */\n noCode?: boolean;\n /**\n * Is the background white or plaid?\n */\n bgWhite?: boolean;\n /**\n * Only show Edit\n */\n onlyEdit?: boolean;\n /**\n * Whether to display the preview interface.\n */\n noPreview?: boolean;\n /**\n * Preview area does not display scroll bars\n */\n noScroll?: boolean;\n /**\n * Modify ReactCodemirror props.\n */\n editProps?: ReactCodeMirrorProps;\n /**\n * Dependent component\n */\n dependencies?: Record;\n codePenOption?: CodepenProps & {\n /**\n * Packages that do not require comments.\n * @example ['uiw']\n */\n includeModule?: string[];\n };\n codeSandboxOption?: CodeSandboxProps;\n /** @default 'Code' */\n btnText?: string;\n /** @default 'Hide Editor' */\n btnHideText?: string;\n /**\n * `light` / `dark` / `Extension` Defaults to `light`.\n * @default light\n */\n theme?: ReactCodeMirrorProps['theme'];\n}\n```\n\n```typescript\ntype CodePenOption = {\n title?: string;\n html?: string;\n js?: string;\n css?: string;\n editors?: string;\n css_external?: string;\n js_external?: string;\n js_pre_processor?: string;\n};\ntype CodepenProps = CodePenOption & React.FormHTMLAttributes;\n```\n\n```typescript\ntype CodeSandboxProps = React.FormHTMLAttributes & {\n /**\n * Whether we should redirect to the embed instead of the editor.\n */\n embed?: boolean;\n /**\n * The query that will be used in the redirect url. `embed` must be equal to `true`, `embed=true`.\n * [CodeSandbox Embed Options](https://codesandbox.io/docs/embedding#embed-options)\n * @example `view=preview&runonclick=1`\n */\n query?: string;\n /**\n * Instead of redirecting we will send a JSON reponse with `{\"sandbox_id\": sandboxId}`.\n */\n json?: boolean;\n /**\n * Parameters used to define how the sandbox should be created.\n */\n files?: Record<\n string,\n {\n content?: string | Record;\n isBinary?: boolean;\n }\n >;\n};\n```\n\n## Development\n\nThe components are placed in the [`src`](./src) directory.\n\n```bash\nnpm run watch # Listen compile .tsx files.\nnpm run build # compile .tsx files.\n\nnpm run doc\n```\n\n### Related\n\n- [@uiw/react-markdown-preview](https://github.com/uiwjs/react-markdown-preview): React component preview markdown text in web browser.\n- [@uiw/react-codemirror](https://github.com/uiwjs/react-codemirror): CodeMirror component for React. @codemirror\n- [@uiw/react-monacoeditor](https://github.com/jaywcjlove/react-monacoeditor): Monaco Editor component for React.\n- [@uiw/react-markdown-editor](https://github.com/uiwjs/react-markdown-editor): A markdown editor with preview, implemented with React.js and TypeScript.\n- [@uiw/react-md-editor](https://github.com/uiwjs/react-md-editor): A simple markdown editor with preview, implemented with React.js and TypeScript.\n\n## Contributors\n\nAs always, thanks to our amazing contributors!\n\n\n \n\n\nMade with [github-action-contributors](https://github.com/jaywcjlove/github-action-contributors).\n\n### License\n\nLicensed under the MIT License.\n",c="App_warpper__3j1r1",a="App_title__Uj2m0";var l=t(8168),u=t(8587),p=t(119),h=t(2716),m=t.n(h),w=t(9554),C=t(7267),b=t(4973),v=t(8021),g=t(382),L=["includeModule"];const x=e=>{var{codePenOption:n,codeSandboxOption:t,prefixCls:o}=e||{},r=n||{},{includeModule:i}=r,d=(0,u.A)(r,L);if(d&&d.js){var s=(i||[]).join("|");d.js=d.js.replace(/import([\s\S]*?)(?=['"])['"].*['"]( *;|;)?/gm,(e=>s&&new RegExp("from\\s+['\"]("+s+")['\"](s.+)?;?").test(e)?e:"/** "+e+" **/"))}return(0,g.jsxs)("div",{className:o+"-thirdparty",children:[n&&(0,g.jsx)(v.A,(0,l.A)({},d,{children:(0,g.jsx)("svg",{height:"12",fill:"currentColor",viewBox:"0 0 69 69",children:(0,g.jsx)("path",{d:"M68.974125,23.6022271 C68.9669375,23.556228 68.956875,23.5159788 68.951125,23.4728545 C68.9369583,23.3892382 68.9192128,23.3062677 68.8979375,23.2241717 C68.885,23.1752977 68.8663125,23.127861 68.8505,23.0804244 C68.8278442,23.0077868 68.8029153,22.9358778 68.77575,22.8648035 C68.7562939,22.8157401 68.7342205,22.7677555 68.709625,22.7210562 C68.6804108,22.6530301 68.6463004,22.5872128 68.6075625,22.5241224 C68.5816874,22.4766857 68.5515,22.4321241 68.52275,22.386125 C68.4142531,22.2169066 68.2885197,22.0593814 68.1475625,21.9160713 C68.10875,21.8772595 68.0728125,21.8355728 68.0325625,21.8010735 C67.9775701,21.7523865 67.9214935,21.704938 67.864375,21.6587636 C67.818375,21.6242643 67.77525,21.589765 67.72925,21.5581406 L67.680375,21.5207662 L36.1445,0.497723998 C35.1485978,-0.165907999 33.8514022,-0.165907999 32.8555,0.497723998 L1.32106248,21.5207662 L1.27218748,21.5581406 C1.16574994,21.6321432 1.06485681,21.713817 0.970312494,21.8025109 C0.928625004,21.8355728 0.891249961,21.8772595 0.850999999,21.9160713 C0.800687478,21.9678203 0.750375025,22.0224443 0.704374952,22.0770683 C0.618968308,22.1722554 0.543358166,22.275796 0.47868744,22.386125 L0.392437472,22.5241224 C0.355916851,22.587711 0.322339729,22.6529454 0.291812498,22.7196187 C0.235417041,22.8356642 0.187844895,22.9557936 0.149499967,23.0789869 C0.133687434,23.127861 0.11643744,23.1752977 0.103499962,23.2241717 C0.0819374527,23.3046702 0.0675624468,23.3880436 0.0517499808,23.4728545 C0.0431249503,23.5159787 0.0330624597,23.5562279 0.0273124842,23.6022271 C0.0114999508,23.7272873 0,23.8566599 0,23.9874699 L0,45.0105121 C0,45.1398847 0.0115000182,45.2692572 0.0287499444,45.3986298 C0.0330624597,45.4403165 0.0431249503,45.4834407 0.0517499808,45.5265649 C0.0661249867,45.6113758 0.0819374527,45.6918743 0.103499962,45.7752478 C0.11643744,45.8241218 0.133687434,45.8715585 0.149499967,45.918995 C0.172499936,45.9908687 0.195499972,46.0627423 0.227124972,46.1360534 C0.245812493,46.1849275 0.27024999,46.2309267 0.290374971,46.2798007 C0.323437498,46.3459245 0.355062497,46.4106108 0.392437472,46.478172 C0.421187484,46.5227337 0.448499968,46.5687328 0.47868744,46.6132945 C0.585037244,46.7827707 0.710436736,46.9395172 0.852437459,47.0804732 C0.979968483,47.2145679 1.12112666,47.3350078 1.27362494,47.4398414 L1.32106248,47.4786532 L32.8555,68.5016954 C33.8511677,69.1661015 35.1488322,69.1661015 36.1445,68.5016954 L67.680375,47.4786532 L67.72925,47.4412789 C67.77525,47.4096545 67.818375,47.3751552 67.864375,47.3406558 C67.9215088,47.2940078 67.9775854,47.2460798 68.0325625,47.1969085 C68.0728125,47.1609716 68.10875,47.1221599 68.1475625,47.0819107 C68.2902677,46.9406867 68.4161661,46.7834372 68.52275,46.6132945 C68.5515,46.5672953 68.5816874,46.5227337 68.6075625,46.478172 C68.646375,46.4106108 68.6794375,46.3459245 68.7081875,46.2798007 C68.732625,46.2309267 68.7570625,46.1849275 68.77575,46.1360534 C68.8045,46.0641798 68.8275,45.9908687 68.8505,45.918995 C68.8663125,45.8715584 68.885,45.8241218 68.8979375,45.7752478 C68.9195,45.6918743 68.9353125,45.6113759 68.951125,45.5265649 C68.956875,45.4834407 68.9669375,45.4403165 68.974125,45.4000673 C68.991375,45.2706947 69,45.1413222 69,45.0119496 L69,23.9889074 C69,23.8566599 68.991375,23.7272873 68.974125,23.6022271 Z M38,9 L61,24.1907448 L50.7281277,31 L38.0014231,22.5649276 L38.0014231,9 L38,9 Z M30.997154,9 L30.997154,22.5649276 L18.2740828,31 L8,24.1907448 L31,9 L30.997154,9 Z M6,29 L13,34 L6,39 L6,29 L6,29 Z M31,60 L8,44.8082815 L18.2732954,38 L30.9971538,46.434203 L30.9971538,60 L31,60 Z M34.4985607,41 L24,34 L34.4985607,27 L45,34 L34.4985607,41 Z M38,60 L38,46.4333333 L50.7268564,38 L61,44.8073077 L38,60 L38,60 Z M63,39 L56,34 L63,29 L63,39 L63,39 Z"})})})),t&&(0,g.jsx)(b.A,(0,l.A)({},t,{children:(0,g.jsx)("svg",{height:"12",fill:"currentColor",viewBox:"0 0 69 69",children:(0,g.jsx)("path",{d:"M32,38.2764838 L11,24 L11,35.7160031 L22.0526316,43.2306536 L22.0526316,54.3200601 L32,60 L32,38.2764838 Z M38,38.2764838 L38,60 L47.9473684,54.3200601 L47.9473684,43.2306536 L59,35.7160031 L59,24 L38,38.2764838 Z M46.296506,13 L35.5021904,21.0761293 L24.7078748,13.004586 L15,18.6913552 L35.5021904,33 L56,18.6913552 L46.296506,13.004586 L46.296506,13 Z M37.1676303,0.571217481 L63.7371606,15.5989936 C65.1342563,16.3900364 66,17.8813846 66,19.4990592 L66,49.4964682 C66.0011469,51.1157433 65.1356391,52.6091811 63.7371606,53.4010064 L37.1676303,68.4287825 C35.8224939,69.1904058 34.1819333,69.1904058 32.8367968,68.4287825 L6.26726663,53.4010064 C4.86707992,52.6103421 4,51.1166819 4,49.4964682 L4,19.4990592 C4,17.8813846 4.86574257,16.3900364 6.26283836,15.5989936 L32.8323686,0.571217481 C34.1775051,-0.190405827 35.8180656,-0.190405827 37.1632021,0.571217481 L37.1676303,0.571217481 Z"})})}))]})};var f=(0,g.jsx)("svg",{viewBox:"0 0 176 176",children:(0,g.jsx)("path",{d:"M40.25 8.8817842e-15 5.25 8.8817842e-15C2.35 8.8817842e-15 0 2.35 0 5.25L0 40.15C0 40.175 0 40.2 0 40.225 0 43.1375 2.35 45.4875 5.25 45.4875 8.15 45.4875 10.525 43.1375 10.525 40.225 10.525 39.925 10.475 39.6125 10.425 39.325L10.425 11.35C10.425 10.8625 10.8125 10.475 11.2875 10.475L39.6875 10.475C39.875 10.4875 40.0625 10.525 40.25 10.525 43.15 10.525 45.5125 8.175 45.5125 5.2625 45.5125 2.35 43.15 8.8817842e-15 40.25 8.8817842e-15ZM143.136561 140.373919C143.136561 142.009731 141.787547 143.3375 140.162358 143.3375L34.0895201 143.3375C32.4537083 143.3375 31.1259389 142.009731 31.1259389 140.373919L31.1259389 34.3117033C31.1259389 32.6652693 32.4537083 31.3375 34.0895201 31.3375L140.162358 31.3375C141.787547 31.3375 143.136561 32.6652693 143.136561 34.3117033L143.136561 140.373919ZM134.725 3.55271368e-15 169.725 3.55271368e-15C172.625 3.55271368e-15 174.975 2.35 174.975 5.25L174.975 40.15C174.975 40.175 175 40.2 175 40.225 175 43.1375 172.6375 45.4875 169.725 45.4875 166.8125 45.4875 164.4625 43.1375 164.4625 40.225 164.4625 39.925 164.5125 39.6125 164.55 39.325L164.55 11.35C164.55 10.8625 164.175 10.475 163.675 10.475L135.2875 10.475C135.0875 10.4875 134.925 10.525 134.725 10.525 131.825 10.525 129.475 8.175 129.475 5.2625 129.475 2.35 131.825 3.55271368e-15 134.725 3.55271368e-15ZM40.25 174.975 5.25 174.975C2.35 174.975 0 172.6375 0 169.7375L0 134.825C0 134.8 0 134.775 0 134.75 0 131.8375 2.35 129.475 5.25 129.475 8.15 129.475 10.525 131.825 10.525 134.75 10.525 135.05 10.475 135.3625 10.425 135.65L10.425 163.6125C10.425 164.1 10.8125 164.4875 11.2875 164.4875L39.6875 164.4875C39.875 164.475 40.05 164.4375 40.2375 164.4375 43.1375 164.4375 45.5 166.7875 45.5 169.7 45.5 172.6125 43.15 174.975 40.25 174.975ZM134.725 174.975 169.725 174.975C172.625 174.975 174.975 172.625 174.975 169.7375L174.975 134.825C174.975 134.8 175 134.775 175 134.75 175 131.8375 172.6375 129.475 169.725 129.475 166.8125 129.475 164.4625 131.825 164.4625 134.75 164.4625 135.05 164.5125 135.3625 164.55 135.65L164.55 163.6125C164.55 164.1 164.175 164.4875 163.675 164.4875L135.2875 164.4875C135.0875 164.475 134.925 164.4375 134.725 164.4375 131.825 164.4375 129.475 166.7875 129.475 169.7 129.475 172.6125 131.825 174.975 134.725 174.975Z",transform:"translate(.5 .512)"})}),j=(0,g.jsx)("svg",{viewBox:"0 0 170 185",children:(0,g.jsx)("path",{d:"M153.846154,-3.55271368e-15 L53.8461537,-3.55271368e-15 C45.3846152,-3.55271368e-15 38.4615385,6.92307695 38.4615385,15.3846154 L38.4615385,23.0769232 L130.769231,23.0769232 C139.230769,23.0769232 146.153846,30 146.153846,38.4615385 L146.153846,146.153846 L153.846154,146.153846 C162.307692,146.153846 169.230769,139.230769 169.230769,130.769231 L169.230769,15.3846154 C169.230769,6.92307695 162.307692,-3.55271368e-15 153.846154,-3.55271368e-15 Z M130.769231,53.8461539 C130.769231,45.3846154 123.846154,38.4615385 115.384615,38.4615385 L15.3846154,38.4615385 C6.92307695,38.4615385 3.55271368e-15,45.3846154 3.55271368e-15,53.8461539 L3.55271368e-15,169.230769 C3.55271368e-15,177.692308 6.92307695,184.615385 15.3846154,184.615385 L115.384615,184.615385 C123.846154,184.615385 130.769231,177.692308 130.769231,169.230769 L130.769231,53.8461539 Z M61.5384615,80.7692309 C61.5384615,83.0769232 60,84.6153848 57.6923076,84.6153848 L26.923077,84.6153848 C24.6153846,84.6153848 23.076923,83.0769232 23.076923,80.7692309 L23.076923,73.0769232 C23.076923,70.7692309 24.6153846,69.2307693 26.923077,69.2307693 L57.6923076,69.2307693 C60,69.2307693 61.5384615,70.7692309 61.5384615,73.0769232 L61.5384615,80.7692309 Z M92.3076922,142.307692 C92.3076922,144.615385 90.7692307,146.153846 88.4615385,146.153846 L26.923077,146.153846 C24.6153846,146.153846 23.076923,144.615385 23.076923,142.307692 L23.076923,134.615385 C23.076923,132.307692 24.6153846,130.769231 26.923077,130.769231 L88.4615385,130.769231 C90.7692309,130.769231 92.3076922,132.307692 92.3076922,134.615385 L92.3076922,142.307692 L92.3076922,142.307692 Z M107.692308,111.538462 C107.692308,113.846154 106.153846,115.384615 103.846154,115.384615 L26.923077,115.384615 C24.6153846,115.384615 23.076923,113.846154 23.076923,111.538462 L23.076923,103.846154 C23.076923,101.538462 24.6153846,100 26.923077,100 L103.846154,100 C106.153846,100 107.692308,101.538462 107.692308,103.846154 L107.692308,111.538462 L107.692308,111.538462 Z"})}),S=(0,g.jsx)("svg",{viewBox:"0 0 170 185",children:(0,g.jsx)("path",{d:"M153.846154,-3.55271368e-15 L53.8461537,-3.55271368e-15 C45.3846152,-3.55271368e-15 38.4615385,6.92307695 38.4615385,15.3846154 L38.4615385,23.0769232 L130.769231,23.0769232 C139.230769,23.0769232 146.153846,30 146.153846,38.4615385 L146.153846,146.153846 L153.846154,146.153846 C162.307692,146.153846 169.230769,139.230769 169.230769,130.769231 L169.230769,15.3846154 C169.230769,6.92307695 162.307692,-3.55271368e-15 153.846154,-3.55271368e-15 Z M130.769231,53.8461539 C130.769231,45.3846154 123.846154,38.4615385 115.384615,38.4615385 L15.3846154,38.4615385 C6.92307695,38.4615385 3.55271368e-15,45.3846154 3.55271368e-15,53.8461539 L3.55271368e-15,169.230769 C3.55271368e-15,177.692308 6.92307695,184.615385 15.3846154,184.615385 L115.384615,184.615385 C123.846154,184.615385 130.769231,177.692308 130.769231,169.230769 L130.769231,53.8461539 Z M106.941858,105.608333 C110.211682,102.450235 115.409229,102.495402 118.623676,105.709849 C121.838122,108.924296 121.883289,114.121842 118.725191,117.391667 L118.725191,117.391667 L72.8918576,163.225 C69.6376921,166.478183 64.3626897,166.478183 61.1085242,163.225 L61.1085242,163.225 L31.9418576,134.058333 C28.7837592,130.788509 28.828926,125.590962 32.0433729,122.376515 C35.2578198,119.162069 40.4553662,119.116902 43.7251908,122.275 L43.7251908,122.275 L67.0001908,145.55 Z M57.6923076,69.2307693 C60,69.2307693 61.5384615,70.7692309 61.5384615,73.0769232 L61.5384615,80.7692309 C61.5384615,83.0769232 60,84.6153848 57.6923076,84.6153848 L26.923077,84.6153848 C24.6153846,84.6153848 23.076923,83.0769232 23.076923,80.7692309 L23.076923,73.0769232 C23.076923,70.7692309 24.6153846,69.2307693 26.923077,69.2307693 L57.6923076,69.2307693 Z",transform:"translate(1)"})});function y(e){var{message:n}=e;return(0,o.useMemo)((()=>n?(0,g.jsx)("pre",{children:(0,g.jsx)("code",{children:n})}):null),[n])}var M=t(6900),k=t(9126);var P=t(6271),O=["React","ReactDOM","ReactDOMClient"];function R(e){var[n,r]=(0,o.useState)(),i=(0,o.useRef)(""+parseInt(String(1e9*Math.random()),10).toString(36)),[d,s]=(0,o.useState)(!1),[c,a]=(0,o.useState)(""),[p,h]=(0,o.useState)(!1),[m,w]=(0,o.useState)(1),[C,b]=(0,o.useState)(!1),[v,g]=(0,o.useState)(e.code||""),L=o.useMemo((()=>window.ReactDOM?window.ReactDOM:(()=>{var e;try{e=t(1480)}catch(n){}return e})()),[]),x=o.useRef(new Map([])),f=n=>{var t=e.dependencies||{},{React:r,ReactDOM:d,ReactDOMClient:s}=t,c=(0,u.A)(t,O),p=s||L||d||P,h=Reflect.has(p,"createRoot"),m=h?(e=>({createRoot:n=>({render:t=>{var o=x.current,r=o.get(n);r?r.render(t):((r=e.createRoot(document.getElementById(n))).render(t),o.set(n,r)),x.current=o}})}))(p):p;try{var w=(0,l.A)({React:r||o},c,{ReactDOM:m}),C=[],b=[];for(var v in w)C.push(v),b.push(w[v]);var g=""+(n=h?(n=(n=n.replace("ReactDOM.render",'ReactDOM.createRoot("'+i.current+'").render')).replace("ReactDOM.createRoot(_mount_)",'ReactDOM.createRoot("'+i.current+'")')).replace("_mount_",""):n.replace("_mount_","document.getElementById('"+i.current+"')")),{code:f}=function(e){return(0,M.transform)(e,{presets:["env","es2015","react"],plugins:[[k.A,{removeAll:!0}]]})}(g);C.push(f||""),new Function(...C).apply(null,b),a("")}catch(S){var j="";j=S&&S.message?S.message:JSON.stringify(S),a(j)}};return(0,o.useEffect)((()=>f(v)),[v,e.noPreview,n]),{playerId:i,demoDom:n,setDemoDom:r,fullScreen:d,setFullScreen:s,errorMessage:c,setErrorMessage:a,width:m,setWidth:w,showEdit:p,setShowEdit:h,copied:C,setCopied:b,code:v,setCode:g,executeCode:f}}var _=["style","prefixCls","className","theme","editProps","codePenOption","codeSandboxOption","code","dependencies","btnText","btnHideText","onlyEdit","bordered","noCode","noPreview","noScroll","bgWhite"],B=o.forwardRef(((e,n)=>{var{style:t,prefixCls:r="w-code-preview",className:i,theme:d="light",editProps:s={},codePenOption:c,codeSandboxOption:a,code:h="",dependencies:b={},btnText:v="Code",btnHideText:L="Hide Editor",onlyEdit:M=!1,bordered:k=!0,noCode:P=!1,noPreview:O=!1,noScroll:B=!1,bgWhite:E=!1}=e,D=(0,u.A)(e,_),{playerId:A,setDemoDom:T,code:Z,setCode:N,fullScreen:I,setFullScreen:W,errorMessage:F,width:H,setWidth:q,showEdit:U,setShowEdit:z,copied:J,setCopied:G}=R((0,l.A)({code:h,dependencies:b},e)),Q=(0,o.useRef)(null),X=(0,o.useRef)(null);(0,o.useImperativeHandle)(n,(()=>({editor:X,demo:Q.current})),[X,Q]);var $=!(!P&&!O)&&(!P||!O),K=1!==H&&[$?1:2],V=[i,r,B?r+"-noScroll":null,$?r+"-OneItem":null,k?r+"-bordered":null,I?r+"-fullScreen":null].filter(Boolean).join(" ").trim();(0,o.useEffect)((()=>N(h)),[h]),(0,o.useEffect)((()=>{Q.current&&T(Q.current),window.addEventListener("popstate",(e=>{document.body.style.overflow="inherit"}),!1)}),[]);var Y=()=>z(1!==H);(0,o.useEffect)((()=>{var e=Q.current;return e&&e.addEventListener("transitionend",Y),()=>{e&&e.removeEventListener("transitionend",Y)}}),[H]);return(0,g.jsxs)(C.A,(0,l.A)({"data-color-mode":d,visiable:K,className:V,style:(0,l.A)({flex:1},t)},D,{children:[!O&&!M&&(0,g.jsxs)("div",{className:[r+"-demo",E?null:r+"-demo-bgPlaid",F?r+"-demo-error":null].filter(Boolean).join(" ").trim(),style:(0,l.A)({flex:1},1===H?{width:"100%"}:{}),children:[(0,g.jsx)(y,{message:F}),(0,g.jsx)("div",{className:[r+"-demo-source",F?"error":null].filter(Boolean).join(" ").trim(),id:A.current})]}),(!P||M)&&(0,g.jsx)("div",{ref:Q,style:{overflow:"hidden",width:M?"100%":H},children:(U||M)&&(0,g.jsx)(p.Ay,(0,l.A)({value:(Z||"").replace(/\n$/,""),ref:X,theme:d,extensions:[(0,w.Q2)({jsx:!0})]},s,{style:{height:"100%"},height:"100%",onChange:(e,n)=>{N(e),s&&s.onChange&&s.onChange(e,n)}}))}),!$&&!(P&&O)&&!M&&(0,g.jsxs)("div",{style:{flex:1,width:29},className:r+"-bar",children:[(0,g.jsx)(x,{prefixCls:r,codePenOption:c,codeSandboxOption:a}),(0,g.jsx)("div",{className:r+"-bar-btn",onClick:()=>{q(1===H?"50%":1),z(!0)},children:1===H?v:L}),(0,g.jsx)("div",{className:[r+"-bar-iconbtns",J?r+"-bar-copied":null].filter(Boolean).join(" ").trim(),onClick:()=>{m()(Z||"",(e=>G(e))),setTimeout((()=>G(!1)),2e3)},children:J?S:j}),(0,g.jsx)("div",{className:[r+"-bar-iconbtns",I?r+"-bar-copied":null].filter(Boolean).join(" ").trim(),onClick:()=>{W(!I),document.body.style.overflow=I?"inherit":"hidden",!I&&Q.current&&(Q.current.style.maxWidth="inherit")},children:f})]})]}))}));B.displayName="CodePreview";const E=B;var D=t(8406);const A=()=>{const[e,n]=(0,o.useState)("light"),[t]=(0,o.useState)('\nimport { Button, Divider, Icon } from \'uiw\';\nimport ReactDOM from \'react-dom/client\';\n\nReactDOM.createRoot(_mount_).render(\n
\n \n \n \n \n \n \n
,\n);'),[r,i]=(0,o.useState)({bgWhite:!1,noCode:!1,noScroll:!1,noPreview:!1,bordered:!0,codeSandbox:{files:{"sandbox.config.json":{content:'{\n "template": "node",\n "container": {\n "startScript": "start",\n "node": "14"\n }\n }'},"public/index.html":{content:'
'},"src/index.js":{content:t.replace("_mount_",'document.getElementById("root")')},"src/index.less":{content:""},".kktrc.js":{content:'import webpack from "webpack";\nimport lessModules from "@kkt/less-modules";\nexport default (conf, env, options) => {\nconf = lessModules(conf, env, options);\nreturn conf;\n};'},"package.json":{content:{dependencies:{react:"latest","react-dom":"latest",uiw:"latest"},devDependencies:{"@kkt/less-modules":"6.0.11",kkt:"6.0.11",typescript:"4.1.3"},scripts:{start:"kkt start",build:"kkt build",test:"kkt test --env=jsdom"},browserslist:[">0.2%","not dead","not ie <= 11","not op_mini all"]}}}},codeSandboxShow:!0,codePenShow:!0,codePen:{includeModule:["uiw"],title:"React Code Preview - demo",html:'
',js:t.replace("_mount_",'document.getElementById("root")'),css_external:"https://unpkg.com/uiw@3.2.6/dist/uiw.min.css",js_external:"https://unpkg.com/react@18.x/umd/react.development.js;https://unpkg.com/react-dom@18.x/umd/react-dom.development.js;https://unpkg.com/uiw@4.7.2/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.12/index.js"}});function d(e,n){const t={...r,["".concat(e)]:n.target.checked};i({...t})}return(0,o.useEffect)((()=>{n("dark"===document.documentElement.getAttribute("data-color-mode")?"dark":"light"),document.addEventListener("colorschemechange",(e=>{n(e.detail.colorScheme)}))}),[]),(0,g.jsxs)(o.Fragment,{children:[(0,g.jsx)(E,{code:t,theme:e,dependencies:{...D},bordered:r.bordered,noScroll:r.noScroll,bgWhite:r.bgWhite,noCode:r.noCode,editProps:{onChange:e=>{i({...r,codeSandbox:{...r.codeSandbox,files:{...r.codeSandbox.files,"src/index.js":{content:e}}},codePen:{...r.codePen,js:e}})}},noPreview:r.noPreview,codeSandboxOption:r.codeSandboxShow?r.codeSandbox:void 0,codePenOption:r.codePenShow?r.codePen:void 0}),(0,g.jsxs)("div",{children:[(0,g.jsxs)(D.Switch,{"data-checked":"\u683c\u7eb9","data-unchecked":"\u767d\u8272",checked:r.bgWhite,onChange:d.bind(void 0,"bgWhite"),children:["\u80cc\u666f `bgWhite=",r.bgWhite.toString(),"`"]}),(0,g.jsx)("br",{}),(0,g.jsxs)(D.Switch,{"data-checked":"\u663e\u793a","data-unchecked":"\u9690\u85cf",checked:r.noCode,onChange:d.bind(void 0,"noCode"),children:["\u662f\u5426\u663e\u793a\u4ee3\u7801 `noCode=",r.noCode.toString(),"`"]}),(0,g.jsx)("br",{}),(0,g.jsxs)(D.Switch,{"data-checked":"\u663e\u793a","data-unchecked":"\u9690\u85cf",checked:r.noPreview,onChange:d.bind(void 0,"noPreview"),children:["\u662f\u5426\u663e\u793a\u5b9e\u4f8b\u9884\u89c8 `noPreview=",r.noPreview.toString(),"`"]}),(0,g.jsx)("br",{}),(0,g.jsxs)(D.Switch,{"data-checked":"\u8d85\u51fa\u6eda\u52a8","data-unchecked":"\u9ad8\u5ea6\u81ea\u9002\u5e94",checked:r.noScroll,onChange:d.bind(void 0,"noScroll"),children:["\u662f\u5426\u663e\u793a\u6eda\u52a8\u6761 `noScroll=",r.noScroll.toString(),"`"]}),(0,g.jsx)("br",{}),(0,g.jsxs)(D.Switch,{checked:r.bordered,onChange:d.bind(void 0,"bordered"),children:["\u662f\u5426\u663e\u793a\u8fb9\u6846 `bordered=",r.bordered.toString(),"`"]}),(0,g.jsx)("br",{}),(0,g.jsxs)(D.Switch,{checked:r.codePenShow,onChange:d.bind(void 0,"codePenShow"),children:["\u662f\u5426\u663e\u793a CodePen \u6309\u94ae `codePenOption=",r.codePenShow?"{...}":"undefined","`"]}),(0,g.jsx)("br",{}),(0,g.jsxs)(D.Switch,{checked:r.codeSandboxShow,onChange:d.bind(void 0,"codeSandboxShow"),children:["\u662f\u5426\u663e\u793a CodeSandbox \u6309\u94ae `codeSandboxOption=",r.codeSandboxShow?"{...}":"undefined","`"]})]})]})},T="5.2.0";function Z(){const e=T;let n=s;return n&&(n=s.replace(/([\s\S]*)/,"")),(0,g.jsxs)("div",{className:c,children:[(0,g.jsx)("dark-mode",{light:"Light",dark:"Dark",style:{position:"fixed",left:10,top:5}}),(0,g.jsx)(i.A,{fixed:!0,href:"https://github.com/uiwjs/react-code-preview",target:"__blank"}),(0,g.jsxs)("h1",{className:a,children:["React Code Preview ",(0,g.jsx)("sup",{children:e})]}),(0,g.jsx)(A,{}),(0,g.jsx)(d.A,{style:{paddingTop:25},source:n})]})}r.createRoot(document.getElementById("root")).render((0,g.jsx)(o.StrictMode,{children:(0,g.jsx)(Z,{})}))}},n={};function t(o){var r=n[o];if(void 0!==r)return r.exports;var i=n[o]={exports:{}};return e[o].call(i.exports,i,i.exports,t),i.exports}t.m=e,(()=>{var e=[];t.O=(n,o,r,i)=>{if(!o){var d=1/0;for(l=0;l=i)&&Object.keys(t.O).every((e=>t.O[e](o[c])))?o.splice(c--,1):(s=!1,i0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[o,r,i]}})(),t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},t.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={792:0};t.O.j=n=>0===e[n];var n=(n,o)=>{var r,i,d=o[0],s=o[1],c=o[2],a=0;if(d.some((n=>0!==e[n]))){for(r in s)t.o(s,r)&&(t.m[r]=s[r]);if(c)var l=c(t)}for(n&&n(o);at(6609)));o=t.O(o)})(); +//# sourceMappingURL=main.19920c0d.js.map \ No newline at end of file diff --git a/static/js/main.be9fe940.js.map b/static/js/main.19920c0d.js.map similarity index 99% rename from static/js/main.be9fe940.js.map rename to static/js/main.19920c0d.js.map index cddb8ae6..7014aeff 100644 --- a/static/js/main.be9fe940.js.map +++ b/static/js/main.19920c0d.js.map @@ -1 +1 @@ -{"version":3,"file":"static/js/main.be9fe940.js","mappings":"sBAAA,SAASA,EAAoBC,GAC5B,IAAIC,EAAI,IAAIC,MAAM,uBAAyBF,EAAM,KAEjD,MADAC,EAAEE,KAAO,mBACHF,CACP,CACAF,EAAoBK,KAAO,IAAM,GACjCL,EAAoBM,QAAUN,EAC9BA,EAAoBO,GAAK,KACzBC,EAAOC,QAAUT,C,yFCRjB,qhMCCA,EAA0B,qBAA1B,EAAuD,mB,qGCCnDU,EAAY,CAAC,iBAiDjB,QA5CuBC,IACrB,IAAI,cACFC,EAAa,kBACbC,EAAiB,UACjBC,GACEH,GAAS,CAAC,EACVI,EAAOH,GAAiB,CAAC,GAC3B,cACEI,GACED,EACJE,GAAsBC,EAAAA,EAAAA,GAA8BH,EAAML,GAC5D,GAAIO,GAAuBA,EAAoBE,GAAI,CACjD,IAAIC,GAAWJ,GAAiB,IAAIK,KAAK,KACzCJ,EAAoBE,GAAKF,EAAoBE,GAAGG,QAAQ,gDAAgDC,GA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,GAA4BA,EAA2BC,GACrD7B,EAAIL,EAASM,OAAQD,IACzB0B,EAAU/B,EAASK,GAChBd,EAAoB2B,EAAEY,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOxC,EAAoBO,EAAEC,EAAO,EAGjCuC,EAAqBC,KAA0C,oCAAIA,KAA0C,qCAAK,GACtHD,EAAmBE,QAAQR,EAAqB5D,KAAK,KAAM,IAC3DkE,EAAmBvK,KAAOiK,EAAqB5D,KAAK,KAAMkE,EAAmBvK,KAAKqG,KAAKkE,G,KC/CvF,IAAIG,EAAsBlD,EAAoBO,OAAE5B,EAAW,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM,IAAOqB,EAAoB,QACjHkD,EAAsBlD,EAAoBO,EAAE2C,E","sources":["../node_modules/@babel/standalone|sync","../README.md","webpack://@uiw/react-code-preview/./website/App.module.less?cfe1","../esm/ThirdPartyButton.js","../esm/icon.js","../esm/ErrorMessage.js","../esm/useCodePreview.js","../esm/transform.js","../esm/index.js","Example.tsx","App.tsx","index.tsx","../webpack/bootstrap","../webpack/runtime/chunk loaded","../webpack/runtime/compat get default export","../webpack/runtime/define property getters","../webpack/runtime/global","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/make namespace object","../webpack/runtime/jsonp chunk loading","../webpack/startup"],"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 = 5764;\nmodule.exports = webpackEmptyContext;","export default \"## React Code Preview\\n\\n\\n\\n[![Build & Deploy](https://github.com/uiwjs/react-code-preview/workflows/Build%20&%20Deploy/badge.svg)](https://github.com/uiwjs/react-code-preview/actions)\\n[![Release](https://img.shields.io/github/release/uiwjs/react-code-preview)](https://github.com/uiwjs/react-code-preview/releases)\\n[![npm version](https://img.shields.io/npm/v/@uiw/react-code-preview.svg)](https://www.npmjs.com/package/@uiw/react-code-preview)\\n[![Gitee](https://jaywcjlove.github.io/sb/ico/gitee.svg)](https://uiw.gitee.io/react-code-preview/)\\n\\nCode edit preview for React. Preview Demo: https://uiwjs.github.io/react-code-preview\\n\\nThere are often a lot of sample code in the documentation. We hope that you can run the sample code to view the rendering interface as you read the document.\\n\\n## Install\\n\\n```bash\\nnpm install @uiw/react-code-preview --save\\n```\\n\\n## Usage\\n\\n### In React 18\\n\\n[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/uiw-react-code-preview-react-18-1bmhhd?fontsize=14&hidenavigation=1&theme=dark)\\n\\n```jsx\\nimport Button from '@uiw/react-button';\\nimport CodePreview from '@uiw/react-code-preview';\\n\\nconst code = `import Button from '@uiw/react-button';\\nimport ReactDOM from 'react-dom/client';\\n\\nReactDOM.createRoot(_mount_).render(\\n
\\n \\n \\n
,\\n);`;\\n\\nexport default function App() {\\n return ;\\n}\\n```\\n\\n### In React 17\\n\\n[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/uiw-react-code-preview-react-17-t6ro9?fontsize=14&hidenavigation=1&theme=dark)\\n\\n```jsx\\nimport Button from '@uiw/react-button';\\nimport CodePreview from '@uiw/react-code-preview';\\n\\nconst code = `import Button from '@uiw/react-button';\\nimport ReactDOM from 'react-dom';\\n\\nReactDOM.render(\\n
\\n \\n \\n
,\\n _mount_\\n);`;\\n\\nexport default function App() {\\n return ;\\n}\\n```\\n\\n- `_mount_` Special strings, the compilation will be replaced.\\n\\n### Props\\n\\n```typescript\\ninterface CodePreviewProps extends SplitProps {\\n prefixCls?: string;\\n style?: React.CSSProperties;\\n /**\\n * To specify a CSS class, use the className attribute.\\n */\\n className?: string;\\n /**\\n * Whether to display the border.\\n */\\n bordered?: boolean;\\n /**\\n * `JSX` source code\\n */\\n code?: string;\\n /**\\n * Whether to display the code interface.\\n */\\n noCode?: boolean;\\n /**\\n * Is the background white or plaid?\\n */\\n bgWhite?: boolean;\\n /**\\n * Only show Edit\\n */\\n onlyEdit?: boolean;\\n /**\\n * Whether to display the preview interface.\\n */\\n noPreview?: boolean;\\n /**\\n * Preview area does not display scroll bars\\n */\\n noScroll?: boolean;\\n /**\\n * Modify ReactCodemirror props.\\n */\\n editProps?: ReactCodeMirrorProps;\\n /**\\n * Dependent component\\n */\\n dependencies?: Record;\\n codePenOption?: CodepenProps & {\\n /**\\n * Packages that do not require comments.\\n * @example ['uiw']\\n */\\n includeModule?: string[];\\n };\\n codeSandboxOption?: CodeSandboxProps;\\n /** @default 'Code' */\\n btnText?: string;\\n /** @default 'Hide Editor' */\\n btnHideText?: string;\\n /**\\n * `light` / `dark` / `Extension` Defaults to `light`.\\n * @default light\\n */\\n theme?: ReactCodeMirrorProps['theme'];\\n}\\n```\\n\\n```typescript\\ntype CodePenOption = {\\n title?: string;\\n html?: string;\\n js?: string;\\n css?: string;\\n editors?: string;\\n css_external?: string;\\n js_external?: string;\\n js_pre_processor?: string;\\n};\\ntype CodepenProps = CodePenOption & React.FormHTMLAttributes;\\n```\\n\\n```typescript\\ntype CodeSandboxProps = React.FormHTMLAttributes & {\\n /**\\n * Whether we should redirect to the embed instead of the editor.\\n */\\n embed?: boolean;\\n /**\\n * The query that will be used in the redirect url. `embed` must be equal to `true`, `embed=true`.\\n * [CodeSandbox Embed Options](https://codesandbox.io/docs/embedding#embed-options)\\n * @example `view=preview&runonclick=1`\\n */\\n query?: string;\\n /**\\n * Instead of redirecting we will send a JSON reponse with `{\\\"sandbox_id\\\": sandboxId}`.\\n */\\n json?: boolean;\\n /**\\n * Parameters used to define how the sandbox should be created.\\n */\\n files?: Record<\\n string,\\n {\\n content?: string | Record;\\n isBinary?: boolean;\\n }\\n >;\\n};\\n```\\n\\n## Development\\n\\nThe components are placed in the [`src`](./src) directory.\\n\\n```bash\\nnpm run watch # Listen compile .tsx files.\\nnpm run build # compile .tsx files.\\n\\nnpm run doc\\n```\\n\\n### Related\\n\\n- [@uiw/react-markdown-preview](https://github.com/uiwjs/react-markdown-preview): React component preview markdown text in web browser.\\n- [@uiw/react-codemirror](https://github.com/uiwjs/react-codemirror): CodeMirror component for React. @codemirror\\n- [@uiw/react-monacoeditor](https://github.com/jaywcjlove/react-monacoeditor): Monaco Editor component for React.\\n- [@uiw/react-markdown-editor](https://github.com/uiwjs/react-markdown-editor): A markdown editor with preview, implemented with React.js and TypeScript.\\n- [@uiw/react-md-editor](https://github.com/uiwjs/react-md-editor): A simple markdown editor with preview, implemented with React.js and TypeScript.\\n\\n## Contributors\\n\\nAs always, thanks to our amazing contributors!\\n\\n\\n \\n\\n\\nMade with [github-action-contributors](https://github.com/jaywcjlove/github-action-contributors).\\n\\n### License\\n\\nLicensed under the MIT License.\\n\";","// extracted by mini-css-extract-plugin\nexport default {\"warpper\":\"App_warpper__3j1r1\",\"title\":\"App_title__Uj2m0\"};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"includeModule\"];\nimport React from 'react';\nimport CodeSandbox from '@uiw/react-codesandbox';\nimport Codepen from '@uiw/react-codepen';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nvar ThirdPartyButton = props => {\n var {\n codePenOption,\n codeSandboxOption,\n prefixCls\n } = props || {};\n var _ref = codePenOption || {},\n {\n includeModule\n } = _ref,\n otherCodePenOptions = _objectWithoutPropertiesLoose(_ref, _excluded);\n if (otherCodePenOptions && otherCodePenOptions.js) {\n var include = (includeModule || []).join('|');\n otherCodePenOptions.js = otherCodePenOptions.js.replace(/import([\\s\\S]*?)(?=['\"])['\"].*['\"]( *;|;)?/gm, str => {\n // eslint-disable-next-line no-useless-escape\n if (include && new RegExp(\"from\\\\s+['\\\"](\" + include + \")['\\\"](s.+)?;?\").test(str)) {\n return str;\n }\n return \"/** \" + str + \" **/\";\n });\n }\n return /*#__PURE__*/_jsxs(\"div\", {\n className: prefixCls + \"-thirdparty\",\n children: [codePenOption && /*#__PURE__*/_jsx(Codepen, _extends({}, otherCodePenOptions, {\n children: /*#__PURE__*/_jsx(\"svg\", {\n height: \"12\",\n fill: \"currentColor\",\n viewBox: \"0 0 69 69\",\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M68.974125,23.6022271 C68.9669375,23.556228 68.956875,23.5159788 68.951125,23.4728545 C68.9369583,23.3892382 68.9192128,23.3062677 68.8979375,23.2241717 C68.885,23.1752977 68.8663125,23.127861 68.8505,23.0804244 C68.8278442,23.0077868 68.8029153,22.9358778 68.77575,22.8648035 C68.7562939,22.8157401 68.7342205,22.7677555 68.709625,22.7210562 C68.6804108,22.6530301 68.6463004,22.5872128 68.6075625,22.5241224 C68.5816874,22.4766857 68.5515,22.4321241 68.52275,22.386125 C68.4142531,22.2169066 68.2885197,22.0593814 68.1475625,21.9160713 C68.10875,21.8772595 68.0728125,21.8355728 68.0325625,21.8010735 C67.9775701,21.7523865 67.9214935,21.704938 67.864375,21.6587636 C67.818375,21.6242643 67.77525,21.589765 67.72925,21.5581406 L67.680375,21.5207662 L36.1445,0.497723998 C35.1485978,-0.165907999 33.8514022,-0.165907999 32.8555,0.497723998 L1.32106248,21.5207662 L1.27218748,21.5581406 C1.16574994,21.6321432 1.06485681,21.713817 0.970312494,21.8025109 C0.928625004,21.8355728 0.891249961,21.8772595 0.850999999,21.9160713 C0.800687478,21.9678203 0.750375025,22.0224443 0.704374952,22.0770683 C0.618968308,22.1722554 0.543358166,22.275796 0.47868744,22.386125 L0.392437472,22.5241224 C0.355916851,22.587711 0.322339729,22.6529454 0.291812498,22.7196187 C0.235417041,22.8356642 0.187844895,22.9557936 0.149499967,23.0789869 C0.133687434,23.127861 0.11643744,23.1752977 0.103499962,23.2241717 C0.0819374527,23.3046702 0.0675624468,23.3880436 0.0517499808,23.4728545 C0.0431249503,23.5159787 0.0330624597,23.5562279 0.0273124842,23.6022271 C0.0114999508,23.7272873 0,23.8566599 0,23.9874699 L0,45.0105121 C0,45.1398847 0.0115000182,45.2692572 0.0287499444,45.3986298 C0.0330624597,45.4403165 0.0431249503,45.4834407 0.0517499808,45.5265649 C0.0661249867,45.6113758 0.0819374527,45.6918743 0.103499962,45.7752478 C0.11643744,45.8241218 0.133687434,45.8715585 0.149499967,45.918995 C0.172499936,45.9908687 0.195499972,46.0627423 0.227124972,46.1360534 C0.245812493,46.1849275 0.27024999,46.2309267 0.290374971,46.2798007 C0.323437498,46.3459245 0.355062497,46.4106108 0.392437472,46.478172 C0.421187484,46.5227337 0.448499968,46.5687328 0.47868744,46.6132945 C0.585037244,46.7827707 0.710436736,46.9395172 0.852437459,47.0804732 C0.979968483,47.2145679 1.12112666,47.3350078 1.27362494,47.4398414 L1.32106248,47.4786532 L32.8555,68.5016954 C33.8511677,69.1661015 35.1488322,69.1661015 36.1445,68.5016954 L67.680375,47.4786532 L67.72925,47.4412789 C67.77525,47.4096545 67.818375,47.3751552 67.864375,47.3406558 C67.9215088,47.2940078 67.9775854,47.2460798 68.0325625,47.1969085 C68.0728125,47.1609716 68.10875,47.1221599 68.1475625,47.0819107 C68.2902677,46.9406867 68.4161661,46.7834372 68.52275,46.6132945 C68.5515,46.5672953 68.5816874,46.5227337 68.6075625,46.478172 C68.646375,46.4106108 68.6794375,46.3459245 68.7081875,46.2798007 C68.732625,46.2309267 68.7570625,46.1849275 68.77575,46.1360534 C68.8045,46.0641798 68.8275,45.9908687 68.8505,45.918995 C68.8663125,45.8715584 68.885,45.8241218 68.8979375,45.7752478 C68.9195,45.6918743 68.9353125,45.6113759 68.951125,45.5265649 C68.956875,45.4834407 68.9669375,45.4403165 68.974125,45.4000673 C68.991375,45.2706947 69,45.1413222 69,45.0119496 L69,23.9889074 C69,23.8566599 68.991375,23.7272873 68.974125,23.6022271 Z M38,9 L61,24.1907448 L50.7281277,31 L38.0014231,22.5649276 L38.0014231,9 L38,9 Z M30.997154,9 L30.997154,22.5649276 L18.2740828,31 L8,24.1907448 L31,9 L30.997154,9 Z M6,29 L13,34 L6,39 L6,29 L6,29 Z M31,60 L8,44.8082815 L18.2732954,38 L30.9971538,46.434203 L30.9971538,60 L31,60 Z M34.4985607,41 L24,34 L34.4985607,27 L45,34 L34.4985607,41 Z M38,60 L38,46.4333333 L50.7268564,38 L61,44.8073077 L38,60 L38,60 Z M63,39 L56,34 L63,29 L63,39 L63,39 Z\"\n })\n })\n })), codeSandboxOption && /*#__PURE__*/_jsx(CodeSandbox, _extends({}, codeSandboxOption, {\n children: /*#__PURE__*/_jsx(\"svg\", {\n height: \"12\",\n fill: \"currentColor\",\n viewBox: \"0 0 69 69\",\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M32,38.2764838 L11,24 L11,35.7160031 L22.0526316,43.2306536 L22.0526316,54.3200601 L32,60 L32,38.2764838 Z M38,38.2764838 L38,60 L47.9473684,54.3200601 L47.9473684,43.2306536 L59,35.7160031 L59,24 L38,38.2764838 Z M46.296506,13 L35.5021904,21.0761293 L24.7078748,13.004586 L15,18.6913552 L35.5021904,33 L56,18.6913552 L46.296506,13.004586 L46.296506,13 Z M37.1676303,0.571217481 L63.7371606,15.5989936 C65.1342563,16.3900364 66,17.8813846 66,19.4990592 L66,49.4964682 C66.0011469,51.1157433 65.1356391,52.6091811 63.7371606,53.4010064 L37.1676303,68.4287825 C35.8224939,69.1904058 34.1819333,69.1904058 32.8367968,68.4287825 L6.26726663,53.4010064 C4.86707992,52.6103421 4,51.1166819 4,49.4964682 L4,19.4990592 C4,17.8813846 4.86574257,16.3900364 6.26283836,15.5989936 L32.8323686,0.571217481 C34.1775051,-0.190405827 35.8180656,-0.190405827 37.1632021,0.571217481 L37.1676303,0.571217481 Z\"\n })\n })\n }))]\n });\n};\nexport default ThirdPartyButton;","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport var full = /*#__PURE__*/_jsx(\"svg\", {\n viewBox: \"0 0 176 176\",\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M40.25 8.8817842e-15 5.25 8.8817842e-15C2.35 8.8817842e-15 0 2.35 0 5.25L0 40.15C0 40.175 0 40.2 0 40.225 0 43.1375 2.35 45.4875 5.25 45.4875 8.15 45.4875 10.525 43.1375 10.525 40.225 10.525 39.925 10.475 39.6125 10.425 39.325L10.425 11.35C10.425 10.8625 10.8125 10.475 11.2875 10.475L39.6875 10.475C39.875 10.4875 40.0625 10.525 40.25 10.525 43.15 10.525 45.5125 8.175 45.5125 5.2625 45.5125 2.35 43.15 8.8817842e-15 40.25 8.8817842e-15ZM143.136561 140.373919C143.136561 142.009731 141.787547 143.3375 140.162358 143.3375L34.0895201 143.3375C32.4537083 143.3375 31.1259389 142.009731 31.1259389 140.373919L31.1259389 34.3117033C31.1259389 32.6652693 32.4537083 31.3375 34.0895201 31.3375L140.162358 31.3375C141.787547 31.3375 143.136561 32.6652693 143.136561 34.3117033L143.136561 140.373919ZM134.725 3.55271368e-15 169.725 3.55271368e-15C172.625 3.55271368e-15 174.975 2.35 174.975 5.25L174.975 40.15C174.975 40.175 175 40.2 175 40.225 175 43.1375 172.6375 45.4875 169.725 45.4875 166.8125 45.4875 164.4625 43.1375 164.4625 40.225 164.4625 39.925 164.5125 39.6125 164.55 39.325L164.55 11.35C164.55 10.8625 164.175 10.475 163.675 10.475L135.2875 10.475C135.0875 10.4875 134.925 10.525 134.725 10.525 131.825 10.525 129.475 8.175 129.475 5.2625 129.475 2.35 131.825 3.55271368e-15 134.725 3.55271368e-15ZM40.25 174.975 5.25 174.975C2.35 174.975 0 172.6375 0 169.7375L0 134.825C0 134.8 0 134.775 0 134.75 0 131.8375 2.35 129.475 5.25 129.475 8.15 129.475 10.525 131.825 10.525 134.75 10.525 135.05 10.475 135.3625 10.425 135.65L10.425 163.6125C10.425 164.1 10.8125 164.4875 11.2875 164.4875L39.6875 164.4875C39.875 164.475 40.05 164.4375 40.2375 164.4375 43.1375 164.4375 45.5 166.7875 45.5 169.7 45.5 172.6125 43.15 174.975 40.25 174.975ZM134.725 174.975 169.725 174.975C172.625 174.975 174.975 172.625 174.975 169.7375L174.975 134.825C174.975 134.8 175 134.775 175 134.75 175 131.8375 172.6375 129.475 169.725 129.475 166.8125 129.475 164.4625 131.825 164.4625 134.75 164.4625 135.05 164.5125 135.3625 164.55 135.65L164.55 163.6125C164.55 164.1 164.175 164.4875 163.675 164.4875L135.2875 164.4875C135.0875 164.475 134.925 164.4375 134.725 164.4375 131.825 164.4375 129.475 166.7875 129.475 169.7 129.475 172.6125 131.825 174.975 134.725 174.975Z\",\n transform: \"translate(.5 .512)\"\n })\n});\nexport var bgPlaid = /*#__PURE__*/_jsxs(\"svg\", {\n width: \"100%\",\n height: \"100%\",\n preserveAspectRatio: \"none\",\n style: {\n display: 'block'\n },\n children: [/*#__PURE__*/_jsxs(\"pattern\", {\n id: \"pattern\",\n x: \"0\",\n y: \"0\",\n width: \"16\",\n height: \"16\",\n patternUnits: \"userSpaceOnUse\",\n children: [/*#__PURE__*/_jsx(\"rect\", {\n fill: \"rgba(0, 0, 0, 0.06)\",\n x: \"0\",\n width: \"8\",\n height: \"8\",\n y: \"0\"\n }), /*#__PURE__*/_jsx(\"rect\", {\n fill: \"rgba(0, 0, 0, 0.06)\",\n x: \"8\",\n width: \"8\",\n height: \"8\",\n y: \"8\"\n })]\n }), /*#__PURE__*/_jsx(\"rect\", {\n fill: \"url(#pattern)\",\n x: \"0\",\n y: \"0\",\n width: \"100%\",\n height: \"100%\"\n })]\n});\nexport var copy = /*#__PURE__*/_jsx(\"svg\", {\n viewBox: \"0 0 170 185\",\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M153.846154,-3.55271368e-15 L53.8461537,-3.55271368e-15 C45.3846152,-3.55271368e-15 38.4615385,6.92307695 38.4615385,15.3846154 L38.4615385,23.0769232 L130.769231,23.0769232 C139.230769,23.0769232 146.153846,30 146.153846,38.4615385 L146.153846,146.153846 L153.846154,146.153846 C162.307692,146.153846 169.230769,139.230769 169.230769,130.769231 L169.230769,15.3846154 C169.230769,6.92307695 162.307692,-3.55271368e-15 153.846154,-3.55271368e-15 Z M130.769231,53.8461539 C130.769231,45.3846154 123.846154,38.4615385 115.384615,38.4615385 L15.3846154,38.4615385 C6.92307695,38.4615385 3.55271368e-15,45.3846154 3.55271368e-15,53.8461539 L3.55271368e-15,169.230769 C3.55271368e-15,177.692308 6.92307695,184.615385 15.3846154,184.615385 L115.384615,184.615385 C123.846154,184.615385 130.769231,177.692308 130.769231,169.230769 L130.769231,53.8461539 Z M61.5384615,80.7692309 C61.5384615,83.0769232 60,84.6153848 57.6923076,84.6153848 L26.923077,84.6153848 C24.6153846,84.6153848 23.076923,83.0769232 23.076923,80.7692309 L23.076923,73.0769232 C23.076923,70.7692309 24.6153846,69.2307693 26.923077,69.2307693 L57.6923076,69.2307693 C60,69.2307693 61.5384615,70.7692309 61.5384615,73.0769232 L61.5384615,80.7692309 Z M92.3076922,142.307692 C92.3076922,144.615385 90.7692307,146.153846 88.4615385,146.153846 L26.923077,146.153846 C24.6153846,146.153846 23.076923,144.615385 23.076923,142.307692 L23.076923,134.615385 C23.076923,132.307692 24.6153846,130.769231 26.923077,130.769231 L88.4615385,130.769231 C90.7692309,130.769231 92.3076922,132.307692 92.3076922,134.615385 L92.3076922,142.307692 L92.3076922,142.307692 Z M107.692308,111.538462 C107.692308,113.846154 106.153846,115.384615 103.846154,115.384615 L26.923077,115.384615 C24.6153846,115.384615 23.076923,113.846154 23.076923,111.538462 L23.076923,103.846154 C23.076923,101.538462 24.6153846,100 26.923077,100 L103.846154,100 C106.153846,100 107.692308,101.538462 107.692308,103.846154 L107.692308,111.538462 L107.692308,111.538462 Z\"\n })\n});\nexport var copyOk = /*#__PURE__*/_jsx(\"svg\", {\n viewBox: \"0 0 170 185\",\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M153.846154,-3.55271368e-15 L53.8461537,-3.55271368e-15 C45.3846152,-3.55271368e-15 38.4615385,6.92307695 38.4615385,15.3846154 L38.4615385,23.0769232 L130.769231,23.0769232 C139.230769,23.0769232 146.153846,30 146.153846,38.4615385 L146.153846,146.153846 L153.846154,146.153846 C162.307692,146.153846 169.230769,139.230769 169.230769,130.769231 L169.230769,15.3846154 C169.230769,6.92307695 162.307692,-3.55271368e-15 153.846154,-3.55271368e-15 Z M130.769231,53.8461539 C130.769231,45.3846154 123.846154,38.4615385 115.384615,38.4615385 L15.3846154,38.4615385 C6.92307695,38.4615385 3.55271368e-15,45.3846154 3.55271368e-15,53.8461539 L3.55271368e-15,169.230769 C3.55271368e-15,177.692308 6.92307695,184.615385 15.3846154,184.615385 L115.384615,184.615385 C123.846154,184.615385 130.769231,177.692308 130.769231,169.230769 L130.769231,53.8461539 Z M106.941858,105.608333 C110.211682,102.450235 115.409229,102.495402 118.623676,105.709849 C121.838122,108.924296 121.883289,114.121842 118.725191,117.391667 L118.725191,117.391667 L72.8918576,163.225 C69.6376921,166.478183 64.3626897,166.478183 61.1085242,163.225 L61.1085242,163.225 L31.9418576,134.058333 C28.7837592,130.788509 28.828926,125.590962 32.0433729,122.376515 C35.2578198,119.162069 40.4553662,119.116902 43.7251908,122.275 L43.7251908,122.275 L67.0001908,145.55 Z M57.6923076,69.2307693 C60,69.2307693 61.5384615,70.7692309 61.5384615,73.0769232 L61.5384615,80.7692309 C61.5384615,83.0769232 60,84.6153848 57.6923076,84.6153848 L26.923077,84.6153848 C24.6153846,84.6153848 23.076923,83.0769232 23.076923,80.7692309 L23.076923,73.0769232 C23.076923,70.7692309 24.6153846,69.2307693 26.923077,69.2307693 L57.6923076,69.2307693 Z\",\n transform: \"translate(1)\"\n })\n});","import { useMemo } from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function ErrorMessage(props) {\n var {\n message\n } = props;\n return useMemo(() => {\n if (!message) return null;\n return /*#__PURE__*/_jsx(\"pre\", {\n children: /*#__PURE__*/_jsx(\"code\", {\n children: message\n })\n });\n }, [message]);\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"React\", \"ReactDOM\", \"ReactDOMClient\"];\nimport React, { useEffect, useRef } from 'react';\nimport { useState } from 'react';\nimport { babelTransform } from './transform';\nimport ReactDOM from 'react-dom';\nexport var getReactDOMClient = () => {\n var _ReactDOM;\n try {\n // 使用 require 解决 react v17 ts 报错问题\n _ReactDOM = require('react-dom/client');\n } catch (err) {\n // console.warn(`如果使用的是react-dom小于v18的版本,可以忽略此警告:${err}`)\n }\n return _ReactDOM;\n};\nexport function useCodePreview(props) {\n var [demoDom, setDemoDom] = useState();\n var playerId = useRef(\"\" + parseInt(String(Math.random() * 1e9), 10).toString(36));\n var [fullScreen, setFullScreen] = useState(false);\n var [errorMessage, setErrorMessage] = useState('');\n var [showEdit, setShowEdit] = useState(false);\n var [width, setWidth] = useState(1);\n var [copied, setCopied] = useState(false);\n var [code, setCode] = useState(props.code || '');\n var ReactDOMClient = React.useMemo(() => {\n return window.ReactDOM ? window.ReactDOM : getReactDOMClient();\n }, []);\n\n /** 通过缓存的方式 解决 react v18 中 的报错 ***/\n // @ts-ignore\n var cachesRef = React.useRef(new Map([]));\n var ReactDOMRender = _ReactDOM => {\n return {\n createRoot: id => {\n return {\n render: _render => {\n var caches = cachesRef.current;\n var root = caches.get(id);\n // 存在则不需要重新创建直接进行render操作\n if (root) {\n root.render(_render);\n } else {\n // @ts-ignore\n root = _ReactDOM.createRoot(document.getElementById(id));\n root.render(_render);\n // 缓存,解决控制台报 ReactDOMClient.createRoot 问题\n caches.set(id, root);\n }\n cachesRef.current = caches;\n }\n };\n }\n };\n };\n /** ------------------------ ***/\n\n var executeCode = str => {\n var _ref = props.dependencies || {},\n {\n React: _React,\n ReactDOM: _ReactDOM,\n ReactDOMClient: _ReactDOMClient\n } = _ref,\n otherDeps = _objectWithoutPropertiesLoose(_ref, _excluded);\n var V18ReactDOM = _ReactDOMClient || ReactDOMClient || _ReactDOM || ReactDOM;\n // 判断是否是 react v18版本\n var isV18 = Reflect.has(V18ReactDOM, 'createRoot');\n var NewReactDOM = isV18 ? ReactDOMRender(V18ReactDOM) : V18ReactDOM;\n try {\n var deps = _extends({\n React: _React || React\n }, otherDeps, {\n ReactDOM: NewReactDOM\n });\n // const args = ['context', 'React', 'ReactDOM', 'Component'];\n var args = [];\n // const argv = [this, React, ReactDOM, Component];\n var argv = [];\n for (var key in deps) {\n args.push(key);\n argv.push(deps[key]);\n }\n if (isV18) {\n // react < v18 中写法替换\n str = str.replace('ReactDOM.render', \"ReactDOM.createRoot(\\\"\" + playerId.current + \"\\\").render\");\n // react v18 中写法替换\n str = str.replace(\"ReactDOM.createRoot(_mount_)\", \"ReactDOM.createRoot(\\\"\" + playerId.current + \"\\\")\");\n str = str.replace('_mount_', \"\");\n } else {\n str = str.replace('_mount_', \"document.getElementById('\" + playerId.current + \"')\");\n }\n var input = \"\" + str;\n var {\n code: _code\n } = babelTransform(input);\n args.push(_code || '');\n // console.log('code:', argv)\n // eslint-disable-next-line no-new-func\n new Function(...args).apply(null, argv);\n setErrorMessage('');\n } catch (err) {\n var message = '';\n if (err && err.message) {\n message = err.message;\n } else {\n message = JSON.stringify(err);\n }\n setErrorMessage(message);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => executeCode(code), [code, props.noPreview, demoDom]);\n return {\n playerId,\n demoDom,\n setDemoDom,\n fullScreen,\n setFullScreen,\n errorMessage,\n setErrorMessage,\n width,\n setWidth,\n showEdit,\n setShowEdit,\n copied,\n setCopied,\n code,\n setCode,\n executeCode\n };\n}","import { transform } from '@babel/standalone';\nimport RemoveImports from 'babel-plugin-transform-remove-imports';\nexport function babelTransform(input) {\n return transform(input, {\n presets: ['env', 'es2015', 'react'],\n plugins: [[RemoveImports, {\n removeAll: true\n }]]\n });\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"style\", \"prefixCls\", \"className\", \"theme\", \"editProps\", \"codePenOption\", \"codeSandboxOption\", \"code\", \"dependencies\", \"btnText\", \"btnHideText\", \"onlyEdit\", \"bordered\", \"noCode\", \"noPreview\", \"noScroll\", \"bgWhite\"];\nimport React, { useRef, useEffect, useImperativeHandle } from 'react';\nimport CodeMirror from '@uiw/react-codemirror';\nimport copyTextToClipboard from '@uiw/copy-to-clipboard';\nimport { javascript } from '@codemirror/lang-javascript';\nimport Split from '@uiw/react-split';\nimport ThirdPartyButton from './ThirdPartyButton';\nimport * as icon from './icon';\nimport { ErrorMessage } from './ErrorMessage';\nimport { useCodePreview } from './useCodePreview';\nimport \"./index.css\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nvar CodePreview = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n style,\n prefixCls = 'w-code-preview',\n className,\n theme = 'light',\n editProps = {},\n codePenOption,\n codeSandboxOption,\n code: _Code = '',\n dependencies = {},\n btnText = 'Code',\n btnHideText = 'Hide Editor',\n onlyEdit = false,\n bordered = true,\n noCode = false,\n noPreview = false,\n noScroll = false,\n bgWhite = false\n } = props,\n otherProps = _objectWithoutPropertiesLoose(props, _excluded);\n var {\n playerId,\n setDemoDom,\n code,\n setCode,\n fullScreen,\n setFullScreen,\n errorMessage,\n width,\n setWidth,\n showEdit,\n setShowEdit,\n copied,\n setCopied\n } = useCodePreview(_extends({\n code: _Code,\n dependencies\n }, props));\n var demoRef = useRef(null);\n var editor = useRef(null);\n useImperativeHandle(ref, () => ({\n editor: editor,\n demo: demoRef.current\n }), [editor, demoRef]);\n var isOneItem = !noCode && !noPreview ? false : !noCode || !noPreview;\n var visiable = width === 1 ? false : [isOneItem ? 1 : 2];\n var cls = [className, prefixCls, noScroll ? prefixCls + \"-noScroll\" : null, isOneItem ? prefixCls + \"-OneItem\" : null, bordered ? prefixCls + \"-bordered\" : null, fullScreen ? prefixCls + \"-fullScreen\" : null].filter(Boolean).join(' ').trim();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => setCode(_Code), [_Code]);\n useEffect(() => {\n if (demoRef.current) {\n setDemoDom(demoRef.current);\n }\n window.addEventListener('popstate', e => {\n document.body.style.overflow = 'inherit';\n }, false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n var transitionend = () => setShowEdit(width !== 1);\n useEffect(() => {\n var dom = demoRef.current;\n if (dom) {\n dom.addEventListener('transitionend', transitionend);\n }\n return () => {\n if (dom) {\n dom.removeEventListener('transitionend', transitionend);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [width]);\n var handleChange = (value, viewUpdate) => {\n setCode(value);\n if (editProps && editProps.onChange) {\n editProps.onChange(value, viewUpdate);\n }\n };\n var onSwitchSource = () => {\n setWidth(width === 1 ? '50%' : 1);\n setShowEdit(true);\n };\n var onCopyCode = () => {\n copyTextToClipboard(code || '', isCopy => setCopied(isCopy));\n setTimeout(() => setCopied(false), 2000);\n };\n var onFullScreen = () => {\n setFullScreen(!fullScreen);\n document.body.style.overflow = !fullScreen ? 'hidden' : 'inherit';\n if (!fullScreen && demoRef.current) {\n demoRef.current.style.maxWidth = 'inherit';\n }\n };\n return /*#__PURE__*/_jsxs(Split, _extends({\n \"data-color-mode\": theme,\n visiable: visiable,\n className: cls,\n style: _extends({\n flex: 1\n }, style)\n }, otherProps, {\n children: [!noPreview && !onlyEdit && /*#__PURE__*/_jsxs(\"div\", {\n className: [prefixCls + \"-demo\", !bgWhite ? prefixCls + \"-demo-bgPlaid\" : null, errorMessage ? prefixCls + \"-demo-error\" : null].filter(Boolean).join(' ').trim(),\n style: _extends({\n flex: 1\n }, width === 1 ? {\n width: '100%'\n } : {}),\n children: [/*#__PURE__*/_jsx(ErrorMessage, {\n message: errorMessage\n }), /*#__PURE__*/_jsx(\"div\", {\n className: [prefixCls + \"-demo-source\", errorMessage ? 'error' : null].filter(Boolean).join(' ').trim(),\n id: playerId.current\n })]\n }), (!noCode || onlyEdit) && /*#__PURE__*/_jsx(\"div\", {\n ref: demoRef,\n style: {\n overflow: 'hidden',\n width: onlyEdit ? '100%' : width\n },\n children: (showEdit || onlyEdit) && /*#__PURE__*/_jsx(CodeMirror, _extends({\n value: (code || '').replace(/\\n$/, ''),\n ref: editor,\n theme: theme,\n extensions: [javascript({\n jsx: true\n })]\n }, editProps, {\n style: {\n height: '100%'\n },\n height: \"100%\",\n onChange: handleChange\n }))\n }), !isOneItem && !(noCode && noPreview) && !onlyEdit && /*#__PURE__*/_jsxs(\"div\", {\n style: {\n flex: 1,\n width: 29\n },\n className: prefixCls + \"-bar\",\n children: [/*#__PURE__*/_jsx(ThirdPartyButton, {\n prefixCls: prefixCls,\n codePenOption: codePenOption,\n codeSandboxOption: codeSandboxOption\n }), /*#__PURE__*/_jsx(\"div\", {\n className: prefixCls + \"-bar-btn\",\n onClick: onSwitchSource,\n children: width === 1 ? btnText : btnHideText\n }), /*#__PURE__*/_jsx(\"div\", {\n className: [prefixCls + \"-bar-iconbtns\", copied ? prefixCls + \"-bar-copied\" : null].filter(Boolean).join(' ').trim(),\n onClick: onCopyCode,\n children: copied ? icon.copyOk : icon.copy\n }), /*#__PURE__*/_jsx(\"div\", {\n className: [prefixCls + \"-bar-iconbtns\", fullScreen ? prefixCls + \"-bar-copied\" : null].filter(Boolean).join(' ').trim(),\n onClick: onFullScreen,\n children: icon.full\n })]\n })]\n }));\n});\nCodePreview.displayName = 'CodePreview';\nexport default CodePreview;","import React, { Fragment, useState, useEffect } from 'react';\nimport CodePreview from '../';\nimport { Switch } from 'uiw';\nimport * as UIW from 'uiw';\n\nconst defaultCode = `\nimport { Button, Divider, Icon } from 'uiw';\nimport ReactDOM from 'react-dom/client';\n\nReactDOM.createRoot(_mount_).render(\n
\n \n \n \n \n \n \n
,\n);`;\n\nconst Example = () => {\n const [theme, setTheme] = useState<'light' | 'dark'>('light');\n const [code] = useState(defaultCode);\n const [state, setState] = useState({\n bgWhite: false,\n noCode: false,\n noScroll: false,\n noPreview: false,\n bordered: true,\n codeSandbox: {\n files: {\n 'sandbox.config.json': {\n content: `{\n \"template\": \"node\",\n \"container\": {\n \"startScript\": \"start\",\n \"node\": \"14\"\n }\n }`,\n },\n 'public/index.html': {\n content: `
`,\n },\n 'src/index.js': {\n content: code.replace('_mount_', 'document.getElementById(\"root\")'),\n },\n 'src/index.less': {\n content: '',\n },\n '.kktrc.js': {\n content: `import webpack from \"webpack\";\\nimport lessModules from \"@kkt/less-modules\";\\nexport default (conf, env, options) => {\\nconf = lessModules(conf, env, options);\\nreturn conf;\\n};`,\n },\n 'package.json': {\n content: {\n dependencies: {\n react: 'latest',\n 'react-dom': 'latest',\n uiw: 'latest',\n },\n devDependencies: {\n '@kkt/less-modules': '6.0.11',\n kkt: '6.0.11',\n typescript: '4.1.3',\n },\n scripts: {\n start: 'kkt start',\n build: 'kkt build',\n test: 'kkt test --env=jsdom',\n },\n browserslist: ['>0.2%', 'not dead', 'not ie <= 11', 'not op_mini all'],\n },\n },\n },\n },\n codeSandboxShow: true,\n codePenShow: true,\n codePen: {\n includeModule: ['uiw'],\n title: 'React Code Preview - demo',\n html: '
',\n js: code.replace('_mount_', 'document.getElementById(\"root\")'),\n css_external: 'https://unpkg.com/uiw@3.2.6/dist/uiw.min.css',\n js_external: `https://unpkg.com/react@18.x/umd/react.development.js;https://unpkg.com/react-dom@18.x/umd/react-dom.development.js;https://unpkg.com/uiw@4.7.2/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.12/index.js`,\n },\n });\n function handleChange(keyName: string, e: React.ChangeEvent) {\n const newstate = { ...state, [`${keyName}`]: e.target.checked };\n setState({ ...newstate });\n }\n\n useEffect(() => {\n setTheme(document.documentElement.getAttribute('data-color-mode') === 'dark' ? 'dark' : 'light');\n document.addEventListener('colorschemechange', (e: any) => {\n setTheme(e.detail.colorScheme);\n });\n }, []);\n\n return (\n \n {\n setState({\n ...state,\n codeSandbox: {\n ...state.codeSandbox,\n files: {\n ...state.codeSandbox.files,\n 'src/index.js': {\n content: value,\n },\n },\n },\n codePen: {\n ...state.codePen,\n js: value,\n },\n });\n },\n }}\n noPreview={state.noPreview}\n codeSandboxOption={state.codeSandboxShow ? state.codeSandbox : undefined}\n codePenOption={state.codePenShow ? state.codePen : undefined}\n />\n
\n \n 背景 `bgWhite={state.bgWhite.toString()}`\n \n
\n \n 是否显示代码 `noCode={state.noCode.toString()}`\n \n
\n \n 是否显示实例预览 `noPreview={state.noPreview.toString()}`\n \n
\n \n 是否显示滚动条 `noScroll={state.noScroll.toString()}`\n \n
\n \n 是否显示边框 `bordered={state.bordered.toString()}`\n \n
\n \n 是否显示 CodePen 按钮 `codePenOption={state.codePenShow ? '{...}' : 'undefined'}`\n \n
\n \n 是否显示 CodeSandbox 按钮 `codeSandboxOption={state.codeSandboxShow ? '{...}' : 'undefined'}`\n \n
\n
\n );\n};\n\nexport default Example;\n","import React from 'react';\nimport GitHubCorners from '@uiw/react-github-corners';\nimport Markdown from '@uiw/react-markdown-preview';\nimport '@wcj/dark-mode';\nimport DocumentStr from '../README.md';\nimport styles from './App.module.less';\nimport Example from './Example';\nimport pkgJson from '../package.json';\n\nexport default function App() {\n const version = pkgJson.version;\n let DocumentStrSource = DocumentStr;\n if (DocumentStrSource) DocumentStrSource = DocumentStr.replace(/([\\s\\S]*)/, '');\n return (\n
\n \n \n

\n React Code Preview {version}\n

\n \n \n
\n );\n}\n","import React from 'react';\n// import ReactDOM from 'react-dom';\nimport ReactDOM from 'react-dom/client';\nimport '@uiw/reset.css/reset.less';\nimport App from './App';\n\n/**\n * 增加一个❕,解决ts报错的问题\n * 因为 `document.getElementById('root')`有可能为null\n * @see https://github.com/uiwjs/react-code-preview/issues/229\n */\nReactDOM.createRoot(document.getElementById('root')!).render(\n \n \n ,\n);\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t792: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunk_uiw_react_code_preview\"] = self[\"webpackChunk_uiw_react_code_preview\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [265,257,759,587,362,499], () => (__webpack_require__(6609)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["webpackEmptyContext","req","e","Error","code","keys","resolve","id","module","exports","_excluded","props","codePenOption","codeSandboxOption","prefixCls","_ref","includeModule","otherCodePenOptions","_objectWithoutPropertiesLoose","js","include","join","replace","str","RegExp","test","_jsxs","className","children","_jsx","Codepen","_extends","height","fill","viewBox","d","CodeSandbox","full","transform","copy","copyOk","ErrorMessage","message","useMemo","useCodePreview","demoDom","setDemoDom","useState","playerId","useRef","parseInt","String","Math","random","toString","fullScreen","setFullScreen","errorMessage","setErrorMessage","showEdit","setShowEdit","width","setWidth","copied","setCopied","setCode","ReactDOMClient","React","window","ReactDOM","getReactDOMClient","_ReactDOM","require","err","cachesRef","Map","executeCode","dependencies","_React","_ReactDOMClient","otherDeps","V18ReactDOM","isV18","Reflect","has","NewReactDOM","createRoot","render","_render","caches","current","root","get","document","getElementById","set","ReactDOMRender","deps","args","argv","key","push","input","_code","presets","plugins","RemoveImports","removeAll","babelTransform","Function","apply","JSON","stringify","useEffect","noPreview","CodePreview","ref","style","theme","editProps","_Code","btnText","btnHideText","onlyEdit","bordered","noCode","noScroll","bgWhite","otherProps","demoRef","editor","useImperativeHandle","demo","isOneItem","visiable","cls","filter","Boolean","trim","addEventListener","body","overflow","transitionend","dom","removeEventListener","Split","flex","CodeMirror","value","extensions","javascript","jsx","onChange","handleChange","viewUpdate","ThirdPartyButton","onClick","onSwitchSource","onCopyCode","copyTextToClipboard","isCopy","setTimeout","icon","onFullScreen","maxWidth","displayName","Example","setTheme","state","setState","codeSandbox","files","content","react","uiw","devDependencies","kkt","typescript","scripts","start","build","browserslist","codeSandboxShow","codePenShow","codePen","title","html","css_external","js_external","keyName","newstate","concat","target","checked","documentElement","getAttribute","detail","colorScheme","Fragment","UIW","undefined","Switch","bind","App","version","pkgJson","DocumentStrSource","DocumentStr","styles","light","dark","position","left","top","GitHubCorners","fixed","href","Markdown","paddingTop","source","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","call","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","every","splice","r","n","getter","__esModule","a","definition","o","defineProperty","enumerable","g","globalThis","this","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","chunkLoadingGlobal","self","forEach","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"static/js/main.19920c0d.js","mappings":"sBAAA,SAASA,EAAoBC,GAC5B,IAAIC,EAAI,IAAIC,MAAM,uBAAyBF,EAAM,KAEjD,MADAC,EAAEE,KAAO,mBACHF,CACP,CACAF,EAAoBK,KAAO,IAAM,GACjCL,EAAoBM,QAAUN,EAC9BA,EAAoBO,GAAK,KACzBC,EAAOC,QAAUT,C,yFCRjB,qhMCCA,EAA0B,qBAA1B,EAAuD,mB,qGCCnDU,EAAY,CAAC,iBAiDjB,QA5CuBC,IACrB,IAAI,cACFC,EAAa,kBACbC,EAAiB,UACjBC,GACEH,GAAS,CAAC,EACVI,EAAOH,GAAiB,CAAC,GAC3B,cACEI,GACED,EACJE,GAAsBC,EAAAA,EAAAA,GAA8BH,EAAML,GAC5D,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AAoB2B,EAAEiB,EAAa3C,KACrCD,EAAoBK,EAAEJ,GAAY2C,EAAY3C,IAGhD,GAAG4C,EAAS,IAAIrC,EAASqC,EAAQ7C,EAClC,CAEA,IADG0C,GAA4BA,EAA2BC,GACrD7B,EAAIL,EAASM,OAAQD,IACzB0B,EAAU/B,EAASK,GAChBd,EAAoB2B,EAAEY,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOxC,EAAoBO,EAAEC,EAAO,EAGjCuC,EAAqBC,KAA0C,oCAAIA,KAA0C,qCAAK,GACtHD,EAAmBE,QAAQR,EAAqB5D,KAAK,KAAM,IAC3DkE,EAAmBvK,KAAOiK,EAAqB5D,KAAK,KAAMkE,EAAmBvK,KAAKqG,KAAKkE,G,KC/CvF,IAAIG,EAAsBlD,EAAoBO,OAAE5B,EAAW,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM,IAAOqB,EAAoB,QACjHkD,EAAsBlD,EAAoBO,EAAE2C,E","sources":["../node_modules/@babel/standalone|sync","../README.md","webpack://@uiw/react-code-preview/./website/App.module.less?cfe1","../esm/ThirdPartyButton.js","../esm/icon.js","../esm/ErrorMessage.js","../esm/useCodePreview.js","../esm/transform.js","../esm/index.js","Example.tsx","App.tsx","index.tsx","../webpack/bootstrap","../webpack/runtime/chunk loaded","../webpack/runtime/compat get default export","../webpack/runtime/define property getters","../webpack/runtime/global","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/make namespace object","../webpack/runtime/jsonp chunk loading","../webpack/startup"],"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 = 5764;\nmodule.exports = webpackEmptyContext;","export default \"## React Code Preview\\n\\n\\n\\n[![Build & Deploy](https://github.com/uiwjs/react-code-preview/workflows/Build%20&%20Deploy/badge.svg)](https://github.com/uiwjs/react-code-preview/actions)\\n[![Release](https://img.shields.io/github/release/uiwjs/react-code-preview)](https://github.com/uiwjs/react-code-preview/releases)\\n[![npm version](https://img.shields.io/npm/v/@uiw/react-code-preview.svg)](https://www.npmjs.com/package/@uiw/react-code-preview)\\n[![Gitee](https://jaywcjlove.github.io/sb/ico/gitee.svg)](https://uiw.gitee.io/react-code-preview/)\\n\\nCode edit preview for React. Preview Demo: https://uiwjs.github.io/react-code-preview\\n\\nThere are often a lot of sample code in the documentation. We hope that you can run the sample code to view the rendering interface as you read the document.\\n\\n## Install\\n\\n```bash\\nnpm install @uiw/react-code-preview --save\\n```\\n\\n## Usage\\n\\n### In React 18\\n\\n[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/uiw-react-code-preview-react-18-1bmhhd?fontsize=14&hidenavigation=1&theme=dark)\\n\\n```jsx\\nimport Button from '@uiw/react-button';\\nimport CodePreview from '@uiw/react-code-preview';\\n\\nconst code = `import Button from '@uiw/react-button';\\nimport ReactDOM from 'react-dom/client';\\n\\nReactDOM.createRoot(_mount_).render(\\n
\\n \\n \\n
,\\n);`;\\n\\nexport default function App() {\\n return ;\\n}\\n```\\n\\n### In React 17\\n\\n[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/uiw-react-code-preview-react-17-t6ro9?fontsize=14&hidenavigation=1&theme=dark)\\n\\n```jsx\\nimport Button from '@uiw/react-button';\\nimport CodePreview from '@uiw/react-code-preview';\\n\\nconst code = `import Button from '@uiw/react-button';\\nimport ReactDOM from 'react-dom';\\n\\nReactDOM.render(\\n
\\n \\n \\n
,\\n _mount_\\n);`;\\n\\nexport default function App() {\\n return ;\\n}\\n```\\n\\n- `_mount_` Special strings, the compilation will be replaced.\\n\\n### Props\\n\\n```typescript\\ninterface CodePreviewProps extends SplitProps {\\n prefixCls?: string;\\n style?: React.CSSProperties;\\n /**\\n * To specify a CSS class, use the className attribute.\\n */\\n className?: string;\\n /**\\n * Whether to display the border.\\n */\\n bordered?: boolean;\\n /**\\n * `JSX` source code\\n */\\n code?: string;\\n /**\\n * Whether to display the code interface.\\n */\\n noCode?: boolean;\\n /**\\n * Is the background white or plaid?\\n */\\n bgWhite?: boolean;\\n /**\\n * Only show Edit\\n */\\n onlyEdit?: boolean;\\n /**\\n * Whether to display the preview interface.\\n */\\n noPreview?: boolean;\\n /**\\n * Preview area does not display scroll bars\\n */\\n noScroll?: boolean;\\n /**\\n * Modify ReactCodemirror props.\\n */\\n editProps?: ReactCodeMirrorProps;\\n /**\\n * Dependent component\\n */\\n dependencies?: Record;\\n codePenOption?: CodepenProps & {\\n /**\\n * Packages that do not require comments.\\n * @example ['uiw']\\n */\\n includeModule?: string[];\\n };\\n codeSandboxOption?: CodeSandboxProps;\\n /** @default 'Code' */\\n btnText?: string;\\n /** @default 'Hide Editor' */\\n btnHideText?: string;\\n /**\\n * `light` / `dark` / `Extension` Defaults to `light`.\\n * @default light\\n */\\n theme?: ReactCodeMirrorProps['theme'];\\n}\\n```\\n\\n```typescript\\ntype CodePenOption = {\\n title?: string;\\n html?: string;\\n js?: string;\\n css?: string;\\n editors?: string;\\n css_external?: string;\\n js_external?: string;\\n js_pre_processor?: string;\\n};\\ntype CodepenProps = CodePenOption & React.FormHTMLAttributes;\\n```\\n\\n```typescript\\ntype CodeSandboxProps = React.FormHTMLAttributes & {\\n /**\\n * Whether we should redirect to the embed instead of the editor.\\n */\\n embed?: boolean;\\n /**\\n * The query that will be used in the redirect url. `embed` must be equal to `true`, `embed=true`.\\n * [CodeSandbox Embed Options](https://codesandbox.io/docs/embedding#embed-options)\\n * @example `view=preview&runonclick=1`\\n */\\n query?: string;\\n /**\\n * Instead of redirecting we will send a JSON reponse with `{\\\"sandbox_id\\\": sandboxId}`.\\n */\\n json?: boolean;\\n /**\\n * Parameters used to define how the sandbox should be created.\\n */\\n files?: Record<\\n string,\\n {\\n content?: string | Record;\\n isBinary?: boolean;\\n }\\n >;\\n};\\n```\\n\\n## Development\\n\\nThe components are placed in the [`src`](./src) directory.\\n\\n```bash\\nnpm run watch # Listen compile .tsx files.\\nnpm run build # compile .tsx files.\\n\\nnpm run doc\\n```\\n\\n### Related\\n\\n- [@uiw/react-markdown-preview](https://github.com/uiwjs/react-markdown-preview): React component preview markdown text in web browser.\\n- [@uiw/react-codemirror](https://github.com/uiwjs/react-codemirror): CodeMirror component for React. @codemirror\\n- [@uiw/react-monacoeditor](https://github.com/jaywcjlove/react-monacoeditor): Monaco Editor component for React.\\n- [@uiw/react-markdown-editor](https://github.com/uiwjs/react-markdown-editor): A markdown editor with preview, implemented with React.js and TypeScript.\\n- [@uiw/react-md-editor](https://github.com/uiwjs/react-md-editor): A simple markdown editor with preview, implemented with React.js and TypeScript.\\n\\n## Contributors\\n\\nAs always, thanks to our amazing contributors!\\n\\n\\n \\n\\n\\nMade with [github-action-contributors](https://github.com/jaywcjlove/github-action-contributors).\\n\\n### License\\n\\nLicensed under the MIT License.\\n\";","// extracted by mini-css-extract-plugin\nexport default {\"warpper\":\"App_warpper__3j1r1\",\"title\":\"App_title__Uj2m0\"};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"includeModule\"];\nimport React from 'react';\nimport CodeSandbox from '@uiw/react-codesandbox';\nimport Codepen from '@uiw/react-codepen';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nvar ThirdPartyButton = props => {\n var {\n codePenOption,\n codeSandboxOption,\n prefixCls\n } = props || {};\n var _ref = codePenOption || {},\n {\n includeModule\n } = _ref,\n otherCodePenOptions = _objectWithoutPropertiesLoose(_ref, _excluded);\n if (otherCodePenOptions && otherCodePenOptions.js) {\n var include = (includeModule || []).join('|');\n otherCodePenOptions.js = otherCodePenOptions.js.replace(/import([\\s\\S]*?)(?=['\"])['\"].*['\"]( *;|;)?/gm, str => {\n // eslint-disable-next-line no-useless-escape\n if (include && new RegExp(\"from\\\\s+['\\\"](\" + include + \")['\\\"](s.+)?;?\").test(str)) {\n return str;\n }\n return \"/** \" + str + \" **/\";\n });\n }\n return /*#__PURE__*/_jsxs(\"div\", {\n className: prefixCls + \"-thirdparty\",\n children: [codePenOption && /*#__PURE__*/_jsx(Codepen, _extends({}, otherCodePenOptions, {\n children: /*#__PURE__*/_jsx(\"svg\", {\n height: \"12\",\n fill: \"currentColor\",\n viewBox: \"0 0 69 69\",\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M68.974125,23.6022271 C68.9669375,23.556228 68.956875,23.5159788 68.951125,23.4728545 C68.9369583,23.3892382 68.9192128,23.3062677 68.8979375,23.2241717 C68.885,23.1752977 68.8663125,23.127861 68.8505,23.0804244 C68.8278442,23.0077868 68.8029153,22.9358778 68.77575,22.8648035 C68.7562939,22.8157401 68.7342205,22.7677555 68.709625,22.7210562 C68.6804108,22.6530301 68.6463004,22.5872128 68.6075625,22.5241224 C68.5816874,22.4766857 68.5515,22.4321241 68.52275,22.386125 C68.4142531,22.2169066 68.2885197,22.0593814 68.1475625,21.9160713 C68.10875,21.8772595 68.0728125,21.8355728 68.0325625,21.8010735 C67.9775701,21.7523865 67.9214935,21.704938 67.864375,21.6587636 C67.818375,21.6242643 67.77525,21.589765 67.72925,21.5581406 L67.680375,21.5207662 L36.1445,0.497723998 C35.1485978,-0.165907999 33.8514022,-0.165907999 32.8555,0.497723998 L1.32106248,21.5207662 L1.27218748,21.5581406 C1.16574994,21.6321432 1.06485681,21.713817 0.970312494,21.8025109 C0.928625004,21.8355728 0.891249961,21.8772595 0.850999999,21.9160713 C0.800687478,21.9678203 0.750375025,22.0224443 0.704374952,22.0770683 C0.618968308,22.1722554 0.543358166,22.275796 0.47868744,22.386125 L0.392437472,22.5241224 C0.355916851,22.587711 0.322339729,22.6529454 0.291812498,22.7196187 C0.235417041,22.8356642 0.187844895,22.9557936 0.149499967,23.0789869 C0.133687434,23.127861 0.11643744,23.1752977 0.103499962,23.2241717 C0.0819374527,23.3046702 0.0675624468,23.3880436 0.0517499808,23.4728545 C0.0431249503,23.5159787 0.0330624597,23.5562279 0.0273124842,23.6022271 C0.0114999508,23.7272873 0,23.8566599 0,23.9874699 L0,45.0105121 C0,45.1398847 0.0115000182,45.2692572 0.0287499444,45.3986298 C0.0330624597,45.4403165 0.0431249503,45.4834407 0.0517499808,45.5265649 C0.0661249867,45.6113758 0.0819374527,45.6918743 0.103499962,45.7752478 C0.11643744,45.8241218 0.133687434,45.8715585 0.149499967,45.918995 C0.172499936,45.9908687 0.195499972,46.0627423 0.227124972,46.1360534 C0.245812493,46.1849275 0.27024999,46.2309267 0.290374971,46.2798007 C0.323437498,46.3459245 0.355062497,46.4106108 0.392437472,46.478172 C0.421187484,46.5227337 0.448499968,46.5687328 0.47868744,46.6132945 C0.585037244,46.7827707 0.710436736,46.9395172 0.852437459,47.0804732 C0.979968483,47.2145679 1.12112666,47.3350078 1.27362494,47.4398414 L1.32106248,47.4786532 L32.8555,68.5016954 C33.8511677,69.1661015 35.1488322,69.1661015 36.1445,68.5016954 L67.680375,47.4786532 L67.72925,47.4412789 C67.77525,47.4096545 67.818375,47.3751552 67.864375,47.3406558 C67.9215088,47.2940078 67.9775854,47.2460798 68.0325625,47.1969085 C68.0728125,47.1609716 68.10875,47.1221599 68.1475625,47.0819107 C68.2902677,46.9406867 68.4161661,46.7834372 68.52275,46.6132945 C68.5515,46.5672953 68.5816874,46.5227337 68.6075625,46.478172 C68.646375,46.4106108 68.6794375,46.3459245 68.7081875,46.2798007 C68.732625,46.2309267 68.7570625,46.1849275 68.77575,46.1360534 C68.8045,46.0641798 68.8275,45.9908687 68.8505,45.918995 C68.8663125,45.8715584 68.885,45.8241218 68.8979375,45.7752478 C68.9195,45.6918743 68.9353125,45.6113759 68.951125,45.5265649 C68.956875,45.4834407 68.9669375,45.4403165 68.974125,45.4000673 C68.991375,45.2706947 69,45.1413222 69,45.0119496 L69,23.9889074 C69,23.8566599 68.991375,23.7272873 68.974125,23.6022271 Z M38,9 L61,24.1907448 L50.7281277,31 L38.0014231,22.5649276 L38.0014231,9 L38,9 Z M30.997154,9 L30.997154,22.5649276 L18.2740828,31 L8,24.1907448 L31,9 L30.997154,9 Z M6,29 L13,34 L6,39 L6,29 L6,29 Z M31,60 L8,44.8082815 L18.2732954,38 L30.9971538,46.434203 L30.9971538,60 L31,60 Z M34.4985607,41 L24,34 L34.4985607,27 L45,34 L34.4985607,41 Z M38,60 L38,46.4333333 L50.7268564,38 L61,44.8073077 L38,60 L38,60 Z M63,39 L56,34 L63,29 L63,39 L63,39 Z\"\n })\n })\n })), codeSandboxOption && /*#__PURE__*/_jsx(CodeSandbox, _extends({}, codeSandboxOption, {\n children: /*#__PURE__*/_jsx(\"svg\", {\n height: \"12\",\n fill: \"currentColor\",\n viewBox: \"0 0 69 69\",\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M32,38.2764838 L11,24 L11,35.7160031 L22.0526316,43.2306536 L22.0526316,54.3200601 L32,60 L32,38.2764838 Z M38,38.2764838 L38,60 L47.9473684,54.3200601 L47.9473684,43.2306536 L59,35.7160031 L59,24 L38,38.2764838 Z M46.296506,13 L35.5021904,21.0761293 L24.7078748,13.004586 L15,18.6913552 L35.5021904,33 L56,18.6913552 L46.296506,13.004586 L46.296506,13 Z M37.1676303,0.571217481 L63.7371606,15.5989936 C65.1342563,16.3900364 66,17.8813846 66,19.4990592 L66,49.4964682 C66.0011469,51.1157433 65.1356391,52.6091811 63.7371606,53.4010064 L37.1676303,68.4287825 C35.8224939,69.1904058 34.1819333,69.1904058 32.8367968,68.4287825 L6.26726663,53.4010064 C4.86707992,52.6103421 4,51.1166819 4,49.4964682 L4,19.4990592 C4,17.8813846 4.86574257,16.3900364 6.26283836,15.5989936 L32.8323686,0.571217481 C34.1775051,-0.190405827 35.8180656,-0.190405827 37.1632021,0.571217481 L37.1676303,0.571217481 Z\"\n })\n })\n }))]\n });\n};\nexport default ThirdPartyButton;","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport var full = /*#__PURE__*/_jsx(\"svg\", {\n viewBox: \"0 0 176 176\",\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M40.25 8.8817842e-15 5.25 8.8817842e-15C2.35 8.8817842e-15 0 2.35 0 5.25L0 40.15C0 40.175 0 40.2 0 40.225 0 43.1375 2.35 45.4875 5.25 45.4875 8.15 45.4875 10.525 43.1375 10.525 40.225 10.525 39.925 10.475 39.6125 10.425 39.325L10.425 11.35C10.425 10.8625 10.8125 10.475 11.2875 10.475L39.6875 10.475C39.875 10.4875 40.0625 10.525 40.25 10.525 43.15 10.525 45.5125 8.175 45.5125 5.2625 45.5125 2.35 43.15 8.8817842e-15 40.25 8.8817842e-15ZM143.136561 140.373919C143.136561 142.009731 141.787547 143.3375 140.162358 143.3375L34.0895201 143.3375C32.4537083 143.3375 31.1259389 142.009731 31.1259389 140.373919L31.1259389 34.3117033C31.1259389 32.6652693 32.4537083 31.3375 34.0895201 31.3375L140.162358 31.3375C141.787547 31.3375 143.136561 32.6652693 143.136561 34.3117033L143.136561 140.373919ZM134.725 3.55271368e-15 169.725 3.55271368e-15C172.625 3.55271368e-15 174.975 2.35 174.975 5.25L174.975 40.15C174.975 40.175 175 40.2 175 40.225 175 43.1375 172.6375 45.4875 169.725 45.4875 166.8125 45.4875 164.4625 43.1375 164.4625 40.225 164.4625 39.925 164.5125 39.6125 164.55 39.325L164.55 11.35C164.55 10.8625 164.175 10.475 163.675 10.475L135.2875 10.475C135.0875 10.4875 134.925 10.525 134.725 10.525 131.825 10.525 129.475 8.175 129.475 5.2625 129.475 2.35 131.825 3.55271368e-15 134.725 3.55271368e-15ZM40.25 174.975 5.25 174.975C2.35 174.975 0 172.6375 0 169.7375L0 134.825C0 134.8 0 134.775 0 134.75 0 131.8375 2.35 129.475 5.25 129.475 8.15 129.475 10.525 131.825 10.525 134.75 10.525 135.05 10.475 135.3625 10.425 135.65L10.425 163.6125C10.425 164.1 10.8125 164.4875 11.2875 164.4875L39.6875 164.4875C39.875 164.475 40.05 164.4375 40.2375 164.4375 43.1375 164.4375 45.5 166.7875 45.5 169.7 45.5 172.6125 43.15 174.975 40.25 174.975ZM134.725 174.975 169.725 174.975C172.625 174.975 174.975 172.625 174.975 169.7375L174.975 134.825C174.975 134.8 175 134.775 175 134.75 175 131.8375 172.6375 129.475 169.725 129.475 166.8125 129.475 164.4625 131.825 164.4625 134.75 164.4625 135.05 164.5125 135.3625 164.55 135.65L164.55 163.6125C164.55 164.1 164.175 164.4875 163.675 164.4875L135.2875 164.4875C135.0875 164.475 134.925 164.4375 134.725 164.4375 131.825 164.4375 129.475 166.7875 129.475 169.7 129.475 172.6125 131.825 174.975 134.725 174.975Z\",\n transform: \"translate(.5 .512)\"\n })\n});\nexport var bgPlaid = /*#__PURE__*/_jsxs(\"svg\", {\n width: \"100%\",\n height: \"100%\",\n preserveAspectRatio: \"none\",\n style: {\n display: 'block'\n },\n children: [/*#__PURE__*/_jsxs(\"pattern\", {\n id: \"pattern\",\n x: \"0\",\n y: \"0\",\n width: \"16\",\n height: \"16\",\n patternUnits: \"userSpaceOnUse\",\n children: [/*#__PURE__*/_jsx(\"rect\", {\n fill: \"rgba(0, 0, 0, 0.06)\",\n x: \"0\",\n width: \"8\",\n height: \"8\",\n y: \"0\"\n }), /*#__PURE__*/_jsx(\"rect\", {\n fill: \"rgba(0, 0, 0, 0.06)\",\n x: \"8\",\n width: \"8\",\n height: \"8\",\n y: \"8\"\n })]\n }), /*#__PURE__*/_jsx(\"rect\", {\n fill: \"url(#pattern)\",\n x: \"0\",\n y: \"0\",\n width: \"100%\",\n height: \"100%\"\n })]\n});\nexport var copy = /*#__PURE__*/_jsx(\"svg\", {\n viewBox: \"0 0 170 185\",\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M153.846154,-3.55271368e-15 L53.8461537,-3.55271368e-15 C45.3846152,-3.55271368e-15 38.4615385,6.92307695 38.4615385,15.3846154 L38.4615385,23.0769232 L130.769231,23.0769232 C139.230769,23.0769232 146.153846,30 146.153846,38.4615385 L146.153846,146.153846 L153.846154,146.153846 C162.307692,146.153846 169.230769,139.230769 169.230769,130.769231 L169.230769,15.3846154 C169.230769,6.92307695 162.307692,-3.55271368e-15 153.846154,-3.55271368e-15 Z M130.769231,53.8461539 C130.769231,45.3846154 123.846154,38.4615385 115.384615,38.4615385 L15.3846154,38.4615385 C6.92307695,38.4615385 3.55271368e-15,45.3846154 3.55271368e-15,53.8461539 L3.55271368e-15,169.230769 C3.55271368e-15,177.692308 6.92307695,184.615385 15.3846154,184.615385 L115.384615,184.615385 C123.846154,184.615385 130.769231,177.692308 130.769231,169.230769 L130.769231,53.8461539 Z M61.5384615,80.7692309 C61.5384615,83.0769232 60,84.6153848 57.6923076,84.6153848 L26.923077,84.6153848 C24.6153846,84.6153848 23.076923,83.0769232 23.076923,80.7692309 L23.076923,73.0769232 C23.076923,70.7692309 24.6153846,69.2307693 26.923077,69.2307693 L57.6923076,69.2307693 C60,69.2307693 61.5384615,70.7692309 61.5384615,73.0769232 L61.5384615,80.7692309 Z M92.3076922,142.307692 C92.3076922,144.615385 90.7692307,146.153846 88.4615385,146.153846 L26.923077,146.153846 C24.6153846,146.153846 23.076923,144.615385 23.076923,142.307692 L23.076923,134.615385 C23.076923,132.307692 24.6153846,130.769231 26.923077,130.769231 L88.4615385,130.769231 C90.7692309,130.769231 92.3076922,132.307692 92.3076922,134.615385 L92.3076922,142.307692 L92.3076922,142.307692 Z M107.692308,111.538462 C107.692308,113.846154 106.153846,115.384615 103.846154,115.384615 L26.923077,115.384615 C24.6153846,115.384615 23.076923,113.846154 23.076923,111.538462 L23.076923,103.846154 C23.076923,101.538462 24.6153846,100 26.923077,100 L103.846154,100 C106.153846,100 107.692308,101.538462 107.692308,103.846154 L107.692308,111.538462 L107.692308,111.538462 Z\"\n })\n});\nexport var copyOk = /*#__PURE__*/_jsx(\"svg\", {\n viewBox: \"0 0 170 185\",\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M153.846154,-3.55271368e-15 L53.8461537,-3.55271368e-15 C45.3846152,-3.55271368e-15 38.4615385,6.92307695 38.4615385,15.3846154 L38.4615385,23.0769232 L130.769231,23.0769232 C139.230769,23.0769232 146.153846,30 146.153846,38.4615385 L146.153846,146.153846 L153.846154,146.153846 C162.307692,146.153846 169.230769,139.230769 169.230769,130.769231 L169.230769,15.3846154 C169.230769,6.92307695 162.307692,-3.55271368e-15 153.846154,-3.55271368e-15 Z M130.769231,53.8461539 C130.769231,45.3846154 123.846154,38.4615385 115.384615,38.4615385 L15.3846154,38.4615385 C6.92307695,38.4615385 3.55271368e-15,45.3846154 3.55271368e-15,53.8461539 L3.55271368e-15,169.230769 C3.55271368e-15,177.692308 6.92307695,184.615385 15.3846154,184.615385 L115.384615,184.615385 C123.846154,184.615385 130.769231,177.692308 130.769231,169.230769 L130.769231,53.8461539 Z M106.941858,105.608333 C110.211682,102.450235 115.409229,102.495402 118.623676,105.709849 C121.838122,108.924296 121.883289,114.121842 118.725191,117.391667 L118.725191,117.391667 L72.8918576,163.225 C69.6376921,166.478183 64.3626897,166.478183 61.1085242,163.225 L61.1085242,163.225 L31.9418576,134.058333 C28.7837592,130.788509 28.828926,125.590962 32.0433729,122.376515 C35.2578198,119.162069 40.4553662,119.116902 43.7251908,122.275 L43.7251908,122.275 L67.0001908,145.55 Z M57.6923076,69.2307693 C60,69.2307693 61.5384615,70.7692309 61.5384615,73.0769232 L61.5384615,80.7692309 C61.5384615,83.0769232 60,84.6153848 57.6923076,84.6153848 L26.923077,84.6153848 C24.6153846,84.6153848 23.076923,83.0769232 23.076923,80.7692309 L23.076923,73.0769232 C23.076923,70.7692309 24.6153846,69.2307693 26.923077,69.2307693 L57.6923076,69.2307693 Z\",\n transform: \"translate(1)\"\n })\n});","import { useMemo } from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function ErrorMessage(props) {\n var {\n message\n } = props;\n return useMemo(() => {\n if (!message) return null;\n return /*#__PURE__*/_jsx(\"pre\", {\n children: /*#__PURE__*/_jsx(\"code\", {\n children: message\n })\n });\n }, [message]);\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"React\", \"ReactDOM\", \"ReactDOMClient\"];\nimport React, { useEffect, useRef } from 'react';\nimport { useState } from 'react';\nimport { babelTransform } from './transform';\nimport ReactDOM from 'react-dom';\nexport var getReactDOMClient = () => {\n var _ReactDOM;\n try {\n // 使用 require 解决 react v17 ts 报错问题\n _ReactDOM = require('react-dom/client');\n } catch (err) {\n // console.warn(`如果使用的是react-dom小于v18的版本,可以忽略此警告:${err}`)\n }\n return _ReactDOM;\n};\nexport function useCodePreview(props) {\n var [demoDom, setDemoDom] = useState();\n var playerId = useRef(\"\" + parseInt(String(Math.random() * 1e9), 10).toString(36));\n var [fullScreen, setFullScreen] = useState(false);\n var [errorMessage, setErrorMessage] = useState('');\n var [showEdit, setShowEdit] = useState(false);\n var [width, setWidth] = useState(1);\n var [copied, setCopied] = useState(false);\n var [code, setCode] = useState(props.code || '');\n var ReactDOMClient = React.useMemo(() => {\n return window.ReactDOM ? window.ReactDOM : getReactDOMClient();\n }, []);\n\n /** 通过缓存的方式 解决 react v18 中 的报错 ***/\n // @ts-ignore\n var cachesRef = React.useRef(new Map([]));\n var ReactDOMRender = _ReactDOM => {\n return {\n createRoot: id => {\n return {\n render: _render => {\n var caches = cachesRef.current;\n var root = caches.get(id);\n // 存在则不需要重新创建直接进行render操作\n if (root) {\n root.render(_render);\n } else {\n // @ts-ignore\n root = _ReactDOM.createRoot(document.getElementById(id));\n root.render(_render);\n // 缓存,解决控制台报 ReactDOMClient.createRoot 问题\n caches.set(id, root);\n }\n cachesRef.current = caches;\n }\n };\n }\n };\n };\n /** ------------------------ ***/\n\n var executeCode = str => {\n var _ref = props.dependencies || {},\n {\n React: _React,\n ReactDOM: _ReactDOM,\n ReactDOMClient: _ReactDOMClient\n } = _ref,\n otherDeps = _objectWithoutPropertiesLoose(_ref, _excluded);\n var V18ReactDOM = _ReactDOMClient || ReactDOMClient || _ReactDOM || ReactDOM;\n // 判断是否是 react v18版本\n var isV18 = Reflect.has(V18ReactDOM, 'createRoot');\n var NewReactDOM = isV18 ? ReactDOMRender(V18ReactDOM) : V18ReactDOM;\n try {\n var deps = _extends({\n React: _React || React\n }, otherDeps, {\n ReactDOM: NewReactDOM\n });\n // const args = ['context', 'React', 'ReactDOM', 'Component'];\n var args = [];\n // const argv = [this, React, ReactDOM, Component];\n var argv = [];\n for (var key in deps) {\n args.push(key);\n argv.push(deps[key]);\n }\n if (isV18) {\n // react < v18 中写法替换\n str = str.replace('ReactDOM.render', \"ReactDOM.createRoot(\\\"\" + playerId.current + \"\\\").render\");\n // react v18 中写法替换\n str = str.replace(\"ReactDOM.createRoot(_mount_)\", \"ReactDOM.createRoot(\\\"\" + playerId.current + \"\\\")\");\n str = str.replace('_mount_', \"\");\n } else {\n str = str.replace('_mount_', \"document.getElementById('\" + playerId.current + \"')\");\n }\n var input = \"\" + str;\n var {\n code: _code\n } = babelTransform(input);\n args.push(_code || '');\n // console.log('code:', argv)\n // eslint-disable-next-line no-new-func\n new Function(...args).apply(null, argv);\n setErrorMessage('');\n } catch (err) {\n var message = '';\n if (err && err.message) {\n message = err.message;\n } else {\n message = JSON.stringify(err);\n }\n setErrorMessage(message);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => executeCode(code), [code, props.noPreview, demoDom]);\n return {\n playerId,\n demoDom,\n setDemoDom,\n fullScreen,\n setFullScreen,\n errorMessage,\n setErrorMessage,\n width,\n setWidth,\n showEdit,\n setShowEdit,\n copied,\n setCopied,\n code,\n setCode,\n executeCode\n };\n}","import { transform } from '@babel/standalone';\nimport RemoveImports from 'babel-plugin-transform-remove-imports';\nexport function babelTransform(input) {\n return transform(input, {\n presets: ['env', 'es2015', 'react'],\n plugins: [[RemoveImports, {\n removeAll: true\n }]]\n });\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"style\", \"prefixCls\", \"className\", \"theme\", \"editProps\", \"codePenOption\", \"codeSandboxOption\", \"code\", \"dependencies\", \"btnText\", \"btnHideText\", \"onlyEdit\", \"bordered\", \"noCode\", \"noPreview\", \"noScroll\", \"bgWhite\"];\nimport React, { useRef, useEffect, useImperativeHandle } from 'react';\nimport CodeMirror from '@uiw/react-codemirror';\nimport copyTextToClipboard from '@uiw/copy-to-clipboard';\nimport { javascript } from '@codemirror/lang-javascript';\nimport Split from '@uiw/react-split';\nimport ThirdPartyButton from './ThirdPartyButton';\nimport * as icon from './icon';\nimport { ErrorMessage } from './ErrorMessage';\nimport { useCodePreview } from './useCodePreview';\nimport \"./index.css\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nvar CodePreview = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n style,\n prefixCls = 'w-code-preview',\n className,\n theme = 'light',\n editProps = {},\n codePenOption,\n codeSandboxOption,\n code: _Code = '',\n dependencies = {},\n btnText = 'Code',\n btnHideText = 'Hide Editor',\n onlyEdit = false,\n bordered = true,\n noCode = false,\n noPreview = false,\n noScroll = false,\n bgWhite = false\n } = props,\n otherProps = _objectWithoutPropertiesLoose(props, _excluded);\n var {\n playerId,\n setDemoDom,\n code,\n setCode,\n fullScreen,\n setFullScreen,\n errorMessage,\n width,\n setWidth,\n showEdit,\n setShowEdit,\n copied,\n setCopied\n } = useCodePreview(_extends({\n code: _Code,\n dependencies\n }, props));\n var demoRef = useRef(null);\n var editor = useRef(null);\n useImperativeHandle(ref, () => ({\n editor: editor,\n demo: demoRef.current\n }), [editor, demoRef]);\n var isOneItem = !noCode && !noPreview ? false : !noCode || !noPreview;\n var visiable = width === 1 ? false : [isOneItem ? 1 : 2];\n var cls = [className, prefixCls, noScroll ? prefixCls + \"-noScroll\" : null, isOneItem ? prefixCls + \"-OneItem\" : null, bordered ? prefixCls + \"-bordered\" : null, fullScreen ? prefixCls + \"-fullScreen\" : null].filter(Boolean).join(' ').trim();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => setCode(_Code), [_Code]);\n useEffect(() => {\n if (demoRef.current) {\n setDemoDom(demoRef.current);\n }\n window.addEventListener('popstate', e => {\n document.body.style.overflow = 'inherit';\n }, false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n var transitionend = () => setShowEdit(width !== 1);\n useEffect(() => {\n var dom = demoRef.current;\n if (dom) {\n dom.addEventListener('transitionend', transitionend);\n }\n return () => {\n if (dom) {\n dom.removeEventListener('transitionend', transitionend);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [width]);\n var handleChange = (value, viewUpdate) => {\n setCode(value);\n if (editProps && editProps.onChange) {\n editProps.onChange(value, viewUpdate);\n }\n };\n var onSwitchSource = () => {\n setWidth(width === 1 ? '50%' : 1);\n setShowEdit(true);\n };\n var onCopyCode = () => {\n copyTextToClipboard(code || '', isCopy => setCopied(isCopy));\n setTimeout(() => setCopied(false), 2000);\n };\n var onFullScreen = () => {\n setFullScreen(!fullScreen);\n document.body.style.overflow = !fullScreen ? 'hidden' : 'inherit';\n if (!fullScreen && demoRef.current) {\n demoRef.current.style.maxWidth = 'inherit';\n }\n };\n return /*#__PURE__*/_jsxs(Split, _extends({\n \"data-color-mode\": theme,\n visiable: visiable,\n className: cls,\n style: _extends({\n flex: 1\n }, style)\n }, otherProps, {\n children: [!noPreview && !onlyEdit && /*#__PURE__*/_jsxs(\"div\", {\n className: [prefixCls + \"-demo\", !bgWhite ? prefixCls + \"-demo-bgPlaid\" : null, errorMessage ? prefixCls + \"-demo-error\" : null].filter(Boolean).join(' ').trim(),\n style: _extends({\n flex: 1\n }, width === 1 ? {\n width: '100%'\n } : {}),\n children: [/*#__PURE__*/_jsx(ErrorMessage, {\n message: errorMessage\n }), /*#__PURE__*/_jsx(\"div\", {\n className: [prefixCls + \"-demo-source\", errorMessage ? 'error' : null].filter(Boolean).join(' ').trim(),\n id: playerId.current\n })]\n }), (!noCode || onlyEdit) && /*#__PURE__*/_jsx(\"div\", {\n ref: demoRef,\n style: {\n overflow: 'hidden',\n width: onlyEdit ? '100%' : width\n },\n children: (showEdit || onlyEdit) && /*#__PURE__*/_jsx(CodeMirror, _extends({\n value: (code || '').replace(/\\n$/, ''),\n ref: editor,\n theme: theme,\n extensions: [javascript({\n jsx: true\n })]\n }, editProps, {\n style: {\n height: '100%'\n },\n height: \"100%\",\n onChange: handleChange\n }))\n }), !isOneItem && !(noCode && noPreview) && !onlyEdit && /*#__PURE__*/_jsxs(\"div\", {\n style: {\n flex: 1,\n width: 29\n },\n className: prefixCls + \"-bar\",\n children: [/*#__PURE__*/_jsx(ThirdPartyButton, {\n prefixCls: prefixCls,\n codePenOption: codePenOption,\n codeSandboxOption: codeSandboxOption\n }), /*#__PURE__*/_jsx(\"div\", {\n className: prefixCls + \"-bar-btn\",\n onClick: onSwitchSource,\n children: width === 1 ? btnText : btnHideText\n }), /*#__PURE__*/_jsx(\"div\", {\n className: [prefixCls + \"-bar-iconbtns\", copied ? prefixCls + \"-bar-copied\" : null].filter(Boolean).join(' ').trim(),\n onClick: onCopyCode,\n children: copied ? icon.copyOk : icon.copy\n }), /*#__PURE__*/_jsx(\"div\", {\n className: [prefixCls + \"-bar-iconbtns\", fullScreen ? prefixCls + \"-bar-copied\" : null].filter(Boolean).join(' ').trim(),\n onClick: onFullScreen,\n children: icon.full\n })]\n })]\n }));\n});\nCodePreview.displayName = 'CodePreview';\nexport default CodePreview;","import React, { Fragment, useState, useEffect } from 'react';\nimport CodePreview from '../';\nimport { Switch } from 'uiw';\nimport * as UIW from 'uiw';\n\nconst defaultCode = `\nimport { Button, Divider, Icon } from 'uiw';\nimport ReactDOM from 'react-dom/client';\n\nReactDOM.createRoot(_mount_).render(\n
\n \n \n \n \n \n \n
,\n);`;\n\nconst Example = () => {\n const [theme, setTheme] = useState<'light' | 'dark'>('light');\n const [code] = useState(defaultCode);\n const [state, setState] = useState({\n bgWhite: false,\n noCode: false,\n noScroll: false,\n noPreview: false,\n bordered: true,\n codeSandbox: {\n files: {\n 'sandbox.config.json': {\n content: `{\n \"template\": \"node\",\n \"container\": {\n \"startScript\": \"start\",\n \"node\": \"14\"\n }\n }`,\n },\n 'public/index.html': {\n content: `
`,\n },\n 'src/index.js': {\n content: code.replace('_mount_', 'document.getElementById(\"root\")'),\n },\n 'src/index.less': {\n content: '',\n },\n '.kktrc.js': {\n content: `import webpack from \"webpack\";\\nimport lessModules from \"@kkt/less-modules\";\\nexport default (conf, env, options) => {\\nconf = lessModules(conf, env, options);\\nreturn conf;\\n};`,\n },\n 'package.json': {\n content: {\n dependencies: {\n react: 'latest',\n 'react-dom': 'latest',\n uiw: 'latest',\n },\n devDependencies: {\n '@kkt/less-modules': '6.0.11',\n kkt: '6.0.11',\n typescript: '4.1.3',\n },\n scripts: {\n start: 'kkt start',\n build: 'kkt build',\n test: 'kkt test --env=jsdom',\n },\n browserslist: ['>0.2%', 'not dead', 'not ie <= 11', 'not op_mini all'],\n },\n },\n },\n },\n codeSandboxShow: true,\n codePenShow: true,\n codePen: {\n includeModule: ['uiw'],\n title: 'React Code Preview - demo',\n html: '
',\n js: code.replace('_mount_', 'document.getElementById(\"root\")'),\n css_external: 'https://unpkg.com/uiw@3.2.6/dist/uiw.min.css',\n js_external: `https://unpkg.com/react@18.x/umd/react.development.js;https://unpkg.com/react-dom@18.x/umd/react-dom.development.js;https://unpkg.com/uiw@4.7.2/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.12/index.js`,\n },\n });\n function handleChange(keyName: string, e: React.ChangeEvent) {\n const newstate = { ...state, [`${keyName}`]: e.target.checked };\n setState({ ...newstate });\n }\n\n useEffect(() => {\n setTheme(document.documentElement.getAttribute('data-color-mode') === 'dark' ? 'dark' : 'light');\n document.addEventListener('colorschemechange', (e: any) => {\n setTheme(e.detail.colorScheme);\n });\n }, []);\n\n return (\n \n {\n setState({\n ...state,\n codeSandbox: {\n ...state.codeSandbox,\n files: {\n ...state.codeSandbox.files,\n 'src/index.js': {\n content: value,\n },\n },\n },\n codePen: {\n ...state.codePen,\n js: value,\n },\n });\n },\n }}\n noPreview={state.noPreview}\n codeSandboxOption={state.codeSandboxShow ? state.codeSandbox : undefined}\n codePenOption={state.codePenShow ? state.codePen : undefined}\n />\n
\n \n 背景 `bgWhite={state.bgWhite.toString()}`\n \n
\n \n 是否显示代码 `noCode={state.noCode.toString()}`\n \n
\n \n 是否显示实例预览 `noPreview={state.noPreview.toString()}`\n \n
\n \n 是否显示滚动条 `noScroll={state.noScroll.toString()}`\n \n
\n \n 是否显示边框 `bordered={state.bordered.toString()}`\n \n
\n \n 是否显示 CodePen 按钮 `codePenOption={state.codePenShow ? '{...}' : 'undefined'}`\n \n
\n \n 是否显示 CodeSandbox 按钮 `codeSandboxOption={state.codeSandboxShow ? '{...}' : 'undefined'}`\n \n
\n
\n );\n};\n\nexport default Example;\n","import React from 'react';\nimport GitHubCorners from '@uiw/react-github-corners';\nimport Markdown from '@uiw/react-markdown-preview';\nimport '@wcj/dark-mode';\nimport DocumentStr from '../README.md';\nimport styles from './App.module.less';\nimport Example from './Example';\nimport pkgJson from '../package.json';\n\nexport default function App() {\n const version = pkgJson.version;\n let DocumentStrSource = DocumentStr;\n if (DocumentStrSource) DocumentStrSource = DocumentStr.replace(/([\\s\\S]*)/, '');\n return (\n
\n \n \n

\n React Code Preview {version}\n

\n \n \n
\n );\n}\n","import React from 'react';\n// import ReactDOM from 'react-dom';\nimport ReactDOM from 'react-dom/client';\nimport '@uiw/reset.css/reset.less';\nimport App from './App';\n\n/**\n * 增加一个❕,解决ts报错的问题\n * 因为 `document.getElementById('root')`有可能为null\n * @see https://github.com/uiwjs/react-code-preview/issues/229\n */\nReactDOM.createRoot(document.getElementById('root')!).render(\n \n \n ,\n);\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t792: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunk_uiw_react_code_preview\"] = self[\"webpackChunk_uiw_react_code_preview\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [265,257,759,587,362,499], () => (__webpack_require__(6609)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["webpackEmptyContext","req","e","Error","code","keys","resolve","id","module","exports","_excluded","props","codePenOption","codeSandboxOption","prefixCls","_ref","includeModule","otherCodePenOptions","_objectWithoutPropertiesLoose","js","include","join","replace","str","RegExp","test","_jsxs","className","children","_jsx","Codepen","_extends","height","fill","viewBox","d","CodeSandbox","full","transform","copy","copyOk","ErrorMessage","message","useMemo","useCodePreview","demoDom","setDemoDom","useState","playerId","useRef","parseInt","String","Math","random","toString","fullScreen","setFullScreen","errorMessage","setErrorMessage","showEdit","setShowEdit","width","setWidth","copied","setCopied","setCode","ReactDOMClient","React","window","ReactDOM","getReactDOMClient","_ReactDOM","require","err","cachesRef","Map","executeCode","dependencies","_React","_ReactDOMClient","otherDeps","V18ReactDOM","isV18","Reflect","has","NewReactDOM","createRoot","render","_render","caches","current","root","get","document","getElementById","set","ReactDOMRender","deps","args","argv","key","push","input","_code","presets","plugins","RemoveImports","removeAll","babelTransform","Function","apply","JSON","stringify","useEffect","noPreview","CodePreview","ref","style","theme","editProps","_Code","btnText","btnHideText","onlyEdit","bordered","noCode","noScroll","bgWhite","otherProps","demoRef","editor","useImperativeHandle","demo","isOneItem","visiable","cls","filter","Boolean","trim","addEventListener","body","overflow","transitionend","dom","removeEventListener","Split","flex","CodeMirror","value","extensions","javascript","jsx","onChange","handleChange","viewUpdate","ThirdPartyButton","onClick","onSwitchSource","onCopyCode","copyTextToClipboard","isCopy","setTimeout","icon","onFullScreen","maxWidth","displayName","Example","setTheme","state","setState","codeSandbox","files","content","react","uiw","devDependencies","kkt","typescript","scripts","start","build","browserslist","codeSandboxShow","codePenShow","codePen","title","html","css_external","js_external","keyName","newstate","concat","target","checked","documentElement","getAttribute","detail","colorScheme","Fragment","UIW","undefined","Switch","bind","App","version","pkgJson","DocumentStrSource","DocumentStr","styles","light","dark","position","left","top","GitHubCorners","fixed","href","Markdown","paddingTop","source","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","call","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","every","splice","r","n","getter","__esModule","a","definition","o","defineProperty","enumerable","g","globalThis","this","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","chunkLoadingGlobal","self","forEach","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/website-result.html b/website-result.html index c277a22d..48479329 100644 --- a/website-result.html +++ b/website-result.html @@ -57,7 +57,7 @@ - + @@ -72,7 +72,7 @@