diff --git a/README.md b/README.md index 9d9614c..880ebc0 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,22 @@ -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +## Status Web Chat + +[Click here to access status-web](https://status-im.github.io/chat/build/). note that no plugins are required, just a compatible browser. Currently recommended is Chrome. + +**Note: This is a proof of concept, and an alpha version. There will be bugs. If you you're looking for something more stable try the [status desktop app](https://status.im/get_desktop/).** + +known issues: +- Desktop *Chrome* only for now. There is an UI issue in firefox which causes the page to reload. +- Reportedly works on android mobile browsers but not on ios (to be confirmed). In theory it should work on any webrtc enabled browser. +- Direct chats and chat history is currently disabled. + +what you can do: +- Join other status channels, this bridges with devp2p network. +- see who is online in the channel (applicable to other status-web users) +- see who is typing in the channel (applicable to other status-web users) +- see previews for images, spotify (e.g `spotify:track:0vnfZAVW1Suiet6wtUMdg9`) +- code formatting(e.g ``js` var a = 3;``) +- upload files +- emojis support ## Available Scripts diff --git a/build/asset-manifest.json b/build/asset-manifest.json index 8076cd1..16dbe9c 100644 --- a/build/asset-manifest.json +++ b/build/asset-manifest.json @@ -1,7 +1,7 @@ { "main.css": "./static/css/main.9a6004a0.chunk.css", - "main.js": "./static/js/main.00af481e.chunk.js", - "main.js.map": "./static/js/main.00af481e.chunk.js.map", + "main.js": "./static/js/main.e0745bc2.chunk.js", + "main.js.map": "./static/js/main.e0745bc2.chunk.js.map", "static/css/1.b4a31a49.chunk.css": "./static/css/1.b4a31a49.chunk.css", "static/js/1.85aad662.chunk.js": "./static/js/1.85aad662.chunk.js", "static/js/1.85aad662.chunk.js.map": "./static/js/1.85aad662.chunk.js.map", @@ -11,6 +11,6 @@ "static/media/logo.svg": "./static/media/logo.5d5d9eef.svg", "static/css/main.9a6004a0.chunk.css.map": "./static/css/main.9a6004a0.chunk.css.map", "index.html": "./index.html", - "precache-manifest.8ef72375e14c217baaf2fd1018cd4a4c.js": "./precache-manifest.8ef72375e14c217baaf2fd1018cd4a4c.js", + "precache-manifest.8b0bdca8d1e6282298a11eee0441a525.js": "./precache-manifest.8b0bdca8d1e6282298a11eee0441a525.js", "service-worker.js": "./service-worker.js" } \ No newline at end of file diff --git a/build/index.html b/build/index.html index 5d46e23..be0d7fb 100644 --- a/build/index.html +++ b/build/index.html @@ -1 +1 @@ -Status Web
\ No newline at end of file +Status Web
\ No newline at end of file diff --git a/build/precache-manifest.8ef72375e14c217baaf2fd1018cd4a4c.js b/build/precache-manifest.8b0bdca8d1e6282298a11eee0441a525.js similarity index 74% rename from build/precache-manifest.8ef72375e14c217baaf2fd1018cd4a4c.js rename to build/precache-manifest.8b0bdca8d1e6282298a11eee0441a525.js index 86f616d..8c42262 100644 --- a/build/precache-manifest.8ef72375e14c217baaf2fd1018cd4a4c.js +++ b/build/precache-manifest.8b0bdca8d1e6282298a11eee0441a525.js @@ -8,15 +8,15 @@ self.__precacheManifest = [ "url": "./static/js/runtime~main.4a686d48.js" }, { - "revision": "00af481e8346574f23c8", - "url": "./static/js/main.00af481e.chunk.js" + "revision": "e0745bc2020e46921c59", + "url": "./static/js/main.e0745bc2.chunk.js" }, { "revision": "85aad662b0e90e4880fc", "url": "./static/js/1.85aad662.chunk.js" }, { - "revision": "00af481e8346574f23c8", + "revision": "e0745bc2020e46921c59", "url": "./static/css/main.9a6004a0.chunk.css" }, { @@ -24,7 +24,7 @@ self.__precacheManifest = [ "url": "./static/css/1.b4a31a49.chunk.css" }, { - "revision": "9c3549d3158eec2a8f010bb0fc98e4de", + "revision": "ba6780ce56e841843c1047edde5cff1d", "url": "./index.html" } ]; \ No newline at end of file diff --git a/build/service-worker.js b/build/service-worker.js index d709324..9891b7c 100644 --- a/build/service-worker.js +++ b/build/service-worker.js @@ -14,7 +14,7 @@ importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js"); importScripts( - "./precache-manifest.8ef72375e14c217baaf2fd1018cd4a4c.js" + "./precache-manifest.8b0bdca8d1e6282298a11eee0441a525.js" ); workbox.clientsClaim(); diff --git a/build/static/js/main.00af481e.chunk.js.map b/build/static/js/main.00af481e.chunk.js.map deleted file mode 100644 index fa89814..0000000 --- a/build/static/js/main.00af481e.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["logo.svg","utils/syntaxLookup.js","utils/ipfs.js","components/ChatBox.js","context.js","components/ChatHeader.js","components/Userlist.jsx","components/ChatRoom.js","components/ChannelBox.js","utils/parsers.js","components/ChannelList.js","components/ContextFilter.js","components/ContextPanel.js","images/status-logo.js","images/js-logo.js","images/statusjs-logo.js","components/Login.js","utils/actors.js","utils/keyManagement.js","utils/store.js","components/Loaders.js","utils/windows.js","components/Home.js","App.js","serviceWorker.js","index.js"],"names":["module","exports","__webpack_require__","p","syntaxLookup","bs","bf","c","cp","cl","cs","dk","ht","js","jn","jx","la","ma","md","nm","pb","pu","py","sq","ts","vi","ym","fileUpload","node","filePath","file","fileReaderPullStream","Promise","resolve","reject","files","add","err","uploadFileAndSend","_ref","Object","asyncToGenerator","regenerator_default","a","mark","_callee","sendFn","hash","text","wrap","_context","prev","next","name","path","type","sent","concat","stop","this","_x","_x2","_x3","apply","arguments","getFile","CID","get","ipfsMatcher","Matcher","begin","find","MessageRender","match","message","emojis","regex1","RegExp","exec","push","react_default","createElement","dist_es","emoji","size","parts","split","forEach","part","i","className","key","SyntaxLookup","slice","prism","language","style","atomDark","Linkify_default","wordWrap","whiteSpace","ChatBox","state","imgUrl","getImageFromIpfs","_this$props","ipfs","content","arrayBufferView","blob","_this","props","Uint8Array","Blob","URL","createObjectURL","setState","test","url","_this$props2","username","pubkey","react","ListItem_default","Avatar_default","ListItemAvatar_default","lib_default","diameter","seed","jsNumberForAddress","ListItemText_default","primary","secondary","ChatBox_MessageRender","indexOf","YouTube","videoId","undefined","replace","opts","height","width","playerVars","autoplay","isSpotifyLink","SpotifyPlayer_default","uri","view","theme","src","alt","maxWidth","isImage","imageUrl","displayImage","PureComponent","ChatContext","React","createContext","ChatHeader","displayChannelStats","handleClose","handleOpen","heartBeat","clearInterval","heartBeatId","_this2","setInterval","forceUpdate","_this3","currentChannel","toggleSidebar","Consumer","channels","channelUsers","users","usersList","keys","currentTime","Date","getTime","Dialog_default","onClose","aria-labelledby","open","DialogTitle_default","List_default","map","user","button","lastSeen","userOffline","OfflineBolt_default","color","CheckCircle_default","CardContent_default","flexBasis","paddingBottom","Typography_default","variant","component","display","alignItems","PersonOutline_default","grey","onClick","length","marginLeft","Info_default","online","green","offline","blueGrey","scrolling","overflow","Userlist","allUsers","sort","x","y","xIsOnline","yIsOnline","sortUsers","paddingLeft","FiberManualRecordOutlined_default","margin","FiberManualRecord_default","Tooltip_default","title","placement","WhoIsTyping","usersTyping","typingInChannel","typingUsers","lastTyped","userList","whoIsTyping","textAlign","join","AutoScrollList","autoscroll","List","formStyle","justifyContent","ChatRoomForm","createRef","NameInput","ChatRoom","classCallCheck","possibleConstructorReturn","getPrototypeOf","call","toggleInfoPanel","infoPanelActive","showEmojis","e","fileInput","click","event","sendMessage","target","chatInput","setValue","console","log","id","current","labelNode","focus","_this$props3","messages","typingEvent","_this$state","messagesHeight","flexWrap","boxSizing","ref","input","onChange","fileChangedHandler","bind","Grid_default","xs","item","es","onDrop","r","acceptedFiles","rejectedFiles","disableClick","position","activeStyle","backgroundColor","outline","alignSelf","outlineOffset","container","direction","justify","components_ChatHeader","Divider_default","overflowY","data","payload","components_ChatBox","assign","formik_esm","initialValues","onSubmit","values","setSubmitting","resetForm","_ref2","errors","touched","handleChange","handleBlur","handleSubmit","setFieldValue","Button_default","uploadFileDialog","AddCircle_default","TextField_default","multiline","flexGrow","label","fullWidth","onKeyDown","value","shiftKey","keyCode","preventDefault","cursor","selectionStart","dispatchEvent","Event","keyDownHandler","onBlur","onSelect","addEmoji","bottom","right","toggleEmojis","ChatRoom_WhoIsTyping","borderLeft","minHeight","components_Userlist","Component","ChannelBox","channelName","setActiveChannel","selected","padding","CONTACT_CODE_REGEXP","isContactCode","str","ChannelBoxes","marginBottom","channel","components_ChannelBox","ChannelList","channelList","onlyChannels","filter","directMessages","ChannelList_ChannelBoxes","ContextFilter","handleClickOpen","joinConversation","verticalAlign","DialogContent_default","DialogContentText_default","autoFocus","DialogActions_default","ContextPanel","styles","sidebar","borderRight","components_ContextFilter","components_ChannelList","StatusLogo","xmlns","d","fill","fillRule","JSLogo","viewBox","StatusJSLogo","status_logo","js_logo","containerStyle","flexDirection","Login","setupKeyringController","keyStore","wipeKeyStore","connect","password","setFieldError","catch","_ref3","statusjs_logo","isNull","rows","error","helperText","User","store","Store","localStorage","getItem","val","setItem","configName","defaults","vault","createVault","mnemonic","keyRingController","KeyringController","createNewVaultAndRestore","getState","storeKeyData","JSON","stringify","abrupt","restoreVault","_callee2","_context2","parse","getKeyData","initState","submitPassword","set","wipeVault","FullScreenLoader","react_spinners","sizeUnit","openBrowserWindow","window","addWindowEventListeners","statusVerbose","addEventListener","msg","source","parent","typingNotificationsTimestamp","DEFAULT_CHANNEL","status","StatusJS","Home","defineProperty","identity","loading","account","connectToProvider","server","provider","onConnect","keyringController","exportAccount","then","joinChannel","pingChannel","createOnUserMessageHandler","setTimeout","getMyIdentities","openBrowser","pingInterval","sendJsonMessage","accounts","t0","getAccounts","contact","_assertThisInitialize","assertThisInitialized","addDirectMessage","contactCode","addContact","addConversationEntry","code","changeChannel","objectSpread","joinChat","onMessage","handleProtocolMessages","sig","prevState","existing","toConsumableArray","onUserMessage","res","sender","addUserToChannel","getChannel","_callee3","publicKey","_context3","getPublicKey","getUserName","fromUser","addOrUpdateUserKey","now","lastEvent","connectMurMur","IPFS","shutdown","Murmur","protocols","signalServers","bootnodes","start","_this$state2","chatContext","Provider","Loaders_FullScreenLoader","isNil","src_components_ContextPanel","components_ChatRoom","components_Login","App","Home_Home","Boolean","location","hostname","ReactDOM","render","src_App","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"ugBAAAA,EAAAC,QAAiBC,EAAAC,EAAuB,inBCCzBC,GAAA,CACbC,GAAM,OACNC,GAAM,YACNC,EAAK,IAC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,EAAArC,EAAAsC,cAAC2E,GAAYsW,SAAb,CAAsB1L,MAAOyL,GAC1B5D,EACErX,EAAArC,EAAAsC,cAACkb,GAAD,MACAnb,EAAArC,EAAAsC,cAACyC,EAAA,SAAD,KACE0U,EAAS4C,UAMRha,EAAArC,EAAAsC,cAAA,OAAKe,MAAO,CAAE6C,MAAO,OAAQqI,SAAU,SAAUzE,QAAS,OAAQ0E,UAAW,eAC7EnM,EAAArC,EAAAsC,cAACwM,EAAA9O,EAAD,CAAMgP,MAAI,EAACD,GAAI,IACX0O,gBAAMvV,IACN7F,EAAArC,EAAAsC,cAACob,GAAD,CACExV,SAAUA,EACVmM,iBAAkBrT,KAAKqT,oBAE7BhS,EAAArC,EAAAsC,cAACwM,EAAA9O,EAAD,CAAMgP,MAAI,EAACD,GAAI,IACX1M,EAAArC,EAAAsC,cAACqb,GAAD,CACExP,SAAUA,EACVX,YAAaxM,KAAKwM,YAClBzF,eAAgBA,EAChB6D,YAAaA,EACbwC,YAAapN,KAAKoN,YAClBjG,aAAcA,EACd0C,SAAUzC,EACVrE,KAAMA,MArBZ1B,EAAArC,EAAAsC,cAACsb,GAAD,CACE3H,QAASA,EACTH,uBAAwBA,EACxBC,SAAUA,EACVC,aAAcA,aA1QIhP,iBCjBnB6W,6LAJX,OAAOxb,EAAArC,EAAAsC,cAACwb,GAAD,aAFO9K,cCQE+K,QACW,cAA7BnF,OAAOoF,SAASC,UAEe,UAA7BrF,OAAOoF,SAASC,UAEhBrF,OAAOoF,SAASC,SAASnc,MACvB,2DCbNoc,IAASC,OAAO9b,EAAArC,EAAAsC,cAAC8b,GAAD,MAASC,SAASC,eAAe,SD4H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMvE,KAAK,SAAAwE,GACjCA,EAAaC","file":"static/js/main.00af481e.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/logo.5d5d9eef.svg\";","// all options available here: https://github.com/conorhastings/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD\nexport default {\n 'bs': 'bash',\n 'bf': 'brainfuck',\n 'c': 'c',\n 'cp': 'cpp',\n 'cl': 'clojure',\n 'cs': 'css',\n 'dk': 'docker',\n 'ht': 'http',\n 'js': 'javascript',\n 'jn': 'json',\n 'jx': 'jsx',\n 'la': 'latex',\n 'ma': 'makefile',\n 'md': 'markdown',\n 'nm': 'nim',\n 'pb': 'protobuf',\n 'pu': 'puppet',\n 'py': 'python',\n 'sq': 'sql',\n 'ts': 'typescript',\n 'vi': 'vim',\n 'ym': 'yaml'\n}\n","import fileReaderPullStream from 'pull-file-reader'\n\nexport const fileUpload = (node, filePath) => {\n const file = fileReaderPullStream(filePath)\n return new Promise(function(resolve, reject) {\n node.files.add(file, (err, files) => {\n if (err) return reject(err)\n else resolve(files)\n })\n })\n}\n\nexport const uploadFileAndSend = async (node, file, sendFn) => {\n const { name, path, type } = file;\n const files = await fileUpload(node, file);\n const { hash } = files[0];\n const text = `/ipfs/${hash}`;\n sendFn(text);\n}\n\nexport const getFile = (node, CID) => {\n return new Promise(function(resolve, reject) {\n node.files.get(CID, function (err, files) {\n if (err) reject(err)\n else resolve(files)\n })\n })\n}\n","// @flow\nimport React, { Fragment, PureComponent } from 'react';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Avatar from '@material-ui/core/Avatar';\nimport YouTube from 'react-youtube';\nimport Linkify from 'react-linkify';\nimport SpotifyPlayer from 'react-spotify-player';\nimport { Emoji } from 'emoji-mart';\nimport Jazzicon, { jsNumberForAddress } from 'react-jazzicon'\nimport { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';\nimport { atomDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';\nimport { Matcher } from '@areknawo/rex'\nimport SyntaxLookup from '../utils/syntaxLookup';\nimport { getFile } from '../utils/ipfs';\n\nconst ipfsMatcher = new Matcher().begin().find('/ipfs/');\n\n// TODO: not exactly bulletproof right now, needs proper regex\nfunction hasYoutubeLink(text) {\n return text.indexOf('http://www.youtube.com') >= 0 || text.indexOf('https://www.youtube.com') >= 0;\n}\n\n// TODO: not exactly bulletproof right now, needs proper regex\nfunction isSpotifyLink(text) {\n return text.indexOf('spotify:') >= 0 ;\n}\n\n// https://gist.github.com/takien/4077195#\nfunction getYoutubeId(url) {\n let ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if (url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n}\n\nfunction isImage(text) {\n return text.indexOf(\"http\") >= 0 && (text.indexOf('.jpg') || text.indexOf('.gif'));\n}\n\n// TODO: this needs to be reviewed. best to return as a css background-image instead\nfunction displayImage(text) {\n\n let reg = new RegExp(/\\b(https?:\\/\\/\\S+(?:png|jpe?g|gif)\\S*)\\b/);\n let imageUrl = reg.exec(text);\n if (!imageUrl) return ();\n return ()\n}\n\n// TODO use regex for code parsing / detection. Add new line detection for shift+enter\nconst MessageRender = ({ message }) => {\n const emojis = [];\n let match;\n const regex1 = RegExp(/:[\\-a-zA-Z_+0-9]+:/g);\n while ((match = regex1.exec(message)) !== null) {\n emojis.push();\n }\n\n const parts = message.split(regex1);\n parts.forEach((part, i) => {\n parts[i] = {part}{emojis[i]};\n });\n\n return (message[2] === \"`\" && SyntaxLookup[message.slice(0,2)]\n ? {message.slice(3)}\n : {parts})\n};\n\nclass ChatBox extends PureComponent {\n\n state = {\n imgUrl: null\n };\n\n componentDidMount() {\n const { message } = this.props;\n if (ipfsMatcher.test(message)) this.getImageFromIpfs();\n }\n\n getImageFromIpfs = async () => {\n const { ipfs, message } = this.props;\n const files = await getFile(ipfs, message);\n const { content } = files[0];\n const arrayBufferView = new Uint8Array(content);\n const blob = new Blob([ arrayBufferView ], { type: \"image/jpeg\" });\n const imgUrl = URL.createObjectURL(blob);\n this.setState({ imgUrl });\n };\n\n render() {\n const { username, message, pubkey } = this.props;\n const { imgUrl } = this.state;\n return (\n \n \n \n \n \n {pubkey && }\n \n \n \n }/>\n \n {hasYoutubeLink(message) &&\n \n \n \n }\n {isSpotifyLink(message) &&\n \n \n \n }\n {!!imgUrl && ipfs}\n {isImage(message) && displayImage(message)}\n \n );\n };\n}\n\nexport default ChatBox;\n","import React from 'react';\n\nexport const ChatContext = React.createContext('chat');\n","import React, { PureComponent } from 'react';\nimport CardContent from '@material-ui/core/CardContent';\nimport Typography from '@material-ui/core/Typography';\nimport grey from '@material-ui/core/colors/grey';\nimport PersonIcon from '@material-ui/icons/PersonOutline';\nimport Dialog from '@material-ui/core/Dialog';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Avatar from '@material-ui/core/Avatar';\nimport CheckCircle from '@material-ui/icons/CheckCircle';\nimport OfflineBolt from '@material-ui/icons/OfflineBolt';\nimport Info from '@material-ui/icons/Info';\nimport Jazzicon, { jsNumberForAddress } from 'react-jazzicon'\nimport { ChatContext } from '../context';\n\nclass ChatHeader extends PureComponent {\n\n state = {\n displayChannelStats: false\n }\n\n componentDidMount() {\n this.heartBeat();\n }\n\n componentWillUnmount() {\n clearInterval(this.heartBeatId);\n }\n\n handleClose = () => {\n this.setState({ displayChannelStats: false });\n }\n\n handleOpen = () => {\n this.setState({ displayChannelStats: true });\n }\n\n heartBeat() {\n this.heartBeatId = setInterval(() => { this.forceUpdate() }, 5000)\n }\n\n render() {\n const { currentChannel, toggleSidebar } = this.props;\n const { displayChannelStats } = this.state;\n return (\n \n {({ channels }) => {\n const channelUsers = channels[currentChannel].users;\n const usersList = Object.keys(channelUsers);\n const currentTime = new Date().getTime();\n const userOffline = user => currentTime - user.lastSeen > 10*1000\n return (\n
\n {channels[currentChannel].users && \n {`Users Online in #${currentChannel}`}\n
\n \n {usersList.map(user => (\n \n {userOffline(channelUsers[user]) ? : }\n \n \n \n \n \n \n \n ))}\n \n
\n
}\n \n \n {channels[currentChannel].username ? `${channels[currentChannel].username}` : `#${currentChannel}`}\n \n
\n
{usersList.length}
\n \n \n \n
\n
\n
\n )\n }\n }\n
\n )\n }\n}\n\nexport default ChatHeader;\n","import React, { PureComponent } from 'react';\nimport blueGrey from '@material-ui/core/colors/blueGrey';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Avatar from '@material-ui/core/Avatar';\nimport FiberManualRecord from '@material-ui/icons/FiberManualRecord';\nimport FiberManualRecordOutlined from '@material-ui/icons/FiberManualRecordOutlined';\nimport Jazzicon, { jsNumberForAddress } from 'react-jazzicon'\nimport green from '@material-ui/core/colors/green';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { ChatContext } from '../context';\n\nconst online = green['500'];\nconst offline = blueGrey['500'];\nconst scrolling = { height: '100vh', overflow: 'scroll' };\n\nconst sortUsers = (channelUsers, allUsers) => Object.keys(channelUsers).sort((x,y) => {\n const currentTime = (new Date().getTime());\n const xIsOnline = ((currentTime - allUsers[x].lastSeen) > 10*1000) ? 1 : -1;\n const yIsOnline = ((currentTime - allUsers[y].lastSeen) > 10*1000) ? 1 : -1;\n\n if (xIsOnline > yIsOnline) return 1;\n if (xIsOnline < yIsOnline) return -1;\n if (x.username < y.username) return -1;\n if (x.username > y.username) return 1;\n return 0;\n});\n\n\nclass Userlist extends PureComponent {\n\n componentDidMount() {\n this.heartBeat();\n }\n\n componentWillUnmount() {\n clearInterval(this.heartBeatId);\n }\n\n heartBeat() {\n this.heartBeatId = setInterval(() => { this.forceUpdate() }, 5000)\n }\n\n render() {\n return (\n \n {({ channels, currentChannel, users }) => {\n const channelUsers = channels[currentChannel].users;\n const usersList = sortUsers(channelUsers, users);\n const currentTime = new Date().getTime();\n const userOffline = user => currentTime - user.lastSeen > 10*1000\n return (\n
\n \n {usersList.map(user => (\n \n
\n {userOffline(channelUsers[user]) ? : }\n \n \n \n \n \n
\n \n \n \n
\n ))}\n
\n
\n )\n }\n }\n
\n )\n }\n}\n\nexport default Userlist;\n","// @flow\nimport React, { Fragment, Component, PureComponent, createRef } from 'react';\nimport { Formik } from 'formik';\nimport autoscroll from 'autoscroll-react';\nimport List from '@material-ui/core/List';\nimport Divider from '@material-ui/core/Divider';\nimport Grid from '@material-ui/core/Grid';\nimport TextField from '@material-ui/core/TextField';\nimport Button from '@material-ui/core/Button';\nimport Dropzone from 'react-dropzone';\nimport { Picker } from 'emoji-mart';\nimport AddCircle from '@material-ui/icons/AddCircle';\n\nimport 'emoji-mart/css/emoji-mart.css';\n\nimport ChatBox from './ChatBox';\nimport ChatHeader from './ChatHeader';\nimport Userlist from './Userlist';\nimport { uploadFileAndSend } from '../utils/ipfs';\n\nclass WhoIsTyping extends PureComponent {\n\n whoIsTyping() {\n const { users, usersTyping, currentChannel } = this.props;\n const currentTime = new Date().getTime();\n\n const typingInChannel = usersTyping[currentChannel];\n const typingUsers = [];\n for (let pubkey in typingInChannel) {\n const lastTyped = typingInChannel[pubkey];\n if (!users[pubkey]) continue;\n if (currentTime - lastTyped > 3*1000 || currentTime < lastTyped) continue;\n typingUsers.push(users[pubkey].username)\n }\n return typingUsers;\n }\n\n render() {\n const userList = this.whoIsTyping();\n return (\n
\n {!userList.length ? \"\" : `${userList.join(',')} is typing`}\n
\n )\n }\n}\n\nfunction onDrop(acceptedFiles, rejectedFiles, ipfs, sendMessage) {\n const file = acceptedFiles[0];\n uploadFileAndSend(ipfs, file, sendMessage);\n}\n\nconst keyDownHandler = (e, typingEvent, setValue, value) => {\n if(e.shiftKey && e.keyCode === 13) {\n\t e.preventDefault();\n const cursor = e.target.selectionStart;\n const newValue = `${value.slice(0, cursor)}\\n${value.slice(cursor)}`;\n setValue('chatInput', newValue);\n }\n else if (e.keyCode === 13) {\n e.preventDefault();\n const form = ChatRoomForm.current;\n form.dispatchEvent(new Event(\"submit\"));\n }\n typingEvent(e)\n};\n\nconst AutoScrollList = autoscroll(List);\nconst formStyle = { display: 'flex', justifyContent: 'center', alignItems: 'center', flexBasis: '10%' };\nconst ChatRoomForm = createRef();\nconst NameInput = createRef();\nconst messagesOffset = 185;\nclass ChatRoom extends Component {\n constructor(props) {\n super(props);\n this.state = {\n showEmojis: false,\n infoPanelActive: true\n };\n }\n\n toggleEmojis(e) {\n this.setState(({ showEmojis: !this.state.showEmojis }));\n }\n\n toggleInfoPanel = () => {\n this.setState({ infoPanelActive: !this.state.infoPanelActive })\n }\n\n uploadFileDialog() {\n this.fileInput.click();\n }\n\n fileChangedHandler(event) {\n const { ipfs, sendMessage } = this.props;\n const file = event.target.files[0];\n uploadFileAndSend(ipfs, file, sendMessage);\n }\n\n addEmoji(emoji, chatInput, setValue) {\n console.log(emoji);\n setValue('chatInput', `${chatInput}:${emoji.id}:`);\n this.setState(({showEmojis: false}), () => {\n NameInput.current.labelNode.focus();\n });\n }\n\n render() {\n const { messages, sendMessage, currentChannel, usersTyping, typingEvent, channelUsers, allUsers, ipfs } = this.props;\n const { showEmojis, infoPanelActive } = this.state;\n const messagesHeight = `calc(100vh - ${messagesOffset}px)`;\n return (\n
\n { this.fileInput = input; }}\n onChange={this.fileChangedHandler.bind(this)}\n style={{display: 'none'}}\n />\n \n {\n onDrop(a, r, ipfs, sendMessage);\n }}\n disableClick\n style={{ position: 'relative', height: '100%' }}\n activeStyle={{\n backgroundColor: 'grey',\n outline: '5px dashed lightgrey',\n alignSelf: 'center',\n outlineOffset: '-10px'\n }}>\n \n \n \n \n \n \n {messages[currentChannel] && messages[currentChannel].map((message) => (\n \n \n
  • \n \n
  • \n
    \n ))}\n
    \n {\n const { chatInput } = values;\n sendMessage(chatInput);\n resetForm();\n setSubmitting(false);\n }}\n >\n {({\n values,\n errors,\n touched,\n handleChange,\n handleBlur,\n handleSubmit,\n setFieldValue\n }) => (\n
    \n
    \n \n keyDownHandler(e, typingEvent, setFieldValue, values.chatInput)}\n onBlur={handleBlur}\n value={values.chatInput || ''}\n />\n {showEmojis && this.addEmoji(emoji, values.chatInput, setFieldValue)}\n style={{ position: 'absolute', bottom: '80px', right: '20px' }}/>}\n \n {errors.chatInput && touched.chatInput && errors.chatInput}\n \n \n
    \n )}\n \n
    \n {infoPanelActive && }\n
    \n
    \n \n \n
    \n )\n }\n}\n\nexport default ChatRoom;\n","// @flow\nimport React from 'react';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { ChatContext } from '../context';\n\nconst ChannelBox = ({ channelName, message }) => (\n \n {({ setActiveChannel, currentChannel, channels }) =>\n setActiveChannel(channelName)} selected={currentChannel == channelName} style={{\"cursor\": \"pointer\", \"padding\": \"0px 2px\"}}>\n \n {channels[channelName].username ? `${channels[channelName].username}` : `#${channelName}`}\n \n } secondary={message} />\n \n }\n \n);\n\nexport default ChannelBox;\n","const CONTACT_CODE_REGEXP = /^(0x)?[0-9a-f]{130}$/i;\nexport const isContactCode = str => CONTACT_CODE_REGEXP.test(str);\n","// @flow\nimport React, { Fragment } from 'react';\nimport List from '@material-ui/core/List';\nimport ChannelBox from './ChannelBox';\nimport { isContactCode } from '../utils/parsers';\n\nconst ChannelBoxes = ({ channels }) => (\n
    \n {channels.map((channel) => (\n \n \n \n ))}\n
    \n\n)\nconst ChannelList = ({ channels }) => {\n const channelList = Object.keys(channels)\n const onlyChannels = channelList.filter((i) => !isContactCode(i));\n const directMessages = channelList.filter(isContactCode);\n\n return (\n \n \n Direct Messages\n \n \n )\n}\n\nexport default ChannelList;\n","import React, { Fragment } from 'react';\nimport { Formik } from 'formik';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport AddCircle from '@material-ui/icons/AddCircle';\n\nclass ContextFilter extends React.Component {\n state = {\n open: false,\n };\n\n handleClickOpen = () => {\n this.setState({ open: true });\n };\n\n handleClose = () => {\n this.setState({ open: false });\n };\n\n render() {\n const { open } = this.state;\n const { joinConversation, name } = this.props;\n return (\n \n \n {name}\n \n \n {\n const { channel } = values;\n joinConversation(channel);\n resetForm();\n setSubmitting(false);\n this.handleClose();\n }}\n >\n {({\n values,\n errors,\n touched,\n handleChange,\n handleBlur,\n handleSubmit\n }) => (\n \n Join Conversation\n \n \n Enter the Channel, Contact Code or Username you would like to join\n \n
    \n \n {errors.channel && touched.channel && errors.channel}\n \n
    \n \n \n \n \n \n )}\n \n
    \n );\n }\n}\n\nexport default ContextFilter;\n","import React from 'react';\nimport ChannelList from './ChannelList';\nimport ContextFilter from './ContextFilter';\nimport styles from './ContextPanel.css';\n\nconst ContextPanel = ({ channels, joinConversation }) => (\n
    \n

    Status

    \n \n \n
    \n);\n\nexport default ContextPanel;\n","import React from 'react';\n\nconst StatusLogo = () => (\n \n \n)\n\nexport default StatusLogo\n","import React from 'react';\n\nconst JSLogo = () => (\n \n \n \n \n)\n\nexport default JSLogo;\n","import React from 'react';\nimport StatusLogo from './status-logo';\nimport JSLogo from './js-logo';\n\nconst StatusJSLogo = () => (\n
    \n \n
    \n \n
    \n
    \n)\n\nexport default StatusJSLogo;\n","import React from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport TextField from '@material-ui/core/TextField';\nimport Button from '@material-ui/core/Button';\nimport { Formik } from 'formik';\nimport { func } from 'prop-types';\nimport { isNull } from 'lodash';\nimport StatusJSLogo from '../images/statusjs-logo';\n\nconst containerStyle = {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-evenly',\n height: '100vh',\n width: '50%'\n};\nconst Login = ({ setupKeyringController, keyStore, wipeKeyStore, connect }) => (\n \n {\n const { password, seed } = values;\n setupKeyringController(password, seed)\n .catch(err => {\n setFieldError(\"password\", err.message)\n });\n resetForm();\n }}\n >\n {({\n values,\n errors,\n handleChange,\n handleBlur,\n handleSubmit\n }) => (\n
    \n \n {isNull(keyStore) && }\n \n \n {!isNull(keyStore) && }\n \n )}\n \n \n);\n\nLogin.propTypes = {\n setupKeyringController: func.isRequired,\n wipeKeyStore: func.isRequired,\n connect: func.isRequired\n};\n\nexport default Login;\n","export class User {\n constructor(pubkey, username) {\n this.pubkey = pubkey;\n this.username = username;\n this.online = false;\n this.lastSeen = 0;\n }\n}\n","import KeyringController from 'eth-keyring-controller';\nimport Store from './store';\n\nconst store = new Store({ configName: 'keyManagement', defaults: { vault: null } });\nexport const createVault = async (password, mnemonic) => {\n const keyRingController = new KeyringController({});\n const controller = await keyRingController.createNewVaultAndRestore(password, mnemonic);\n const vault = keyRingController.store.getState();\n storeKeyData(JSON.stringify(vault));\n return keyRingController;\n}\n\nexport const restoreVault = async (password) => {\n const keyStore = JSON.parse(getKeyData());\n const keyRingController = new KeyringController({\n initState: keyStore\n });\n const controller = await keyRingController.submitPassword(password);\n return keyRingController;\n}\n\nexport const getKeyData = () => store.get('vault');\nexport const storeKeyData = vault => {\n store.set('vault', vault);\n}\nexport const wipeVault = () => { store.set('vault', null); }\n","export default class Store {\n constructor(opts) {}\n\n get(key) {\n return localStorage.getItem(key);\n }\n\n set(key, val) {\n localStorage.setItem(key, val);\n }\n}\n","import React from 'react';\nimport { css } from 'react-emotion';\nimport { BounceLoader, GridLoader } from 'react-spinners';\n\nconst containerStyle = { display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh', margin: '0 30% 0 30%' };\nexport const FullScreenLoader = () => (\n
    \n \n
    \n)\n\nexport const FullScreenGridLoader = () => (\n
    \n \n
    \n)\n\n","export const openBrowserWindow = url => {\n window.open(url, '_blank', 'nodeIntegration=no');\n}\n\nexport const addWindowEventListeners = (sendMessage) => {\n const verbose = window.statusVerbose\n window.addEventListener('message', function (msg) {\n if(window.statusVerbose) console.log('message', msg)\n if (msg.source === window.parent && window.statusVerbose) {\n console.log(msg.data)\n }\n\n if (msg.data && msg.data.type && msg.data.type === 'whisperMsg') {\n sendMessage(msg.data.msg)\n }\n })\n}\n","// @flow\nimport React, { PureComponent, Fragment } from 'react';\nimport StatusJS from 'status-js-api';\nimport Murmur from 'murmur-client';\nimport IPFS from 'ipfs';\nimport uuid from 'uuid/v4';\nimport { isNil } from 'lodash';\nimport Grid from '@material-ui/core/Grid';\nimport ChatRoom from './ChatRoom';\nimport ContextPanel from './ContextPanel';\nimport Login from './Login';\nimport { User } from '../utils/actors';\nimport { ChatContext } from '../context';\nimport { isContactCode } from '../utils/parsers';\nimport { getKeyData, createVault, restoreVault, wipeVault } from '../utils/keyManagement';\nimport { FullScreenLoader } from './Loaders';\nimport { openBrowserWindow, addWindowEventListeners } from '../utils/windows';\n\nconst typingNotificationsTimestamp = {};\n\n\nconst DEFAULT_CHANNEL = \"status-js\";\nconst URL = \"ws://localhost:8546\";\nconst status = new StatusJS();\n\ntype Props = {};\n\nexport default class Home extends PureComponent {\n props: Props;\n\n state = {\n messages: { [DEFAULT_CHANNEL]: [] },\n users: {},\n channels: {\n [DEFAULT_CHANNEL]: { users: {} }\n },\n currentChannel: DEFAULT_CHANNEL,\n usersTyping: { [DEFAULT_CHANNEL]: [] },\n identity: {},\n loading: false,\n keyStore: getKeyData()\n };\n\n componentDidMount() {\n this.connectMurMur();\n this.ipfs = new IPFS();\n }\n\n componentWillUnmount() {\n clearInterval(this.pingInterval);\n this.ipfs.shutdown();\n }\n\n connect = async (account) => {\n if (!account) {\n this.setState({ loading: true });\n status.connectToProvider(this.server.provider, null);\n return this.onConnect();\n }\n\n this.keyringController.exportAccount(account)\n .then(key => { status.connect(URL, `0x${key}`) })\n .then(() => { this.onConnect() })\n };\n\n connectMurMur() {\n this.server = new Murmur({\n protocols: [\"libp2p\"],\n // signalServer: { host: '104.248.64.24', port: '9090', protocol: 'ws' },\n signalServers: [\n \"/dns4/cryptolife.status.im/tcp/443/wss/p2p-webrtc-star\"\n ],\n bootnodes: []\n });\n this.server.start();\n }\n\n onConnect = () => {\n const { currentChannel } = this.state;\n this.joinChannel(currentChannel);\n this.pingChannel();\n this.createOnUserMessageHandler();\n //TODO store ref to clear on componentWillUnmount\n addWindowEventListeners(this.sendMessage);\n setTimeout(() => {\n this.getMyIdentities();\n // Uncomment to test signing to status channels\n //this.openBrowser('http://localhost:3000/sign-and-verify-message/sign');\n }, 1500);\n }\n\n openBrowser = (url) => {\n openBrowserWindow(url);\n }\n\n pingChannel = (channelName) => {\n const { currentChannel } = this.state;\n this.pingInterval = setInterval(() => {\n status.sendJsonMessage(channelName || currentChannel, {type: \"ping\"});\n }, 5 * 1000)\n }\n\n setupKeyringController = async (password, mnemonic) => {\n const { keyStore } = this.state;\n if (!keyStore) {\n this.keyringController = await createVault(password, mnemonic);\n } else {\n try {\n this.keyringController = await restoreVault(password);\n } catch(err) {\n throw err;\n }\n }\n this.setState({ loading: true });\n const accounts = await this.keyringController.getAccounts();\n this.connect(accounts[0]);\n }\n\n wipeKeyStore = () => {\n wipeVault();\n this.setState({ keyStore: null });\n }\n\n setActiveChannel = channelName => {\n this.setState({ currentChannel: channelName, });\n }\n\n joinConversation = contact => {\n const { joinChannel, addDirectMessage } = this;\n if (isContactCode(contact)) {\n addDirectMessage(contact)\n } else {\n joinChannel(contact)\n }\n }\n\n addDirectMessage = contactCode => {\n status.addContact(contactCode, () => {\n this.addConversationEntry(contactCode);\n })\n }\n\n addConversationEntry = (code, changeChannel = true) => {\n const { channels, currentChannel } = this.state;\n this.setState({\n currentChannel: changeChannel ? code : currentChannel,\n channels: {\n ...channels,\n [code]: { users: {} }\n }\n })\n }\n\n joinChannel = channelName => {\n status.joinChat(channelName, () => {\n this.addConversationEntry(channelName);\n console.log(`joined channel ${channelName}`);\n status.onMessage(channelName, (err, data) => {\n const msg = JSON.parse(data.payload)[1][0];\n\n if (JSON.parse(data.payload)[1][1] === 'content/json') {\n return this.handleProtocolMessages(channelName, data);\n }\n const message = { username: data.username, message: msg, pubkey: data.data.sig, data };\n this.setState((prevState) => {\n const existing = prevState.messages[channelName];\n return {\n messages: {\n ...prevState.messages,\n [channelName]: existing ? [ ...existing, message ] : [ message ]\n }\n }\n })\n });\n this.pingChannel(channelName);\n });\n }\n\n createOnUserMessageHandler = () => {\n status.onUserMessage((err, res) => {\n if (res) {\n const payload = JSON.parse(res.payload);\n const msg = payload[1][0];\n const sender = res.data.sig;\n const message = { username: res.username, message: msg, data: res };\n this.setState((prevState) => {\n const existing = prevState.messages[sender];\n return {\n messages: {\n ...prevState.messages,\n [sender]: existing ? [ ...existing, message ] : [ message ]\n },\n channels: {\n ...prevState.channels,\n [sender]: { username: res.username, users: {} }\n }\n }\n })\n }\n });\n }\n\n sendMessage = message => {\n const { currentChannel } = this.state;\n status.sendMessage(currentChannel, message);\n }\n\n addUserToChannel = (channelName, user) => {\n const { channels } = this.state;\n const channel = { ...channels[channelName] };\n channel.users[user.pubkey] = user;\n this.setState({ channels: { ...channels, [channelName]: channel }});\n }\n\n getChannel = channelName => {\n const { channels } = this.state;\n return channels.find(c => c.name === channelName);\n }\n\n getMyIdentities = async () => {\n const publicKey = await status.getPublicKey();\n const username = await status.getUserName(publicKey);\n this.setState({\n identity: { publicKey, username },\n loading: false\n })\n\n }\n\n handleProtocolMessages = (channelName, data) => {\n const { identity: { publicKey } } = this.state\n const msg = JSON.parse(JSON.parse(data.payload)[1][0]);\n const fromUser = data.data.sig;\n\n if (msg.type === 'ping') {\n const user = this.addOrUpdateUserKey(fromUser, data.username);\n this.addUserToChannel(channelName, user);\n }\n\n if (msg.type === 'typing' && fromUser !== publicKey) {\n this.setState(prevState => ({\n usersTyping: {\n ...prevState.usersTyping,\n [channelName]: {\n [fromUser]: (new Date().getTime())\n }\n }\n }))\n }\n }\n\n addOrUpdateUserKey = (pubkey, username) => {\n const user = new User(pubkey, username);\n user.lastSeen = (new Date().getTime());\n user.online = true;\n this.setState(prevState => ({\n users: {\n ...prevState.users,\n [pubkey]: user\n }\n }))\n return user;\n }\n\n typingEvent = () => {\n const { currentChannel } = this.state;\n const now = (new Date().getTime());\n\n if (!typingNotificationsTimestamp[currentChannel]) {\n typingNotificationsTimestamp[currentChannel] = { lastEvent: 0 }\n }\n if (typingNotificationsTimestamp[currentChannel].lastEvent === 0 || now - typingNotificationsTimestamp[currentChannel].lastEvent > 3*1000) {;\n typingNotificationsTimestamp[currentChannel].lastEvent = now;\n status.sendJsonMessage(currentChannel, {type: \"typing\"});\n }\n }\n\n render() {\n const { messages, channels, currentChannel, users, usersTyping, identity, loading, keyStore } = this.state;\n const channelUsers = channels[currentChannel].users;\n const { setActiveChannel, setupKeyringController, wipeKeyStore, connect, ipfs } = this;\n const chatContext = { setActiveChannel, currentChannel, users, channels };\n\n return (\n \n {loading\n ? \n : \n {!identity.publicKey\n ? \n :
    \n \n {!isNil(channels) &&\n }\n \n \n \n \n
    }\n
    }\n
    \n );\n }\n}\n","import React, { Component } from 'react';\nimport Home from './components/Home'\nimport logo from './logo.svg';\n\nclass App extends Component {\n render() {\n return \n }\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read http://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit http://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See http://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""} \ No newline at end of file diff --git a/build/static/js/main.00af481e.chunk.js b/build/static/js/main.e0745bc2.chunk.js similarity index 50% rename from build/static/js/main.00af481e.chunk.js rename to build/static/js/main.e0745bc2.chunk.js index ca02807..e72562b 100644 --- a/build/static/js/main.00af481e.chunk.js +++ b/build/static/js/main.e0745bc2.chunk.js @@ -1,2 +1,2 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{1023:function(e,t,n){},1027:function(e,t,n){e.exports=n(2698)},1094:function(e,t){},1096:function(e,t){},1133:function(e,t){},1181:function(e,t){},1226:function(e,t){},1378:function(e,t){},1445:function(e,t){},1458:function(e,t){},1538:function(e,t){},1540:function(e,t){},1552:function(e,t){},1982:function(e,t){},2122:function(e,t){},2133:function(e,t){},2135:function(e,t){},2163:function(e,t){},2176:function(e,t){},2209:function(e,t){},2697:function(e,t,n){e.exports=n.p+"static/media/logo.5d5d9eef.svg"},2698:function(e,t,n){"use strict";n.r(t);var a=n(1),r=n.n(a),s=n(94),l=n.n(s),c=n(70),i=n(77),o=n(86),u=n(85),m=n(87),p=n(558),h=n(146),f=n(41),d=n.n(f),g=n(115),y=n(95),v=n(282),b=n(991),E=n.n(b),w=n(992),j=n.n(w),C=n(993),O=n.n(C),k=(n(252),n(190)),x=n(116),S=n.n(x),I=n(231),M=n(997),U=n.n(M),A=n(143),N=n.n(A),T=n(555),D=n.n(T),B=n(192),F=n.n(B),P=n(131),K=n.n(P),W=n(1026),J=n(367),z=n(365),R=n.n(z),L=(n(2284),n(130)),V=n.n(L),H=n(230),_=n.n(H),q=n(165),$=n.n(q),G=n(191),Y=n.n(G),Z=n(1e3),Q=n(1003),X=n.n(Q),ee=n(1004),te=n.n(ee),ne=n(145),ae=n.n(ne),re=n(2703),se=n(1008),le=n(1005),ce={bs:"bash",bf:"brainfuck",c:"c",cp:"cpp",cl:"clojure",cs:"css",dk:"docker",ht:"http",js:"javascript",jn:"json",jx:"jsx",la:"latex",ma:"makefile",md:"markdown",nm:"nim",pb:"protobuf",pu:"puppet",py:"python",sq:"sql",ts:"typescript",vi:"vim",ym:"yaml"},ie=n(1006),oe=n.n(ie),ue=function(e,t){var n=oe()(t);return new Promise(function(t,a){e.files.add(n,function(e,n){if(e)return a(e);t(n)})})},me=function(){var e=Object(g.a)(d.a.mark(function e(t,n,a){var r,s,l;return d.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n.name,n.path,n.type,e.next=3,ue(t,n);case 3:r=e.sent,s=r[0].hash,l="/ipfs/".concat(s),a(l);case 7:case"end":return e.stop()}},e,this)}));return function(t,n,a){return e.apply(this,arguments)}}(),pe=function(e,t){return new Promise(function(n,a){e.files.get(t,function(e,t){e?a(e):n(t)})})},he=(new le.a).begin().find("/ipfs/");var fe=function(e){for(var t,n=e.message,a=[],s=RegExp(/:[\-a-zA-Z_+0-9]+:/g);null!==(t=s.exec(n));)a.push(r.a.createElement(J.a,{emoji:t[0],size:16}));var l=n.split(s);return l.forEach(function(e,t){l[t]=r.a.createElement("span",{className:"match",key:t},e,a[t])}),"`"===n[2]&&ce[n.slice(0,2)]?r.a.createElement(re.a,{language:ce[n.slice(0,2)],style:se.atomDark},n.slice(3)):r.a.createElement(X.a,null,r.a.createElement("span",{style:{wordWrap:"break-word",whiteSpace:"pre-line"}},l))},de=function(e){function t(){var e,n;Object(c.a)(this,t);for(var a=arguments.length,r=new Array(a),s=0;s=0||t.indexOf("https://www.youtube.com")>=0)&&r.a.createElement(V.a,null,r.a.createElement(Z.a,{videoId:(e=l,void 0!==(e=e.replace(/(>|<)/gi,"").split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/))[2]?e[2].split(/[^0-9a-z_\-]/i)[0]:e),opts:{height:"390",width:"640",playerVars:{autoplay:0}}})),function(e){return e.indexOf("spotify:")>=0}(l)&&r.a.createElement(V.a,null,r.a.createElement(te.a,{uri:l,size:{width:300,height:300},view:"list",theme:"black"})),!!i&&r.a.createElement("img",{src:i,alt:"ipfs",style:{maxWidth:"90%"}}),function(e){return e.indexOf("http")>=0&&(e.indexOf(".jpg")||e.indexOf(".gif"))}(l)&&function(e){var t=new RegExp(/\b(https?:\/\/\S+(?:png|jpe?g|gif)\S*)\b/).exec(e);return t?r.a.createElement("img",{src:t[0],style:{maxWidth:"90%"}}):r.a.createElement("span",null)}(l))}}]),t}(a.PureComponent),ge=n(1012),ye=n.n(ge),ve=n(281),be=n.n(ve),Ee=n(283),we=n.n(Ee),je=n(1013),Ce=n.n(je),Oe=n(363),ke=n.n(Oe),xe=n(364),Se=n.n(xe),Ie=n(1011),Me=n.n(Ie),Ue=n(1010),Ae=n.n(Ue),Ne=n(1014),Te=n.n(Ne),De=r.a.createContext("chat"),Be=function(e){function t(){var e,n;Object(c.a)(this,t);for(var a=arguments.length,r=new Array(a),s=0;s1e4}(c[e])?r.a.createElement(Ae.a,{style:{color:"red"}}):r.a.createElement(Me.a,{style:{color:"green"}}),r.a.createElement(_.a,null,r.a.createElement(Y.a,null,r.a.createElement(ae.a,{diameter:40,seed:Object(ne.jsNumberForAddress)(c[e].pubkey)}))),r.a.createElement($.a,{primary:c[e].username,secondary:"Last seen on ".concat(new Date(c[e].lastSeen))}))})))),r.a.createElement(ye.a,{style:{flexBasis:"10%",paddingBottom:"0px"}},r.a.createElement(be.a,{variant:"h5",component:"h2"},l[n].username?"".concat(l[n].username):"#".concat(n)),r.a.createElement("div",{style:{display:"flex",alignItems:"center"}},r.a.createElement(Ce.a,{style:{color:we.a[500]},onClick:e.handleOpen}),r.a.createElement("div",{style:{color:we.a[500]}},i.length),r.a.createElement("span",{style:{marginLeft:"auto"}},r.a.createElement(Te.a,{style:{color:we.a[500]},onClick:a})))))})}}]),t}(a.PureComponent),Fe=n(1016),Pe=n.n(Fe),Ke=n(1018),We=n.n(Ke),Je=n(1017),ze=n.n(Je),Re=n(1015),Le=n.n(Re),Ve=n(1019),He=n.n(Ve),_e=Le.a[500],qe=Pe.a[500],$e={height:"100vh",overflow:"scroll"},Ge=function(e){function t(){return Object(c.a)(this,t),Object(o.a)(this,Object(u.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(i.a)(t,[{key:"componentDidMount",value:function(){this.heartBeat()}},{key:"componentWillUnmount",value:function(){clearInterval(this.heartBeatId)}},{key:"heartBeat",value:function(){var e=this;this.heartBeatId=setInterval(function(){e.forceUpdate()},5e3)}},{key:"render",value:function(){return r.a.createElement(De.Consumer,null,function(e){var t=e.channels,n=e.currentChannel,a=e.users,s=t[n].users,l=function(e,t){return Object.keys(e).sort(function(e,n){var a=(new Date).getTime(),r=a-t[e].lastSeen>1e4?1:-1,s=a-t[n].lastSeen>1e4?1:-1;return r>s?1:rn.username?1:0})}(s,a),c=(new Date).getTime();return r.a.createElement("div",{style:$e},r.a.createElement(N.a,{style:$e},l.map(function(e){return r.a.createElement(V.a,{button:!0,key:s[e].pubkey,style:{display:"flex",paddingLeft:"5px"}},r.a.createElement("div",{style:{display:"flex"}},function(e){return c-e.lastSeen>1e4}(s[e])?r.a.createElement(ze.a,{style:{color:qe,margin:"auto"}}):r.a.createElement(We.a,{style:{color:_e,margin:"auto"}}),r.a.createElement(_.a,null,r.a.createElement(Y.a,null,r.a.createElement(ae.a,{diameter:40,seed:Object(ne.jsNumberForAddress)(s[e].pubkey)})))),r.a.createElement(He.a,{title:"Last seen on ".concat(new Date(s[e].lastSeen)),placement:"top-start"},r.a.createElement($.a,{primary:s[e].username})))})))})}}]),t}(a.PureComponent),Ye=function(e){function t(){return Object(c.a)(this,t),Object(o.a)(this,Object(u.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(i.a)(t,[{key:"whoIsTyping",value:function(){var e=this.props,t=e.users,n=e.usersTyping,a=e.currentChannel,r=(new Date).getTime(),s=n[a],l=[];for(var c in s){var i=s[c];t[c]&&(r-i>3e3||r1&&void 0!==arguments[1])||arguments[1],a=n.state,r=a.channels,s=a.currentChannel;n.setState({currentChannel:t?e:s,channels:Object(h.a)({},r,Object(y.a)({},e,{users:{}}))})},n.joinChannel=function(e){Wt.joinChat(e,function(){n.addConversationEntry(e),console.log("joined channel ".concat(e)),Wt.onMessage(e,function(t,a){var r=JSON.parse(a.payload)[1][0];if("content/json"===JSON.parse(a.payload)[1][1])return n.handleProtocolMessages(e,a);var s={username:a.username,message:r,pubkey:a.data.sig,data:a};n.setState(function(t){var n=t.messages[e];return{messages:Object(h.a)({},t.messages,Object(y.a)({},e,n?[].concat(Object(p.a)(n),[s]):[s]))}})}),n.pingChannel(e)})},n.createOnUserMessageHandler=function(){Wt.onUserMessage(function(e,t){if(t){var a=JSON.parse(t.payload)[1][0],r=t.data.sig,s={username:t.username,message:a,data:t};n.setState(function(e){var n=e.messages[r];return{messages:Object(h.a)({},e.messages,Object(y.a)({},r,n?[].concat(Object(p.a)(n),[s]):[s])),channels:Object(h.a)({},e.channels,Object(y.a)({},r,{username:t.username,users:{}}))}})}})},n.sendMessage=function(e){var t=n.state.currentChannel;Wt.sendMessage(t,e)},n.addUserToChannel=function(e,t){var a=n.state.channels,r=Object(h.a)({},a[e]);r.users[t.pubkey]=t,n.setState({channels:Object(h.a)({},a,Object(y.a)({},e,r))})},n.getChannel=function(e){return n.state.channels.find(function(t){return t.name===e})},n.getMyIdentities=Object(g.a)(d.a.mark(function e(){var t,a;return d.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Wt.getPublicKey();case 2:return t=e.sent,e.next=5,Wt.getUserName(t);case 5:a=e.sent,n.setState({identity:{publicKey:t,username:a},loading:!1});case 7:case"end":return e.stop()}},e,this)})),n.handleProtocolMessages=function(e,t){var a=n.state.identity.publicKey,r=JSON.parse(JSON.parse(t.payload)[1][0]),s=t.data.sig;if("ping"===r.type){var l=n.addOrUpdateUserKey(s,t.username);n.addUserToChannel(e,l)}"typing"===r.type&&s!==a&&n.setState(function(t){return{usersTyping:Object(h.a)({},t.usersTyping,Object(y.a)({},e,Object(y.a)({},s,(new Date).getTime())))}})},n.addOrUpdateUserKey=function(e,t){var a=new jt(e,t);return a.lastSeen=(new Date).getTime(),a.online=!0,n.setState(function(t){return{users:Object(h.a)({},t.users,Object(y.a)({},e,a))}}),a},n.typingEvent=function(){var e=n.state.currentChannel,t=(new Date).getTime();Ft[e]||(Ft[e]={lastEvent:0}),(0===Ft[e].lastEvent||t-Ft[e].lastEvent>3e3)&&(Ft[e].lastEvent=t,Wt.sendJsonMessage(e,{type:"typing"}))},n}return Object(m.a)(t,e),Object(i.a)(t,[{key:"componentDidMount",value:function(){this.connectMurMur(),this.ipfs=new O.a}},{key:"componentWillUnmount",value:function(){clearInterval(this.pingInterval),this.ipfs.shutdown()}},{key:"connectMurMur",value:function(){this.server=new j.a({protocols:["libp2p"],signalServers:["/dns4/cryptolife.status.im/tcp/443/wss/p2p-webrtc-star"],bootnodes:[]}),this.server.start()}},{key:"render",value:function(){var e=this.state,t=e.messages,n=e.channels,s=e.currentChannel,l=e.users,c=e.usersTyping,i=e.identity,o=e.loading,u=e.keyStore,m=n[s].users,p=this.setActiveChannel,h=this.setupKeyringController,f=this.wipeKeyStore,d=this.connect,g=this.ipfs,y={setActiveChannel:p,currentChannel:s,users:l,channels:n};return r.a.createElement(De.Provider,{value:y},o?r.a.createElement(Tt,null):r.a.createElement(a.Fragment,null,i.publicKey?r.a.createElement("div",{style:{width:"100%",flexWrap:"nowrap",display:"flex",boxSizing:"border-box"}},r.a.createElement(S.a,{item:!0,xs:2},!Object(k.isNil)(n)&&r.a.createElement(gt,{channels:n,joinConversation:this.joinConversation})),r.a.createElement(S.a,{item:!0,xs:10},r.a.createElement(tt,{messages:t,sendMessage:this.sendMessage,currentChannel:s,usersTyping:c,typingEvent:this.typingEvent,channelUsers:m,allUsers:l,ipfs:g}))):r.a.createElement(wt,{connect:d,setupKeyringController:h,keyStore:u,wipeKeyStore:f})))}}]),t}(a.PureComponent),zt=(n(2697),function(e){function t(){return Object(c.a)(this,t),Object(o.a)(this,Object(u.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(i.a)(t,[{key:"render",value:function(){return r.a.createElement(Jt,null)}}]),t}(a.Component));Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));l.a.render(r.a.createElement(zt,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(e){e.unregister()})},663:function(e,t){}},[[1027,2,1]]]); -//# sourceMappingURL=main.00af481e.chunk.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{1023:function(e,t,n){},1027:function(e,t,n){e.exports=n(2698)},1094:function(e,t){},1096:function(e,t){},1133:function(e,t){},1181:function(e,t){},1226:function(e,t){},1378:function(e,t){},1445:function(e,t){},1458:function(e,t){},1538:function(e,t){},1540:function(e,t){},1552:function(e,t){},1982:function(e,t){},2122:function(e,t){},2133:function(e,t){},2135:function(e,t){},2163:function(e,t){},2176:function(e,t){},2209:function(e,t){},2697:function(e,t,n){e.exports=n.p+"static/media/logo.5d5d9eef.svg"},2698:function(e,t,n){"use strict";n.r(t);var a=n(1),r=n.n(a),s=n(94),l=n.n(s),c=n(70),o=n(77),i=n(86),u=n(85),m=n(87),p=n(558),h=n(146),d=n(41),f=n.n(d),g=n(115),y=n(95),v=n(282),b=n(991),E=n.n(b),w=n(992),j=n.n(w),C=n(993),O=n.n(C),k=(n(252),n(190)),x=n(116),S=n.n(x),I=n(231),M=n(997),U=n.n(M),T=n(143),N=n.n(T),A=n(555),D=n.n(A),B=n(192),F=n.n(B),P=n(131),K=n.n(P),W=n(1026),J=n(367),R=n(365),z=n.n(R),L=(n(2284),n(130)),V=n.n(L),H=n(230),_=n.n(H),q=n(165),$=n.n(q),G=n(191),Y=n.n(G),Z=n(1e3),Q=n(1003),X=n.n(Q),ee=n(1004),te=n.n(ee),ne=n(145),ae=n.n(ne),re=n(2703),se=n(1008),le=n(1005),ce={bs:"bash",bf:"brainfuck",c:"c",cp:"cpp",cl:"clojure",cs:"css",dk:"docker",ht:"http",js:"javascript",jn:"json",jx:"jsx",la:"latex",ma:"makefile",md:"markdown",nm:"nim",pb:"protobuf",pu:"puppet",py:"python",sq:"sql",ts:"typescript",vi:"vim",ym:"yaml"},oe=n(1006),ie=n.n(oe),ue=function(e,t){var n=ie()(t);return new Promise(function(t,a){e.files.add(n,function(e,n){if(e)return a(e);t(n)})})},me=function(){var e=Object(g.a)(f.a.mark(function e(t,n,a){var r,s,l;return f.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n.name,n.path,n.type,e.next=3,ue(t,n);case 3:r=e.sent,s=r[0].hash,l="/ipfs/".concat(s),a(l);case 7:case"end":return e.stop()}},e,this)}));return function(t,n,a){return e.apply(this,arguments)}}(),pe=function(e,t){return new Promise(function(n,a){e.files.get(t,function(e,t){e?a(e):n(t)})})},he=(new le.a).begin().find("/ipfs/");var de=function(e){for(var t,n=e.message,a=[],s=RegExp(/:[\-a-zA-Z_+0-9]+:/g);null!==(t=s.exec(n));)a.push(r.a.createElement(J.a,{emoji:t[0],size:16}));var l=n.split(s);return l.forEach(function(e,t){l[t]=r.a.createElement("span",{className:"match",key:t},e,a[t])}),"`"===n[2]&&ce[n.slice(0,2)]?r.a.createElement(re.a,{language:ce[n.slice(0,2)],style:se.atomDark},n.slice(3)):r.a.createElement(X.a,null,r.a.createElement("span",{style:{wordWrap:"break-word",whiteSpace:"pre-line"}},l))},fe=function(e){function t(){var e,n;Object(c.a)(this,t);for(var a=arguments.length,r=new Array(a),s=0;s=0||t.indexOf("https://www.youtube.com")>=0)&&r.a.createElement(V.a,null,r.a.createElement(Z.a,{videoId:(e=l,void 0!==(e=e.replace(/(>|<)/gi,"").split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/))[2]?e[2].split(/[^0-9a-z_\-]/i)[0]:e),opts:{height:"390",width:"640",playerVars:{autoplay:0}}})),function(e){return e.indexOf("spotify:")>=0}(l)&&r.a.createElement(V.a,null,r.a.createElement(te.a,{uri:l,size:{width:300,height:300},view:"list",theme:"black"})),!!o&&r.a.createElement("img",{src:o,alt:"ipfs",style:{maxWidth:"90%"}}),function(e){return e.indexOf("http")>=0&&(e.indexOf(".jpg")||e.indexOf(".gif"))}(l)&&function(e){var t=new RegExp(/\b(https?:\/\/\S+(?:png|jpe?g|gif)\S*)\b/).exec(e);return t?r.a.createElement("img",{src:t[0],style:{maxWidth:"90%"}}):r.a.createElement("span",null)}(l))}}]),t}(a.PureComponent),ge=n(1012),ye=n.n(ge),ve=n(281),be=n.n(ve),Ee=n(283),we=n.n(Ee),je=n(1013),Ce=n.n(je),Oe=n(363),ke=n.n(Oe),xe=n(364),Se=n.n(xe),Ie=n(1011),Me=n.n(Ie),Ue=n(1010),Te=n.n(Ue),Ne=n(1014),Ae=n.n(Ne),De=r.a.createContext("chat"),Be=function(e){function t(){var e,n;Object(c.a)(this,t);for(var a=arguments.length,r=new Array(a),s=0;s1e4}(c[e])?r.a.createElement(Te.a,{style:{color:"red"}}):r.a.createElement(Me.a,{style:{color:"green"}}),r.a.createElement(_.a,null,r.a.createElement(Y.a,null,r.a.createElement(ae.a,{diameter:40,seed:Object(ne.jsNumberForAddress)(c[e].pubkey)}))),r.a.createElement($.a,{primary:c[e].username,secondary:"Last seen on ".concat(new Date(c[e].lastSeen))}))})))),r.a.createElement(ye.a,{style:{flexBasis:"10%",paddingBottom:"0px"}},r.a.createElement(be.a,{variant:"h5",component:"h2"},l[n].username?"".concat(l[n].username):"#".concat(n)),r.a.createElement("div",{style:{display:"flex",alignItems:"center"}},r.a.createElement(Ce.a,{style:{color:we.a[500]},onClick:e.handleOpen}),r.a.createElement("div",{style:{color:we.a[500]}},o.length),r.a.createElement("span",{style:{marginLeft:"auto"}},r.a.createElement(Ae.a,{style:{color:we.a[500]},onClick:a})))))})}}]),t}(a.PureComponent),Fe=n(1016),Pe=n.n(Fe),Ke=n(1018),We=n.n(Ke),Je=n(1017),Re=n.n(Je),ze=n(1015),Le=n.n(ze),Ve=n(1019),He=n.n(Ve),_e=Le.a[500],qe=Pe.a[500],$e={height:"100vh",overflow:"scroll"},Ge=function(e){function t(){return Object(c.a)(this,t),Object(i.a)(this,Object(u.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(o.a)(t,[{key:"componentDidMount",value:function(){this.heartBeat()}},{key:"componentWillUnmount",value:function(){clearInterval(this.heartBeatId)}},{key:"heartBeat",value:function(){var e=this;this.heartBeatId=setInterval(function(){e.forceUpdate()},5e3)}},{key:"render",value:function(){return r.a.createElement(De.Consumer,null,function(e){var t=e.channels,n=e.currentChannel,a=e.users,s=t[n].users,l=function(e,t){return Object.keys(e).sort(function(e,n){var a=(new Date).getTime(),r=a-t[e].lastSeen>1e4?1:-1,s=a-t[n].lastSeen>1e4?1:-1;return r>s?1:rn.username?1:0})}(s,a),c=(new Date).getTime();return r.a.createElement("div",{style:$e},r.a.createElement(N.a,{style:$e},l.map(function(e){return r.a.createElement(V.a,{button:!0,key:s[e].pubkey,style:{display:"flex",paddingLeft:"5px"}},r.a.createElement("div",{style:{display:"flex"}},function(e){return c-e.lastSeen>1e4}(s[e])?r.a.createElement(Re.a,{style:{color:qe,margin:"auto"}}):r.a.createElement(We.a,{style:{color:_e,margin:"auto"}}),r.a.createElement(_.a,null,r.a.createElement(Y.a,null,r.a.createElement(ae.a,{diameter:40,seed:Object(ne.jsNumberForAddress)(s[e].pubkey)})))),r.a.createElement(He.a,{title:"Last seen on ".concat(new Date(s[e].lastSeen)),placement:"top-start"},r.a.createElement($.a,{primary:s[e].username})))})))})}}]),t}(a.PureComponent),Ye=function(e){function t(){return Object(c.a)(this,t),Object(i.a)(this,Object(u.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(o.a)(t,[{key:"whoIsTyping",value:function(){var e=this.props,t=e.users,n=e.usersTyping,a=e.currentChannel,r=(new Date).getTime(),s=n[a],l=[];for(var c in s){var o=s[c];t[c]&&(r-o>3e3||r1&&void 0!==arguments[1])||arguments[1],a=n.state,r=a.channels,s=a.currentChannel;n.setState({currentChannel:t?e:s,channels:Object(h.a)({},r,Object(y.a)({},e,{users:{}}))})},n.joinChannel=function(e){Wt.joinChat(e,function(){n.addConversationEntry(e),console.log("joined channel ".concat(e)),Wt.onMessage(e,function(t,a){var r=JSON.parse(a.payload)[1][0];if("content/json"===JSON.parse(a.payload)[1][1])return n.handleProtocolMessages(e,a);var s={username:a.username,message:r,pubkey:a.data.sig,data:a};n.setState(function(t){var n=t.messages[e];return{messages:Object(h.a)({},t.messages,Object(y.a)({},e,n?[].concat(Object(p.a)(n),[s]):[s]))}})}),n.pingChannel(e)})},n.createOnUserMessageHandler=function(){Wt.onUserMessage(function(e,t){if(t){var a=JSON.parse(t.payload)[1][0],r=t.data.sig,s={username:t.username,message:a,data:t};n.setState(function(e){var n=e.messages[r];return{messages:Object(h.a)({},e.messages,Object(y.a)({},r,n?[].concat(Object(p.a)(n),[s]):[s])),channels:Object(h.a)({},e.channels,Object(y.a)({},r,{username:t.username,users:{}}))}})}})},n.sendMessage=function(e){var t=n.state.currentChannel;Wt.sendMessage(t,e)},n.addUserToChannel=function(e,t){var a=n.state.channels,r=Object(h.a)({},a[e]);r.users[t.pubkey]=t,n.setState({channels:Object(h.a)({},a,Object(y.a)({},e,r))})},n.getChannel=function(e){return n.state.channels.find(function(t){return t.name===e})},n.getMyIdentities=Object(g.a)(f.a.mark(function e(){var t,a;return f.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Wt.getPublicKey();case 2:return t=e.sent,e.next=5,Wt.getUserName(t);case 5:a=e.sent,n.setState({identity:{publicKey:t,username:a},loading:!1});case 7:case"end":return e.stop()}},e,this)})),n.handleProtocolMessages=function(e,t){var a=n.state.identity.publicKey,r=JSON.parse(JSON.parse(t.payload)[1][0]),s=t.data.sig;if("ping"===r.type){var l=n.addOrUpdateUserKey(s,t.username);n.addUserToChannel(e,l)}"typing"===r.type&&s!==a&&n.setState(function(t){return{usersTyping:Object(h.a)({},t.usersTyping,Object(y.a)({},e,Object(y.a)({},s,(new Date).getTime())))}})},n.addOrUpdateUserKey=function(e,t){var a=new jt(e,t);return a.lastSeen=(new Date).getTime(),a.online=!0,n.setState(function(t){return{users:Object(h.a)({},t.users,Object(y.a)({},e,a))}}),a},n.typingEvent=function(){var e=n.state.currentChannel,t=(new Date).getTime();Ft[e]||(Ft[e]={lastEvent:0}),(0===Ft[e].lastEvent||t-Ft[e].lastEvent>3e3)&&(Ft[e].lastEvent=t,Wt.sendJsonMessage(e,{type:"typing"}))},n}return Object(m.a)(t,e),Object(o.a)(t,[{key:"componentDidMount",value:function(){this.connectMurMur(),this.ipfs=new O.a}},{key:"componentWillUnmount",value:function(){clearInterval(this.pingInterval),this.ipfs.shutdown()}},{key:"connectMurMur",value:function(){this.server=new j.a({protocols:["libp2p"],signalServers:["/dns4/cryptolife.status.im/tcp/443/wss/p2p-webrtc-star"],bootnodes:[]}),this.server.start()}},{key:"render",value:function(){var e=this.state,t=e.messages,n=e.channels,s=e.currentChannel,l=e.users,c=e.usersTyping,o=e.identity,i=e.loading,u=e.keyStore,m=n[s].users,p=this.setActiveChannel,h=this.setupKeyringController,d=this.wipeKeyStore,f=this.connect,g=this.ipfs,y={setActiveChannel:p,currentChannel:s,users:l,channels:n};return r.a.createElement(De.Provider,{value:y},i?r.a.createElement(At,null):r.a.createElement(a.Fragment,null,o.publicKey?r.a.createElement("div",{style:{width:"100%",flexWrap:"nowrap",display:"flex",boxSizing:"border-box"}},r.a.createElement(S.a,{item:!0,xs:2},!Object(k.isNil)(n)&&r.a.createElement(gt,{channels:n,joinConversation:this.joinConversation})),r.a.createElement(S.a,{item:!0,xs:10},r.a.createElement(tt,{messages:t,sendMessage:this.sendMessage,currentChannel:s,usersTyping:c,typingEvent:this.typingEvent,channelUsers:m,allUsers:l,ipfs:g}))):r.a.createElement(wt,{connect:f,setupKeyringController:h,keyStore:u,wipeKeyStore:d})))}}]),t}(a.PureComponent),Rt=(n(2697),function(e){function t(){return Object(c.a)(this,t),Object(i.a)(this,Object(u.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(o.a)(t,[{key:"render",value:function(){return r.a.createElement(Jt,null)}}]),t}(a.Component));Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));l.a.render(r.a.createElement(Rt,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(e){e.unregister()})},663:function(e,t){}},[[1027,2,1]]]); +//# sourceMappingURL=main.e0745bc2.chunk.js.map \ No newline at end of file diff --git a/build/static/js/main.e0745bc2.chunk.js.map b/build/static/js/main.e0745bc2.chunk.js.map new file mode 100644 index 0000000..87364f7 --- /dev/null +++ b/build/static/js/main.e0745bc2.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["logo.svg","utils/syntaxLookup.js","utils/ipfs.js","components/ChatBox.js","context.js","components/ChatHeader.js","components/Userlist.jsx","components/ChatRoom.js","components/ChannelBox.js","utils/parsers.js","components/ChannelList.js","components/ContextFilter.js","components/ContextPanel.js","images/status-logo.js","images/js-logo.js","images/statusjs-logo.js","components/Login.js","utils/actors.js","utils/keyManagement.js","utils/store.js","components/Loaders.js","utils/windows.js","components/Home.js","App.js","serviceWorker.js","index.js"],"names":["module","exports","__webpack_require__","p","syntaxLookup","bs","bf","c","cp","cl","cs","dk","ht","js","jn","jx","la","ma","md","nm","pb","pu","py","sq","ts","vi","ym","fileUpload","node","filePath","file","fileReaderPullStream","Promise","resolve","reject","files","add","err","uploadFileAndSend","_ref","Object","asyncToGenerator","regenerator_default","a","mark","_callee","sendFn","hash","text","wrap","_context","prev","next","name","path","type","sent","concat","stop","this","_x","_x2","_x3","apply","arguments","getFile","CID","get","ipfsMatcher","Matcher","begin","find","MessageRender","match","message","emojis","regex1","RegExp","exec","push","react_default","createElement","dist_es","emoji","size","parts","split","forEach","part","i","className","key","SyntaxLookup","slice","prism","language","style","atomDark","Linkify_default","wordWrap","whiteSpace","ChatBox","state","imgUrl","getImageFromIpfs","_this$props","ipfs","content","arrayBufferView","blob","_this","props","Uint8Array","Blob","URL","createObjectURL","setState","test","url","_this$props2","username","pubkey","react","ListItem_default","Avatar_default","ListItemAvatar_default","lib_default","diameter","seed","jsNumberForAddress","ListItemText_default","primary","secondary","ChatBox_MessageRender","indexOf","YouTube","videoId","undefined","replace","opts","height","width","playerVars","autoplay","isSpotifyLink","SpotifyPlayer_default","uri","view","theme","src","alt","maxWidth","isImage","imageUrl","displayImage","PureComponent","ChatContext","React","createContext","ChatHeader","displayChannelStats","handleClose","handleOpen","heartBeat","clearInterval","heartBeatId","_this2","setInterval","forceUpdate","_this3","currentChannel","toggleSidebar","Consumer","channels","channelUsers","users","usersList","keys","currentTime","Date","getTime","Dialog_default","onClose","aria-labelledby","open","DialogTitle_default","List_default","map","user","button","lastSeen","userOffline","OfflineBolt_default","color","CheckCircle_default","CardContent_default","flexBasis","paddingBottom","Typography_default","variant","component","display","alignItems","PersonOutline_default","grey","onClick","length","marginLeft","Info_default","online","green","offline","blueGrey","scrolling","overflow","Userlist","allUsers","sort","x","y","xIsOnline","yIsOnline","sortUsers","paddingLeft","FiberManualRecordOutlined_default","margin","FiberManualRecord_default","Tooltip_default","title","placement","WhoIsTyping","usersTyping","typingInChannel","typingUsers","lastTyped","userList","whoIsTyping","textAlign","join","AutoScrollList","autoscroll","List","formStyle","justifyContent","ChatRoomForm","createRef","NameInput","ChatRoom","classCallCheck","possibleConstructorReturn","getPrototypeOf","call","toggleInfoPanel","infoPanelActive","showEmojis","e","fileInput","click","event","sendMessage","target","chatInput","setValue","console","log","id","current","labelNode","focus","_this$props3","messages","typingEvent","_this$state","messagesHeight","flexWrap","boxSizing","ref","input","onChange","fileChangedHandler","bind","Grid_default","xs","item","es","onDrop","r","acceptedFiles","rejectedFiles","disableClick","position","activeStyle","backgroundColor","outline","alignSelf","outlineOffset","container","direction","justify","components_ChatHeader","Divider_default","overflowY","data","payload","components_ChatBox","assign","formik_esm","initialValues","onSubmit","values","setSubmitting","resetForm","_ref2","errors","touched","handleChange","handleBlur","handleSubmit","setFieldValue","Button_default","uploadFileDialog","AddCircle_default","TextField_default","multiline","flexGrow","label","fullWidth","onKeyDown","value","shiftKey","keyCode","preventDefault","cursor","selectionStart","dispatchEvent","Event","keyDownHandler","onBlur","onSelect","addEmoji","bottom","right","toggleEmojis","ChatRoom_WhoIsTyping","borderLeft","minHeight","components_Userlist","Component","ChannelBox","channelName","setActiveChannel","selected","padding","CONTACT_CODE_REGEXP","isContactCode","str","ChannelBoxes","marginBottom","channel","components_ChannelBox","ChannelList","channelList","onlyChannels","filter","directMessages","ChannelList_ChannelBoxes","ContextFilter","handleClickOpen","joinConversation","verticalAlign","DialogContent_default","DialogContentText_default","autoFocus","DialogActions_default","ContextPanel","styles","sidebar","borderRight","components_ContextFilter","components_ChannelList","StatusLogo","xmlns","d","fill","fillRule","JSLogo","viewBox","StatusJSLogo","status_logo","js_logo","containerStyle","flexDirection","Login","setupKeyringController","keyStore","wipeKeyStore","connect","password","setFieldError","catch","_ref3","statusjs_logo","href","isNull","rows","error","helperText","User","store","Store","localStorage","getItem","val","setItem","configName","defaults","vault","createVault","mnemonic","keyRingController","KeyringController","createNewVaultAndRestore","getState","storeKeyData","JSON","stringify","abrupt","restoreVault","_callee2","_context2","parse","getKeyData","initState","submitPassword","set","wipeVault","FullScreenLoader","react_spinners","sizeUnit","openBrowserWindow","window","addWindowEventListeners","statusVerbose","addEventListener","msg","source","parent","typingNotificationsTimestamp","DEFAULT_CHANNEL","status","StatusJS","Home","defineProperty","identity","loading","account","connectToProvider","server","provider","onConnect","keyringController","exportAccount","then","joinChannel","pingChannel","createOnUserMessageHandler","setTimeout","getMyIdentities","openBrowser","pingInterval","sendJsonMessage","accounts","t0","getAccounts","contact","_assertThisInitialize","assertThisInitialized","addDirectMessage","contactCode","addContact","addConversationEntry","code","changeChannel","objectSpread","joinChat","onMessage","handleProtocolMessages","sig","prevState","existing","toConsumableArray","onUserMessage","res","sender","addUserToChannel","getChannel","_callee3","publicKey","_context3","getPublicKey","getUserName","fromUser","addOrUpdateUserKey","now","lastEvent","connectMurMur","IPFS","shutdown","Murmur","protocols","signalServers","bootnodes","start","_this$state2","chatContext","Provider","Loaders_FullScreenLoader","isNil","src_components_ContextPanel","components_ChatRoom","components_Login","App","Home_Home","Boolean","location","hostname","ReactDOM","render","src_App","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"ugBAAAA,EAAAC,QAAiBC,EAAAC,EAAuB,inBCCzBC,GAAA,CACbC,GAAM,OACNC,GAAM,YACNC,EAAK,IACLC,GAAM,MACNC,GAAM,UACNC,GAAM,MACNC,GAAM,SACNC,GAAM,OACNC,GAAM,aACNC,GAAM,OACNC,GAAM,MACNC,GAAM,QACNC,GAAM,WACNC,GAAM,WACNC,GAAM,MACNC,GAAM,WACNC,GAAM,SACNC,GAAM,SACNC,GAAM,MACNC,GAAM,aACNC,GAAM,MACNC,GAAM,8BCrBKC,GAAa,SAACC,EAAMC,GAC/B,IAAMC,EAAOC,KAAqBF,GAClC,OAAO,IAAIG,QAAQ,SAASC,EAASC,GACnCN,EAAKO,MAAMC,IAAIN,EAAM,SAACO,EA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b,CAAsB3L,MAAO0L,GAC1B5D,EACEtX,EAAArC,EAAAsC,cAACmb,GAAD,MACApb,EAAArC,EAAAsC,cAACyC,EAAA,SAAD,KACE2U,EAAS4C,UAMRja,EAAArC,EAAAsC,cAAA,OAAKe,MAAO,CAAE6C,MAAO,OAAQqI,SAAU,SAAUzE,QAAS,OAAQ0E,UAAW,eAC7EnM,EAAArC,EAAAsC,cAACwM,EAAA9O,EAAD,CAAMgP,MAAI,EAACD,GAAI,IACX2O,gBAAMxV,IACN7F,EAAArC,EAAAsC,cAACqb,GAAD,CACEzV,SAAUA,EACVmM,iBAAkBrT,KAAKqT,oBAE7BhS,EAAArC,EAAAsC,cAACwM,EAAA9O,EAAD,CAAMgP,MAAI,EAACD,GAAI,IACX1M,EAAArC,EAAAsC,cAACsb,GAAD,CACEzP,SAAUA,EACVX,YAAaxM,KAAKwM,YAClBzF,eAAgBA,EAChB6D,YAAaA,EACbwC,YAAapN,KAAKoN,YAClBjG,aAAcA,EACd0C,SAAUzC,EACVrE,KAAMA,MArBZ1B,EAAArC,EAAAsC,cAACub,GAAD,CACE5H,QAASA,EACTH,uBAAwBA,EACxBC,SAAUA,EACVC,aAAcA,aA1QIhP,iBCjBnB8W,6LAJX,OAAOzb,EAAArC,EAAAsC,cAACyb,GAAD,aAFO/K,cCQEgL,QACW,cAA7BnF,OAAOoF,SAASC,UAEe,UAA7BrF,OAAOoF,SAASC,UAEhBrF,OAAOoF,SAASC,SAASpc,MACvB,2DCbNqc,IAASC,OAAO/b,EAAArC,EAAAsC,cAAC+b,GAAD,MAASC,SAASC,eAAe,SD4H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMvE,KAAK,SAAAwE,GACjCA,EAAaC","file":"static/js/main.e0745bc2.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/logo.5d5d9eef.svg\";","// all options available here: https://github.com/conorhastings/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD\nexport default {\n 'bs': 'bash',\n 'bf': 'brainfuck',\n 'c': 'c',\n 'cp': 'cpp',\n 'cl': 'clojure',\n 'cs': 'css',\n 'dk': 'docker',\n 'ht': 'http',\n 'js': 'javascript',\n 'jn': 'json',\n 'jx': 'jsx',\n 'la': 'latex',\n 'ma': 'makefile',\n 'md': 'markdown',\n 'nm': 'nim',\n 'pb': 'protobuf',\n 'pu': 'puppet',\n 'py': 'python',\n 'sq': 'sql',\n 'ts': 'typescript',\n 'vi': 'vim',\n 'ym': 'yaml'\n}\n","import fileReaderPullStream from 'pull-file-reader'\n\nexport const fileUpload = (node, filePath) => {\n const file = fileReaderPullStream(filePath)\n return new Promise(function(resolve, reject) {\n node.files.add(file, (err, files) => {\n if (err) return reject(err)\n else resolve(files)\n })\n })\n}\n\nexport const uploadFileAndSend = async (node, file, sendFn) => {\n const { name, path, type } = file;\n const files = await fileUpload(node, file);\n const { hash } = files[0];\n const text = `/ipfs/${hash}`;\n sendFn(text);\n}\n\nexport const getFile = (node, CID) => {\n return new Promise(function(resolve, reject) {\n node.files.get(CID, function (err, files) {\n if (err) reject(err)\n else resolve(files)\n })\n })\n}\n","// @flow\nimport React, { Fragment, PureComponent } from 'react';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Avatar from '@material-ui/core/Avatar';\nimport YouTube from 'react-youtube';\nimport Linkify from 'react-linkify';\nimport SpotifyPlayer from 'react-spotify-player';\nimport { Emoji } from 'emoji-mart';\nimport Jazzicon, { jsNumberForAddress } from 'react-jazzicon'\nimport { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';\nimport { atomDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';\nimport { Matcher } from '@areknawo/rex'\nimport SyntaxLookup from '../utils/syntaxLookup';\nimport { getFile } from '../utils/ipfs';\n\nconst ipfsMatcher = new Matcher().begin().find('/ipfs/');\n\n// TODO: not exactly bulletproof right now, needs proper regex\nfunction hasYoutubeLink(text) {\n return text.indexOf('http://www.youtube.com') >= 0 || text.indexOf('https://www.youtube.com') >= 0;\n}\n\n// TODO: not exactly bulletproof right now, needs proper regex\nfunction isSpotifyLink(text) {\n return text.indexOf('spotify:') >= 0 ;\n}\n\n// https://gist.github.com/takien/4077195#\nfunction getYoutubeId(url) {\n let ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if (url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n}\n\nfunction isImage(text) {\n return text.indexOf(\"http\") >= 0 && (text.indexOf('.jpg') || text.indexOf('.gif'));\n}\n\n// TODO: this needs to be reviewed. best to return as a css background-image instead\nfunction displayImage(text) {\n\n let reg = new RegExp(/\\b(https?:\\/\\/\\S+(?:png|jpe?g|gif)\\S*)\\b/);\n let imageUrl = reg.exec(text);\n if (!imageUrl) return ();\n return ()\n}\n\n// TODO use regex for code parsing / detection. Add new line detection for shift+enter\nconst MessageRender = ({ message }) => {\n const emojis = [];\n let match;\n const regex1 = RegExp(/:[\\-a-zA-Z_+0-9]+:/g);\n while ((match = regex1.exec(message)) !== null) {\n emojis.push();\n }\n\n const parts = message.split(regex1);\n parts.forEach((part, i) => {\n parts[i] = {part}{emojis[i]};\n });\n\n return (message[2] === \"`\" && SyntaxLookup[message.slice(0,2)]\n ? {message.slice(3)}\n : {parts})\n};\n\nclass ChatBox extends PureComponent {\n\n state = {\n imgUrl: null\n };\n\n componentDidMount() {\n const { message } = this.props;\n if (ipfsMatcher.test(message)) this.getImageFromIpfs();\n }\n\n getImageFromIpfs = async () => {\n const { ipfs, message } = this.props;\n const files = await getFile(ipfs, message);\n const { content } = files[0];\n const arrayBufferView = new Uint8Array(content);\n const blob = new Blob([ arrayBufferView ], { type: \"image/jpeg\" });\n const imgUrl = URL.createObjectURL(blob);\n this.setState({ imgUrl });\n };\n\n render() {\n const { username, message, pubkey } = this.props;\n const { imgUrl } = this.state;\n return (\n \n \n \n \n \n {pubkey && }\n \n \n \n }/>\n \n {hasYoutubeLink(message) &&\n \n \n \n }\n {isSpotifyLink(message) &&\n \n \n \n }\n {!!imgUrl && ipfs}\n {isImage(message) && displayImage(message)}\n \n );\n };\n}\n\nexport default ChatBox;\n","import React from 'react';\n\nexport const ChatContext = React.createContext('chat');\n","import React, { PureComponent } from 'react';\nimport CardContent from '@material-ui/core/CardContent';\nimport Typography from '@material-ui/core/Typography';\nimport grey from '@material-ui/core/colors/grey';\nimport PersonIcon from '@material-ui/icons/PersonOutline';\nimport Dialog from '@material-ui/core/Dialog';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Avatar from '@material-ui/core/Avatar';\nimport CheckCircle from '@material-ui/icons/CheckCircle';\nimport OfflineBolt from '@material-ui/icons/OfflineBolt';\nimport Info from '@material-ui/icons/Info';\nimport Jazzicon, { jsNumberForAddress } from 'react-jazzicon'\nimport { ChatContext } from '../context';\n\nclass ChatHeader extends PureComponent {\n\n state = {\n displayChannelStats: false\n }\n\n componentDidMount() {\n this.heartBeat();\n }\n\n componentWillUnmount() {\n clearInterval(this.heartBeatId);\n }\n\n handleClose = () => {\n this.setState({ displayChannelStats: false });\n }\n\n handleOpen = () => {\n this.setState({ displayChannelStats: true });\n }\n\n heartBeat() {\n this.heartBeatId = setInterval(() => { this.forceUpdate() }, 5000)\n }\n\n render() {\n const { currentChannel, toggleSidebar } = this.props;\n const { displayChannelStats } = this.state;\n return (\n \n {({ channels }) => {\n const channelUsers = channels[currentChannel].users;\n const usersList = Object.keys(channelUsers);\n const currentTime = new Date().getTime();\n const userOffline = user => currentTime - user.lastSeen > 10*1000\n return (\n
    \n {channels[currentChannel].users && \n {`Users Online in #${currentChannel}`}\n
    \n \n {usersList.map(user => (\n \n {userOffline(channelUsers[user]) ? : }\n \n \n \n \n \n \n \n ))}\n \n
    \n
    }\n \n \n {channels[currentChannel].username ? `${channels[currentChannel].username}` : `#${currentChannel}`}\n \n
    \n
    {usersList.length}
    \n \n \n \n
    \n
    \n
    \n )\n }\n }\n
    \n )\n }\n}\n\nexport default ChatHeader;\n","import React, { PureComponent } from 'react';\nimport blueGrey from '@material-ui/core/colors/blueGrey';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Avatar from '@material-ui/core/Avatar';\nimport FiberManualRecord from '@material-ui/icons/FiberManualRecord';\nimport FiberManualRecordOutlined from '@material-ui/icons/FiberManualRecordOutlined';\nimport Jazzicon, { jsNumberForAddress } from 'react-jazzicon'\nimport green from '@material-ui/core/colors/green';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { ChatContext } from '../context';\n\nconst online = green['500'];\nconst offline = blueGrey['500'];\nconst scrolling = { height: '100vh', overflow: 'scroll' };\n\nconst sortUsers = (channelUsers, allUsers) => Object.keys(channelUsers).sort((x,y) => {\n const currentTime = (new Date().getTime());\n const xIsOnline = ((currentTime - allUsers[x].lastSeen) > 10*1000) ? 1 : -1;\n const yIsOnline = ((currentTime - allUsers[y].lastSeen) > 10*1000) ? 1 : -1;\n\n if (xIsOnline > yIsOnline) return 1;\n if (xIsOnline < yIsOnline) return -1;\n if (x.username < y.username) return -1;\n if (x.username > y.username) return 1;\n return 0;\n});\n\n\nclass Userlist extends PureComponent {\n\n componentDidMount() {\n this.heartBeat();\n }\n\n componentWillUnmount() {\n clearInterval(this.heartBeatId);\n }\n\n heartBeat() {\n this.heartBeatId = setInterval(() => { this.forceUpdate() }, 5000)\n }\n\n render() {\n return (\n \n {({ channels, currentChannel, users }) => {\n const channelUsers = channels[currentChannel].users;\n const usersList = sortUsers(channelUsers, users);\n const currentTime = new Date().getTime();\n const userOffline = user => currentTime - user.lastSeen > 10*1000\n return (\n
    \n \n {usersList.map(user => (\n \n
    \n {userOffline(channelUsers[user]) ? : }\n \n \n \n \n \n
    \n \n \n \n
    \n ))}\n
    \n
    \n )\n }\n }\n
    \n )\n }\n}\n\nexport default Userlist;\n","// @flow\nimport React, { Fragment, Component, PureComponent, createRef } from 'react';\nimport { Formik } from 'formik';\nimport autoscroll from 'autoscroll-react';\nimport List from '@material-ui/core/List';\nimport Divider from '@material-ui/core/Divider';\nimport Grid from '@material-ui/core/Grid';\nimport TextField from '@material-ui/core/TextField';\nimport Button from '@material-ui/core/Button';\nimport Dropzone from 'react-dropzone';\nimport { Picker } from 'emoji-mart';\nimport AddCircle from '@material-ui/icons/AddCircle';\n\nimport 'emoji-mart/css/emoji-mart.css';\n\nimport ChatBox from './ChatBox';\nimport ChatHeader from './ChatHeader';\nimport Userlist from './Userlist';\nimport { uploadFileAndSend } from '../utils/ipfs';\n\nclass WhoIsTyping extends PureComponent {\n\n whoIsTyping() {\n const { users, usersTyping, currentChannel } = this.props;\n const currentTime = new Date().getTime();\n\n const typingInChannel = usersTyping[currentChannel];\n const typingUsers = [];\n for (let pubkey in typingInChannel) {\n const lastTyped = typingInChannel[pubkey];\n if (!users[pubkey]) continue;\n if (currentTime - lastTyped > 3*1000 || currentTime < lastTyped) continue;\n typingUsers.push(users[pubkey].username)\n }\n return typingUsers;\n }\n\n render() {\n const userList = this.whoIsTyping();\n return (\n
    \n {!userList.length ? \"\" : `${userList.join(',')} is typing`}\n
    \n )\n }\n}\n\nfunction onDrop(acceptedFiles, rejectedFiles, ipfs, sendMessage) {\n const file = acceptedFiles[0];\n uploadFileAndSend(ipfs, file, sendMessage);\n}\n\nconst keyDownHandler = (e, typingEvent, setValue, value) => {\n if(e.shiftKey && e.keyCode === 13) {\n\t e.preventDefault();\n const cursor = e.target.selectionStart;\n const newValue = `${value.slice(0, cursor)}\\n${value.slice(cursor)}`;\n setValue('chatInput', newValue);\n }\n else if (e.keyCode === 13) {\n e.preventDefault();\n const form = ChatRoomForm.current;\n form.dispatchEvent(new Event(\"submit\"));\n }\n typingEvent(e)\n};\n\nconst AutoScrollList = autoscroll(List);\nconst formStyle = { display: 'flex', justifyContent: 'center', alignItems: 'center', flexBasis: '10%' };\nconst ChatRoomForm = createRef();\nconst NameInput = createRef();\nconst messagesOffset = 185;\nclass ChatRoom extends Component {\n constructor(props) {\n super(props);\n this.state = {\n showEmojis: false,\n infoPanelActive: true\n };\n }\n\n toggleEmojis(e) {\n this.setState(({ showEmojis: !this.state.showEmojis }));\n }\n\n toggleInfoPanel = () => {\n this.setState({ infoPanelActive: !this.state.infoPanelActive })\n }\n\n uploadFileDialog() {\n this.fileInput.click();\n }\n\n fileChangedHandler(event) {\n const { ipfs, sendMessage } = this.props;\n const file = event.target.files[0];\n uploadFileAndSend(ipfs, file, sendMessage);\n }\n\n addEmoji(emoji, chatInput, setValue) {\n console.log(emoji);\n setValue('chatInput', `${chatInput}:${emoji.id}:`);\n this.setState(({showEmojis: false}), () => {\n NameInput.current.labelNode.focus();\n });\n }\n\n render() {\n const { messages, sendMessage, currentChannel, usersTyping, typingEvent, channelUsers, allUsers, ipfs } = this.props;\n const { showEmojis, infoPanelActive } = this.state;\n const messagesHeight = `calc(100vh - ${messagesOffset}px)`;\n return (\n
    \n { this.fileInput = input; }}\n onChange={this.fileChangedHandler.bind(this)}\n style={{display: 'none'}}\n />\n \n {\n onDrop(a, r, ipfs, sendMessage);\n }}\n disableClick\n style={{ position: 'relative', height: '100%' }}\n activeStyle={{\n backgroundColor: 'grey',\n outline: '5px dashed lightgrey',\n alignSelf: 'center',\n outlineOffset: '-10px'\n }}>\n \n \n \n \n \n \n {messages[currentChannel] && messages[currentChannel].map((message) => (\n \n \n
  • \n \n
  • \n
    \n ))}\n
    \n {\n const { chatInput } = values;\n sendMessage(chatInput);\n resetForm();\n setSubmitting(false);\n }}\n >\n {({\n values,\n errors,\n touched,\n handleChange,\n handleBlur,\n handleSubmit,\n setFieldValue\n }) => (\n
    \n
    \n \n keyDownHandler(e, typingEvent, setFieldValue, values.chatInput)}\n onBlur={handleBlur}\n value={values.chatInput || ''}\n />\n {showEmojis && this.addEmoji(emoji, values.chatInput, setFieldValue)}\n style={{ position: 'absolute', bottom: '80px', right: '20px' }}/>}\n \n {errors.chatInput && touched.chatInput && errors.chatInput}\n \n \n
    \n )}\n \n
    \n {infoPanelActive && }\n
    \n
    \n \n \n
    \n )\n }\n}\n\nexport default ChatRoom;\n","// @flow\nimport React from 'react';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { ChatContext } from '../context';\n\nconst ChannelBox = ({ channelName, message }) => (\n \n {({ setActiveChannel, currentChannel, channels }) =>\n setActiveChannel(channelName)} selected={currentChannel == channelName} style={{\"cursor\": \"pointer\", \"padding\": \"0px 2px\"}}>\n \n {channels[channelName].username ? `${channels[channelName].username}` : `#${channelName}`}\n \n } secondary={message} />\n \n }\n \n);\n\nexport default ChannelBox;\n","const CONTACT_CODE_REGEXP = /^(0x)?[0-9a-f]{130}$/i;\nexport const isContactCode = str => CONTACT_CODE_REGEXP.test(str);\n","// @flow\nimport React, { Fragment } from 'react';\nimport List from '@material-ui/core/List';\nimport ChannelBox from './ChannelBox';\nimport { isContactCode } from '../utils/parsers';\n\nconst ChannelBoxes = ({ channels }) => (\n
    \n {channels.map((channel) => (\n \n \n \n ))}\n
    \n\n)\nconst ChannelList = ({ channels }) => {\n const channelList = Object.keys(channels)\n const onlyChannels = channelList.filter((i) => !isContactCode(i));\n const directMessages = channelList.filter(isContactCode);\n\n return (\n \n \n Direct Messages\n \n \n )\n}\n\nexport default ChannelList;\n","import React, { Fragment } from 'react';\nimport { Formik } from 'formik';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport AddCircle from '@material-ui/icons/AddCircle';\n\nclass ContextFilter extends React.Component {\n state = {\n open: false,\n };\n\n handleClickOpen = () => {\n this.setState({ open: true });\n };\n\n handleClose = () => {\n this.setState({ open: false });\n };\n\n render() {\n const { open } = this.state;\n const { joinConversation, name } = this.props;\n return (\n \n \n {name}\n \n \n {\n const { channel } = values;\n joinConversation(channel);\n resetForm();\n setSubmitting(false);\n this.handleClose();\n }}\n >\n {({\n values,\n errors,\n touched,\n handleChange,\n handleBlur,\n handleSubmit\n }) => (\n \n Join Conversation\n \n \n Enter the Channel, Contact Code or Username you would like to join\n \n
    \n \n {errors.channel && touched.channel && errors.channel}\n \n
    \n \n \n \n \n \n )}\n \n
    \n );\n }\n}\n\nexport default ContextFilter;\n","import React from 'react';\nimport ChannelList from './ChannelList';\nimport ContextFilter from './ContextFilter';\nimport styles from './ContextPanel.css';\n\nconst ContextPanel = ({ channels, joinConversation }) => (\n
    \n

    Status

    \n \n \n
    \n);\n\nexport default ContextPanel;\n","import React from 'react';\n\nconst StatusLogo = () => (\n \n \n)\n\nexport default StatusLogo\n","import React from 'react';\n\nconst JSLogo = () => (\n \n \n \n \n)\n\nexport default JSLogo;\n","import React from 'react';\nimport StatusLogo from './status-logo';\nimport JSLogo from './js-logo';\n\nconst StatusJSLogo = () => (\n
    \n \n
    \n \n
    \n
    \n)\n\nexport default StatusJSLogo;\n","import React from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport TextField from '@material-ui/core/TextField';\nimport Button from '@material-ui/core/Button';\nimport { Formik } from 'formik';\nimport { func } from 'prop-types';\nimport { isNull } from 'lodash';\nimport StatusJSLogo from '../images/statusjs-logo';\n\nconst containerStyle = {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-evenly',\n height: '100vh',\n width: '50%'\n};\nconst Login = ({ setupKeyringController, keyStore, wipeKeyStore, connect }) => (\n \n\n {\n const { password, seed } = values;\n setupKeyringController(password, seed)\n .catch(err => {\n setFieldError(\"password\", err.message)\n });\n resetForm();\n }}\n >\n {({\n values,\n errors,\n handleChange,\n handleBlur,\n handleSubmit\n }) => (\n
    \n \n\n
    \n Note: This is a proof of concept, and an alpha version. There will be bugs. If you you're looking for something more stable try the status desktop app.\n
    known issues:\n
    - Desktop Chrome only for now. There is an UI issue in firefox which causes the page to reload.\n
    - Reportedly works on android mobile browsers but not on ios (to be confirmed). In theory it should work on any webrtc enabled browser.\n
    - Direct chats and chat history is currently disabled.\n
    \n\n \n\n
    or for dev purposes:
    \n {isNull(keyStore) && }\n \n {!isNull(keyStore) && }\n \n )}\n \n \n);\n\nLogin.propTypes = {\n setupKeyringController: func.isRequired,\n wipeKeyStore: func.isRequired,\n connect: func.isRequired\n};\n\nexport default Login;\n","export class User {\n constructor(pubkey, username) {\n this.pubkey = pubkey;\n this.username = username;\n this.online = false;\n this.lastSeen = 0;\n }\n}\n","import KeyringController from 'eth-keyring-controller';\nimport Store from './store';\n\nconst store = new Store({ configName: 'keyManagement', defaults: { vault: null } });\nexport const createVault = async (password, mnemonic) => {\n const keyRingController = new KeyringController({});\n const controller = await keyRingController.createNewVaultAndRestore(password, mnemonic);\n const vault = keyRingController.store.getState();\n storeKeyData(JSON.stringify(vault));\n return keyRingController;\n}\n\nexport const restoreVault = async (password) => {\n const keyStore = JSON.parse(getKeyData());\n const keyRingController = new KeyringController({\n initState: keyStore\n });\n const controller = await keyRingController.submitPassword(password);\n return keyRingController;\n}\n\nexport const getKeyData = () => store.get('vault');\nexport const storeKeyData = vault => {\n store.set('vault', vault);\n}\nexport const wipeVault = () => { store.set('vault', null); }\n","export default class Store {\n constructor(opts) {}\n\n get(key) {\n return localStorage.getItem(key);\n }\n\n set(key, val) {\n localStorage.setItem(key, val);\n }\n}\n","import React from 'react';\nimport { css } from 'react-emotion';\nimport { BounceLoader, GridLoader } from 'react-spinners';\n\nconst containerStyle = { display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh', margin: '0 30% 0 30%' };\nexport const FullScreenLoader = () => (\n
    \n \n
    \n)\n\nexport const FullScreenGridLoader = () => (\n
    \n \n
    \n)\n\n","export const openBrowserWindow = url => {\n window.open(url, '_blank', 'nodeIntegration=no');\n}\n\nexport const addWindowEventListeners = (sendMessage) => {\n const verbose = window.statusVerbose\n window.addEventListener('message', function (msg) {\n if(window.statusVerbose) console.log('message', msg)\n if (msg.source === window.parent && window.statusVerbose) {\n console.log(msg.data)\n }\n\n if (msg.data && msg.data.type && msg.data.type === 'whisperMsg') {\n sendMessage(msg.data.msg)\n }\n })\n}\n","// @flow\nimport React, { PureComponent, Fragment } from 'react';\nimport StatusJS from 'status-js-api';\nimport Murmur from 'murmur-client';\nimport IPFS from 'ipfs';\nimport uuid from 'uuid/v4';\nimport { isNil } from 'lodash';\nimport Grid from '@material-ui/core/Grid';\nimport ChatRoom from './ChatRoom';\nimport ContextPanel from './ContextPanel';\nimport Login from './Login';\nimport { User } from '../utils/actors';\nimport { ChatContext } from '../context';\nimport { isContactCode } from '../utils/parsers';\nimport { getKeyData, createVault, restoreVault, wipeVault } from '../utils/keyManagement';\nimport { FullScreenLoader } from './Loaders';\nimport { openBrowserWindow, addWindowEventListeners } from '../utils/windows';\n\nconst typingNotificationsTimestamp = {};\n\n\nconst DEFAULT_CHANNEL = \"status-js\";\nconst URL = \"ws://localhost:8546\";\nconst status = new StatusJS();\n\ntype Props = {};\n\nexport default class Home extends PureComponent {\n props: Props;\n\n state = {\n messages: { [DEFAULT_CHANNEL]: [] },\n users: {},\n channels: {\n [DEFAULT_CHANNEL]: { users: {} }\n },\n currentChannel: DEFAULT_CHANNEL,\n usersTyping: { [DEFAULT_CHANNEL]: [] },\n identity: {},\n loading: false,\n keyStore: getKeyData()\n };\n\n componentDidMount() {\n this.connectMurMur();\n this.ipfs = new IPFS();\n }\n\n componentWillUnmount() {\n clearInterval(this.pingInterval);\n this.ipfs.shutdown();\n }\n\n connect = async (account) => {\n if (!account) {\n this.setState({ loading: true });\n status.connectToProvider(this.server.provider, null);\n return this.onConnect();\n }\n\n this.keyringController.exportAccount(account)\n .then(key => { status.connect(URL, `0x${key}`) })\n .then(() => { this.onConnect() })\n };\n\n connectMurMur() {\n this.server = new Murmur({\n protocols: [\"libp2p\"],\n // signalServer: { host: '104.248.64.24', port: '9090', protocol: 'ws' },\n signalServers: [\n \"/dns4/cryptolife.status.im/tcp/443/wss/p2p-webrtc-star\"\n ],\n bootnodes: []\n });\n this.server.start();\n }\n\n onConnect = () => {\n const { currentChannel } = this.state;\n this.joinChannel(currentChannel);\n this.pingChannel();\n this.createOnUserMessageHandler();\n //TODO store ref to clear on componentWillUnmount\n addWindowEventListeners(this.sendMessage);\n setTimeout(() => {\n this.getMyIdentities();\n // Uncomment to test signing to status channels\n //this.openBrowser('http://localhost:3000/sign-and-verify-message/sign');\n }, 1500);\n }\n\n openBrowser = (url) => {\n openBrowserWindow(url);\n }\n\n pingChannel = (channelName) => {\n const { currentChannel } = this.state;\n this.pingInterval = setInterval(() => {\n status.sendJsonMessage(channelName || currentChannel, {type: \"ping\"});\n }, 5 * 1000)\n }\n\n setupKeyringController = async (password, mnemonic) => {\n const { keyStore } = this.state;\n if (!keyStore) {\n this.keyringController = await createVault(password, mnemonic);\n } else {\n try {\n this.keyringController = await restoreVault(password);\n } catch(err) {\n throw err;\n }\n }\n this.setState({ loading: true });\n const accounts = await this.keyringController.getAccounts();\n this.connect(accounts[0]);\n }\n\n wipeKeyStore = () => {\n wipeVault();\n this.setState({ keyStore: null });\n }\n\n setActiveChannel = channelName => {\n this.setState({ currentChannel: channelName, });\n }\n\n joinConversation = contact => {\n const { joinChannel, addDirectMessage } = this;\n if (isContactCode(contact)) {\n addDirectMessage(contact)\n } else {\n joinChannel(contact)\n }\n }\n\n addDirectMessage = contactCode => {\n status.addContact(contactCode, () => {\n this.addConversationEntry(contactCode);\n })\n }\n\n addConversationEntry = (code, changeChannel = true) => {\n const { channels, currentChannel } = this.state;\n this.setState({\n currentChannel: changeChannel ? code : currentChannel,\n channels: {\n ...channels,\n [code]: { users: {} }\n }\n })\n }\n\n joinChannel = channelName => {\n status.joinChat(channelName, () => {\n this.addConversationEntry(channelName);\n console.log(`joined channel ${channelName}`);\n status.onMessage(channelName, (err, data) => {\n const msg = JSON.parse(data.payload)[1][0];\n\n if (JSON.parse(data.payload)[1][1] === 'content/json') {\n return this.handleProtocolMessages(channelName, data);\n }\n const message = { username: data.username, message: msg, pubkey: data.data.sig, data };\n this.setState((prevState) => {\n const existing = prevState.messages[channelName];\n return {\n messages: {\n ...prevState.messages,\n [channelName]: existing ? [ ...existing, message ] : [ message ]\n }\n }\n })\n });\n this.pingChannel(channelName);\n });\n }\n\n createOnUserMessageHandler = () => {\n status.onUserMessage((err, res) => {\n if (res) {\n const payload = JSON.parse(res.payload);\n const msg = payload[1][0];\n const sender = res.data.sig;\n const message = { username: res.username, message: msg, data: res };\n this.setState((prevState) => {\n const existing = prevState.messages[sender];\n return {\n messages: {\n ...prevState.messages,\n [sender]: existing ? [ ...existing, message ] : [ message ]\n },\n channels: {\n ...prevState.channels,\n [sender]: { username: res.username, users: {} }\n }\n }\n })\n }\n });\n }\n\n sendMessage = message => {\n const { currentChannel } = this.state;\n status.sendMessage(currentChannel, message);\n }\n\n addUserToChannel = (channelName, user) => {\n const { channels } = this.state;\n const channel = { ...channels[channelName] };\n channel.users[user.pubkey] = user;\n this.setState({ channels: { ...channels, [channelName]: channel }});\n }\n\n getChannel = channelName => {\n const { channels } = this.state;\n return channels.find(c => c.name === channelName);\n }\n\n getMyIdentities = async () => {\n const publicKey = await status.getPublicKey();\n const username = await status.getUserName(publicKey);\n this.setState({\n identity: { publicKey, username },\n loading: false\n })\n\n }\n\n handleProtocolMessages = (channelName, data) => {\n const { identity: { publicKey } } = this.state\n const msg = JSON.parse(JSON.parse(data.payload)[1][0]);\n const fromUser = data.data.sig;\n\n if (msg.type === 'ping') {\n const user = this.addOrUpdateUserKey(fromUser, data.username);\n this.addUserToChannel(channelName, user);\n }\n\n if (msg.type === 'typing' && fromUser !== publicKey) {\n this.setState(prevState => ({\n usersTyping: {\n ...prevState.usersTyping,\n [channelName]: {\n [fromUser]: (new Date().getTime())\n }\n }\n }))\n }\n }\n\n addOrUpdateUserKey = (pubkey, username) => {\n const user = new User(pubkey, username);\n user.lastSeen = (new Date().getTime());\n user.online = true;\n this.setState(prevState => ({\n users: {\n ...prevState.users,\n [pubkey]: user\n }\n }))\n return user;\n }\n\n typingEvent = () => {\n const { currentChannel } = this.state;\n const now = (new Date().getTime());\n\n if (!typingNotificationsTimestamp[currentChannel]) {\n typingNotificationsTimestamp[currentChannel] = { lastEvent: 0 }\n }\n if (typingNotificationsTimestamp[currentChannel].lastEvent === 0 || now - typingNotificationsTimestamp[currentChannel].lastEvent > 3*1000) {;\n typingNotificationsTimestamp[currentChannel].lastEvent = now;\n status.sendJsonMessage(currentChannel, {type: \"typing\"});\n }\n }\n\n render() {\n const { messages, channels, currentChannel, users, usersTyping, identity, loading, keyStore } = this.state;\n const channelUsers = channels[currentChannel].users;\n const { setActiveChannel, setupKeyringController, wipeKeyStore, connect, ipfs } = this;\n const chatContext = { setActiveChannel, currentChannel, users, channels };\n\n return (\n \n {loading\n ? \n : \n {!identity.publicKey\n ? \n :
    \n \n {!isNil(channels) &&\n }\n \n \n \n \n
    }\n
    }\n
    \n );\n }\n}\n","import React, { Component } from 'react';\nimport Home from './components/Home'\nimport logo from './logo.svg';\n\nclass App extends Component {\n render() {\n return \n }\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read http://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit http://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See http://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""} \ No newline at end of file diff --git a/src/components/Login.js b/src/components/Login.js index cb549c1..3e53dbe 100644 --- a/src/components/Login.js +++ b/src/components/Login.js @@ -22,6 +22,7 @@ const Login = ({ setupKeyringController, keyStore, wipeKeyStore, connect }) => ( direction="column" style={{ height: '100%' }} > + { @@ -42,6 +43,20 @@ const Login = ({ setupKeyringController, keyStore, wipeKeyStore, connect }) => ( }) => (
    + +
    + Note: This is a proof of concept, and an alpha version. There will be bugs. If you you're looking for something more stable try the status desktop app. +
    known issues: +
    - Desktop Chrome only for now. There is an UI issue in firefox which causes the page to reload. +
    - Reportedly works on android mobile browsers but not on ios (to be confirmed). In theory it should work on any webrtc enabled browser. +
    - Direct chats and chat history is currently disabled. +
    + + + +
    or for dev purposes:
    {isNull(keyStore) && ( onBlur={handleBlur} onChange={handleChange} /> - {!isNull(keyStore) && }