gearboxdownloadmodal 4.0.7 → 4.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -76,5 +76,5 @@ doc.body (`+e+`):
|
|
|
76
76
|
`+i:"")+`
|
|
77
77
|
|
|
78
78
|
The above lifecycles should be removed. Learn more about this warning here:
|
|
79
|
-
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=Si,t.componentWillReceiveProps=Mi),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=Ei;var A=t.componentDidUpdate;t.componentDidUpdate=function(s,u,d){var q=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:d;A.call(this,s,u,q)}}return e}const Ls=eo(Object.freeze(Object.defineProperty({__proto__:null,polyfill:Es},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.bodyOpenClassName=Fe.portalClassName=void 0;var Li=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ys=function(){function e(t,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),Yi=b,rr=xt(Yi),zs=_i,nr=xt(zs),ks=Yt,X=xt(ks),js=Ms,zi=xt(js),Js=Ee,Ns=Gs(Js),Qe=Le,ki=xt(Qe),Ds=Ls;function Gs(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function xt(e){return e&&e.__esModule?e:{default:e}}function Rs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ji(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function Ts(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Hs=Fe.portalClassName="ReactModalPortal",Xs=Fe.bodyOpenClassName="ReactModal__Body--open",rt=Qe.canUseDOM&&nr.default.createPortal!==void 0,Pr=function(t){return document.createElement(t)},Ji=function(){return rt?nr.default.createPortal:nr.default.unstable_renderSubtreeIntoContainer};function ir(e){return e()}var lt=function(e){Ts(t,e);function t(){var r,n,i,o;Rs(this,t);for(var a=arguments.length,A=Array(a),c=0;c<a;c++)A[c]=arguments[c];return o=(n=(i=ji(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this].concat(A))),i),i.removePortal=function(){!rt&&nr.default.unmountComponentAtNode(i.node);var s=ir(i.props.parentSelector);s&&s.contains(i.node)?s.removeChild(i.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},i.portalRef=function(s){i.portal=s},i.renderPortal=function(s){var u=Ji(),d=u(i,rr.default.createElement(zi.default,Li({defaultStyles:t.defaultStyles},s)),i.node);i.portalRef(d)},n),ji(i,o)}return Ys(t,[{key:"componentDidMount",value:function(){if(Qe.canUseDOM){rt||(this.node=Pr("div")),this.node.className=this.props.portalClassName;var n=ir(this.props.parentSelector);n.appendChild(this.node),!rt&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(n){var i=ir(n.parentSelector),o=ir(this.props.parentSelector);return{prevParent:i,nextParent:o}}},{key:"componentDidUpdate",value:function(n,i,o){if(Qe.canUseDOM){var a=this.props,A=a.isOpen,c=a.portalClassName;n.portalClassName!==c&&(this.node.className=c);var s=o.prevParent,u=o.nextParent;u!==s&&(s.removeChild(this.node),u.appendChild(this.node)),!(!n.isOpen&&!A)&&!rt&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!Qe.canUseDOM||!this.node||!this.portal)){var n=this.portal.state,i=Date.now(),o=n.isOpen&&this.props.closeTimeoutMS&&(n.closesAt||i+this.props.closeTimeoutMS);o?(n.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,o-i)):this.removePortal()}}},{key:"render",value:function(){if(!Qe.canUseDOM||!rt)return null;!this.node&&rt&&(this.node=Pr("div"));var n=Ji();return n(rr.default.createElement(zi.default,Li({ref:this.portalRef,defaultStyles:t.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(n){Ns.setElement(n)}}]),t}(Yi.Component);lt.propTypes={isOpen:X.default.bool.isRequired,style:X.default.shape({content:X.default.object,overlay:X.default.object}),portalClassName:X.default.string,bodyOpenClassName:X.default.string,htmlOpenClassName:X.default.string,className:X.default.oneOfType([X.default.string,X.default.shape({base:X.default.string.isRequired,afterOpen:X.default.string.isRequired,beforeClose:X.default.string.isRequired})]),overlayClassName:X.default.oneOfType([X.default.string,X.default.shape({base:X.default.string.isRequired,afterOpen:X.default.string.isRequired,beforeClose:X.default.string.isRequired})]),appElement:X.default.oneOfType([X.default.instanceOf(ki.default),X.default.instanceOf(Qe.SafeHTMLCollection),X.default.instanceOf(Qe.SafeNodeList),X.default.arrayOf(X.default.instanceOf(ki.default))]),onAfterOpen:X.default.func,onRequestClose:X.default.func,closeTimeoutMS:X.default.number,ariaHideApp:X.default.bool,shouldFocusAfterRender:X.default.bool,shouldCloseOnOverlayClick:X.default.bool,shouldReturnFocusAfterClose:X.default.bool,preventScroll:X.default.bool,parentSelector:X.default.func,aria:X.default.object,data:X.default.object,role:X.default.string,contentLabel:X.default.string,shouldCloseOnEsc:X.default.bool,overlayRef:X.default.func,contentRef:X.default.func,id:X.default.string,overlayElement:X.default.func,contentElement:X.default.func},lt.defaultProps={isOpen:!1,portalClassName:Hs,bodyOpenClassName:Xs,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(t,r){return rr.default.createElement("div",t,r)},contentElement:function(t,r){return rr.default.createElement("div",t,r)}},lt.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,Ds.polyfill)(lt),process.env.NODE_ENV!=="production"&&(lt.setCreateHTMLElement=function(e){return Pr=e}),Fe.default=lt,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=Fe,n=i(r);function i(o){return o&&o.__esModule?o:{default:o}}t.default=n.default,e.exports=t.default}(Dr,Dr.exports);var Qs=Dr.exports;const Ps=$i(Qs),Vs=({visible:e,closeModal:t,versionId:r,gameId:n,versionName:i,playableId:o,typeOfProduct:a,api:A,user:c,title:s,iframeUrl:u,handleDownloadError:d,fetchFileUrl:q})=>{const[f,h]=b.useState(window.innerWidth),[g,Z]=b.useState(!1),[K,k]=b.useState(u),N=async()=>{a==="Flex"?await $t({_id:r,network:"default"},A).then(E=>{Z(!0),k(E.url)}):await bt(A,r,wt(5),"default",!1,0,{}).then(E=>{Z(!0),k(E.url)})};return b.useEffect(()=>{e?g||(N(),Z(!0)):Z(!1)},[e]),b.useEffect(()=>{const E=()=>{h(window.innerWidth)};return window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[]),m.jsxs(Ps,{isOpen:e,ariaHideApp:!1,onRequestClose:t,style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:f>1440?"700px":"650px",width:f>1440?"920px":"975px",overflow:"hidden",paddingTop:"0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:[m.jsx("div",{style:{position:"absolute",top:"1.25rem",right:"1.25rem",zIndex:50},children:m.jsx("button",{onClick:t,style:{color:"#718096",cursor:"pointer",backgroundColor:"#F7F7F8"},children:m.jsx("img",{src:no,alt:"close image"})})}),m.jsxs(io,{children:[g?m.jsx(dA,{versionName:i,versionId:r,typeOfProduct:a,iframeUrl:K,api:A,fetchFileUrl:q}):m.jsx(m.Fragment,{children:m.jsx("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"5px",height:f>1440?"650px":"625px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:m.jsx("img",{width:"75px",height:"75px",src:yi,alt:"pf-logo-gif"})})}),m.jsx(DA,{visible:e,versionId:r,playableId:o,gameId:n,typeOfProduct:a,api:A,user:c,title:s,handleDownloadError:d,fetchFileUrl:q})]}),m.jsx(jr,{})]})};Ge.DownloadModal=Vs,Object.defineProperty(Ge,Symbol.toStringTag,{value:"Module"})});
|
|
79
|
+
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=Si,t.componentWillReceiveProps=Mi),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=Ei;var A=t.componentDidUpdate;t.componentDidUpdate=function(s,u,d){var q=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:d;A.call(this,s,u,q)}}return e}const Ls=eo(Object.freeze(Object.defineProperty({__proto__:null,polyfill:Es},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.bodyOpenClassName=Fe.portalClassName=void 0;var Li=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ys=function(){function e(t,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),Yi=b,rr=xt(Yi),zs=_i,nr=xt(zs),ks=Yt,X=xt(ks),js=Ms,zi=xt(js),Js=Ee,Ns=Gs(Js),Qe=Le,ki=xt(Qe),Ds=Ls;function Gs(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function xt(e){return e&&e.__esModule?e:{default:e}}function Rs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ji(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function Ts(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Hs=Fe.portalClassName="ReactModalPortal",Xs=Fe.bodyOpenClassName="ReactModal__Body--open",rt=Qe.canUseDOM&&nr.default.createPortal!==void 0,Pr=function(t){return document.createElement(t)},Ji=function(){return rt?nr.default.createPortal:nr.default.unstable_renderSubtreeIntoContainer};function ir(e){return e()}var lt=function(e){Ts(t,e);function t(){var r,n,i,o;Rs(this,t);for(var a=arguments.length,A=Array(a),c=0;c<a;c++)A[c]=arguments[c];return o=(n=(i=ji(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this].concat(A))),i),i.removePortal=function(){!rt&&nr.default.unmountComponentAtNode(i.node);var s=ir(i.props.parentSelector);s&&s.contains(i.node)?s.removeChild(i.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},i.portalRef=function(s){i.portal=s},i.renderPortal=function(s){var u=Ji(),d=u(i,rr.default.createElement(zi.default,Li({defaultStyles:t.defaultStyles},s)),i.node);i.portalRef(d)},n),ji(i,o)}return Ys(t,[{key:"componentDidMount",value:function(){if(Qe.canUseDOM){rt||(this.node=Pr("div")),this.node.className=this.props.portalClassName;var n=ir(this.props.parentSelector);n.appendChild(this.node),!rt&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(n){var i=ir(n.parentSelector),o=ir(this.props.parentSelector);return{prevParent:i,nextParent:o}}},{key:"componentDidUpdate",value:function(n,i,o){if(Qe.canUseDOM){var a=this.props,A=a.isOpen,c=a.portalClassName;n.portalClassName!==c&&(this.node.className=c);var s=o.prevParent,u=o.nextParent;u!==s&&(s.removeChild(this.node),u.appendChild(this.node)),!(!n.isOpen&&!A)&&!rt&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!Qe.canUseDOM||!this.node||!this.portal)){var n=this.portal.state,i=Date.now(),o=n.isOpen&&this.props.closeTimeoutMS&&(n.closesAt||i+this.props.closeTimeoutMS);o?(n.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,o-i)):this.removePortal()}}},{key:"render",value:function(){if(!Qe.canUseDOM||!rt)return null;!this.node&&rt&&(this.node=Pr("div"));var n=Ji();return n(rr.default.createElement(zi.default,Li({ref:this.portalRef,defaultStyles:t.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(n){Ns.setElement(n)}}]),t}(Yi.Component);lt.propTypes={isOpen:X.default.bool.isRequired,style:X.default.shape({content:X.default.object,overlay:X.default.object}),portalClassName:X.default.string,bodyOpenClassName:X.default.string,htmlOpenClassName:X.default.string,className:X.default.oneOfType([X.default.string,X.default.shape({base:X.default.string.isRequired,afterOpen:X.default.string.isRequired,beforeClose:X.default.string.isRequired})]),overlayClassName:X.default.oneOfType([X.default.string,X.default.shape({base:X.default.string.isRequired,afterOpen:X.default.string.isRequired,beforeClose:X.default.string.isRequired})]),appElement:X.default.oneOfType([X.default.instanceOf(ki.default),X.default.instanceOf(Qe.SafeHTMLCollection),X.default.instanceOf(Qe.SafeNodeList),X.default.arrayOf(X.default.instanceOf(ki.default))]),onAfterOpen:X.default.func,onRequestClose:X.default.func,closeTimeoutMS:X.default.number,ariaHideApp:X.default.bool,shouldFocusAfterRender:X.default.bool,shouldCloseOnOverlayClick:X.default.bool,shouldReturnFocusAfterClose:X.default.bool,preventScroll:X.default.bool,parentSelector:X.default.func,aria:X.default.object,data:X.default.object,role:X.default.string,contentLabel:X.default.string,shouldCloseOnEsc:X.default.bool,overlayRef:X.default.func,contentRef:X.default.func,id:X.default.string,overlayElement:X.default.func,contentElement:X.default.func},lt.defaultProps={isOpen:!1,portalClassName:Hs,bodyOpenClassName:Xs,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(t,r){return rr.default.createElement("div",t,r)},contentElement:function(t,r){return rr.default.createElement("div",t,r)}},lt.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,Ds.polyfill)(lt),process.env.NODE_ENV!=="production"&&(lt.setCreateHTMLElement=function(e){return Pr=e}),Fe.default=lt,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=Fe,n=i(r);function i(o){return o&&o.__esModule?o:{default:o}}t.default=n.default,e.exports=t.default}(Dr,Dr.exports);var Qs=Dr.exports;const Ps=$i(Qs),Vs=({visible:e,closeModal:t,versionId:r,gameId:n,versionName:i,playableId:o,typeOfProduct:a,api:A,user:c,title:s,iframeUrl:u,handleDownloadError:d,fetchFileUrl:q})=>{const[f,h]=b.useState(window.innerWidth),[g,Z]=b.useState(!1),[K,k]=b.useState(u),N=async()=>{a==="Flex"?await $t({_id:r,network:"default"},A).then(E=>{Z(!0),k("https://gearbox.playablefactory.app/files/"+E.url)}):await bt(A,r,wt(5),"default",!1,0,{}).then(E=>{Z(!0),k("https://gearbox.playablefactory.app/files/"+E.url)})};return b.useEffect(()=>{e?g||(N(),Z(!0)):Z(!1)},[e]),b.useEffect(()=>{const E=()=>{h(window.innerWidth)};return window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[]),m.jsxs(Ps,{isOpen:e,ariaHideApp:!1,onRequestClose:t,style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:f>1440?"700px":"650px",width:f>1440?"920px":"975px",overflow:"hidden",paddingTop:"0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:[m.jsx("div",{style:{position:"absolute",top:"1.25rem",right:"1.25rem",zIndex:50},children:m.jsx("button",{onClick:t,style:{color:"#718096",cursor:"pointer",backgroundColor:"#F7F7F8"},children:m.jsx("img",{src:no,alt:"close image"})})}),m.jsxs(io,{children:[g?m.jsx(dA,{versionName:i,versionId:r,typeOfProduct:a,iframeUrl:K,api:A,fetchFileUrl:q}):m.jsx(m.Fragment,{children:m.jsx("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"5px",height:f>1440?"650px":"625px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:m.jsx("img",{width:"75px",height:"75px",src:yi,alt:"pf-logo-gif"})})}),m.jsx(DA,{visible:e,versionId:r,playableId:o,gameId:n,typeOfProduct:a,api:A,user:c,title:s,handleDownloadError:d,fetchFileUrl:q})]}),m.jsx(jr,{})]})};Ge.DownloadModal=Vs,Object.defineProperty(Ge,Symbol.toStringTag,{value:"Module"})});
|
|
80
80
|
//# sourceMappingURL=index.umd.js.map
|