Socket
Socket
Sign inDemoInstall

flat-embed

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flat-embed - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

5

CHANGELOG.md
# Changelog
## v0.8.0
* Switch from babel-preset-es2015 to babel-preset-env
* Remove rollup-plugin-hypothetical and babel-plugin-transform-runtime
## v0.7.0

@@ -4,0 +9,0 @@

2

dist/embed.min.js
/*! flat-embed v0.7.0 | (c) 2017 Tutteo Ltd. (Flat) | Apache-2.0 License | https://github.com/FlatIO/embed-client */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.Flat=t.Flat||{},t.Flat.Embed=e())}(this,function(){"use strict";function t(t){return t&&t.__esModule?t.default:t}function e(t,e){return e={exports:{}},t(e,e.exports),e.exports}function n(t){if(window.jQuery&&t instanceof window.jQuery&&(t=t[0]),"string"==typeof t&&(t=document.getElementById(t)),!(t instanceof window.HTMLElement))throw new TypeError("The first parameter must be an existing DOM element or an identifier.");if("IFRAME"!==t.nodeName){var e=t.querySelector("iframe");e&&(t=e)}return t}function r(t){var e=t.baseUrl||"https://flat.io/embed";e+="/"+(t.score||"blank");var n=sr({jsapi:!0},t.embedParams);return e+"?"+ur(n).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(n[t])}).join("&")}function o(t,e){var n=r(e),o=document.createElement("iframe");return o.setAttribute("src",n),o.setAttribute("width",e.width||"100%"),o.setAttribute("height",e.height||"100%"),o.setAttribute("allowfullscreen",!0),o.setAttribute("frameborder","0"),t.appendChild(o),o}function i(t,e,n){if(!t.element.contentWindow||!t.element.contentWindow.postMessage)throw new Error("No `contentWindow` or `contentWindow.postMessage` avaialble on the element");var r={method:e,parameters:n};t.element.contentWindow.postMessage(r,t.origin)}function u(t){return"string"==typeof t&&(t=JSON.parse(t)),t}var c=Math.ceil,s=Math.floor,a=function(t){return isNaN(t=+t)?0:(t>0?s:c)(t)},f=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},l=e(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),h=e(function(t){var e=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)}),p=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},v=function(t,e,n){if(p(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},d=function(t){return"object"==typeof t?null!==t:"function"==typeof t},y=function(t){if(!d(t))throw TypeError(t+" is not an object!");return t},m=function(t){try{return!!t()}catch(t){return!0}},b=!m(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),g=l.document,_=d(g)&&d(g.createElement),w=function(t){return _?g.createElement(t):{}},k=!b&&!m(function(){return 7!=Object.defineProperty(w("div"),"a",{get:function(){return 7}}).a}),O=function(t,e){if(!d(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!d(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!d(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!d(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},j=Object.defineProperty,E={f:b?Object.defineProperty:function(t,e,n){if(y(t),e=O(e,!0),y(n),k)try{return j(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},S=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},M=b?function(t,e,n){return E.f(t,e,S(1,n))}:function(t,e,n){return t[e]=n,t},P=function(t,e,n){var r,o,i,u=t&P.F,c=t&P.G,s=t&P.S,a=t&P.P,f=t&P.B,p=t&P.W,d=c?h:h[e]||(h[e]={}),y=d.prototype,m=c?l:s?l[e]:(l[e]||{}).prototype;c&&(n=e);for(r in n)(o=!u&&m&&void 0!==m[r])&&r in d||(i=o?m[r]:n[r],d[r]=c&&"function"!=typeof m[r]?n[r]:f&&o?v(i,l):p&&m[r]==i?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(i):a&&"function"==typeof i?v(Function.call,i):i,a&&((d.virtual||(d.virtual={}))[r]=i,t&P.R&&y&&!y[r]&&M(y,r,i)))};P.F=1,P.G=2,P.S=4,P.P=8,P.B=16,P.W=32,P.U=64,P.R=128;var C=P,A=M,x={}.hasOwnProperty,F=function(t,e){return x.call(t,e)},T={},N={}.toString,I=function(t){return N.call(t).slice(8,-1)},W=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==I(t)?t.split(""):Object(t)},R=function(t){return W(f(t))},L=Math.min,J=function(t){return t>0?L(a(t),9007199254740991):0},D=Math.max,U=Math.min,Z=function(t,e){return(t=a(t))<0?D(t+e,0):U(t,e)},G=l["__core-js_shared__"]||(l["__core-js_shared__"]={}),z=function(t){return G[t]||(G[t]={})},q=0,B=Math.random(),K=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++q+B).toString(36))},X=z("keys"),Q=function(t){return X[t]||(X[t]=K(t))},H=function(t){return function(e,n,r){var o,i=R(e),u=J(i.length),c=Z(r,u);if(t&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}}(!1),Y=Q("IE_PROTO"),V=function(t,e){var n,r=R(t),o=0,i=[];for(n in r)n!=Y&&F(r,n)&&i.push(n);for(;e.length>o;)F(r,n=e[o++])&&(~H(i,n)||i.push(n));return i},$="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),tt=Object.keys||function(t){return V(t,$)},et=b?Object.defineProperties:function(t,e){y(t);for(var n,r=tt(e),o=r.length,i=0;o>i;)E.f(t,n=r[i++],e[n]);return t},nt=l.document&&document.documentElement,rt=Q("IE_PROTO"),ot=function(){},it=function(){var t,e=w("iframe"),n=$.length;for(e.style.display="none",nt.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),it=t.F;n--;)delete it.prototype[$[n]];return it()},ut=Object.create||function(t,e){var n;return null!==t?(ot.prototype=y(t),n=new ot,ot.prototype=null,n[rt]=t):n=it(),void 0===e?n:et(n,e)},ct=e(function(t){var e=z("wks"),n=l.Symbol,r="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=r&&n[t]||(r?n:K)("Symbol."+t))}).store=e}),st=E.f,at=ct("toStringTag"),ft=function(t,e,n){t&&!F(t=n?t:t.prototype,at)&&st(t,at,{configurable:!0,value:e})},lt={};M(lt,ct("iterator"),function(){return this});var ht=function(t,e,n){t.prototype=ut(lt,{next:S(1,n)}),ft(t,e+" Iterator")},pt=function(t){return Object(f(t))},vt=Q("IE_PROTO"),dt=Object.prototype,yt=Object.getPrototypeOf||function(t){return t=pt(t),F(t,vt)?t[vt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?dt:null},mt=ct("iterator"),bt=!([].keys&&"next"in[].keys()),gt=function(){return this},_t=function(t,e,n,r,o,i,u){ht(n,e,r);var c,s,a,f=function(t){if(!bt&&t in v)return v[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},l=e+" Iterator",h="values"==o,p=!1,v=t.prototype,d=v[mt]||v["@@iterator"]||o&&v[o],y=d||f(o),m=o?h?f("entries"):y:void 0,b="Array"==e?v.entries||d:d;if(b&&(a=yt(b.call(new t)))!==Object.prototype&&ft(a,l,!0),h&&d&&"values"!==d.name&&(p=!0,y=function(){return d.call(this)}),u&&(bt||p||!v[mt])&&M(v,mt,y),T[e]=y,T[l]=gt,o)if(c={values:h?y:f("values"),keys:i?y:f("keys"),entries:m},u)for(s in c)s in v||A(v,s,c[s]);else C(C.P+C.F*(bt||p),e,c);return c},wt=function(t){return function(e,n){var r,o,i=String(f(e)),u=a(n),c=i.length;return u<0||u>=c?t?"":void 0:(r=i.charCodeAt(u))<55296||r>56319||u+1===c||(o=i.charCodeAt(u+1))<56320||o>57343?t?i.charAt(u):r:t?i.slice(u,u+2):o-56320+(r-55296<<10)+65536}}(!0);_t(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=wt(e,n),this._i+=t.length,{value:t,done:!1})});var kt=function(){},Ot=function(t,e){return{value:e,done:!!t}};_t(Array,"Array",function(t,e){this._t=R(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,Ot(1)):"keys"==e?Ot(0,n):"values"==e?Ot(0,t[n]):Ot(0,[n,t[n]])},"values");T.Arguments=T.Array,kt(),kt(),kt();for(var jt=ct("toStringTag"),Et=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],St=0;St<5;St++){var Mt=Et[St],Pt=l[Mt],Ct=Pt&&Pt.prototype;Ct&&!Ct[jt]&&M(Ct,jt,Mt),T[Mt]=T.Array}var At={f:ct},xt=At.f("iterator"),Ft=e(function(t){t.exports={default:xt,__esModule:!0}}),Tt=e(function(t){var e=K("meta"),n=E.f,r=0,o=Object.isExtensible||function(){return!0},i=!m(function(){return o(Object.preventExtensions({}))}),u=function(t){n(t,e,{value:{i:"O"+ ++r,w:{}}})},c=t.exports={KEY:e,NEED:!1,fastKey:function(t,n){if(!d(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!F(t,e)){if(!o(t))return"F";if(!n)return"E";u(t)}return t[e].i},getWeak:function(t,n){if(!F(t,e)){if(!o(t))return!0;if(!n)return!1;u(t)}return t[e].w},onFreeze:function(t){return i&&c.NEED&&o(t)&&!F(t,e)&&u(t),t}}}),Nt=E.f,It=function(t){var e=h.Symbol||(h.Symbol={});"_"==t.charAt(0)||t in e||Nt(e,t,{value:At.f(t)})},Wt=function(t,e){for(var n,r=R(t),o=tt(r),i=o.length,u=0;i>u;)if(r[n=o[u++]]===e)return n},Rt={f:Object.getOwnPropertySymbols},Lt={f:{}.propertyIsEnumerable},Jt=function(t){var e=tt(t),n=Rt.f;if(n)for(var r,o=n(t),i=Lt.f,u=0;o.length>u;)i.call(t,r=o[u++])&&e.push(r);return e},Dt=Array.isArray||function(t){return"Array"==I(t)},Ut=$.concat("length","prototype"),Zt={f:Object.getOwnPropertyNames||function(t){return V(t,Ut)}},Gt=Zt.f,zt={}.toString,qt="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Bt=function(t){try{return Gt(t)}catch(t){return qt.slice()}},Kt={f:function(t){return qt&&"[object Window]"==zt.call(t)?Bt(t):Gt(R(t))}},Xt=Object.getOwnPropertyDescriptor,Qt={f:b?Xt:function(t,e){if(t=R(t),e=O(e,!0),k)try{return Xt(t,e)}catch(t){}if(F(t,e))return S(!Lt.f.call(t,e),t[e])}},Ht=Tt.KEY,Yt=Qt.f,Vt=E.f,$t=Kt.f,te=l.Symbol,ee=l.JSON,ne=ee&&ee.stringify,re=ct("_hidden"),oe=ct("toPrimitive"),ie={}.propertyIsEnumerable,ue=z("symbol-registry"),ce=z("symbols"),se=z("op-symbols"),ae=Object.prototype,fe="function"==typeof te,le=l.QObject,he=!le||!le.prototype||!le.prototype.findChild,pe=b&&m(function(){return 7!=ut(Vt({},"a",{get:function(){return Vt(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=Yt(ae,e);r&&delete ae[e],Vt(t,e,n),r&&t!==ae&&Vt(ae,e,r)}:Vt,ve=function(t){var e=ce[t]=ut(te.prototype);return e._k=t,e},de=fe&&"symbol"==typeof te.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof te},ye=function(t,e,n){return t===ae&&ye(se,e,n),y(t),e=O(e,!0),y(n),F(ce,e)?(n.enumerable?(F(t,re)&&t[re][e]&&(t[re][e]=!1),n=ut(n,{enumerable:S(0,!1)})):(F(t,re)||Vt(t,re,S(1,{})),t[re][e]=!0),pe(t,e,n)):Vt(t,e,n)},me=function(t,e){y(t);for(var n,r=Jt(e=R(e)),o=0,i=r.length;i>o;)ye(t,n=r[o++],e[n]);return t},be=function(t){var e=ie.call(this,t=O(t,!0));return!(this===ae&&F(ce,t)&&!F(se,t))&&(!(e||!F(this,t)||!F(ce,t)||F(this,re)&&this[re][t])||e)},ge=function(t,e){if(t=R(t),e=O(e,!0),t!==ae||!F(ce,e)||F(se,e)){var n=Yt(t,e);return!n||!F(ce,e)||F(t,re)&&t[re][e]||(n.enumerable=!0),n}},_e=function(t){for(var e,n=$t(R(t)),r=[],o=0;n.length>o;)F(ce,e=n[o++])||e==re||e==Ht||r.push(e);return r},we=function(t){for(var e,n=t===ae,r=$t(n?se:R(t)),o=[],i=0;r.length>i;)!F(ce,e=r[i++])||n&&!F(ae,e)||o.push(ce[e]);return o};fe||(A((te=function(){if(this instanceof te)throw TypeError("Symbol is not a constructor!");var t=K(arguments.length>0?arguments[0]:void 0),e=function(n){this===ae&&e.call(se,n),F(this,re)&&F(this[re],t)&&(this[re][t]=!1),pe(this,t,S(1,n))};return b&&he&&pe(ae,t,{configurable:!0,set:e}),ve(t)}).prototype,"toString",function(){return this._k}),Qt.f=ge,E.f=ye,Zt.f=Kt.f=_e,Lt.f=be,Rt.f=we,At.f=function(t){return ve(ct(t))}),C(C.G+C.W+C.F*!fe,{Symbol:te});for(var ke="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Oe=0;ke.length>Oe;)ct(ke[Oe++]);for(var ke=tt(ct.store),Oe=0;ke.length>Oe;)It(ke[Oe++]);C(C.S+C.F*!fe,"Symbol",{for:function(t){return F(ue,t+="")?ue[t]:ue[t]=te(t)},keyFor:function(t){if(de(t))return Wt(ue,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){he=!0},useSimple:function(){he=!1}}),C(C.S+C.F*!fe,"Object",{create:function(t,e){return void 0===e?ut(t):me(ut(t),e)},defineProperty:ye,defineProperties:me,getOwnPropertyDescriptor:ge,getOwnPropertyNames:_e,getOwnPropertySymbols:we}),ee&&C(C.S+C.F*(!fe||m(function(){var t=te();return"[null]"!=ne([t])||"{}"!=ne({a:t})||"{}"!=ne(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!de(t)){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);return"function"==typeof(e=r[1])&&(n=e),!n&&Dt(e)||(e=function(t,e){if(n&&(e=n.call(this,t,e)),!de(e))return e}),r[1]=e,ne.apply(ee,r)}}}),te.prototype[oe]||M(te.prototype,oe,te.prototype.valueOf),ft(te,"Symbol"),ft(Math,"Math",!0),ft(l.JSON,"JSON",!0),It("asyncIterator"),It("observable");var je,Ee,Se,Me=h.Symbol,Pe=e(function(t){t.exports={default:Me,__esModule:!0}}),Ce=t(e(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(Ft),o=n(Pe),i="function"==typeof o.default&&"symbol"==typeof r.default?function(t){return typeof t}:function(t){return t&&"function"==typeof o.default&&t.constructor===o.default&&t!==o.default.prototype?"symbol":typeof t};e.default="function"==typeof o.default&&"symbol"===i(r.default)?function(t){return void 0===t?"undefined":i(t)}:function(t){return t&&"function"==typeof o.default&&t.constructor===o.default&&t!==o.default.prototype?"symbol":void 0===t?"undefined":i(t)}})),Ae=ct("toStringTag"),xe="Arguments"==I(function(){return arguments}()),Fe=function(t,e){try{return t[e]}catch(t){}},Te=function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=Fe(e=Object(t),Ae))?n:xe?I(e):"Object"==(r=I(e))&&"function"==typeof e.callee?"Arguments":r},Ne=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t},Ie=function(t,e,n,r){try{return r?e(y(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&y(o.call(t)),e}},We=ct("iterator"),Re=Array.prototype,Le=function(t){return void 0!==t&&(T.Array===t||Re[We]===t)},Je=ct("iterator"),De=h.getIteratorMethod=function(t){if(void 0!=t)return t[Je]||t["@@iterator"]||T[Te(t)]},Ue=e(function(t){var e={},n={},r=t.exports=function(t,r,o,i,u){var c,s,a,f,l=u?function(){return t}:De(t),h=v(o,i,r?2:1),p=0;if("function"!=typeof l)throw TypeError(t+" is not iterable!");if(Le(l)){for(c=J(t.length);c>p;p++)if((f=r?h(y(s=t[p])[0],s[1]):h(t[p]))===e||f===n)return f}else for(a=l.call(t);!(s=a.next()).done;)if((f=Ie(a,h,s.value,r))===e||f===n)return f};r.BREAK=e,r.RETURN=n}),Ze=ct("species"),Ge=function(t,e){var n,r=y(t).constructor;return void 0===r||void 0==(n=y(r)[Ze])?e:p(n)},ze=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)},qe=l.process,Be=l.setImmediate,Ke=l.clearImmediate,Xe=l.MessageChannel,Qe=0,He={},Ye=function(){var t=+this;if(He.hasOwnProperty(t)){var e=He[t];delete He[t],e()}},Ve=function(t){Ye.call(t.data)};Be&&Ke||(Be=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return He[++Qe]=function(){ze("function"==typeof t?t:Function(t),e)},je(Qe),Qe},Ke=function(t){delete He[t]},"process"==I(qe)?je=function(t){qe.nextTick(v(Ye,t,1))}:Xe?(Se=(Ee=new Xe).port2,Ee.port1.onmessage=Ve,je=v(Se.postMessage,Se,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(je=function(t){l.postMessage(t+"","*")},l.addEventListener("message",Ve,!1)):je="onreadystatechange"in w("script")?function(t){nt.appendChild(w("script")).onreadystatechange=function(){nt.removeChild(this),Ye.call(t)}}:function(t){setTimeout(v(Ye,t,1),0)});var $e={set:Be,clear:Ke},tn=$e.set,en=l.MutationObserver||l.WebKitMutationObserver,nn=l.process,rn=l.Promise,on="process"==I(nn),un=function(t,e,n){for(var r in e)n&&t[r]?t[r]=e[r]:M(t,r,e[r]);return t},cn=ct("species"),sn=ct("iterator"),an=!1;try{var fn=[7][sn]();fn.return=function(){an=!0},Array.from(fn,function(){throw 2})}catch(t){}var ln,hn,pn,vn=$e.set,dn=function(){var t,e,n,r=function(){var r,o;for(on&&(r=nn.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(on)n=function(){nn.nextTick(r)};else if(en){var o=!0,i=document.createTextNode("");new en(r).observe(i,{characterData:!0}),n=function(){i.data=o=!o}}else if(rn&&rn.resolve){var u=rn.resolve();n=function(){u.then(r)}}else n=function(){tn.call(l,r)};return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}(),yn=l.TypeError,mn=l.process,bn=l.Promise,mn=l.process,gn="process"==Te(mn),_n=function(){},wn=!!function(){try{var t=bn.resolve(1),e=(t.constructor={})[ct("species")]=function(t){t(_n,_n)};return(gn||"function"==typeof PromiseRejectionEvent)&&t.then(_n)instanceof e}catch(t){}}(),kn=function(t,e){return t===e||t===bn&&e===pn},On=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},jn=function(t){return kn(bn,t)?new En(t):new hn(t)},En=hn=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw yn("Bad Promise constructor");e=t,n=r}),this.resolve=p(e),this.reject=p(n)},Sn=function(t){try{t()}catch(t){return{error:t}}},Mn=function(t,e){if(!t._n){t._n=!0;var n=t._c;dn(function(){for(var r=t._v,o=1==t._s,i=0;n.length>i;)!function(e){var n,i,u=o?e.ok:e.fail,c=e.resolve,s=e.reject,a=e.domain;try{u?(o||(2==t._h&&An(t),t._h=1),!0===u?n=r:(a&&a.enter(),n=u(r),a&&a.exit()),n===e.promise?s(yn("Promise-chain cycle")):(i=On(n))?i.call(n,c,s):c(n)):s(r)}catch(t){s(t)}}(n[i++]);t._c=[],t._n=!1,e&&!t._h&&Pn(t)})}},Pn=function(t){vn.call(l,function(){var e,n,r,o=t._v;if(Cn(t)&&(e=Sn(function(){gn?mn.emit("unhandledRejection",o,t):(n=l.onunhandledrejection)?n({promise:t,reason:o}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=gn||Cn(t)?2:1),t._a=void 0,e)throw e.error})},Cn=function(t){if(1==t._h)return!1;for(var e,n=t._a||t._c,r=0;n.length>r;)if((e=n[r++]).fail||!Cn(e.promise))return!1;return!0},An=function(t){vn.call(l,function(){var e;gn?mn.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})})},xn=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),Mn(e,!0))},Fn=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw yn("Promise can't be resolved itself");(e=On(t))?dn(function(){var r={_w:n,_d:!1};try{e.call(t,v(Fn,r,1),v(xn,r,1))}catch(t){xn.call(r,t)}}):(n._v=t,n._s=1,Mn(n,!1))}catch(t){xn.call({_w:n,_d:!1},t)}}};wn||(bn=function(t){Ne(this,bn,"Promise","_h"),p(t),ln.call(this);try{t(v(Fn,this,1),v(xn,this,1))}catch(t){xn.call(this,t)}},(ln=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=un(bn.prototype,{then:function(t,e){var n=jn(Ge(this,bn));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=gn?mn.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&Mn(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),En=function(){var t=new ln;this.promise=t,this.resolve=v(Fn,t,1),this.reject=v(xn,t,1)}),C(C.G+C.W+C.F*!wn,{Promise:bn}),ft(bn,"Promise"),function(t){var e="function"==typeof h[t]?h[t]:l[t];b&&e&&!e[cn]&&E.f(e,cn,{configurable:!0,get:function(){return this}})}("Promise"),pn=h.Promise,C(C.S+C.F*!wn,"Promise",{reject:function(t){var e=jn(this);return(0,e.reject)(t),e.promise}}),C(C.S+!0*C.F,"Promise",{resolve:function(t){if(t instanceof bn&&kn(t.constructor,this))return t;var e=jn(this);return(0,e.resolve)(t),e.promise}}),C(C.S+C.F*!(wn&&function(t,e){if(!e&&!an)return!1;var n=!1;try{var r=[7],o=r[sn]();o.next=function(){return{done:n=!0}},r[sn]=function(){return o},t(r)}catch(t){}return n}(function(t){bn.all(t).catch(_n)})),"Promise",{all:function(t){var e=this,n=jn(e),r=n.resolve,o=n.reject,i=Sn(function(){var n=[],i=0,u=1;Ue(t,!1,function(t){var c=i++,s=!1;n.push(void 0),u++,e.resolve(t).then(function(t){s||(s=!0,n[c]=t,--u||r(n))},o)}),--u||r(n)});return i&&o(i.error),n.promise},race:function(t){var e=this,n=jn(e),r=n.reject,o=Sn(function(){Ue(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o&&r(o.error),n.promise}});var Tn=h.Promise,Nn=t(e(function(t){t.exports={default:Tn,__esModule:!0}})),In=t(e(function(t,e){e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}}));C(C.S+C.F*!b,"Object",{defineProperty:E.f});var Wn=h.Object,Rn=function(t,e,n){return Wn.defineProperty(t,e,n)},Ln=e(function(t){t.exports={default:Rn,__esModule:!0}}),Jn=t(e(function(t,e){e.__esModule=!0;var n=function(t){return t&&t.__esModule?t:{default:t}}(Ln);e.default=function(){function t(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),(0,n.default)(t,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()})),Dn=ct("species"),Un=function(t){var e;return Dt(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Dt(e.prototype)||(e=void 0),d(e)&&null===(e=e[Dn])&&(e=void 0)),void 0===e?Array:e},Zn=function(t,e){return new(Un(t))(e)},Gn=function(t,e){var n=1==t,r=2==t,o=3==t,i=4==t,u=6==t,c=5==t||u,s=e||Zn;return function(e,a,f){for(var l,h,p=pt(e),d=W(p),y=v(a,f,3),m=J(d.length),b=0,g=n?s(e,m):r?s(e,0):void 0;m>b;b++)if((c||b in d)&&(l=d[b],h=y(l,b,p),t))if(n)g[b]=h;else if(h)switch(t){case 3:return!0;case 5:return l;case 6:return b;case 2:g.push(l)}else if(i)return!1;return u?-1:o||i?i:g}},zn=Object.assign,qn=!zn||m(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=zn({},t)[n]||Object.keys(zn({},e)).join("")!=r})?function(t,e){for(var n=pt(t),r=arguments.length,o=1,i=Rt.f,u=Lt.f;r>o;)for(var c,s=W(arguments[o++]),a=i?tt(s).concat(i(s)):tt(s),f=a.length,l=0;f>l;)u.call(s,c=a[l++])&&(n[c]=s[c]);return n}:zn,Bn=Tt.getWeak,Kn=Gn(5),Xn=Gn(6),Qn=0,Hn=function(t){return t._l||(t._l=new Yn)},Yn=function(){this.a=[]},Vn=function(t,e){return Kn(t.a,function(t){return t[0]===e})};Yn.prototype={get:function(t){var e=Vn(this,t);if(e)return e[1]},has:function(t){return!!Vn(this,t)},set:function(t,e){var n=Vn(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=Xn(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}};var $n={getConstructor:function(t,e,n,r){var o=t(function(t,i){Ne(t,o,e,"_i"),t._i=Qn++,t._l=void 0,void 0!=i&&Ue(i,n,t[r],t)});return un(o.prototype,{delete:function(t){if(!d(t))return!1;var e=Bn(t);return!0===e?Hn(this).delete(t):e&&F(e,this._i)&&delete e[this._i]},has:function(t){if(!d(t))return!1;var e=Bn(t);return!0===e?Hn(this).has(t):e&&F(e,this._i)}}),o},def:function(t,e,n){var r=Bn(y(e),!0);return!0===r?Hn(t).set(e,n):r[t._i]=n,t},ufstore:Hn},tr=E.f,er=Gn(0),nr=function(t,e,n,r,o,i){var u=l[t],c=u,s=o?"set":"add",a=c&&c.prototype,f={};return b&&"function"==typeof c&&(i||a.forEach&&!m(function(){(new c).entries().next()}))?(c=e(function(e,n){Ne(e,c,t,"_c"),e._c=new u,void 0!=n&&Ue(n,o,e[s],e)}),er("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(t){var e="add"==t||"set"==t;t in a&&(!i||"clear"!=t)&&M(c.prototype,t,function(n,r){if(Ne(this,c,t),!e&&i&&!d(n))return"get"==t&&void 0;var o=this._c[t](0===n?0:n,r);return e?this:o})}),"size"in a&&tr(c.prototype,"size",{get:function(){return this._c.size}})):(c=r.getConstructor(e,t,o,s),un(c.prototype,n),Tt.NEED=!0),ft(c,t),f[t]=c,C(C.G+C.W+C.F,f),i||r.setStrong(c,t,o),c},rr=(e(function(t){var e,n=Gn(0),r=Tt.getWeak,o=Object.isExtensible,i=$n.ufstore,u={},c=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},s={get:function(t){if(d(t)){var e=r(t);return!0===e?i(this).get(t):e?e[this._i]:void 0}},set:function(t,e){return $n.def(this,t,e)}},a=t.exports=nr("WeakMap",c,s,$n,!0,!0);7!=(new a).set((Object.freeze||Object)(u),7).get(u)&&(e=$n.getConstructor(c),qn(e.prototype,s),Tt.NEED=!0,n(["delete","has","get","set"],function(t){var n=a.prototype,r=n[t];A(n,t,function(n,i){if(d(n)&&!o(n)){this._f||(this._f=new e);var u=this._f[t](n,i);return"set"==t?this:u}return r.call(this,n,i)})}))}),h.WeakMap),or=t(e(function(t){t.exports={default:rr,__esModule:!0}}));if(void 0===window.postMessage)throw new Error("The Flat Embed JS API is not supported in this browser");!function(t,e){var n=(h.Object||{})[t]||Object[t],r={};r[t]=e(n),C(C.S+C.F*m(function(){n(1)}),"Object",r)}("keys",function(){return function(t){return tt(pt(t))}});var ir=h.Object.keys,ur=t(e(function(t){t.exports={default:ir,__esModule:!0}}));C(C.S+C.F,"Object",{assign:qn});var cr=h.Object.assign,sr=t(e(function(t){t.exports={default:cr,__esModule:!0}})),ar=function(){function t(e){return In(this,t),this.embed=e,this.promises={},this.eventCallbacks={},this}return Jn(t,[{key:"pushCall",value:function(t,e,n){this.promises[t]=this.promises[t]||[],this.promises[t].push({resolve:e,reject:n})}},{key:"subscribeEvent",value:function(t,e){return this.eventCallbacks[t]=this.eventCallbacks[t]||[],this.eventCallbacks[t].push(e),1===this.eventCallbacks[t].length}},{key:"unsubscribeEvent",value:function(t,e){if(!this.eventCallbacks[t])return!1;if(e){var n=this.eventCallbacks[t].indexOf(e);n>=0&&this.eventCallbacks[t].splice(n,1)}else this.eventCallbacks[t]=[];return!e||0===this.eventCallbacks[t].length}},{key:"process",value:function(t){t.method?this.processMethodResponse(t):t.event&&this.processEvent(t)}},{key:"processMethodResponse",value:function(t){var e=this.promises[t.method].shift();e&&(t.error?e.reject(t.error):e.resolve(t.response))}},{key:"processEvent",value:function(t){var e=this;this.eventCallbacks[t.event]&&0!==this.eventCallbacks[t.event].length&&this.eventCallbacks[t.event].forEach(function(n){n.call(e.embed,t.parameters)})}}]),t}(),fr=new or,lr=new or;return function(){function Embed(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(In(this,Embed),t=n(t),fr.has(t))return fr.get(t);"IFRAME"!==t.nodeName&&(t=o(t,r)),this.origin="*",this.element=t,this.embedCallback=new ar;var c=new Nn(function(n){window.addEventListener("message",function(r){if(t.contentWindow===r.source){"*"===e.origin&&(e.origin=r.origin);var o=u(r.data);"ready"!==o.event&&"ping"!==o.method?e.embedCallback.process(o):n()}},!1),i(e,"ping")});return fr.set(this.element,this),lr.set(this,c),this}return Jn(Embed,[{key:"ready",value:function(){return Nn.resolve(lr.get(this))}},{key:"call",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Nn(function(r,o){return e.ready().then(function(){e.embedCallback.pushCall(t,r,o),i(e,t,n)})})}},{key:"on",value:function(t,e){if("string"!=typeof t)throw new TypeError("An event name (string) is required");if("function"!=typeof e)throw new TypeError("An callback (function) is required");this.embedCallback.subscribeEvent(t,e)&&this.call("addEventListener",t).catch(function(){})}},{key:"off",value:function(t,e){if("string"!=typeof t)throw new TypeError("An event name (string) is required");this.embedCallback.unsubscribeEvent(t,e)&&this.call("removeEventListener",t).catch(function(){})}},{key:"loadFlatScore",value:function(t,e){return this.call("loadFlatScore",{score:t,revision:e})}},{key:"loadMusicXML",value:function(t){return this.call("loadMusicXML",t)}},{key:"loadJSON",value:function(t){return this.call("loadJSON",t)}},{key:"getJSON",value:function(){return this.call("getJSON")}},{key:"getMusicXML",value:function(t){var e=this;return new Nn(function(n,r){if("object"!==(void 0===(t=t||{})?"undefined":Ce(t)))return r(new TypeError("Options must be an object"));e.call("getMusicXML",t).then(function(t){return n("string"==typeof t?t:new Uint8Array(t.data))}).catch(r)})}},{key:"getPNG",value:function(t){var e=this;return new Nn(function(n,r){if("object"!==(void 0===(t=t||{})?"undefined":Ce(t)))return r(new TypeError("Options must be an object"));e.call("getPNG",t).then(function(t){return n("string"==typeof t?t:new Uint8Array(t))}).catch(r)})}},{key:"getFlatScoreMetadata",value:function(){return this.call("getFlatScoreMetadata")}},{key:"getEmbedConfig",value:function(){return this.call("getEmbedConfig")}},{key:"setEditorConfig",value:function(t){return this.call("setEditorConfig",t)}},{key:"fullscreen",value:function(t){return this.call("fullscreen",t)}},{key:"play",value:function(){return this.call("play")}},{key:"pause",value:function(){return this.call("pause")}},{key:"stop",value:function(){return this.call("stop")}},{key:"print",value:function(){return this.call("print")}},{key:"getZoom",value:function(){return this.call("getZoom")}},{key:"setZoom",value:function(t){return this.call("setZoom",t)}},{key:"getAutoZoom",value:function(){return this.call("getAutoZoom")}},{key:"setAutoZoom",value:function(t){return this.call("setAutoZoom",t)}},{key:"focusScore",value:function(){return this.call("focusScore")}},{key:"getCursorPosition",value:function(){return this.call("getCursorPosition")}},{key:"setCursorPosition",value:function(t){return this.call("setCursorPosition",t)}},{key:"edit",value:function(t){return this.call("edit",t)}},{key:"setNoteColor",value:function(t,e){return this.call("setNoteColor",{note:t,color:e})}}]),Embed}()});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e.Flat=e.Flat||{},e.Flat.Embed=t())}(this,function(){"use strict";function e(e){if(window.jQuery&&e instanceof window.jQuery&&(e=e[0]),"string"==typeof e&&(e=document.getElementById(e)),!(e instanceof window.HTMLElement))throw new TypeError("The first parameter must be an existing DOM element or an identifier.");if("IFRAME"!==e.nodeName){var t=e.querySelector("iframe");t&&(e=t)}return e}function t(e){var t=e.baseUrl||"https://flat.io/embed";t+="/"+(e.score||"blank");var n=Object.assign({jsapi:!0},e.embedParams);return t+"?"+Object.keys(n).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(n[e])}).join("&")}function n(e,n){var r=t(n),o=document.createElement("iframe");return o.setAttribute("src",r),o.setAttribute("width",n.width||"100%"),o.setAttribute("height",n.height||"100%"),o.setAttribute("allowfullscreen",!0),o.setAttribute("frameborder","0"),e.appendChild(o),o}function r(e,t,n){if(!e.element.contentWindow||!e.element.contentWindow.postMessage)throw new Error("No `contentWindow` or `contentWindow.postMessage` avaialble on the element");var r={method:t,parameters:n};e.element.contentWindow.postMessage(r,e.origin)}function o(e){return"string"==typeof e&&(e=JSON.parse(e)),e}if(void 0===window.postMessage)throw new Error("The Flat Embed JS API is not supported in this browser");var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=(function(){function e(e){this.value=e}function t(t){function n(o,i){try{var s=t[o](i),u=s.value;u instanceof e?Promise.resolve(u.value).then(function(e){n("next",e)},function(e){n("throw",e)}):r(s.done?"return":"normal",s.value)}catch(e){r("throw",e)}}function r(e,t){switch(e){case"return":o.resolve({value:t,done:!0});break;case"throw":o.reject(t);break;default:o.resolve({value:t,done:!1})}(o=o.next)?n(o.key,o.arg):i=null}var o,i;this._invoke=function(e,t){return new Promise(function(r,s){var u={key:e,arg:t,resolve:r,reject:s,next:null};i?i=i.next=u:(o=i=u,n(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}),u=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t){return s(this,e),this.embed=t,this.promises={},this.eventCallbacks={},this}return u(e,[{key:"pushCall",value:function(e,t,n){this.promises[e]=this.promises[e]||[],this.promises[e].push({resolve:t,reject:n})}},{key:"subscribeEvent",value:function(e,t){return this.eventCallbacks[e]=this.eventCallbacks[e]||[],this.eventCallbacks[e].push(t),1===this.eventCallbacks[e].length}},{key:"unsubscribeEvent",value:function(e,t){if(!this.eventCallbacks[e])return!1;if(t){var n=this.eventCallbacks[e].indexOf(t);n>=0&&this.eventCallbacks[e].splice(n,1)}else this.eventCallbacks[e]=[];return!t||0===this.eventCallbacks[e].length}},{key:"process",value:function(e){e.method?this.processMethodResponse(e):e.event&&this.processEvent(e)}},{key:"processMethodResponse",value:function(e){var t=this.promises[e.method].shift();t&&(e.error?t.reject(e.error):t.resolve(e.response))}},{key:"processEvent",value:function(e){var t=this;this.eventCallbacks[e.event]&&0!==this.eventCallbacks[e.event].length&&this.eventCallbacks[e.event].forEach(function(n){n.call(t.embed,e.parameters)})}}]),e}(),l=new WeakMap,c=new WeakMap;return function(){function Embed(t){var i=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s(this,Embed),t=e(t),l.has(t))return l.get(t);"IFRAME"!==t.nodeName&&(t=n(t,u)),this.origin="*",this.element=t,this.embedCallback=new a;var f=new Promise(function(e){window.addEventListener("message",function(n){if(t.contentWindow===n.source){"*"===i.origin&&(i.origin=n.origin);var r=o(n.data);"ready"!==r.event&&"ping"!==r.method?i.embedCallback.process(r):e()}},!1),r(i,"ping")});return l.set(this.element,this),c.set(this,f),this}return u(Embed,[{key:"ready",value:function(){return Promise.resolve(c.get(this))}},{key:"call",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(o,i){return t.ready().then(function(){t.embedCallback.pushCall(e,o,i),r(t,e,n)})})}},{key:"on",value:function(e,t){if("string"!=typeof e)throw new TypeError("An event name (string) is required");if("function"!=typeof t)throw new TypeError("An callback (function) is required");this.embedCallback.subscribeEvent(e,t)&&this.call("addEventListener",e).catch(function(){})}},{key:"off",value:function(e,t){if("string"!=typeof e)throw new TypeError("An event name (string) is required");this.embedCallback.unsubscribeEvent(e,t)&&this.call("removeEventListener",e).catch(function(){})}},{key:"loadFlatScore",value:function(e,t){return this.call("loadFlatScore",{score:e,revision:t})}},{key:"loadMusicXML",value:function(e){return this.call("loadMusicXML",e)}},{key:"loadJSON",value:function(e){return this.call("loadJSON",e)}},{key:"getJSON",value:function(){return this.call("getJSON")}},{key:"getMusicXML",value:function(e){var t=this;return new Promise(function(n,r){if("object"!==(void 0===(e=e||{})?"undefined":i(e)))return r(new TypeError("Options must be an object"));t.call("getMusicXML",e).then(function(e){return n("string"==typeof e?e:new Uint8Array(e.data))}).catch(r)})}},{key:"getPNG",value:function(e){var t=this;return new Promise(function(n,r){if("object"!==(void 0===(e=e||{})?"undefined":i(e)))return r(new TypeError("Options must be an object"));t.call("getPNG",e).then(function(e){return n("string"==typeof e?e:new Uint8Array(e))}).catch(r)})}},{key:"getFlatScoreMetadata",value:function(){return this.call("getFlatScoreMetadata")}},{key:"getEmbedConfig",value:function(){return this.call("getEmbedConfig")}},{key:"setEditorConfig",value:function(e){return this.call("setEditorConfig",e)}},{key:"fullscreen",value:function(e){return this.call("fullscreen",e)}},{key:"play",value:function(){return this.call("play")}},{key:"pause",value:function(){return this.call("pause")}},{key:"stop",value:function(){return this.call("stop")}},{key:"print",value:function(){return this.call("print")}},{key:"getZoom",value:function(){return this.call("getZoom")}},{key:"setZoom",value:function(e){return this.call("setZoom",e)}},{key:"getAutoZoom",value:function(){return this.call("getAutoZoom")}},{key:"setAutoZoom",value:function(e){return this.call("setAutoZoom",e)}},{key:"focusScore",value:function(){return this.call("focusScore")}},{key:"getCursorPosition",value:function(){return this.call("getCursorPosition")}},{key:"setCursorPosition",value:function(e){return this.call("setCursorPosition",e)}},{key:"edit",value:function(e){return this.call("edit",e)}},{key:"setNoteColor",value:function(e,t){return this.call("setNoteColor",{note:e,color:t})}}]),Embed}()});
{
"name": "flat-embed",
"version": "0.7.0",
"version": "0.8.0",
"description": "Interact and get events from Flat's Sheet Music Embed",

@@ -43,4 +43,3 @@ "license": "Apache-2.0",

"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-env": "^1.6.1",
"chokidar": "^1.6.1",

@@ -54,7 +53,6 @@ "eslint": "^4.1.0",

"karma-mocha-reporter": "^2.2.3",
"mocha": "^3.4.1",
"rollup": "^0.45.2",
"rollup-plugin-babel": "^2.7.1",
"mocha": "^4.0.0",
"rollup": "^0.50.0",
"rollup-plugin-babel": "^3.0.0",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-hypothetical": "^1.2.1",
"rollup-plugin-node-resolve": "^3.0.0",

@@ -61,0 +59,0 @@ "uglify-js": "^3.0.9"

@@ -12,15 +12,11 @@ # Flat Sheet Music Embed Client

This API requires an API Key, [please contact us for more information](mailto:developers@flat.io).
If you have any feedback or questions regarding this product, [please feel free to contact our developers support](mailto:developers@flat.io).
## Installation
You can install our Embed Client using npm or bower:
You can install our Embed Client using [npm](https://www.npmjs.com/package/flat-embed), [yarn](https://yarnpkg.com/en/package/flat-embed) or bower:
```bash
npm install flat-embed
```
or
```bash
yarn add flat-embed
bower install flat-embed

@@ -32,3 +28,3 @@ ```

```html
<script src="https://cdn.jsdelivr.net/npm/flat-embed@v0.5.0/dist/embed.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/flat-embed@v0.8.0/dist/embed.min.js"></script>
```

@@ -42,3 +38,3 @@

<div id="embed-container"></div>
<script src="https://cdn.jsdelivr.net/npm/flat-embed@v0.5.0/dist/embed.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/flat-embed@v0.8.0/dist/embed.min.js"></script>
<script>

@@ -55,3 +51,10 @@ var container = document.getElementById('embed-container');

```
*[>> Open this demo in JSFiddle](https://jsfiddle.net/gierschv/jr91116y/)*
### App ID
Our Embed JS API requires an App ID (`appId`) to use it:
* In development, you can try and use this client without limits on `localhost`/`*.localhost`.
* To use it in production or with a custom domain, [create a new app on our website](https://flat.io/developers/apps), then go to the *Embed > Settings* and add your domains to the whitelist. Your app ID will also be displayed on this page.
## Embed construction

@@ -105,3 +108,3 @@

* [`focusScore`](#focusscore-promisevoid-error): Set the focus to the score
* [`setNoteColor`](#setnotecolor-promisevoid-error): Set the color for the given note
* [`setNoteColor`](#setnotecolornotelocation-object-color-string-promiseobject-error): Set the color for the given note
* [`getCursorPosition`](#getcursorposition-promiseobject-error): Get the current cursor position of the score

@@ -108,0 +111,0 @@ * [`setCursorPosition`](#setcursorpositionposition-object-promiseobject-error): Set a new position for the cursor

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc