diff options
Diffstat (limited to 'static/js/main.7792aefb.chunk.js')
-rw-r--r-- | static/js/main.7792aefb.chunk.js | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/static/js/main.7792aefb.chunk.js b/static/js/main.7792aefb.chunk.js deleted file mode 100644 index cfcb80a..0000000 --- a/static/js/main.7792aefb.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),Z=a(36),$=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:$(":"),bold:$("\\*\\*"),italic:$("\\*"),code:$("`"),strikeThrough:$("~~")},W=new RegExp(Object.values(P).map((function(e){return e.global.source})).join("|")),G=[];Object.keys(Z.lib).forEach((function(e){return G.push({name:e,char:Z.lib[e].char})})),console.log({emojiList:G});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){var t=e.span,a=J();if(!t)return null;var n=P.conceal.local.exec(t);if(n)return"!"===t[0]?l.a.createElement("img",{src:n[2],alt:n[1],className:a.image}):l.a.createElement(_.a,{href:n[2]},n[1]);var r=t.match(P.emoji.local);if(r){var c=G.find((function(e){return e.name===r[1]}));return l.a.createElement("span",null,c?c.char:t)}var i=t.match(P.code.local);if(i)return l.a.createElement("span",{className:a.code},i[1]);var o=t.match(P.bold.local);if(o)return l.a.createElement("b",null,o[1]);var u=t.match(P.italic.local);if(u)return l.a.createElement("i",null,u[1]);var m=t.match(P.strikeThrough.local);return m?l.a.createElement("span",{style:{textDecoration:"line-through"}},m[1]):t.match(P.rawLink.global)?l.a.createElement(_.a,{href:t},t):l.a.createElement(l.a.Fragment,null,t)},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(/^```.*$/)},K=function(e){return null!==e.match(/^ ?- .*$/)},Q=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=a.findIndex((function(e){return function(e,t){var a=new RegExp("</".concat(t,"[^<]*>"));return null!==e.match(a)}(e,s)})),p=a.splice(0,d+1).slice(0,d);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];console.log({line:c,match:f,before:h,after:E}),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 r=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}))},U=function(e){if(!e)return 0;for(var t=0;"#"===e[t];)t++;return t},V=function(e){var t=e.rawLines,a=e.level,n=void 0===a?0:a,r=t.reduce((function(e,t){return t&&(U(t)===n&&e.push([]),e.length&&e[e.length-1].push(t)),e}),[]).map((function(e){return l.a.createElement(ee,{rawLines:e,level:n})}));return l.a.createElement(l.a.Fragment,null," ",r," ")},ee=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(V,{rawLines:t,level:U(t[0])});var i=c.splice(0,1)[0].slice(n).trim(),o=U(t[0]);return l.a.createElement(N,{sectionName:i,level:n},l.a.createElement(Q,{rawLines:c}),l.a.createElement(V,{rawLines:t,level:o}))},te=ee,ae=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];return Object(r.useEffect)((function(){a||u(t||"")}),[t,a]),a&&H.a.get(a).then((function(e){return u(e.data)})),l.a.createElement(te,{rawLines:o.split("\n")})},ne=a(58),re=a.n(ne),le=Object(o.a)((function(e){return{window:{padding:e.spacing(4)},promoButton:{display:"flex",justifyContent:"center",marginTop:e.spacing(4)}}})),ce=l.a.createElement("img",{src:re.a,width:"32px",height:"37px",alt:"logo"}),ie={home:null,spacevim:null,"material-ui":null,custom:null,"live preview":null},oe={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"},ue=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(ae,{url:a}))},me=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=le(),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=oe[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:ce,title:"BENZIN"},contents:ie,page:c,setPage:i}),l.a.createElement(E,{type:"primary"},l.a.createElement("div",{className:e.window},"custom"===c?l.a.createElement(ue,null):"live preview"===c?l.a.createElement(ae,{data:s||"# Start typing in the right window!"}):l.a.createElement(ae,{url:p}))),l.a.createElement(E,{type:"secondary",name:"Feature preview"},l.a.createElement("div",{className:e.window},"live preview"===c?l.a.createElement(me,{setLivePreviewData:d}):l.a.createElement(l.a.Fragment,null,l.a.createElement(ae,{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.7792aefb.chunk.js.map
\ No newline at end of file |