Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

toast-me

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toast-me - npm Package Compare versions

Comparing version 1.4.14 to 1.5.0

toast-me.d.ts

2

lib/toast-me.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("toast-me",[],e):"object"==typeof exports?exports["toast-me"]=e():t["toast-me"]=e()}("undefined"!=typeof self?self:this,(()=>(()=>{"use strict";var t={115:(t,e,o)=>{o.d(e,{Z:()=>i});var a=o(81),n=o.n(a),r=o(645),s=o.n(r)()(n());s.push([t.id,'.ToastMe__toast___AHIYl{-ms-flex-align:center;-ms-flex-pack:stretch;-ms-flex-negative:0;align-items:center;background-color:rgba(0,0,0,.9);border-radius:4px;display:-ms-flexbox;display:flex;flex-shrink:0;height:48px;justify-content:stretch;left:50%;min-width:270px;padding:0 15px;width:40%}.ToastMe__toast___AHIYl.ToastMe__error___F4WMb{background-color:#d40d00}.ToastMe__container___dJjGH{color:#fff;height:0;position:fixed;width:100%}.ToastMe__container___dJjGH.ToastMe__chain___jRXVl{-ms-flex-pack:end;-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;justify-content:flex-end}.ToastMe__container___dJjGH.ToastMe__chain___jRXVl.ToastMe__top___lUSSQ{-ms-flex-direction:column-reverse;flex-direction:column-reverse}.ToastMe__container___dJjGH.ToastMe__chain___jRXVl.ToastMe__bottom___wAgGK{-ms-flex-direction:column;flex-direction:column}.ToastMe__container___dJjGH.ToastMe__top___lUSSQ{top:0}.ToastMe__container___dJjGH.ToastMe__bottom___wAgGK{bottom:0}.ToastMe__container___dJjGH.ToastMe__top___lUSSQ.ToastMe__over___ZsnYy .ToastMe__toast___AHIYl{-webkit-animation:ToastMe__toast-in-top-over___Pos0q .3s ease-out forwards;animation:ToastMe__toast-in-top-over___Pos0q .3s ease-out forwards;position:absolute;top:12px}.ToastMe__container___dJjGH.ToastMe__top___lUSSQ.ToastMe__over___ZsnYy .ToastMe__toast___AHIYl.ToastMe__remove___GSCEM{-webkit-animation:ToastMe__toast-out___ThfvU .4s forwards;animation:ToastMe__toast-out___ThfvU .4s forwards;-webkit-transform:translate(-50%);-ms-transform:translate(-50%);transform:translate(-50%)}.ToastMe__container___dJjGH.ToastMe__bottom___wAgGK.ToastMe__over___ZsnYy .ToastMe__toast___AHIYl{-webkit-animation:ToastMe__toast-in-bottom-over___BLukl .3s ease-out forwards;animation:ToastMe__toast-in-bottom-over___BLukl .3s ease-out forwards;bottom:30px;position:absolute}.ToastMe__container___dJjGH.ToastMe__bottom___wAgGK.ToastMe__over___ZsnYy .ToastMe__toast___AHIYl.ToastMe__remove___GSCEM{-webkit-animation:ToastMe__toast-out___ThfvU .4s forwards;animation:ToastMe__toast-out___ThfvU .4s forwards;-webkit-transform:translate(-50%);-ms-transform:translate(-50%);transform:translate(-50%)}.ToastMe__container___dJjGH.ToastMe__top___lUSSQ.ToastMe__chain___jRXVl .ToastMe__toast___AHIYl{-webkit-animation:ToastMe__toast-in-chain___tIeHS .4s ease-out none;animation:ToastMe__toast-in-chain___tIeHS .4s ease-out none;margin-top:12px;max-height:100px}.ToastMe__container___dJjGH.ToastMe__top___lUSSQ.ToastMe__chain___jRXVl .ToastMe__toast___AHIYl.ToastMe__remove___GSCEM{margin-top:0;max-height:0;opacity:0;-webkit-transition:margin-top .2s .2s,max-height .2s .2s,opacity .2s;-o-transition:margin-top .2s .2s,max-height .2s .2s,opacity .2s;transition:margin-top .2s .2s,max-height .2s .2s,opacity .2s}.ToastMe__container___dJjGH.ToastMe__bottom___wAgGK.ToastMe__chain___jRXVl .ToastMe__toast___AHIYl{-webkit-animation:ToastMe__toast-in-chain___tIeHS .4s ease-out none;animation:ToastMe__toast-in-chain___tIeHS .4s ease-out none;margin-bottom:12px;max-height:100px}.ToastMe__container___dJjGH.ToastMe__bottom___wAgGK.ToastMe__chain___jRXVl .ToastMe__toast___AHIYl:last-child{margin-bottom:30px}.ToastMe__container___dJjGH.ToastMe__bottom___wAgGK.ToastMe__chain___jRXVl .ToastMe__toast___AHIYl.ToastMe__remove___GSCEM{margin-bottom:0;max-height:0;opacity:0;-webkit-transition:margin-bottom .2s .2s,max-height .2s .2s,opacity .2s;-o-transition:margin-bottom .2s .2s,max-height .2s .2s,opacity .2s;transition:margin-bottom .2s .2s,max-height .2s .2s,opacity .2s}@-webkit-keyframes ToastMe__toast-in-top-over___Pos0q{0%{opacity:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}to{opacity:1;-webkit-transform:translate(-50%);transform:translate(-50%)}}@keyframes ToastMe__toast-in-top-over___Pos0q{0%{opacity:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}to{opacity:1;-webkit-transform:translate(-50%);transform:translate(-50%)}}@-webkit-keyframes ToastMe__toast-in-bottom-over___BLukl{0%{opacity:0;-webkit-transform:translate(-50%,50%);transform:translate(-50%,50%)}to{opacity:1;-webkit-transform:translate(-50%);transform:translate(-50%)}}@keyframes ToastMe__toast-in-bottom-over___BLukl{0%{opacity:0;-webkit-transform:translate(-50%,50%);transform:translate(-50%,50%)}to{opacity:1;-webkit-transform:translate(-50%);transform:translate(-50%)}}@-webkit-keyframes ToastMe__toast-in-chain___tIeHS{0%{max-height:0;opacity:0}25%{max-height:100px;opacity:0}to{opacity:1}}@keyframes ToastMe__toast-in-chain___tIeHS{0%{max-height:0;opacity:0}25%{max-height:100px;opacity:0}to{opacity:1}}@-webkit-keyframes ToastMe__toast-out___ThfvU{0%{opacity:1}50%{max-height:100px;opacity:0}to{max-height:0;opacity:0}}@keyframes ToastMe__toast-out___ThfvU{0%{opacity:1}50%{max-height:100px;opacity:0}to{max-height:0;opacity:0}}.ToastMe__message___jG_k3{-ms-flex:1 1;flex:1 1;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.ToastMe__button___rgnK1{background-color:transparent;border:none;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;color:#fff;cursor:pointer;outline:none;padding:0;position:relative;-webkit-transition:background-color .2s;-o-transition:background-color .2s;transition:background-color .2s}.ToastMe__button___rgnK1:hover{background-color:hsla(0,0%,100%,.1)}.ToastMe__button___rgnK1:active{background-color:hsla(0,0%,100%,.2)}.ToastMe__action___T22Kg{-ms-flex-negative:0;-ms-flex-positive:0;color:#0b8aff;flex-grow:0;flex-shrink:0;line-height:24px;margin:0 8px;padding:0 8px}.ToastMe__close___rR5u6{-ms-flex:0 0 24px;flex:0 0 24px;height:24px;width:24px}.ToastMe__close___rR5u6:after,.ToastMe__close___rR5u6:before{background-color:#fff;content:"";display:block;height:2px;left:50%;position:absolute;top:calc(50% - 1px);width:20px}.ToastMe__close___rR5u6:before{-webkit-transform:translateX(-50%) rotate(45deg);-ms-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg)}.ToastMe__close___rR5u6:after{-webkit-transform:translateX(-50%) rotate(135deg);-ms-transform:translateX(-50%) rotate(135deg);transform:translateX(-50%) rotate(135deg)}.ToastMe__close___rR5u6.ToastMe__hidden___J9F6j{display:none}',""]),s.locals={toast:"ToastMe__toast___AHIYl",error:"ToastMe__error___F4WMb",container:"ToastMe__container___dJjGH",chain:"ToastMe__chain___jRXVl",top:"ToastMe__top___lUSSQ",bottom:"ToastMe__bottom___wAgGK",over:"ToastMe__over___ZsnYy","toast-in-top-over":"ToastMe__toast-in-top-over___Pos0q",remove:"ToastMe__remove___GSCEM","toast-out":"ToastMe__toast-out___ThfvU","toast-in-bottom-over":"ToastMe__toast-in-bottom-over___BLukl","toast-in-chain":"ToastMe__toast-in-chain___tIeHS",message:"ToastMe__message___jG_k3",button:"ToastMe__button___rgnK1",action:"ToastMe__action___T22Kg",close:"ToastMe__close___rR5u6",hidden:"ToastMe__hidden___J9F6j"};const i=s},645:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",a=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),a&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),a&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,a,n,r){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(a)for(var i=0;i<this.length;i++){var _=this[i][0];null!=_&&(s[_]=!0)}for(var c=0;c<t.length;c++){var l=[].concat(t[c]);a&&s[l[0]]||(void 0!==r&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=r),o&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=o):l[2]=o),n&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=n):l[4]="".concat(n)),e.push(l))}},e}},81:t=>{t.exports=function(t){return t[1]}},379:t=>{var e=[];function o(t){for(var o=-1,a=0;a<e.length;a++)if(e[a].identifier===t){o=a;break}return o}function a(t,a){for(var r={},s=[],i=0;i<t.length;i++){var _=t[i],c=a.base?_[0]+a.base:_[0],l=r[c]||0,u="".concat(c," ").concat(l);r[c]=l+1;var m=o(u),p={css:_[1],media:_[2],sourceMap:_[3],supports:_[4],layer:_[5]};if(-1!==m)e[m].references++,e[m].updater(p);else{var f=n(p,a);a.byIndex=i,e.splice(i,0,{identifier:u,updater:f,references:1})}s.push(u)}return s}function n(t,e){var o=e.domAPI(e);return o.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;o.update(t=e)}else o.remove()}}t.exports=function(t,n){var r=a(t=t||[],n=n||{});return function(t){t=t||[];for(var s=0;s<r.length;s++){var i=o(r[s]);e[i].references--}for(var _=a(t,n),c=0;c<r.length;c++){var l=o(r[c]);0===e[l].references&&(e[l].updater(),e.splice(l,1))}r=_}}},569:t=>{var e={};t.exports=function(t,o){var a=function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}(t);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(o)}},216:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,o)=>{t.exports=function(t){var e=o.nc;e&&t.setAttribute("nonce",e)}},795:t=>{t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(o){!function(t,e,o){var a="";o.supports&&(a+="@supports (".concat(o.supports,") {")),o.media&&(a+="@media ".concat(o.media," {"));var n=void 0!==o.layer;n&&(a+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),a+=o.css,n&&(a+="}"),o.media&&(a+="}"),o.supports&&(a+="}");var r=o.sourceMap;r&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleTagTransform(a,t,e.options)}(e,t,o)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function o(a){var n=e[a];if(void 0!==n)return n.exports;var r=e[a]={id:a,exports:{}};return t[a](r,r.exports,o),r.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var a in e)o.o(e,a)&&!o.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nc=void 0;var a={};return(()=>{o.r(a),o.d(a,{ToastMeClass:()=>A,ToastOptions:()=>T,default:()=>O,removeAllToasts:()=>G});var t=o(379),e=o.n(t),n=o(795),r=o.n(n),s=o(569),i=o.n(s),_=o(565),c=o.n(_),l=o(216),u=o.n(l),m=o(589),p=o.n(m),f=o(115),d={};d.styleTagTransform=p(),d.setAttributes=c(),d.insert=i().bind(null,"head"),d.domAPI=r(),d.insertStyleElement=u(),e()(f.Z,d);const h=f.Z&&f.Z.locals?f.Z.locals:void 0;var v=1e3,b=5e3;const T={default:{position:"top",type:"over",toastClass:"",removedToastClass:"",containerClass:"",useUniqueContainer:!1,useUnsafeHtmlContent:!1,closeable:!0,timeoutOnRemove:v,duration:b},error:{toastClass:h.error,timeoutOnRemove:v,duration:b}};function y(t){return t.reduce((function(t,e){return t.concat(Array.isArray(e)?y(e):e)}),[])}function M(t){return t?t.split(" "):[]}function g(t,e){(Array.isArray(e)?y(e.map(M)):M(e)).forEach((function(e){return e&&t.classList.add(e)}))}function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function w(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,a)}return o}function k(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?w(Object(o),!0).forEach((function(e){j(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):w(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function j(t,e,o){return(e=C(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function H(t,e){for(var o=0;o<e.length;o++){var a=e[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,C(a.key),a)}}function C(t){var e=function(t,e){if("object"!==x(t)||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var a=o.call(t,"string");if("object"!==x(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===x(e)?e:String(e)}var A=function(){function t(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"notify",a=arguments.length>2?arguments[2]:void 0;S(this,t);var n=k({},T.default);"string"==typeof o&&T[o]?n=k(k({},n),T[o]):"object"===x(o)&&(n=k(k({},n),o)),"over"===n.type&&t.removeAll(n),this.options=n,this.content=e,this.domNode=this.createToastNode(a),t.getContainer(n).appendChild(this.domNode),this.startTimer()}var e,o,a;return e=t,a=[{key:"getContainer",value:function(t){var e=t.position,o=void 0===e?"top":e,a=t.type,n=void 0===a?"over":a,r=t.containerClass,s=void 0===r?"":r,i=t.useUniqueContainer,_=void 0!==i&&i,c="bottom"===o?h.bottom:h.top,l="chain"===n?h.chain:h.over,u=".".concat(h.container,".").concat(c,".").concat(l),m=_?null:document.querySelector(u);return m?m.className="":(m=document.createElement("div"),document.body.appendChild(m)),g(m,[h.container,c,l,s]),m}},{key:"removeAll",value:function(e){for(var o=t.getContainer(e).querySelectorAll(".".concat(h.close)),a=0,n=o.length;a<n;a+=1)o[a].click()}}],(o=[{key:"createToastNode",value:function(t){var e=this,o=document.createElement("div");g(o,h.toast);var a=document.createElement("div");if(g(a,h.message),this.options.useUnsafeHtmlContent?(a.innerHTML=this.content,o.appendChild(a)):(a.textContent=this.content,o.appendChild(a),o.title=this.content),g(o,[this.options.toastClass]),t){var n=document.createElement("button");g(n,[h.action,h.button,t.class]),n.title=t.label,n.textContent=t.label,n.addEventListener("click",(function(){t.action(),e.close()})),o.appendChild(n)}var r=document.createElement("button");return g(r,[h.close,h.button,!this.options.closeable&&h.hidden]),r.title="Close",r.addEventListener("click",(function(){return e.close()})),o.appendChild(r),o.addEventListener("mouseenter",(function(){return e.stopTimer()})),o.addEventListener("mouseleave",(function(){return e.startTimer()})),o}},{key:"close",value:function(){var t=this;this.stopTimer(),this.domNode&&(g(this.domNode,[h.remove,this.options.removedToastClass]),setTimeout((function(){t.domNode.remove()}),this.options.timeoutOnRemove||v))}},{key:"startTimer",value:function(){var t=this;this.stopTimer(),this.timerShow=setTimeout((function(){return t.close()}),this.options.duration||b)}},{key:"stopTimer",value:function(){clearTimeout(this.timerShow)}}])&&H(e.prototype,o),a&&H(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();function G(t){A.removeAll(t)}function O(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"notify",o=arguments.length>2?arguments[2]:void 0;return new A(t,e,o)}})(),a})()));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("toast-me",[],e):"object"==typeof exports?exports["toast-me"]=e():t["toast-me"]=e()}("undefined"!=typeof self?self:this,(()=>(()=>{"use strict";var t={115:(t,e,o)=>{o.d(e,{Z:()=>i});var a=o(81),n=o.n(a),r=o(645),s=o.n(r)()(n());s.push([t.id,'.ToastMe__toast___AHIYl{-ms-flex-align:center;-ms-flex-pack:stretch;-ms-flex-negative:0;align-items:center;background-color:rgba(0,0,0,.9);border-radius:4px;display:-ms-flexbox;display:flex;flex-shrink:0;height:48px;justify-content:stretch;left:50%;min-width:270px;padding:0 15px;width:40%}.ToastMe__toast___AHIYl.ToastMe__error___F4WMb{background-color:#d40d00}.ToastMe__container___dJjGH{color:#fff;height:0;position:fixed;width:100%}.ToastMe__container___dJjGH.ToastMe__chain___jRXVl{-ms-flex-pack:end;-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;justify-content:flex-end}.ToastMe__container___dJjGH.ToastMe__chain___jRXVl.ToastMe__top___lUSSQ{-ms-flex-direction:column-reverse;flex-direction:column-reverse}.ToastMe__container___dJjGH.ToastMe__chain___jRXVl.ToastMe__bottom___wAgGK{-ms-flex-direction:column;flex-direction:column}.ToastMe__container___dJjGH.ToastMe__top___lUSSQ{top:0}.ToastMe__container___dJjGH.ToastMe__bottom___wAgGK{bottom:0}.ToastMe__container___dJjGH.ToastMe__top___lUSSQ.ToastMe__over___ZsnYy .ToastMe__toast___AHIYl{-webkit-animation:ToastMe__toast-in-top-over___Pos0q .3s ease-out forwards;animation:ToastMe__toast-in-top-over___Pos0q .3s ease-out forwards;position:absolute;top:12px}.ToastMe__container___dJjGH.ToastMe__top___lUSSQ.ToastMe__over___ZsnYy .ToastMe__toast___AHIYl.ToastMe__remove___GSCEM{-webkit-animation:ToastMe__toast-out___ThfvU .4s forwards;animation:ToastMe__toast-out___ThfvU .4s forwards;-webkit-transform:translate(-50%);-ms-transform:translate(-50%);transform:translate(-50%)}.ToastMe__container___dJjGH.ToastMe__bottom___wAgGK.ToastMe__over___ZsnYy .ToastMe__toast___AHIYl{-webkit-animation:ToastMe__toast-in-bottom-over___BLukl .3s ease-out forwards;animation:ToastMe__toast-in-bottom-over___BLukl .3s ease-out forwards;bottom:30px;position:absolute}.ToastMe__container___dJjGH.ToastMe__bottom___wAgGK.ToastMe__over___ZsnYy .ToastMe__toast___AHIYl.ToastMe__remove___GSCEM{-webkit-animation:ToastMe__toast-out___ThfvU .4s forwards;animation:ToastMe__toast-out___ThfvU .4s forwards;-webkit-transform:translate(-50%);-ms-transform:translate(-50%);transform:translate(-50%)}.ToastMe__container___dJjGH.ToastMe__top___lUSSQ.ToastMe__chain___jRXVl .ToastMe__toast___AHIYl{-webkit-animation:ToastMe__toast-in-chain___tIeHS .4s ease-out none;animation:ToastMe__toast-in-chain___tIeHS .4s ease-out none;margin-top:12px;max-height:100px}.ToastMe__container___dJjGH.ToastMe__top___lUSSQ.ToastMe__chain___jRXVl .ToastMe__toast___AHIYl.ToastMe__remove___GSCEM{margin-top:0;max-height:0;opacity:0;-webkit-transition:margin-top .2s .2s,max-height .2s .2s,opacity .2s;-o-transition:margin-top .2s .2s,max-height .2s .2s,opacity .2s;transition:margin-top .2s .2s,max-height .2s .2s,opacity .2s}.ToastMe__container___dJjGH.ToastMe__bottom___wAgGK.ToastMe__chain___jRXVl .ToastMe__toast___AHIYl{-webkit-animation:ToastMe__toast-in-chain___tIeHS .4s ease-out none;animation:ToastMe__toast-in-chain___tIeHS .4s ease-out none;margin-bottom:12px;max-height:100px}.ToastMe__container___dJjGH.ToastMe__bottom___wAgGK.ToastMe__chain___jRXVl .ToastMe__toast___AHIYl:last-child{margin-bottom:30px}.ToastMe__container___dJjGH.ToastMe__bottom___wAgGK.ToastMe__chain___jRXVl .ToastMe__toast___AHIYl.ToastMe__remove___GSCEM{margin-bottom:0;max-height:0;opacity:0;-webkit-transition:margin-bottom .2s .2s,max-height .2s .2s,opacity .2s;-o-transition:margin-bottom .2s .2s,max-height .2s .2s,opacity .2s;transition:margin-bottom .2s .2s,max-height .2s .2s,opacity .2s}@-webkit-keyframes ToastMe__toast-in-top-over___Pos0q{0%{opacity:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}to{opacity:1;-webkit-transform:translate(-50%);transform:translate(-50%)}}@keyframes ToastMe__toast-in-top-over___Pos0q{0%{opacity:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}to{opacity:1;-webkit-transform:translate(-50%);transform:translate(-50%)}}@-webkit-keyframes ToastMe__toast-in-bottom-over___BLukl{0%{opacity:0;-webkit-transform:translate(-50%,50%);transform:translate(-50%,50%)}to{opacity:1;-webkit-transform:translate(-50%);transform:translate(-50%)}}@keyframes ToastMe__toast-in-bottom-over___BLukl{0%{opacity:0;-webkit-transform:translate(-50%,50%);transform:translate(-50%,50%)}to{opacity:1;-webkit-transform:translate(-50%);transform:translate(-50%)}}@-webkit-keyframes ToastMe__toast-in-chain___tIeHS{0%{max-height:0;opacity:0}25%{max-height:100px;opacity:0}to{opacity:1}}@keyframes ToastMe__toast-in-chain___tIeHS{0%{max-height:0;opacity:0}25%{max-height:100px;opacity:0}to{opacity:1}}@-webkit-keyframes ToastMe__toast-out___ThfvU{0%{opacity:1}50%{max-height:100px;opacity:0}to{max-height:0;opacity:0}}@keyframes ToastMe__toast-out___ThfvU{0%{opacity:1}50%{max-height:100px;opacity:0}to{max-height:0;opacity:0}}.ToastMe__message___jG_k3{-ms-flex:1 1;flex:1 1;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.ToastMe__button___rgnK1{background-color:transparent;border:none;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;color:#fff;cursor:pointer;outline:none;padding:0;position:relative;-webkit-transition:background-color .2s;-o-transition:background-color .2s;transition:background-color .2s}.ToastMe__button___rgnK1:hover{background-color:hsla(0,0%,100%,.1)}.ToastMe__button___rgnK1:active{background-color:hsla(0,0%,100%,.2)}.ToastMe__action___T22Kg{-ms-flex-negative:0;-ms-flex-positive:0;color:#0b8aff;flex-grow:0;flex-shrink:0;line-height:24px;margin:0 8px;padding:0 8px}.ToastMe__close___rR5u6{-ms-flex:0 0 24px;flex:0 0 24px;height:24px;width:24px}.ToastMe__close___rR5u6:after,.ToastMe__close___rR5u6:before{background-color:#fff;content:"";display:block;height:2px;left:50%;position:absolute;top:calc(50% - 1px);width:20px}.ToastMe__close___rR5u6:before{-webkit-transform:translateX(-50%) rotate(45deg);-ms-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg)}.ToastMe__close___rR5u6:after{-webkit-transform:translateX(-50%) rotate(135deg);-ms-transform:translateX(-50%) rotate(135deg);transform:translateX(-50%) rotate(135deg)}.ToastMe__close___rR5u6.ToastMe__hidden___J9F6j{display:none}',""]),s.locals={toast:"ToastMe__toast___AHIYl",error:"ToastMe__error___F4WMb",container:"ToastMe__container___dJjGH",chain:"ToastMe__chain___jRXVl",top:"ToastMe__top___lUSSQ",bottom:"ToastMe__bottom___wAgGK",over:"ToastMe__over___ZsnYy","toast-in-top-over":"ToastMe__toast-in-top-over___Pos0q",remove:"ToastMe__remove___GSCEM","toast-out":"ToastMe__toast-out___ThfvU","toast-in-bottom-over":"ToastMe__toast-in-bottom-over___BLukl","toast-in-chain":"ToastMe__toast-in-chain___tIeHS",message:"ToastMe__message___jG_k3",button:"ToastMe__button___rgnK1",action:"ToastMe__action___T22Kg",close:"ToastMe__close___rR5u6",hidden:"ToastMe__hidden___J9F6j"};const i=s},645:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",a=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),a&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),a&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,a,n,r){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(a)for(var i=0;i<this.length;i++){var _=this[i][0];null!=_&&(s[_]=!0)}for(var c=0;c<t.length;c++){var l=[].concat(t[c]);a&&s[l[0]]||(void 0!==r&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=r),o&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=o):l[2]=o),n&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=n):l[4]="".concat(n)),e.push(l))}},e}},81:t=>{t.exports=function(t){return t[1]}},379:t=>{var e=[];function o(t){for(var o=-1,a=0;a<e.length;a++)if(e[a].identifier===t){o=a;break}return o}function a(t,a){for(var r={},s=[],i=0;i<t.length;i++){var _=t[i],c=a.base?_[0]+a.base:_[0],l=r[c]||0,u="".concat(c," ").concat(l);r[c]=l+1;var m=o(u),p={css:_[1],media:_[2],sourceMap:_[3],supports:_[4],layer:_[5]};if(-1!==m)e[m].references++,e[m].updater(p);else{var f=n(p,a);a.byIndex=i,e.splice(i,0,{identifier:u,updater:f,references:1})}s.push(u)}return s}function n(t,e){var o=e.domAPI(e);return o.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;o.update(t=e)}else o.remove()}}t.exports=function(t,n){var r=a(t=t||[],n=n||{});return function(t){t=t||[];for(var s=0;s<r.length;s++){var i=o(r[s]);e[i].references--}for(var _=a(t,n),c=0;c<r.length;c++){var l=o(r[c]);0===e[l].references&&(e[l].updater(),e.splice(l,1))}r=_}}},569:t=>{var e={};t.exports=function(t,o){var a=function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}(t);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(o)}},216:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,o)=>{t.exports=function(t){var e=o.nc;e&&t.setAttribute("nonce",e)}},795:t=>{t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(o){!function(t,e,o){var a="";o.supports&&(a+="@supports (".concat(o.supports,") {")),o.media&&(a+="@media ".concat(o.media," {"));var n=void 0!==o.layer;n&&(a+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),a+=o.css,n&&(a+="}"),o.media&&(a+="}"),o.supports&&(a+="}");var r=o.sourceMap;r&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleTagTransform(a,t,e.options)}(e,t,o)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function o(a){var n=e[a];if(void 0!==n)return n.exports;var r=e[a]={id:a,exports:{}};return t[a](r,r.exports,o),r.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var a in e)o.o(e,a)&&!o.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nc=void 0;var a={};return(()=>{o.r(a),o.d(a,{ToastMeClass:()=>A,ToastOptions:()=>T,default:()=>O,removeAllToasts:()=>G});var t=o(379),e=o.n(t),n=o(795),r=o.n(n),s=o(569),i=o.n(s),_=o(565),c=o.n(_),l=o(216),u=o.n(l),m=o(589),p=o.n(m),f=o(115),d={};d.styleTagTransform=p(),d.setAttributes=c(),d.insert=i().bind(null,"head"),d.domAPI=r(),d.insertStyleElement=u(),e()(f.Z,d);const h=f.Z&&f.Z.locals?f.Z.locals:void 0;var v=1e3,b=5e3;const T={default:{position:"top",type:"over",toastClass:"",removedToastClass:"",containerClass:"",useUniqueContainer:!1,useUnsafeHtmlContent:!1,closeable:!0,timeoutOnRemove:v,duration:b},error:{toastClass:h.error,timeoutOnRemove:v,duration:b}};function y(t){return t.reduce((function(t,e){return t.concat(Array.isArray(e)?y(e):e)}),[])}function M(t){return t?t.split(" "):[]}function g(t,e){(Array.isArray(e)?y(e.map(M)):M(e)).forEach((function(e){return e&&t.classList.add(e)}))}function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function w(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,a)}return o}function k(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?w(Object(o),!0).forEach((function(e){j(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):w(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function j(t,e,o){return(e=C(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function H(t,e){for(var o=0;o<e.length;o++){var a=e[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,C(a.key),a)}}function C(t){var e=function(t,e){if("object"!==x(t)||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var a=o.call(t,"string");if("object"!==x(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===x(e)?e:String(e)}var A=function(){function t(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"notify",a=arguments.length>2?arguments[2]:void 0;S(this,t);var n=k({},T.default);"string"==typeof o&&T[o]?n=k(k({},n),T[o]):"object"===x(o)&&(n=k(k({},n),o)),"over"===n.type&&t.removeAll(n),this.options=n,this.content=e,this.domNode=this.createToastNode(a),t.getContainer(n).appendChild(this.domNode),this.startTimer()}var e,o,a;return e=t,a=[{key:"getContainer",value:function(t){var e=t.position,o=void 0===e?"top":e,a=t.type,n=void 0===a?"over":a,r=t.containerClass,s=void 0===r?"":r,i=t.useUniqueContainer,_=void 0!==i&&i,c="bottom"===o?h.bottom:h.top,l="chain"===n?h.chain:h.over,u=".".concat(h.container,".").concat(c,".").concat(l),m=_?null:document.querySelector(u);return m?m.className="":(m=document.createElement("div"),document.body.appendChild(m)),g(m,[h.container,c,l,s]),m}},{key:"removeAll",value:function(e){for(var o=t.getContainer(e).querySelectorAll(".".concat(h.close)),a=0,n=o.length;a<n;a+=1)o[a].click()}}],(o=[{key:"createToastNode",value:function(t){var e=this,o=document.createElement("div");g(o,h.toast);var a=document.createElement("div");if(g(a,h.message),this.options.useUnsafeHtmlContent?(a.innerHTML=this.content,o.appendChild(a)):(a.textContent=this.content,o.appendChild(a),o.title=this.content),g(o,[this.options.toastClass]),t){var n=document.createElement("button");g(n,[h.action,h.button,t.class]),n.title=t.label,n.textContent=t.label,n.addEventListener("click",(function(){t.action(),e.close()})),o.appendChild(n)}var r=document.createElement("button");return g(r,[h.close,h.button,!this.options.closeable&&h.hidden]),r.title="Close",r.addEventListener("click",(function(){return e.close()})),o.appendChild(r),o.addEventListener("mouseenter",(function(){return e.stopTimer()})),o.addEventListener("mouseleave",(function(){return e.startTimer()})),o}},{key:"close",value:function(){var t=this;this.stopTimer(),this.domNode&&(g(this.domNode,[h.remove,this.options.removedToastClass]),setTimeout((function(){t.domNode.remove()}),this.options.timeoutOnRemove||v))}},{key:"startTimer",value:function(){var t=this;this.stopTimer(),this.timerShow=setTimeout((function(){return t.close()}),this.options.duration||b)}},{key:"stopTimer",value:function(){clearTimeout(this.timerShow)}}])&&H(e.prototype,o),a&&H(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();function G(t){A.removeAll(t)}function O(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"notify",o=arguments.length>2?arguments[2]:void 0;return new A(t,e,o)}O._version="1.5.0"})(),a})()));
{
"name": "toast-me",
"version": "1.4.14",
"version": "1.5.0",
"description": "Creates toast messages",
"main": "lib/toast-me.min.js",
"types": "toast-me.d.ts",
"scripts": {
"build": "webpack --env build --config scripts/config/webpack.config.prod.js",
"run-dev": "node scripts/dev-server",
"run-demo": "cross-env DEMO=true PORT=3006 node scripts/dev-server",
"watch": "webpack --watch --env dev --config scripts/config/webpack.config.devLib.js",

@@ -52,3 +54,3 @@ "test-watch": "node scripts/test.js --env=jsdom --config jest.config.js",

"clean-webpack-plugin": "^2.0.1",
"cross-env": "^5.2.0",
"cross-env": "^5.2.1",
"css-loader": "^6.7.3",

@@ -77,2 +79,3 @@ "cssnano": "^5.1.14",

"style-loader": "^3.3.1",
"toast-me": "^1.4.14",
"webpack": "^5.75.0",

@@ -79,0 +82,0 @@ "webpack-cli": "^5.0.1",

@@ -271,1 +271,5 @@ # toast-me

1. [Jest](https://jestjs.io/docs/en/getting-started)
## Thanks for contributing:
[@TV-T](https://github.com/TV-T)

@@ -12,3 +12,3 @@ // @flow

export default function (
export default function toast (
content: string,

@@ -20,1 +20,3 @@ receivedOptions?: null | ToastOptionsType | 'error' | 'notify' = 'notify',

}
toast._version = VERSION;
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