diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/js/main.4193a873.chunk.js | 2 | ||||
-rw-r--r-- | static/js/main.4193a873.chunk.js.map | 1 | ||||
-rw-r--r-- | static/js/main.76c0462e.chunk.js | 2 | ||||
-rw-r--r-- | static/js/main.76c0462e.chunk.js.map | 1 |
4 files changed, 3 insertions, 3 deletions
diff --git a/static/js/main.4193a873.chunk.js b/static/js/main.4193a873.chunk.js new file mode 100644 index 0000000..7546391 --- /dev/null +++ b/static/js/main.4193a873.chunk.js @@ -0,0 +1,2 @@ +(this["webpackJsonpreact-benzin"]=this["webpackJsonpreact-benzin"]||[]).push([[0],{58:function(e,t,a){e.exports=a.p+"static/media/icon.8908a388.svg"},70:function(e,t,a){e.exports=a(99)},99:function(e,t,a){"use strict";a.r(t);var n=a(23),r=a(0),l=a.n(r),c=a(9),i=a.n(c),o=a(51),u=a(138),m=a(136),s=a(101),d=a(130),p=a(63),f=a(100),v=Object(o.a)((function(e){return{surface:{position:"absolute",display:"flex",flexDirection:"column",overflowY:"auto",scrollbarColor:"".concat(e.palette.secondary.dark," ").concat(e.palette.secondary.light),"& a.MuiTypography-root":{color:e.palette.primary.light}}}})),g=function(e){var t=e.size,a=e.position,n=e.children,r=v();return l.a.createElement(f.a,{variant:"outlined",style:Object(p.a)({},t,{},a),className:r.surface},n)},h=Object(o.a)((function(e){return{header:{padding:e.spacing(1,0,1,2),background:e.palette.background.elevation2}}})),E=function(e){var t=e.type,a=e.name,n=e.children,r=h(),c={height:"85vh"},i={bottom:"3vh"};return"primary"===t?(c.width="63vw",i.left="2vw"):"secondary"===t?(c.width="31vw",i.right="2vw"):"mono"===t&&(i.left="2vw",i.right="2vw"),l.a.createElement(g,{size:c,position:i},a&&l.a.createElement("div",null,l.a.createElement(s.a,{variant:"h5",className:r.header},a),l.a.createElement(d.a,null)),n)},w=a(131),b=a(132),y=a(139),k=a(133),j=Object(o.a)((function(e){return{root:{background:e.palette.background.elevation2,color:e.palette.text.primary,paddingLeft:e.spacing(3)},logo:{margin:e.spacing(0,3,0,1)},tab:{"& .MuiTab-wrapper":{padding:e.spacing(2),flexDirection:"row",fontSize:"0.8125rem","& svg":{marginRight:e.spacing(1),marginBottom:"0 !important"}}}}})),x=function(e){var t=e.logo,a=e.contents,n=e.page,r=e.setPage,c=j();return l.a.createElement(w.a,{position:"sticky",className:c.root},l.a.createElement(b.a,null,t.icon,l.a.createElement(s.a,{variant:"h5",className:c.logo,color:"primary"},t.title),l.a.createElement(y.a,{onChange:function(e,t){r(t)},value:n},a&&Object.keys(a).map((function(e){return l.a.createElement(k.a,{label:e,icon:a[e],value:e,className:c.tab,key:e})})))))},O=Object(o.a)((function(e){return{content:{padding:e.spacing(2,2,1,3),marginBottom:e.spacing(1),"& .MuiButton-root":{margin:e.spacing(1,2,2,0)}}}})),N=function(e){var t=e.sectionName,a=e.children,n=e.level,r=void 0===n?0:n,c=O(),i=r+2;i>6&&(i=6);var o="h".concat(i);return l.a.createElement(l.a.Fragment,null,l.a.createElement(s.a,{variant:o},t),l.a.createElement(d.a,{variant:"middle"}),l.a.createElement(s.a,{component:"div",className:c.content},a))},L=(a(62),a(54),a(55)),M=a.n(L),R=a(56),I=a.n(R),F=a(61),z=a(134),D=a(135),S=(a(79),Object(F.a)({palette:{type:"dark",primary:{main:M.a[400]},secondary:{main:I.a[500]},background:{default:"#121212",paper:"#1e1e1e",elevation1:"#1e1e1e",elevation2:"#232323",elevation3:"#252525"},text:{primary:"#f4f4f4",secondary:"rgba(255, 255, 255, 0.6)"}}})),T=function(e){var t=e.children;return l.a.createElement(z.a,{theme:S},l.a.createElement(D.a,null),t)},B=a(57),H=a.n(B),C=Object(o.a)((function(e){return{root:{background:e.palette.background.default,padding:e.spacing(1),overflowX:"auto",fontFamily:"Monospace",scrollbarColor:"auto"}}})),A=function(e){var t=e.rawLines,a=C();return l.a.createElement(f.a,{variant:"outlined",className:a.root},t.map((function(e){return l.a.createElement("pre",null,e)})))},$=a(137),_=a(36),Z=function(e){return{local:new RegExp("".concat(e,"([^").concat(e,"]+)").concat(e)),global:new RegExp("(".concat(e,"[^").concat(e,"]+").concat(e,")"))}},P={conceal:{global:/(!?\[.+?\]\(.+?\))(?!])/g,local:/!?\[(.*\]?.*)\]\((.+?)\)/},rawLink:{global:/((?:(?:[A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www\.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)(?:(?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[.!/\\\w]*))?)/,local:/&^/},emoji:Z(":"),bold:Z("\\*\\*"),italic:Z("\\*"),code:Z("`"),strikeThrough:Z("~~")},W=new RegExp(Object.values(P).map((function(e){return e.global.source})).join("|")),G=[];Object.keys(_.lib).forEach((function(e){return G.push({name:e,char:_.lib[e].char})}));var J=Object(o.a)((function(e){return{code:{background:e.palette.background.default,borderRadius:e.spacing(.5),padding:e.spacing(.5),fontFamily:"Monospace"},image:{maxWidth:"100%",maxHeight:"100%"}}})),X=function e(t){var a=t.span,n=J();if(!a)return null;var r=P.conceal.local.exec(a);if(r)return"!"===a[0]?l.a.createElement("img",{src:r[2],alt:r[1],className:n.image}):l.a.createElement($.a,{href:r[2]},l.a.createElement(e,{span:r[1]}));var c=a.match(P.emoji.local);if(c){var i=G.find((function(e){return e.name===c[1]}));return l.a.createElement("span",null,i?i.char:a)}var o=a.match(P.code.local);if(o)return l.a.createElement("span",{className:n.code},o[1]);var u=a.match(P.bold.local);if(u)return l.a.createElement("b",null,u[1]);var m=a.match(P.italic.local);if(m)return l.a.createElement("i",null,m[1]);var s=a.match(P.strikeThrough.local);return s?l.a.createElement("span",{style:{textDecoration:"line-through"}},s[1]):a.match(P.rawLink.global)?l.a.createElement($.a,{href:a},a):l.a.createElement(l.a.Fragment,null,a)},Y=function(e){var t=e.line;return l.a.createElement(l.a.Fragment,null,t.split(W).map((function(e){return l.a.createElement(X,{span:e})})))},q=function(e){return null!==e.match(/^\s*```.*$/)},K=function(e){return null!==e.match(/^ ?[-*] .*$/)},Q=function(e,t){var a=new RegExp("</".concat(t,"[^<]*>"));return null!==e.match(a)},U=function(e){return null!==e.match(/\\\|$/)},V=function e(t){var a=t.rawLines;if(!a.length)return null;var r,c=a.splice(0,1)[0];if(q(c)){var i=a.findIndex((function(e){return q(e)})),o=a.splice(0,i+1).slice(0,i);r=l.a.createElement(A,{rawLines:o})}else if(K(c)){var u=a.findIndex((function(e){return!K(e)})),m=a.splice(0,u).slice(0,u);m.unshift(c),r=l.a.createElement("ul",null,m.map((function(e){return l.a.createElement("li",null,l.a.createElement(Y,{line:e.slice(2)}))})))}else if(r=function(e){var t=/<([^/\s]*)[^<]*[^/]>/g.exec(e);return t?t[1]:""}(c)){var s=r,d=Q(c,s)?-1:a.findIndex((function(e){return Q(e,s)})),p=a.splice(0,d+1);p.unshift(c),r=l.a.createElement("div",{dangerouslySetInnerHTML:{__html:p.join("\n")}})}else if(null!==(r=function(e){return e.match(/(<[^/\s]*[^<]*\/>)/g)}(c))){var f=r[0],v=c.split(f),g=Object(n.a)(v,2),h=g[0],E=g[1];r=l.a.createElement(l.a.Fragment,null,l.a.createElement(Y,{line:h}),l.a.createElement("div",{dangerouslySetInnerHTML:{__html:f}}),l.a.createElement(Y,{line:E}))}else if(U(c)){var w=a.findIndex((function(e){return!U(e)})),b=a.splice(0,w).map((function(e){return e.slice(0,-2)}));b.unshift(c.slice(0,-2)),b.push(a.splice(0,1)[0]),r=l.a.createElement("p",null,b.map((function(e){return l.a.createElement(Y,{line:e})})))}else r=Q(c,"")?null:l.a.createElement("p",null,l.a.createElement(Y,{line:c}));return l.a.createElement(l.a.Fragment,null,r,l.a.createElement(e,{rawLines:a}))},ee=function(e){if(!e)return 0;for(var t=0;"#"===e[t];)t+=1;return t},te=function(e){var t=e.rawLines,a=e.level,n=void 0===a?0:a,r=t.reduce((function(e,t){return t&&(ee(t)===n&&e.push([]),e.length&&e[e.length-1].push(t)),e}),[]).map((function(e){return l.a.createElement(ae,{rawLines:e,level:n})}));return l.a.createElement(l.a.Fragment,null,r)},ae=function(e){var t=e.rawLines,a=e.level,n=void 0===a?0:a,r=t.findIndex((function(e){return e.match("^#{".concat(n+1,",} .*$"))})),c=t.splice(0,r<0?t.length:r);if(!n)return l.a.createElement(l.a.Fragment,null,l.a.createElement(s.a,null,l.a.createElement(V,{rawLines:c})),l.a.createElement(te,{rawLines:t,level:ee(t[0])}));var i=c.splice(0,1)[0].slice(n).trim(),o=ee(t[0]);return l.a.createElement(N,{sectionName:i,level:n},l.a.createElement(V,{rawLines:c}),l.a.createElement(te,{rawLines:t,level:o}))},ne=ae,re=function(e){var t=e.data,a=e.url,c=Object(r.useState)(t||""),i=Object(n.a)(c,2),o=i[0],u=i[1];a&&H.a.get(a).then((function(e){return u(e.data)})),Object(r.useEffect)((function(){a||u(t||"")}),[t,a]);var m=(null===a||void 0===a?void 0:a.slice(0,a.lastIndexOf("/")))||"",s=o.split(/\r?\n/).map((function(e){return function(e,t){return e.replace(/src="(?!http)(.*)"[\s>]/,(function(e,a){return'src="'.concat(t,"/").concat(a,'?sanitize=true"')})).replace(/\[(.*\]?.*)\]\((?!http)(.+?)\)/,(function(e,a,n){return"[".concat(a,"](").concat(t,"/").concat(n,")")}))}(e,m)}));return l.a.createElement(ne,{rawLines:s})},le=a(58),ce=a.n(le),ie=Object(o.a)((function(e){return{window:{padding:e.spacing(4)},promoButton:{display:"flex",justifyContent:"center",marginTop:e.spacing(4)}}})),oe=l.a.createElement("img",{src:ce.a,width:"32px",height:"37px",alt:"logo"}),ue={home:null,spacevim:null,"material-ui":null,custom:null,"live preview":null},me={home:"https://raw.githubusercontent.com/eug-vs/react-benzin/develop/README.md",spacevim:"https://raw.githubusercontent.com/spacevim/spacevim/master/README.md","material-ui":"https://raw.githubusercontent.com/mui-org/material-ui/master/README.md"},se=function(){var e=Object(r.useState)(""),t=Object(n.a)(e,2),a=t[0],c=t[1],i=Object(r.useRef)(null);return l.a.createElement(l.a.Fragment,null,l.a.createElement(N,{sectionName:"Render custom markdown document",level:2},l.a.createElement("p",null,"This should be a link to a valid markdown file. Response should give the file contents. If you copy README file from GitHub, make sure you provide link to raw view."),l.a.createElement("p",null,l.a.createElement(u.a,{fullWidth:!0,inputRef:i,variant:"outlined",color:"secondary",label:"Markdown url"})),l.a.createElement(m.a,{variant:"contained",color:"secondary",onClick:function(){var e;c((null===(e=i.current)||void 0===e?void 0:e.value)||"")}},"Render!")),l.a.createElement(re,{url:a}))},de=function(e){var t=e.setLivePreviewData,a=Object(r.useRef)(null);return l.a.createElement(l.a.Fragment,null,l.a.createElement(N,{sectionName:"Markdown live preview",level:2},l.a.createElement("p",null,"Start typing and see your text rendered on the left window! We recommend starting with # Header."),l.a.createElement("p",null,l.a.createElement(u.a,{fullWidth:!0,multiline:!0,inputRef:a,variant:"outlined",color:"primary",label:"Markdown",onChange:function(){var e;t((null===(e=a.current)||void 0===e?void 0:e.value)||"")}}))))};i.a.render(l.a.createElement((function(){var e=ie(),t=Object(r.useState)("home"),a=Object(n.a)(t,2),c=a[0],i=a[1],o=Object(r.useState)(""),u=Object(n.a)(o,2),s=u[0],d=u[1],p=me[c],f=null===p||void 0===p?void 0:p.slice(p.lastIndexOf("/")+1),v=["## Markdown\n [Markdown file](".concat(p,") *(...").concat(f,")* that you can see on the left was parsed and rendered by **BENZIN**! :rocket:"),"Switch between tabs on the header to explore other markdown templates. :recycle: ","Currently **only core features** of markdown function.","Templates on the left are being loaded from the [GitHub](https://github.com), though this pane is generated from plaintext. :pen:","## How do I use this feature?","```","import Markdown from 'react-benzin';","const data = '# Header\\nHello, *world!*';","ReactDOM.render(<Markdown data={data}/>, document.getElementById('root'));","```"].join("\n"),g=l.a.createElement(re,{url:p});return"custom"===c?g=l.a.createElement(se,null):"live preview"===c&&(g=l.a.createElement(re,{data:s||"# Start typing in the right window!"})),l.a.createElement(T,null,l.a.createElement(x,{logo:{icon:oe,title:"BENZIN"},contents:ue,page:c,setPage:i}),l.a.createElement(E,{type:"primary"},l.a.createElement("div",{className:e.window},g)),l.a.createElement(E,{type:"secondary",name:"Feature preview"},l.a.createElement("div",{className:e.window},"live preview"===c?l.a.createElement(de,{setLivePreviewData:d}):l.a.createElement(l.a.Fragment,null,l.a.createElement(re,{data:v}),l.a.createElement("p",{className:e.promoButton},l.a.createElement(m.a,{variant:"contained",color:"primary",size:"large",onClick:function(){i("live preview")}},"Try it yourself!"))))))}),null),document.getElementById("root"))}},[[70,1,2]]]); +//# sourceMappingURL=main.4193a873.chunk.js.map
\ No newline at end of file diff --git a/static/js/main.4193a873.chunk.js.map b/static/js/main.4193a873.chunk.js.map new file mode 100644 index 0000000..0264d71 --- /dev/null +++ b/static/js/main.4193a873.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["assets/icon.svg","lib/Window/WindowSurface.tsx","lib/Window/Window.tsx","lib/Header/Header.tsx","lib/ContentSection/ContentSection.tsx","lib/Benzin/Benzin.tsx","lib/Markdown/CodeBlock.tsx","lib/Markdown/SyntacticSpan.tsx","lib/Markdown/Text.tsx","lib/Markdown/Content.tsx","lib/Markdown/Section.tsx","lib/Markdown/Markdown.tsx","index.tsx"],"names":["module","exports","useStyles","makeStyles","theme","surface","position","display","flexDirection","overflowY","scrollbarColor","palette","secondary","dark","light","color","primary","WindowSurface","size","children","classes","Paper","variant","style","className","header","padding","spacing","background","elevation2","Window","type","name","height","bottom","width","left","right","Typography","Divider","root","text","paddingLeft","logo","margin","tab","fontSize","marginRight","marginBottom","Header","contents","page","setPage","AppBar","Toolbar","icon","title","Tabs","onChange","event","newPage","value","Object","keys","map","item","Tab","label","key","content","ContentSection","sectionName","level","adjustedLevel","component","benzinTheme","createMuiTheme","main","orange","purple","default","paper","elevation1","elevation3","Benzin","ThemeProvider","CssBaseline","overflowX","fontFamily","CodeBlock","rawLines","line","enclosureRegex","e","local","RegExp","global","regex","conceal","rawLink","emoji","bold","italic","code","strikeThrough","splitter","values","pair","source","join","emojiList","emojiLib","forEach","push","char","borderRadius","image","maxWidth","maxHeight","SyntacticSpan","span","matchConceal","exec","src","alt","Link","href","matchEmoji","match","find","matchCode","matchBold","matchItalic","matchStrikeThrough","textDecoration","Text","split","denotesCodeBlock","denotesDottedList","denotesClosingHtml","tag","declaresNoLineBreak","Content","length","buffer","splice","closeIndex","findIndex","rawLine","codeBlockLines","slice","dottedListLines","unshift","li","denotesOpenHtml","htmlLines","dangerouslySetInnerHTML","__html","denotesSelfClosingHtml","before","after","lineBreakLines","lineBreakLine","getHeaderLevel","ChildrenSections","reduce","sections","sectionLines","Section","deeperLevelIndex","rawContent","trim","deeperLevel","Markdown","data","url","useState","markdown","setMarkdown","axios","get","then","response","useEffect","baseUrl","lastIndexOf","lines","replace","resolveUrls","window","promoButton","justifyContent","marginTop","Icon","headerContents","home","spacevim","custom","pageMap","CustomPage","setUrl","inputEl","useRef","TextField","fullWidth","inputRef","onClick","current","LivePreviewPage","setLivePreviewData","multiline","ReactDOM","render","livePreviewData","fileName","info","primaryWindowContent","document","getElementById"],"mappings":"sGAAAA,EAAOC,QAAU,IAA0B,kC,oLCarCC,EAAYC,aAAW,SAAAC,GAAK,MAAK,CACrCC,QAAS,CACPC,SAAU,WACVC,QAAS,OACTC,cAAe,SACfC,UAAW,OACXC,eAAe,GAAD,OAAKN,EAAMO,QAAQC,UAAUC,KAA7B,YAAqCT,EAAMO,QAAQC,UAAUE,OAE3E,yBAA0B,CACxBC,MAAOX,EAAMO,QAAQK,QAAQF,YAqBpBG,EAf4B,SAAC,GAAkC,IAAhCC,EAA+B,EAA/BA,KAAMZ,EAAyB,EAAzBA,SAAUa,EAAe,EAAfA,SACtDC,EAAUlB,IAEhB,OACE,kBAACmB,EAAA,EAAD,CACEC,QAAQ,WACRC,MAAK,eAAOL,EAAP,GAAgBZ,GACrBkB,UAAWJ,EAAQf,SAElBc,ICvBDjB,EAAYC,aAAW,SAAAC,GAAK,MAAK,CACrCqB,OAAQ,CACNC,QAAStB,EAAMuB,QAAQ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,kBAAC,IAAD,CACExK,QAAQ,YACRP,MAAM,UACNG,KAAK,QACL4L,QAtDQ,WAC1B1J,EAAQ,kBAiDQ,2BAmBJ,MAASqK,SAASC,eAAe,W","file":"static/js/main.4193a873.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/icon.8908a388.svg\";","import React from 'react';\n\nimport { Paper, makeStyles } from '@material-ui/core';\n\nimport { SurfaceSize, SurfacePosition } from './types';\n\n\ninterface PropTypes {\n size: SurfaceSize;\n position: SurfacePosition;\n}\n\n\nconst useStyles = makeStyles(theme => ({\n surface: {\n position: 'absolute',\n display: 'flex',\n flexDirection: 'column',\n overflowY: 'auto',\n scrollbarColor: `${theme.palette.secondary.dark} ${theme.palette.secondary.light}`,\n\n '& a.MuiTypography-root': {\n color: theme.palette.primary.light,\n },\n },\n}));\n\n\nconst WindowSurface: React.FC<PropTypes> = ({ size, position, children }) => {\n const classes = useStyles();\n\n return (\n <Paper\n variant=\"outlined\"\n style={{ ...size, ...position }}\n className={classes.surface}\n >\n {children}\n </Paper>\n );\n};\n\n\nexport default WindowSurface;\n","import React from 'react';\n\nimport { Typography, Divider, makeStyles } from '@material-ui/core';\n\nimport WindowSurface from './WindowSurface';\nimport { SurfaceSize, SurfacePosition } from './types';\n\n\ninterface PropTypes {\n type: 'primary' | 'secondary' | 'mono';\n name?: string;\n}\n\n\nconst useStyles = makeStyles(theme => ({\n header: {\n padding: theme.spacing(1, 0, 1, 2),\n background: theme.palette.background.elevation2,\n },\n}));\n\n\nconst Window: React.FC<PropTypes> = ({ type, name, children }) => {\n const classes = useStyles();\n\n const size: SurfaceSize = {\n height: '85vh',\n };\n\n const position: SurfacePosition = {\n bottom: '3vh',\n };\n\n if (type === 'primary') {\n size.width = '63vw';\n position.left = '2vw';\n } else if (type === 'secondary') {\n size.width = '31vw';\n position.right = '2vw';\n } else if (type === 'mono') {\n position.left = '2vw';\n position.right = '2vw';\n }\n\n return (\n <WindowSurface\n size={size}\n position={position}\n >\n {name\n && (\n <div>\n <Typography variant=\"h5\" className={classes.header}>{name}</Typography>\n <Divider />\n </div>\n )}\n {children}\n </WindowSurface>\n );\n};\n\nexport default Window;\n","import React from 'react';\n\nimport {\n AppBar,\n Tabs,\n Tab,\n Typography,\n Toolbar,\n} from '@material-ui/core';\n\nimport { makeStyles } from '@material-ui/core/styles';\n\n\ninterface PropTypes {\n logo: {\n icon: React.ReactNode;\n title: string;\n };\n contents: {\n [key: string]: React.ReactNode | null;\n };\n page: string;\n setPage: (newPage: string) => void;\n}\n\nconst useStyles = makeStyles(theme => ({\n root: {\n background: theme.palette.background.elevation2,\n color: theme.palette.text.primary,\n paddingLeft: theme.spacing(3),\n },\n logo: {\n margin: theme.spacing(0, 3, 0, 1),\n },\n tab: {\n '& .MuiTab-wrapper': {\n padding: theme.spacing(2),\n flexDirection: 'row',\n fontSize: '0.8125rem',\n '& svg': {\n marginRight: theme.spacing(1),\n marginBottom: '0 !important',\n },\n },\n },\n}));\n\n\nconst Header: React.FC<PropTypes> = ({\n logo, contents, page, setPage,\n}) => {\n const classes = useStyles();\n\n const handleChange = (event: React.ChangeEvent<{}>, newPage: string): void => {\n setPage(newPage);\n };\n\n return (\n <AppBar position=\"sticky\" className={classes.root}>\n <Toolbar>\n {logo.icon}\n <Typography variant=\"h5\" className={classes.logo} color=\"primary\">\n {logo.title}\n </Typography>\n <Tabs onChange={handleChange} value={page}>\n {contents && Object.keys(contents).map((item: string) => (\n <Tab\n label={item}\n icon={contents[item] as JSX.Element}\n value={item}\n className={classes.tab}\n key={item}\n />\n ))}\n </Tabs>\n </Toolbar>\n </AppBar>\n );\n};\n\nexport default Header;\n","import React from 'react';\n\nimport {\n Typography,\n Divider,\n makeStyles,\n} from '@material-ui/core';\n\n\ninterface PropTypes {\n sectionName: string;\n level?: number;\n}\n\nconst useStyles = makeStyles(theme => ({\n content: {\n padding: theme.spacing(2, 2, 1, 3),\n marginBottom: theme.spacing(1),\n\n '& .MuiButton-root': {\n margin: theme.spacing(1, 2, 2, 0),\n },\n },\n}));\n\nconst ContentSection: React.FC<PropTypes> = ({ sectionName, children, level = 0 }) => {\n const classes = useStyles();\n\n let adjustedLevel = level + 2; // Make everything smaller\n if (adjustedLevel > 6) adjustedLevel = 6;\n\n type Variant = 'h3' | 'h4' | 'h5' | 'h6';\n const variant: Variant = `h${adjustedLevel}` as Variant;\n\n return (\n <>\n <Typography variant={variant}>{sectionName}</Typography>\n <Divider variant=\"middle\" />\n <Typography component=\"div\" className={classes.content}>\n {children}\n </Typography>\n </>\n );\n};\n\n\nexport default ContentSection;\n","import React from 'react';\nimport orange from '@material-ui/core/colors/orange';\nimport purple from '@material-ui/core/colors/purple';\nimport { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';\nimport { CssBaseline } from '@material-ui/core';\nimport 'typeface-roboto';\n\n\ndeclare module '@material-ui/core/styles/createPalette' {\n interface TypeBackground {\n elevation1: string;\n elevation2: string;\n elevation3: string;\n }\n}\n\n\nconst benzinTheme = createMuiTheme({\n palette: {\n type: 'dark',\n primary: {\n main: orange[400],\n },\n secondary: {\n main: purple[500],\n },\n background: {\n default: '#121212',\n paper: '#1e1e1e',\n elevation1: '#1e1e1e',\n elevation2: '#232323',\n elevation3: '#252525',\n },\n text: {\n primary: '#f4f4f4',\n secondary: 'rgba(255, 255, 255, 0.6)',\n },\n },\n});\n\n\nconst Benzin: React.FC = ({ children }) => (\n <ThemeProvider theme={benzinTheme}>\n <CssBaseline />\n {children}\n </ThemeProvider>\n);\n\n\nexport default Benzin;\n\n","import React from 'react';\nimport { Paper } from '@material-ui/core';\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ParserPropTypes } from './types';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n background: theme.palette.background.default,\n padding: theme.spacing(1),\n overflowX: 'auto',\n fontFamily: 'Monospace',\n scrollbarColor: 'auto',\n },\n}));\n\nconst CodeBlock: React.FC<ParserPropTypes> = ({ rawLines }) => {\n const classes = useStyles();\n return (\n <Paper variant=\"outlined\" className={classes.root}>\n {rawLines.map(line => <pre>{line}</pre>)}\n </Paper>\n );\n};\n\nexport default CodeBlock;\n\n","import React from 'react';\nimport { Link, makeStyles } from '@material-ui/core';\n\nimport { lib as emojiLib } from 'emojilib';\n\ninterface PropTypes {\n span: string;\n}\n\ninterface RegexPair {\n global: RegExp;\n local: RegExp;\n}\n\ninterface Emoji {\n name: string;\n char: string;\n}\n\nconst enclosureRegex = (e: string): RegexPair => ({\n local: new RegExp(`${e}([^${e}]+)${e}`),\n global: new RegExp(`(${e}[^${e}]+${e})`),\n});\n\nconst regex: Record<string, RegexPair> = {\n conceal: {\n global: /(!?\\[.+?\\]\\(.+?\\))(?!])/g,\n local: /!?\\[(.*\\]?.*)\\]\\((.+?)\\)/,\n },\n rawLink: {\n // eslint-disable-next-line max-len\n global: /((?:(?:[A-Za-z]{3,9}:(?:\\/\\/)?)(?:[-;:&=+$,\\w]+@)?[A-Za-z0-9.-]+|(?:www\\.|[-;:&=+$,\\w]+@)[A-Za-z0-9.-]+)(?:(?:\\/[+~%/.\\w-_]*)?\\??(?:[-+=&;%@.\\w_]*)#?(?:[.!/\\\\\\w]*))?)/,\n local: /&^/,\n },\n emoji: enclosureRegex(':'),\n bold: enclosureRegex('\\\\*\\\\*'),\n italic: enclosureRegex('\\\\*'),\n code: enclosureRegex('`'),\n strikeThrough: enclosureRegex('~~'),\n};\n\nconst splitter = new RegExp(Object.values(regex).map(pair => pair.global.source).join('|'));\n\nconst emojiList: Emoji[] = [];\nObject.keys(emojiLib).forEach(name => emojiList.push({ name, char: emojiLib[name].char }));\n\nconst useStyles = makeStyles(theme => ({\n code: {\n background: theme.palette.background.default,\n borderRadius: theme.spacing(0.5),\n padding: theme.spacing(0.5),\n fontFamily: 'Monospace',\n },\n image: {\n maxWidth: '100%',\n maxHeight: '100%',\n },\n}));\n\nconst SyntacticSpan: React.FC<PropTypes> = ({ span }) => {\n const classes = useStyles();\n if (!span) return null;\n\n const matchConceal = regex.conceal.local.exec(span);\n if (matchConceal) {\n if (span[0] === '!') return <img src={matchConceal[2]} alt={matchConceal[1]} className={classes.image} />;\n return <Link href={matchConceal[2]}><SyntacticSpan span={matchConceal[1]} /></Link>;\n }\n\n const matchEmoji = span.match(regex.emoji.local);\n if (matchEmoji) {\n const emoji = emojiList.find(e => e.name === matchEmoji[1]);\n return <span>{emoji ? emoji.char : span}</span>;\n }\n\n const matchCode = span.match(regex.code.local);\n if (matchCode) return <span className={classes.code}>{matchCode[1]}</span>;\n\n const matchBold = span.match(regex.bold.local);\n if (matchBold) return <b>{matchBold[1]}</b>;\n\n const matchItalic = span.match(regex.italic.local);\n if (matchItalic) return <i>{matchItalic[1]}</i>;\n\n const matchStrikeThrough = span.match(regex.strikeThrough.local);\n if (matchStrikeThrough) return <span style={{ textDecoration: 'line-through' }}>{matchStrikeThrough[1]}</span>;\n\n if (span.match(regex.rawLink.global)) return <Link href={span}>{span}</Link>;\n\n return <>{span}</>;\n};\n\n\nexport { splitter };\nexport default SyntacticSpan;\n\n","import React from 'react';\nimport SyntacticSpan, { splitter } from './SyntacticSpan';\n\ninterface PropTypes {\n line: string;\n}\n\nconst Text: React.FC<PropTypes> = ({ line }) => {\n return <>{line.split(splitter).map(span => <SyntacticSpan span={span} />)}</>;\n};\n\nexport default Text;\n\n","import React from 'react';\n\nimport CodeBlock from './CodeBlock';\nimport Text from './Text';\nimport { ParserPropTypes } from './types';\n\n\nconst denotesCodeBlock = (line: string): boolean => {\n return line.match(/^\\s*```.*$/) !== null;\n};\n\nconst denotesDottedList = (line: string): boolean => {\n return line.match(/^ ?[-*] .*$/) !== null;\n};\n\nconst denotesOpenHtml = (line: string): string => {\n const regex = /<([^/\\s]*)[^<]*[^/]>/g;\n const match = regex.exec(line);\n return match ? match[1] : '';\n};\n\nconst denotesClosingHtml = (line: string, tag: string): boolean => {\n const regex = new RegExp(`</${tag}[^<]*>`);\n return line.match(regex) !== null;\n};\n\nconst denotesSelfClosingHtml = (line: string): string[] | null => {\n const regex = /(<[^/\\s]*[^<]*\\/>)/g;\n return line.match(regex);\n};\n\nconst declaresNoLineBreak = (line: string): boolean => {\n return line.match(/\\\\\\|$/) !== null;\n};\n\nconst Content: React.FC<ParserPropTypes> = ({ rawLines }) => {\n if (!rawLines.length) return null;\n\n const line = rawLines.splice(0, 1)[0];\n\n let buffer;\n if (denotesCodeBlock(line)) {\n const closeIndex = rawLines.findIndex(rawLine => denotesCodeBlock(rawLine));\n const codeBlockLines = rawLines.splice(0, closeIndex + 1).slice(0, closeIndex);\n buffer = <CodeBlock rawLines={codeBlockLines} />;\n } else if (denotesDottedList(line)) {\n const closeIndex = rawLines.findIndex(rawLine => !denotesDottedList(rawLine));\n const dottedListLines = rawLines.splice(0, closeIndex).slice(0, closeIndex);\n dottedListLines.unshift(line);\n buffer = <ul>{dottedListLines.map(li => <li><Text line={li.slice(2)} /></li>)}</ul>;\n } else if ((buffer = denotesOpenHtml(line))) {\n const tag = buffer;\n const closeIndex = denotesClosingHtml(line, tag) ? -1 : rawLines.findIndex(\n rawLine => denotesClosingHtml(rawLine, tag),\n );\n const htmlLines = rawLines.splice(0, closeIndex + 1);\n htmlLines.unshift(line);\n buffer = <div dangerouslySetInnerHTML={{ __html: htmlLines.join('\\n') }} />;\n } else if ((buffer = denotesSelfClosingHtml(line)) !== null) {\n const match = buffer[0];\n const [before, after] = line.split(match);\n buffer = (\n <>\n <Text line={before} />\n <div dangerouslySetInnerHTML={{ __html: match }} />\n <Text line={after} />\n </>\n );\n } else if (declaresNoLineBreak(line)) {\n const closeIndex = rawLines.findIndex(rawLine => !declaresNoLineBreak(rawLine));\n const lineBreakLines = rawLines.splice(0, closeIndex).map(rawLine => rawLine.slice(0, -2));\n lineBreakLines.unshift(line.slice(0, -2));\n lineBreakLines.push(rawLines.splice(0, 1)[0]);\n buffer = <p>{lineBreakLines.map(lineBreakLine => <Text line={lineBreakLine} />)}</p>;\n } else if (denotesClosingHtml(line, '')) {\n buffer = null;\n } else {\n buffer = <p><Text line={line} /></p>;\n }\n\n return (\n <>\n { buffer }\n <Content rawLines={rawLines} />\n </>\n );\n};\n\nexport default Content;\n\n","import React from 'react';\nimport { Typography } from '@material-ui/core';\nimport ContentSection from '../ContentSection/ContentSection';\nimport Content from './Content';\nimport { ParserPropTypes } from './types';\n\ninterface PropTypes extends ParserPropTypes {\n level?: number;\n}\n\nconst getHeaderLevel = (header: string): number => {\n if (!header) return 0;\n let level = 0;\n while (header[level] === '#') level += 1;\n return level;\n};\n\nconst ChildrenSections: React.FC<PropTypes> = ({ rawLines, level = 0 }) => {\n const childrenSectionLines = rawLines.reduce((sections: string[][], line: string) => {\n if (line) {\n if (getHeaderLevel(line) === level) sections.push([]);\n if (sections.length) sections[sections.length - 1].push(line);\n }\n return sections;\n }, []);\n const children = childrenSectionLines.map(sectionLines => <Section rawLines={sectionLines} level={level} />);\n return <>{children}</>;\n};\n\nconst Section: React.FC<PropTypes> = ({ rawLines, level = 0 }) => {\n const deeperLevelIndex = rawLines.findIndex(line => line.match(`^#{${level + 1},} .*$`));\n const rawContent = rawLines.splice(0, (deeperLevelIndex < 0) ? rawLines.length : deeperLevelIndex);\n\n if (!level) {\n return (\n <>\n <Typography><Content rawLines={rawContent} /></Typography>\n <ChildrenSections rawLines={rawLines} level={getHeaderLevel(rawLines[0])} />\n </>\n );\n }\n\n const sectionName = rawContent.splice(0, 1)[0].slice(level).trim();\n const deeperLevel = getHeaderLevel(rawLines[0]);\n return (\n <ContentSection sectionName={sectionName} level={level}>\n <Content rawLines={rawContent} />\n <ChildrenSections rawLines={rawLines} level={deeperLevel} />\n </ContentSection>\n );\n};\n\nexport default Section;\n\n","import React, { useState, useEffect } from 'react';\nimport axios from 'axios';\n\nimport Section from './Section';\n\ninterface PropTypes {\n data?: string;\n url?: string;\n}\n\nconst resolveUrls = (line: string, baseUrl: string): string => line.replace(\n /src=\"(?!http)(.*)\"[\\s>]/,\n (match, url) => `src=\"${baseUrl}/${url}?sanitize=true\"`,\n).replace(\n /\\[(.*\\]?.*)\\]\\((?!http)(.+?)\\)/,\n (match, text, url) => `[${text}](${baseUrl}/${url})`,\n);\n\nconst Markdown: React.FC<PropTypes> = ({ data, url }) => {\n const [markdown, setMarkdown] = useState<string>(data || '');\n\n if (url) axios.get(url).then(response => setMarkdown(response.data));\n\n useEffect(() => {\n if (!url) setMarkdown(data || '');\n }, [data, url]);\n\n const baseUrl = url?.slice(0, url.lastIndexOf('/')) || '';\n const lines = markdown.split(/\\r?\\n/).map(line => resolveUrls(line, baseUrl));\n return <Section rawLines={lines} />;\n};\n\n\nexport default Markdown;\n\n","import React, { useState, useRef } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { makeStyles, TextField, Button } from '@material-ui/core';\n\nimport {\n Benzin,\n Header,\n Window,\n Markdown,\n ContentSection,\n} from './lib';\n\nimport icon from './assets/icon.svg';\n\ninterface RenderPropTypes {\n index: number;\n style: React.CSSProperties;\n}\n\n\nconst useStyles = makeStyles(theme => ({\n window: {\n padding: theme.spacing(4),\n },\n promoButton: {\n display: 'flex',\n justifyContent: 'center',\n marginTop: theme.spacing(4),\n },\n}));\n\n\nconst Icon = <img src={icon} width=\"32px\" height=\"37px\" alt=\"logo\" />;\n\nconst headerContents = {\n home: null,\n spacevim: null,\n 'material-ui': null,\n custom: null,\n 'live preview': null,\n};\n\nconst pageMap: Record<string, string> = {\n home: 'https://raw.githubusercontent.com/eug-vs/react-benzin/develop/README.md',\n spacevim: 'https://raw.githubusercontent.com/spacevim/spacevim/master/README.md',\n 'material-ui': 'https://raw.githubusercontent.com/mui-org/material-ui/master/README.md',\n};\n\n\nconst CustomPage: React.FC = () => {\n const [url, setUrl] = useState<string>('');\n const inputEl = useRef<HTMLInputElement>(null);\n\n const handleParseUrl = (): void => {\n setUrl(inputEl.current?.value || '');\n };\n\n return (\n <>\n <ContentSection sectionName=\"Render custom markdown document\" level={2}>\n <p>\n This should be a link to a valid markdown file. Response should give the file contents.\n If you copy README file from GitHub, make sure you provide link to raw view.\n </p>\n <p>\n <TextField\n fullWidth\n inputRef={inputEl}\n variant=\"outlined\"\n color=\"secondary\"\n label=\"Markdown url\"\n />\n </p>\n <Button variant=\"contained\" color=\"secondary\" onClick={handleParseUrl}>\n Render!\n </Button>\n </ContentSection>\n <Markdown url={url} />\n </>\n );\n};\n\ninterface LivePropTypes {\n setLivePreviewData: (livePreviewData: string) => void;\n}\n\nconst LivePreviewPage: React.FC<LivePropTypes> = ({ setLivePreviewData }) => {\n const inputEl = useRef<HTMLInputElement>(null);\n\n const handleRender = (): void => {\n setLivePreviewData(inputEl.current?.value || '');\n };\n\n return (\n <>\n <ContentSection sectionName=\"Markdown live preview\" level={2}>\n <p>\n Start typing and see your text rendered on the left window!\n We recommend starting with # Header.\n </p>\n <p>\n <TextField\n fullWidth\n multiline\n inputRef={inputEl}\n variant=\"outlined\"\n color=\"primary\"\n label=\"Markdown\"\n onChange={handleRender}\n />\n </p>\n </ContentSection>\n </>\n );\n};\n\n\nconst App: React.FC = () => {\n const classes = useStyles();\n const [page, setPage] = useState<string>('home');\n const [livePreviewData, setLivePreviewData] = useState<string>('');\n\n const handleGoLivePreview = (): void => {\n setPage('live preview');\n };\n\n const url = pageMap[page];\n const fileName = url?.slice(url.lastIndexOf('/') + 1);\n const info = [\n /* eslint-disable max-len */\n `## Markdown\\n [Markdown file](${url}) *(...${fileName})* that you can see on the left was parsed and rendered by **BENZIN**! :rocket:`,\n 'Switch between tabs on the header to explore other markdown templates. :recycle: ',\n 'Currently **only core features** of markdown function.',\n 'Templates on the left are being loaded from the [GitHub](https://github.com), though this pane is generated from plaintext. :pen:',\n '## How do I use this feature?',\n '```',\n 'import Markdown from \\'react-benzin\\';',\n 'const data = \\'# Header\\\\nHello, *world!*\\';',\n 'ReactDOM.render(<Markdown data={data}/>, document.getElementById(\\'root\\'));',\n '```',\n /* eslint-enable max-len */\n ].join('\\n');\n\n let primaryWindowContent = <Markdown url={url} />;\n if (page === 'custom') primaryWindowContent = <CustomPage />;\n else if (page === 'live preview') {\n primaryWindowContent = <Markdown data={livePreviewData || '# Start typing in the right window!'} />;\n }\n\n return (\n <Benzin>\n <Header\n logo={{\n icon: Icon,\n title: 'BENZIN',\n }}\n contents={headerContents}\n page={page}\n setPage={setPage}\n />\n <Window type=\"primary\">\n <div className={classes.window}>{primaryWindowContent}</div>\n </Window>\n <Window type=\"secondary\" name=\"Feature preview\">\n <div className={classes.window}>\n {\n (page === 'live preview')\n ? <LivePreviewPage setLivePreviewData={setLivePreviewData} />\n : (\n <>\n <Markdown data={info} />\n <p className={classes.promoButton}>\n <Button\n variant=\"contained\"\n color=\"primary\"\n size=\"large\"\n onClick={handleGoLivePreview}\n >\n Try it yourself!\n </Button>\n </p>\n </>\n )\n }\n </div>\n </Window>\n </Benzin>\n );\n};\n\n\nReactDOM.render(<App />, document.getElementById('root'));\n\n"],"sourceRoot":""}
\ No newline at end of file diff --git a/static/js/main.76c0462e.chunk.js b/static/js/main.76c0462e.chunk.js deleted file mode 100644 index 1ba7780..0000000 --- a/static/js/main.76c0462e.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this["webpackJsonpreact-benzin"]=this["webpackJsonpreact-benzin"]||[]).push([[0],{58:function(e,t,a){e.exports=a.p+"static/media/icon.8908a388.svg"},70:function(e,t,a){e.exports=a(99)},99:function(e,t,a){"use strict";a.r(t);var n=a(23),r=a(0),l=a.n(r),c=a(9),i=a.n(c),o=a(51),u=a(138),m=a(136),s=a(101),d=a(130),p=a(63),f=a(100),v=Object(o.a)((function(e){return{surface:{position:"absolute",display:"flex",flexDirection:"column",overflowY:"auto",scrollbarColor:"".concat(e.palette.secondary.dark," ").concat(e.palette.secondary.light),"& a.MuiTypography-root":{color:e.palette.primary.light}}}})),g=function(e){var t=e.size,a=e.position,n=e.children,r=v();return l.a.createElement(f.a,{variant:"outlined",style:Object(p.a)({},t,{},a),className:r.surface},n)},h=Object(o.a)((function(e){return{header:{padding:e.spacing(1,0,1,2),background:e.palette.background.elevation2}}})),E=function(e){var t=e.type,a=e.name,n=e.children,r=h(),c={height:"85vh"},i={bottom:"3vh"};return"primary"===t?(c.width="63vw",i.left="2vw"):"secondary"===t?(c.width="31vw",i.right="2vw"):"mono"===t&&(i.left="2vw",i.right="2vw"),l.a.createElement(g,{size:c,position:i},a&&l.a.createElement("div",null,l.a.createElement(s.a,{variant:"h5",className:r.header},a),l.a.createElement(d.a,null)),n)},w=a(131),b=a(132),y=a(139),k=a(133),j=Object(o.a)((function(e){return{root:{background:e.palette.background.elevation2,color:e.palette.text.primary,paddingLeft:e.spacing(3)},logo:{margin:e.spacing(0,3,0,1)},tab:{"& .MuiTab-wrapper":{padding:e.spacing(2),flexDirection:"row",fontSize:"0.8125rem","& svg":{marginRight:e.spacing(1),marginBottom:"0 !important"}}}}})),x=function(e){var t=e.logo,a=e.contents,n=e.page,r=e.setPage,c=j();return l.a.createElement(w.a,{position:"sticky",className:c.root},l.a.createElement(b.a,null,t.icon,l.a.createElement(s.a,{variant:"h5",className:c.logo,color:"primary"},t.title),l.a.createElement(y.a,{onChange:function(e,t){r(t)},value:n},a&&Object.keys(a).map((function(e){return l.a.createElement(k.a,{label:e,icon:a[e],value:e,className:c.tab,key:e})})))))},O=Object(o.a)((function(e){return{content:{padding:e.spacing(2,2,1,3),marginBottom:e.spacing(1),"& .MuiButton-root":{margin:e.spacing(1,2,2,0)}}}})),N=function(e){var t=e.sectionName,a=e.children,n=e.level,r=void 0===n?0:n,c=O();(r+=2)>6&&(r=6);var i="h"+r;return l.a.createElement(l.a.Fragment,null,l.a.createElement(s.a,{variant:i},t),l.a.createElement(d.a,{variant:"middle"}),l.a.createElement(s.a,{component:"div",className:c.content},a))},L=(a(62),a(54),a(55)),M=a.n(L),R=a(56),I=a.n(R),F=a(61),z=a(134),D=a(135),S=(a(79),Object(F.a)({palette:{type:"dark",primary:{main:M.a[400]},secondary:{main:I.a[500]},background:{default:"#121212",paper:"#1e1e1e",elevation1:"#1e1e1e",elevation2:"#232323",elevation3:"#252525"},text:{primary:"#f4f4f4",secondary:"rgba(255, 255, 255, 0.6)"}}})),T=function(e){var t=e.children;return l.a.createElement(z.a,{theme:S},l.a.createElement(D.a,null),t)},B=a(57),H=a.n(B),C=Object(o.a)((function(e){return{root:{background:e.palette.background.default,padding:e.spacing(1),overflowX:"auto",fontFamily:"Monospace",scrollbarColor:"auto"}}})),A=function(e){var t=e.rawLines,a=C();return l.a.createElement(f.a,{variant:"outlined",className:a.root},t.map((function(e){return l.a.createElement("pre",null,e)})))},$=a(137),_=a(36),Z=function(e){return{local:new RegExp("".concat(e,"([^").concat(e,"]+)").concat(e)),global:new RegExp("(".concat(e,"[^").concat(e,"]+").concat(e,")"))}},P={conceal:{global:/(!?\[.+?\]\(.+?\))(?!])/g,local:/!?\[(.*\]?.*)\]\((.+?)\)/},rawLink:{global:/((?:(?:[A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www\.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)(?:(?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[.!/\\\w]*))?)/,local:/&^/},emoji:Z(":"),bold:Z("\\*\\*"),italic:Z("\\*"),code:Z("`"),strikeThrough:Z("~~")},W=new RegExp(Object.values(P).map((function(e){return e.global.source})).join("|")),G=[];Object.keys(_.lib).forEach((function(e){return G.push({name:e,char:_.lib[e].char})}));var J=Object(o.a)((function(e){return{code:{background:e.palette.background.default,borderRadius:e.spacing(.5),padding:e.spacing(.5),fontFamily:"Monospace"},image:{maxWidth:"100%",maxHeight:"100%"}}})),X=function e(t){var a=t.span,n=J();if(!a)return null;var r=P.conceal.local.exec(a);if(r)return"!"===a[0]?l.a.createElement("img",{src:r[2],alt:r[1],className:n.image}):l.a.createElement($.a,{href:r[2]},l.a.createElement(e,{span:r[1]}));var c=a.match(P.emoji.local);if(c){var i=G.find((function(e){return e.name===c[1]}));return l.a.createElement("span",null,i?i.char:a)}var o=a.match(P.code.local);if(o)return l.a.createElement("span",{className:n.code},o[1]);var u=a.match(P.bold.local);if(u)return l.a.createElement("b",null,u[1]);var m=a.match(P.italic.local);if(m)return l.a.createElement("i",null,m[1]);var s=a.match(P.strikeThrough.local);return s?l.a.createElement("span",{style:{textDecoration:"line-through"}},s[1]):a.match(P.rawLink.global)?l.a.createElement($.a,{href:a},a):l.a.createElement(l.a.Fragment,null,a)},Y=function(e){var t=e.line;return l.a.createElement(l.a.Fragment,null,t.split(W).map((function(e){return l.a.createElement(X,{span:e})})))},q=function(e){return null!==e.match(/^\s*```.*$/)},K=function(e){return null!==e.match(/^ ?[-*] .*$/)},Q=function(e,t){var a=new RegExp("</".concat(t,"[^<]*>"));return null!==e.match(a)},U=function(e){return null!==e.match(/\\\|$/)},V=function e(t){var a=t.rawLines;if(!a.length)return null;var r,c=a.splice(0,1)[0];if(q(c)){var i=a.findIndex((function(e){return q(e)})),o=a.splice(0,i+1).slice(0,i);r=l.a.createElement(A,{rawLines:o})}else if(K(c)){var u=a.findIndex((function(e){return!K(e)})),m=a.splice(0,u).slice(0,u);m.unshift(c),r=l.a.createElement("ul",null,m.map((function(e){return l.a.createElement("li",null,l.a.createElement(Y,{line:e.slice(2)}))})))}else if(r=function(e){var t=/<([^/\s]*)[^<]*[^/]>/g.exec(e);return t?t[1]:""}(c)){var s=r,d=Q(c,s)?-1:a.findIndex((function(e){return Q(e,s)})),p=a.splice(0,d+1);p.unshift(c),r=l.a.createElement("div",{dangerouslySetInnerHTML:{__html:p.join("\n")}})}else if(null!==(r=function(e){return e.match(/(<[^/\s]*[^<]*\/>)/g)}(c))){var f=r[0],v=c.split(f),g=Object(n.a)(v,2),h=g[0],E=g[1];r=l.a.createElement(l.a.Fragment,null,l.a.createElement(Y,{line:h}),l.a.createElement("div",{dangerouslySetInnerHTML:{__html:f}}),l.a.createElement(Y,{line:E}))}else if(U(c)){var w=a.findIndex((function(e){return!U(e)})),b=a.splice(0,w).map((function(e){return e.slice(0,-2)}));b.unshift(c.slice(0,-2)),b.push(a.splice(0,1)[0]),r=l.a.createElement("p",null,b.map((function(e){return l.a.createElement(Y,{line:e})})))}else r=Q(c,"")?null:l.a.createElement("p",null,l.a.createElement(Y,{line:c}));return l.a.createElement(l.a.Fragment,null,r,l.a.createElement(e,{rawLines:a}))},ee=function(e){if(!e)return 0;for(var t=0;"#"===e[t];)t++;return t},te=function(e){var t=e.rawLines,a=e.level,n=void 0===a?0:a,r=t.reduce((function(e,t){return t&&(ee(t)===n&&e.push([]),e.length&&e[e.length-1].push(t)),e}),[]).map((function(e){return l.a.createElement(ae,{rawLines:e,level:n})}));return l.a.createElement(l.a.Fragment,null," ",r," ")},ae=function(e){var t=e.rawLines,a=e.level,n=void 0===a?0:a,r=t.findIndex((function(e){return e.match("^#{".concat(n+1,",} .*$"))})),c=t.splice(0,r<0?t.length:r);if(!n)return l.a.createElement(l.a.Fragment,null,l.a.createElement(s.a,null," ",l.a.createElement(V,{rawLines:c})," "),l.a.createElement(te,{rawLines:t,level:ee(t[0])}));var i=c.splice(0,1)[0].slice(n).trim(),o=ee(t[0]);return l.a.createElement(N,{sectionName:i,level:n},l.a.createElement(V,{rawLines:c}),l.a.createElement(te,{rawLines:t,level:o}))},ne=ae,re=function(e){var t=e.data,a=e.url,c=Object(r.useState)(t||""),i=Object(n.a)(c,2),o=i[0],u=i[1];a&&H.a.get(a).then((function(e){return u(e.data)})),Object(r.useEffect)((function(){a||u(t||"")}),[t,a]);var m=(null===a||void 0===a?void 0:a.slice(0,a.lastIndexOf("/")))||"",s=o.split(/\r?\n/).map((function(e){return function(e,t){return e.replace(/src="(?!http)(.*)"[\s>]/,(function(e,a,n,r){return'src="'.concat(t,"/").concat(a,'?sanitize=true"')})).replace(/\[(.*\]?.*)\]\((?!http)(.+?)\)/,(function(e,a,n,r,l){return"[".concat(a,"](").concat(t,"/").concat(n,")")}))}(e,m)}));return l.a.createElement(ne,{rawLines:s})},le=a(58),ce=a.n(le),ie=Object(o.a)((function(e){return{window:{padding:e.spacing(4)},promoButton:{display:"flex",justifyContent:"center",marginTop:e.spacing(4)}}})),oe=l.a.createElement("img",{src:ce.a,width:"32px",height:"37px",alt:"logo"}),ue={home:null,spacevim:null,"material-ui":null,custom:null,"live preview":null},me={home:"https://raw.githubusercontent.com/eug-vs/react-benzin/develop/README.md",spacevim:"https://raw.githubusercontent.com/spacevim/spacevim/master/README.md","material-ui":"https://raw.githubusercontent.com/mui-org/material-ui/master/README.md"},se=function(){var e=Object(r.useState)(""),t=Object(n.a)(e,2),a=t[0],c=t[1],i=Object(r.useRef)(null);return l.a.createElement(l.a.Fragment,null,l.a.createElement(N,{sectionName:"Render custom markdown document",level:2},l.a.createElement("p",null,"This should be a link to a valid markdown file. Response should give the file contents. If you copy README file from GitHub, make sure you provide link to raw view."),l.a.createElement("p",null,l.a.createElement(u.a,{fullWidth:!0,inputRef:i,variant:"outlined",color:"secondary",label:"Markdown url"})),l.a.createElement(m.a,{variant:"contained",color:"secondary",onClick:function(){var e;c((null===(e=i.current)||void 0===e?void 0:e.value)||"")}},"Render!")),l.a.createElement(re,{url:a}))},de=function(e){var t=e.setLivePreviewData,a=Object(r.useRef)(null);return l.a.createElement(l.a.Fragment,null,l.a.createElement(N,{sectionName:"Markdown live preview",level:2},l.a.createElement("p",null,"Start typing and see your text rendered on the left window! We recommend starting with # Header."),l.a.createElement("p",null,l.a.createElement(u.a,{fullWidth:!0,multiline:!0,inputRef:a,variant:"outlined",color:"primary",label:"Markdown",onChange:function(){var e;t((null===(e=a.current)||void 0===e?void 0:e.value)||"")}}))))};i.a.render(l.a.createElement((function(){var e=ie(),t=Object(r.useState)("home"),a=Object(n.a)(t,2),c=a[0],i=a[1],o=Object(r.useState)(""),u=Object(n.a)(o,2),s=u[0],d=u[1],p=me[c],f=null===p||void 0===p?void 0:p.slice(p.lastIndexOf("/")+1),v=["## Markdown\n [Markdown file](".concat(p,") *(...").concat(f,")* that you can see on the left was parsed and rendered by **BENZIN**! :rocket:"),"Switch between tabs on the header to explore other markdown templates. :recycle: ","Currently **only core features** of markdown function.","Templates on the left are being loaded from the [GitHub](https://github.com), though this pane is generated from plaintext. :pen:","## How do I use this feature?","```","import Markdown from 'react-benzin';","const data = '# Header\\nHello, *world!*';","ReactDOM.render(<Markdown data={data}/>, document.getElementById('root'));","```"].join("\n");return l.a.createElement(T,null,l.a.createElement(x,{logo:{icon:oe,title:"BENZIN"},contents:ue,page:c,setPage:i}),l.a.createElement(E,{type:"primary"},l.a.createElement("div",{className:e.window},"custom"===c?l.a.createElement(se,null):"live preview"===c?l.a.createElement(re,{data:s||"# Start typing in the right window!"}):l.a.createElement(re,{url:p}))),l.a.createElement(E,{type:"secondary",name:"Feature preview"},l.a.createElement("div",{className:e.window},"live preview"===c?l.a.createElement(de,{setLivePreviewData:d}):l.a.createElement(l.a.Fragment,null,l.a.createElement(re,{data:v}),l.a.createElement("p",{className:e.promoButton},l.a.createElement(m.a,{variant:"contained",color:"primary",size:"large",onClick:function(){i("live preview")}},"Try it yourself!"))))))}),null),document.getElementById("root"))}},[[70,1,2]]]); -//# sourceMappingURL=main.76c0462e.chunk.js.map
\ No newline at end of file diff --git a/static/js/main.76c0462e.chunk.js.map b/static/js/main.76c0462e.chunk.js.map deleted file mode 100644 index 613580a..0000000 --- a/static/js/main.76c0462e.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["assets/icon.svg","lib/Window/WindowSurface.tsx","lib/Window/Window.tsx","lib/Header/Header.tsx","lib/ContentSection/ContentSection.tsx","lib/Benzin/Benzin.tsx","lib/Markdown/CodeBlock.tsx","lib/Markdown/SyntacticSpan.tsx","lib/Markdown/Text.tsx","lib/Markdown/Content.tsx","lib/Markdown/Section.tsx","lib/Markdown/Markdown.tsx","index.tsx"],"names":["module","exports","useStyles","makeStyles","theme","surface","position","display","flexDirection","overflowY","scrollbarColor","palette","secondary","dark","light","color","primary","WindowSurface","size","children","classes","Paper","variant","style","className","header","padding","spacing","background","elevation2","Window","type","name","height","bottom","width","left","right","Typography","Divider","root","text","paddingLeft","logo","margin","tab","fontSize","marginRight","marginBottom","Header","contents","page","setPage","AppBar","Toolbar","icon","title","Tabs","onChange","event","newPage","value","Object","keys","map","item","Tab","label","key","content","ContentSection","sectionName","level","component","benzinTheme","createMuiTheme","main","orange","purple","default","paper","elevation1","elevation3","Benzin","ThemeProvider","CssBaseline","overflowX","fontFamily","CodeBlock","rawLines","line","enclosureRegex","e","local","RegExp","global","regex","conceal","rawLink","emoji","bold","italic","code","strikeThrough","splitter","values","pair","source","join","emojiList","emojiLib","forEach","push","char","borderRadius","image","maxWidth","maxHeight","SyntacticSpan","span","matchConceal","exec","src","alt","Link","href","matchEmoji","match","find","matchCode","matchBold","matchItalic","matchStrikeThrough","textDecoration","Text","split","denotesCodeBlock","denotesDottedList","denotesClosingHtml","tag","declaresNoLineBreak","Content","length","buffer","splice","closeIndex","findIndex","codeBlockLines","slice","dottedListLines","unshift","li","denotesOpenHtml","htmlLines","dangerouslySetInnerHTML","__html","denotesSelfClosingHtml","before","after","lineBreakLines","lineBreakLine","getHeaderLevel","ChildrenSections","reduce","sections","sectionLines","Section","deeperLevelIndex","rawContent","trim","deeperLevel","Markdown","data","url","useState","markdown","setMarkdown","axios","get","then","response","useEffect","baseUrl","lastIndexOf","lines","replace","offset","string","resolveUrls","window","promoButton","justifyContent","marginTop","Icon","headerContents","home","pageMap","CustomPage","setUrl","inputEl","useRef","TextField","fullWidth","inputRef","onClick","current","LivePreviewPage","setLivePreviewData","multiline","ReactDOM","render","livePreviewData","fileName","info","document","getElementById"],"mappings":"sGAAAA,EAAOC,QAAU,IAA0B,kC,oLCarCC,EAAYC,aAAW,SAAAC,GAAK,MAAK,CACrCC,QAAS,CACPC,SAAU,WACVC,QAAS,OACTC,cAAe,SACfC,UAAW,OACXC,eAAe,GAAD,OAAKN,EAAMO,QAAQC,UAAUC,KAA7B,YAAqCT,EAAMO,QAAQC,UAAUE,OAE3E,yBAA0B,CACxBC,MAAOX,EAAMO,QAAQK,QAAQF,YAqBpBG,EAf4B,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AD,MAEU,iBAATA,EACD,kBAAC,GAAD,CAAUyH,KAAMuC,GAAmB,wCAEnC,kBAAC,GAAD,CAAUtC,IAAKA,MAIrB,kBAAC,EAAD,CAAQ9I,KAAK,YAAYC,KAAK,mBAC5B,yBAAKR,UAAWJ,EAAQyK,QAEV,iBAAT1I,EACD,kBAAC,GAAD,CAAiB4J,mBAAoBA,IAErC,oCACE,kBAAC,GAAD,CAAUnC,KAAMyC,IAChB,uBAAG7L,UAAWJ,EAAQ0K,aACpB,kBAAC,IAAD,CACExK,QAAQ,YACRP,MAAM,UACNG,KAAK,QACL0L,QAxDY,WAC1BxJ,EAAQ,kBAmDI,2BAkBA,MAASkK,SAASC,eAAe,W","file":"static/js/main.76c0462e.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/icon.8908a388.svg\";","import React from 'react';\n\nimport { Paper, makeStyles } from '@material-ui/core';\n\nimport { SurfaceSize, SurfacePosition } from './types';\n\n\ninterface PropTypes {\n size: SurfaceSize;\n position: SurfacePosition;\n}\n\n\nconst useStyles = makeStyles(theme => ({\n surface: {\n position: 'absolute',\n display: 'flex',\n flexDirection: 'column',\n overflowY: 'auto',\n scrollbarColor: `${theme.palette.secondary.dark} ${theme.palette.secondary.light}`,\n\n '& a.MuiTypography-root': {\n color: theme.palette.primary.light,\n },\n }\n}));\n\n\nconst WindowSurface: React.FC<PropTypes> = ({ size, position, children }) => {\n const classes = useStyles();\n\n return (\n <Paper\n variant=\"outlined\"\n style={{...size, ...position}}\n className={classes.surface}\n >\n {children}\n </Paper>\n )\n};\n\n\nexport default WindowSurface;\n","import React from 'react';\n\nimport { Typography, Divider, makeStyles } from '@material-ui/core';\n\nimport WindowSurface from './WindowSurface';\nimport { SurfaceSize, SurfacePosition } from './types';\n\n\ninterface PropTypes {\n type: 'primary' | 'secondary' | 'mono';\n name?: string;\n}\n\n\nconst useStyles = makeStyles(theme => ({\n header: {\n padding: theme.spacing(1, 0, 1, 2),\n background: theme.palette.background.elevation2,\n },\n}));\n\n\nconst Window: React.FC<PropTypes> = ({ type, name, children }) => {\n const classes = useStyles();\n\n const size: SurfaceSize = {\n height: '85vh',\n };\n\n const position: SurfacePosition = {\n bottom: '3vh',\n };\n\n if (type === 'primary') {\n size.width = '63vw';\n position.left = '2vw';\n } else if (type === 'secondary') {\n size.width = '31vw';\n position.right = '2vw';\n } else if (type === 'mono') {\n position.left = '2vw';\n position.right = '2vw';\n }\n\n return (\n <WindowSurface\n size={size}\n position={position}\n >\n {name &&\n <div>\n <Typography variant=\"h5\" className={classes.header}>{name}</Typography>\n <Divider />\n </div>\n }\n {children}\n </WindowSurface>\n );\n};\n\nexport default Window;\n","import React from 'react';\n\nimport {\n AppBar,\n Tabs,\n Tab,\n Typography,\n Toolbar,\n} from '@material-ui/core';\n\nimport { makeStyles } from '@material-ui/core/styles';\n\n\ninterface PropTypes {\n logo: {\n icon: React.ReactNode;\n title: string;\n };\n contents: {\n [key: string]: React.ReactNode | null;\n };\n page: string;\n setPage: (newPage: string) => void;\n}\n\nconst useStyles = makeStyles(theme => ({\n root: {\n background: theme.palette.background.elevation2,\n color: theme.palette.text.primary,\n paddingLeft: theme.spacing(3),\n },\n logo: {\n margin: theme.spacing(0, 3, 0, 1),\n },\n tab: {\n '& .MuiTab-wrapper': {\n padding: theme.spacing(2),\n flexDirection: 'row',\n fontSize: '0.8125rem',\n '& svg': {\n marginRight: theme.spacing(1),\n marginBottom: '0 !important',\n }\n }\n }\n}));\n\n\nconst Header: React.FC<PropTypes> = ({ logo, contents, page, setPage }) => {\n const classes = useStyles();\n\n const handleChange = (event: React.ChangeEvent<{}>, newPage: string): void => {\n setPage(newPage);\n };\n\n return (\n <AppBar position=\"sticky\" className={classes.root}>\n <Toolbar>\n {logo.icon}\n <Typography variant=\"h5\" className={classes.logo} color=\"primary\">\n {logo.title}\n </Typography>\n <Tabs onChange={handleChange} value={page}>\n {contents && Object.keys(contents).map((item: string) => (\n <Tab\n label={item}\n icon={contents[item] as JSX.Element}\n value={item}\n className={classes.tab}\n key={item}\n />\n ))}\n </Tabs>\n </Toolbar>\n </AppBar>\n );\n};\n\nexport default Header;\n","import React from 'react';\n\nimport {\n Typography,\n Divider,\n makeStyles\n} from '@material-ui/core';\n\n\ninterface PropTypes {\n sectionName: string;\n level?: number;\n}\n\nconst useStyles = makeStyles(theme => ({\n content: {\n padding: theme.spacing(2, 2, 1, 3),\n marginBottom: theme.spacing(1),\n\n '& .MuiButton-root': {\n margin: theme.spacing(1, 2, 2, 0),\n },\n },\n}));\n\nconst ContentSection: React.FC<PropTypes> = ({ sectionName, children, level = 0 }) => {\n const classes = useStyles();\n\n level += 2; // Make everything smaller\n if (level > 6) level = 6;\n\n type Variant = 'h3' | 'h4' | 'h5' | 'h6';\n const variant: Variant = 'h' + level as Variant;\n\n return (\n <>\n <Typography variant={variant}>{sectionName}</Typography>\n <Divider variant=\"middle\"/>\n <Typography component=\"div\" className={classes.content}>\n {children}\n </Typography>\n </>\n );\n\n};\n\n\nexport default ContentSection;\n","import React from 'react';\nimport orange from '@material-ui/core/colors/orange';\nimport purple from '@material-ui/core/colors/purple';\nimport { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';\nimport { CssBaseline } from '@material-ui/core';\nimport 'typeface-roboto';\n\n\ndeclare module '@material-ui/core/styles/createPalette' {\n interface TypeBackground {\n elevation1: string;\n elevation2: string;\n elevation3: string;\n }\n}\n\n\nconst benzinTheme = createMuiTheme({\n palette: {\n type: 'dark',\n primary: {\n main: orange[400],\n },\n secondary: {\n main: purple[500],\n },\n background: {\n default: '#121212',\n paper: '#1e1e1e',\n elevation1: '#1e1e1e',\n elevation2: '#232323',\n elevation3: '#252525',\n },\n text: {\n primary: '#f4f4f4',\n secondary: 'rgba(255, 255, 255, 0.6)',\n }\n },\n});\n\n\nconst Benzin: React.FC = ({ children }) => (\n <ThemeProvider theme={benzinTheme}>\n <CssBaseline />\n {children}\n </ThemeProvider>\n);\n\n\nexport default Benzin;\n\n","import React from 'react';\nimport { ParserPropTypes } from './types';\nimport { Paper } from '@material-ui/core';\n\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n background: theme.palette.background.default,\n padding: theme.spacing(1),\n overflowX: 'auto',\n fontFamily: 'Monospace',\n scrollbarColor: 'auto'\n },\n}));\n\nconst CodeBlock: React.FC<ParserPropTypes> = ({ rawLines }) => {\n const classes = useStyles();\n return (\n <Paper variant=\"outlined\" className={classes.root}>\n {rawLines.map(line => <pre>{line}</pre>)}\n </Paper>\n );\n}\n\nexport default CodeBlock;\n\n","import React from 'react';\nimport { Link, makeStyles } from '@material-ui/core';\n\nimport { lib as emojiLib } from 'emojilib';\n\ninterface PropTypes {\n span: string;\n}\n\ninterface RegexPair {\n global: RegExp;\n local: RegExp;\n}\n\ninterface Emoji {\n name: string;\n char: string;\n}\n\nconst enclosureRegex = (e: string): RegexPair => ({\n local: new RegExp(`${e}([^${e}]+)${e}`),\n global: new RegExp(`(${e}[^${e}]+${e})`)\n});\n\nconst regex: Record<string, RegexPair> = {\n conceal: {\n global: /(!?\\[.+?\\]\\(.+?\\))(?!])/g,\n local: /!?\\[(.*\\]?.*)\\]\\((.+?)\\)/\n },\n rawLink: {\n global: /((?:(?:[A-Za-z]{3,9}:(?:\\/\\/)?)(?:[-;:&=+$,\\w]+@)?[A-Za-z0-9.-]+|(?:www\\.|[-;:&=+$,\\w]+@)[A-Za-z0-9.-]+)(?:(?:\\/[+~%/.\\w-_]*)?\\??(?:[-+=&;%@.\\w_]*)#?(?:[.!/\\\\\\w]*))?)/,\n local: /&^/\n },\n emoji: enclosureRegex(':'),\n bold: enclosureRegex('\\\\*\\\\*'),\n italic: enclosureRegex('\\\\*'),\n code: enclosureRegex('`'),\n strikeThrough: enclosureRegex('~~'),\n}\n\nconst splitter = new RegExp(Object.values(regex).map(pair => pair.global.source).join('|'));\n\nconst emojiList: Emoji[] = [];\nObject.keys(emojiLib).forEach(name => emojiList.push({ name, char: emojiLib[name].char }));\n\nconst useStyles = makeStyles(theme => ({\n code: {\n background: theme.palette.background.default,\n borderRadius: theme.spacing(.5),\n padding: theme.spacing(.5),\n fontFamily: 'Monospace',\n },\n image: {\n maxWidth: '100%',\n maxHeight: '100%'\n },\n}));\n\nconst SyntacticSpan: React.FC<PropTypes> = ({ span }) => {\n const classes = useStyles();\n if (!span) return null;\n\n const matchConceal = regex.conceal.local.exec(span);\n if (matchConceal) {\n if (span[0] === '!') return <img src={matchConceal[2]} alt={matchConceal[1]} className={classes.image} />;\n return <Link href={matchConceal[2]}><SyntacticSpan span={matchConceal[1]} /></Link>;\n }\n\n const matchEmoji = span.match(regex.emoji.local);\n if (matchEmoji) {\n const emoji = emojiList.find(emoji => emoji.name === matchEmoji[1]);\n return <span>{emoji ? emoji.char : span}</span>;\n }\n\n const matchCode = span.match(regex.code.local);\n if (matchCode) return <span className={classes.code}>{matchCode[1]}</span>;\n\n const matchBold = span.match(regex.bold.local);\n if (matchBold) return <b>{matchBold[1]}</b>;\n\n const matchItalic = span.match(regex.italic.local);\n if (matchItalic) return <i>{matchItalic[1]}</i>;\n\n const matchStrikeThrough = span.match(regex.strikeThrough.local);\n if (matchStrikeThrough) return <span style={{textDecoration: 'line-through' }}>{matchStrikeThrough[1]}</span>;\n\n if (span.match(regex.rawLink.global)) return <Link href={span}>{span}</Link>;\n\n return <>{span}</>;\n}\n\n\nexport { splitter };\nexport default SyntacticSpan;\n\n","import React from 'react';\nimport SyntacticSpan, { splitter } from './SyntacticSpan';\n\ninterface PropTypes {\n line: string;\n}\n\nconst Text: React.FC<PropTypes> = ({ line }) => {\n return <>{line.split(splitter).map(span => <SyntacticSpan span={span} />)}</>;\n}\n\nexport default Text;\n\n","import React from 'react';\n\nimport CodeBlock from './CodeBlock';\nimport Text from './Text';\nimport { ParserPropTypes } from './types';\n\n\nconst denotesCodeBlock = (line: string): boolean => {\n return line.match(/^\\s*```.*$/) !== null; }\n\nconst denotesDottedList = (line: string): boolean => {\n return line.match(/^ ?[-*] .*$/) !== null;\n}\n\nconst denotesOpenHtml= (line: string): string => {\n const regex = /<([^/\\s]*)[^<]*[^/]>/g;\n const match = regex.exec(line);\n return match ? match[1] : '';\n}\n\nconst denotesClosingHtml= (line: string, tag: string): boolean => {\n const regex = new RegExp(`</${tag}[^<]*>`);\n return line.match(regex) !== null;\n}\n\nconst denotesSelfClosingHtml = (line: string): string[] | null => {\n const regex = /(<[^/\\s]*[^<]*\\/>)/g;\n return line.match(regex);\n}\n\nconst declaresNoLineBreak = (line: string): boolean => {\n return line.match(/\\\\\\|$/) !== null;\n}\n\nconst Content: React.FC<ParserPropTypes> = ({ rawLines }) => {\n if (!rawLines.length) return null;\n\n const line = rawLines.splice(0, 1)[0];\n\n let buffer;\n if (denotesCodeBlock(line)) {\n const closeIndex = rawLines.findIndex(line => denotesCodeBlock(line));\n const codeBlockLines = rawLines.splice(0, closeIndex + 1).slice(0, closeIndex);\n buffer = <CodeBlock rawLines={codeBlockLines} />\n } else if (denotesDottedList(line)) {\n const closeIndex = rawLines.findIndex(line => !denotesDottedList(line));\n const dottedListLines = rawLines.splice(0, closeIndex).slice(0, closeIndex);\n dottedListLines.unshift(line);\n buffer = <ul>{dottedListLines.map(li => <li><Text line={li.slice(2)} /></li>)}</ul>;\n } else if ((buffer = denotesOpenHtml(line))) {\n const tag = buffer;\n const closeIndex = denotesClosingHtml(line, tag) ? -1 : rawLines.findIndex(line => denotesClosingHtml(line, tag));\n const htmlLines = rawLines.splice(0, closeIndex + 1);\n htmlLines.unshift(line);\n buffer = <div dangerouslySetInnerHTML={{ __html: htmlLines.join('\\n') }}></div>;\n } else if ((buffer = denotesSelfClosingHtml(line)) !== null) {\n const match = buffer[0];\n const [before, after] = line.split(match);\n buffer = (\n <>\n <Text line={before} />\n <div dangerouslySetInnerHTML={{ __html: match }}></div>\n <Text line={after} />\n </>\n );\n } else if (declaresNoLineBreak(line)) {\n const closeIndex = rawLines.findIndex(line => !declaresNoLineBreak(line));\n const lineBreakLines = rawLines.splice(0, closeIndex).map(line => line.slice(0, -2));\n lineBreakLines.unshift(line.slice(0, -2));\n lineBreakLines.push(rawLines.splice(0, 1)[0]);\n buffer = <p>{lineBreakLines.map(lineBreakLine => <Text line={lineBreakLine} />)}</p>;\n } else if (denotesClosingHtml(line, '')) {\n buffer = null;\n } else {\n buffer = <p><Text line={line} /></p>\n }\n\n return (\n <>\n { buffer }\n <Content rawLines={rawLines} />\n </>\n );\n}\n\nexport default Content;\n\n","import React from 'react';\nimport ContentSection from '../ContentSection/ContentSection';\nimport { Typography } from '@material-ui/core';\nimport Content from './Content';\nimport { ParserPropTypes } from './types';\n\ninterface PropTypes extends ParserPropTypes {\n level?: number;\n}\n\nconst getHeaderLevel = (header: string): number => {\n if (!header) return 0;\n let level = 0;\n while(header[level] === '#') level++;\n return level;\n}\n\nconst ChildrenSections: React.FC<PropTypes> = ({ rawLines, level = 0 }) => {\n const childrenSectionLines = rawLines.reduce((sections: string[][], line: string) => {\n if (line) {\n if (getHeaderLevel(line) === level) sections.push([]);\n if (sections.length) sections[sections.length - 1].push(line);\n }\n return sections;\n }, []);\n const children = childrenSectionLines.map(sectionLines => <Section rawLines={sectionLines} level={level}/>);\n return <> {children} </>;\n}\n\nconst Section: React.FC<PropTypes> = ({ rawLines, level = 0 }) => {\n const deeperLevelIndex = rawLines.findIndex(line => line.match(`^#{${level + 1},} .*$`));\n const rawContent = rawLines.splice(0, (deeperLevelIndex < 0) ? rawLines.length : deeperLevelIndex);\n\n if (!level) return (\n <>\n <Typography> <Content rawLines={rawContent} /> </Typography>\n <ChildrenSections rawLines={rawLines} level={getHeaderLevel(rawLines[0])}/>\n </>\n )\n\n const sectionName = rawContent.splice(0, 1)[0].slice(level).trim();\n const deeperLevel = getHeaderLevel(rawLines[0]);\n return (\n <ContentSection sectionName={sectionName} level={level}>\n <Content rawLines={rawContent} />\n <ChildrenSections rawLines={rawLines} level={deeperLevel} />\n </ContentSection>\n );\n}\n\nexport default Section;\n\n","import React, { useState, useEffect } from 'react';\nimport axios from 'axios';\n\nimport Section from './Section';\n\ninterface PropTypes {\n data?: string;\n url?: string;\n}\n\nconst resolveUrls = (line: string, baseUrl: string): string => {\n return line.replace(/src=\"(?!http)(.*)\"[\\s>]/, (match, url, offset, string) => `src=\"${baseUrl}/${url}?sanitize=true\"`)\n .replace(/\\[(.*\\]?.*)\\]\\((?!http)(.+?)\\)/, (match, text, url, offset, string) => `[${text}](${baseUrl}/${url})`);\n}\n\nconst Markdown: React.FC<PropTypes> = ({ data, url }) => {\n const [markdown, setMarkdown] = useState<string>(data || '');\n\n if (url) axios.get(url).then(response => setMarkdown(response.data));\n\n useEffect(() => {\n if (!url) setMarkdown(data || '');\n }, [data, url]);\n\n const baseUrl = url?.slice(0, url.lastIndexOf('/')) || '';\n const lines = markdown.split(/\\r?\\n/).map(line => resolveUrls(line, baseUrl));\n return <Section rawLines={lines} />\n};\n\n\nexport default Markdown;\n\n","import React, { useState, useRef } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { makeStyles, TextField, Button } from '@material-ui/core';\n\nimport {\n Benzin,\n Header,\n Window,\n Markdown,\n ContentSection,\n} from './lib';\n\nimport icon from './assets/icon.svg';\n\ninterface RenderPropTypes {\n index: number;\n style: React.CSSProperties;\n}\n\n\nconst useStyles = makeStyles(theme => ({\n window: {\n padding: theme.spacing(4),\n },\n promoButton: {\n display: 'flex',\n justifyContent: 'center',\n marginTop: theme.spacing(4),\n }\n}));\n\n\nconst Icon = <img src={icon} width=\"32px\" height=\"37px\" alt=\"logo\"/>\n\nconst headerContents = {\n home: null,\n 'spacevim': null,\n 'material-ui': null,\n 'custom': null,\n 'live preview': null,\n};\n\nconst pageMap: Record<string, string> = {\n home: 'https://raw.githubusercontent.com/eug-vs/react-benzin/develop/README.md',\n 'spacevim': 'https://raw.githubusercontent.com/spacevim/spacevim/master/README.md',\n 'material-ui': 'https://raw.githubusercontent.com/mui-org/material-ui/master/README.md',\n};\n\n\nconst CustomPage: React.FC = () => {\n const [url, setUrl] = useState<string>('');\n const inputEl = useRef<HTMLInputElement>(null);\n\n const handleParseUrl = (): void => {\n setUrl(inputEl.current?.value || '');\n }\n\n return (\n <>\n <ContentSection sectionName=\"Render custom markdown document\" level={2} >\n <p>\n This should be a link to a valid markdown file. Response should give the file contents.\n If you copy README file from GitHub, make sure you provide link to raw view.\n </p>\n <p>\n <TextField\n fullWidth\n inputRef={inputEl}\n variant=\"outlined\"\n color=\"secondary\"\n label=\"Markdown url\"\n />\n </p>\n <Button variant=\"contained\" color=\"secondary\" onClick={handleParseUrl} >\n Render!\n </Button>\n </ContentSection>\n <Markdown url={url} />\n </>\n );\n}\n\ninterface LivePropTypes {\n setLivePreviewData: (livePreviewData: string) => void;\n}\n\nconst LivePreviewPage: React.FC<LivePropTypes> = ({ setLivePreviewData }) => {\n const inputEl = useRef<HTMLInputElement>(null);\n\n const handleRender = (): void => {\n setLivePreviewData(inputEl.current?.value || '');\n }\n\n return (\n <>\n <ContentSection sectionName=\"Markdown live preview\" level={2} >\n <p>\n Start typing and see your text rendered on the left window! We recommend starting with # Header.\n </p>\n <p>\n <TextField\n fullWidth\n multiline\n inputRef={inputEl}\n variant=\"outlined\"\n color=\"primary\"\n label=\"Markdown\"\n onChange={handleRender}\n />\n </p>\n </ContentSection>\n </>\n )\n}\n\n\nconst App: React.FC = () => {\n const classes = useStyles();\n const [page, setPage] = useState<string>('home');\n const [livePreviewData, setLivePreviewData] = useState<string>('');\n\n const handleGoLivePreview = (): void => {\n setPage('live preview');\n }\n\n const url = pageMap[page];\n const fileName = url?.slice(url.lastIndexOf('/') + 1);\n const info = [\n `## Markdown\\n [Markdown file](${url}) *(...${fileName})* that you can see on the left was parsed and rendered by **BENZIN**! :rocket:`,\n 'Switch between tabs on the header to explore other markdown templates. :recycle: ',\n 'Currently **only core features** of markdown function.',\n 'Templates on the left are being loaded from the [GitHub](https://github.com), though this pane is generated from plaintext. :pen:',\n '## How do I use this feature?',\n '```',\n 'import Markdown from \\'react-benzin\\';',\n 'const data = \\'# Header\\\\nHello, *world!*\\';',\n 'ReactDOM.render(<Markdown data={data}/>, document.getElementById(\\'root\\'));',\n '```',\n ].join('\\n');\n\n return (\n <Benzin>\n <Header\n logo={{\n icon: Icon,\n title: 'BENZIN',\n }}\n contents={headerContents}\n page={page}\n setPage={setPage}\n />\n <Window type=\"primary\">\n <div className={classes.window}>\n {\n (page === 'custom') ?\n <CustomPage />\n :\n (page === 'live preview') ?\n <Markdown data={livePreviewData || '# Start typing in the right window!'} />\n :\n <Markdown url={url} />\n }\n </div>\n </Window>\n <Window type=\"secondary\" name=\"Feature preview\">\n <div className={classes.window}>\n {\n (page === 'live preview') ?\n <LivePreviewPage setLivePreviewData={setLivePreviewData} />\n :\n <>\n <Markdown data={info} />\n <p className={classes.promoButton}>\n <Button\n variant=\"contained\"\n color=\"primary\"\n size=\"large\"\n onClick={handleGoLivePreview}\n >\n Try it yourself!\n </Button>\n </p>\n </>\n }\n </div>\n </Window>\n </Benzin>\n );\n};\n\n\nReactDOM.render(<App />, document.getElementById('root'));\n\n"],"sourceRoot":""}
\ No newline at end of file |