partially dependencies updated
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"316.prod.js","mappings":"qkNASA,MAAMA,UAA6BC,IAAAA,cACjCC,WAAAA,CAAYC,GACVC,MAAMD,GAENE,KAAKC,UAAY,GACjB,MAAM,kBAAEC,GAAsBJ,EAAMK,KACpCC,EAAeC,QAAQC,IACPA,EAAGC,KAAKC,MAAM,KACtBH,QAAQI,IACZT,KAAKC,UAAUS,KAAK,CAClBH,KAAME,EAAKE,OACXC,KAAMN,EAAGM,KACTC,MAAMC,EAAAA,EAAAA,IAAUR,EAAGM,MACnBG,KAAMb,EAAkBI,EAAGM,KAAM,CAACI,KAAM,iBAK9ChB,KAAKC,UAAUgB,KAAK,CAACC,EAAGC,IAAMD,EAAEH,KAAKK,cAAcD,EAAEJ,MACvD,CAEAM,iBAAAA,GACMrB,KAAKsB,aACPtB,KAAKsB,YAAYC,eAAe,CAACC,MAAO,SAAUC,OAAQ,WAE9D,CAEAC,MAAAA,GACE,MAAMzB,EAAY,GACZ0B,EAAW3B,KAAKF,MAAM6B,UAAY,KAYxC,OAXA3B,KAAKC,UAAUI,QAAQ,CAACuB,EAAGC,KACzB,MAAMC,EAASF,EAAEhB,MAAQe,EAAW,YAAc,GAClD1B,EAAUS,KAAKd,IAAAA,cAAA,MAAImC,UAAWD,EAAOE,IAAKH,EACxCI,IAAKA,IAAYL,EAAEhB,MAAQe,IAAW3B,KAAKsB,YAAcW,IACzDC,QAASC,GAAKnC,KAAKF,MAAMsC,SAASR,EAAEhB,KAAMgB,EAAErB,OAC5CX,IAAAA,cAAA,QAAMmC,UAAU,gBAAgBH,EAAEf,MAClCjB,IAAAA,cAAA,QAAMmC,UAAU,WAAU,IAAOH,EAAEb,MACnCnB,IAAAA,cAAA,QAAMmC,UAAU,aAAY,KAAQH,EAAErB,UAKxCX,IAAAA,cAAA,OAAKmC,UAAU,mBAAmBD,MAAO,CAACO,OAAQ,UAChDzC,IAAAA,cAAA,MAAImC,UAAU,0BACX9B,GAIT,EAGF,WAAeqC,EAAAA,EAAAA,YAAW3C,E","sources":["webpack://tinode-webapp/./src/widgets/phone-country-selector.jsx"],"sourcesContent":["// Selector for country dialing code.\n\nimport React from 'react';\nimport { injectIntl } from 'react-intl';\n\nimport * as dcodes from '../dcodes.json';\n\nimport { flagEmoji } from '../lib/strformat';\n\nclass PhoneCountrySelector extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.countries = [];\n const { formatDisplayName } = props.intl;\n dcodes.default.forEach(dc => {\n const parts = dc.dial.split(',');\n parts.forEach(part => {\n this.countries.push({\n dial: part.trim(),\n code: dc.code,\n flag: flagEmoji(dc.code),\n name: formatDisplayName(dc.code, {type: 'region'})\n });\n });\n });\n\n this.countries.sort((a, b) => a.name.localeCompare(b.name));\n }\n\n componentDidMount() {\n if (this.selectedRef) {\n this.selectedRef.scrollIntoView({block: 'center', inline: 'nearest'});\n }\n }\n\n render() {\n const countries = [];\n const selected = this.props.selected || 'US';\n this.countries.forEach((c, idx) => {\n const style = (c.code == selected ? 'selected ' : '');\n countries.push(<li className={style} key={idx}\n ref={ref => {if (c.code == selected) {this.selectedRef = ref}}}\n onClick={_ => this.props.onSubmit(c.code, c.dial)}>\n <span className=\"country-flag\">{c.flag}</span>\n <span className=\"country\"> {c.name}</span>\n <span className=\"dial-code\"> +{c.dial}</span>\n </li>);\n });\n\n return (\n <div className=\"scrollable-panel\" style={{height: '30rem'}}>\n <ul className=\"phone-country-selector\">\n {countries}\n </ul>\n </div>\n );\n }\n}\n\nexport default injectIntl(PhoneCountrySelector);\n"],"names":["PhoneCountrySelector","React","constructor","props","super","this","countries","formatDisplayName","intl","dcodes","forEach","dc","dial","split","part","push","trim","code","flag","flagEmoji","name","type","sort","a","b","localeCompare","componentDidMount","selectedRef","scrollIntoView","block","inline","render","selected","c","idx","style","className","key","ref","onClick","_","onSubmit","height","injectIntl"],"ignoreList":[],"sourceRoot":""}
|
||||
{"version":3,"file":"316.prod.js","mappings":"wLASA,MAAMA,UAA6BC,IAAA,cACjC,WAAAC,CAAYC,GACVC,MAAMD,GAENE,KAAKC,UAAY,GACjB,MAAMC,kBAAEA,GAAsBJ,EAAMK,KACpCC,EAAeC,QAAQC,IACPA,EAAGC,KAAKC,MAAM,KACtBH,QAAQI,IACZT,KAAKC,UAAUS,KAAK,CAClBH,KAAME,EAAKE,OACXC,KAAMN,EAAGM,KACTC,MAAM,EAAAC,EAAAC,IAAUT,EAAGM,MACnBI,KAAMd,EAAkBI,EAAGM,KAAM,CAACK,KAAM,iBAK9CjB,KAAKC,UAAUiB,KAAK,CAACC,EAAGC,IAAMD,EAAEH,KAAKK,cAAcD,EAAEJ,MACvD,CAEA,iBAAAM,GACMtB,KAAKuB,aACPvB,KAAKuB,YAAYC,eAAe,CAACC,MAAO,SAAUC,OAAQ,WAE9D,CAEA,MAAAC,GACE,MAAM1B,EAAY,GACZ2B,EAAW5B,KAAKF,MAAM8B,UAAY,KAYxC,OAXA5B,KAAKC,UAAUI,QAAQ,CAACwB,EAAGC,KACzB,MAAMC,EAASF,EAAEjB,MAAQgB,EAAW,YAAc,GAClD3B,EAAUS,MAAK,EAAAsB,EAAAC,QAAA,MAAIC,UAAWH,EAC5BI,IAAKA,IAAYN,EAAEjB,MAAQgB,IAAW5B,KAAKuB,YAAcY,IACzDC,QAASC,GAAKrC,KAAKF,MAAMwC,SAAST,EAAEjB,KAAMiB,EAAEtB,MAAMgC,SAAA,EAClD,EAAAP,EAAAC,QAAA,QAAMC,UAAU,eAAcK,SAAEV,EAAEhB,WAAI,OACtC,EAAAmB,EAAAC,QAAA,QAAMC,UAAU,UAASK,SAAA,CAAC,IAAOV,EAAEb,YAAI,OACvC,EAAAgB,EAAAC,QAAA,QAAMC,UAAU,YAAWK,SAAA,CAAC,KAAQV,EAAEtB,YAAI,QALFuB,GAAG,OAU7C,EAAAE,EAAAC,QAAA,OAAKC,UAAU,mBAAmBH,MAAO,CAACS,OAAQ,SAASD,UACzD,EAAAP,EAAAC,QAAA,MAAIC,UAAU,yBAAwBK,SACnCtC,QAAS,YACP,KAGX,EAGFwC,EAAA,SAAe,EAAAC,EAAAC,YAAWhD","sources":["webpack://tinode-webapp/./src/widgets/phone-country-selector.jsx"],"sourcesContent":["// Selector for country dialing code.\n\nimport React from 'react';\nimport { injectIntl } from 'react-intl';\n\nimport * as dcodes from '../dcodes.json';\n\nimport { flagEmoji } from '../lib/strformat';\n\nclass PhoneCountrySelector extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.countries = [];\n const { formatDisplayName } = props.intl;\n dcodes.default.forEach(dc => {\n const parts = dc.dial.split(',');\n parts.forEach(part => {\n this.countries.push({\n dial: part.trim(),\n code: dc.code,\n flag: flagEmoji(dc.code),\n name: formatDisplayName(dc.code, {type: 'region'})\n });\n });\n });\n\n this.countries.sort((a, b) => a.name.localeCompare(b.name));\n }\n\n componentDidMount() {\n if (this.selectedRef) {\n this.selectedRef.scrollIntoView({block: 'center', inline: 'nearest'});\n }\n }\n\n render() {\n const countries = [];\n const selected = this.props.selected || 'US';\n this.countries.forEach((c, idx) => {\n const style = (c.code == selected ? 'selected ' : '');\n countries.push(<li className={style} key={idx}\n ref={ref => {if (c.code == selected) {this.selectedRef = ref}}}\n onClick={_ => this.props.onSubmit(c.code, c.dial)}>\n <span className=\"country-flag\">{c.flag}</span>\n <span className=\"country\"> {c.name}</span>\n <span className=\"dial-code\"> +{c.dial}</span>\n </li>);\n });\n\n return (\n <div className=\"scrollable-panel\" style={{height: '30rem'}}>\n <ul className=\"phone-country-selector\">\n {countries}\n </ul>\n </div>\n );\n }\n}\n\nexport default injectIntl(PhoneCountrySelector);\n"],"names":["PhoneCountrySelector","react__WEBPACK_IMPORTED_MODULE_0___default","constructor","props","super","this","countries","formatDisplayName","intl","_dcodes_json__WEBPACK_IMPORTED_MODULE_2__","forEach","dc","dial","split","part","push","trim","code","flag","_lib_strformat__WEBPACK_IMPORTED_MODULE_3__","lb","name","type","sort","a","b","localeCompare","componentDidMount","selectedRef","scrollIntoView","block","inline","render","selected","c","idx","style","react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__","jsxDEV","className","ref","onClick","_","onSubmit","children","height","__webpack_exports__","react_intl__WEBPACK_IMPORTED_MODULE_1__","injectIntl"],"sourceRoot":""}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,2 +1,2 @@
|
||||
"use strict";(self.webpackChunktinode_webapp=self.webpackChunktinode_webapp||[]).push([[371],{6371:function(e,t,n){n.r(t);var i=n(1594),o=n.n(i),s=n(8181),r=n(1725),a=n(8589);const l=(0,s.defineMessages)({unrecognized_video_format:{id:"unrecognized_video_format",defaultMessage:[{type:0,value:"Format of this video is not recognized"}]}});class d extends o().PureComponent{constructor(e){super(e),this.videoRef=o().createRef(),this.handleSendVideo=this.handleSendVideo.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){this.props.onSendMessage||(e.preventDefault(),"Escape"===e.key&&this.props.onClose())}handleSendVideo(e){this.props.onClose();const t={width:this.videoRef.current.videoWidth,height:this.videoRef.current.videoHeight,duration:1e3*this.videoRef.current.duration|0,mime:this.props.content.mime,name:this.props.content.filename};if(0==t.width||0==t.height)return void this.props.onError(this.props.intl.formatMessage(l.unrecognized_video_format),"err");const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const i=n.getContext("2d");i.drawImage(this.videoRef.current,0,0,n.width,n.height),i.canvas.toBlob(n=>this.props.onSendMessage(e,this.props.content.blob,n,t),"image/jpeg",.75)}render(){if(!this.props.content)return null;const e=this.props.content.width||"-",t=this.props.content.height||"-",n=this.props.onSendMessage?"nodownload":"",i=!this.props.onSendMessage;return o().createElement("div",{id:"image-preview"},o().createElement("div",{id:"preview-caption-panel"},o().createElement("span",null,this.props.content.filename),o().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()}},o().createElement("i",{className:"material-icons gray"},"close"))),o().createElement("div",{id:"image-preview-container"},o().createElement("video",{className:"image-preview",controls:!0,controlsList:n,disablePictureInPicture:!0,ref:this.videoRef,autoPlay:i,src:this.props.tinode.authorizeURL(this.props.content.url),poster:this.props.content.preview,alt:this.props.content.filename})),this.props.onSendMessage?o().createElement(r.A,{messagePrompt:"add_image_caption",acceptBlank:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendVideo,onError:this.props.onError}):o().createElement("div",{id:"image-preview-footer"},o().createElement("div",null,o().createElement("div",null,o().createElement("b",null,o().createElement(s.FormattedMessage,{id:"label_file_name",defaultMessage:[{type:0,value:"File name:"}]}))),o().createElement("div",null,o().createElement("span",{title:this.props.content.filename},this.props.content.filename))),o().createElement("div",null,o().createElement("div",null,o().createElement("b",null,o().createElement(s.FormattedMessage,{id:"label_content_type",defaultMessage:[{type:0,value:"Content type:"}]}))),o().createElement("div",null,this.props.content.type)),o().createElement("div",null,o().createElement("div",null,o().createElement("b",null,o().createElement(s.FormattedMessage,{id:"label_size",defaultMessage:[{type:0,value:"Size:"}]}))),o().createElement("div",null,e," × ",t," px; ",(0,a.lX)(this.props.content.size)))))}}t.default=(0,s.injectIntl)(d)}}]);
|
||||
"use strict";(self.webpackChunktinode_webapp=self.webpackChunktinode_webapp||[]).push([[371],{6371:function(e,i,n){n.r(i);var o=n(1594),t=n.n(o),s=n(8181),d=n(1725),r=n(8589),a=n(5446);const p=(0,s.defineMessages)({unrecognized_video_format:{id:"unrecognized_video_format",defaultMessage:"Format of this video is not recognized",description:"Error message when uploaded video is invalid"}});class h extends t().PureComponent{constructor(e){super(e),this.videoRef=t().createRef(),this.handleSendVideo=this.handleSendVideo.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){this.props.onSendMessage||(e.preventDefault(),"Escape"===e.key&&this.props.onClose())}handleSendVideo(e){this.props.onClose();const i={width:this.videoRef.current.videoWidth,height:this.videoRef.current.videoHeight,duration:1e3*this.videoRef.current.duration|0,mime:this.props.content.mime,name:this.props.content.filename};if(0==i.width||0==i.height)return void this.props.onError(this.props.intl.formatMessage(p.unrecognized_video_format),"err");const n=document.createElement("canvas");n.width=i.width,n.height=i.height;const o=n.getContext("2d");o.drawImage(this.videoRef.current,0,0,n.width,n.height),o.canvas.toBlob(n=>this.props.onSendMessage(e,this.props.content.blob,n,i),"image/jpeg",.75)}render(){if(!this.props.content)return null;const e=this.props.content.width||"-",i=this.props.content.height||"-",n=this.props.onSendMessage?"nodownload":"",o=!this.props.onSendMessage;return(0,a.jsxDEV)("div",{id:"image-preview",children:[(0,a.jsxDEV)("div",{id:"preview-caption-panel",children:[(0,a.jsxDEV)("span",{children:this.props.content.filename},void 0,!1),(0,a.jsxDEV)("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()},children:(0,a.jsxDEV)("i",{className:"material-icons gray",children:"close"},void 0,!1)},void 0,!1)]},void 0,!0),(0,a.jsxDEV)("div",{id:"image-preview-container",children:(0,a.jsxDEV)("video",{className:"image-preview",controls:!0,controlsList:n,disablePictureInPicture:!0,ref:this.videoRef,autoPlay:o,src:this.props.tinode.authorizeURL(this.props.content.url),poster:this.props.content.preview,alt:this.props.content.filename},void 0,!1)},void 0,!1),this.props.onSendMessage?(0,a.jsxDEV)(d.A,{messagePrompt:"add_image_caption",acceptBlank:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendVideo,onError:this.props.onError},void 0,!1):(0,a.jsxDEV)("div",{id:"image-preview-footer",children:[(0,a.jsxDEV)("div",{children:[(0,a.jsxDEV)("div",{children:(0,a.jsxDEV)("b",{children:(0,a.jsxDEV)(s.FormattedMessage,{id:"label_file_name",defaultMessage:"File name:",description:"Label for a file name"},void 0,!1)},void 0,!1)},void 0,!1),(0,a.jsxDEV)("div",{children:(0,a.jsxDEV)("span",{title:this.props.content.filename,children:this.props.content.filename},void 0,!1)},void 0,!1)]},void 0,!0),(0,a.jsxDEV)("div",{children:[(0,a.jsxDEV)("div",{children:(0,a.jsxDEV)("b",{children:(0,a.jsxDEV)(s.FormattedMessage,{id:"label_content_type",defaultMessage:"Content type:",description:"Label for file content type (mime)"},void 0,!1)},void 0,!1)},void 0,!1),(0,a.jsxDEV)("div",{children:this.props.content.type},void 0,!1)]},void 0,!0),(0,a.jsxDEV)("div",{children:[(0,a.jsxDEV)("div",{children:(0,a.jsxDEV)("b",{children:(0,a.jsxDEV)(s.FormattedMessage,{id:"label_size",defaultMessage:"Size:",description:"Label for file size"},void 0,!1)},void 0,!1)},void 0,!1),(0,a.jsxDEV)("div",{children:[e," × ",i," px; ",(0,r.lX)(this.props.content.size)]},void 0,!0)]},void 0,!0)]},void 0,!0)]},void 0,!0)}}i.default=(0,s.injectIntl)(h)}}]);
|
||||
//# sourceMappingURL=371.prod.js.map
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,2 +1,2 @@
|
||||
"use strict";(self.webpackChunktinode_webapp=self.webpackChunktinode_webapp||[]).push([[472],{4472:function(e,t,n){n.r(t),n.d(t,{default:function(){return r}});var a=n(1594),l=n.n(a),s=n(8181),o=n(1725),i=n(8589);class r extends l().PureComponent{constructor(e){super(e),this.handleSendDoc=this.handleSendDoc.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){e.preventDefault(),"Escape"===e.key&&this.props.onClose()}handleSendDoc(e){this.props.onClose(),this.props.onSendMessage(this.props.content.file)}render(){return this.props.content?l().createElement("div",{id:"image-preview"},l().createElement("div",{id:"preview-caption-panel"},l().createElement("span",null,this.props.content.name),l().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()}},l().createElement("i",{className:"material-icons gray"},"close"))),l().createElement("div",{id:"image-preview-container"},l().createElement("div",{className:"doc-card"},l().createElement("i",{className:"material-icons gray"},function(e){const t={default:"insert_drive_file",image:"image",text:"description",video:"theaters"};return t[e]||t[(e||"").split("/")[0]]||t.default}(this.props.content.type)),l().createElement("div",null,l().createElement("b",null,l().createElement(s.FormattedMessage,{id:"label_file_name",defaultMessage:[{type:0,value:"File name:"}]}))," ",(0,i.Tu)(this.props.content.name,24)||"-"),l().createElement("div",null,l().createElement("b",null,l().createElement(s.FormattedMessage,{id:"label_content_type",defaultMessage:[{type:0,value:"Content type:"}]}))," ",this.props.content.type||"application/octet-stream"),l().createElement("div",null,l().createElement("b",null,l().createElement(s.FormattedMessage,{id:"label_size",defaultMessage:[{type:0,value:"Size:"}]}))," ",(0,i.lX)(this.props.content.size)))),l().createElement(o.A,{noInput:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendDoc,onError:this.props.onError})):null}}}}]);
|
||||
"use strict";(self.webpackChunktinode_webapp=self.webpackChunktinode_webapp||[]).push([[472],{4472:function(e,n,i){i.r(n),i.d(n,{default:function(){return p}});var s=i(1594),t=i.n(s),o=i(8181),d=i(1725),r=i(8589),a=i(5446);function l(e){const n={default:"insert_drive_file",image:"image",text:"description",video:"theaters"};return n[e]||n[(e||"").split("/")[0]]||n.default}class p extends t().PureComponent{constructor(e){super(e),this.handleSendDoc=this.handleSendDoc.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){e.preventDefault(),"Escape"===e.key&&this.props.onClose()}handleSendDoc(e){this.props.onClose(),this.props.onSendMessage(this.props.content.file)}render(){return this.props.content?(0,a.jsxDEV)("div",{id:"image-preview",children:[(0,a.jsxDEV)("div",{id:"preview-caption-panel",children:[(0,a.jsxDEV)("span",{children:this.props.content.name},void 0,!1),(0,a.jsxDEV)("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()},children:(0,a.jsxDEV)("i",{className:"material-icons gray",children:"close"},void 0,!1)},void 0,!1)]},void 0,!0),(0,a.jsxDEV)("div",{id:"image-preview-container",children:(0,a.jsxDEV)("div",{className:"doc-card",children:[(0,a.jsxDEV)("i",{className:"material-icons gray",children:l(this.props.content.type)},void 0,!1),(0,a.jsxDEV)("div",{children:[(0,a.jsxDEV)("b",{children:(0,a.jsxDEV)(o.FormattedMessage,{id:"label_file_name",defaultMessage:"File name:",description:"Label for a file name"},void 0,!1)},void 0,!1)," ",(0,r.Tu)(this.props.content.name,24)||"-"]},void 0,!0),(0,a.jsxDEV)("div",{children:[(0,a.jsxDEV)("b",{children:(0,a.jsxDEV)(o.FormattedMessage,{id:"label_content_type",defaultMessage:"Content type:",description:"Label for file content type (mime)"},void 0,!1)},void 0,!1)," ",this.props.content.type||"application/octet-stream"]},void 0,!0),(0,a.jsxDEV)("div",{children:[(0,a.jsxDEV)("b",{children:(0,a.jsxDEV)(o.FormattedMessage,{id:"label_size",defaultMessage:"Size:",description:"Label for file size"},void 0,!1)},void 0,!1)," ",(0,r.lX)(this.props.content.size)]},void 0,!0)]},void 0,!0)},void 0,!1),(0,a.jsxDEV)(d.A,{noInput:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendDoc,onError:this.props.onError},void 0,!1)]},void 0,!0):null}}}}]);
|
||||
//# sourceMappingURL=472.prod.js.map
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+2
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,2 +1,2 @@
|
||||
"use strict";(self.webpackChunktinode_webapp=self.webpackChunktinode_webapp||[]).push([[827],{3827:function(e,t,a){a.r(t),a.d(t,{default:function(){return p}});var l=a(1594),s=a.n(l),r=a(8181),n=a(7151),i=a(9027),d=a(3540),c=a(1781);class p extends s().PureComponent{constructor(e){super(e);const t=(0,d.MC)(this.props.wallpaper),a=(0,d.t7)(this.props.wallpaper);this.state={tab:t||i.S.type,selectedType:t||i.S.type,wallpaper:a||c[i.S.type][i.S.index].name,blur:0|this.props.wallpaperBlur},this.blurValues=[0,1,2,4,8,16],this.handleTabClick=this.handleTabClick.bind(this),this.handleWallpaperSelected=this.handleWallpaperSelected.bind(this),this.handleBlurChanged=this.handleBlurChanged.bind(this),this.hasChanged=this.hasChanged.bind(this)}handleTabClick(e){e.preventDefault(),n.A.navigateTo(n.A.addUrlParam(window.location.hash,"tab",e.currentTarget.dataset.id)),this.setState({tab:e.currentTarget.dataset.id})}handleWallpaperSelected(e){let t,a,l;if(e)e.preventDefault(),a=this.state.tab,t=e.currentTarget.dataset.id,l="patt"==a?0:this.state.blur;else{if(!this.hasChanged())return;a=i.S.type,t=i.S.index,l=0}const s=c[a][t].name,r="patt"==a?c[a][t].size:0;this.setState({tab:a,wallpaper:s,selectedType:a,blur:l}),this.props.onWallpaperSelected(`../${i.S.path}${s}`,r,this.blurValues[l])}handleBlurChanged(e){e.preventDefault();const t=e.currentTarget.value;this.setState({blur:t}),"img"==this.state.selectedType&&this.props.onWallpaperSelected(`../${i.S.path}${this.state.wallpaper}`,0,this.blurValues[t])}hasChanged(){return this.state.selectedType!=i.S.type||this.state.wallpaper!=c[i.S.type][i.S.index].name||0!=this.state.blur}render(){return s().createElement("div",{className:"flex-column"},s().createElement("div",{className:"panel-form-row"+(this.hasChanged()?" clean-clickable":"")},s().createElement("a",{className:"flat-button"+(this.hasChanged()?"":" disabled"),onClick:()=>this.handleWallpaperSelected(null)},s().createElement("i",{className:"material-icons"},"undo")," ",s().createElement(r.FormattedMessage,{id:"button_restore",defaultMessage:[{type:0,value:"Restore default"}]}))),s().createElement("ul",{className:"tabbar"},s().createElement("li",{className:"patt"===this.state.tab?"active":null},s().createElement("a",{href:"#","data-id":"patt",onClick:this.handleTabClick},s().createElement(r.FormattedMessage,{id:"tabtitle_pattern",defaultMessage:[{type:0,value:"pattern"}]}))),s().createElement("li",{className:"img"===this.state.tab?"active":null},s().createElement("a",{href:"#","data-id":"img",onClick:this.handleTabClick},s().createElement(r.FormattedMessage,{id:"tabtitle_image",defaultMessage:[{type:0,value:"image"}]})))),s().createElement("div",{id:"settings-form",className:"scrollable-panel"},"patt"===this.state.tab?s().createElement("div",{className:"image-grid"},c.patt.map((e,t)=>{const a=this.state.wallpaper===e.name?" selected":"",l="dark"==this.props.colorSchema?"inverted":null;return s().createElement("div",{key:t,"data-id":t,className:`image-grid-cell${a}`,onClick:this.handleWallpaperSelected},s().createElement("img",{src:i.S.path+e.name,alt:e.name,className:l,style:{width:`${e.size}px`,height:`${e.size}px`}}))})):s().createElement(s().Fragment,null,s().createElement("div",{className:"panel-form-column"},s().createElement("div",{className:"panel-form-row"},s().createElement("label",{className:"small"},s().createElement(r.FormattedMessage,{id:"label_blur_wallpaper",defaultMessage:[{type:0,value:"Blur:"}]}))),s().createElement("div",{className:"panel-form-row"},s().createElement("input",{type:"range",id:"blur",name:"blur",min:"0",max:"5",step:"1",value:this.state.blur,onChange:this.handleBlurChanged}))),s().createElement("div",{className:"image-grid"},c.img.map((e,t)=>{const a=this.state.wallpaper===e.name?" selected":"";return s().createElement("div",{key:t,"data-id":t,className:`image-grid-cell${a}`,onClick:this.handleWallpaperSelected},s().createElement("img",{src:i.S.path+e.pr,alt:e.name,style:{width:"100%",height:"100%"}}))})))))}}}}]);
|
||||
"use strict";(self.webpackChunktinode_webapp=self.webpackChunktinode_webapp||[]).push([[827],{3827:function(e,a,t){t.r(a),t.d(a,{default:function(){return c}});var s=t(1594),l=t.n(s),i=t(8181),d=t(7151),r=t(9027),n=t(3540),h=t(1781),p=t(5446);class c extends l().PureComponent{constructor(e){super(e);const a=(0,n.MC)(this.props.wallpaper),t=(0,n.t7)(this.props.wallpaper);this.state={tab:a||r.S.type,selectedType:a||r.S.type,wallpaper:t||h[r.S.type][r.S.index].name,blur:0|this.props.wallpaperBlur},this.blurValues=[0,1,2,4,8,16],this.handleTabClick=this.handleTabClick.bind(this),this.handleWallpaperSelected=this.handleWallpaperSelected.bind(this),this.handleBlurChanged=this.handleBlurChanged.bind(this),this.hasChanged=this.hasChanged.bind(this)}handleTabClick(e){e.preventDefault(),d.A.navigateTo(d.A.addUrlParam(window.location.hash,"tab",e.currentTarget.dataset.id)),this.setState({tab:e.currentTarget.dataset.id})}handleWallpaperSelected(e){let a,t,s;if(e)e.preventDefault(),t=this.state.tab,a=e.currentTarget.dataset.id,s="patt"==t?0:this.state.blur;else{if(!this.hasChanged())return;t=r.S.type,a=r.S.index,s=0}const l=h[t][a].name,i="patt"==t?h[t][a].size:0;this.setState({tab:t,wallpaper:l,selectedType:t,blur:s}),this.props.onWallpaperSelected(`../${r.S.path}${l}`,i,this.blurValues[s])}handleBlurChanged(e){e.preventDefault();const a=e.currentTarget.value;this.setState({blur:a}),"img"==this.state.selectedType&&this.props.onWallpaperSelected(`../${r.S.path}${this.state.wallpaper}`,0,this.blurValues[a])}hasChanged(){return this.state.selectedType!=r.S.type||this.state.wallpaper!=h[r.S.type][r.S.index].name||0!=this.state.blur}render(){return(0,p.jsxDEV)("div",{className:"flex-column",children:[(0,p.jsxDEV)("div",{className:"panel-form-row"+(this.hasChanged()?" clean-clickable":""),children:(0,p.jsxDEV)("a",{className:"flat-button"+(this.hasChanged()?"":" disabled"),onClick:()=>this.handleWallpaperSelected(null),children:[(0,p.jsxDEV)("i",{className:"material-icons",children:"undo"},void 0,!1)," ",(0,p.jsxDEV)(i.FormattedMessage,{id:"button_restore",defaultMessage:"Restore default",description:"Reset setting to default"},void 0,!1)]},void 0,!0)},void 0,!1),(0,p.jsxDEV)("ul",{className:"tabbar",children:[(0,p.jsxDEV)("li",{className:"patt"===this.state.tab?"active":null,children:(0,p.jsxDEV)("a",{href:"#","data-id":"patt",onClick:this.handleTabClick,children:(0,p.jsxDEV)(i.FormattedMessage,{id:"tabtitle_pattern",defaultMessage:"pattern",description:"Tab title Pattern"},void 0,!1)},void 0,!1)},void 0,!1),(0,p.jsxDEV)("li",{className:"img"===this.state.tab?"active":null,children:(0,p.jsxDEV)("a",{href:"#","data-id":"img",onClick:this.handleTabClick,children:(0,p.jsxDEV)(i.FormattedMessage,{id:"tabtitle_image",defaultMessage:"image",description:"Tab title Image"},void 0,!1)},void 0,!1)},void 0,!1)]},void 0,!0),(0,p.jsxDEV)("div",{id:"settings-form",className:"scrollable-panel",children:"patt"===this.state.tab?(0,p.jsxDEV)("div",{className:"image-grid",children:h.patt.map((e,a)=>{const t=this.state.wallpaper===e.name?" selected":"",s="dark"==this.props.colorSchema?"inverted":null;return(0,p.jsxDEV)("div",{"data-id":a,className:`image-grid-cell${t}`,onClick:this.handleWallpaperSelected,children:(0,p.jsxDEV)("img",{src:r.S.path+e.name,alt:e.name,className:s,style:{width:`${e.size}px`,height:`${e.size}px`}},void 0,!1)},a,!1)})},void 0,!1):(0,p.jsxDEV)(p.Fragment,{children:[(0,p.jsxDEV)("div",{className:"panel-form-column",children:[(0,p.jsxDEV)("div",{className:"panel-form-row",children:(0,p.jsxDEV)("label",{className:"small",children:(0,p.jsxDEV)(i.FormattedMessage,{id:"label_blur_wallpaper",defaultMessage:"Blur:",description:"Label adjusting blur amount"},void 0,!1)},void 0,!1)},void 0,!1),(0,p.jsxDEV)("div",{className:"panel-form-row",children:(0,p.jsxDEV)("input",{type:"range",id:"blur",name:"blur",min:"0",max:"5",step:"1",value:this.state.blur,onChange:this.handleBlurChanged},void 0,!1)},void 0,!1)]},void 0,!0),(0,p.jsxDEV)("div",{className:"image-grid",children:h.img.map((e,a)=>{const t=this.state.wallpaper===e.name?" selected":"";return(0,p.jsxDEV)("div",{"data-id":a,className:`image-grid-cell${t}`,onClick:this.handleWallpaperSelected,children:(0,p.jsxDEV)("img",{src:r.S.path+e.pr,alt:e.name,style:{width:"100%",height:"100%"}},void 0,!1)},a,!1)})},void 0,!1)]},void 0,!0)},void 0,!1)]},void 0,!0)}}}}]);
|
||||
//# sourceMappingURL=827.prod.js.map
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,2 +1,2 @@
|
||||
"use strict";(self.webpackChunktinode_webapp=self.webpackChunktinode_webapp||[]).push([[889],{8889:function(e,t,n){n.r(t),n.d(t,{default:function(){return d}});var s=n(1594),i=n.n(s),a=n(8181),l=n(1725),o=n(9027),r=n(6110),p=n(8589),h=n(3540);class d extends i().PureComponent{constructor(e){super(e),this.state={width:0,height:0},this.handleSendImage=this.handleSendImage.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){this.props.onSendMessage||(e.preventDefault(),"Escape"===e.key&&this.props.onClose())}assignWidth(e){if(e&&!this.state.width){const t=e.getBoundingClientRect();this.setState({width:0|t.width,height:0|t.height})}}handleSendImage(e){this.props.onClose(),this.props.onSendMessage(e,this.props.content.blob)}render(){if(!this.props.content)return null;const e=(0,r.ae)(this.props.content.width,this.props.content.height,this.state.width,this.state.height,!1),t=e?{width:e.dstWidth+"px",height:e.dstHeight+"px"}:this.props.content.width>this.props.content.height?{width:"100%"}:{height:"100%"};t.maxWidth="100%",t.maxHeight="100%";const n=Math.max((this.state.width/o.JS/1.5|0)-2,12),s=(0,p.Tu)(this.props.content.filename,n)||"-",d=this.props.content.width||"-",c=this.props.content.height||"-",m=(0,h.FH)(this.props.content.url);return i().createElement("div",{id:"image-preview"},i().createElement("div",{id:"preview-caption-panel"},this.props.onSendMessage?i().createElement("span",null,s):i().createElement("a",{href:m,download:this.props.content.filename},i().createElement("i",{className:"material-icons"},"file_download")," ",i().createElement(a.FormattedMessage,{id:"download_action",defaultMessage:[{type:0,value:"download"}]})),i().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()}},i().createElement("i",{className:"material-icons gray"},"close"))),i().createElement("div",{id:"image-preview-container",ref:e=>this.assignWidth(e)},i().createElement("img",{src:this.props.content.url,style:t,className:"image-preview",alt:this.props.content.filename})),this.props.onSendMessage?i().createElement(l.A,{messagePrompt:"add_image_caption",acceptBlank:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendImage,onError:this.props.onError}):i().createElement("div",{id:"image-preview-footer"},i().createElement("div",null,i().createElement("div",null,i().createElement("b",null,i().createElement(a.FormattedMessage,{id:"label_file_name",defaultMessage:[{type:0,value:"File name:"}]}))),i().createElement("div",null,i().createElement("span",{title:this.props.content.filename},s))),i().createElement("div",null,i().createElement("div",null,i().createElement("b",null,i().createElement(a.FormattedMessage,{id:"label_content_type",defaultMessage:[{type:0,value:"Content type:"}]}))),i().createElement("div",null,this.props.content.type)),i().createElement("div",null,i().createElement("div",null,i().createElement("b",null,i().createElement(a.FormattedMessage,{id:"label_size",defaultMessage:[{type:0,value:"Size:"}]}))),i().createElement("div",null,d," × ",c," px; ",(0,p.lX)(this.props.content.size)))))}}}}]);
|
||||
"use strict";(self.webpackChunktinode_webapp=self.webpackChunktinode_webapp||[]).push([[889],{8889:function(e,i,t){t.r(i),t.d(i,{default:function(){return p}});var s=t(1594),n=t.n(s),o=t(8181),d=t(1725),h=(t(9027),t(6110)),a=t(8589),r=t(3540),l=t(5446);class p extends n().PureComponent{constructor(e){super(e),this.state={width:0,height:0},this.handleSendImage=this.handleSendImage.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){this.props.onSendMessage||(e.preventDefault(),"Escape"===e.key&&this.props.onClose())}assignWidth(e){if(e&&!this.state.width){const i=e.getBoundingClientRect();this.setState({width:0|i.width,height:0|i.height})}}handleSendImage(e){this.props.onClose(),this.props.onSendMessage(e,this.props.content.blob)}render(){if(!this.props.content)return null;const e=(0,h.ae)(this.props.content.width,this.props.content.height,this.state.width,this.state.height,!1),i=e?{width:e.dstWidth+"px",height:e.dstHeight+"px"}:this.props.content.width>this.props.content.height?{width:"100%"}:{height:"100%"};i.maxWidth="100%",i.maxHeight="100%";const t=Math.max((this.state.width/13/1.5|0)-2,12),s=(0,a.Tu)(this.props.content.filename,t)||"-",n=this.props.content.width||"-",p=this.props.content.height||"-",c=(0,r.FH)(this.props.content.url);return(0,l.jsxDEV)("div",{id:"image-preview",children:[(0,l.jsxDEV)("div",{id:"preview-caption-panel",children:[this.props.onSendMessage?(0,l.jsxDEV)("span",{children:s},void 0,!1):(0,l.jsxDEV)("a",{href:c,download:this.props.content.filename,children:[(0,l.jsxDEV)("i",{className:"material-icons",children:"file_download"},void 0,!1)," ",(0,l.jsxDEV)(o.FormattedMessage,{id:"download_action",defaultMessage:"download",description:"Call to action [download]"},void 0,!1)]},void 0,!0),(0,l.jsxDEV)("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()},children:(0,l.jsxDEV)("i",{className:"material-icons gray",children:"close"},void 0,!1)},void 0,!1)]},void 0,!0),(0,l.jsxDEV)("div",{id:"image-preview-container",ref:e=>this.assignWidth(e),children:(0,l.jsxDEV)("img",{src:this.props.content.url,style:i,className:"image-preview",alt:this.props.content.filename},void 0,!1)},void 0,!1),this.props.onSendMessage?(0,l.jsxDEV)(d.A,{messagePrompt:"add_image_caption",acceptBlank:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendImage,onError:this.props.onError},void 0,!1):(0,l.jsxDEV)("div",{id:"image-preview-footer",children:[(0,l.jsxDEV)("div",{children:[(0,l.jsxDEV)("div",{children:(0,l.jsxDEV)("b",{children:(0,l.jsxDEV)(o.FormattedMessage,{id:"label_file_name",defaultMessage:"File name:",description:"Label for a file name"},void 0,!1)},void 0,!1)},void 0,!1),(0,l.jsxDEV)("div",{children:(0,l.jsxDEV)("span",{title:this.props.content.filename,children:s},void 0,!1)},void 0,!1)]},void 0,!0),(0,l.jsxDEV)("div",{children:[(0,l.jsxDEV)("div",{children:(0,l.jsxDEV)("b",{children:(0,l.jsxDEV)(o.FormattedMessage,{id:"label_content_type",defaultMessage:"Content type:",description:"Label for file content type (mime)"},void 0,!1)},void 0,!1)},void 0,!1),(0,l.jsxDEV)("div",{children:this.props.content.type},void 0,!1)]},void 0,!0),(0,l.jsxDEV)("div",{children:[(0,l.jsxDEV)("div",{children:(0,l.jsxDEV)("b",{children:(0,l.jsxDEV)(o.FormattedMessage,{id:"label_size",defaultMessage:"Size:",description:"Label for file size"},void 0,!1)},void 0,!1)},void 0,!1),(0,l.jsxDEV)("div",{children:[n," × ",p," px; ",(0,a.lX)(this.props.content.size)]},void 0,!0)]},void 0,!0)]},void 0,!0)]},void 0,!0)}}}}]);
|
||||
//# sourceMappingURL=889.prod.js.map
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,2 +1,2 @@
|
||||
"use strict";(self.webpackChunktinode_webapp=self.webpackChunktinode_webapp||[]).push([[942],{8942:function(e,t,a){a.r(t),a.d(t,{default:function(){return p}});var n=a(1594),l=a.n(n),s=a(8181),r=a(8892),o=a(1725),c=a(6904),d=a(4532),i=a(6110);const m=(0,s.defineMessages)({unknown_name:{id:"unknown_name",defaultMessage:[{type:0,value:"Unknown"}]}});class p extends l().PureComponent{constructor(e){super(e),this.state={content:e.content.object},e.content.object||(0,i.QJ)(e.content.file).then(e=>{this.setState({content:e})}),this.handleSendCard=this.handleSendCard.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){e.preventDefault(),"Escape"===e.key&&this.props.onClose()}handleSendCard(){this.props.onClose(),this.props.onSendMessage(this.props.content)}render(){const e=this.state.content,t=d.TheCard.getFn(e),a=d.TheCard.getPhotoUrl(e)||null,n=e?.note,i=d.TheCard.getOrg(e),p=d.TheCard.getComm(e,"email")||[],u=d.TheCard.getComm(e,"tel")||[],h=d.TheCard.getComm(e,"tinode")||[],E=d.TheCard.getComm(e,"http")||[],v=[];return p.forEach((e,t)=>{const a=Array.isArray(e.des)?e.des.join(", "):"";v.push(l().createElement("div",{className:"group quoted",key:`email-${t}`},l().createElement("tt",null,e.value),l().createElement("span",{className:"small gray"}," ",a?`(${a})`:"")))}),u.forEach((e,t)=>{let a=e.value;try{const t=(0,r.L)(e.value);a=t?t.formatInternational():e.value}catch(e){}const n=Array.isArray(e.des)?e.des.join(", "):"";v.push(l().createElement("div",{className:"group quoted",key:`tel-${t}`},l().createElement("tt",null,a),l().createElement("span",{className:"small gray"}," ",n?`(${n})`:"")))}),h.forEach((e,t)=>{const a=Array.isArray(e.des)?e.des.join(", "):"";v.push(l().createElement("div",{className:"group quoted",key:`tinode-${t}`},l().createElement("tt",null,e.value),l().createElement("span",{className:"small gray"}," ",a?`(${a})`:"")))}),E.forEach((e,t)=>{const a=Array.isArray(e.des)?e.des.join(", "):"";v.push(l().createElement("div",{className:"group quoted",key:`url-${t}`},l().createElement("tt",null,e.value),l().createElement("span",{className:"small gray"}," ",a?`(${a})`:"")))}),l().createElement("div",{id:"image-preview"},l().createElement("div",{id:"preview-caption-panel"},l().createElement("span",null,l().createElement(s.FormattedMessage,{id:"label_contact_card",defaultMessage:[{type:0,value:"Contact Card"}]})),l().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()}},l().createElement("i",{className:"material-icons gray"},"close"))),l().createElement("div",{id:"image-preview-container"},l().createElement("div",{className:"doc-card"},l().createElement("div",{className:"panel-form-column"},l().createElement("center",null,l().createElement("div",{className:"avatar-box"},l().createElement(c.A,{authorizeURL:this.props.tinode.authorizeURL,avatar:a||!0,topic:"usrXXX123",title:t}))),l().createElement("div",{className:"group"},l().createElement("div",{className:"large ellipsized"},t||l().createElement(s.FormattedMessage,m.unknown_name))),i?l().createElement("div",{className:"group"},l().createElement("div",null,i)):null,n?l().createElement("div",{className:"group"},l().createElement("label",{className:"small"},l().createElement(s.FormattedMessage,{id:"label_description",defaultMessage:[{type:0,value:"Description"}]})),l().createElement("div",{className:"quoted"},n)):null,v.length>0?l().createElement("div",{className:"group"},l().createElement("label",{className:"small"},l().createElement(s.FormattedMessage,{id:"label_contacts",defaultMessage:[{type:0,value:"Contacts"}]})),v):null))),l().createElement(o.A,{noInput:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendCard,onError:this.props.onError}))}}}}]);
|
||||
"use strict";(self.webpackChunktinode_webapp=self.webpackChunktinode_webapp||[]).push([[942],{8942:function(e,s,n){n.r(s),n.d(s,{default:function(){return v}});var a=n(1594),i=n.n(a),o=n(8181),d=n(8892),t=n(1725),r=n(6904),l=n(4532),c=n(6110),h=n(5446);const p=(0,o.defineMessages)({unknown_name:{id:"unknown_name",defaultMessage:"Unknown",description:"Name to show when the name is missing"}});class v extends i().PureComponent{constructor(e){super(e),this.state={content:e.content.object},e.content.object||(0,c.QJ)(e.content.file).then(e=>{this.setState({content:e})}),this.handleSendCard=this.handleSendCard.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){e.preventDefault(),"Escape"===e.key&&this.props.onClose()}handleSendCard(){this.props.onClose(),this.props.onSendMessage(this.props.content)}render(){const e=this.state.content,s=l.TheCard.getFn(e),n=l.TheCard.getPhotoUrl(e)||null,a=e?.note,i=l.TheCard.getOrg(e),c=l.TheCard.getComm(e,"email")||[],v=l.TheCard.getComm(e,"tel")||[],m=l.TheCard.getComm(e,"tinode")||[],u=l.TheCard.getComm(e,"http")||[],D=[];return c.forEach((e,s)=>{const n=Array.isArray(e.des)?e.des.join(", "):"";D.push((0,h.jsxDEV)("div",{className:"group quoted",children:[(0,h.jsxDEV)("tt",{children:e.value},void 0,!1),(0,h.jsxDEV)("span",{className:"small gray",children:[" ",n?`(${n})`:""]},void 0,!0)]},`email-${s}`,!0))}),v.forEach((e,s)=>{let n=e.value;try{const s=(0,d.L)(e.value);n=s?s.formatInternational():e.value}catch(e){}const a=Array.isArray(e.des)?e.des.join(", "):"";D.push((0,h.jsxDEV)("div",{className:"group quoted",children:[(0,h.jsxDEV)("tt",{children:n},void 0,!1),(0,h.jsxDEV)("span",{className:"small gray",children:[" ",a?`(${a})`:""]},void 0,!0)]},`tel-${s}`,!0))}),m.forEach((e,s)=>{const n=Array.isArray(e.des)?e.des.join(", "):"";D.push((0,h.jsxDEV)("div",{className:"group quoted",children:[(0,h.jsxDEV)("tt",{children:e.value},void 0,!1),(0,h.jsxDEV)("span",{className:"small gray",children:[" ",n?`(${n})`:""]},void 0,!0)]},`tinode-${s}`,!0))}),u.forEach((e,s)=>{const n=Array.isArray(e.des)?e.des.join(", "):"";D.push((0,h.jsxDEV)("div",{className:"group quoted",children:[(0,h.jsxDEV)("tt",{children:e.value},void 0,!1),(0,h.jsxDEV)("span",{className:"small gray",children:[" ",n?`(${n})`:""]},void 0,!0)]},`url-${s}`,!0))}),(0,h.jsxDEV)("div",{id:"image-preview",children:[(0,h.jsxDEV)("div",{id:"preview-caption-panel",children:[(0,h.jsxDEV)("span",{children:(0,h.jsxDEV)(o.FormattedMessage,{id:"label_contact_card",defaultMessage:"Contact Card",description:"Label for contact card preview"},void 0,!1)},void 0,!1),(0,h.jsxDEV)("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()},children:(0,h.jsxDEV)("i",{className:"material-icons gray",children:"close"},void 0,!1)},void 0,!1)]},void 0,!0),(0,h.jsxDEV)("div",{id:"image-preview-container",children:(0,h.jsxDEV)("div",{className:"doc-card",children:(0,h.jsxDEV)("div",{className:"panel-form-column",children:[(0,h.jsxDEV)("center",{children:(0,h.jsxDEV)("div",{className:"avatar-box",children:(0,h.jsxDEV)(r.A,{authorizeURL:this.props.tinode.authorizeURL,avatar:n||!0,topic:"usrXXX123",title:s},void 0,!1)},void 0,!1)},void 0,!1),(0,h.jsxDEV)("div",{className:"group",children:(0,h.jsxDEV)("div",{className:"large ellipsized",children:s||(0,h.jsxDEV)(o.FormattedMessage,{...p.unknown_name},void 0,!1)},void 0,!1)},void 0,!1),i?(0,h.jsxDEV)("div",{className:"group",children:(0,h.jsxDEV)("div",{children:i},void 0,!1)},void 0,!1):null,a?(0,h.jsxDEV)("div",{className:"group",children:[(0,h.jsxDEV)("label",{className:"small",children:(0,h.jsxDEV)(o.FormattedMessage,{id:"label_description",defaultMessage:"Description",description:"Label for description of user or topic"},void 0,!1)},void 0,!1),(0,h.jsxDEV)("div",{className:"quoted",children:a},void 0,!1)]},void 0,!0):null,D.length>0?(0,h.jsxDEV)("div",{className:"group",children:[(0,h.jsxDEV)("label",{className:"small",children:(0,h.jsxDEV)(o.FormattedMessage,{id:"label_contacts",defaultMessage:"Contacts",description:"Label for contact information"},void 0,!1)},void 0,!1),D]},void 0,!0):null]},void 0,!0)},void 0,!1)},void 0,!1),(0,h.jsxDEV)(t.A,{noInput:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendCard,onError:this.props.onError},void 0,!1)]},void 0,!0)}}}}]);
|
||||
//# sourceMappingURL=942.prod.js.map
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+14028
-12556
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+2
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -15,6 +15,8 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/checkbox.jsx */ "./src/widgets/checkbox.jsx");
|
||||
/* harmony import */ var _widgets_in_place_edit_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widgets/in-place-edit.jsx */ "./src/widgets/in-place-edit.jsx");
|
||||
/* harmony import */ var _widgets_permissions_editor_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../widgets/permissions-editor.jsx */ "./src/widgets/permissions-editor.jsx");
|
||||
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -22,18 +24,14 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
const messages = (0,react_intl__WEBPACK_IMPORTED_MODULE_1__.defineMessages)({
|
||||
delete_account: {
|
||||
id: "delete_account",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Delete account"
|
||||
}]
|
||||
id: 'delete_account',
|
||||
defaultMessage: 'Delete account',
|
||||
description: 'Title for delete account warning'
|
||||
},
|
||||
delete_account_warning: {
|
||||
id: "delete_account_warning",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Are you sure you want to delete your account? It cannot be undone."
|
||||
}]
|
||||
id: 'delete_account_warning',
|
||||
defaultMessage: 'Are you sure you want to delete your account? It cannot be undone.',
|
||||
description: 'Warning message when deleting an account'
|
||||
}
|
||||
});
|
||||
class AccSecurityView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
|
||||
@@ -98,142 +96,153 @@ class AccSecurityView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Comp
|
||||
this.props.onShowAlert(formatMessage(messages.delete_account), formatMessage(messages.delete_account_warning), _ => this.props.onDeleteAccount(), null, true, null);
|
||||
}
|
||||
render() {
|
||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.state.showPermissionEditorFor ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_widgets_permissions_editor_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
||||
mode: this.state.editedPermissions,
|
||||
skip: "O",
|
||||
onSubmit: this.handlePermissionsChanged,
|
||||
onCancel: this.handleHidePermissionsEditor
|
||||
}) : react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "scrollable-panel"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "panel-form-column"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
|
||||
className: "small"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_password",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Password"
|
||||
}]
|
||||
})), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "password_unchanged_prompt",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Unchanged"
|
||||
}]
|
||||
}, password_unchanged => react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_widgets_in_place_edit_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
||||
placeholder: password_unchanged,
|
||||
type: "password",
|
||||
onFinished: this.handlePasswordUpdate
|
||||
})))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "hr"
|
||||
}), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "panel-form-row"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
|
||||
htmlFor: "incognito-mode"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_incognito_mode",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Incognito mode:"
|
||||
}]
|
||||
})), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
name: "incognito",
|
||||
id: "incognito-mode",
|
||||
checked: this.props.incognitoMode,
|
||||
onChange: this.handleCheckboxClick
|
||||
})), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "panel-form-row"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
||||
className: "small gray"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "incognito_mode_description",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Hide your online status and typing indicators."
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "hr"
|
||||
}), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "panel-form-column"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
className: "danger flat-button",
|
||||
onClick: e => {
|
||||
e.preventDefault();
|
||||
this.props.onLogout();
|
||||
}
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons"
|
||||
}, "exit_to_app"), " \xA0", react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "button_logout",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Logout"
|
||||
}]
|
||||
})), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
className: "danger flat-button",
|
||||
onClick: e => {
|
||||
this.handleDeleteAccount(e);
|
||||
}
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons"
|
||||
}, "delete"), " \xA0", react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "button_delete_account",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Delete account"
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "hr"
|
||||
}), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "panel-form-column"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
|
||||
className: "small"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_default_access_mode",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Default access mode:"
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "quoted"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, "Auth: ", react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tt", {
|
||||
className: "clickable",
|
||||
onClick: this.handleLaunchPermissionsEditor.bind(this, 'auth')
|
||||
}, this.state.auth)), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, "Anon: ", react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tt", {
|
||||
className: "clickable",
|
||||
onClick: this.handleLaunchPermissionsEditor.bind(this, 'anon')
|
||||
}, this.state.anon)))), this.state.blockedCount > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "hr"
|
||||
}), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "panel-form-row"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons"
|
||||
}, "block"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
className: "gray",
|
||||
onClick: e => {
|
||||
e.preventDefault();
|
||||
this.props.onShowBlocked();
|
||||
}
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "blocked_contacts_link",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Blocked contacts ("
|
||||
}, {
|
||||
"type": 1,
|
||||
"value": "count"
|
||||
}, {
|
||||
"type": 0,
|
||||
"value": ")"
|
||||
}],
|
||||
values: {
|
||||
count: this.state.blockedCount
|
||||
}
|
||||
})))) : null));
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
|
||||
children: this.state.showPermissionEditorFor ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(_widgets_permissions_editor_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
||||
mode: this.state.editedPermissions,
|
||||
skip: "O",
|
||||
onSubmit: this.handlePermissionsChanged,
|
||||
onCancel: this.handleHidePermissionsEditor
|
||||
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "scrollable-panel",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "panel-form-column",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("label", {
|
||||
className: "small",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_password",
|
||||
defaultMessage: "Password",
|
||||
description: "Label for password editing"
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "password_unchanged_prompt",
|
||||
defaultMessage: "Unchanged",
|
||||
description: "Message in editor while password is unchanged",
|
||||
children: password_unchanged => (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(_widgets_in_place_edit_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
||||
placeholder: password_unchanged,
|
||||
type: "password",
|
||||
onFinished: this.handlePasswordUpdate
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "hr"
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "panel-form-row",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("label", {
|
||||
htmlFor: "incognito-mode",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_incognito_mode",
|
||||
defaultMessage: "Incognito mode:",
|
||||
description: "Label for incognito mode toggle"
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(_widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
name: "incognito",
|
||||
id: "incognito-mode",
|
||||
checked: this.props.incognitoMode,
|
||||
onChange: this.handleCheckboxClick
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "panel-form-row",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("span", {
|
||||
className: "small gray",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "incognito_mode_description",
|
||||
defaultMessage: "Hide your online status and typing indicators.",
|
||||
description: "Description for incognito mode toggle"
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "hr"
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "panel-form-column",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
className: "danger flat-button",
|
||||
onClick: e => {
|
||||
e.preventDefault();
|
||||
this.props.onLogout();
|
||||
},
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("i", {
|
||||
className: "material-icons",
|
||||
children: "exit_to_app"
|
||||
}, void 0, false), " \xA0", (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "button_logout",
|
||||
defaultMessage: "Logout",
|
||||
description: "Button [Logout]"
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
className: "danger flat-button",
|
||||
onClick: e => {
|
||||
this.handleDeleteAccount(e);
|
||||
},
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("i", {
|
||||
className: "material-icons",
|
||||
children: "delete"
|
||||
}, void 0, false), " \xA0", (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "button_delete_account",
|
||||
defaultMessage: "Delete account",
|
||||
description: "Button [Delete account]"
|
||||
}, void 0, false)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "hr"
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "panel-form-column",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("label", {
|
||||
className: "small",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_default_access_mode",
|
||||
defaultMessage: "Default access mode:",
|
||||
description: "Label for default access mode"
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "quoted",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
children: ["Auth: ", (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("tt", {
|
||||
className: "clickable",
|
||||
onClick: this.handleLaunchPermissionsEditor.bind(this, 'auth'),
|
||||
children: this.state.auth
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
children: ["Anon: ", (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("tt", {
|
||||
className: "clickable",
|
||||
onClick: this.handleLaunchPermissionsEditor.bind(this, 'anon'),
|
||||
children: this.state.anon
|
||||
}, void 0, false)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true), this.state.blockedCount > 0 ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "hr"
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "panel-form-row",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("i", {
|
||||
className: "material-icons",
|
||||
children: "block"
|
||||
}, void 0, false), "\xA0", (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
className: "gray",
|
||||
onClick: e => {
|
||||
e.preventDefault();
|
||||
this.props.onShowBlocked();
|
||||
},
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "blocked_contacts_link",
|
||||
defaultMessage: "Blocked contacts ({count})",
|
||||
values: {
|
||||
count: this.state.blockedCount
|
||||
},
|
||||
description: "Blocked contacts link"
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true) : null]
|
||||
}, void 0, true)
|
||||
}, void 0, false);
|
||||
}
|
||||
}
|
||||
;
|
||||
@@ -255,6 +264,8 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./checkbox.jsx */ "./src/widgets/checkbox.jsx");
|
||||
/* harmony import */ var _contact_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contact.jsx */ "./src/widgets/contact.jsx");
|
||||
/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/blob-helpers.js */ "./src/lib/blob-helpers.js");
|
||||
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -262,108 +273,44 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
const messages = (0,react_intl__WEBPACK_IMPORTED_MODULE_1__.defineMessages)({
|
||||
joiner: {
|
||||
id: "permission_join",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Join ("
|
||||
}, {
|
||||
"type": 1,
|
||||
"value": "val"
|
||||
}, {
|
||||
"type": 0,
|
||||
"value": ")"
|
||||
}]
|
||||
id: 'permission_join',
|
||||
defaultMessage: "Join ({val})",
|
||||
description: 'Name of J permission'
|
||||
},
|
||||
reader: {
|
||||
id: "permission_read",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Read ("
|
||||
}, {
|
||||
"type": 1,
|
||||
"value": "val"
|
||||
}, {
|
||||
"type": 0,
|
||||
"value": ")"
|
||||
}]
|
||||
id: 'permission_read',
|
||||
defaultMessage: "Read ({val})",
|
||||
description: 'Name of R permission'
|
||||
},
|
||||
writer: {
|
||||
id: "permission_write",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Write ("
|
||||
}, {
|
||||
"type": 1,
|
||||
"value": "val"
|
||||
}, {
|
||||
"type": 0,
|
||||
"value": ")"
|
||||
}]
|
||||
id: 'permission_write',
|
||||
defaultMessage: "Write ({val})",
|
||||
description: 'Name of W permission'
|
||||
},
|
||||
preser: {
|
||||
id: "permission_pres",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Get notified ("
|
||||
}, {
|
||||
"type": 1,
|
||||
"value": "val"
|
||||
}, {
|
||||
"type": 0,
|
||||
"value": ")"
|
||||
}]
|
||||
id: 'permission_pres',
|
||||
defaultMessage: "Get notified ({val})",
|
||||
description: 'Name of P permission'
|
||||
},
|
||||
approver: {
|
||||
id: "permission_admin",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Approve ("
|
||||
}, {
|
||||
"type": 1,
|
||||
"value": "val"
|
||||
}, {
|
||||
"type": 0,
|
||||
"value": ")"
|
||||
}]
|
||||
id: 'permission_admin',
|
||||
defaultMessage: "Approve ({val})",
|
||||
description: 'Name of A permission'
|
||||
},
|
||||
sharer: {
|
||||
id: "permission_share",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Share ("
|
||||
}, {
|
||||
"type": 1,
|
||||
"value": "val"
|
||||
}, {
|
||||
"type": 0,
|
||||
"value": ")"
|
||||
}]
|
||||
id: 'permission_share',
|
||||
defaultMessage: "Share ({val})",
|
||||
description: 'Name of S permission'
|
||||
},
|
||||
deleter: {
|
||||
id: "permission_delete",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Delete ("
|
||||
}, {
|
||||
"type": 1,
|
||||
"value": "val"
|
||||
}, {
|
||||
"type": 0,
|
||||
"value": ")"
|
||||
}]
|
||||
id: 'permission_delete',
|
||||
defaultMessage: "Delete ({val})",
|
||||
description: 'Name of D permission'
|
||||
},
|
||||
owner: {
|
||||
id: "permission_owner",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Owner ("
|
||||
}, {
|
||||
"type": 1,
|
||||
"value": "val"
|
||||
}, {
|
||||
"type": 0,
|
||||
"value": ")"
|
||||
}]
|
||||
id: 'permission_owner',
|
||||
defaultMessage: "Owner ({val})",
|
||||
description: 'Name of O permission'
|
||||
}
|
||||
});
|
||||
class PermissionsEditor extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
|
||||
@@ -440,65 +387,80 @@ class PermissionsEditor extends (react__WEBPACK_IMPORTED_MODULE_0___default().Co
|
||||
if (skip.indexOf(c) >= 0 && mode.indexOf(c) < 0) {
|
||||
continue;
|
||||
}
|
||||
items.push(react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tr", {
|
||||
key: c
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("td", null, names[c]), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("td", {
|
||||
className: "checkbox"
|
||||
}, skip.indexOf(c) < 0 ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
name: c,
|
||||
checked: mode.indexOf(c) >= 0,
|
||||
onChange: this.handleChange
|
||||
}) : react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
name: c,
|
||||
checked: mode.indexOf(c) >= 0
|
||||
})), this.props.compare ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement("td", {
|
||||
className: "checkbox"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
name: c,
|
||||
checked: compare.indexOf(c) >= 0
|
||||
})) : null));
|
||||
items.push((0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("tr", {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("td", {
|
||||
children: names[c]
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("td", {
|
||||
className: "checkbox",
|
||||
children: skip.indexOf(c) < 0 ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
name: c,
|
||||
checked: mode.indexOf(c) >= 0,
|
||||
onChange: this.handleChange
|
||||
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
name: c,
|
||||
checked: mode.indexOf(c) >= 0
|
||||
}, void 0, false)
|
||||
}, void 0, false), this.props.compare ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("td", {
|
||||
className: "checkbox",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
name: c,
|
||||
checked: compare.indexOf(c) >= 0
|
||||
}, void 0, false)
|
||||
}, void 0, false) : null]
|
||||
}, c, true));
|
||||
}
|
||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "panel-form-column"
|
||||
}, this.props.userTitle ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", {
|
||||
className: "contact-box small"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_contact_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
||||
tinode: this.props.tinode,
|
||||
item: this.props.item,
|
||||
title: this.props.userTitle,
|
||||
small: true,
|
||||
avatar: (0,_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_4__.makeImageUrl)(this.props.userAvatar ? this.props.userAvatar : null)
|
||||
})) : null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
|
||||
className: "small"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "title_permissions",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Permissions"
|
||||
}]
|
||||
})), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("table", {
|
||||
className: "permission-editor"
|
||||
}, this.props.compare ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement("thead", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("th", null), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("th", null, this.props.modeTitle), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("th", null, this.props.compareTitle))) : null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tbody", null, items)), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("br", null), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "dialog-buttons"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
|
||||
className: "outline",
|
||||
onClick: this.handleCancel
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "button_cancel",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Cancel"
|
||||
}]
|
||||
})), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
|
||||
className: "primary",
|
||||
onClick: this.handleSubmit
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "button_ok",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "OK"
|
||||
}]
|
||||
}))));
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "panel-form-column",
|
||||
children: [this.props.userTitle ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("ul", {
|
||||
className: "contact-box small",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(_contact_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
||||
tinode: this.props.tinode,
|
||||
item: this.props.item,
|
||||
title: this.props.userTitle,
|
||||
small: true,
|
||||
avatar: (0,_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_4__.makeImageUrl)(this.props.userAvatar ? this.props.userAvatar : null)
|
||||
}, void 0, false)
|
||||
}, void 0, false) : null, (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("label", {
|
||||
className: "small",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "title_permissions",
|
||||
defaultMessage: "Permissions",
|
||||
description: "Section title"
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("table", {
|
||||
className: "permission-editor",
|
||||
children: [this.props.compare ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("thead", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("tr", {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("th", {}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("th", {
|
||||
children: this.props.modeTitle
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("th", {
|
||||
children: this.props.compareTitle
|
||||
}, void 0, false)]
|
||||
}, void 0, true)
|
||||
}, void 0, false) : null, (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("tbody", {
|
||||
children: items
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("br", {}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("div", {
|
||||
className: "dialog-buttons",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("button", {
|
||||
className: "outline",
|
||||
onClick: this.handleCancel,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "button_cancel",
|
||||
defaultMessage: "Cancel",
|
||||
description: "Button [Cancel]"
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("button", {
|
||||
className: "primary",
|
||||
onClick: this.handleSubmit,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "button_ok",
|
||||
defaultMessage: "OK",
|
||||
description: "Button [OK]"
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+783
-803
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+116
-104
@@ -19,6 +19,8 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config.js */ "./src/config.js");
|
||||
/* harmony import */ var _lib_utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/utils.js */ "./src/lib/utils.js");
|
||||
/* harmony import */ var _img_bkg_index_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../img/bkg/index.json */ "./img/bkg/index.json");
|
||||
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -88,110 +90,120 @@ class WallpapersView extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureC
|
||||
return this.state.selectedType != _config_js__WEBPACK_IMPORTED_MODULE_3__.WALLPAPER_DEFAULTS.type || this.state.wallpaper != _img_bkg_index_json__WEBPACK_IMPORTED_MODULE_5__[_config_js__WEBPACK_IMPORTED_MODULE_3__.WALLPAPER_DEFAULTS.type][_config_js__WEBPACK_IMPORTED_MODULE_3__.WALLPAPER_DEFAULTS.index].name || this.state.blur != 0;
|
||||
}
|
||||
render() {
|
||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "flex-column"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: `panel-form-row${this.hasChanged() ? ' clean-clickable' : ''}`
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
className: `flat-button${this.hasChanged() ? '' : ' disabled'}`,
|
||||
onClick: () => this.handleWallpaperSelected(null)
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons"
|
||||
}, "undo"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "button_restore",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Restore default"
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", {
|
||||
className: "tabbar"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", {
|
||||
className: this.state.tab === 'patt' ? 'active' : null
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
"data-id": "patt",
|
||||
onClick: this.handleTabClick
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "tabtitle_pattern",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "pattern"
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", {
|
||||
className: this.state.tab === 'img' ? 'active' : null
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
"data-id": "img",
|
||||
onClick: this.handleTabClick
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "tabtitle_image",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "image"
|
||||
}]
|
||||
})))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "settings-form",
|
||||
className: "scrollable-panel"
|
||||
}, this.state.tab === 'patt' ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "image-grid"
|
||||
}, _img_bkg_index_json__WEBPACK_IMPORTED_MODULE_5__.patt.map((img, idx) => {
|
||||
const selected = this.state.wallpaper === img.name ? ' selected' : '';
|
||||
const dark = this.props.colorSchema == 'dark' ? 'inverted' : null;
|
||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
key: idx,
|
||||
"data-id": idx,
|
||||
className: `image-grid-cell${selected}`,
|
||||
onClick: this.handleWallpaperSelected
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
|
||||
src: _config_js__WEBPACK_IMPORTED_MODULE_3__.WALLPAPER_DEFAULTS.path + img.name,
|
||||
alt: img.name,
|
||||
className: dark,
|
||||
style: {
|
||||
width: `${img.size}px`,
|
||||
height: `${img.size}px`
|
||||
}
|
||||
}));
|
||||
})) : react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "panel-form-column"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "panel-form-row"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
|
||||
className: "small"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_blur_wallpaper",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Blur:"
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "panel-form-row"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
|
||||
type: "range",
|
||||
id: "blur",
|
||||
name: "blur",
|
||||
min: "0",
|
||||
max: "5",
|
||||
step: "1",
|
||||
value: this.state.blur,
|
||||
onChange: this.handleBlurChanged
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "image-grid"
|
||||
}, _img_bkg_index_json__WEBPACK_IMPORTED_MODULE_5__.img.map((img, idx) => {
|
||||
const selected = this.state.wallpaper === img.name ? ' selected' : '';
|
||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
key: idx,
|
||||
"data-id": idx,
|
||||
className: `image-grid-cell${selected}`,
|
||||
onClick: this.handleWallpaperSelected
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
|
||||
src: _config_js__WEBPACK_IMPORTED_MODULE_3__.WALLPAPER_DEFAULTS.path + img.pr,
|
||||
alt: img.name,
|
||||
style: {
|
||||
width: '100%',
|
||||
height: '100%'
|
||||
}
|
||||
}));
|
||||
})))));
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: "flex-column",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: `panel-form-row${this.hasChanged() ? ' clean-clickable' : ''}`,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("a", {
|
||||
className: `flat-button${this.hasChanged() ? '' : ' disabled'}`,
|
||||
onClick: () => this.handleWallpaperSelected(null),
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("i", {
|
||||
className: "material-icons",
|
||||
children: "undo"
|
||||
}, void 0, false), "\xA0", (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "button_restore",
|
||||
defaultMessage: "Restore default",
|
||||
description: "Reset setting to default"
|
||||
}, void 0, false)]
|
||||
}, void 0, true)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("ul", {
|
||||
className: "tabbar",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("li", {
|
||||
className: this.state.tab === 'patt' ? 'active' : null,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
"data-id": "patt",
|
||||
onClick: this.handleTabClick,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "tabtitle_pattern",
|
||||
defaultMessage: "pattern",
|
||||
description: "Tab title Pattern"
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("li", {
|
||||
className: this.state.tab === 'img' ? 'active' : null,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
"data-id": "img",
|
||||
onClick: this.handleTabClick,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "tabtitle_image",
|
||||
defaultMessage: "image",
|
||||
description: "Tab title Image"
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
id: "settings-form",
|
||||
className: "scrollable-panel",
|
||||
children: this.state.tab === 'patt' ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: "image-grid",
|
||||
children: _img_bkg_index_json__WEBPACK_IMPORTED_MODULE_5__.patt.map((img, idx) => {
|
||||
const selected = this.state.wallpaper === img.name ? ' selected' : '';
|
||||
const dark = this.props.colorSchema == 'dark' ? 'inverted' : null;
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
"data-id": idx,
|
||||
className: `image-grid-cell${selected}`,
|
||||
onClick: this.handleWallpaperSelected,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("img", {
|
||||
src: _config_js__WEBPACK_IMPORTED_MODULE_3__.WALLPAPER_DEFAULTS.path + img.name,
|
||||
alt: img.name,
|
||||
className: dark,
|
||||
style: {
|
||||
width: `${img.size}px`,
|
||||
height: `${img.size}px`
|
||||
}
|
||||
}, void 0, false)
|
||||
}, idx, false);
|
||||
})
|
||||
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: "panel-form-column",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: "panel-form-row",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("label", {
|
||||
className: "small",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_blur_wallpaper",
|
||||
defaultMessage: "Blur:",
|
||||
description: "Label adjusting blur amount"
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: "panel-form-row",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("input", {
|
||||
type: "range",
|
||||
id: "blur",
|
||||
name: "blur",
|
||||
min: "0",
|
||||
max: "5",
|
||||
step: "1",
|
||||
value: this.state.blur,
|
||||
onChange: this.handleBlurChanged
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: "image-grid",
|
||||
children: _img_bkg_index_json__WEBPACK_IMPORTED_MODULE_5__.img.map((img, idx) => {
|
||||
const selected = this.state.wallpaper === img.name ? ' selected' : '';
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
"data-id": idx,
|
||||
className: `image-grid-cell${selected}`,
|
||||
onClick: this.handleWallpaperSelected,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("img", {
|
||||
src: _config_js__WEBPACK_IMPORTED_MODULE_3__.WALLPAPER_DEFAULTS.path + img.pr,
|
||||
alt: img.name,
|
||||
style: {
|
||||
width: '100%',
|
||||
height: '100%'
|
||||
}
|
||||
}, void 0, false)
|
||||
}, idx, false);
|
||||
})
|
||||
}, void 0, false)]
|
||||
}, void 0, true)
|
||||
}, void 0, false)]
|
||||
}, void 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -18,6 +18,8 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/blob-helpers.js */ "./src/lib/blob-helpers.js");
|
||||
/* harmony import */ var _lib_strformat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/strformat */ "./src/lib/strformat.js");
|
||||
/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../config.js */ "./src/config.js");
|
||||
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -39,39 +41,29 @@ const SAFARI_AUDIO_MIME_TYPE = 'audio/mp4';
|
||||
const AUDIO_MIME_TYPES = [DEFAULT_AUDIO_MIME_TYPE, SAFARI_AUDIO_MIME_TYPE, ''];
|
||||
const messages = (0,react_intl__WEBPACK_IMPORTED_MODULE_1__.defineMessages)({
|
||||
icon_title_delete: {
|
||||
id: "icon_title_delete",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Delete recording"
|
||||
}]
|
||||
id: 'icon_title_delete',
|
||||
defaultMessage: 'Delete recording',
|
||||
description: 'Icon tool tip for deleting recorded audio'
|
||||
},
|
||||
icon_title_pause: {
|
||||
id: "icon_title_pause",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Pause playback"
|
||||
}]
|
||||
id: 'icon_title_pause',
|
||||
defaultMessage: 'Pause playback',
|
||||
description: 'Icon tool tip for pausing audio playback'
|
||||
},
|
||||
icon_title_resume: {
|
||||
id: "icon_title_resume",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Resume playback"
|
||||
}]
|
||||
id: 'icon_title_resume',
|
||||
defaultMessage: 'Resume playback',
|
||||
description: 'Icon tool tip for resuming audio playback'
|
||||
},
|
||||
icon_title_send: {
|
||||
id: "icon_title_send",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Send message"
|
||||
}]
|
||||
id: 'icon_title_send',
|
||||
defaultMessage: 'Send message',
|
||||
description: 'Icon tool tip for sending a message'
|
||||
},
|
||||
failed_to_init_audio: {
|
||||
id: "failed_to_init_audio",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Failed to initialize audio recording"
|
||||
}]
|
||||
id: 'failed_to_init_audio',
|
||||
defaultMessage: 'Failed to initialize audio recording',
|
||||
description: 'Error message when audio is not available'
|
||||
}
|
||||
});
|
||||
class AudioRecorder extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComponent) {
|
||||
@@ -344,42 +336,52 @@ class AudioRecorder extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo
|
||||
formatMessage
|
||||
} = this.props.intl;
|
||||
const resumeClass = 'material-icons ' + (this.state.enabled ? 'red' : 'gray');
|
||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "audio"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
onClick: this.handleDelete,
|
||||
title: formatMessage(messages.icon_title_delete)
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons gray"
|
||||
}, "delete_outline")), this.state.recording ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement("canvas", {
|
||||
ref: this.canvasRef
|
||||
}) : react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_audio_player_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
src: this.state.blobUrl,
|
||||
preview: this.state.preview,
|
||||
duration: this.durationMillis,
|
||||
short: true
|
||||
}), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "duration"
|
||||
}, this.state.duration), this.state.recording ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
onClick: this.handlePause,
|
||||
title: formatMessage(messages.icon_title_pause)
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons"
|
||||
}, "pause_circle_outline")) : react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
onClick: this.handleResume,
|
||||
title: formatMessage(messages.icon_title_resume)
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: resumeClass
|
||||
}, "radio_button_checked")), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
onClick: this.handleDone,
|
||||
title: formatMessage(messages.icon_title_send)
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons"
|
||||
}, "send")));
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "audio",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
onClick: this.handleDelete,
|
||||
title: formatMessage(messages.icon_title_delete),
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("i", {
|
||||
className: "material-icons gray",
|
||||
children: "delete_outline"
|
||||
}, void 0, false)
|
||||
}, void 0, false), this.state.recording ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("canvas", {
|
||||
ref: this.canvasRef
|
||||
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(_audio_player_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
src: this.state.blobUrl,
|
||||
preview: this.state.preview,
|
||||
duration: this.durationMillis,
|
||||
short: true
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "duration",
|
||||
children: this.state.duration
|
||||
}, void 0, false), this.state.recording ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
onClick: this.handlePause,
|
||||
title: formatMessage(messages.icon_title_pause),
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("i", {
|
||||
className: "material-icons",
|
||||
children: "pause_circle_outline"
|
||||
}, void 0, false)
|
||||
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
onClick: this.handleResume,
|
||||
title: formatMessage(messages.icon_title_resume),
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("i", {
|
||||
className: resumeClass,
|
||||
children: "radio_button_checked"
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
onClick: this.handleDone,
|
||||
title: formatMessage(messages.icon_title_send),
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("i", {
|
||||
className: "material-icons",
|
||||
children: "send"
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true);
|
||||
}
|
||||
}
|
||||
/* harmony default export */ __webpack_exports__["default"] = ((0,react_intl__WEBPACK_IMPORTED_MODULE_1__.injectIntl)(AudioRecorder));
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -16,6 +16,8 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config.js */ "./src/config.js");
|
||||
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants.js */ "./src/constants.js");
|
||||
/* harmony import */ var _lib_strformat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/strformat.js */ "./src/lib/strformat.js");
|
||||
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -31,11 +33,9 @@ const VIDEO_MUTED_EVENT = 'video:muted';
|
||||
const VIDEO_UNMUTED_EVENT = 'video:unmuted';
|
||||
const messages = (0,react_intl__WEBPACK_IMPORTED_MODULE_1__.defineMessages)({
|
||||
already_in_call: {
|
||||
id: "already_in_call",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "You already in an ongoing call!"
|
||||
}]
|
||||
id: 'already_in_call',
|
||||
defaultMessage: 'You already in an ongoing call!',
|
||||
description: 'Error message when the user tried to accept a new call without finishing pervious one'
|
||||
}
|
||||
});
|
||||
class CallPanel extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComponent) {
|
||||
@@ -581,77 +581,97 @@ class CallPanel extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompon
|
||||
}
|
||||
const minimizedClass = this.props.minimized ? 'minimized' : null;
|
||||
const fullScreen = this.props.minimized ? 'fullscreen' : 'fullscreen_exit';
|
||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
id: "video-container",
|
||||
className: minimizedClass,
|
||||
ref: this.containerRef
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "video-container-panel"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "call-party self",
|
||||
disabled: this.state.audioOnly || this.props.minimized
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("video", {
|
||||
ref: this.localRef,
|
||||
autoPlay: true,
|
||||
muted: true,
|
||||
playsInline: true
|
||||
}), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "caller-name inactive"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "calls_you_label",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "You"
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "call-party peer",
|
||||
disabled: !remoteActive
|
||||
}, remoteActive ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("video", {
|
||||
ref: this.remoteRef,
|
||||
autoPlay: true,
|
||||
playsInline: true
|
||||
}), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "caller-name inactive"
|
||||
}, peerTitle)) : react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("audio", {
|
||||
ref: this.remoteRef,
|
||||
autoPlay: true
|
||||
}), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: `caller-card${pulseAnimation} draggable`
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "avatar-box"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_letter_tile_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
authorizeURL: this.props.tinode.authorizeURL,
|
||||
avatar: this.props.avatar,
|
||||
topic: this.props.topic,
|
||||
title: this.props.title
|
||||
})), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "caller-name"
|
||||
}, peerTitle))))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
|
||||
className: "full-screen",
|
||||
onClick: this.props.onToggleMinimize
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons"
|
||||
}, fullScreen)), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "controls",
|
||||
className: minimizedClass
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
|
||||
className: "danger",
|
||||
onClick: this.handleCloseClick
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons"
|
||||
}, "call_end")), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
|
||||
className: "secondary",
|
||||
onClick: this.handleToggleCameraClick,
|
||||
disabled: disabled
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons"
|
||||
}, videoIcon)), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
|
||||
className: "secondary",
|
||||
onClick: this.handleToggleMicClick,
|
||||
disabled: disabled
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons"
|
||||
}, audioIcon))));
|
||||
ref: this.containerRef,
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
id: "video-container-panel",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: "call-party self",
|
||||
disabled: this.state.audioOnly || this.props.minimized,
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("video", {
|
||||
ref: this.localRef,
|
||||
autoPlay: true,
|
||||
muted: true,
|
||||
playsInline: true
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: "caller-name inactive",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "calls_you_label",
|
||||
defaultMessage: "You",
|
||||
description: "Shown over the local video screen"
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: "call-party peer",
|
||||
disabled: !remoteActive,
|
||||
children: remoteActive ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("video", {
|
||||
ref: this.remoteRef,
|
||||
autoPlay: true,
|
||||
playsInline: true
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: "caller-name inactive",
|
||||
children: peerTitle
|
||||
}, void 0, false)]
|
||||
}, void 0, true) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("audio", {
|
||||
ref: this.remoteRef,
|
||||
autoPlay: true
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: `caller-card${pulseAnimation} draggable`,
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: "avatar-box",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)(_letter_tile_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
authorizeURL: this.props.tinode.authorizeURL,
|
||||
avatar: this.props.avatar,
|
||||
topic: this.props.topic,
|
||||
title: this.props.title
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
className: "caller-name",
|
||||
children: peerTitle
|
||||
}, void 0, false)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true)
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("button", {
|
||||
className: "full-screen",
|
||||
onClick: this.props.onToggleMinimize,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("i", {
|
||||
className: "material-icons",
|
||||
children: fullScreen
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
|
||||
id: "controls",
|
||||
className: minimizedClass,
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("button", {
|
||||
className: "danger",
|
||||
onClick: this.handleCloseClick,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("i", {
|
||||
className: "material-icons",
|
||||
children: "call_end"
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("button", {
|
||||
className: "secondary",
|
||||
onClick: this.handleToggleCameraClick,
|
||||
disabled: disabled,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("i", {
|
||||
className: "material-icons",
|
||||
children: videoIcon
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("button", {
|
||||
className: "secondary",
|
||||
onClick: this.handleToggleMicClick,
|
||||
disabled: disabled,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("i", {
|
||||
className: "material-icons",
|
||||
children: audioIcon
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -17,6 +17,8 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var _widgets_send_message_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/send-message.jsx */ "./src/widgets/send-message.jsx");
|
||||
/* harmony import */ var _lib_strformat_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/strformat.js */ "./src/lib/strformat.js");
|
||||
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -56,50 +58,65 @@ class DocPreview extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompo
|
||||
if (!this.props.content) {
|
||||
return null;
|
||||
}
|
||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "image-preview"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "preview-caption-panel"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, this.props.content.name), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
onClick: e => {
|
||||
e.preventDefault();
|
||||
this.props.onClose();
|
||||
}
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons gray"
|
||||
}, "close"))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "image-preview-container"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "doc-card"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons gray"
|
||||
}, iconFromMime(this.props.content.type)), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_file_name",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "File name:"
|
||||
}]
|
||||
})), " ", (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_3__.shortenFileName)(this.props.content.name, 24) || '-'), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_content_type",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Content type:"
|
||||
}]
|
||||
})), " ", this.props.content.type || 'application/octet-stream'), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_size",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Size:"
|
||||
}]
|
||||
})), " ", (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_3__.bytesToHumanSize)(this.props.content.size)))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_widgets_send_message_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
noInput: true,
|
||||
tinode: this.props.tinode,
|
||||
reply: this.props.reply,
|
||||
onCancelReply: this.props.onCancelReply,
|
||||
onSendMessage: this.handleSendDoc,
|
||||
onError: this.props.onError
|
||||
}));
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
id: "image-preview",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
id: "preview-caption-panel",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("span", {
|
||||
children: this.props.content.name
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
onClick: e => {
|
||||
e.preventDefault();
|
||||
this.props.onClose();
|
||||
},
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("i", {
|
||||
className: "material-icons gray",
|
||||
children: "close"
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
id: "image-preview-container",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
className: "doc-card",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("i", {
|
||||
className: "material-icons gray",
|
||||
children: iconFromMime(this.props.content.type)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("b", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_file_name",
|
||||
defaultMessage: "File name:",
|
||||
description: "Label for a file name"
|
||||
}, void 0, false)
|
||||
}, void 0, false), " ", (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_3__.shortenFileName)(this.props.content.name, 24) || '-']
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("b", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_content_type",
|
||||
defaultMessage: "Content type:",
|
||||
description: "Label for file content type (mime)"
|
||||
}, void 0, false)
|
||||
}, void 0, false), " ", this.props.content.type || 'application/octet-stream']
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("b", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_size",
|
||||
defaultMessage: "Size:",
|
||||
description: "Label for file size"
|
||||
}, void 0, false)
|
||||
}, void 0, false), " ", (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_3__.bytesToHumanSize)(this.props.content.size)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(_widgets_send_message_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
noInput: true,
|
||||
tinode: this.props.tinode,
|
||||
reply: this.props.reply,
|
||||
onCancelReply: this.props.onCancelReply,
|
||||
onSendMessage: this.handleSendDoc,
|
||||
onError: this.props.onError
|
||||
}, void 0, false)]
|
||||
}, void 0, true);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -20,6 +20,8 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/blob-helpers.js */ "./src/lib/blob-helpers.js");
|
||||
/* harmony import */ var _lib_strformat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/strformat.js */ "./src/lib/strformat.js");
|
||||
/* harmony import */ var _lib_utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/utils.js */ "./src/lib/utils.js");
|
||||
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -85,68 +87,95 @@ class ImagePreview extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCom
|
||||
const width = this.props.content.width || '-';
|
||||
const height = this.props.content.height || '-';
|
||||
const download_url = (0,_lib_utils_js__WEBPACK_IMPORTED_MODULE_6__.urlAsAttachment)(this.props.content.url);
|
||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "image-preview"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "preview-caption-panel"
|
||||
}, this.props.onSendMessage ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, fname) : react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: download_url,
|
||||
download: this.props.content.filename
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons"
|
||||
}, "file_download"), " ", react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "download_action",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "download"
|
||||
}]
|
||||
})), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
onClick: e => {
|
||||
e.preventDefault();
|
||||
this.props.onClose();
|
||||
}
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons gray"
|
||||
}, "close"))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "image-preview-container",
|
||||
ref: node => this.assignWidth(node)
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
|
||||
src: this.props.content.url,
|
||||
style: size,
|
||||
className: "image-preview",
|
||||
alt: this.props.content.filename
|
||||
})), this.props.onSendMessage ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_send_message_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
messagePrompt: "add_image_caption",
|
||||
acceptBlank: true,
|
||||
tinode: this.props.tinode,
|
||||
reply: this.props.reply,
|
||||
onCancelReply: this.props.onCancelReply,
|
||||
onSendMessage: this.handleSendImage,
|
||||
onError: this.props.onError
|
||||
}) : react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "image-preview-footer"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_file_name",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "File name:"
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
||||
title: this.props.content.filename
|
||||
}, fname))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_content_type",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Content type:"
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, this.props.content.type)), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_size",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Size:"
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, width, " \xD7 ", height, " px; ", (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_5__.bytesToHumanSize)(this.props.content.size)))));
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
id: "image-preview",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
id: "preview-caption-panel",
|
||||
children: [this.props.onSendMessage ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("span", {
|
||||
children: fname
|
||||
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("a", {
|
||||
href: download_url,
|
||||
download: this.props.content.filename,
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("i", {
|
||||
className: "material-icons",
|
||||
children: "file_download"
|
||||
}, void 0, false), " ", (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "download_action",
|
||||
defaultMessage: "download",
|
||||
description: "Call to action [download]"
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
onClick: e => {
|
||||
e.preventDefault();
|
||||
this.props.onClose();
|
||||
},
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("i", {
|
||||
className: "material-icons gray",
|
||||
children: "close"
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
id: "image-preview-container",
|
||||
ref: node => this.assignWidth(node),
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("img", {
|
||||
src: this.props.content.url,
|
||||
style: size,
|
||||
className: "image-preview",
|
||||
alt: this.props.content.filename
|
||||
}, void 0, false)
|
||||
}, void 0, false), this.props.onSendMessage ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(_send_message_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
messagePrompt: "add_image_caption",
|
||||
acceptBlank: true,
|
||||
tinode: this.props.tinode,
|
||||
reply: this.props.reply,
|
||||
onCancelReply: this.props.onCancelReply,
|
||||
onSendMessage: this.handleSendImage,
|
||||
onError: this.props.onError
|
||||
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
id: "image-preview-footer",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("b", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_file_name",
|
||||
defaultMessage: "File name:",
|
||||
description: "Label for a file name"
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("span", {
|
||||
title: this.props.content.filename,
|
||||
children: fname
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("b", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_content_type",
|
||||
defaultMessage: "Content type:",
|
||||
description: "Label for file content type (mime)"
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
children: this.props.content.type
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("b", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_size",
|
||||
defaultMessage: "Size:",
|
||||
description: "Label for file size"
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
children: [width, " × ", height, " px; ", (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_5__.bytesToHumanSize)(this.props.content.size)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":3,"file":"src_widgets_phone-country-selector_jsx.dev.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAE0B;AACc;AAEC;AAEI;AAE7C,MAAMI,oBAAoB,SAASJ,4DAAmB,CAAC;EACrDM,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZ,IAAI,CAACC,SAAS,GAAG,EAAE;IACnB,MAAM;MAAEC;IAAkB,CAAC,GAAGF,KAAK,CAACG,IAAI;IACxCR,yCAAc,CAACU,OAAO,CAACC,EAAE,IAAI;MAC3B,MAAMC,KAAK,GAAGD,EAAE,CAACE,IAAI,CAACC,KAAK,CAAC,GAAG,CAAC;MAChCF,KAAK,CAACF,OAAO,CAACK,IAAI,IAAI;QACpB,IAAI,CAACT,SAAS,CAACU,IAAI,CAAC;UAClBH,IAAI,EAAEE,IAAI,CAACE,IAAI,CAAC,CAAC;UACjBC,IAAI,EAAEP,EAAE,CAACO,IAAI;UACbC,IAAI,EAAElB,yDAAS,CAACU,EAAE,CAACO,IAAI,CAAC;UACxBE,IAAI,EAAEb,iBAAiB,CAACI,EAAE,CAACO,IAAI,EAAE;YAACG,IAAI,EAAE;UAAQ,CAAC;QACnD,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,IAAI,CAACf,SAAS,CAACgB,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACH,IAAI,CAACK,aAAa,CAACD,CAAC,CAACJ,IAAI,CAAC,CAAC;EAC7D;EAEAM,iBAAiBA,CAAA,EAAG;IAClB,IAAI,IAAI,CAACC,WAAW,EAAE;MACpB,IAAI,CAACA,WAAW,CAACC,cAAc,CAAC;QAACC,KAAK,EAAE,QAAQ;QAAEC,MAAM,EAAE;MAAS,CAAC,CAAC;IACvE;EACF;EAEAC,MAAMA,CAAA,EAAG;IACP,MAAMzB,SAAS,GAAG,EAAE;IACpB,MAAM0B,QAAQ,GAAG,IAAI,CAAC3B,KAAK,CAAC2B,QAAQ,IAAI,IAAI;IAC5C,IAAI,CAAC1B,SAAS,CAACI,OAAO,CAAC,CAACuB,CAAC,EAAEC,GAAG,KAAK;MACjC,MAAMC,KAAK,GAAIF,CAAC,CAACf,IAAI,IAAIc,QAAQ,GAAG,WAAW,GAAG,EAAG;MACrD1B,SAAS,CAACU,IAAI,CAAClB,0DAAA;QAAIuC,SAAS,EAAEF,KAAM;QAACG,GAAG,EAAEJ,GAAI;QAC5CK,GAAG,EAAEA,GAAG,IAAI;UAAC,IAAIN,CAAC,CAACf,IAAI,IAAIc,QAAQ,EAAE;YAAC,IAAI,CAACL,WAAW,GAAGY,GAAG;UAAA;QAAC,CAAE;QAC/DC,OAAO,EAAEC,CAAC,IAAI,IAAI,CAACpC,KAAK,CAACqC,QAAQ,CAACT,CAAC,CAACf,IAAI,EAAEe,CAAC,CAACpB,IAAI;MAAE,GAClDf,0DAAA;QAAMuC,SAAS,EAAC;MAAc,GAAEJ,CAAC,CAACd,IAAW,CAAC,EAC9CrB,0DAAA;QAAMuC,SAAS,EAAC;MAAS,GAAC,MAAM,EAACJ,CAAC,CAACb,IAAW,CAAC,EAC/CtB,0DAAA;QAAMuC,SAAS,EAAC;MAAW,GAAC,OAAO,EAACJ,CAAC,CAACpB,IAAW,CAC/C,CAAC,CAAC;IACR,CAAC,CAAC;IAEF,OACEf,0DAAA;MAAKuC,SAAS,EAAC,kBAAkB;MAACF,KAAK,EAAE;QAACQ,MAAM,EAAE;MAAO;IAAE,GACzD7C,0DAAA;MAAIuC,SAAS,EAAC;IAAwB,GACnC/B,SACC,CACD,CAAC;EAEV;AACF;AAEA,+DAAeP,sDAAU,CAACG,oBAAoB,CAAC,E","sources":["webpack://tinode-webapp/./src/widgets/phone-country-selector.jsx"],"sourcesContent":["// Selector for country dialing code.\n\nimport React from 'react';\nimport { injectIntl } from 'react-intl';\n\nimport * as dcodes from '../dcodes.json';\n\nimport { flagEmoji } from '../lib/strformat';\n\nclass PhoneCountrySelector extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.countries = [];\n const { formatDisplayName } = props.intl;\n dcodes.default.forEach(dc => {\n const parts = dc.dial.split(',');\n parts.forEach(part => {\n this.countries.push({\n dial: part.trim(),\n code: dc.code,\n flag: flagEmoji(dc.code),\n name: formatDisplayName(dc.code, {type: 'region'})\n });\n });\n });\n\n this.countries.sort((a, b) => a.name.localeCompare(b.name));\n }\n\n componentDidMount() {\n if (this.selectedRef) {\n this.selectedRef.scrollIntoView({block: 'center', inline: 'nearest'});\n }\n }\n\n render() {\n const countries = [];\n const selected = this.props.selected || 'US';\n this.countries.forEach((c, idx) => {\n const style = (c.code == selected ? 'selected ' : '');\n countries.push(<li className={style} key={idx}\n ref={ref => {if (c.code == selected) {this.selectedRef = ref}}}\n onClick={_ => this.props.onSubmit(c.code, c.dial)}>\n <span className=\"country-flag\">{c.flag}</span>\n <span className=\"country\"> {c.name}</span>\n <span className=\"dial-code\"> +{c.dial}</span>\n </li>);\n });\n\n return (\n <div className=\"scrollable-panel\" style={{height: '30rem'}}>\n <ul className=\"phone-country-selector\">\n {countries}\n </ul>\n </div>\n );\n }\n}\n\nexport default injectIntl(PhoneCountrySelector);\n"],"names":["React","injectIntl","dcodes","flagEmoji","PhoneCountrySelector","PureComponent","constructor","props","countries","formatDisplayName","intl","default","forEach","dc","parts","dial","split","part","push","trim","code","flag","name","type","sort","a","b","localeCompare","componentDidMount","selectedRef","scrollIntoView","block","inline","render","selected","c","idx","style","createElement","className","key","ref","onClick","_","onSubmit","height"],"ignoreList":[],"sourceRoot":""}
|
||||
{"version":3,"file":"src_widgets_phone-country-selector_jsx.dev.js","mappings":";;;;;;;;;;;;;;;;;AAE0B;AACc;AAEC;AAEI;AAAA;AAE7C,MAAM,oBAAoB,SAAS,4DAAmB,CAAC;EACrD,WAAW,CAAC,KAAK,EAAE;IACjB,KAAK,CAAC,KAAK,CAAC;IAEZ,IAAI,CAAC,SAAS,GAAG,EAAE;IACnB,MAAM;MAAE;IAAkB,CAAC,GAAG,KAAK,CAAC,IAAI;IACxC,yCAAc,CAAC,OAAO,CAAC,EAAE,IAAI;MAC3B,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;MAChC,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI;QACpB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;UAClB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;UACjB,IAAI,EAAE,EAAE,CAAC,IAAI;UACb,IAAI,EAAE,yDAAS,CAAC,EAAE,CAAC,IAAI,CAAC;UACxB,IAAI,EAAE,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;YAAC,IAAI,EAAE;UAAQ,CAAC;QACnD,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAC7D;EAEA,iBAAiB,GAAG;IAClB,IAAI,IAAI,CAAC,WAAW,EAAE;MACpB,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;QAAC,KAAK,EAAE,QAAQ;QAAE,MAAM,EAAE;MAAS,CAAC,CAAC;IACvE;EACF;EAEA,MAAM,GAAG;IACP,MAAM,SAAS,GAAG,EAAE;IACpB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI;IAC5C,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK;MACjC,MAAM,KAAK,GAAI,CAAC,CAAC,IAAI,IAAI,QAAQ,GAAG,WAAW,GAAG,EAAG;MACrD,SAAS,CAAC,IAAI,CAAC;QAAI,SAAS,EAAE,KAAM;QAClC,GAAG,EAAE,GAAG,IAAI;UAAC,IAAI,CAAC,CAAC,IAAI,IAAI,QAAQ,EAAE;YAAC,IAAI,CAAC,WAAW,GAAG,GAAG;UAAA;QAAC,CAAE;QAC/D,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAE;QAAA,WAClD;UAAM,SAAS,EAAC,cAAc;UAAA,UAAE,CAAC,CAAC;QAAI,gBAAO,CAAC,EAC9C;UAAM,SAAS,EAAC,SAAS;UAAA,WAAC,MAAM,EAAC,CAAC,CAAC,IAAI;QAAA,eAAO,CAAC,EAC/C;UAAM,SAAS,EAAC,WAAW;UAAA,WAAC,OAAO,EAAC,CAAC,CAAC,IAAI;QAAA,eAAO,CAAC;MAAA,GALV,GAAG,MAMzC,CAAC,CAAC;IACR,CAAC,CAAC;IAEF,OACE;MAAK,SAAS,EAAC,kBAAkB;MAAC,KAAK,EAAE;QAAC,MAAM,EAAE;MAAO,CAAE;MAAA,UACzD;QAAI,SAAS,EAAC,wBAAwB;QAAA,UACnC;MAAS,gBACR;IAAC,gBACF,CAAC;EAEV;AACF;AAEA,+DAAe,sDAAU,CAAC,oBAAoB,CAAC,E","sources":["webpack://tinode-webapp/./src/widgets/phone-country-selector.jsx"],"sourcesContent":["// Selector for country dialing code.\n\nimport React from 'react';\nimport { injectIntl } from 'react-intl';\n\nimport * as dcodes from '../dcodes.json';\n\nimport { flagEmoji } from '../lib/strformat';\n\nclass PhoneCountrySelector extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.countries = [];\n const { formatDisplayName } = props.intl;\n dcodes.default.forEach(dc => {\n const parts = dc.dial.split(',');\n parts.forEach(part => {\n this.countries.push({\n dial: part.trim(),\n code: dc.code,\n flag: flagEmoji(dc.code),\n name: formatDisplayName(dc.code, {type: 'region'})\n });\n });\n });\n\n this.countries.sort((a, b) => a.name.localeCompare(b.name));\n }\n\n componentDidMount() {\n if (this.selectedRef) {\n this.selectedRef.scrollIntoView({block: 'center', inline: 'nearest'});\n }\n }\n\n render() {\n const countries = [];\n const selected = this.props.selected || 'US';\n this.countries.forEach((c, idx) => {\n const style = (c.code == selected ? 'selected ' : '');\n countries.push(<li className={style} key={idx}\n ref={ref => {if (c.code == selected) {this.selectedRef = ref}}}\n onClick={_ => this.props.onSubmit(c.code, c.dial)}>\n <span className=\"country-flag\">{c.flag}</span>\n <span className=\"country\"> {c.name}</span>\n <span className=\"dial-code\"> +{c.dial}</span>\n </li>);\n });\n\n return (\n <div className=\"scrollable-panel\" style={{height: '30rem'}}>\n <ul className=\"phone-country-selector\">\n {countries}\n </ul>\n </div>\n );\n }\n}\n\nexport default injectIntl(PhoneCountrySelector);\n"],"names":[],"sourceRoot":""}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -21,6 +21,8 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! tinode-sdk */ "tinode-sdk");
|
||||
/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(tinode_sdk__WEBPACK_IMPORTED_MODULE_5__);
|
||||
/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/blob-helpers.js */ "./src/lib/blob-helpers.js");
|
||||
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -30,11 +32,9 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
const messages = (0,react_intl__WEBPACK_IMPORTED_MODULE_1__.defineMessages)({
|
||||
unknown_name: {
|
||||
id: "unknown_name",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Unknown"
|
||||
}]
|
||||
id: 'unknown_name',
|
||||
defaultMessage: 'Unknown',
|
||||
description: 'Name to show when the name is missing'
|
||||
}
|
||||
});
|
||||
class TheCardPreview extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComponent) {
|
||||
@@ -82,12 +82,15 @@ class TheCardPreview extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureC
|
||||
const contacts = [];
|
||||
emails.forEach((email, idx) => {
|
||||
const types = Array.isArray(email.des) ? email.des.join(', ') : '';
|
||||
contacts.push(react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
contacts.push((0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "group quoted",
|
||||
key: `email-${idx}`
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tt", null, email.value), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
||||
className: "small gray"
|
||||
}, " ", types ? `(${types})` : '')));
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("tt", {
|
||||
children: email.value
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("span", {
|
||||
className: "small gray",
|
||||
children: [" ", types ? `(${types})` : '']
|
||||
}, void 0, true)]
|
||||
}, `email-${idx}`, true));
|
||||
});
|
||||
phones.forEach((phone, idx) => {
|
||||
let val = phone.value;
|
||||
@@ -96,98 +99,125 @@ class TheCardPreview extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureC
|
||||
val = number ? number.formatInternational() : phone.value;
|
||||
} catch (err) {}
|
||||
const types = Array.isArray(phone.des) ? phone.des.join(', ') : '';
|
||||
contacts.push(react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
contacts.push((0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "group quoted",
|
||||
key: `tel-${idx}`
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tt", null, val), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
||||
className: "small gray"
|
||||
}, " ", types ? `(${types})` : '')));
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("tt", {
|
||||
children: val
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("span", {
|
||||
className: "small gray",
|
||||
children: [" ", types ? `(${types})` : '']
|
||||
}, void 0, true)]
|
||||
}, `tel-${idx}`, true));
|
||||
});
|
||||
tinodeIds.forEach((tid, idx) => {
|
||||
const types = Array.isArray(tid.des) ? tid.des.join(', ') : '';
|
||||
contacts.push(react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
contacts.push((0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "group quoted",
|
||||
key: `tinode-${idx}`
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tt", null, tid.value), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
||||
className: "small gray"
|
||||
}, " ", types ? `(${types})` : '')));
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("tt", {
|
||||
children: tid.value
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("span", {
|
||||
className: "small gray",
|
||||
children: [" ", types ? `(${types})` : '']
|
||||
}, void 0, true)]
|
||||
}, `tinode-${idx}`, true));
|
||||
});
|
||||
urls.forEach((url, idx) => {
|
||||
const types = Array.isArray(url.des) ? url.des.join(', ') : '';
|
||||
contacts.push(react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
contacts.push((0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "group quoted",
|
||||
key: `url-${idx}`
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tt", null, url.value), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
||||
className: "small gray"
|
||||
}, " ", types ? `(${types})` : '')));
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("tt", {
|
||||
children: url.value
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("span", {
|
||||
className: "small gray",
|
||||
children: [" ", types ? `(${types})` : '']
|
||||
}, void 0, true)]
|
||||
}, `url-${idx}`, true));
|
||||
});
|
||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "image-preview"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "preview-caption-panel"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_contact_card",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Contact Card"
|
||||
}]
|
||||
})), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
onClick: e => {
|
||||
e.preventDefault();
|
||||
this.props.onClose();
|
||||
}
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons gray"
|
||||
}, "close"))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "image-preview-container"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "doc-card"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "panel-form-column"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("center", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "avatar-box"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_letter_tile_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
||||
authorizeURL: this.props.tinode.authorizeURL,
|
||||
avatar: photoUrl || true,
|
||||
topic: "usrXXX123",
|
||||
title: fullName
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "group"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "large ellipsized"
|
||||
}, fullName || react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, messages.unknown_name))), org ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "group"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, org)) : null, note ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "group"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
|
||||
className: "small"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_description",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Description"
|
||||
}]
|
||||
})), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "quoted"
|
||||
}, note)) : null, contacts.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
className: "group"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
|
||||
className: "small"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_contacts",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Contacts"
|
||||
}]
|
||||
})), contacts) : null))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_send_message_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
||||
noInput: true,
|
||||
tinode: this.props.tinode,
|
||||
reply: this.props.reply,
|
||||
onCancelReply: this.props.onCancelReply,
|
||||
onSendMessage: this.handleSendCard,
|
||||
onError: this.props.onError
|
||||
}));
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
id: "image-preview",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
id: "preview-caption-panel",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("span", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_contact_card",
|
||||
defaultMessage: "Contact Card",
|
||||
description: "Label for contact card preview"
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
onClick: e => {
|
||||
e.preventDefault();
|
||||
this.props.onClose();
|
||||
},
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("i", {
|
||||
className: "material-icons gray",
|
||||
children: "close"
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
id: "image-preview-container",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "doc-card",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "panel-form-column",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("center", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "avatar-box",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(_letter_tile_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
||||
authorizeURL: this.props.tinode.authorizeURL,
|
||||
avatar: photoUrl || true,
|
||||
topic: "usrXXX123",
|
||||
title: fullName
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "group",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "large ellipsized",
|
||||
children: fullName || (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
...messages.unknown_name
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false), org ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "group",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
children: org
|
||||
}, void 0, false)
|
||||
}, void 0, false) : null, note ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "group",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("label", {
|
||||
className: "small",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_description",
|
||||
defaultMessage: "Description",
|
||||
description: "Label for description of user or topic"
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "quoted",
|
||||
children: note
|
||||
}, void 0, false)]
|
||||
}, void 0, true) : null, contacts.length > 0 ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("div", {
|
||||
className: "group",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("label", {
|
||||
className: "small",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_contacts",
|
||||
defaultMessage: "Contacts",
|
||||
description: "Label for contact information"
|
||||
}, void 0, false)
|
||||
}, void 0, false), contacts]
|
||||
}, void 0, true) : null]
|
||||
}, void 0, true)
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(_send_message_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
||||
noInput: true,
|
||||
tinode: this.props.tinode,
|
||||
reply: this.props.reply,
|
||||
onCancelReply: this.props.onCancelReply,
|
||||
onSendMessage: this.handleSendCard,
|
||||
onError: this.props.onError
|
||||
}, void 0, false)]
|
||||
}, void 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -14,17 +14,17 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var _send_message_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./send-message.jsx */ "./src/widgets/send-message.jsx");
|
||||
/* harmony import */ var _lib_strformat_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/strformat.js */ "./src/lib/strformat.js");
|
||||
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const messages = (0,react_intl__WEBPACK_IMPORTED_MODULE_1__.defineMessages)({
|
||||
unrecognized_video_format: {
|
||||
id: "unrecognized_video_format",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Format of this video is not recognized"
|
||||
}]
|
||||
id: 'unrecognized_video_format',
|
||||
defaultMessage: 'Format of this video is not recognized',
|
||||
description: 'Error message when uploaded video is invalid'
|
||||
}
|
||||
});
|
||||
class VideoPreview extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComponent) {
|
||||
@@ -77,61 +77,88 @@ class VideoPreview extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCom
|
||||
const height = this.props.content.height || '-';
|
||||
const controlist = this.props.onSendMessage ? 'nodownload' : '';
|
||||
const autoPlay = !this.props.onSendMessage;
|
||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "image-preview"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "preview-caption-panel"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, this.props.content.filename), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||
href: "#",
|
||||
onClick: e => {
|
||||
e.preventDefault();
|
||||
this.props.onClose();
|
||||
}
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||
className: "material-icons gray"
|
||||
}, "close"))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "image-preview-container"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("video", {
|
||||
className: "image-preview",
|
||||
controls: true,
|
||||
controlsList: controlist,
|
||||
disablePictureInPicture: true,
|
||||
ref: this.videoRef,
|
||||
autoPlay: autoPlay,
|
||||
src: this.props.tinode.authorizeURL(this.props.content.url),
|
||||
poster: this.props.content.preview,
|
||||
alt: this.props.content.filename
|
||||
})), this.props.onSendMessage ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_send_message_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
messagePrompt: "add_image_caption",
|
||||
acceptBlank: true,
|
||||
tinode: this.props.tinode,
|
||||
reply: this.props.reply,
|
||||
onCancelReply: this.props.onCancelReply,
|
||||
onSendMessage: this.handleSendVideo,
|
||||
onError: this.props.onError
|
||||
}) : react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||
id: "image-preview-footer"
|
||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_file_name",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "File name:"
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
||||
title: this.props.content.filename
|
||||
}, this.props.content.filename))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_content_type",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Content type:"
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, this.props.content.type)), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_size",
|
||||
defaultMessage: [{
|
||||
"type": 0,
|
||||
"value": "Size:"
|
||||
}]
|
||||
}))), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, width, " \xD7 ", height, " px; ", (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_3__.bytesToHumanSize)(this.props.content.size)))));
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
id: "image-preview",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
id: "preview-caption-panel",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("span", {
|
||||
children: this.props.content.filename
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("a", {
|
||||
href: "#",
|
||||
onClick: e => {
|
||||
e.preventDefault();
|
||||
this.props.onClose();
|
||||
},
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("i", {
|
||||
className: "material-icons gray",
|
||||
children: "close"
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
id: "image-preview-container",
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("video", {
|
||||
className: "image-preview",
|
||||
controls: true,
|
||||
controlsList: controlist,
|
||||
disablePictureInPicture: true,
|
||||
ref: this.videoRef,
|
||||
autoPlay: autoPlay,
|
||||
src: this.props.tinode.authorizeURL(this.props.content.url),
|
||||
poster: this.props.content.preview,
|
||||
alt: this.props.content.filename
|
||||
}, void 0, false)
|
||||
}, void 0, false), this.props.onSendMessage ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(_send_message_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||
messagePrompt: "add_image_caption",
|
||||
acceptBlank: true,
|
||||
tinode: this.props.tinode,
|
||||
reply: this.props.reply,
|
||||
onCancelReply: this.props.onCancelReply,
|
||||
onSendMessage: this.handleSendVideo,
|
||||
onError: this.props.onError
|
||||
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
id: "image-preview-footer",
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("b", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_file_name",
|
||||
defaultMessage: "File name:",
|
||||
description: "Label for a file name"
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("span", {
|
||||
title: this.props.content.filename,
|
||||
children: this.props.content.filename
|
||||
}, void 0, false)
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("b", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_content_type",
|
||||
defaultMessage: "Content type:",
|
||||
description: "Label for file content type (mime)"
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
children: this.props.content.type
|
||||
}, void 0, false)]
|
||||
}, void 0, true), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("b", {
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "label_size",
|
||||
defaultMessage: "Size:",
|
||||
description: "Label for file size"
|
||||
}, void 0, false)
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)("div", {
|
||||
children: [width, " × ", height, " px; ", (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_3__.bytesToHumanSize)(this.props.content.size)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
File diff suppressed because one or more lines are too long
+44
-16
@@ -439,8 +439,8 @@ const MESSAGE_STATUS_SENT = 50;
|
||||
const MESSAGE_STATUS_RECEIVED = 60;
|
||||
const MESSAGE_STATUS_READ = 70;
|
||||
const MESSAGE_STATUS_TO_ME = 80;
|
||||
const EXPIRE_PROMISES_TIMEOUT = 5000;
|
||||
const EXPIRE_PROMISES_PERIOD = 1000;
|
||||
const EXPIRE_PROMISES_TIMEOUT = 5_000;
|
||||
const EXPIRE_PROMISES_PERIOD = 1_000;
|
||||
const RECV_TIMEOUT = 100;
|
||||
const DEFAULT_MESSAGES_PAGE = 24;
|
||||
const DEL_CHAR = '\u2421';
|
||||
@@ -448,7 +448,7 @@ const MAX_PINNED_COUNT = 5;
|
||||
const TAG_ALIAS = 'alias:';
|
||||
const TAG_EMAIL = 'email:';
|
||||
const TAG_PHONE = 'tel:';
|
||||
const BACKOFF_BASE = 2000;
|
||||
const BACKOFF_BASE = 2_000;
|
||||
const BACKOFF_MAX_ITER = 10;
|
||||
const BACKOFF_JITTER = 0.3;
|
||||
|
||||
@@ -1140,6 +1140,10 @@ class DB {
|
||||
from = 0;
|
||||
to = Number.MAX_SAFE_INTEGER;
|
||||
}
|
||||
if (to > 0 && to <= from) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
const range = to > 0 ? IDBKeyRange.bound([topicName, from], [topicName, to], false, true) : IDBKeyRange.only([topicName, from]);
|
||||
const trx = this.db.transaction(['message'], 'readwrite');
|
||||
trx.onsuccess = event => {
|
||||
@@ -1166,8 +1170,13 @@ class DB {
|
||||
this.#logger('PCache', 'readMessages', event.target.error);
|
||||
reject(event.target.error);
|
||||
};
|
||||
const ranges = query.ranges.filter(r => !r.hi || r.hi > r.low);
|
||||
if (ranges.length == 0) {
|
||||
resolve(result);
|
||||
return;
|
||||
}
|
||||
let count = 0;
|
||||
query.ranges.forEach(range => {
|
||||
ranges.forEach(range => {
|
||||
const key = range.hi ? IDBKeyRange.bound([topicName, range.low], [topicName, range.hi], false, true) : IDBKeyRange.only([topicName, range.low]);
|
||||
trx.objectStore('message').getAll(key).onsuccess = event => {
|
||||
const msgs = event.target.result;
|
||||
@@ -1182,7 +1191,7 @@ class DB {
|
||||
}
|
||||
}
|
||||
count++;
|
||||
if (count == query.ranges.length) {
|
||||
if (count == ranges.length) {
|
||||
resolve(result);
|
||||
}
|
||||
};
|
||||
@@ -1197,6 +1206,10 @@ class DB {
|
||||
this.#logger('PCache', 'readMessages', event.target.error);
|
||||
reject(event.target.error);
|
||||
};
|
||||
if (since >= before) {
|
||||
resolve(result);
|
||||
return;
|
||||
}
|
||||
const range = IDBKeyRange.bound([topicName, since], [topicName, before], false, true);
|
||||
trx.objectStore('message').openCursor(range, 'prev').onsuccess = event => {
|
||||
const cursor = event.target.result;
|
||||
@@ -6023,7 +6036,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ PACKAGE_VERSION: function() { return /* binding */ PACKAGE_VERSION; }
|
||||
/* harmony export */ });
|
||||
const PACKAGE_VERSION = "0.25.2";
|
||||
const PACKAGE_VERSION = "0.25.3";
|
||||
|
||||
/***/ })
|
||||
|
||||
@@ -6039,12 +6052,6 @@ const PACKAGE_VERSION = "0.25.2";
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Check if module exists (development only)
|
||||
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
||||
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
||||
/******/ e.code = 'MODULE_NOT_FOUND';
|
||||
/******/ throw e;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
@@ -6053,6 +6060,12 @@ const PACKAGE_VERSION = "0.25.2";
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ if (!(moduleId in __webpack_modules__)) {
|
||||
/******/ delete __webpack_module_cache__[moduleId];
|
||||
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
||||
/******/ e.code = 'MODULE_NOT_FOUND';
|
||||
/******/ throw e;
|
||||
/******/ }
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
@@ -6074,11 +6087,26 @@ const PACKAGE_VERSION = "0.25.2";
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ !function() {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ // define getter/value functions for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, definition) {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ if(Array.isArray(definition)) {
|
||||
/******/ var i = 0;
|
||||
/******/ while(i < definition.length) {
|
||||
/******/ var key = definition[i++];
|
||||
/******/ var binding = definition[i++];
|
||||
/******/ if(!__webpack_require__.o(exports, key)) {
|
||||
/******/ if(binding === 0) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
|
||||
/******/ } else {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
|
||||
/******/ }
|
||||
/******/ } else if(binding === 0) { i++; }
|
||||
/******/ }
|
||||
/******/ } else {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+263
-175
@@ -13,13 +13,14 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _metadata_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./metadata.js */ "./node_modules/libphonenumber-js/es6/metadata.js");
|
||||
/* harmony import */ var _PhoneNumber_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PhoneNumber.js */ "./node_modules/libphonenumber-js/es6/PhoneNumber.js");
|
||||
/* harmony import */ var _AsYouTypeState_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AsYouTypeState.js */ "./node_modules/libphonenumber-js/es6/AsYouTypeState.js");
|
||||
/* harmony import */ var _AsYouTypeFormatter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AsYouTypeFormatter.js */ "./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js");
|
||||
/* harmony import */ var _AsYouTypeFormatter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AsYouTypeFormatter.js */ "./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js");
|
||||
/* harmony import */ var _AsYouTypeParser_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./AsYouTypeParser.js */ "./node_modules/libphonenumber-js/es6/AsYouTypeParser.js");
|
||||
/* harmony import */ var _helpers_getCountryByCallingCode_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers/getCountryByCallingCode.js */ "./node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js");
|
||||
/* harmony import */ var _helpers_getCountryByNationalNumber_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/getCountryByNationalNumber.js */ "./node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js");
|
||||
/* harmony import */ var _helpers_isObject_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers/isObject.js */ "./node_modules/libphonenumber-js/es6/helpers/isObject.js");
|
||||
/* harmony import */ var _helpers_checkNumberLength_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/checkNumberLength.js */ "./node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js");
|
||||
/* harmony import */ var _AsYouTypeState_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AsYouTypeState.js */ "./node_modules/libphonenumber-js/es6/AsYouTypeState.js");
|
||||
/* harmony import */ var _AsYouTypeFormatter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AsYouTypeFormatter.js */ "./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js");
|
||||
/* harmony import */ var _AsYouTypeFormatter_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./AsYouTypeFormatter.js */ "./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js");
|
||||
/* harmony import */ var _AsYouTypeParser_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./AsYouTypeParser.js */ "./node_modules/libphonenumber-js/es6/AsYouTypeParser.js");
|
||||
/* harmony import */ var _helpers_getCountryByCallingCode_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/getCountryByCallingCode.js */ "./node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js");
|
||||
/* harmony import */ var _helpers_getCountryByNationalNumber_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers/getCountryByNationalNumber.js */ "./node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js");
|
||||
/* harmony import */ var _helpers_isObject_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/isObject.js */ "./node_modules/libphonenumber-js/es6/helpers/isObject.js");
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
@@ -40,14 +41,18 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
||||
|
||||
|
||||
|
||||
|
||||
var USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;
|
||||
var AsYouType = /*#__PURE__*/function () {
|
||||
/**
|
||||
* @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.
|
||||
* @param {Object} metadata
|
||||
/**
|
||||
* @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.
|
||||
* @param {Object} metadata
|
||||
*/
|
||||
function AsYouType(optionsOrDefaultCountry, metadata) {
|
||||
_classCallCheck(this, AsYouType);
|
||||
// Metadata instance is created once and stays constant.
|
||||
// This is required because other utility classes such as `AsYouTypeFormatter`
|
||||
// will use this metadata instance "reference" and will assume that it stays constant.
|
||||
this.metadata = new _metadata_js__WEBPACK_IMPORTED_MODULE_0__["default"](metadata);
|
||||
var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry),
|
||||
_this$getCountryAndCa2 = _slicedToArray(_this$getCountryAndCa, 2),
|
||||
@@ -68,7 +73,7 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
var defaultCallingCode;
|
||||
// Turns out `null` also has type "object". Weird.
|
||||
if (optionsOrDefaultCountry) {
|
||||
if ((0,_helpers_isObject_js__WEBPACK_IMPORTED_MODULE_8__["default"])(optionsOrDefaultCountry)) {
|
||||
if ((0,_helpers_isObject_js__WEBPACK_IMPORTED_MODULE_9__["default"])(optionsOrDefaultCountry)) {
|
||||
defaultCountry = optionsOrDefaultCountry.defaultCountry;
|
||||
defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;
|
||||
} else {
|
||||
@@ -89,10 +94,10 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
return [defaultCountry, defaultCallingCode];
|
||||
}
|
||||
|
||||
/**
|
||||
* Inputs "next" phone number characters.
|
||||
* @param {string} text
|
||||
* @return {string} Formatted phone number characters that have been input so far.
|
||||
/**
|
||||
* Inputs "next" phone number characters.
|
||||
* @param {string} text
|
||||
* @return {string} Formatted phone number characters that have been input so far.
|
||||
*/
|
||||
}, {
|
||||
key: "input",
|
||||
@@ -131,7 +136,7 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
key: "reset",
|
||||
value: function reset() {
|
||||
var _this = this;
|
||||
this.state = new _AsYouTypeState_js__WEBPACK_IMPORTED_MODULE_2__["default"]({
|
||||
this.state = new _AsYouTypeState_js__WEBPACK_IMPORTED_MODULE_3__["default"]({
|
||||
onCountryChange: function onCountryChange(country) {
|
||||
// Before version `1.6.0`, the official `AsYouType` formatter API
|
||||
// included a `.country` property on an `AsYouType` instance.
|
||||
@@ -141,16 +146,16 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
_this.country = country;
|
||||
},
|
||||
onCallingCodeChange: function onCallingCodeChange(callingCode, country) {
|
||||
_this.metadata.selectNumberingPlan(country, callingCode);
|
||||
_this.metadata.selectNumberingPlan(country || callingCode);
|
||||
_this.formatter.reset(_this.metadata.numberingPlan, _this.state);
|
||||
_this.parser.reset(_this.metadata.numberingPlan);
|
||||
}
|
||||
});
|
||||
this.formatter = new _AsYouTypeFormatter_js__WEBPACK_IMPORTED_MODULE_3__["default"]({
|
||||
this.formatter = new _AsYouTypeFormatter_js__WEBPACK_IMPORTED_MODULE_4__["default"]({
|
||||
state: this.state,
|
||||
metadata: this.metadata
|
||||
});
|
||||
this.parser = new _AsYouTypeParser_js__WEBPACK_IMPORTED_MODULE_5__["default"]({
|
||||
this.parser = new _AsYouTypeParser_js__WEBPACK_IMPORTED_MODULE_6__["default"]({
|
||||
defaultCountry: this.defaultCountry,
|
||||
defaultCallingCode: this.defaultCallingCode,
|
||||
metadata: this.metadata,
|
||||
@@ -168,10 +173,10 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns `true` if the phone number is being input in international format.
|
||||
* In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
|
||||
* @return {boolean}
|
||||
/**
|
||||
* Returns `true` if the phone number is being input in international format.
|
||||
* In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
|
||||
* @return {boolean}
|
||||
*/
|
||||
}, {
|
||||
key: "isInternational",
|
||||
@@ -179,11 +184,11 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
return this.state.international;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the "calling code" part of the phone number when it's being input
|
||||
* in an international format.
|
||||
* If no valid calling code has been entered so far, returns `undefined`.
|
||||
* @return {string} [callingCode]
|
||||
/**
|
||||
* Returns the "calling code" part of the phone number when it's being input
|
||||
* in an international format.
|
||||
* If no valid calling code has been entered so far, returns `undefined`.
|
||||
* @return {string} [callingCode]
|
||||
*/
|
||||
}, {
|
||||
key: "getCallingCode",
|
||||
@@ -208,11 +213,11 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
return this.getCallingCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a two-letter country code of the phone number.
|
||||
* Returns `undefined` for "non-geographic" phone numbering plans.
|
||||
* Returns `undefined` if no phone number has been input yet.
|
||||
* @return {string} [country]
|
||||
/**
|
||||
* Returns a two-letter country code of the phone number.
|
||||
* Returns `undefined` for "non-geographic" phone numbering plans.
|
||||
* Returns `undefined` if no phone number has been input yet.
|
||||
* @return {string} [country]
|
||||
*/
|
||||
}, {
|
||||
key: "getCountry",
|
||||
@@ -224,10 +229,10 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a two-letter country code of the phone number.
|
||||
* Returns `undefined` for "non-geographic" phone numbering plans.
|
||||
* @return {string} [country]
|
||||
/**
|
||||
* Returns a two-letter country code of the phone number.
|
||||
* Returns `undefined` for "non-geographic" phone numbering plans.
|
||||
* @return {string} [country]
|
||||
*/
|
||||
}, {
|
||||
key: "_getCountry",
|
||||
@@ -314,7 +319,7 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
value: function getNonFormattedTemplate() {
|
||||
var number = this.getNonFormattedNumber();
|
||||
if (number) {
|
||||
return number.replace(/[\+\d]/g, _AsYouTypeFormatter_js__WEBPACK_IMPORTED_MODULE_4__.DIGIT_PLACEHOLDER);
|
||||
return number.replace(/[\+\d]/g, _AsYouTypeFormatter_js__WEBPACK_IMPORTED_MODULE_5__.DIGIT_PLACEHOLDER);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
@@ -331,29 +336,51 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
}, {
|
||||
key: "determineTheCountry",
|
||||
value: function determineTheCountry() {
|
||||
this.state.setCountry((0,_helpers_getCountryByCallingCode_js__WEBPACK_IMPORTED_MODULE_6__["default"])(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, {
|
||||
// Get a more precise country code for this national number.
|
||||
// It is possible that the precise country couldn't be determined
|
||||
// in cases when there're multiple countries sharing the same calling code.
|
||||
// In that case, `country` will be `undefined`.
|
||||
var country = (0,_helpers_getCountryByCallingCode_js__WEBPACK_IMPORTED_MODULE_7__["default"])(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, {
|
||||
nationalNumber: this.state.nationalSignificantNumber,
|
||||
metadata: this.metadata
|
||||
}));
|
||||
});
|
||||
// If the derived country is indeed more precise,
|
||||
// or if no country could be derived for the updated phone number.
|
||||
if (country !== this.state.country) {
|
||||
// Set (or reset) the more precise country.
|
||||
this.state.setCountry(country);
|
||||
// If a more precise country could be derived.
|
||||
if (country) {
|
||||
// Select a more precise telephone numbering plan.
|
||||
// For example, consider that `AsYouType` instance was created with `defaultCountry: "US"` argument.
|
||||
// In that case, the metadata instance will be using "US" metadata.
|
||||
// But then the user could input a Canadian phone number, in which case
|
||||
// the metadata instance should be switched to Canadian telephone numbering plan.
|
||||
// It is required to do that because later `canFormatCompleteNumber()` function will be called,
|
||||
// and that function relies on the precise country being pre-selected in the metadata instance.
|
||||
// Or, for example, `checkNumberLength()` function also relies on same thing.
|
||||
this.metadata.selectNumberingPlan(country);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a E.164 phone number value for the user's input.
|
||||
*
|
||||
* For example, for country `"US"` and input `"(222) 333-4444"`
|
||||
* it will return `"+12223334444"`.
|
||||
*
|
||||
* For international phone number input, it will also auto-correct
|
||||
* some minor errors such as using a national prefix when writing
|
||||
* an international phone number. For example, if the user inputs
|
||||
* `"+44 0 7400 000000"` then it will return an auto-corrected
|
||||
* `"+447400000000"` phone number value.
|
||||
*
|
||||
* Will return `undefined` if no digits have been input,
|
||||
* or when inputting a phone number in national format and no
|
||||
* default country or default "country calling code" have been set.
|
||||
*
|
||||
* @return {string} [value]
|
||||
/**
|
||||
* Returns a E.164 phone number value for the user's input.
|
||||
*
|
||||
* For example, for country `"US"` and input `"(222) 333-4444"`
|
||||
* it will return `"+12223334444"`.
|
||||
*
|
||||
* For international phone number input, it will also auto-correct
|
||||
* some minor errors such as using a national prefix when writing
|
||||
* an international phone number. For example, if the user inputs
|
||||
* `"+44 0 7400 000000"` then it will return an auto-corrected
|
||||
* `"+447400000000"` phone number value.
|
||||
*
|
||||
* Will return `undefined` if no digits have been input,
|
||||
* or when inputting a phone number in national format and no
|
||||
* default country or default "country calling code" have been set.
|
||||
*
|
||||
* @return {string} [value]
|
||||
*/
|
||||
}, {
|
||||
key: "getNumberValue",
|
||||
@@ -382,11 +409,11 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an instance of `PhoneNumber` class.
|
||||
* Will return `undefined` if no national (significant) number
|
||||
* digits have been entered so far, or if no `defaultCountry` has been
|
||||
* set and the user enters a phone number not in international format.
|
||||
/**
|
||||
* Returns an instance of `PhoneNumber` class.
|
||||
* Will return `undefined` if no national (significant) number
|
||||
* digits have been entered so far, or if no `defaultCountry` has been
|
||||
* set and the user enters a phone number not in international format.
|
||||
*/
|
||||
}, {
|
||||
key: "getNumber",
|
||||
@@ -395,18 +422,19 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
nationalSignificantNumber = _this$state3.nationalSignificantNumber,
|
||||
carrierCode = _this$state3.carrierCode,
|
||||
callingCode = _this$state3.callingCode;
|
||||
|
||||
// `this._getCountry()` is basically same as `this.state.country`
|
||||
// with the only change that it return `undefined` in case of a
|
||||
// "non-geographic" numbering plan instead of `"001"` "internal use" value.
|
||||
var country = this._getCountry();
|
||||
if (!nationalSignificantNumber) {
|
||||
return;
|
||||
}
|
||||
|
||||
// `state.country` and `state.callingCode` aren't required to be in sync.
|
||||
// For example, `country` could be `"AR"` and `callingCode` could be `undefined`.
|
||||
// So `country` and `callingCode` are totally independent.
|
||||
// `this._getCountry()` is basically same as `this.state.country`
|
||||
// with the only change that it returns `undefined` in case of a
|
||||
// "non-geographic" numbering plan instead of `"001"` "internal use" value.
|
||||
var country = this._getCountry();
|
||||
|
||||
// Sidenote:
|
||||
// `state.callingCode` and `state.country` are somewhat independent from one another
|
||||
// and there could be situations when one is defined but the other is not.
|
||||
// See the comment in `AsYouTypeState.js` for more info on when that is possible.
|
||||
|
||||
if (!country && !callingCode) {
|
||||
return;
|
||||
@@ -422,26 +450,32 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
//
|
||||
// Because `AsYouType.getNumber()` method is supposed to be a 1:1
|
||||
// equivalent for `parsePhoneNumber(AsYouType.getNumberValue())`,
|
||||
// then it should also behave accordingly in cases of `country` ambiguity.
|
||||
// it means that it should also behave accordingly in such cases of `country` ambiguity.
|
||||
// That's how users of this library would expect it to behave anyway.
|
||||
//
|
||||
// So here it checks if `state.country` is same as the `defaultCountry`,
|
||||
// and if it is, it attempts to get rid of any potential ambiguity.
|
||||
//
|
||||
if (country) {
|
||||
if (country === this.defaultCountry) {
|
||||
// `state.country` and `state.callingCode` aren't required to be in sync.
|
||||
// For example, `state.country` could be `"AR"` and `state.callingCode` could be `undefined`.
|
||||
// So `state.country` and `state.callingCode` are totally independent.
|
||||
var metadata = new _metadata_js__WEBPACK_IMPORTED_MODULE_0__["default"](this.metadata.metadata);
|
||||
metadata.selectNumberingPlan(country);
|
||||
var _callingCode = metadata.numberingPlan.callingCode();
|
||||
var ambiguousCountries = this.metadata.getCountryCodesForCallingCode(_callingCode);
|
||||
if (ambiguousCountries.length > 1) {
|
||||
var exactCountry = (0,_helpers_getCountryByNationalNumber_js__WEBPACK_IMPORTED_MODULE_7__["default"])(nationalSignificantNumber, {
|
||||
countries: ambiguousCountries,
|
||||
metadata: this.metadata.metadata
|
||||
});
|
||||
if (exactCountry) {
|
||||
country = exactCountry;
|
||||
}
|
||||
// // Create a `Metadata` instance just to get the calling code of the `country`.
|
||||
// const metadata = new Metadata(this.metadata.metadata)
|
||||
// // `state.callingCode` and `state.country` are somewhat independent from one another
|
||||
// // and there could be situations when one is defined but the other is not.
|
||||
// // See the comment in `AsYouTypeState.js` for more info on when that is possible.
|
||||
// // Here, it only passes `state.country` because there's no need to pass `state.callingCode`
|
||||
// // because `state.country` is known to be defined.
|
||||
// metadata.selectNumberingPlan(country)
|
||||
// const countryCallingCode = metadata.numberingPlan.callingCode()
|
||||
|
||||
// Instead of getting `countryCallingCode` value above,
|
||||
// it could simply read it from the existing metadata instance.
|
||||
var countryCallingCode = this.metadata.numberingPlan.callingCode();
|
||||
|
||||
// Attempt to rule out any potential country code ambiguity, if present.
|
||||
var exactCountry = getExactCountryForMultiCountryCallingCode(countryCallingCode, nationalSignificantNumber, this.metadata);
|
||||
if (exactCountry) {
|
||||
country = exactCountry;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -453,10 +487,10 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
return phoneNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns `true` if the phone number is "possible".
|
||||
* Is just a shortcut for `PhoneNumber.isPossible()`.
|
||||
* @return {boolean}
|
||||
/**
|
||||
* Returns `true` if the phone number is "possible".
|
||||
* Is just a shortcut for `PhoneNumber.isPossible()`.
|
||||
* @return {boolean}
|
||||
*/
|
||||
}, {
|
||||
key: "isPossible",
|
||||
@@ -468,10 +502,10 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
return phoneNumber.isPossible();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns `true` if the phone number is "valid".
|
||||
* Is just a shortcut for `PhoneNumber.isValid()`.
|
||||
* @return {boolean}
|
||||
/**
|
||||
* Returns `true` if the phone number is "valid".
|
||||
* Is just a shortcut for `PhoneNumber.isValid()`.
|
||||
* @return {boolean}
|
||||
*/
|
||||
}, {
|
||||
key: "isValid",
|
||||
@@ -483,10 +517,43 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
return phoneNumber.isValid();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* This method is used in `react-phone-number-input/source/input-control.js`
|
||||
* in versions before `3.0.16`.
|
||||
/**
|
||||
* Checks if the phone number length is valid.
|
||||
* If it is, nothing is returned.
|
||||
* Otherwise, a rejection reason is returned.
|
||||
* @return {string?}
|
||||
*/
|
||||
}, {
|
||||
key: "validateLength",
|
||||
value: function validateLength() {
|
||||
var _this$state4 = this.state,
|
||||
digits = _this$state4.digits,
|
||||
nationalSignificantNumber = _this$state4.nationalSignificantNumber;
|
||||
if (!digits) {
|
||||
return 'NOT_A_NUMBER';
|
||||
}
|
||||
if (!this.metadata.numberingPlan) {
|
||||
return 'INVALID_COUNTRY';
|
||||
}
|
||||
if (!nationalSignificantNumber) {
|
||||
return 'TOO_SHORT';
|
||||
}
|
||||
|
||||
// `state.callingCode` and `state.country` are somewhat independent from one another
|
||||
// and there could be situations when one is defined but the other is not.
|
||||
// See the comment in `AsYouTypeState.js` for more info on when that is possible.
|
||||
// Here, it uses both: if `country` is defined then it will use that,
|
||||
// otherwise it will use `callingCode`.
|
||||
var result = (0,_helpers_checkNumberLength_js__WEBPACK_IMPORTED_MODULE_2__["default"])(nationalSignificantNumber, undefined, this.metadata);
|
||||
if (result !== 'IS_POSSIBLE') {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* This method is used in `react-phone-number-input/source/input-control.js`
|
||||
* in versions before `3.0.16`.
|
||||
*/
|
||||
}, {
|
||||
key: "getNationalNumber",
|
||||
@@ -494,9 +561,9 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
return this.state.nationalSignificantNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the phone number characters entered by the user.
|
||||
* @return {string}
|
||||
/**
|
||||
* Returns the phone number characters entered by the user.
|
||||
* @return {string}
|
||||
*/
|
||||
}, {
|
||||
key: "getChars",
|
||||
@@ -504,9 +571,9 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
return (this.state.international ? '+' : '') + this.state.digits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the template for the formatted phone number.
|
||||
* @return {string}
|
||||
/**
|
||||
* Returns the template for the formatted phone number.
|
||||
* @return {string}
|
||||
*/
|
||||
}, {
|
||||
key: "getTemplate",
|
||||
@@ -514,8 +581,15 @@ var AsYouType = /*#__PURE__*/function () {
|
||||
return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || '';
|
||||
}
|
||||
}]);
|
||||
}();
|
||||
}(); // In situations when multiple countries use the same calling code,
|
||||
// this function tells what exact country does a given national (significant) number belong to.
|
||||
|
||||
function getExactCountryForMultiCountryCallingCode(callingCode, nationalSignificantNumber, metadata) {
|
||||
var ambiguousCountries = metadata.getCountryCodesForCallingCode(callingCode);
|
||||
if (ambiguousCountries.length > 1) {
|
||||
return (0,_helpers_getCountryByNationalNumber_js__WEBPACK_IMPORTED_MODULE_8__["default"])(nationalSignificantNumber, ambiguousCountries, metadata.metadata);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=AsYouType.js.map
|
||||
|
||||
/***/ }),
|
||||
@@ -567,12 +641,12 @@ var PatternMatcher = /*#__PURE__*/function () {
|
||||
}
|
||||
}]);
|
||||
}();
|
||||
/**
|
||||
* Matches `characters` against a pattern compiled into a `tree`.
|
||||
* @param {string[]} characters
|
||||
* @param {Tree} tree — A pattern compiled into a `tree`. See the `*.d.ts` file for the description of the `tree` structure.
|
||||
* @param {boolean} last — Whether it's the last (rightmost) subtree on its level of the match tree.
|
||||
* @return {object} See the `*.d.ts` file for the description of the result object.
|
||||
/**
|
||||
* Matches `characters` against a pattern compiled into a `tree`.
|
||||
* @param {string[]} characters
|
||||
* @param {Tree} tree — A pattern compiled into a `tree`. See the `*.d.ts` file for the description of the `tree` structure.
|
||||
* @param {boolean} last — Whether it's the last (rightmost) subtree on its level of the match tree.
|
||||
* @return {object} See the `*.d.ts` file for the description of the result object.
|
||||
*/
|
||||
|
||||
function _match(characters, tree, last) {
|
||||
@@ -990,8 +1064,8 @@ function formatCompleteNumber(state, format, _ref) {
|
||||
});
|
||||
}
|
||||
}
|
||||
function canFormatCompleteNumber(nationalSignificantNumber, country, metadata) {
|
||||
return (0,_helpers_checkNumberLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nationalSignificantNumber, country, metadata) === 'IS_POSSIBLE';
|
||||
function canFormatCompleteNumber(nationalSignificantNumber, metadata) {
|
||||
return (0,_helpers_checkNumberLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nationalSignificantNumber, undefined, metadata) === 'IS_POSSIBLE';
|
||||
}
|
||||
function formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, _ref2) {
|
||||
var metadata = _ref2.metadata,
|
||||
@@ -1241,11 +1315,11 @@ var AsYouTypeFormatter = /*#__PURE__*/function () {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats an updated phone number.
|
||||
* @param {string} nextDigits — Additional phone number digits.
|
||||
* @param {object} state — `AsYouType` state.
|
||||
* @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats.
|
||||
/**
|
||||
* Formats an updated phone number.
|
||||
* @param {string} nextDigits — Additional phone number digits.
|
||||
* @param {object} state — `AsYouType` state.
|
||||
* @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats.
|
||||
*/
|
||||
}, {
|
||||
key: "format",
|
||||
@@ -1265,7 +1339,7 @@ var AsYouTypeFormatter = /*#__PURE__*/function () {
|
||||
// If so, we should use this instead of any other formatting template
|
||||
// whose leadingDigitsPattern also matches the input."
|
||||
//
|
||||
if ((0,_AsYouTypeFormatter_complete_js__WEBPACK_IMPORTED_MODULE_1__.canFormatCompleteNumber)(state.nationalSignificantNumber, state.country, this.metadata)) {
|
||||
if ((0,_AsYouTypeFormatter_complete_js__WEBPACK_IMPORTED_MODULE_1__.canFormatCompleteNumber)(state.nationalSignificantNumber, this.metadata)) {
|
||||
for (var _iterator = _createForOfIteratorHelperLoose(this.matchingFormats), _step; !(_step = _iterator()).done;) {
|
||||
var _format = _step.value;
|
||||
var formattedCompleteNumber = (0,_AsYouTypeFormatter_complete_js__WEBPACK_IMPORTED_MODULE_1__["default"])(state, _format, {
|
||||
@@ -1650,12 +1724,12 @@ var AsYouTypeFormatter = /*#__PURE__*/function () {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates formatting template for a national phone number,
|
||||
* optionally containing a national prefix, for a format.
|
||||
* @param {Format} format
|
||||
* @param {string} nationalPrefix
|
||||
* @return {string}
|
||||
/**
|
||||
* Generates formatting template for a national phone number,
|
||||
* optionally containing a national prefix, for a format.
|
||||
* @param {Format} format
|
||||
* @param {string} nationalPrefix
|
||||
* @return {string}
|
||||
*/
|
||||
}, {
|
||||
key: "getTemplateForFormat",
|
||||
@@ -2040,10 +2114,10 @@ var AsYouTypeParser = /*#__PURE__*/function () {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Inputs "next" phone number digits.
|
||||
* @param {string} digits
|
||||
* @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means "don't format the national phone number at this stage".
|
||||
/**
|
||||
* Inputs "next" phone number digits.
|
||||
* @param {string} digits
|
||||
* @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means "don't format the national phone number at this stage".
|
||||
*/
|
||||
}, {
|
||||
key: "inputDigits",
|
||||
@@ -2129,12 +2203,12 @@ var AsYouTypeParser = /*#__PURE__*/function () {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts a national (significant) number from user input.
|
||||
* Google's library is different in that it only applies `national_prefix_for_parsing`
|
||||
* and doesn't apply `national_prefix_transform_rule` after that.
|
||||
* https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539
|
||||
* @return {boolean} [extracted]
|
||||
/**
|
||||
* Extracts a national (significant) number from user input.
|
||||
* Google's library is different in that it only applies `national_prefix_for_parsing`
|
||||
* and doesn't apply `national_prefix_transform_rule` after that.
|
||||
* https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539
|
||||
* @return {boolean} [extracted]
|
||||
*/
|
||||
}, {
|
||||
key: "extractNationalSignificantNumber",
|
||||
@@ -2153,10 +2227,10 @@ var AsYouTypeParser = /*#__PURE__*/function () {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* In Google's code this function is called "attempt to extract longer NDD".
|
||||
* "Some national prefixes are a substring of others", they say.
|
||||
* @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.
|
||||
/**
|
||||
* In Google's code this function is called "attempt to extract longer NDD".
|
||||
* "Some national prefixes are a substring of others", they say.
|
||||
* @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.
|
||||
*/
|
||||
}, {
|
||||
key: "extractAnotherNationalSignificantNumber",
|
||||
@@ -2387,10 +2461,10 @@ var AsYouTypeParser = /*#__PURE__*/function () {
|
||||
}
|
||||
}]);
|
||||
}();
|
||||
/**
|
||||
* Extracts formatted phone number from text (if there's any).
|
||||
* @param {string} text
|
||||
* @return {string} [formattedPhoneNumber]
|
||||
/**
|
||||
* Extracts formatted phone number from text (if there's any).
|
||||
* @param {string} text
|
||||
* @return {string} [formattedPhoneNumber]
|
||||
*/
|
||||
|
||||
function extractFormattedPhoneNumber(text) {
|
||||
@@ -2416,10 +2490,10 @@ function extractFormattedPhoneNumber(text) {
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts formatted phone number digits (and a `+`) from text (if there're any).
|
||||
* @param {string} text
|
||||
* @return {any[]}
|
||||
/**
|
||||
* Extracts formatted phone number digits (and a `+`) from text (if there're any).
|
||||
* @param {string} text
|
||||
* @return {any[]}
|
||||
*/
|
||||
function _extractFormattedDigitsAndPlus(text) {
|
||||
// Extract a formatted phone number part from text.
|
||||
@@ -2431,10 +2505,10 @@ function _extractFormattedDigitsAndPlus(text) {
|
||||
return [extractedNumber];
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts formatted phone number digits (and a `+`) from text (if there're any).
|
||||
* @param {string} text
|
||||
* @return {any[]}
|
||||
/**
|
||||
* Extracts formatted phone number digits (and a `+`) from text (if there're any).
|
||||
* @param {string} text
|
||||
* @return {any[]}
|
||||
*/
|
||||
function extractFormattedDigitsAndPlus(text) {
|
||||
var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text),
|
||||
@@ -2471,6 +2545,21 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
||||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
// This "state" object simply holds the state of the "AsYouType" parser:
|
||||
//
|
||||
// Sidenote:
|
||||
// `state.callingCode` and `state.country` are somewhat independent from one another
|
||||
// and there could be situations when one is defined but the other is not.
|
||||
// * Situations when `state.country` would be defined but `state.callingCode` would be `undefined`:
|
||||
// * When `defaultCountry` is specified and inputting a phone number not in "international" format.
|
||||
// * When `defaultCountry` is specified and inputting a phone number in "international" format,
|
||||
// but before the `+` character has been input.
|
||||
// * Situations when `state.country` would be `undefined` but `state.callingCode` would be defined:
|
||||
// * When `defaultCountry` is not specified and inputting a phone number in "international" format,
|
||||
// and the "calling code" part is already complete, but multiple countries share this "calling code"
|
||||
// and there's not enough national (significant) number digits yet to determine the exact country.
|
||||
// * In any other sigutations, `state.country` and `state.callingCode` are either both defined or both `undefined`.
|
||||
// * When they're both defined, `state.callingCode` always corresponds to `state.country`.
|
||||
// So both are always consistent in this case.
|
||||
//
|
||||
// * `country?: string` — The exact country of the phone number, if it could be determined.
|
||||
// When inputting a phone number in "international" format, it will derive the `country` from "country calling code" and the phone number digits.
|
||||
// When inputting a phone number in "national" format, it will derive the `country` from `defaultCountry` that was specified when creating the `AsYouType` formatter.
|
||||
@@ -2478,7 +2567,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
||||
// * `callingCode?: string` — "Country calling code" that has been extracted from the input phone number.
|
||||
// When inputting a phone number in "international" format, it will extract the "country calling code" from the digits that follow the "+" character.
|
||||
// When inputting a phone number in "national" format, `callingCode` will be `undefined`.
|
||||
// Sidenote: `state.callingCode` is therefore independent from `state.country` and there could be situations when `state.country` is defined by `state.callingCode` is not — that would be when inputting a phone number not in "international" format.
|
||||
// * `digits: string` — Phone number digits that have been input so far, including the "+" character, if present. In case of inputting non-arabic digits, those will be converted to arabic ones.
|
||||
// * `international: boolean` — Whether the phone number is being input in "international" format, i.e. with a "+" character.
|
||||
// * `missingPlus: boolean` — Whether it's a phone number in "international" format that is missing the leading "+" character for some reason — apparently, Google thinks that it's a common mistake when inputting a phone number.
|
||||
@@ -2568,12 +2656,12 @@ var AsYouTypeState = /*#__PURE__*/function () {
|
||||
this.nationalSignificantNumber += nextDigits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the part of `this.digits` that corresponds to the national number.
|
||||
* Basically, all digits that have been input by the user, except for the
|
||||
* international prefix and the country calling code part
|
||||
* (if the number is an international one).
|
||||
* @return {string}
|
||||
/**
|
||||
* Returns the part of `this.digits` that corresponds to the national number.
|
||||
* Basically, all digits that have been input by the user, except for the
|
||||
* international prefix and the country calling code part
|
||||
* (if the number is an international one).
|
||||
* @return {string}
|
||||
*/
|
||||
}, {
|
||||
key: "getNationalDigits",
|
||||
@@ -2631,7 +2719,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
// This file is a workaround for a bug in web browsers' "native"
|
||||
// ES6 importing system which is uncapable of importing "*.json" files.
|
||||
// https://github.com/catamphetamine/libphonenumber-js/issues/239
|
||||
/* harmony default export */ __webpack_exports__["default"] = ({"AC":"40123","AD":"312345","AE":"501234567","AF":"701234567","AG":"2684641234","AI":"2642351234","AL":"672123456","AM":"77123456","AO":"923123456","AR":"91123456789","AS":"6847331234","AT":"664123456","AU":"412345678","AW":"5601234","AX":"412345678","AZ":"401234567","BA":"61123456","BB":"2462501234","BD":"1812345678","BE":"470123456","BF":"70123456","BG":"43012345","BH":"36001234","BI":"79561234","BJ":"0195123456","BL":"690001234","BM":"4413701234","BN":"7123456","BO":"71234567","BQ":"3181234","BR":"11961234567","BS":"2423591234","BT":"17123456","BW":"71123456","BY":"294911911","BZ":"6221234","CA":"5062345678","CC":"412345678","CD":"991234567","CF":"70012345","CG":"061234567","CH":"781234567","CI":"0123456789","CK":"71234","CL":"221234567","CM":"671234567","CN":"13123456789","CO":"3211234567","CR":"83123456","CU":"51234567","CV":"9911234","CW":"95181234","CX":"412345678","CY":"96123456","CZ":"601123456","DE":"15123456789","DJ":"77831001","DK":"34412345","DM":"7672251234","DO":"8092345678","DZ":"551234567","EC":"991234567","EE":"51234567","EG":"1001234567","EH":"650123456","ER":"7123456","ES":"612345678","ET":"911234567","FI":"412345678","FJ":"7012345","FK":"51234","FM":"3501234","FO":"211234","FR":"612345678","GA":"06031234","GB":"7400123456","GD":"4734031234","GE":"555123456","GF":"694201234","GG":"7781123456","GH":"231234567","GI":"57123456","GL":"221234","GM":"3012345","GN":"601123456","GP":"690001234","GQ":"222123456","GR":"6912345678","GT":"51234567","GU":"6713001234","GW":"955012345","GY":"6091234","HK":"51234567","HN":"91234567","HR":"921234567","HT":"34101234","HU":"201234567","ID":"812345678","IE":"850123456","IL":"502345678","IM":"7924123456","IN":"8123456789","IO":"3801234","IQ":"7912345678","IR":"9123456789","IS":"6111234","IT":"3123456789","JE":"7797712345","JM":"8762101234","JO":"790123456","JP":"9012345678","KE":"712123456","KG":"700123456","KH":"91234567","KI":"72001234","KM":"3212345","KN":"8697652917","KP":"1921234567","KR":"1020000000","KW":"50012345","KY":"3453231234","KZ":"7710009998","LA":"2023123456","LB":"71123456","LC":"7582845678","LI":"660234567","LK":"712345678","LR":"770123456","LS":"50123456","LT":"61234567","LU":"628123456","LV":"21234567","LY":"912345678","MA":"650123456","MC":"612345678","MD":"62112345","ME":"60123456","MF":"690001234","MG":"321234567","MH":"2351234","MK":"72345678","ML":"65012345","MM":"92123456","MN":"88123456","MO":"66123456","MP":"6702345678","MQ":"696201234","MR":"22123456","MS":"6644923456","MT":"96961234","MU":"52512345","MV":"7712345","MW":"991234567","MX":"2221234567","MY":"123456789","MZ":"821234567","NA":"811234567","NC":"751234","NE":"93123456","NF":"381234","NG":"8021234567","NI":"81234567","NL":"612345678","NO":"40612345","NP":"9841234567","NR":"5551234","NU":"8884012","NZ":"211234567","OM":"92123456","PA":"61234567","PE":"912345678","PF":"87123456","PG":"70123456","PH":"9051234567","PK":"3012345678","PL":"512345678","PM":"551234","PR":"7872345678","PS":"599123456","PT":"912345678","PW":"6201234","PY":"961456789","QA":"33123456","RE":"692123456","RO":"712034567","RS":"601234567","RU":"9123456789","RW":"720123456","SA":"512345678","SB":"7421234","SC":"2510123","SD":"911231234","SE":"701234567","SG":"81234567","SH":"51234","SI":"31234567","SJ":"41234567","SK":"912123456","SL":"25123456","SM":"66661212","SN":"701234567","SO":"71123456","SR":"7412345","SS":"977123456","ST":"9812345","SV":"70123456","SX":"7215205678","SY":"944567890","SZ":"76123456","TA":"8999","TC":"6492311234","TD":"63012345","TG":"90112345","TH":"812345678","TJ":"917123456","TK":"7290","TL":"77212345","TM":"66123456","TN":"20123456","TO":"7715123","TR":"5012345678","TT":"8682911234","TV":"901234","TW":"912345678","TZ":"621234567","UA":"501234567","UG":"712345678","US":"2015550123","UY":"94231234","UZ":"912345678","VA":"3123456789","VC":"7844301234","VE":"4121234567","VG":"2843001234","VI":"3406421234","VN":"912345678","VU":"5912345","WF":"821234","WS":"7212345","XK":"43201234","YE":"712345678","YT":"639012345","ZA":"711234567","ZM":"955123456","ZW":"712345678"});
|
||||
/* harmony default export */ __webpack_exports__["default"] = ({"AC":"40123","AD":"312345","AE":"501234567","AF":"701234567","AG":"2684641234","AI":"2642351234","AL":"672123456","AM":"77123456","AO":"923123456","AR":"91123456789","AS":"6847331234","AT":"664123456","AU":"412345678","AW":"5601234","AX":"412345678","AZ":"401234567","BA":"61123456","BB":"2462501234","BD":"1812345678","BE":"450001234","BF":"70123456","BG":"43012345","BH":"36001234","BI":"79561234","BJ":"0195123456","BL":"690001234","BM":"4413701234","BN":"7123456","BO":"71234567","BQ":"3181234","BR":"11961234567","BS":"2423591234","BT":"17123456","BW":"71123456","BY":"294911911","BZ":"6221234","CA":"5062345678","CC":"412345678","CD":"991234567","CF":"70012345","CG":"061234567","CH":"781234567","CI":"0123456789","CK":"71234","CL":"221234567","CM":"671234567","CN":"13123456789","CO":"3211234567","CR":"83123456","CU":"51234567","CV":"9911234","CW":"95181234","CX":"412345678","CY":"96123456","CZ":"601123456","DE":"15123456789","DJ":"77831001","DK":"34412345","DM":"7672251234","DO":"8092345678","DZ":"551234567","EC":"991234567","EE":"51234567","EG":"1001234567","EH":"650123456","ER":"7123456","ES":"612345678","ET":"911234567","FI":"412345678","FJ":"7012345","FK":"51234","FM":"3501234","FO":"211234","FR":"612345678","GA":"06031234","GB":"7400123456","GD":"4734031234","GE":"555123456","GF":"694201234","GG":"7781123456","GH":"231234567","GI":"57123456","GL":"221234","GM":"3012345","GN":"601123456","GP":"690001234","GQ":"222123456","GR":"6912345678","GT":"51234567","GU":"6713001234","GW":"955012345","GY":"6091234","HK":"51234567","HN":"91234567","HR":"921234567","HT":"34101234","HU":"201234567","ID":"812345678","IE":"850123456","IL":"502345678","IM":"7924123456","IN":"8123456789","IO":"3801234","IQ":"7912345678","IR":"9123456789","IS":"6111234","IT":"3123456789","JE":"7797712345","JM":"8762101234","JO":"790123456","JP":"9012345678","KE":"712123456","KG":"700123456","KH":"91234567","KI":"72001234","KM":"3212345","KN":"8697652917","KP":"1921234567","KR":"1020000000","KW":"50012345","KY":"3453231234","KZ":"7710009998","LA":"2023123456","LB":"71123456","LC":"7582845678","LI":"660234567","LK":"712345678","LR":"770123456","LS":"50123456","LT":"61234567","LU":"628123456","LV":"21234567","LY":"912345678","MA":"650123456","MC":"612345678","MD":"62112345","ME":"60123456","MF":"690001234","MG":"321234567","MH":"2351234","MK":"72345678","ML":"65012345","MM":"92123456","MN":"88123456","MO":"66123456","MP":"6702345678","MQ":"696201234","MR":"22123456","MS":"6644923456","MT":"96961234","MU":"52512345","MV":"7712345","MW":"991234567","MX":"2221234567","MY":"123456789","MZ":"821234567","NA":"811234567","NC":"751234","NE":"93123456","NF":"381234","NG":"8021234567","NI":"81234567","NL":"612345678","NO":"40612345","NP":"9841234567","NR":"5551234","NU":"8884012","NZ":"211234567","OM":"92123456","PA":"61234567","PE":"912345678","PF":"87123456","PG":"70123456","PH":"9051234567","PK":"3012345678","PL":"512345678","PM":"551234","PR":"7872345678","PS":"599123456","PT":"912345678","PW":"6201234","PY":"961456789","QA":"33123456","RE":"692123456","RO":"712034567","RS":"601234567","RU":"9123456789","RW":"720123456","SA":"512345678","SB":"7421234","SC":"2510123","SD":"911231234","SE":"701234567","SG":"81234567","SH":"51234","SI":"31234567","SJ":"41234567","SK":"912123456","SL":"25123456","SM":"66661212","SN":"701234567","SO":"71123456","SR":"7412345","SS":"977123456","ST":"9812345","SV":"70123456","SX":"7215205678","SY":"944567890","SZ":"76123456","TA":"8999","TC":"6492311234","TD":"63012345","TG":"90112345","TH":"812345678","TJ":"917123456","TK":"7290","TL":"77212345","TM":"66123456","TN":"20123456","TO":"7715123","TR":"5012345678","TT":"8682911234","TV":"901234","TW":"912345678","TZ":"621234567","UA":"501234567","UG":"712345678","US":"2015550123","UY":"94231234","UZ":"912345678","VA":"3123456789","VC":"7844301234","VE":"4121234567","VG":"2843001234","VI":"3406421234","VN":"912345678","VU":"5912345","WF":"821234","WS":"7212345","XK":"43201234","YE":"712345678","YT":"639012345","ZA":"711234567","ZM":"955123456","ZW":"712345678"});
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -2647,17 +2735,17 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _metadata_mobile_json_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../metadata.mobile.json.js */ "./node_modules/libphonenumber-js/metadata.mobile.json.js");
|
||||
/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../core/index.js */ "./node_modules/libphonenumber-js/es6/AsYouType.js");
|
||||
// Importing from a ".js" file is a workaround for Node.js "ES Modules"
|
||||
// importing system which is even uncapable of importing "*.json" files.
|
||||
|
||||
|
||||
|
||||
|
||||
function AsYouType(country) {
|
||||
return _core_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].call(this, country, _metadata_mobile_json_js__WEBPACK_IMPORTED_MODULE_0__["default"])
|
||||
}
|
||||
|
||||
AsYouType.prototype = Object.create(_core_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].prototype, {})
|
||||
// Importing from a ".js" file is a workaround for Node.js "ES Modules"
|
||||
// importing system which is even uncapable of importing "*.json" files.
|
||||
|
||||
|
||||
|
||||
|
||||
function AsYouType(country) {
|
||||
return _core_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].call(this, country, _metadata_mobile_json_js__WEBPACK_IMPORTED_MODULE_0__["default"])
|
||||
}
|
||||
|
||||
AsYouType.prototype = Object.create(_core_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].prototype, {})
|
||||
AsYouType.prototype.constructor = AsYouType
|
||||
|
||||
/***/ }),
|
||||
@@ -2674,11 +2762,11 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _withMetadataArgument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./withMetadataArgument.js */ "./node_modules/libphonenumber-js/mobile/exports/withMetadataArgument.js");
|
||||
/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../core/index.js */ "./node_modules/libphonenumber-js/es6/getExampleNumber.js");
|
||||
|
||||
|
||||
|
||||
function getExampleNumber() {
|
||||
return (0,_withMetadataArgument_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_core_index_js__WEBPACK_IMPORTED_MODULE_1__["default"], arguments)
|
||||
|
||||
|
||||
|
||||
function getExampleNumber() {
|
||||
return (0,_withMetadataArgument_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_core_index_js__WEBPACK_IMPORTED_MODULE_1__["default"], arguments)
|
||||
}
|
||||
|
||||
/***/ })
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+670
-454
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -3073,322 +3073,6 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/int64-buffer/int64-buffer.js":
|
||||
/*!***************************************************!*\
|
||||
!*** ./node_modules/int64-buffer/int64-buffer.js ***!
|
||||
\***************************************************/
|
||||
/***/ (function(__unused_webpack_module, exports) {
|
||||
|
||||
// int64-buffer.js
|
||||
|
||||
/*jshint -W018 */ // Confusing use of '!'.
|
||||
/*jshint -W030 */ // Expected an assignment or function call and instead saw an expression.
|
||||
/*jshint -W093 */ // Did you mean to return a conditional instead of an assignment?
|
||||
|
||||
var Uint64BE, Int64BE, Uint64LE, Int64LE;
|
||||
|
||||
!function(exports) {
|
||||
// constants
|
||||
|
||||
var UNDEFINED = "undefined";
|
||||
var BUFFER = (UNDEFINED !== typeof Buffer) && Buffer;
|
||||
var UINT8ARRAY = (UNDEFINED !== typeof Uint8Array) && Uint8Array;
|
||||
var ARRAYBUFFER = (UNDEFINED !== typeof ArrayBuffer) && ArrayBuffer;
|
||||
var ZERO = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||
var isArray = Array.isArray || _isArray;
|
||||
var BIT32 = 4294967296;
|
||||
var BIT24 = 16777216;
|
||||
|
||||
// storage class
|
||||
|
||||
var storage; // Array;
|
||||
|
||||
// generate classes
|
||||
|
||||
Uint64BE = factory("Uint64BE", true, true);
|
||||
Int64BE = factory("Int64BE", true, false);
|
||||
Uint64LE = factory("Uint64LE", false, true);
|
||||
Int64LE = factory("Int64LE", false, false);
|
||||
|
||||
// class factory
|
||||
|
||||
function factory(name, bigendian, unsigned) {
|
||||
var posH = bigendian ? 0 : 4;
|
||||
var posL = bigendian ? 4 : 0;
|
||||
var pos0 = bigendian ? 0 : 3;
|
||||
var pos1 = bigendian ? 1 : 2;
|
||||
var pos2 = bigendian ? 2 : 1;
|
||||
var pos3 = bigendian ? 3 : 0;
|
||||
var fromPositive = bigendian ? fromPositiveBE : fromPositiveLE;
|
||||
var fromNegative = bigendian ? fromNegativeBE : fromNegativeLE;
|
||||
var proto = Int64.prototype;
|
||||
var isName = "is" + name;
|
||||
var _isInt64 = "_" + isName;
|
||||
|
||||
// properties
|
||||
proto.buffer = void 0;
|
||||
proto.offset = 0;
|
||||
proto[_isInt64] = true;
|
||||
|
||||
// methods
|
||||
proto.toNumber = toNumber;
|
||||
proto.toString = toString;
|
||||
proto.toJSON = toNumber;
|
||||
proto.toArray = toArray;
|
||||
|
||||
// add .toBuffer() method only when Buffer available
|
||||
if (BUFFER) proto.toBuffer = toBuffer;
|
||||
|
||||
// add .toArrayBuffer() method only when Uint8Array available
|
||||
if (UINT8ARRAY) proto.toArrayBuffer = toArrayBuffer;
|
||||
|
||||
// isUint64BE, isInt64BE
|
||||
Int64[isName] = isInt64;
|
||||
|
||||
// CommonJS
|
||||
exports[name] = Int64;
|
||||
|
||||
return Int64;
|
||||
|
||||
// constructor
|
||||
function Int64(buffer, offset, value, raddix) {
|
||||
if (!(this instanceof Int64)) return new Int64(buffer, offset, value, raddix);
|
||||
return init(this, buffer, offset, value, raddix);
|
||||
}
|
||||
|
||||
// isUint64BE, isInt64BE
|
||||
function isInt64(b) {
|
||||
return !!(b && b[_isInt64]);
|
||||
}
|
||||
|
||||
// initializer
|
||||
function init(that, buffer, offset, value, raddix) {
|
||||
if (UINT8ARRAY && ARRAYBUFFER) {
|
||||
if (buffer instanceof ARRAYBUFFER) buffer = new UINT8ARRAY(buffer);
|
||||
if (value instanceof ARRAYBUFFER) value = new UINT8ARRAY(value);
|
||||
}
|
||||
|
||||
// Int64BE() style
|
||||
if (!buffer && !offset && !value && !storage) {
|
||||
// shortcut to initialize with zero
|
||||
that.buffer = newArray(ZERO, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Int64BE(value, raddix) style
|
||||
if (!isValidBuffer(buffer, offset)) {
|
||||
var _storage = storage || Array;
|
||||
raddix = offset;
|
||||
value = buffer;
|
||||
offset = 0;
|
||||
buffer = (storage === BUFFER) ? BUFFER.alloc(8) : new _storage(8);
|
||||
}
|
||||
|
||||
that.buffer = buffer;
|
||||
that.offset = offset |= 0;
|
||||
|
||||
// Int64BE(buffer, offset) style
|
||||
if (UNDEFINED === typeof value) return;
|
||||
|
||||
// Int64BE(buffer, offset, value, raddix) style
|
||||
if ("string" === typeof value) {
|
||||
fromString(buffer, offset, value, raddix || 10);
|
||||
} else if (isValidBuffer(value, raddix)) {
|
||||
fromArray(buffer, offset, value, raddix);
|
||||
} else if ("number" === typeof raddix) {
|
||||
writeInt32(buffer, offset + posH, value); // high
|
||||
writeInt32(buffer, offset + posL, raddix); // low
|
||||
} else if (value > 0) {
|
||||
fromPositive(buffer, offset, value); // positive
|
||||
} else if (value < 0) {
|
||||
fromNegative(buffer, offset, value); // negative
|
||||
} else {
|
||||
fromArray(buffer, offset, ZERO, 0); // zero, NaN and others
|
||||
}
|
||||
}
|
||||
|
||||
function fromString(buffer, offset, str, raddix) {
|
||||
var pos = 0;
|
||||
var len = str.length;
|
||||
var high = 0;
|
||||
var low = 0;
|
||||
if (str[0] === "-") pos++;
|
||||
var sign = pos;
|
||||
while (pos < len) {
|
||||
var chr = parseInt(str[pos++], raddix);
|
||||
if (!(chr >= 0)) break; // NaN
|
||||
low = low * raddix + chr;
|
||||
high = high * raddix + Math.floor(low / BIT32);
|
||||
low %= BIT32;
|
||||
}
|
||||
if (sign) {
|
||||
high = ~high;
|
||||
if (low) {
|
||||
low = BIT32 - low;
|
||||
} else {
|
||||
high++;
|
||||
}
|
||||
}
|
||||
writeInt32(buffer, offset + posH, high);
|
||||
writeInt32(buffer, offset + posL, low);
|
||||
}
|
||||
|
||||
function toNumber() {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
var high = readInt32(buffer, offset + posH);
|
||||
var low = readInt32(buffer, offset + posL);
|
||||
if (!unsigned) high |= 0; // a trick to get signed
|
||||
return high ? (high * BIT32 + low) : low;
|
||||
}
|
||||
|
||||
function toString(radix) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
var high = readInt32(buffer, offset + posH);
|
||||
var low = readInt32(buffer, offset + posL);
|
||||
var str = "";
|
||||
var sign = !unsigned && (high & 0x80000000);
|
||||
if (sign) {
|
||||
high = ~high;
|
||||
low = BIT32 - low;
|
||||
}
|
||||
radix = radix || 10;
|
||||
while (1) {
|
||||
var mod = (high % radix) * BIT32 + low;
|
||||
high = Math.floor(high / radix);
|
||||
low = Math.floor(mod / radix);
|
||||
str = (mod % radix).toString(radix) + str;
|
||||
if (!high && !low) break;
|
||||
}
|
||||
if (sign) {
|
||||
str = "-" + str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
function writeInt32(buffer, offset, value) {
|
||||
buffer[offset + pos3] = value & 255;
|
||||
value = value >> 8;
|
||||
buffer[offset + pos2] = value & 255;
|
||||
value = value >> 8;
|
||||
buffer[offset + pos1] = value & 255;
|
||||
value = value >> 8;
|
||||
buffer[offset + pos0] = value & 255;
|
||||
}
|
||||
|
||||
function readInt32(buffer, offset) {
|
||||
return (buffer[offset + pos0] * BIT24) +
|
||||
(buffer[offset + pos1] << 16) +
|
||||
(buffer[offset + pos2] << 8) +
|
||||
buffer[offset + pos3];
|
||||
}
|
||||
}
|
||||
|
||||
function toArray(raw) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
storage = null; // Array
|
||||
|
||||
if (raw !== false && isArray(buffer)) {
|
||||
return (buffer.length === 8) ? buffer : buffer.slice(offset, offset + 8);
|
||||
}
|
||||
|
||||
return newArray(buffer, offset);
|
||||
}
|
||||
|
||||
function toBuffer(raw) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
storage = BUFFER;
|
||||
|
||||
if (raw !== false && BUFFER.isBuffer(buffer)) {
|
||||
return (buffer.length === 8) ? buffer : buffer.slice(offset, offset + 8);
|
||||
}
|
||||
|
||||
// Buffer.from(arraybuffer) available since Node v4.5.0
|
||||
// https://nodejs.org/en/blog/release/v4.5.0/
|
||||
return BUFFER.from(toArrayBuffer.call(this, raw));
|
||||
}
|
||||
|
||||
function toArrayBuffer(raw) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
var arrbuf = buffer.buffer;
|
||||
storage = UINT8ARRAY;
|
||||
|
||||
// arrbuf.slice() ignores buffer.offset until Node v8.0.0
|
||||
if (raw !== false && !buffer.offset && (arrbuf instanceof ARRAYBUFFER)) {
|
||||
return (arrbuf.byteLength === 8) ? arrbuf : arrbuf.slice(offset, offset + 8);
|
||||
}
|
||||
|
||||
var dest = new UINT8ARRAY(8);
|
||||
fromArray(dest, 0, buffer, offset);
|
||||
return dest.buffer;
|
||||
}
|
||||
|
||||
function isValidBuffer(buffer, offset) {
|
||||
var len = buffer && buffer.length;
|
||||
offset |= 0;
|
||||
return len && (offset + 8 <= len) && ("string" !== typeof buffer[offset]);
|
||||
}
|
||||
|
||||
function fromArray(destbuf, destoff, srcbuf, srcoff) {
|
||||
destoff |= 0;
|
||||
srcoff |= 0;
|
||||
for (var i = 0; i < 8; i++) {
|
||||
destbuf[destoff++] = srcbuf[srcoff++] & 255;
|
||||
}
|
||||
}
|
||||
|
||||
function newArray(buffer, offset) {
|
||||
return Array.prototype.slice.call(buffer, offset, offset + 8);
|
||||
}
|
||||
|
||||
function fromPositiveBE(buffer, offset, value) {
|
||||
var pos = offset + 8;
|
||||
while (pos > offset) {
|
||||
buffer[--pos] = value & 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
function fromNegativeBE(buffer, offset, value) {
|
||||
var pos = offset + 8;
|
||||
value++;
|
||||
while (pos > offset) {
|
||||
buffer[--pos] = ((-value) & 255) ^ 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
function fromPositiveLE(buffer, offset, value) {
|
||||
var end = offset + 8;
|
||||
while (offset < end) {
|
||||
buffer[offset++] = value & 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
function fromNegativeLE(buffer, offset, value) {
|
||||
var end = offset + 8;
|
||||
value++;
|
||||
while (offset < end) {
|
||||
buffer[offset++] = ((-value) & 255) ^ 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/retrofox/is-array
|
||||
function _isArray(val) {
|
||||
return !!val && "[object Array]" == Object.prototype.toString.call(val);
|
||||
}
|
||||
|
||||
}( true && typeof exports.nodeName !== 'string' ? exports : (this || {}));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/webm-duration-fix/lib/ebml/EBML.js":
|
||||
@@ -7352,6 +7036,322 @@ function fixWebmDuration(blob) {
|
||||
exports["default"] = fixWebmDuration;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/int64-buffer/int64-buffer.js":
|
||||
/*!***************************************************!*\
|
||||
!*** ./node_modules/int64-buffer/int64-buffer.js ***!
|
||||
\***************************************************/
|
||||
/***/ (function(__unused_webpack_module, exports) {
|
||||
|
||||
// int64-buffer.js
|
||||
|
||||
/*jshint -W018 */ // Confusing use of '!'.
|
||||
/*jshint -W030 */ // Expected an assignment or function call and instead saw an expression.
|
||||
/*jshint -W093 */ // Did you mean to return a conditional instead of an assignment?
|
||||
|
||||
var Uint64BE, Int64BE, Uint64LE, Int64LE;
|
||||
|
||||
!function(exports) {
|
||||
// constants
|
||||
|
||||
var UNDEFINED = "undefined";
|
||||
var BUFFER = (UNDEFINED !== typeof Buffer) && Buffer;
|
||||
var UINT8ARRAY = (UNDEFINED !== typeof Uint8Array) && Uint8Array;
|
||||
var ARRAYBUFFER = (UNDEFINED !== typeof ArrayBuffer) && ArrayBuffer;
|
||||
var ZERO = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||
var isArray = Array.isArray || _isArray;
|
||||
var BIT32 = 4294967296;
|
||||
var BIT24 = 16777216;
|
||||
|
||||
// storage class
|
||||
|
||||
var storage; // Array;
|
||||
|
||||
// generate classes
|
||||
|
||||
Uint64BE = factory("Uint64BE", true, true);
|
||||
Int64BE = factory("Int64BE", true, false);
|
||||
Uint64LE = factory("Uint64LE", false, true);
|
||||
Int64LE = factory("Int64LE", false, false);
|
||||
|
||||
// class factory
|
||||
|
||||
function factory(name, bigendian, unsigned) {
|
||||
var posH = bigendian ? 0 : 4;
|
||||
var posL = bigendian ? 4 : 0;
|
||||
var pos0 = bigendian ? 0 : 3;
|
||||
var pos1 = bigendian ? 1 : 2;
|
||||
var pos2 = bigendian ? 2 : 1;
|
||||
var pos3 = bigendian ? 3 : 0;
|
||||
var fromPositive = bigendian ? fromPositiveBE : fromPositiveLE;
|
||||
var fromNegative = bigendian ? fromNegativeBE : fromNegativeLE;
|
||||
var proto = Int64.prototype;
|
||||
var isName = "is" + name;
|
||||
var _isInt64 = "_" + isName;
|
||||
|
||||
// properties
|
||||
proto.buffer = void 0;
|
||||
proto.offset = 0;
|
||||
proto[_isInt64] = true;
|
||||
|
||||
// methods
|
||||
proto.toNumber = toNumber;
|
||||
proto.toString = toString;
|
||||
proto.toJSON = toNumber;
|
||||
proto.toArray = toArray;
|
||||
|
||||
// add .toBuffer() method only when Buffer available
|
||||
if (BUFFER) proto.toBuffer = toBuffer;
|
||||
|
||||
// add .toArrayBuffer() method only when Uint8Array available
|
||||
if (UINT8ARRAY) proto.toArrayBuffer = toArrayBuffer;
|
||||
|
||||
// isUint64BE, isInt64BE
|
||||
Int64[isName] = isInt64;
|
||||
|
||||
// CommonJS
|
||||
exports[name] = Int64;
|
||||
|
||||
return Int64;
|
||||
|
||||
// constructor
|
||||
function Int64(buffer, offset, value, raddix) {
|
||||
if (!(this instanceof Int64)) return new Int64(buffer, offset, value, raddix);
|
||||
return init(this, buffer, offset, value, raddix);
|
||||
}
|
||||
|
||||
// isUint64BE, isInt64BE
|
||||
function isInt64(b) {
|
||||
return !!(b && b[_isInt64]);
|
||||
}
|
||||
|
||||
// initializer
|
||||
function init(that, buffer, offset, value, raddix) {
|
||||
if (UINT8ARRAY && ARRAYBUFFER) {
|
||||
if (buffer instanceof ARRAYBUFFER) buffer = new UINT8ARRAY(buffer);
|
||||
if (value instanceof ARRAYBUFFER) value = new UINT8ARRAY(value);
|
||||
}
|
||||
|
||||
// Int64BE() style
|
||||
if (!buffer && !offset && !value && !storage) {
|
||||
// shortcut to initialize with zero
|
||||
that.buffer = newArray(ZERO, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Int64BE(value, raddix) style
|
||||
if (!isValidBuffer(buffer, offset)) {
|
||||
var _storage = storage || Array;
|
||||
raddix = offset;
|
||||
value = buffer;
|
||||
offset = 0;
|
||||
buffer = (storage === BUFFER) ? BUFFER.alloc(8) : new _storage(8);
|
||||
}
|
||||
|
||||
that.buffer = buffer;
|
||||
that.offset = offset |= 0;
|
||||
|
||||
// Int64BE(buffer, offset) style
|
||||
if (UNDEFINED === typeof value) return;
|
||||
|
||||
// Int64BE(buffer, offset, value, raddix) style
|
||||
if ("string" === typeof value) {
|
||||
fromString(buffer, offset, value, raddix || 10);
|
||||
} else if (isValidBuffer(value, raddix)) {
|
||||
fromArray(buffer, offset, value, raddix);
|
||||
} else if ("number" === typeof raddix) {
|
||||
writeInt32(buffer, offset + posH, value); // high
|
||||
writeInt32(buffer, offset + posL, raddix); // low
|
||||
} else if (value > 0) {
|
||||
fromPositive(buffer, offset, value); // positive
|
||||
} else if (value < 0) {
|
||||
fromNegative(buffer, offset, value); // negative
|
||||
} else {
|
||||
fromArray(buffer, offset, ZERO, 0); // zero, NaN and others
|
||||
}
|
||||
}
|
||||
|
||||
function fromString(buffer, offset, str, raddix) {
|
||||
var pos = 0;
|
||||
var len = str.length;
|
||||
var high = 0;
|
||||
var low = 0;
|
||||
if (str[0] === "-") pos++;
|
||||
var sign = pos;
|
||||
while (pos < len) {
|
||||
var chr = parseInt(str[pos++], raddix);
|
||||
if (!(chr >= 0)) break; // NaN
|
||||
low = low * raddix + chr;
|
||||
high = high * raddix + Math.floor(low / BIT32);
|
||||
low %= BIT32;
|
||||
}
|
||||
if (sign) {
|
||||
high = ~high;
|
||||
if (low) {
|
||||
low = BIT32 - low;
|
||||
} else {
|
||||
high++;
|
||||
}
|
||||
}
|
||||
writeInt32(buffer, offset + posH, high);
|
||||
writeInt32(buffer, offset + posL, low);
|
||||
}
|
||||
|
||||
function toNumber() {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
var high = readInt32(buffer, offset + posH);
|
||||
var low = readInt32(buffer, offset + posL);
|
||||
if (!unsigned) high |= 0; // a trick to get signed
|
||||
return high ? (high * BIT32 + low) : low;
|
||||
}
|
||||
|
||||
function toString(radix) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
var high = readInt32(buffer, offset + posH);
|
||||
var low = readInt32(buffer, offset + posL);
|
||||
var str = "";
|
||||
var sign = !unsigned && (high & 0x80000000);
|
||||
if (sign) {
|
||||
high = ~high;
|
||||
low = BIT32 - low;
|
||||
}
|
||||
radix = radix || 10;
|
||||
while (1) {
|
||||
var mod = (high % radix) * BIT32 + low;
|
||||
high = Math.floor(high / radix);
|
||||
low = Math.floor(mod / radix);
|
||||
str = (mod % radix).toString(radix) + str;
|
||||
if (!high && !low) break;
|
||||
}
|
||||
if (sign) {
|
||||
str = "-" + str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
function writeInt32(buffer, offset, value) {
|
||||
buffer[offset + pos3] = value & 255;
|
||||
value = value >> 8;
|
||||
buffer[offset + pos2] = value & 255;
|
||||
value = value >> 8;
|
||||
buffer[offset + pos1] = value & 255;
|
||||
value = value >> 8;
|
||||
buffer[offset + pos0] = value & 255;
|
||||
}
|
||||
|
||||
function readInt32(buffer, offset) {
|
||||
return (buffer[offset + pos0] * BIT24) +
|
||||
(buffer[offset + pos1] << 16) +
|
||||
(buffer[offset + pos2] << 8) +
|
||||
buffer[offset + pos3];
|
||||
}
|
||||
}
|
||||
|
||||
function toArray(raw) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
storage = null; // Array
|
||||
|
||||
if (raw !== false && isArray(buffer)) {
|
||||
return (buffer.length === 8) ? buffer : buffer.slice(offset, offset + 8);
|
||||
}
|
||||
|
||||
return newArray(buffer, offset);
|
||||
}
|
||||
|
||||
function toBuffer(raw) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
storage = BUFFER;
|
||||
|
||||
if (raw !== false && BUFFER.isBuffer(buffer)) {
|
||||
return (buffer.length === 8) ? buffer : buffer.slice(offset, offset + 8);
|
||||
}
|
||||
|
||||
// Buffer.from(arraybuffer) available since Node v4.5.0
|
||||
// https://nodejs.org/en/blog/release/v4.5.0/
|
||||
return BUFFER.from(toArrayBuffer.call(this, raw));
|
||||
}
|
||||
|
||||
function toArrayBuffer(raw) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
var arrbuf = buffer.buffer;
|
||||
storage = UINT8ARRAY;
|
||||
|
||||
// arrbuf.slice() ignores buffer.offset until Node v8.0.0
|
||||
if (raw !== false && !buffer.offset && (arrbuf instanceof ARRAYBUFFER)) {
|
||||
return (arrbuf.byteLength === 8) ? arrbuf : arrbuf.slice(offset, offset + 8);
|
||||
}
|
||||
|
||||
var dest = new UINT8ARRAY(8);
|
||||
fromArray(dest, 0, buffer, offset);
|
||||
return dest.buffer;
|
||||
}
|
||||
|
||||
function isValidBuffer(buffer, offset) {
|
||||
var len = buffer && buffer.length;
|
||||
offset |= 0;
|
||||
return len && (offset + 8 <= len) && ("string" !== typeof buffer[offset]);
|
||||
}
|
||||
|
||||
function fromArray(destbuf, destoff, srcbuf, srcoff) {
|
||||
destoff |= 0;
|
||||
srcoff |= 0;
|
||||
for (var i = 0; i < 8; i++) {
|
||||
destbuf[destoff++] = srcbuf[srcoff++] & 255;
|
||||
}
|
||||
}
|
||||
|
||||
function newArray(buffer, offset) {
|
||||
return Array.prototype.slice.call(buffer, offset, offset + 8);
|
||||
}
|
||||
|
||||
function fromPositiveBE(buffer, offset, value) {
|
||||
var pos = offset + 8;
|
||||
while (pos > offset) {
|
||||
buffer[--pos] = value & 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
function fromNegativeBE(buffer, offset, value) {
|
||||
var pos = offset + 8;
|
||||
value++;
|
||||
while (pos > offset) {
|
||||
buffer[--pos] = ((-value) & 255) ^ 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
function fromPositiveLE(buffer, offset, value) {
|
||||
var end = offset + 8;
|
||||
while (offset < end) {
|
||||
buffer[offset++] = value & 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
function fromNegativeLE(buffer, offset, value) {
|
||||
var end = offset + 8;
|
||||
value++;
|
||||
while (offset < end) {
|
||||
buffer[offset++] = ((-value) & 255) ^ 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/retrofox/is-array
|
||||
function _isArray(val) {
|
||||
return !!val && "[object Array]" == Object.prototype.toString.call(val);
|
||||
}
|
||||
|
||||
}( true && typeof exports.nodeName !== 'string' ? exports : (this || {}));
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user