@beyonk/embedded
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -5,2 +5,14 @@ { | ||
{ | ||
"version": "1.0.2", | ||
"tag": "@beyonk/embedded_v1.0.2", | ||
"date": "Wed, 14 Oct 2020 11:09:32 GMT", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "suppress warnings from ResizableElementObserver. Allow custom events" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "1.0.1", | ||
@@ -7,0 +19,0 @@ "tag": "@beyonk/embedded_v1.0.1", |
# Change Log - @beyonk/embedded | ||
This log was last generated on Thu, 08 Oct 2020 07:03:43 GMT and should not be manually modified. | ||
This log was last generated on Wed, 14 Oct 2020 11:09:32 GMT and should not be manually modified. | ||
## 1.0.2 | ||
Wed, 14 Oct 2020 11:09:32 GMT | ||
### Patches | ||
- suppress warnings from ResizableElementObserver. Allow custom events | ||
## 1.0.1 | ||
@@ -6,0 +13,0 @@ Thu, 08 Oct 2020 07:03:43 GMT |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).BeyonkEmbedded={})}(this,(function(e){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var r=function(e){return e&&e.Math==Math&&e},o=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||Function("return this")(),i=function(e){try{return!!e()}catch(e){return!0}},u=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,l={f:a&&!c.call({1:2},1)?function(e){var t=a(this,e);return!!t&&t.enumerable}:c},f=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},s={}.toString,p=function(e){return s.call(e).slice(8,-1)},h="".split,d=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==p(e)?h.call(e,""):Object(e)}:Object,y=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},g=function(e){return d(y(e))},v=function(e){return"object"==typeof e?null!==e:"function"==typeof e},b=function(e,t){if(!v(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!v(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!v(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!v(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},m={}.hasOwnProperty,x=function(e,t){return m.call(e,t)},E=o.document,w=v(E)&&v(E.createElement),S=!u&&!i((function(){return 7!=Object.defineProperty((e="div",w?E.createElement(e):{}),"a",{get:function(){return 7}}).a;var e})),O=Object.getOwnPropertyDescriptor,j={f:u?O:function(e,t){if(e=g(e),t=b(t,!0),S)try{return O(e,t)}catch(e){}if(x(e,t))return f(!l.f.call(e,t),e[t])}},R=function(e){if(!v(e))throw TypeError(String(e)+" is not an object");return e},P=Object.defineProperty,T={f:u?P:function(e,t,n){if(R(e),t=b(t,!0),R(n),S)try{return P(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},I=u?function(e,t,n){return T.f(e,t,f(1,n))}:function(e,t,n){return e[t]=n,e},_=function(e,t){try{I(o,e,t)}catch(n){o[e]=t}return t},k="__core-js_shared__",N=o[k]||_(k,{}),A=Function.toString;"function"!=typeof N.inspectSource&&(N.inspectSource=function(e){return A.call(e)});var C,M,F,D,L=N.inspectSource,U=o.WeakMap,z="function"==typeof U&&/native code/.test(L(U)),$=n((function(e){(e.exports=function(e,t){return N[e]||(N[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),B=0,K=Math.random(),q=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++B+K).toString(36)},G=$("keys"),Y={},J=o.WeakMap;if(z){var W=new J,V=W.get,X=W.has,H=W.set;C=function(e,t){return H.call(W,e,t),t},M=function(e){return V.call(W,e)||{}},F=function(e){return X.call(W,e)}}else{var Q=G[D="state"]||(G[D]=q(D));Y[Q]=!0,C=function(e,t){return I(e,Q,t),t},M=function(e){return x(e,Q)?e[Q]:{}},F=function(e){return x(e,Q)}}var Z={set:C,get:M,has:F,enforce:function(e){return F(e)?M(e):C(e,{})},getterFor:function(e){return function(t){var n;if(!v(t)||(n=M(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},ee=n((function(e){var t=Z.get,n=Z.enforce,r=String(String).split("String");(e.exports=function(e,t,i,u){var c=!!u&&!!u.unsafe,a=!!u&&!!u.enumerable,l=!!u&&!!u.noTargetGet;"function"==typeof i&&("string"!=typeof t||x(i,"name")||I(i,"name",t),n(i).source=r.join("string"==typeof t?t:"")),e!==o?(c?!l&&e[t]&&(a=!0):delete e[t],a?e[t]=i:I(e,t,i)):a?e[t]=i:_(t,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||L(this)}))})),te=o,ne=function(e){return"function"==typeof e?e:void 0},re=Math.ceil,oe=Math.floor,ie=function(e){return isNaN(e=+e)?0:(e>0?oe:re)(e)},ue=Math.min,ce=function(e){return e>0?ue(ie(e),9007199254740991):0},ae=Math.max,le=Math.min,fe=function(e){return function(t,n,r){var o,i=g(t),u=ce(i.length),c=function(e,t){var n=ie(e);return n<0?ae(n+t,0):le(n,t)}(r,u);if(e&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((e||c in i)&&i[c]===n)return e||c||0;return!e&&-1}},se={includes:fe(!0),indexOf:fe(!1)}.indexOf,pe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),he={f:Object.getOwnPropertyNames||function(e){return function(e,t){var n,r=g(e),o=0,i=[];for(n in r)!x(Y,n)&&x(r,n)&&i.push(n);for(;t.length>o;)x(r,n=t[o++])&&(~se(i,n)||i.push(n));return i}(e,pe)}},de={f:Object.getOwnPropertySymbols},ye=function(e,t){return arguments.length<2?ne(te[e])||ne(o[e]):te[e]&&te[e][t]||o[e]&&o[e][t]}("Reflect","ownKeys")||function(e){var t=he.f(R(e)),n=de.f;return n?t.concat(n(e)):t},ge=function(e,t){for(var n=ye(t),r=T.f,o=j.f,i=0;i<n.length;i++){var u=n[i];x(e,u)||r(e,u,o(t,u))}},ve=/#|\.prototype\./,be=function(e,t){var n=xe[me(e)];return n==we||n!=Ee&&("function"==typeof t?i(t):!!t)},me=be.normalize=function(e){return String(e).replace(ve,".").toLowerCase()},xe=be.data={},Ee=be.NATIVE="N",we=be.POLYFILL="P",Se=be,Oe=j.f,je=function(e,t){var n,r,i,u,c,a=e.target,l=e.global,f=e.stat;if(n=l?o:f?o[a]||_(a,{}):(o[a]||{}).prototype)for(r in t){if(u=t[r],i=e.noTargetGet?(c=Oe(n,r))&&c.value:n[r],!Se(l?r:a+(f?".":"#")+r,e.forced)&&void 0!==i){if(typeof u==typeof i)continue;ge(u,i)}(e.sham||i&&i.sham)&&I(u,"sham",!0),ee(n,r,u,e)}},Re=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Pe=[].slice,Te={},Ie=function(e,t,n){if(!(t in Te)){for(var r=[],o=0;o<t;o++)r[o]="a["+o+"]";Te[t]=Function("C,a","return new C("+r.join(",")+")")}return Te[t](e,n)};je({target:"Function",proto:!0},{bind:Function.bind||function(e){var t=Re(this),n=Pe.call(arguments,1),r=function(){var o=n.concat(Pe.call(arguments));return this instanceof r?Ie(t,o.length,o):t.apply(e,o)};return v(t.prototype)&&(r.prototype=t.prototype),r}}),je({target:"Object",stat:!0,forced:!u,sham:!u},{defineProperty:T.f});var _e=function(){var e=R(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function ke(e,t){return RegExp(e,t)}var Ne,Ae,Ce={UNSUPPORTED_Y:i((function(){var e=ke("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET:i((function(){var e=ke("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},Me=RegExp.prototype.exec,Fe=String.prototype.replace,De=Me,Le=(Ne=/a/,Ae=/b*/g,Me.call(Ne,"a"),Me.call(Ae,"a"),0!==Ne.lastIndex||0!==Ae.lastIndex),Ue=Ce.UNSUPPORTED_Y||Ce.BROKEN_CARET,ze=void 0!==/()??/.exec("")[1];(Le||ze||Ue)&&(De=function(e){var t,n,r,o,i=this,u=Ue&&i.sticky,c=_e.call(i),a=i.source,l=0,f=e;return u&&(-1===(c=c.replace("y","")).indexOf("g")&&(c+="g"),f=String(e).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(a="(?: "+a+")",f=" "+f,l++),n=new RegExp("^(?:"+a+")",c)),ze&&(n=new RegExp("^"+a+"$(?!\\s)",c)),Le&&(t=i.lastIndex),r=Me.call(u?n:i,f),u?r?(r.input=r.input.slice(l),r[0]=r[0].slice(l),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:Le&&r&&(i.lastIndex=i.global?r.index+r[0].length:t),ze&&r&&r.length>1&&Fe.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r});var $e=De;je({target:"RegExp",proto:!0,forced:/./.exec!==$e},{exec:$e});var Be=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())})),Ke=Be&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,qe=$("wks"),Ge=o.Symbol,Ye=Ke?Ge:Ge&&Ge.withoutSetter||q,Je=function(e){return x(qe,e)||(Be&&x(Ge,e)?qe[e]=Ge[e]:qe[e]=Ye("Symbol."+e)),qe[e]},We=Je("species"),Ve=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),Xe="$0"==="a".replace(/./,"$0"),He=Je("replace"),Qe=!!/./[He]&&""===/./[He]("a","$0"),Ze=!i((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),et=function(e){return function(t,n){var r,o,i=String(y(t)),u=ie(n),c=i.length;return u<0||u>=c?e?"":void 0:(r=i.charCodeAt(u))<55296||r>56319||u+1===c||(o=i.charCodeAt(u+1))<56320||o>57343?e?i.charAt(u):r:e?i.slice(u,u+2):o-56320+(r-55296<<10)+65536}},tt={codeAt:et(!1),charAt:et(!0)}.charAt,nt=function(e,t,n){return t+(n?tt(e,t).length:1)},rt=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==p(e))throw TypeError("RegExp#exec called on incompatible receiver");return $e.call(e,t)};function ot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function it(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ut(e,t,n){return t&&it(e.prototype,t),n&&it(e,n),e}!function(e,t,n,r){var o=Je(e),u=!i((function(){var t={};return t[o]=function(){return 7},7!=""[e](t)})),c=u&&!i((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[We]=function(){return n},n.flags="",n[o]=/./[o]),n.exec=function(){return t=!0,null},n[o](""),!t}));if(!u||!c||"replace"===e&&(!Ve||!Xe||Qe)||"split"===e&&!Ze){var a=/./[o],l=n(o,""[e],(function(e,t,n,r,o){return t.exec===$e?u&&!o?{done:!0,value:a.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:Xe,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Qe}),f=l[0],s=l[1];ee(String.prototype,e,f),ee(RegExp.prototype,o,2==t?function(e,t){return s.call(e,this,t)}:function(e){return s.call(e,this)})}r&&I(RegExp.prototype[o],"sham",!0)}("match",1,(function(e,t,n){return[function(t){var n=y(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var o=R(e),i=String(this);if(!o.global)return rt(o,i);var u=o.unicode;o.lastIndex=0;for(var c,a=[],l=0;null!==(c=rt(o,i));){var f=String(c[0]);a[l]=f,""===f&&(o.lastIndex=nt(i,ce(o.lastIndex),u)),l++}return 0===l?null:a}]}));var ct=function(){function e(t){ot(this,e),this.w=t}return ut(e,[{key:"update",value:function(e){var t=JSON.stringify({version:1,eventName:"resize",meta:{height:e}});this.w.parent.postMessage(t,"*")}}]),e}(),at=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/.*/;ot(this,e),this.w=t,this.originFilter=n}return ut(e,[{key:"handle",value:function(e){if(e.origin.match(this.originFilter))try{var t=JSON.parse(e.data),n=t.version,r=t.eventName,o=t.meta;if(1!==n&&console.warn("Recieved event from incompatible script version"),"resize"===r)return this.callback(o.height);console.warn("Recieved unknown event ".concat(r))}catch(t){console.warn("Recieved unparseable event",e.data)}}},{key:"subscribe",value:function(e){this.callback=e,this.w.addEventListener("message",this.handle.bind(this),!1)}},{key:"unsubscribe",value:function(){this.w.removeEventListener("message",this.handle.bind(this),!1)}}]),e}();e.ResizableElementDispatcher=ct,e.ResizableElementObserver=at,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).BeyonkEmbedded={})}(this,(function(e){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var r=function(e){return e&&e.Math==Math&&e},o=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||Function("return this")(),i=function(e){try{return!!e()}catch(e){return!0}},u=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,l={f:a&&!c.call({1:2},1)?function(e){var t=a(this,e);return!!t&&t.enumerable}:c},f=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},s={}.toString,p=function(e){return s.call(e).slice(8,-1)},h="".split,v=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==p(e)?h.call(e,""):Object(e)}:Object,d=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},g=function(e){return v(d(e))},y=function(e){return"object"==typeof e?null!==e:"function"==typeof e},b=function(e,t){if(!y(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!y(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!y(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!y(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},m={}.hasOwnProperty,x=function(e,t){return m.call(e,t)},E=o.document,w=y(E)&&y(E.createElement),S=!u&&!i((function(){return 7!=Object.defineProperty((e="div",w?E.createElement(e):{}),"a",{get:function(){return 7}}).a;var e})),O=Object.getOwnPropertyDescriptor,j={f:u?O:function(e,t){if(e=g(e),t=b(t,!0),S)try{return O(e,t)}catch(e){}if(x(e,t))return f(!l.f.call(e,t),e[t])}},P=function(e){if(!y(e))throw TypeError(String(e)+" is not an object");return e},R=Object.defineProperty,T={f:u?R:function(e,t,n){if(P(e),t=b(t,!0),P(n),S)try{return R(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},I=u?function(e,t,n){return T.f(e,t,f(1,n))}:function(e,t,n){return e[t]=n,e},_=function(e,t){try{I(o,e,t)}catch(n){o[e]=t}return t},N="__core-js_shared__",k=o[N]||_(N,{}),A=Function.toString;"function"!=typeof k.inspectSource&&(k.inspectSource=function(e){return A.call(e)});var C,M,F,D,L=k.inspectSource,U=o.WeakMap,z="function"==typeof U&&/native code/.test(L(U)),$=n((function(e){(e.exports=function(e,t){return k[e]||(k[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),B=0,K=Math.random(),q=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++B+K).toString(36)},G=$("keys"),Y={},J=o.WeakMap;if(z){var W=new J,V=W.get,X=W.has,H=W.set;C=function(e,t){return H.call(W,e,t),t},M=function(e){return V.call(W,e)||{}},F=function(e){return X.call(W,e)}}else{var Q=G[D="state"]||(G[D]=q(D));Y[Q]=!0,C=function(e,t){return I(e,Q,t),t},M=function(e){return x(e,Q)?e[Q]:{}},F=function(e){return x(e,Q)}}var Z={set:C,get:M,has:F,enforce:function(e){return F(e)?M(e):C(e,{})},getterFor:function(e){return function(t){var n;if(!y(t)||(n=M(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},ee=n((function(e){var t=Z.get,n=Z.enforce,r=String(String).split("String");(e.exports=function(e,t,i,u){var c=!!u&&!!u.unsafe,a=!!u&&!!u.enumerable,l=!!u&&!!u.noTargetGet;"function"==typeof i&&("string"!=typeof t||x(i,"name")||I(i,"name",t),n(i).source=r.join("string"==typeof t?t:"")),e!==o?(c?!l&&e[t]&&(a=!0):delete e[t],a?e[t]=i:I(e,t,i)):a?e[t]=i:_(t,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||L(this)}))})),te=o,ne=function(e){return"function"==typeof e?e:void 0},re=Math.ceil,oe=Math.floor,ie=function(e){return isNaN(e=+e)?0:(e>0?oe:re)(e)},ue=Math.min,ce=function(e){return e>0?ue(ie(e),9007199254740991):0},ae=Math.max,le=Math.min,fe=function(e){return function(t,n,r){var o,i=g(t),u=ce(i.length),c=function(e,t){var n=ie(e);return n<0?ae(n+t,0):le(n,t)}(r,u);if(e&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((e||c in i)&&i[c]===n)return e||c||0;return!e&&-1}},se={includes:fe(!0),indexOf:fe(!1)}.indexOf,pe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),he={f:Object.getOwnPropertyNames||function(e){return function(e,t){var n,r=g(e),o=0,i=[];for(n in r)!x(Y,n)&&x(r,n)&&i.push(n);for(;t.length>o;)x(r,n=t[o++])&&(~se(i,n)||i.push(n));return i}(e,pe)}},ve={f:Object.getOwnPropertySymbols},de=function(e,t){return arguments.length<2?ne(te[e])||ne(o[e]):te[e]&&te[e][t]||o[e]&&o[e][t]}("Reflect","ownKeys")||function(e){var t=he.f(P(e)),n=ve.f;return n?t.concat(n(e)):t},ge=function(e,t){for(var n=de(t),r=T.f,o=j.f,i=0;i<n.length;i++){var u=n[i];x(e,u)||r(e,u,o(t,u))}},ye=/#|\.prototype\./,be=function(e,t){var n=xe[me(e)];return n==we||n!=Ee&&("function"==typeof t?i(t):!!t)},me=be.normalize=function(e){return String(e).replace(ye,".").toLowerCase()},xe=be.data={},Ee=be.NATIVE="N",we=be.POLYFILL="P",Se=be,Oe=j.f,je=function(e,t){var n,r,i,u,c,a=e.target,l=e.global,f=e.stat;if(n=l?o:f?o[a]||_(a,{}):(o[a]||{}).prototype)for(r in t){if(u=t[r],i=e.noTargetGet?(c=Oe(n,r))&&c.value:n[r],!Se(l?r:a+(f?".":"#")+r,e.forced)&&void 0!==i){if(typeof u==typeof i)continue;ge(u,i)}(e.sham||i&&i.sham)&&I(u,"sham",!0),ee(n,r,u,e)}},Pe=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Re=[].slice,Te={},Ie=function(e,t,n){if(!(t in Te)){for(var r=[],o=0;o<t;o++)r[o]="a["+o+"]";Te[t]=Function("C,a","return new C("+r.join(",")+")")}return Te[t](e,n)};je({target:"Function",proto:!0},{bind:Function.bind||function(e){var t=Pe(this),n=Re.call(arguments,1),r=function(){var o=n.concat(Re.call(arguments));return this instanceof r?Ie(t,o.length,o):t.apply(e,o)};return y(t.prototype)&&(r.prototype=t.prototype),r}}),je({target:"Object",stat:!0,forced:!u,sham:!u},{defineProperty:T.f});var _e=function(){var e=P(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function Ne(e,t){return RegExp(e,t)}var ke,Ae,Ce={UNSUPPORTED_Y:i((function(){var e=Ne("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET:i((function(){var e=Ne("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},Me=RegExp.prototype.exec,Fe=String.prototype.replace,De=Me,Le=(ke=/a/,Ae=/b*/g,Me.call(ke,"a"),Me.call(Ae,"a"),0!==ke.lastIndex||0!==Ae.lastIndex),Ue=Ce.UNSUPPORTED_Y||Ce.BROKEN_CARET,ze=void 0!==/()??/.exec("")[1];(Le||ze||Ue)&&(De=function(e){var t,n,r,o,i=this,u=Ue&&i.sticky,c=_e.call(i),a=i.source,l=0,f=e;return u&&(-1===(c=c.replace("y","")).indexOf("g")&&(c+="g"),f=String(e).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(a="(?: "+a+")",f=" "+f,l++),n=new RegExp("^(?:"+a+")",c)),ze&&(n=new RegExp("^"+a+"$(?!\\s)",c)),Le&&(t=i.lastIndex),r=Me.call(u?n:i,f),u?r?(r.input=r.input.slice(l),r[0]=r[0].slice(l),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:Le&&r&&(i.lastIndex=i.global?r.index+r[0].length:t),ze&&r&&r.length>1&&Fe.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r});var $e=De;je({target:"RegExp",proto:!0,forced:/./.exec!==$e},{exec:$e});var Be=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())})),Ke=Be&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,qe=$("wks"),Ge=o.Symbol,Ye=Ke?Ge:Ge&&Ge.withoutSetter||q,Je=function(e){return x(qe,e)||(Be&&x(Ge,e)?qe[e]=Ge[e]:qe[e]=Ye("Symbol."+e)),qe[e]},We=Je("species"),Ve=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),Xe="$0"==="a".replace(/./,"$0"),He=Je("replace"),Qe=!!/./[He]&&""===/./[He]("a","$0"),Ze=!i((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),et=function(e){return function(t,n){var r,o,i=String(d(t)),u=ie(n),c=i.length;return u<0||u>=c?e?"":void 0:(r=i.charCodeAt(u))<55296||r>56319||u+1===c||(o=i.charCodeAt(u+1))<56320||o>57343?e?i.charAt(u):r:e?i.slice(u,u+2):o-56320+(r-55296<<10)+65536}},tt={codeAt:et(!1),charAt:et(!0)}.charAt,nt=function(e,t,n){return t+(n?tt(e,t).length:1)},rt=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==p(e))throw TypeError("RegExp#exec called on incompatible receiver");return $e.call(e,t)};function ot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function it(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ut(e,t,n){return t&&it(e.prototype,t),n&&it(e,n),e}!function(e,t,n,r){var o=Je(e),u=!i((function(){var t={};return t[o]=function(){return 7},7!=""[e](t)})),c=u&&!i((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[We]=function(){return n},n.flags="",n[o]=/./[o]),n.exec=function(){return t=!0,null},n[o](""),!t}));if(!u||!c||"replace"===e&&(!Ve||!Xe||Qe)||"split"===e&&!Ze){var a=/./[o],l=n(o,""[e],(function(e,t,n,r,o){return t.exec===$e?u&&!o?{done:!0,value:a.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:Xe,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Qe}),f=l[0],s=l[1];ee(String.prototype,e,f),ee(RegExp.prototype,o,2==t?function(e,t){return s.call(e,this,t)}:function(e){return s.call(e,this)})}r&&I(RegExp.prototype[o],"sham",!0)}("match",1,(function(e,t,n){return[function(t){var n=d(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var o=P(e),i=String(this);if(!o.global)return rt(o,i);var u=o.unicode;o.lastIndex=0;for(var c,a=[],l=0;null!==(c=rt(o,i));){var f=String(c[0]);a[l]=f,""===f&&(o.lastIndex=nt(i,ce(o.lastIndex),u)),l++}return 0===l?null:a}]}));var ct="whitelabel:header:resize",at=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ct;ot(this,e),this.w=t,this.eventName=n}return ut(e,[{key:"update",value:function(e){var t=JSON.stringify({version:1,eventName:this.eventName,meta:{height:e}});this.w.parent.postMessage(t,"*")}}]),e}(),lt=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/.*/;ot(this,e),this.w=t,this.originFilter=n}return ut(e,[{key:"handle",value:function(e,t){if(t.origin.match(this.originFilter))try{var n=JSON.parse(t.data),r=n.version,o=n.eventName,i=n.meta;if(r&&1!==r&&console.warn("Recieved event from incompatible script version"),o===e)return this.callback(i.height)}catch(e){console.warn("Recieved unparseable event",t.data)}}},{key:"subscribe",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ct;this.callback=e,this.w.addEventListener("message",this.handle.bind(this,t),!1)}},{key:"unsubscribe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ct;this.w.removeEventListener("message",this.handle.bind(this,e),!1)}}]),e}();e.ResizableElementDispatcher=at,e.ResizableElementObserver=lt,Object.defineProperty(e,"__esModule",{value:!0})})); |
const thisVersion = 1 | ||
const defaultEventName = 'whitelabel:header:resize' | ||
class ResizableElementDispatcher { | ||
constructor (w) { | ||
constructor (w, eventName = defaultEventName) { | ||
this.w = w | ||
this.eventName = eventName | ||
} | ||
@@ -11,3 +13,3 @@ | ||
version: thisVersion, | ||
eventName: 'resize', | ||
eventName: this.eventName, | ||
meta: { | ||
@@ -27,16 +29,14 @@ height | ||
handle (ev) { | ||
handle (eventName, ev) { | ||
if (!ev.origin.match(this.originFilter)) { return } | ||
try { | ||
const { version, eventName, meta } = JSON.parse(ev.data) | ||
if (version !== thisVersion) { | ||
const { version, eventName: givenEventName, meta } = JSON.parse(ev.data) | ||
if (version && version !== thisVersion) { | ||
console.warn('Recieved event from incompatible script version') | ||
} | ||
if (eventName === 'resize') { | ||
if (givenEventName === eventName) { | ||
return this.callback(meta.height) | ||
} | ||
console.warn(`Recieved unknown event ${eventName}`) | ||
} catch (e) { | ||
@@ -47,9 +47,9 @@ console.warn(`Recieved unparseable event`, ev.data) | ||
subscribe (callback) { | ||
subscribe (callback, eventName = defaultEventName) { | ||
this.callback = callback | ||
this.w.addEventListener('message', this.handle.bind(this), false) | ||
this.w.addEventListener('message', this.handle.bind(this, eventName), false) | ||
} | ||
unsubscribe () { | ||
this.w.removeEventListener('message', this.handle.bind(this), false) | ||
unsubscribe (eventName = defaultEventName) { | ||
this.w.removeEventListener('message', this.handle.bind(this, eventName), false) | ||
} | ||
@@ -56,0 +56,0 @@ } |
{ | ||
"name": "@beyonk/embedded", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Embedded Beyonk Libraries", | ||
@@ -14,3 +14,3 @@ "main": "lib/observers.js", | ||
"test": "NODE_ENV=test mocha --require esm './!(node_modules)/**/**.+(spec).js'", | ||
"build": "rollup -c" | ||
"build": "rollup -c 2>&1" | ||
}, | ||
@@ -17,0 +17,0 @@ "author": "Antony Jones", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15431
136
0