@algoan/connect
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -1,3 +0,3 @@ | ||
/*! Algoan Connect v2.2.0 */ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AlgoanConnect=t():e.AlgoanConnect=t()}(self,(function(){return(()=>{"use strict";var e={614:function(e,t,n){var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.addWidget=void 0;var r=n(712),i=function(e){var t=e.iframeUrl;return null!=t?t:"https://connect.algoan.com"},a=function(e,t){window.addEventListener("message",(function(n){n.origin===i(e)&&(n.data.eventName===r.Events.WIDGET_STARTING&&function(e,t){var n,r=o(o({},e),{onSuccessUrl:e.onSuccessUrl||window.location.href});null===(n=t.contentWindow)||void 0===n||n.postMessage(r,i(r))}(e,t))}))};t.addWidget=function(e){!function(e){if("object"!=typeof e)throw new Error("Invalid config provided.")}(e);var t=document.getElementById("algoan-connect");if(null===t)throw new Error("No container element found. Are you sure you created a div with id `algoan-connect`?");var n=function(e){var t=document.createElement("iframe");return t.src=i(e),t.style.border="none",t.style.width="318px",t.style.height="130px",t}(e);a(e,n),t.appendChild(n)}},712:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Events=void 0,function(e){e.WIDGET_STARTING="widget_starting",e.AGGREGATION_START="aggregation_start",e.AGGREGATION_SUCCESS="aggregation_success",e.AGGREGATION_CANCEL="aggregation_cancel",e.AGGREGATION_ERROR="aggregation_error"}(t.Events||(t.Events={}))},607:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(614),t),r(n(712),t)}},t={};return function n(o){if(t[o])return t[o].exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}(607)})()})); | ||
/*! Algoan Connect v2.3.0 */ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AlgoanConnect=t():e.AlgoanConnect=t()}(self,(function(){return(()=>{"use strict";var e={614:function(e,t,n){var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.addWidget=void 0;var r=n(712),i=function(e){var t=e.iframeUrl;return null!=t?t:"https://connect.algoan.com"},a=function(e,t){window.addEventListener("message",(function(n){if(n.origin===i(e))switch(n.data.eventName){case r.Events.WIDGET_STARTING:!function(e,t){var n,r=o(o({},e),{onSuccessUrl:e.onSuccessUrl||window.location.href});null===(n=t.contentWindow)||void 0===n||n.postMessage(r,i(r))}(e,t);break;case r.Events.AGGREGATION_START:t.style.width="408px",t.style.height="540px";break;default:return}}))};t.addWidget=function(e){!function(e){if("object"!=typeof e)throw new Error("Invalid config provided.")}(e);var t=document.getElementById("algoan-connect");if(null===t)throw new Error("No container element found. Are you sure you created a div with id `algoan-connect`?");var n=function(e){var t=document.createElement("iframe");return t.src=i(e),t.style.border="none",t.style.width="318px",t.style.height="130px",t.style.transition="all 0.2s ease-out",t}(e);a(e,n),t.appendChild(n)}},712:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Events=void 0,function(e){e.WIDGET_STARTING="widget_starting",e.AGGREGATION_START="aggregation_start",e.AGGREGATION_SUCCESS="aggregation_success",e.AGGREGATION_CANCEL="aggregation_cancel",e.AGGREGATION_ERROR="aggregation_error"}(t.Events||(t.Events={}))},607:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(614),t),r(n(712),t)}},t={};return function n(o){if(t[o])return t[o].exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}(607)})()})); | ||
//# sourceMappingURL=algoan-connect.js.map |
@@ -37,2 +37,3 @@ var __assign = (this && this.__assign) || function () { | ||
iframe.style.height = '130px'; | ||
iframe.style.transition = 'all 0.2s ease-out'; | ||
return iframe; | ||
@@ -56,4 +57,12 @@ }; | ||
var event = message.data; | ||
if (event.eventName === Events.WIDGET_STARTING) { | ||
sendConfigToIframe(config, iframe); | ||
switch (event.eventName) { | ||
case Events.WIDGET_STARTING: | ||
sendConfigToIframe(config, iframe); | ||
break; | ||
case Events.AGGREGATION_START: | ||
iframe.style.width = '408px'; | ||
iframe.style.height = '540px'; | ||
break; | ||
default: | ||
return; | ||
} | ||
@@ -60,0 +69,0 @@ }); |
@@ -40,2 +40,3 @@ "use strict"; | ||
iframe.style.height = '130px'; | ||
iframe.style.transition = 'all 0.2s ease-out'; | ||
return iframe; | ||
@@ -59,4 +60,12 @@ }; | ||
var event = message.data; | ||
if (event.eventName === event_1.Events.WIDGET_STARTING) { | ||
sendConfigToIframe(config, iframe); | ||
switch (event.eventName) { | ||
case event_1.Events.WIDGET_STARTING: | ||
sendConfigToIframe(config, iframe); | ||
break; | ||
case event_1.Events.AGGREGATION_START: | ||
iframe.style.width = '408px'; | ||
iframe.style.height = '540px'; | ||
break; | ||
default: | ||
return; | ||
} | ||
@@ -63,0 +72,0 @@ }); |
{ | ||
"name": "@algoan/connect", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Library for Algoan Connect", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
28004
312