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.1.0 to 1.1.1

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,function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=5)}([function(t,e,o){var n=o(1);"string"==typeof n&&(n=[[t.i,n,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};o(3)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,o){(e=t.exports=o(2)(!1)).push([t.i,'.index__container___1eyTh{position:fixed;top:0;width:100%;color:#fff}.index__container___1eyTh.index__bottom___1F1B5{top:auto;bottom:0}.index__toast___233-Y{height:48px;width:40%;min-width:270px;padding:0 15px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:stretch;justify-content:stretch;background-color:rgba(0,0,0,.9);border-radius:4px;position:absolute;top:12px;left:50%;-webkit-animation:index__toast-in-top___3uuec .3s ease-out forwards;animation:index__toast-in-top___3uuec .3s ease-out forwards}.index__toast___233-Y.index__remove___nvwuo{-webkit-transform:translate(-50%);-ms-transform:translate(-50%);transform:translate(-50%);-webkit-animation:index__toast-out___1NqCu .2s forwards;animation:index__toast-out___1NqCu .2s forwards}.index__toast___233-Y.index__error___38eWT{background-color:#d40d00}.index__toastBottom___1NZ1k{top:auto;bottom:30px;-webkit-animation:index__toast-in-bottom___1BpTv .3s ease-out forwards;animation:index__toast-in-bottom___1BpTv .3s ease-out forwards}@-webkit-keyframes index__toast-in-top___3uuec{0%{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0}to{-webkit-transform:translate(-50%);transform:translate(-50%);opacity:1}}@keyframes index__toast-in-top___3uuec{0%{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0}to{-webkit-transform:translate(-50%);transform:translate(-50%);opacity:1}}@-webkit-keyframes index__toast-in-bottom___1BpTv{0%{-webkit-transform:translate(-50%,50%);transform:translate(-50%,50%);opacity:0}to{-webkit-transform:translate(-50%);transform:translate(-50%);opacity:1}}@keyframes index__toast-in-bottom___1BpTv{0%{-webkit-transform:translate(-50%,50%);transform:translate(-50%,50%);opacity:0}to{-webkit-transform:translate(-50%);transform:translate(-50%);opacity:1}}@-webkit-keyframes index__toast-out___1NqCu{0%{opacity:1}to{opacity:0}}@keyframes index__toast-out___1NqCu{0%{opacity:1}to{opacity:0}}.index__message___2bel9{-ms-flex:1 1;flex:1 1;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.index__button___1t8u7{outline:none;border:none;border-radius:4px;background-color:transparent;position:relative;margin-left:10px;cursor:pointer;color:#fff;-webkit-transition:background-color .2s;-o-transition:background-color .2s;transition:background-color .2s}.index__button___1t8u7:hover{background-color:hsla(0,0%,100%,.1)}.index__button___1t8u7:active{background-color:hsla(0,0%,100%,.2)}.index__action___2faCa{-ms-flex-negative:0;flex-shrink:0;-ms-flex-positive:0;flex-grow:0;padding:0 8px;line-height:24px;color:#0b8aff}.index__close___2o6CK{-ms-flex:0 0 24px;flex:0 0 24px;width:24px;height:24px}.index__close___2o6CK:after,.index__close___2o6CK:before{content:"";display:block;position:absolute;width:20px;height:2px;top:calc(50% - 1px);left:50%;background-color:#fff}.index__close___2o6CK:before{-webkit-transform:translateX(-50%) rotate(45deg);-ms-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg)}.index__close___2o6CK:after{-webkit-transform:translateX(-50%) rotate(135deg);-ms-transform:translateX(-50%) rotate(135deg);transform:translateX(-50%) rotate(135deg)}.index__close___2o6CK.index__hidden___Ov2Dy{display:none}',""]),e.locals={container:"index__container___1eyTh",bottom:"index__bottom___1F1B5",toast:"index__toast___233-Y","toast-in-top":"index__toast-in-top___3uuec",remove:"index__remove___nvwuo","toast-out":"index__toast-out___1NqCu",error:"index__error___38eWT",toastBottom:"index__toastBottom___1NZ1k","toast-in-bottom":"index__toast-in-bottom___1BpTv",message:"index__message___2bel9",button:"index__button___1t8u7",action:"index__action___2faCa",close:"index__close___2o6CK",hidden:"index__hidden___Ov2Dy"}},function(t,e,o){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var o=function(t,e){var o=t[1]||"",n=t[3];if(!n)return o;if(e&&"function"==typeof btoa){var r=(a=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=n.sources.map(function(t){return"/*# sourceURL="+n.sourceRoot+t+" */"});return[o].concat(i).concat([r]).join("\n")}var a;return[o].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+o+"}":o}).join("")},e.i=function(t,o){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},r=0;r<this.length;r++){var i=this[r][0];null!=i&&(n[i]=!0)}for(r=0;r<t.length;r++){var a=t[r];null!=a[0]&&n[a[0]]||(o&&!a[2]?a[2]=o:o&&(a[2]="("+a[2]+") and ("+o+")"),e.push(a))}},e}},function(t,e,o){var n,r,i={},a=(n=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=n.apply(this,arguments)),r}),s=function(t){var e={};return function(t,o){if("function"==typeof t)return t();if(void 0===e[t]){var n=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,o);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}}(),c=null,l=0,u=[],f=o(4);function d(t,e){for(var o=0;o<t.length;o++){var n=t[o],r=i[n.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](n.parts[a]);for(;a<n.parts.length;a++)r.parts.push(v(n.parts[a],e))}else{var s=[];for(a=0;a<n.parts.length;a++)s.push(v(n.parts[a],e));i[n.id]={id:n.id,refs:1,parts:s}}}}function _(t,e){for(var o=[],n={},r=0;r<t.length;r++){var i=t[r],a=e.base?i[0]+e.base:i[0],s={css:i[1],media:i[2],sourceMap:i[3]};n[a]?n[a].parts.push(s):o.push(n[a]={id:a,parts:[s]})}return o}function p(t,e){var o=s(t.insertInto);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=u[u.length-1];if("top"===t.insertAt)n?n.nextSibling?o.insertBefore(e,n.nextSibling):o.appendChild(e):o.insertBefore(e,o.firstChild),u.push(e);else if("bottom"===t.insertAt)o.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=s(t.insertAt.before,o);o.insertBefore(e,r)}}function m(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=u.indexOf(t);e>=0&&u.splice(e,1)}function b(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var n=function(){0;return o.nc}();n&&(t.attrs.nonce=n)}return h(e,t.attrs),p(t,e),e}function h(t,e){Object.keys(e).forEach(function(o){t.setAttribute(o,e[o])})}function v(t,e){var o,n,r,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var a=l++;o=c||(c=b(e)),n=g.bind(null,o,a,!1),r=g.bind(null,o,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(o=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",h(e,t.attrs),p(t,e),e}(e),n=function(t,e,o){var n=o.css,r=o.sourceMap,i=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||i)&&(n=f(n));r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([n],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,o,e),r=function(){m(o),o.href&&URL.revokeObjectURL(o.href)}):(o=b(e),n=function(t,e){var o=e.css,n=e.media;n&&t.setAttribute("media",n);if(t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}.bind(null,o),r=function(){m(o)});return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var o=_(t,e);return d(o,e),function(t){for(var n=[],r=0;r<o.length;r++){var a=o[r];(s=i[a.id]).refs--,n.push(s)}t&&d(_(t,e),e);for(r=0;r<n.length;r++){var s;if(0===(s=n[r]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete i[s.id]}}}};var y,x=(y=[],function(t,e){return y[t]=e,y.filter(Boolean).join("\n")});function g(t,e,o,n){var r=o?"":n.css;if(t.styleSheet)t.styleSheet.cssText=x(e,r);else{var i=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var o=e.protocol+"//"+e.host,n=o+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r,i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?o+i:n+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(t,e,o){"use strict";o.r(e);var n=o(0),r=o.n(n),i={default:{position:"top",toastClass:"",removedToastClass:"",closeable:!0,timeoutOnRemove:1e3,showDuration:5e3},error:{toastClass:r.a.error,timeoutOnRemove:1e3,showDuration:5e3}};function a(t,e){e.split(" ").forEach(function(e){return t.classList.add(e)})}function s(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function c(t){return(c="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})(t)}function l(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var u=function(){function t(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"notify",n=arguments.length>2?arguments[2]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),t.removeAll();var r={};"string"==typeof o&&i[o]?r=i[o]:"object"===c(o)&&(r=o),this.options=function(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))),n.forEach(function(e){s(t,e,o[e])})}return t}({},i.default,r),this.content=e,this.container=t.getContainer(this.options.position),this.domNode=this.createToastNode(n),this.container.appendChild(this.domNode),this.startTimer()}var e,o,n;return e=t,n=[{key:"getContainer",value:function(t){var e=document.querySelector(".".concat(r.a.container));return e||((e=document.createElement("div")).classList.add(r.a.container),document.body.appendChild(e)),"bottom"!==t&&e.classList.contains("bottom")?e.classList.remove(r.a.bottom):"bottom"!==t||e.classList.contains("bottom")||e.classList.add(r.a.bottom),e}},{key:"removeAll",value:function(){for(var e=t.getContainer().querySelectorAll(".".concat(r.a.close)),o=0,n=e.length;o<n;o+=1)e[o].click()}}],(o=[{key:"createToastNode",value:function(t){var e=this,o=document.createElement("div");a(o,r.a.toast);var n=document.createElement("div");if(a(n,r.a.message),n.textContent=this.content,o.appendChild(n),o.title=this.content,this.options&&this.options.toastClass&&a(o,this.options.toastClass),this.options&&"bottom"===this.options.position&&a(o,r.a.toastBottom),t){var i=document.createElement("button");a(i,r.a.action),a(i,r.a.button),t.class&&a(i,t.class),i.textContent=t.name,i.addEventListener("click",function(){t.action(),e.close()}),i.title=t.name,o.appendChild(i)}var s=document.createElement("button");return a(s,r.a.close),a(s,r.a.button),this.options&&!this.options.closeable&&a(s,r.a.hidden),s.title="Close",s.addEventListener("click",function(){return e.close()}),o.appendChild(s),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&&(a(this.domNode,r.a.remove),this.options.removedToastClass&&a(this.domNode,this.options.removedToastClass),setTimeout(function(){t.domNode.remove()},this.options.timeoutOnRemove||1e3))}},{key:"startTimer",value:function(){var t=this;this.timerShow=setTimeout(function(){return t.close()},this.options.showDuration||5e3)}},{key:"stopTimer",value:function(){clearTimeout(this.timerShow)}}])&&l(e.prototype,o),n&&l(e,n),t}();o.d(e,"ToastOptions",function(){return i}),o.d(e,"ToastMeClass",function(){return u});e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"notify",o=arguments.length>2?arguments[2]:void 0;return new u(t,e,o)}}])});
!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,function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=5)}([function(t,e,o){var n=o(1);"string"==typeof n&&(n=[[t.i,n,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};o(3)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,o){(e=t.exports=o(2)(!1)).push([t.i,'.index__container___1eyTh{position:fixed;top:0;width:100%;color:#fff}.index__container___1eyTh.index__bottom___1F1B5{top:auto;bottom:0}.index__toast___233-Y{height:48px;width:40%;min-width:270px;padding:0 15px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:stretch;justify-content:stretch;background-color:rgba(0,0,0,.9);border-radius:4px;position:absolute;top:12px;left:50%;-webkit-animation:index__toast-in-top___3uuec .3s ease-out forwards;animation:index__toast-in-top___3uuec .3s ease-out forwards}.index__toast___233-Y.index__remove___nvwuo{-webkit-transform:translate(-50%);-ms-transform:translate(-50%);transform:translate(-50%);-webkit-animation:index__toast-out___1NqCu .2s forwards;animation:index__toast-out___1NqCu .2s forwards}.index__toast___233-Y.index__error___38eWT{background-color:#d40d00}.index__toastBottom___1NZ1k{top:auto;bottom:30px;-webkit-animation:index__toast-in-bottom___1BpTv .3s ease-out forwards;animation:index__toast-in-bottom___1BpTv .3s ease-out forwards}@-webkit-keyframes index__toast-in-top___3uuec{0%{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0}to{-webkit-transform:translate(-50%);transform:translate(-50%);opacity:1}}@keyframes index__toast-in-top___3uuec{0%{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0}to{-webkit-transform:translate(-50%);transform:translate(-50%);opacity:1}}@-webkit-keyframes index__toast-in-bottom___1BpTv{0%{-webkit-transform:translate(-50%,50%);transform:translate(-50%,50%);opacity:0}to{-webkit-transform:translate(-50%);transform:translate(-50%);opacity:1}}@keyframes index__toast-in-bottom___1BpTv{0%{-webkit-transform:translate(-50%,50%);transform:translate(-50%,50%);opacity:0}to{-webkit-transform:translate(-50%);transform:translate(-50%);opacity:1}}@-webkit-keyframes index__toast-out___1NqCu{0%{opacity:1}to{opacity:0}}@keyframes index__toast-out___1NqCu{0%{opacity:1}to{opacity:0}}.index__message___2bel9{-ms-flex:1 1;flex:1 1;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.index__button___1t8u7{outline:none;border:none;border-radius:4px;background-color:transparent;position:relative;margin:10px 0 0;cursor:pointer;color:#fff;-webkit-transition:background-color .2s;-o-transition:background-color .2s;transition:background-color .2s;padding:0;-webkit-box-shadow:none;box-shadow:none}.index__button___1t8u7:hover{background-color:hsla(0,0%,100%,.1)}.index__button___1t8u7:active{background-color:hsla(0,0%,100%,.2)}.index__action___2faCa{-ms-flex-negative:0;flex-shrink:0;-ms-flex-positive:0;flex-grow:0;padding:0 8px;line-height:24px;color:#0b8aff}.index__close___2o6CK{-ms-flex:0 0 24px;flex:0 0 24px;width:24px;height:24px}.index__close___2o6CK:after,.index__close___2o6CK:before{content:"";display:block;position:absolute;width:20px;height:2px;top:calc(50% - 1px);left:50%;background-color:#fff}.index__close___2o6CK:before{-webkit-transform:translateX(-50%) rotate(45deg);-ms-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg)}.index__close___2o6CK:after{-webkit-transform:translateX(-50%) rotate(135deg);-ms-transform:translateX(-50%) rotate(135deg);transform:translateX(-50%) rotate(135deg)}.index__close___2o6CK.index__hidden___Ov2Dy{display:none}',""]),e.locals={container:"index__container___1eyTh",bottom:"index__bottom___1F1B5",toast:"index__toast___233-Y","toast-in-top":"index__toast-in-top___3uuec",remove:"index__remove___nvwuo","toast-out":"index__toast-out___1NqCu",error:"index__error___38eWT",toastBottom:"index__toastBottom___1NZ1k","toast-in-bottom":"index__toast-in-bottom___1BpTv",message:"index__message___2bel9",button:"index__button___1t8u7",action:"index__action___2faCa",close:"index__close___2o6CK",hidden:"index__hidden___Ov2Dy"}},function(t,e,o){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var o=function(t,e){var o=t[1]||"",n=t[3];if(!n)return o;if(e&&"function"==typeof btoa){var r=(a=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=n.sources.map(function(t){return"/*# sourceURL="+n.sourceRoot+t+" */"});return[o].concat(i).concat([r]).join("\n")}var a;return[o].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+o+"}":o}).join("")},e.i=function(t,o){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},r=0;r<this.length;r++){var i=this[r][0];null!=i&&(n[i]=!0)}for(r=0;r<t.length;r++){var a=t[r];null!=a[0]&&n[a[0]]||(o&&!a[2]?a[2]=o:o&&(a[2]="("+a[2]+") and ("+o+")"),e.push(a))}},e}},function(t,e,o){var n,r,i={},a=(n=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=n.apply(this,arguments)),r}),s=function(t){var e={};return function(t,o){if("function"==typeof t)return t();if(void 0===e[t]){var n=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,o);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}}(),c=null,l=0,u=[],f=o(4);function d(t,e){for(var o=0;o<t.length;o++){var n=t[o],r=i[n.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](n.parts[a]);for(;a<n.parts.length;a++)r.parts.push(v(n.parts[a],e))}else{var s=[];for(a=0;a<n.parts.length;a++)s.push(v(n.parts[a],e));i[n.id]={id:n.id,refs:1,parts:s}}}}function _(t,e){for(var o=[],n={},r=0;r<t.length;r++){var i=t[r],a=e.base?i[0]+e.base:i[0],s={css:i[1],media:i[2],sourceMap:i[3]};n[a]?n[a].parts.push(s):o.push(n[a]={id:a,parts:[s]})}return o}function p(t,e){var o=s(t.insertInto);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=u[u.length-1];if("top"===t.insertAt)n?n.nextSibling?o.insertBefore(e,n.nextSibling):o.appendChild(e):o.insertBefore(e,o.firstChild),u.push(e);else if("bottom"===t.insertAt)o.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=s(t.insertAt.before,o);o.insertBefore(e,r)}}function m(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=u.indexOf(t);e>=0&&u.splice(e,1)}function b(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var n=function(){0;return o.nc}();n&&(t.attrs.nonce=n)}return h(e,t.attrs),p(t,e),e}function h(t,e){Object.keys(e).forEach(function(o){t.setAttribute(o,e[o])})}function v(t,e){var o,n,r,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var a=l++;o=c||(c=b(e)),n=g.bind(null,o,a,!1),r=g.bind(null,o,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(o=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",h(e,t.attrs),p(t,e),e}(e),n=function(t,e,o){var n=o.css,r=o.sourceMap,i=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||i)&&(n=f(n));r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([n],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,o,e),r=function(){m(o),o.href&&URL.revokeObjectURL(o.href)}):(o=b(e),n=function(t,e){var o=e.css,n=e.media;n&&t.setAttribute("media",n);if(t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}.bind(null,o),r=function(){m(o)});return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var o=_(t,e);return d(o,e),function(t){for(var n=[],r=0;r<o.length;r++){var a=o[r];(s=i[a.id]).refs--,n.push(s)}t&&d(_(t,e),e);for(r=0;r<n.length;r++){var s;if(0===(s=n[r]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete i[s.id]}}}};var y,x=(y=[],function(t,e){return y[t]=e,y.filter(Boolean).join("\n")});function g(t,e,o,n){var r=o?"":n.css;if(t.styleSheet)t.styleSheet.cssText=x(e,r);else{var i=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var o=e.protocol+"//"+e.host,n=o+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r,i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?o+i:n+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(t,e,o){"use strict";o.r(e);var n=o(0),r=o.n(n),i={default:{position:"top",toastClass:"",removedToastClass:"",closeable:!0,timeoutOnRemove:1e3,duration:5e3},error:{toastClass:r.a.error,timeoutOnRemove:1e3,duration:5e3}};function a(t,e){e.split(" ").forEach(function(e){return t.classList.add(e)})}function s(t){return(s="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})(t)}function c(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))),n.forEach(function(e){l(t,e,o[e])})}return t}function l(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function u(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var f=function(){function t(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"notify",n=arguments.length>2?arguments[2]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=c({},i.default);"string"==typeof o&&i[o]?r=c({},r,i[o]):"object"===s(o)&&(r=c({},r,o)),t.removeAll(r.position),this.options=r,this.content=e,t.getContainer(r.position).appendChild(this.domNode),this.domNode=this.createToastNode(n),this.startTimer()}var e,o,n;return e=t,n=[{key:"getContainer",value:function(t){var e="bottom"===t,o=".".concat(r.a.container," ").concat(e?".".concat(r.a.bottom):""),n=document.querySelector(o);return n||((n=document.createElement("div")).classList.add(r.a.container),e&&n.classList.add(r.a.bottom),document.body.appendChild(n)),n}},{key:"removeAll",value:function(e){for(var o=t.getContainer(e).querySelectorAll(".".concat(r.a.close)),n=0,i=o.length;n<i;n+=1)o[n].click()}}],(o=[{key:"createToastNode",value:function(t){var e=this,o=document.createElement("div");a(o,r.a.toast);var n=document.createElement("div");if(a(n,r.a.message),n.textContent=this.content,o.appendChild(n),o.title=this.content,this.options&&this.options.toastClass&&a(o,this.options.toastClass),this.options&&"bottom"===this.options.position&&a(o,r.a.toastBottom),t){var i=document.createElement("button");a(i,r.a.action),a(i,r.a.button),t.class&&a(i,t.class),i.textContent=t.label,i.addEventListener("click",function(){t.action(),e.close()}),i.title=t.label,o.appendChild(i)}var s=document.createElement("button");return a(s,r.a.close),a(s,r.a.button),this.options&&!this.options.closeable&&a(s,r.a.hidden),s.title="Close",s.addEventListener("click",function(){return e.close()}),o.appendChild(s),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&&(a(this.domNode,r.a.remove),this.options.removedToastClass&&a(this.domNode,this.options.removedToastClass),setTimeout(function(){t.domNode.remove()},this.options.timeoutOnRemove||1e3))}},{key:"startTimer",value:function(){var t=this;this.stopTimer(),this.timerShow=setTimeout(function(){return t.close()},this.options.duration||5e3)}},{key:"stopTimer",value:function(){clearTimeout(this.timerShow)}}])&&u(e.prototype,o),n&&u(e,n),t}();o.d(e,"ToastOptions",function(){return i}),o.d(e,"ToastMeClass",function(){return f});e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"notify",o=arguments.length>2?arguments[2]:void 0;return new f(t,e,o)}}])});
{
"name": "toast-me",
"version": "1.1.0",
"version": "1.1.1",
"description": "Creates toast messages",

@@ -5,0 +5,0 @@ "main": "lib/toast-me.min.js",

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