aboutsummaryrefslogtreecommitdiff
path: root/static/js/main.508ed0a4.chunk.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/main.508ed0a4.chunk.js')
-rw-r--r--static/js/main.508ed0a4.chunk.js2
1 files changed, 0 insertions, 2 deletions
diff --git a/static/js/main.508ed0a4.chunk.js b/static/js/main.508ed0a4.chunk.js
deleted file mode 100644
index bde2574..0000000
--- a/static/js/main.508ed0a4.chunk.js
+++ /dev/null
@@ -1,2 +0,0 @@
-(this["webpackJsonpreact-benzin"]=this["webpackJsonpreact-benzin"]||[]).push([[0],{57:function(e,t,a){e.exports=a.p+"static/media/icon.8908a388.svg"},68:function(e,t,a){e.exports=a(96)},96:function(e,t,a){"use strict";a.r(t);var n=a(21),r=a(0),l=a.n(r),c=a(9),i=a.n(c),o=a(51),u=a(135),m=a(134),s=a(130),d=a(97),p=a(127),f=Object(o.a)((function(e){return{content:{padding:e.spacing(2,2,1,3),marginBottom:e.spacing(1)}}})),v=function(e){var t=e.sectionName,a=e.children,n=e.level,r=void 0===n?0:n,c=f(),i=r+2;i>6&&(i=6);var o="h".concat(i);return l.a.createElement(l.a.Fragment,null,l.a.createElement(d.a,{variant:o},t),l.a.createElement(p.a,{variant:"middle"}),l.a.createElement(d.a,{component:"div",className:c.content},a))},h=a(54),g=a.n(h),E=a(55),w=a.n(E),b=a(60),y=a(128),k=a(129),j=(a(76),Object(b.a)({palette:{type:"dark",primary:{main:g.a[400]},secondary:{main:w.a[500]},background:{default:"#121212",paper:"#1e1e1e",elevation1:"#1e1e1e",elevation2:"#232323",elevation3:"#252525"},text:{primary:"#f4f4f4",secondary:"rgba(255, 255, 255, 0.6)"}}})),x=function(e){var t=e.children;return l.a.createElement(y.a,{theme:j},l.a.createElement(k.a,null),t)},O=a(56),M=a.n(O),N=a(98),L=Object(o.a)((function(e){return{root:{background:e.palette.background.default,padding:e.spacing(1),overflowX:"auto",fontFamily:"Monospace",scrollbarColor:"auto"}}})),R=function(e){var t=e.rawLines,a=L();return l.a.createElement(N.a,{variant:"outlined",className:a.root},t.map((function(e){return l.a.createElement("pre",null,e)})))},I=a(36),F=function(e){return{local:new RegExp("".concat(e,"([^").concat(e,"]+)").concat(e)),global:new RegExp("(".concat(e,"[^").concat(e,"]+").concat(e,")"))}},z={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:F(":"),bold:F("\\*\\*"),italic:F("\\*"),code:F("`"),strikeThrough:F("~~")},D=new RegExp(Object.values(z).map((function(e){return e.global.source})).join("|")),S=[];Object.keys(I.lib).forEach((function(e){return S.push({name:e,char:I.lib[e].char})}));var T=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%"}}})),H=function e(t){var a=t.span,n=T();if(!a)return null;var r=z.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(s.a,{href:r[2]},l.a.createElement(e,{span:r[1]}));var c=a.match(z.emoji.local);if(c){var i=S.find((function(e){return e.name===c[1]}));return l.a.createElement("span",null,i?i.char:a)}var o=a.match(z.code.local);if(o)return l.a.createElement("span",{className:n.code},o[1]);var u=a.match(z.bold.local);if(u)return l.a.createElement("b",null,u[1]);var m=a.match(z.italic.local);if(m)return l.a.createElement("i",null,m[1]);var d=a.match(z.strikeThrough.local);return d?l.a.createElement("span",{style:{textDecoration:"line-through"}},d[1]):a.match(z.rawLink.global)?l.a.createElement(s.a,{href:a},a):l.a.createElement(l.a.Fragment,null,a)},B=function(e){var t=e.line;return l.a.createElement(l.a.Fragment,null,t.split(D).map((function(e){return l.a.createElement(H,{span:e})})))},C=function(e){return null!==e.match(/^\s*```.*$/)},A=function(e){return null!==e.match(/^ ?[-*] .*$/)},$=function(e,t){var a=new RegExp("</".concat(t,"[^<]*>"));return null!==e.match(a)},_=function(e){return null!==e.match(/\\\|$/)},Z=function e(t){var a=t.rawLines;if(!a.length)return null;var r,c=a.splice(0,1)[0];if(C(c)){var i=a.findIndex((function(e){return C(e)})),o=a.splice(0,i+1).slice(0,i);r=l.a.createElement(R,{rawLines:o})}else if(A(c)){var u=a.findIndex((function(e){return!A(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(B,{line:e.slice(2)}))})))}else if(r=function(e){var t=/<([^/\s]*)[^<]*[^/]>/g.exec(e);return t?t[1]:""}(c)){var s=r,d=$(c,s)?-1:a.findIndex((function(e){return $(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),h=Object(n.a)(v,2),g=h[0],E=h[1];r=l.a.createElement(l.a.Fragment,null,l.a.createElement(B,{line:g}),l.a.createElement("div",{dangerouslySetInnerHTML:{__html:f}}),l.a.createElement(B,{line:E}))}else if(_(c)){var w=a.findIndex((function(e){return!_(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(B,{line:e})})))}else r=$(c,"")?null:l.a.createElement("p",null,l.a.createElement(B,{line:c}));return l.a.createElement(l.a.Fragment,null,r,l.a.createElement(e,{rawLines:a}))},P=function(e){if(!e)return 0;for(var t=0;"#"===e[t];)t+=1;return t},W=function(e){var t=e.rawLines,a=e.level,n=void 0===a?0:a,r=t.reduce((function(e,t){return t&&(P(t)===n&&e.push([]),e.length&&e[e.length-1].push(t)),e}),[]).map((function(e){return l.a.createElement(G,{rawLines:e,level:n})}));return l.a.createElement(l.a.Fragment,null,r)},G=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(d.a,null,l.a.createElement(Z,{rawLines:c})),l.a.createElement(W,{rawLines:t,level:P(t[0])}));var i=c.splice(0,1)[0].slice(n).trim(),o=P(t[0]);return l.a.createElement(v,{sectionName:i,level:n},l.a.createElement(Z,{rawLines:c}),l.a.createElement(W,{rawLines:t,level:o}))},J=G,Y=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&&M.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(J,{rawLines:s})},X=a(131),q=a(132),K=a(136),Q=a(133),U=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"}}}}})),V=function(e){var t=e.logo,a=e.contents,n=e.page,r=e.setPage,c=U();return l.a.createElement(X.a,{position:"sticky",className:c.root},l.a.createElement(q.a,null,t.icon,l.a.createElement(d.a,{variant:"h5",className:c.logo,color:"primary"},t.title),l.a.createElement(K.a,{onChange:function(e,t){r(t)},value:n},a&&Object.keys(a).map((function(e){return l.a.createElement(Q.a,{label:e,icon:a[e],value:e,className:c.tab,key:e})})))))},ee=a(61),te=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}}}})),ae=function(e){var t=e.size,a=e.position,n=e.children,r=te();return l.a.createElement(N.a,{variant:"outlined",style:Object(ee.a)({},t,{},a),className:r.surface},n)},ne=Object(o.a)((function(e){return{header:{padding:e.spacing(1,0,1,2),background:e.palette.background.elevation2}}})),re=function(e){var t=e.type,a=e.name,n=e.children,r=ne(),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(ae,{size:c,position:i},a&&l.a.createElement("div",null,l.a.createElement(d.a,{variant:"h5",className:r.header},a),l.a.createElement(p.a,null)),n)},le=a(57),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(v,{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(Y,{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(v,{sectionName:"Markdown live preview",level:2},l.a.createElement("p",null,"Start typing and see your text rendered on the left window! You can find the list of all Markdown features"," ",l.a.createElement(s.a,{href:"https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet"},"here"),". (some of them are yet in progress). 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: ","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"),h=l.a.createElement(Y,{url:p});return"custom"===c?h=l.a.createElement(se,null):"live preview"===c&&(h=l.a.createElement(Y,{data:s||"# Start typing in the right window!"})),l.a.createElement(x,null,l.a.createElement(V,{logo:{icon:oe,title:"BENZIN"},contents:ue,page:c,setPage:i}),l.a.createElement(re,{type:"primary"},l.a.createElement("div",{className:e.window},h)),l.a.createElement(re,{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(Y,{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"))}},[[68,1,2]]]);
-//# sourceMappingURL=main.508ed0a4.chunk.js.map \ No newline at end of file