aboutsummaryrefslogtreecommitdiff
path: root/static/js/main.1bea423d.chunk.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/main.1bea423d.chunk.js')
-rw-r--r--static/js/main.1bea423d.chunk.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/static/js/main.1bea423d.chunk.js b/static/js/main.1bea423d.chunk.js
new file mode 100644
index 0000000..612da37
--- /dev/null
+++ b/static/js/main.1bea423d.chunk.js
@@ -0,0 +1,2 @@
+(this["webpackJsonpreact-benzin"]=this["webpackJsonpreact-benzin"]||[]).push([[0],{100:function(e,t,n){"use strict";n.r(t);var r=n(22),a=n(2),c=n(0),i=n(10),o=n.n(i),l=n(132),s=n(144),u=n(143),d=n(139),j=n(29),b=n(135),h=n(102),p=n(136),m=Object(l.a)((function(e){var t;return{content:(t={},Object(j.a)(t,e.breakpoints.up("md"),{padding:e.spacing(2,2,1,3)}),Object(j.a)(t,e.breakpoints.down("sm"),{padding:e.spacing(2,0)}),Object(j.a)(t,"marginBottom",e.spacing(1)),t)}})),f=function(e){var t=e.sectionName,n=e.children,r=e.level,c=void 0===r?0:r,i=m(),o=Object(b.a)((function(e){return e.breakpoints.down("sm")})),l=c+2;l>6&&(l=6);var s="h".concat(l);return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(h.a,{variant:s,children:t}),Object(a.jsx)(p.a,{variant:o?"fullWidth":"middle"}),Object(a.jsx)(h.a,{component:"div",className:i.content,children:n})]})},v=n(62),O=n.n(v),g=n(63),x=n.n(g),w=n(65),y=n(137),k=n(138),M=(n(80),Object(w.a)({palette:{type:"dark",primary:{main:O.a[400]},secondary:{main:x.a[500]},background:{default:"#121212",paper:"#1e1e1e",elevation1:"#1e1e1e",elevation2:"#232323",elevation3:"#252525"},text:{primary:"#f4f4f4",secondary:"rgba(255, 255, 255, 0.6)"}}})),N=function(e){var t=e.children;return Object(a.jsxs)(y.a,{theme:M,children:[Object(a.jsx)(k.a,{}),t]})},L=n(64),E=n.n(L),R=n(103),I=Object(l.a)((function(e){return{root:{background:e.palette.background.default,padding:e.spacing(1),overflowX:"auto",fontFamily:"Monospace",scrollbarColor:"auto"}}})),F=function(e){var t=e.rawLines,n=I();return Object(a.jsx)(R.a,{variant:"outlined",className:n.root,children:t.map((function(e){return Object(a.jsx)("pre",{children:e})}))})},S=n(42),z=function(e){return{local:new RegExp("".concat(e,"([^").concat(e,"]+)").concat(e)),global:new RegExp("(".concat(e,"[^").concat(e,"]+").concat(e,")"))}},C={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("~~")},D=new RegExp(Object.values(C).map((function(e){return e.global.source})).join("|")),T=[];Object.keys(S.lib).forEach((function(e){return T.push({name:e,char:S.lib[e].char})}));var H=Object(l.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%"}}})),B=function e(t){var n=t.span,r=H();if(!n)return null;var c=C.conceal.local.exec(n);if(c)return"!"===n[0]?Object(a.jsx)("img",{src:c[2],alt:c[1],className:r.image}):Object(a.jsx)(d.a,{href:c[2],children:Object(a.jsx)(e,{span:c[1]})});var i=n.match(C.emoji.local);if(i){var o=T.find((function(e){return e.name===i[1]}));return Object(a.jsx)("span",{children:o?o.char:n})}var l=n.match(C.code.local);if(l)return Object(a.jsx)("span",{className:r.code,children:l[1]});var s=n.match(C.bold.local);if(s)return Object(a.jsx)("b",{children:s[1]});var u=n.match(C.italic.local);if(u)return Object(a.jsx)("i",{children:u[1]});var j=n.match(C.strikeThrough.local);return j?Object(a.jsx)("span",{style:{textDecoration:"line-through"},children:j[1]}):n.match(C.rawLink.global)?Object(a.jsx)(d.a,{href:n,children:n}):Object(a.jsx)(a.Fragment,{children:n})},A=function(e){var t=e.line;return Object(a.jsx)(a.Fragment,{children:t.split(D).map((function(e){return Object(a.jsx)(B,{span:e})}))})},$=function(e){return null!==e.match(/^\s*```.*$/)},_=function(e){return null!==e.match(/^ ?[-*] .*$/)},W=function(e,t){var n=new RegExp("</".concat(t,"[^<]*>"));return null!==e.match(n)},Z=function(e){return null!==e.match(/\\\|$/)},P=function e(t){var n=t.rawLines;if(!n.length)return null;var c,i=n.splice(0,1)[0];if($(i)){var o=n.findIndex((function(e){return $(e)})),l=n.splice(0,o+1).slice(0,o);c=Object(a.jsx)(F,{rawLines:l})}else if(_(i)){var s=n.findIndex((function(e){return!_(e)})),u=n.splice(0,s).slice(0,s);u.unshift(i),c=Object(a.jsx)("ul",{children:u.map((function(e){return Object(a.jsx)("li",{children:Object(a.jsx)(A,{line:e.slice(2)})})}))})}else if(c=function(e){var t=/<([^/\s]*)[^<]*[^/]>/g.exec(e);return t?t[1]:""}(i)){var d=c,j=W(i,d)?-1:n.findIndex((function(e){return W(e,d)})),b=n.splice(0,j+1);b.unshift(i),c=Object(a.jsx)("div",{dangerouslySetInnerHTML:{__html:b.join("\n")}})}else if(null!==(c=function(e){return e.match(/(<[^/\s]*[^<]*\/>)/g)}(i))){var h=c[0],p=i.split(h),m=Object(r.a)(p,2),f=m[0],v=m[1];c=Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(A,{line:f}),Object(a.jsx)("div",{dangerouslySetInnerHTML:{__html:h}}),Object(a.jsx)(A,{line:v})]})}else if(Z(i)){var O=n.findIndex((function(e){return!Z(e)})),g=n.splice(0,O).map((function(e){return e.slice(0,-2)}));g.unshift(i.slice(0,-2)),g.push(n.splice(0,1)[0]),c=Object(a.jsx)("p",{children:g.map((function(e){return Object(a.jsx)(A,{line:e})}))})}else c=W(i,"")?null:Object(a.jsx)("p",{children:Object(a.jsx)(A,{line:i})});return Object(a.jsxs)(a.Fragment,{children:[c,Object(a.jsx)(e,{rawLines:n})]})},G=function(e){if(!e)return 0;for(var t=0;"#"===e[t];)t+=1;return t},J=function(e){var t=e.rawLines,n=e.level,r=void 0===n?0:n,c=e.SectionComponent,i=t.reduce((function(e,t){return t&&(G(t)===r&&e.push([]),e.length&&e[e.length-1].push(t)),e}),[]).map((function(e){return Object(a.jsx)(c,{rawLines:e,level:r})}));return Object(a.jsx)(a.Fragment,{children:i})},Y=function e(t){var n=t.rawLines,r=t.level,c=void 0===r?0:r,i=n.findIndex((function(e){return e.match("^#{".concat(c+1,",} .*$"))})),o=n.splice(0,i<0?n.length:i);if(!c)return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(h.a,{children:Object(a.jsx)(P,{rawLines:o})}),Object(a.jsx)(J,{rawLines:n,level:G(n[0]),SectionComponent:e})]});var l=o.splice(0,1)[0].slice(c).trim(),s=G(n[0]);return Object(a.jsxs)(f,{sectionName:l,level:c,children:[Object(a.jsx)(P,{rawLines:o}),Object(a.jsx)(J,{rawLines:n,level:s,SectionComponent:e})]})},X=function(e){var t=e.data,n=e.url,i=Object(c.useState)(t||""),o=Object(r.a)(i,2),l=o[0],s=o[1];n&&E.a.get(n).then((function(e){return s(e.data)})),Object(c.useEffect)((function(){n||s(t||"")}),[t,n]);var u=(null===n||void 0===n?void 0:n.slice(0,n.lastIndexOf("/")))||"",d=l.split(/\r?\n/).map((function(e){return function(e,t){return e.replace(/src="(?!http)(.*)"[\s>]/,(function(e,n){return'src="'.concat(t,"/").concat(n,'?sanitize=true"')})).replace(/\[(.*\]?.*)\]\((?!http)(.+?)\)/,(function(e,n,r){return"[".concat(n,"](").concat(t,"/").concat(r,")")}))}(e,u)}));return Object(a.jsx)(Y,{rawLines:d})},q=n(140),K=n(141),Q=n(145),U=n(142),V=Object(l.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"}}}}})),ee=function(e){var t=e.logo,n=e.contents,r=e.page,c=e.setPage,i=V();return Object(a.jsx)(q.a,{position:"sticky",className:i.root,children:Object(a.jsxs)(K.a,{children:[t.icon,Object(a.jsx)(h.a,{variant:"h5",className:i.logo,color:"primary",children:t.title}),Object(a.jsx)(Q.a,{onChange:function(e,t){c(t)},value:r,children:n&&Object.keys(n).map((function(e){return Object(a.jsx)(U.a,{label:e,icon:n[e],value:e,className:i.tab},e)}))})]})})},te=n(43),ne=Object(l.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}}}})),re=function(e){var t=e.size,n=e.position,r=e.children,c=ne();return Object(a.jsx)(R.a,{variant:"outlined",style:Object(te.a)(Object(te.a)({},t),n),className:c.surface,children:r})},ae=Object(l.a)((function(e){return{header:{padding:e.spacing(1,0,1,2),background:e.palette.background.elevation2}}})),ce=function(e){var t=e.type,n=e.name,r=e.children,c=ae(),i={height:"85vh"},o={bottom:"3vh"};return"primary"===t?(i.width="63vw",o.left="2vw"):"secondary"===t?(i.width="31vw",o.right="2vw"):"mono"===t&&(o.left="2vw",o.right="2vw"),Object(a.jsxs)(re,{size:i,position:o,children:[n&&Object(a.jsxs)("div",{children:[Object(a.jsx)(h.a,{variant:"h5",className:c.header,children:n}),Object(a.jsx)(p.a,{})]}),r]})},ie=n.p+"static/media/icon.50d2b01a.svg",oe=Object(l.a)((function(e){return{window:{padding:e.spacing(4)},promoButton:{display:"flex",justifyContent:"center",marginTop:e.spacing(4)}}})),le=Object(a.jsx)("img",{src:ie,width:"32px",height:"37px",alt:"logo"}),se={home:null,dotfiles:null,"material-ui":null,custom:null,"live preview":null},ue={home:"https://raw.githubusercontent.com/eug-vs/react-benzin/develop/README.md","material-ui":"https://raw.githubusercontent.com/mui-org/material-ui/master/README.md",dotfiles:"https://raw.githubusercontent.com/eug-vs/dotfiles/master/.github/README.md"},de=function(){var e=Object(c.useState)(""),t=Object(r.a)(e,2),n=t[0],i=t[1],o=Object(c.useRef)(null);return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsxs)(f,{sectionName:"Render custom markdown document",level:2,children:[Object(a.jsx)("p",{children:"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."}),Object(a.jsx)("p",{children:Object(a.jsx)(s.a,{fullWidth:!0,inputRef:o,variant:"outlined",color:"secondary",label:"Markdown url"})}),Object(a.jsx)(u.a,{variant:"contained",color:"secondary",onClick:function(){var e;i((null===(e=o.current)||void 0===e?void 0:e.value)||"")},children:"Render!"})]}),Object(a.jsx)(X,{url:n})]})},je=function(e){var t=e.setLivePreviewData,n=Object(c.useRef)(null);return Object(a.jsx)(a.Fragment,{children:Object(a.jsxs)(f,{sectionName:"Markdown live preview",level:2,children:[Object(a.jsxs)("p",{children:["Start typing and see your text rendered on the left window! You can find the list of all Markdown features"," ",Object(a.jsx)(d.a,{href:"https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet",children:"here"}),". (some of them are yet in progress). We recommend starting with # Header."]}),Object(a.jsx)("p",{children:Object(a.jsx)(s.a,{fullWidth:!0,multiline:!0,inputRef:n,variant:"outlined",color:"primary",label:"Markdown",onChange:function(){var e;t((null===(e=n.current)||void 0===e?void 0:e.value)||"")}})})]})})},be=function(){var e=oe(),t=Object(c.useState)("home"),n=Object(r.a)(t,2),i=n[0],o=n[1],l=Object(c.useState)(""),s=Object(r.a)(l,2),d=s[0],j=s[1],b=ue[i],h=null===b||void 0===b?void 0:b.slice(b.lastIndexOf("/")+1),p=["## Markdown\n [Markdown file](".concat(b,") *(...").concat(h,")* 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: ","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"),m=Object(a.jsx)(X,{url:b});return"custom"===i?m=Object(a.jsx)(de,{}):"live preview"===i&&(m=Object(a.jsx)(X,{data:d||"# Start typing in the right window!"})),Object(a.jsxs)(N,{children:[Object(a.jsx)(ee,{logo:{icon:le,title:"BENZIN"},contents:se,page:i,setPage:o}),Object(a.jsx)(ce,{type:"primary",children:Object(a.jsx)("div",{className:e.window,children:m})}),Object(a.jsx)(ce,{type:"secondary",name:"Feature preview",children:Object(a.jsx)("div",{className:e.window,children:"live preview"===i?Object(a.jsx)(je,{setLivePreviewData:j}):Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(X,{data:p}),Object(a.jsx)("p",{className:e.promoButton,children:Object(a.jsx)(u.a,{variant:"contained",color:"primary",size:"large",onClick:function(){o("live preview")},children:"Try it yourself!"})})]})})})]})};o.a.render(Object(a.jsx)(be,{}),document.getElementById("root"))}},[[100,1,2]]]);
+//# sourceMappingURL=main.1bea423d.chunk.js.map \ No newline at end of file