From 9ae18dd0d5741d4c582878e48cc010cb5b07430b Mon Sep 17 00:00:00 2001 From: Gornostaev Sergey Date: Mon, 17 Feb 2020 12:20:38 +0200 Subject: [PATCH] Minor changes --- build/bundle.css | 3 ++- build/bundle.css.map | 12 +++++++----- build/bundle.js | 1 + build/bundle.mjs | 1 + build/index.js | 1 - build/index.mjs | 1 - src/components/Notifications.svelte | 2 -- 7 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 build/bundle.js create mode 100644 build/bundle.mjs delete mode 100644 build/index.js delete mode 100644 build/index.mjs diff --git a/build/bundle.css b/build/bundle.css index 314e4f9..cb6b4b0 100644 --- a/build/bundle.css +++ b/build/bundle.css @@ -1,4 +1,5 @@ +.notification.svelte-1ak1e6y.svelte-1ak1e6y{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin:12px;background:#fff;color:#000;border-radius:6px;-webkit-box-shadow:0 4px 10px rgba(0, 0, 0, 0.08);box-shadow:0 4px 10px rgba(0, 0, 0, 0.08)}.notification-content.svelte-1ak1e6y.svelte-1ak1e6y{width:210px;padding:12px 6px 12px 12px;-webkit-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.notification-content.svelte-1ak1e6y p.svelte-1ak1e6y{font-size:14px;color:#a1a1a1;margin:2px 0 0}.notification-buttons.svelte-1ak1e6y.svelte-1ak1e6y{border-left:1px solid #eee}.notification-buttons.svelte-1ak1e6y button.svelte-1ak1e6y:first-child{border-bottom:1px solid #eee}button.svelte-1ak1e6y.svelte-1ak1e6y{display:block;width:60px;height:50%;padding:0 0 2px;margin:0;border:none;outline:none;background:none;cursor:pointer;font-size:12px;color:#666;-webkit-box-sizing:border-box;box-sizing:border-box}button.svelte-1ak1e6y.svelte-1ak1e6y:hover{background:rgba(0, 0, 0, 0.01)} .default-position-style-top-left.svelte-cogvif,.default-position-style-top-center.svelte-cogvif,.default-position-style-top-right.svelte-cogvif,.default-position-style-bottom-left.svelte-cogvif,.default-position-style-bottom-center.svelte-cogvif,.default-position-style-bottom-right.svelte-cogvif{position:fixed;width:270px}.default-position-style-top-left.svelte-cogvif{top:0;left:0}.default-position-style-top-center.svelte-cogvif{top:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.default-position-style-top-right.svelte-cogvif{top:0;right:0}.default-position-style-bottom-left.svelte-cogvif{bottom:0;left:0}.default-position-style-bottom-center.svelte-cogvif{bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.default-position-style-bottom-right.svelte-cogvif{bottom:0;right:0} -.default-notification-style.svelte-1nm9ptj{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin:12px;background:#fff;color:#000;border-radius:6px;-webkit-box-shadow:0 4px 10px rgba(0, 0, 0, 0.08);box-shadow:0 4px 10px rgba(0, 0, 0, 0.08);min-height:0;overflow:hidden}.default-notification-style-content.svelte-1nm9ptj{width:210px;padding:12px 6px 12px 12px;-webkit-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.default-notification-style-button.svelte-1nm9ptj{display:block;width:40px;padding:0 0 2px;margin:0;border:none;border-left:1px solid #eee;outline:none;background:none;cursor:pointer;font-size:20px;color:#000;-webkit-box-sizing:border-box;box-sizing:border-box}.default-notification-style-button.svelte-1nm9ptj:hover{background:rgba(0, 0, 0, 0.01)} +.default-notification-style.svelte-zh5z3r.svelte-zh5z3r{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin:12px;background:#fff;color:#000;border-radius:6px;-webkit-box-shadow:0 4px 10px rgba(0, 0, 0, 0.08);box-shadow:0 4px 10px rgba(0, 0, 0, 0.08);min-height:0;overflow:hidden}.default-notification-style-content.svelte-zh5z3r.svelte-zh5z3r{width:210px;padding:12px 6px 12px 12px;-webkit-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.default-notification-style-button.svelte-zh5z3r.svelte-zh5z3r{display:block;width:40px;padding:0 0 2px;margin:0;border:none;border-left:1px solid #eee;outline:none;background:none;cursor:pointer;font-size:20px;color:#000;-webkit-box-sizing:border-box;box-sizing:border-box}.default-notification-style-button.svelte-zh5z3r.svelte-zh5z3r:hover{background:rgba(0, 0, 0, 0.01)}.default-notification-danger.svelte-zh5z3r.svelte-zh5z3r{background:#f3555a;color:#fff}.default-notification-danger.svelte-zh5z3r .default-notification-style-button.svelte-zh5z3r{border-left:1px solid rgba(255, 255, 255, 0.4);color:#fff}.default-notification-warning.svelte-zh5z3r.svelte-zh5z3r{background:#ffb900;color:#000}.default-notification-warning.svelte-zh5z3r .default-notification-style-button.svelte-zh5z3r{border-left:1px solid rgba(0, 0, 0, 0.2);color:#000}.default-notification-success.svelte-zh5z3r.svelte-zh5z3r{background:#22ce6c;color:#fff}.default-notification-success.svelte-zh5z3r .default-notification-style-button.svelte-zh5z3r{border-left:1px solid rgba(255, 255, 255, 0.4);color:#fff} /*# sourceMappingURL=bundle.css.map */ \ No newline at end of file diff --git a/build/bundle.css.map b/build/bundle.css.map index 2167831..47c6356 100644 --- a/build/bundle.css.map +++ b/build/bundle.css.map @@ -2,13 +2,15 @@ "version": 3, "file": "bundle.css", "sources": [ - "../src/components/Notifications.svelte", - "../src/components/Notification.svelte" + "../CustomItem.svelte", + "../Notifications.svelte", + "../DefaultNotification.svelte" ], "sourcesContent": [ - "\n\n\n\n
\n {#each positions as position}\n
\n
\n {#each $store as notification (notification.id)}\n {#if notification.position === position}\n {#if item}\n \n {:else}\n \n {/if}\n {/if}\n {/each}\n
\n
\n {/each}\n
\n", - "\n\n\n\n
\n {text}\n
\n \n ×\n \n\n" + "\n\n\n\n\n
\n {notification.text}\n

{notification.description || 'Custom description'}

\n
\n
\n \n \n
\n\n", + "\n\n\n\n
\n {#each positions as position}\n
\n {#each $store as notification (notification.id)}\n {#if notification.position === position}\n \n {/if}\n {/each}\n
\n {/each}\n
\n", + "\n\n\n\n\n
\n {text}\n
\n \n ×\n \n\n" ], "names": [], - "mappings": "AACE,8CAAgC,CAChC,gDAAkC,CAClC,+CAAiC,CACjC,iDAAmC,CACnC,mDAAqC,CACrC,oCAAoC,cAAC,CAAC,AACpC,QAAQ,CAAE,KAAK,CACf,KAAK,CAAE,KAAK,AACd,CAAC,AAED,gCAAgC,cAAC,CAAC,AAChC,GAAG,CAAE,CAAC,CACN,IAAI,CAAE,CAAC,AACT,CAAC,AAED,kCAAkC,cAAC,CAAC,AAClC,GAAG,CAAE,CAAC,CACN,IAAI,CAAE,GAAG,CACT,iBAAiB,CAAE,WAAW,IAAI,CAAC,CAC3B,SAAS,CAAE,WAAW,IAAI,CAAC,AACrC,CAAC,AAED,iCAAiC,cAAC,CAAC,AACjC,GAAG,CAAE,CAAC,CACN,KAAK,CAAE,CAAC,AACV,CAAC,AAED,mCAAmC,cAAC,CAAC,AACnC,MAAM,CAAE,CAAC,CACT,IAAI,CAAE,CAAC,AACT,CAAC,AAED,qCAAqC,cAAC,CAAC,AACrC,MAAM,CAAE,CAAC,CACT,IAAI,CAAE,GAAG,CACT,iBAAiB,CAAE,WAAW,IAAI,CAAC,CAC3B,SAAS,CAAE,WAAW,IAAI,CAAC,AACrC,CAAC,AAED,oCAAoC,cAAC,CAAC,AACpC,MAAM,CAAE,CAAC,CACT,KAAK,CAAE,CAAC,AACV,CAAC;AC1CD,2BAA2B,eAAC,CAAC,AAC3B,QAAQ,CAAE,QAAQ,CAClB,OAAO,CAAE,WAAW,CACpB,OAAO,CAAE,WAAW,CACpB,OAAO,CAAE,IAAI,CACb,iBAAiB,CAAE,OAAO,CACtB,cAAc,CAAE,OAAO,CACnB,WAAW,CAAE,OAAO,CAC5B,gBAAgB,CAAE,OAAO,CACrB,aAAa,CAAE,OAAO,CAClB,eAAe,CAAE,aAAa,CACtC,MAAM,CAAE,IAAI,CACZ,UAAU,CAAE,IAAI,CAChB,KAAK,CAAE,IAAI,CACX,aAAa,CAAE,GAAG,CAClB,kBAAkB,CAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAC1C,UAAU,CAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CACpD,UAAU,CAAE,CAAC,CACb,QAAQ,CAAE,MAAM,AAChB,CAAC,AAED,mCAAmC,eAAC,CAAC,AACnC,KAAK,CAAE,KAAK,CACZ,OAAO,CAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAC3B,kBAAkB,CAAE,UAAU,CACtB,UAAU,CAAE,UAAU,CAC9B,SAAS,CAAE,UAAU,AACvB,CAAC,AAED,kCAAkC,eAAC,CAAC,AAClC,OAAO,CAAE,KAAK,CACd,KAAK,CAAE,IAAI,CACX,OAAO,CAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAChB,MAAM,CAAE,CAAC,CACT,MAAM,CAAE,IAAI,CACZ,WAAW,CAAE,GAAG,CAAC,KAAK,CAAC,IAAI,CAC3B,OAAO,CAAE,IAAI,CACb,UAAU,CAAE,IAAI,CAChB,MAAM,CAAE,OAAO,CACf,SAAS,CAAE,IAAI,CACf,KAAK,CAAE,IAAI,CACX,kBAAkB,CAAE,UAAU,CACtB,UAAU,CAAE,UAAU,AAChC,CAAC,AAED,iDAAkC,MAAM,AAAC,CAAC,AACxC,UAAU,CAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,AACjC,CAAC" + "mappings": "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" } \ No newline at end of file diff --git a/build/bundle.js b/build/bundle.js new file mode 100644 index 0000000..455fddd --- /dev/null +++ b/build/bundle.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).Notifications={})}(this,(function(t){"use strict";function e(){}const n=t=>t;function o(t){return t()}function i(){return Object.create(null)}function c(t){t.forEach(o)}function s(t){return"function"==typeof t}function l(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function r(t,n,o){t.$$.on_destroy.push(function(t,...n){if(null==t)return e;const o=t.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}function u(t,e,n,o){if(t){const i=a(t,e,n,o);return t[0](i)}}function a(t,e,n,o){return t[1]&&o?function(t,e){for(const n in e)t[n]=e[n];return t}(n.ctx.slice(),t[1](o(e))):n.ctx}function f(t,e,n,o){if(t[2]&&o){const i=t[2](o(n));if("object"==typeof e.dirty){const t=[],n=Math.max(e.dirty.length,i.length);for(let o=0;owindow.performance.now():()=>Date.now(),h=p?t=>requestAnimationFrame(t):e;const $=new Set;function g(t){$.forEach(e=>{e.c(t)||($.delete(e),e.f())}),0!==$.size&&h(g)}function v(t){let e;return 0===$.size&&h(g),{promise:new Promise(n=>{$.add(e={c:t,f:n})}),abort(){$.delete(e)}}}function y(t,e){t.appendChild(e)}function b(t,e,n){t.insertBefore(e,n||null)}function w(t){t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function k(t){return document.createTextNode(t)}function C(){return k(" ")}function S(){return k("")}function _(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function N(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function E(t,e){e=""+e,t.data!==e&&(t.data=e)}function R(t,e){(null!=e||t.value)&&(t.value=e)}function A(t,e,n){t.classList[n?"add":"remove"](e)}let T,z,M=0,j={};function O(t,e,n,o,i,c,s,l=0){const r=16.666/o;let u="{\n";for(let t=0;t<=1;t+=r){const o=e+(n-e)*c(t);u+=100*t+`%{${s(o,1-o)}}\n`}const a=u+`100% {${s(n,1-n)}}\n}`,f=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(a)}_${l}`;if(!j[f]){if(!T){const t=x("style");document.head.appendChild(t),T=t.sheet}j[f]=!0,T.insertRule(`@keyframes ${f} ${a}`,T.cssRules.length)}const d=t.style.animation||"";return t.style.animation=`${d?`${d}, `:""}${f} ${o}ms linear ${i}ms 1 both`,M+=1,f}function I(t,e){t.style.animation=(t.style.animation||"").split(", ").filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")).join(", "),e&&!--M&&h(()=>{if(M)return;let t=T.cssRules.length;for(;t--;)T.deleteRule(t);j={}})}function P(t){z=t}function L(){if(!z)throw new Error("Function called outside component initialization");return z}const D=[],q=[],B=[],F=[],H=Promise.resolve();let G=!1;function J(t){B.push(t)}const K=new Set;function Q(){do{for(;D.length;){const t=D.shift();P(t),U(t.$$)}for(;q.length;)q.pop()();for(let t=0;t{V=null})),V}function X(t,e,n){t.dispatchEvent(function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(`${e?"intro":"outro"}${n}`))}const Y=new Set;let Z;function tt(){Z={r:0,c:[],p:Z}}function et(){Z.r||c(Z.c),Z=Z.p}function nt(t,e){t&&t.i&&(Y.delete(t),t.i(e))}function ot(t,e,n,o){if(t&&t.o){if(Y.has(t))return;Y.add(t),Z.c.push(()=>{Y.delete(t),o&&(n&&t.d(1),o())}),t.o(e)}}const it={duration:0};function ct(t,o,i){let c,l,r=o(t,i),u=!1,a=0;function f(){c&&I(t,c)}function d(){const{delay:o=0,duration:i=300,easing:s=n,tick:d=e,css:p}=r||it;p&&(c=O(t,0,1,i,o,s,p,a++)),d(0,1);const h=m()+o,$=h+i;l&&l.abort(),u=!0,J(()=>X(t,!0,"start")),l=v(e=>{if(u){if(e>=$)return d(1,0),X(t,!0,"end"),f(),u=!1;if(e>=h){const t=s((e-h)/i);d(t,1-t)}}return u})}let p=!1;return{start(){p||(I(t),s(r)?(r=r(),W().then(d)):d())},invalidate(){p=!1},end(){u&&(f(),u=!1)}}}function st(t,o,i){let l,r=o(t,i),u=!0;const a=Z;function f(){const{delay:o=0,duration:i=300,easing:s=n,tick:f=e,css:d}=r||it;d&&(l=O(t,1,0,i,o,s,d));const p=m()+o,h=p+i;J(()=>X(t,!1,"start")),v(e=>{if(u){if(e>=h)return f(0,1),X(t,!1,"end"),--a.r||c(a.c),!1;if(e>=p){const t=s((e-p)/i);f(1-t,t)}}return u})}return a.r+=1,s(r)?W().then(()=>{r=r(),f()}):f(),{end(e){e&&r.tick&&r.tick(1,0),u&&(l&&I(t,l),u=!1)}}}function lt(t,e){ot(t,1,1,()=>{e.delete(t.key)})}function rt(t){t&&t.c()}function ut(t,e,n){const{fragment:i,on_mount:l,on_destroy:r,after_update:u}=t.$$;i&&i.m(e,n),J(()=>{const e=l.map(o).filter(s);r?r.push(...e):c(e),t.$$.on_mount=[]}),u.forEach(J)}function at(t,e){const n=t.$$;null!==n.fragment&&(c(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ft(t,e){-1===t.$$.dirty[0]&&(D.push(t),G||(G=!0,H.then(Q)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const i=o.length?o[0]:n;return d.ctx&&l(d.ctx[e],d.ctx[e]=i)&&(d.bound[e]&&d.bound[e](i),p&&ft(t,e)),n}):[],d.update(),p=!0,c(d.before_update),d.fragment=!!s&&s(d.ctx),n.target&&(n.hydrate?d.fragment&&d.fragment.l(function(t){return Array.from(t.childNodes)}(n.target)):d.fragment&&d.fragment.c(),n.intro&&nt(t.$$.fragment),ut(t,n.target,n.anchor),Q()),P(a)}class pt{$destroy(){at(this,1),this.$destroy=e}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(){}}const mt={subscribe:null,addNotification:null,removeNotification:null,clearNotifications:null},ht=()=>{return t=mt,L().$$.context.get(t);var t};function $t(t){let e,n;var o=t[0];function i(t){return{props:{notification:t[1],withoutStyles:t[2],onRemove:t[3]}}}if(o)var c=new o(i(t));return{c(){c&&rt(c.$$.fragment),e=S()},m(t,o){c&&ut(c,t,o),b(t,e,o),n=!0},p(t,[n]){const s={};if(2&n&&(s.notification=t[1]),4&n&&(s.withoutStyles=t[2]),o!==(o=t[0])){if(c){tt();const t=c;ot(t.$$.fragment,1,0,()=>{at(t,1)}),et()}o?(rt((c=new o(i(t))).$$.fragment),nt(c.$$.fragment,1),ut(c,e.parentNode,e)):c=null}else o&&c.$set(s)},i(t){n||(c&&nt(c.$$.fragment,t),n=!0)},o(t){c&&ot(c.$$.fragment,t),n=!1},d(t){t&&w(e),c&&at(c,t)}}}function gt(t,e,n){let{item:o}=e,{notification:i={}}=e,{withoutStyles:c=!1}=e;const{removeNotification:s}=ht(),{id:l,removeAfter:r}=i,u=()=>s(l);let a=null;var f;return r&&(a=setTimeout(u,r)),f=()=>{r&&a&&clearTimeout(a)},L().$$.on_destroy.push(f),t.$set=t=>{"item"in t&&n(0,o=t.item),"notification"in t&&n(1,i=t.notification),"withoutStyles"in t&&n(2,c=t.withoutStyles)},[o,i,c,u]}class vt extends pt{constructor(t){super(),dt(this,t,gt,$t,l,{item:0,notification:1,withoutStyles:2})}}function yt(t,{delay:e=0,duration:o=400,easing:i=n}){const c=+getComputedStyle(t).opacity;return{delay:e,duration:o,easing:i,css:t=>`opacity: ${t*c}`}}function bt(t){let e,n,o,i,c,s,l,r,p,m,h,$,g;const v=t[7].default,S=u(v,t,t[6],null);return{c(){e=x("div"),n=x("div"),S||(o=k(t[1])),S&&S.c(),c=C(),s=x("button"),l=k("×"),N(n,"class",i=d(t[2]("content"))+" svelte-zh5z3r"),N(s,"class",r=d(t[2]("button"))+" svelte-zh5z3r"),N(s,"aria-label","delete notification"),N(e,"class",p=d(t[2]())+" svelte-zh5z3r"),N(e,"role","status"),N(e,"aria-live","polite")},m(i,r){b(i,e,r),y(e,n),S||y(n,o),S&&S.m(n,null),y(e,c),y(e,s),y(s,l),$=!0,g=_(s,"click",t[0])},p(t,[e]){S&&S.p&&64&e&&S.p(a(v,t,t[6],null),f(v,t[6],e,null))},i(t){$||(nt(S,t),J(()=>{h&&h.end(1),m||(m=ct(e,yt,{})),m.start()}),$=!0)},o(t){ot(S,t),m&&m.invalidate(),h=st(e,yt,{}),$=!1},d(t){t&&w(e),S&&S.d(t),t&&h&&h.end(),g()}}}function wt(t,e,n){let{notification:o={}}=e,{withoutStyles:i=!1}=e,{onRemove:c=null}=e;const{text:s,type:l}=o;let{$$slots:r={},$$scope:u}=e;return t.$set=t=>{"notification"in t&&n(3,o=t.notification),"withoutStyles"in t&&n(4,i=t.withoutStyles),"onRemove"in t&&n(0,c=t.onRemove),"$$scope"in t&&n(6,u=t.$$scope)},[c,s,t=>{const e=t?`-${t}`:"";return`notification${e}${i?"":` default-notification-style${e}`}${l&&!t?` default-notification-${l}`:""}`},o,i,l,u,r]}class xt extends pt{constructor(t){super(),dt(this,t,wt,bt,l,{notification:3,withoutStyles:4,onRemove:0})}}const kt=[];const Ct=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"],St=(t,e)=>{if(!(t=>!(!t||!t.text)&&("string"==typeof t.text&&!!Ct.includes(t.position)))(t))throw new Error("Notification object is not valid");const{id:n=(new Date).getTime(),removeAfter:o=+t.removeAfter,...i}=t;e(t=>[...t,{id:n,removeAfter:o,...i}])};var _t=(()=>{const{subscribe:t,set:n,update:o}=function(t,n=e){let o;const i=[];function c(e){if(l(t,e)&&(t=e,o)){const e=!kt.length;for(let e=0;e{const t=i.indexOf(r);-1!==t&&i.splice(t,1),0===i.length&&(o(),o=null)}}}}([]);return{subscribe:t,addNotification:t=>St(t,o),removeNotification:t=>((t,e)=>e(e=>e.filter(e=>e.id!==t)))(t,o),clearNotifications:()=>(t=>t([]))(n)}})();function Nt(t,e,n){const o=t.slice();return o[9]=e[n],o}function Et(t,e,n){const o=t.slice();return o[6]=e[n],o}function Rt(t){let e;const n=new vt({props:{notification:t[9],withoutStyles:t[1],item:t[0]||xt}});return{c(){rt(n.$$.fragment)},m(t,o){ut(n,t,o),e=!0},p(t,e){const o={};4&e&&(o.notification=t[9]),2&e&&(o.withoutStyles=t[1]),1&e&&(o.item=t[0]||xt),n.$set(o)},i(t){e||(nt(n.$$.fragment,t),e=!0)},o(t){ot(n.$$.fragment,t),e=!1},d(t){at(n,t)}}}function At(t,e){let n,o,i,c=e[9].position===e[6]&&Rt(e);return{key:t,first:null,c(){n=S(),c&&c.c(),o=S(),this.first=n},m(t,e){b(t,n,e),c&&c.m(t,e),b(t,o,e),i=!0},p(t,e){t[9].position===t[6]?c?(c.p(t,e),nt(c,1)):(c=Rt(t),c.c(),nt(c,1),c.m(o.parentNode,o)):c&&(tt(),ot(c,1,1,()=>{c=null}),et())},i(t){i||(nt(c),i=!0)},o(t){ot(c),i=!1},d(t){t&&w(n),c&&c.d(t),t&&w(o)}}}function Tt(t){let e,n,o,i,c=[],s=new Map,l=t[2];const r=t=>t[9].id;for(let e=0;ev.get(i)?(b.add(o),w(e)):(y.add(i),d--):(r(n,s),d--)}for(;d--;){const e=t[d];g.has(e.key)||r(e,s)}for(;p;)w($[p-1]);return $}(c,o,r,1,t,i,s,e,lt,At,n,Nt),et()},i(t){if(!i){for(let t=0;tot(l[t],1,1,()=>{l[t]=null});return{c(){c&&c.c(),e=C(),n=x("div");for(let t=0;tn(2,o=t));let{item:i=null}=e,{withoutStyles:c=!1}=e;!function(t,e){L().$$.context.set(t,e)}(mt,_t);let{$$slots:s={},$$scope:l}=e;return t.$set=t=>{"item"in t&&n(0,i=t.item),"withoutStyles"in t&&n(1,c=t.withoutStyles),"$$scope"in t&&n(4,l=t.$$scope)},[i,c,o,(t="")=>`position-${t}${c?"":` default-position-style-${t}`}`,l,s]}class jt extends pt{constructor(t){super(),dt(this,t,Mt,zt,l,{item:0,withoutStyles:1})}}function Ot(t){let e,n,o,i,s,l,r,d,p,m,h,$,g,v,S,R=t[0].text+"",A=(t[0].description||"Custom description")+"";const T=t[3].default,z=u(T,t,t[2],null);return{c(){e=x("div"),n=x("div"),z||(o=k(R)),z&&z.c(),i=C(),s=x("p"),l=k(A),r=C(),d=x("div"),p=x("button"),p.textContent="Action",m=C(),h=x("button"),h.textContent="Close",N(s,"class","svelte-1ak1e6y"),N(n,"class","notification-content svelte-1ak1e6y"),N(p,"class","svelte-1ak1e6y"),N(h,"class","svelte-1ak1e6y"),N(d,"class","notification-buttons svelte-1ak1e6y"),N(e,"class","notification svelte-1ak1e6y")},m(c,u){b(c,e,u),y(e,n),z||y(n,o),z&&z.m(n,null),y(n,i),y(n,s),y(s,l),y(e,r),y(e,d),y(d,p),y(d,m),y(d,h),v=!0,S=[_(p,"click",t[1]),_(h,"click",t[1])]},p(t,[e]){z||(!v||1&e)&&R!==(R=t[0].text+"")&&E(o,R),z&&z.p&&4&e&&z.p(a(T,t,t[2],null),f(T,t[2],e,null)),(!v||1&e)&&A!==(A=(t[0].description||"Custom description")+"")&&E(l,A)},i(t){v||(nt(z,t),J(()=>{g&&g.end(1),$||($=ct(e,yt,{})),$.start()}),v=!0)},o(t){ot(z,t),$&&$.invalidate(),g=st(e,yt,{}),v=!1},d(t){t&&w(e),z&&z.d(t),t&&g&&g.end(),c(S)}}}function It(t,e,n){let{notification:o}=e,{onRemove:i=null}=e,{$$slots:c={},$$scope:s}=e;return t.$set=t=>{"notification"in t&&n(0,o=t.notification),"onRemove"in t&&n(1,i=t.onRemove),"$$scope"in t&&n(2,s=t.$$scope)},[o,i,s,c]}class Pt extends pt{constructor(t){super(),dt(this,t,It,Ot,l,{notification:0,onRemove:1})}}function Lt(t){let e,n,o,i,s,l,r,u,a;return{c(){e=x("div"),n=x("input"),o=C(),i=x("span"),s=C(),l=x("label"),r=k("Show danger notification"),N(n,"type","checkbox"),N(n,"id","show-danger"),N(i,"class","toggle toggle-danger"),N(l,"for","show-danger"),N(l,"class",u=`label-show-custom ${t[4]?"active":""}`),N(e,"class","col col-1-3 show-custom")},m(c,u){b(c,e,u),y(e,n),n.checked=t[4],y(e,o),y(e,i),y(e,s),y(e,l),y(l,r),a=[_(n,"change",t[14]),_(i,"click",t[9])]},p(t,e){16&e&&(n.checked=t[4]),16&e&&u!==(u=`label-show-custom ${t[4]?"active":""}`)&&N(l,"class",u)},d(t){t&&w(e),c(a)}}}function Dt(t){let n,o,i,s,l,r,u,a,f,d,p,m,h,$,g,v,S,E,T,z,M,j,O,I,P,L,D,q,B,F,H,G,J,K,Q,U,V,W,X,Y,Z,tt,et,nt,ot,it,ct,st=!t[3]&&Lt(t);return{c(){n=x("div"),o=x("div"),o.innerHTML='

\n Svelte notifications\n \n v0.9.9\n

\n

Extremely simple and flexible notifications for Svelte

',i=C(),s=x("div"),l=x("div"),r=x("label"),r.textContent="Message",u=C(),a=x("input"),f=C(),d=x("div"),p=x("label"),p.textContent="Remove after (ms)",m=C(),h=x("input"),$=C(),g=x("div"),v=x("label"),v.textContent="Position",S=C(),E=x("div"),T=x("div"),z=x("button"),z.textContent="↖",M=C(),j=x("button"),j.textContent="↑",O=C(),I=x("button"),I.textContent="↗",P=C(),L=x("div"),D=x("button"),D.textContent="↙",q=C(),B=x("button"),B.textContent="↓",F=C(),H=x("button"),H.textContent="↘",G=C(),J=x("div"),K=x("div"),Q=x("input"),U=C(),V=x("span"),W=C(),X=x("label"),Y=k("Show custom notification"),tt=C(),st&&st.c(),et=C(),nt=x("button"),nt.textContent="Create",ot=C(),it=x("button"),it.textContent="Clear all",N(o,"class","example-title"),N(r,"for","notification-text"),N(a,"id","notification-text"),N(a,"type","text"),N(l,"class","col col-1-3"),N(p,"for","notification-remove-after"),N(h,"id","notification-remove-after"),N(h,"type","text"),N(d,"class","col col-1-3"),N(v,"for","notification-position"),N(z,"class","top-left"),N(z,"id","top-left"),A(z,"active","top-left"===t[2]),N(j,"class","top-center"),N(j,"id","top-center"),A(j,"active","top-center"===t[2]),N(I,"class","top-right"),N(I,"id","top-right"),A(I,"active","top-right"===t[2]),N(T,"class","position-select-row"),N(D,"class","bottom-left"),N(D,"id","bottom-left"),A(D,"active","bottom-left"===t[2]),N(B,"class","bottom-center"),N(B,"id","bottom-center"),A(B,"active","bottom-center"===t[2]),N(H,"class","bottom-right"),N(H,"id","bottom-right"),A(H,"active","bottom-rigth"===t[2]),N(L,"class","position-select-row"),N(E,"class","position-select"),N(g,"class","col col-1-3"),N(s,"class","row"),N(Q,"type","checkbox"),N(Q,"id","show-custom"),N(V,"class","toggle toggle-custom"),N(X,"for","show-custom"),N(X,"class",Z=`label-show-custom ${t[3]?"active":""}`),N(K,"class","col col-1-3 show-custom"),N(J,"class","additional-tools"),N(nt,"class","button"),N(nt,"id","create-button"),N(it,"class","button secondary"),N(n,"class","example")},m(e,c){b(e,n,c),y(n,o),y(n,i),y(n,s),y(s,l),y(l,r),y(l,u),y(l,a),R(a,t[0]),y(s,f),y(s,d),y(d,p),y(d,m),y(d,h),R(h,t[1]),y(s,$),y(s,g),y(g,v),y(g,S),y(g,E),y(E,T),y(T,z),y(T,M),y(T,j),y(T,O),y(T,I),y(E,P),y(E,L),y(L,D),y(L,q),y(L,B),y(L,F),y(L,H),y(n,G),y(n,J),y(J,K),y(K,Q),Q.checked=t[3],y(K,U),y(K,V),y(K,W),y(K,X),y(X,Y),y(J,tt),st&&st.m(J,null),y(n,et),y(n,nt),y(n,ot),y(n,it),ct=[_(a,"input",t[11]),_(h,"input",t[12]),_(z,"click",t[7]),_(j,"click",t[7]),_(I,"click",t[7]),_(D,"click",t[7]),_(B,"click",t[7]),_(H,"click",t[7]),_(Q,"change",t[13]),_(V,"click",t[8]),_(nt,"click",t[15]),_(it,"click",t[16])]},p(t,[e]){1&e&&a.value!==t[0]&&R(a,t[0]),2&e&&h.value!==t[1]&&R(h,t[1]),4&e&&A(z,"active","top-left"===t[2]),4&e&&A(j,"active","top-center"===t[2]),4&e&&A(I,"active","top-right"===t[2]),4&e&&A(D,"active","bottom-left"===t[2]),4&e&&A(B,"active","bottom-center"===t[2]),4&e&&A(H,"active","bottom-rigth"===t[2]),8&e&&(Q.checked=t[3]),8&e&&Z!==(Z=`label-show-custom ${t[3]?"active":""}`)&&N(X,"class",Z),t[3]?st&&(st.d(1),st=null):st?st.p(t,e):(st=Lt(t),st.c(),st.m(J,null))},i:e,o:e,d(t){t&&w(n),st&&st.d(),c(ct)}}}function qt(t,e,n){let{toggleItemType:o=(()=>{})}=e,i="Notification",c=4e3,s="bottom-center",l=!1,r=!1;const{addNotification:u,clearNotifications:a}=ht();return t.$set=t=>{"toggleItemType"in t&&n(10,o=t.toggleItemType)},[i,c,s,l,r,u,a,({target:t})=>{t&&t.id&&n(2,s=t.id)},()=>{n(3,l=!l),l&&n(4,r=!1),o(),a()},()=>{n(4,r=!r),a()},o,function(){i=this.value,n(0,i)},function(){c=this.value,n(1,c)},function(){l=this.checked,n(3,l)},function(){r=this.checked,n(4,r)},()=>u({id:(new Date).getTime(),text:i,removeAfter:c,position:s,type:r&&"danger",customClass:"default-custom-class"}),()=>a()]}class Bt extends pt{constructor(t){super(),dt(this,t,qt,Dt,l,{toggleItemType:10})}}function Ft(t){let n;const o=new Bt({props:{toggleItemType:t[1]}});return{c(){rt(o.$$.fragment)},m(t,e){ut(o,t,e),n=!0},p:e,i(t){n||(nt(o.$$.fragment,t),n=!0)},o(t){ot(o.$$.fragment,t),n=!1},d(t){at(o,t)}}}function Ht(t){let e;const n=new jt({props:{item:t[0],$$slots:{default:[Ft]},$$scope:{ctx:t}}});return{c(){rt(n.$$.fragment)},m(t,o){ut(n,t,o),e=!0},p(t,[e]){const o={};1&e&&(o.item=t[0]),4&e&&(o.$$scope={dirty:e,ctx:t}),n.$set(o)},i(t){e||(nt(n.$$.fragment,t),e=!0)},o(t){ot(n.$$.fragment,t),e=!1},d(t){at(n,t)}}}function Gt(t,e,n){let o=null;return[o,()=>{n(0,o=o?null:Pt)}]}var Jt=new class extends pt{constructor(t){super(),dt(this,t,Gt,Ht,l,{})}}({target:document.body});t.default=Jt,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/build/bundle.mjs b/build/bundle.mjs new file mode 100644 index 0000000..9605d1f --- /dev/null +++ b/build/bundle.mjs @@ -0,0 +1 @@ +function t(){}const e=t=>t;function n(t){return t()}function o(){return Object.create(null)}function i(t){t.forEach(n)}function c(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(e,n,o){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const o=e.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}function r(t,e,n,o){if(t){const i=u(t,e,n,o);return t[0](i)}}function u(t,e,n,o){return t[1]&&o?function(t,e){for(const n in e)t[n]=e[n];return t}(n.ctx.slice(),t[1](o(e))):n.ctx}function a(t,e,n,o){if(t[2]&&o){const i=t[2](o(n));if("object"==typeof e.dirty){const t=[],n=Math.max(e.dirty.length,i.length);for(let o=0;owindow.performance.now():()=>Date.now(),p=d?t=>requestAnimationFrame(t):t;const h=new Set;function $(t){h.forEach(e=>{e.c(t)||(h.delete(e),e.f())}),0!==h.size&&p($)}function g(t){let e;return 0===h.size&&p($),{promise:new Promise(n=>{h.add(e={c:t,f:n})}),abort(){h.delete(e)}}}function v(t,e){t.appendChild(e)}function y(t,e,n){t.insertBefore(e,n||null)}function b(t){t.parentNode.removeChild(t)}function w(t){return document.createElement(t)}function x(t){return document.createTextNode(t)}function k(){return x(" ")}function C(){return x("")}function S(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function _(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function N(t,e){e=""+e,t.data!==e&&(t.data=e)}function E(t,e){(null!=e||t.value)&&(t.value=e)}function R(t,e,n){t.classList[n?"add":"remove"](e)}let A,T,z=0,M={};function j(t,e,n,o,i,c,s,l=0){const r=16.666/o;let u="{\n";for(let t=0;t<=1;t+=r){const o=e+(n-e)*c(t);u+=100*t+`%{${s(o,1-o)}}\n`}const a=u+`100% {${s(n,1-n)}}\n}`,f=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(a)}_${l}`;if(!M[f]){if(!A){const t=w("style");document.head.appendChild(t),A=t.sheet}M[f]=!0,A.insertRule(`@keyframes ${f} ${a}`,A.cssRules.length)}const d=t.style.animation||"";return t.style.animation=`${d?`${d}, `:""}${f} ${o}ms linear ${i}ms 1 both`,z+=1,f}function I(t,e){t.style.animation=(t.style.animation||"").split(", ").filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")).join(", "),e&&!--z&&p(()=>{if(z)return;let t=A.cssRules.length;for(;t--;)A.deleteRule(t);M={}})}function O(t){T=t}function L(){if(!T)throw new Error("Function called outside component initialization");return T}const P=[],D=[],q=[],B=[],F=Promise.resolve();let H=!1;function G(t){q.push(t)}const J=new Set;function K(){do{for(;P.length;){const t=P.shift();O(t),Q(t.$$)}for(;D.length;)D.pop()();for(let t=0;t{U=null})),U}function W(t,e,n){t.dispatchEvent(function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(`${e?"intro":"outro"}${n}`))}const X=new Set;let Y;function Z(){Y={r:0,c:[],p:Y}}function tt(){Y.r||i(Y.c),Y=Y.p}function et(t,e){t&&t.i&&(X.delete(t),t.i(e))}function nt(t,e,n,o){if(t&&t.o){if(X.has(t))return;X.add(t),Y.c.push(()=>{X.delete(t),o&&(n&&t.d(1),o())}),t.o(e)}}const ot={duration:0};function it(n,o,i){let s,l,r=o(n,i),u=!1,a=0;function f(){s&&I(n,s)}function d(){const{delay:o=0,duration:i=300,easing:c=e,tick:d=t,css:p}=r||ot;p&&(s=j(n,0,1,i,o,c,p,a++)),d(0,1);const h=m()+o,$=h+i;l&&l.abort(),u=!0,G(()=>W(n,!0,"start")),l=g(t=>{if(u){if(t>=$)return d(1,0),W(n,!0,"end"),f(),u=!1;if(t>=h){const e=c((t-h)/i);d(e,1-e)}}return u})}let p=!1;return{start(){p||(I(n),c(r)?(r=r(),V().then(d)):d())},invalidate(){p=!1},end(){u&&(f(),u=!1)}}}function ct(n,o,s){let l,r=o(n,s),u=!0;const a=Y;function f(){const{delay:o=0,duration:c=300,easing:s=e,tick:f=t,css:d}=r||ot;d&&(l=j(n,1,0,c,o,s,d));const p=m()+o,h=p+c;G(()=>W(n,!1,"start")),g(t=>{if(u){if(t>=h)return f(0,1),W(n,!1,"end"),--a.r||i(a.c),!1;if(t>=p){const e=s((t-p)/c);f(1-e,e)}}return u})}return a.r+=1,c(r)?V().then(()=>{r=r(),f()}):f(),{end(t){t&&r.tick&&r.tick(1,0),u&&(l&&I(n,l),u=!1)}}}function st(t,e){nt(t,1,1,()=>{e.delete(t.key)})}function lt(t){t&&t.c()}function rt(t,e,o){const{fragment:s,on_mount:l,on_destroy:r,after_update:u}=t.$$;s&&s.m(e,o),G(()=>{const e=l.map(n).filter(c);r?r.push(...e):i(e),t.$$.on_mount=[]}),u.forEach(G)}function ut(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function at(t,e){-1===t.$$.dirty[0]&&(P.push(t),H||(H=!0,F.then(K)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const i=o.length?o[0]:n;return d.ctx&&l(d.ctx[t],d.ctx[t]=i)&&(d.bound[t]&&d.bound[t](i),m&&at(e,t)),n}):[],d.update(),m=!0,i(d.before_update),d.fragment=!!s&&s(d.ctx),n.target&&(n.hydrate?d.fragment&&d.fragment.l(function(t){return Array.from(t.childNodes)}(n.target)):d.fragment&&d.fragment.c(),n.intro&&et(e.$$.fragment),rt(e,n.target,n.anchor),K()),O(a)}class dt{$destroy(){ut(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(){}}const mt={subscribe:null,addNotification:null,removeNotification:null,clearNotifications:null},pt=()=>{return t=mt,L().$$.context.get(t);var t};function ht(t){let e,n;var o=t[0];function i(t){return{props:{notification:t[1],withoutStyles:t[2],onRemove:t[3]}}}if(o)var c=new o(i(t));return{c(){c&<(c.$$.fragment),e=C()},m(t,o){c&&rt(c,t,o),y(t,e,o),n=!0},p(t,[n]){const s={};if(2&n&&(s.notification=t[1]),4&n&&(s.withoutStyles=t[2]),o!==(o=t[0])){if(c){Z();const t=c;nt(t.$$.fragment,1,0,()=>{ut(t,1)}),tt()}o?(lt((c=new o(i(t))).$$.fragment),et(c.$$.fragment,1),rt(c,e.parentNode,e)):c=null}else o&&c.$set(s)},i(t){n||(c&&et(c.$$.fragment,t),n=!0)},o(t){c&&nt(c.$$.fragment,t),n=!1},d(t){t&&b(e),c&&ut(c,t)}}}function $t(t,e,n){let{item:o}=e,{notification:i={}}=e,{withoutStyles:c=!1}=e;const{removeNotification:s}=pt(),{id:l,removeAfter:r}=i,u=()=>s(l);let a=null;var f;return r&&(a=setTimeout(u,r)),f=()=>{r&&a&&clearTimeout(a)},L().$$.on_destroy.push(f),t.$set=t=>{"item"in t&&n(0,o=t.item),"notification"in t&&n(1,i=t.notification),"withoutStyles"in t&&n(2,c=t.withoutStyles)},[o,i,c,u]}class gt extends dt{constructor(t){super(),ft(this,t,$t,ht,s,{item:0,notification:1,withoutStyles:2})}}function vt(t,{delay:n=0,duration:o=400,easing:i=e}){const c=+getComputedStyle(t).opacity;return{delay:n,duration:o,easing:i,css:t=>`opacity: ${t*c}`}}function yt(t){let e,n,o,i,c,s,l,d,m,p,h,$,g;const C=t[7].default,N=r(C,t,t[6],null);return{c(){e=w("div"),n=w("div"),N||(o=x(t[1])),N&&N.c(),c=k(),s=w("button"),l=x("×"),_(n,"class",i=f(t[2]("content"))+" svelte-zh5z3r"),_(s,"class",d=f(t[2]("button"))+" svelte-zh5z3r"),_(s,"aria-label","delete notification"),_(e,"class",m=f(t[2]())+" svelte-zh5z3r"),_(e,"role","status"),_(e,"aria-live","polite")},m(i,r){y(i,e,r),v(e,n),N||v(n,o),N&&N.m(n,null),v(e,c),v(e,s),v(s,l),$=!0,g=S(s,"click",t[0])},p(t,[e]){N&&N.p&&64&e&&N.p(u(C,t,t[6],null),a(C,t[6],e,null))},i(t){$||(et(N,t),G(()=>{h&&h.end(1),p||(p=it(e,vt,{})),p.start()}),$=!0)},o(t){nt(N,t),p&&p.invalidate(),h=ct(e,vt,{}),$=!1},d(t){t&&b(e),N&&N.d(t),t&&h&&h.end(),g()}}}function bt(t,e,n){let{notification:o={}}=e,{withoutStyles:i=!1}=e,{onRemove:c=null}=e;const{text:s,type:l}=o;let{$$slots:r={},$$scope:u}=e;return t.$set=t=>{"notification"in t&&n(3,o=t.notification),"withoutStyles"in t&&n(4,i=t.withoutStyles),"onRemove"in t&&n(0,c=t.onRemove),"$$scope"in t&&n(6,u=t.$$scope)},[c,s,t=>{const e=t?`-${t}`:"";return`notification${e}${i?"":` default-notification-style${e}`}${l&&!t?` default-notification-${l}`:""}`},o,i,l,u,r]}class wt extends dt{constructor(t){super(),ft(this,t,bt,yt,s,{notification:3,withoutStyles:4,onRemove:0})}}const xt=[];const kt=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"],Ct=(t,e)=>{if(!(t=>!(!t||!t.text)&&("string"==typeof t.text&&!!kt.includes(t.position)))(t))throw new Error("Notification object is not valid");const{id:n=(new Date).getTime(),removeAfter:o=+t.removeAfter,...i}=t;e(t=>[...t,{id:n,removeAfter:o,...i}])};var St=(()=>{const{subscribe:e,set:n,update:o}=function(e,n=t){let o;const i=[];function c(t){if(s(e,t)&&(e=t,o)){const t=!xt.length;for(let t=0;t{const t=i.indexOf(r);-1!==t&&i.splice(t,1),0===i.length&&(o(),o=null)}}}}([]);return{subscribe:e,addNotification:t=>Ct(t,o),removeNotification:t=>((t,e)=>e(e=>e.filter(e=>e.id!==t)))(t,o),clearNotifications:()=>(t=>t([]))(n)}})();function _t(t,e,n){const o=t.slice();return o[9]=e[n],o}function Nt(t,e,n){const o=t.slice();return o[6]=e[n],o}function Et(t){let e;const n=new gt({props:{notification:t[9],withoutStyles:t[1],item:t[0]||wt}});return{c(){lt(n.$$.fragment)},m(t,o){rt(n,t,o),e=!0},p(t,e){const o={};4&e&&(o.notification=t[9]),2&e&&(o.withoutStyles=t[1]),1&e&&(o.item=t[0]||wt),n.$set(o)},i(t){e||(et(n.$$.fragment,t),e=!0)},o(t){nt(n.$$.fragment,t),e=!1},d(t){ut(n,t)}}}function Rt(t,e){let n,o,i,c=e[9].position===e[6]&&Et(e);return{key:t,first:null,c(){n=C(),c&&c.c(),o=C(),this.first=n},m(t,e){y(t,n,e),c&&c.m(t,e),y(t,o,e),i=!0},p(t,e){t[9].position===t[6]?c?(c.p(t,e),et(c,1)):(c=Et(t),c.c(),et(c,1),c.m(o.parentNode,o)):c&&(Z(),nt(c,1,1,()=>{c=null}),tt())},i(t){i||(et(c),i=!0)},o(t){nt(c),i=!1},d(t){t&&b(n),c&&c.d(t),t&&b(o)}}}function At(t){let e,n,o,i,c=[],s=new Map,l=t[2];const r=t=>t[9].id;for(let e=0;ev.get(i)?(b.add(o),w(e)):(y.add(i),d--):(r(n,s),d--)}for(;d--;){const e=t[d];g.has(e.key)||r(e,s)}for(;m;)w($[m-1]);return $}(c,o,r,1,t,i,s,e,st,Rt,n,_t),tt()},i(t){if(!i){for(let t=0;tnt(l[t],1,1,()=>{l[t]=null});return{c(){c&&c.c(),e=k(),n=w("div");for(let t=0;tn(2,o=t));let{item:i=null}=e,{withoutStyles:c=!1}=e;!function(t,e){L().$$.context.set(t,e)}(mt,St);let{$$slots:s={},$$scope:r}=e;return t.$set=t=>{"item"in t&&n(0,i=t.item),"withoutStyles"in t&&n(1,c=t.withoutStyles),"$$scope"in t&&n(4,r=t.$$scope)},[i,c,o,(t="")=>`position-${t}${c?"":` default-position-style-${t}`}`,r,s]}class Mt extends dt{constructor(t){super(),ft(this,t,zt,Tt,s,{item:0,withoutStyles:1})}}function jt(t){let e,n,o,c,s,l,f,d,m,p,h,$,g,C,E,R=t[0].text+"",A=(t[0].description||"Custom description")+"";const T=t[3].default,z=r(T,t,t[2],null);return{c(){e=w("div"),n=w("div"),z||(o=x(R)),z&&z.c(),c=k(),s=w("p"),l=x(A),f=k(),d=w("div"),m=w("button"),m.textContent="Action",p=k(),h=w("button"),h.textContent="Close",_(s,"class","svelte-1ak1e6y"),_(n,"class","notification-content svelte-1ak1e6y"),_(m,"class","svelte-1ak1e6y"),_(h,"class","svelte-1ak1e6y"),_(d,"class","notification-buttons svelte-1ak1e6y"),_(e,"class","notification svelte-1ak1e6y")},m(i,r){y(i,e,r),v(e,n),z||v(n,o),z&&z.m(n,null),v(n,c),v(n,s),v(s,l),v(e,f),v(e,d),v(d,m),v(d,p),v(d,h),C=!0,E=[S(m,"click",t[1]),S(h,"click",t[1])]},p(t,[e]){z||(!C||1&e)&&R!==(R=t[0].text+"")&&N(o,R),z&&z.p&&4&e&&z.p(u(T,t,t[2],null),a(T,t[2],e,null)),(!C||1&e)&&A!==(A=(t[0].description||"Custom description")+"")&&N(l,A)},i(t){C||(et(z,t),G(()=>{g&&g.end(1),$||($=it(e,vt,{})),$.start()}),C=!0)},o(t){nt(z,t),$&&$.invalidate(),g=ct(e,vt,{}),C=!1},d(t){t&&b(e),z&&z.d(t),t&&g&&g.end(),i(E)}}}function It(t,e,n){let{notification:o}=e,{onRemove:i=null}=e,{$$slots:c={},$$scope:s}=e;return t.$set=t=>{"notification"in t&&n(0,o=t.notification),"onRemove"in t&&n(1,i=t.onRemove),"$$scope"in t&&n(2,s=t.$$scope)},[o,i,s,c]}class Ot extends dt{constructor(t){super(),ft(this,t,It,jt,s,{notification:0,onRemove:1})}}function Lt(t){let e,n,o,c,s,l,r,u,a;return{c(){e=w("div"),n=w("input"),o=k(),c=w("span"),s=k(),l=w("label"),r=x("Show danger notification"),_(n,"type","checkbox"),_(n,"id","show-danger"),_(c,"class","toggle toggle-danger"),_(l,"for","show-danger"),_(l,"class",u=`label-show-custom ${t[4]?"active":""}`),_(e,"class","col col-1-3 show-custom")},m(i,u){y(i,e,u),v(e,n),n.checked=t[4],v(e,o),v(e,c),v(e,s),v(e,l),v(l,r),a=[S(n,"change",t[14]),S(c,"click",t[9])]},p(t,e){16&e&&(n.checked=t[4]),16&e&&u!==(u=`label-show-custom ${t[4]?"active":""}`)&&_(l,"class",u)},d(t){t&&b(e),i(a)}}}function Pt(e){let n,o,c,s,l,r,u,a,f,d,m,p,h,$,g,C,N,A,T,z,M,j,I,O,L,P,D,q,B,F,H,G,J,K,Q,U,V,W,X,Y,Z,tt,et,nt,ot,it,ct,st=!e[3]&&Lt(e);return{c(){n=w("div"),o=w("div"),o.innerHTML='

\n Svelte notifications\n \n v0.9.9\n

\n

Extremely simple and flexible notifications for Svelte

',c=k(),s=w("div"),l=w("div"),r=w("label"),r.textContent="Message",u=k(),a=w("input"),f=k(),d=w("div"),m=w("label"),m.textContent="Remove after (ms)",p=k(),h=w("input"),$=k(),g=w("div"),C=w("label"),C.textContent="Position",N=k(),A=w("div"),T=w("div"),z=w("button"),z.textContent="↖",M=k(),j=w("button"),j.textContent="↑",I=k(),O=w("button"),O.textContent="↗",L=k(),P=w("div"),D=w("button"),D.textContent="↙",q=k(),B=w("button"),B.textContent="↓",F=k(),H=w("button"),H.textContent="↘",G=k(),J=w("div"),K=w("div"),Q=w("input"),U=k(),V=w("span"),W=k(),X=w("label"),Y=x("Show custom notification"),tt=k(),st&&st.c(),et=k(),nt=w("button"),nt.textContent="Create",ot=k(),it=w("button"),it.textContent="Clear all",_(o,"class","example-title"),_(r,"for","notification-text"),_(a,"id","notification-text"),_(a,"type","text"),_(l,"class","col col-1-3"),_(m,"for","notification-remove-after"),_(h,"id","notification-remove-after"),_(h,"type","text"),_(d,"class","col col-1-3"),_(C,"for","notification-position"),_(z,"class","top-left"),_(z,"id","top-left"),R(z,"active","top-left"===e[2]),_(j,"class","top-center"),_(j,"id","top-center"),R(j,"active","top-center"===e[2]),_(O,"class","top-right"),_(O,"id","top-right"),R(O,"active","top-right"===e[2]),_(T,"class","position-select-row"),_(D,"class","bottom-left"),_(D,"id","bottom-left"),R(D,"active","bottom-left"===e[2]),_(B,"class","bottom-center"),_(B,"id","bottom-center"),R(B,"active","bottom-center"===e[2]),_(H,"class","bottom-right"),_(H,"id","bottom-right"),R(H,"active","bottom-rigth"===e[2]),_(P,"class","position-select-row"),_(A,"class","position-select"),_(g,"class","col col-1-3"),_(s,"class","row"),_(Q,"type","checkbox"),_(Q,"id","show-custom"),_(V,"class","toggle toggle-custom"),_(X,"for","show-custom"),_(X,"class",Z=`label-show-custom ${e[3]?"active":""}`),_(K,"class","col col-1-3 show-custom"),_(J,"class","additional-tools"),_(nt,"class","button"),_(nt,"id","create-button"),_(it,"class","button secondary"),_(n,"class","example")},m(t,i){y(t,n,i),v(n,o),v(n,c),v(n,s),v(s,l),v(l,r),v(l,u),v(l,a),E(a,e[0]),v(s,f),v(s,d),v(d,m),v(d,p),v(d,h),E(h,e[1]),v(s,$),v(s,g),v(g,C),v(g,N),v(g,A),v(A,T),v(T,z),v(T,M),v(T,j),v(T,I),v(T,O),v(A,L),v(A,P),v(P,D),v(P,q),v(P,B),v(P,F),v(P,H),v(n,G),v(n,J),v(J,K),v(K,Q),Q.checked=e[3],v(K,U),v(K,V),v(K,W),v(K,X),v(X,Y),v(J,tt),st&&st.m(J,null),v(n,et),v(n,nt),v(n,ot),v(n,it),ct=[S(a,"input",e[11]),S(h,"input",e[12]),S(z,"click",e[7]),S(j,"click",e[7]),S(O,"click",e[7]),S(D,"click",e[7]),S(B,"click",e[7]),S(H,"click",e[7]),S(Q,"change",e[13]),S(V,"click",e[8]),S(nt,"click",e[15]),S(it,"click",e[16])]},p(t,[e]){1&e&&a.value!==t[0]&&E(a,t[0]),2&e&&h.value!==t[1]&&E(h,t[1]),4&e&&R(z,"active","top-left"===t[2]),4&e&&R(j,"active","top-center"===t[2]),4&e&&R(O,"active","top-right"===t[2]),4&e&&R(D,"active","bottom-left"===t[2]),4&e&&R(B,"active","bottom-center"===t[2]),4&e&&R(H,"active","bottom-rigth"===t[2]),8&e&&(Q.checked=t[3]),8&e&&Z!==(Z=`label-show-custom ${t[3]?"active":""}`)&&_(X,"class",Z),t[3]?st&&(st.d(1),st=null):st?st.p(t,e):(st=Lt(t),st.c(),st.m(J,null))},i:t,o:t,d(t){t&&b(n),st&&st.d(),i(ct)}}}function Dt(t,e,n){let{toggleItemType:o=(()=>{})}=e,i="Notification",c=4e3,s="bottom-center",l=!1,r=!1;const{addNotification:u,clearNotifications:a}=pt();return t.$set=t=>{"toggleItemType"in t&&n(10,o=t.toggleItemType)},[i,c,s,l,r,u,a,({target:t})=>{t&&t.id&&n(2,s=t.id)},()=>{n(3,l=!l),l&&n(4,r=!1),o(),a()},()=>{n(4,r=!r),a()},o,function(){i=this.value,n(0,i)},function(){c=this.value,n(1,c)},function(){l=this.checked,n(3,l)},function(){r=this.checked,n(4,r)},()=>u({id:(new Date).getTime(),text:i,removeAfter:c,position:s,type:r&&"danger",customClass:"default-custom-class"}),()=>a()]}class qt extends dt{constructor(t){super(),ft(this,t,Dt,Pt,s,{toggleItemType:10})}}function Bt(e){let n;const o=new qt({props:{toggleItemType:e[1]}});return{c(){lt(o.$$.fragment)},m(t,e){rt(o,t,e),n=!0},p:t,i(t){n||(et(o.$$.fragment,t),n=!0)},o(t){nt(o.$$.fragment,t),n=!1},d(t){ut(o,t)}}}function Ft(t){let e;const n=new Mt({props:{item:t[0],$$slots:{default:[Bt]},$$scope:{ctx:t}}});return{c(){lt(n.$$.fragment)},m(t,o){rt(n,t,o),e=!0},p(t,[e]){const o={};1&e&&(o.item=t[0]),4&e&&(o.$$scope={dirty:e,ctx:t}),n.$set(o)},i(t){e||(et(n.$$.fragment,t),e=!0)},o(t){nt(n.$$.fragment,t),e=!1},d(t){ut(n,t)}}}function Ht(t,e,n){let o=null;return[o,()=>{n(0,o=o?null:Ot)}]}var Gt=new class extends dt{constructor(t){super(),ft(this,t,Ht,Ft,s,{})}}({target:document.body});export default Gt; diff --git a/build/index.js b/build/index.js deleted file mode 100644 index 61d81dd..0000000 --- a/build/index.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).Notifications={})}(this,(function(t){"use strict";function n(){}const e=t=>t;function o(t,n){for(const e in n)t[e]=n[e];return t}function i(t){return t()}function r(){return Object.create(null)}function s(t){t.forEach(i)}function c(t){return"function"==typeof t}function l(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function u(t,n,e){if(t){const o=f(t,n,e);return t[0](o)}}function f(t,n,e){return t[1]?o({},o(n.$$scope.ctx,t[1](e?e(n):{}))):n.$$scope.ctx}function a(t,n,e,i){return t[1]?o({},o(n.$$scope.changed||{},t[1](i?i(e):{}))):n.$$scope.changed||{}}const d="undefined"!=typeof window;let $=d?()=>window.performance.now():()=>Date.now(),p=d?t=>requestAnimationFrame(t):n;const h=new Set;let m,g=!1;function y(){h.forEach(t=>{t[0]($())||(h.delete(t),t[1]())}),(g=h.size>0)&&p(y)}function v(t){let n;return g||(g=!0,p(y)),{promise:new Promise(e=>{h.add(n=[t,e])}),abort(){h.delete(n)}}}function w(t,n){t.appendChild(n)}function b(t,n,e){t.insertBefore(n,e||null)}function x(t){t.parentNode.removeChild(t)}function _(t){return document.createElement(t)}function S(t){return document.createTextNode(t)}function N(){return S(" ")}function k(){return S("")}function C(t,n,e){null==e?t.removeAttribute(n):t.setAttribute(n,e)}let E,j=0,A={};function O(t,n,e,o,i,r,s,c=0){const l=16.666/o;let u="{\n";for(let t=0;t<=1;t+=l){const o=n+(e-n)*r(t);u+=100*t+`%{${s(o,1-o)}}\n`}const f=u+`100% {${s(e,1-e)}}\n}`,a=`__svelte_${function(t){let n=5381,e=t.length;for(;e--;)n=(n<<5)-n^t.charCodeAt(e);return n>>>0}(f)}_${c}`;if(!A[a]){if(!m){const t=_("style");document.head.appendChild(t),m=t.sheet}A[a]=!0,m.insertRule(`@keyframes ${a} ${f}`,m.cssRules.length)}const d=t.style.animation||"";return t.style.animation=`${d?`${d}, `:""}${a} ${o}ms linear ${i}ms 1 both`,j+=1,a}function M(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>t.indexOf(n)<0:t=>-1===t.indexOf("__svelte")).join(", "),n&&!--j&&p(()=>{if(j)return;let t=m.cssRules.length;for(;t--;)m.deleteRule(t);A={}})}function P(t){E=t}function R(){if(!E)throw new Error("Function called outside component initialization");return E}const T=[],q=[],z=[],B=[],D=Promise.resolve();let F,H=!1;function L(t){z.push(t)}function G(){const t=new Set;do{for(;T.length;){const t=T.shift();P(t),I(t.$$)}for(;q.length;)q.pop()();for(let n=0;n{F=null}),F}function K(t,n,e){t.dispatchEvent(function(t,n){const e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,n),e}(`${n?"intro":"outro"}${e}`))}const Q=new Set;let U;function V(){U={r:0,c:[],p:U}}function W(){U.r||s(U.c),U=U.p}function X(t,n){t&&t.i&&(Q.delete(t),t.i(n))}function Y(t,n,e,o){if(t&&t.o){if(Q.has(t))return;Q.add(t),U.c.push(()=>{Q.delete(t),o&&(e&&t.d(1),o())}),t.o(n)}}const Z={duration:0};function tt(t,n){Y(t,1,1,()=>{n.delete(t.key)})}function nt(t,n,e){const{fragment:o,on_mount:r,on_destroy:l,after_update:u}=t.$$;o.m(n,e),L(()=>{const n=r.map(i).filter(c);l?l.push(...n):s(n),t.$$.on_mount=[]}),u.forEach(L)}function et(t,n){t.$$.fragment&&(s(t.$$.on_destroy),t.$$.fragment.d(n),t.$$.on_destroy=t.$$.fragment=null,t.$$.ctx={})}function ot(t,n){t.$$.dirty||(T.push(t),H||(H=!0,D.then(G)),t.$$.dirty=r()),t.$$.dirty[n]=!0}function it(t,e,o,i,c,l){const u=E;P(t);const f=e.props||{},a=t.$$={fragment:null,ctx:null,props:l,update:n,not_equal:c,bound:r(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(u?u.$$.context:[]),callbacks:r(),dirty:null};let d=!1;a.ctx=o?o(t,f,(n,e,o=e)=>(a.ctx&&c(a.ctx[n],a.ctx[n]=o)&&(a.bound[n]&&a.bound[n](o),d&&ot(t,n)),e)):f,a.update(),d=!0,s(a.before_update),a.fragment=i(a.ctx),e.target&&(e.hydrate?a.fragment.l(function(t){return Array.from(t.childNodes)}(e.target)):a.fragment.c(),e.intro&&X(t.$$.fragment),nt(t,e.target,e.anchor),G()),P(u)}class rt{$destroy(){et(this,1),this.$destroy=n}$on(t,n){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(){}}function st(t,{delay:n=0,duration:e=400}){const o=+getComputedStyle(t).opacity;return{delay:n,duration:e,css:t=>`opacity: ${t*o}`}}const ct={subscribe:null,addNotification:null,removeNotification:null,clearNotifications:null},lt=()=>(function(t){return R().$$.context.get(t)})(ct);function ut(t){var o,i,r,l,d,p,h,m,g,y;const k=t.$$slots.default,E=u(k,t,null);return{c(){var n,e,s,c;o=_("div"),i=_("div"),E||(r=S(t.text)),E&&E.c(),l=N(),d=_("button"),p=S("×"),C(i,"class",t.getClass("content")+" svelte-1nm9ptj"),C(d,"class",t.getClass("button")+" svelte-1nm9ptj"),C(d,"aria-label","delete notification"),C(o,"class",t.getClass()+" svelte-1nm9ptj"),C(o,"role","status"),C(o,"aria-live","polite"),n=d,e="click",s=t.removeNotificationHandler,n.addEventListener(e,s,c),y=()=>n.removeEventListener(e,s,c)},l(t){E&&E.l(div0_nodes)},m(t,n){b(t,o,n),w(o,i),E?E.m(i,null):w(i,r),w(o,l),w(o,d),w(d,p),g=!0},p(t,n){E&&E.p&&t.$$scope&&E.p(a(k,n,t,null),f(k,n,null))},i(t){g||(X(E,t),L(()=>{m&&m.end(1),h||(h=function(t,o,i){let r,s,l=o(t,i),u=!1,f=0;function a(){r&&M(t,r)}function d(){const{delay:o=0,duration:i=300,easing:c=e,tick:d=n,css:p}=l||Z;p&&(r=O(t,0,1,i,o,c,p,f++)),d(0,1);const h=$()+o,m=h+i;s&&s.abort(),u=!0,L(()=>K(t,!0,"start")),s=v(n=>{if(u){if(n>=m)return d(1,0),K(t,!0,"end"),a(),u=!1;if(n>=h){const t=c((n-h)/i);d(t,1-t)}}return u})}let p=!1;return{start(){p||(M(t),c(l)?(l=l(),J().then(d)):d())},invalidate(){p=!1},end(){u&&(a(),u=!1)}}}(o,st,{})),h.start()}),g=!0)},o(t){Y(E,t),h&&h.invalidate(),m=function(t,o,i){let r,l=o(t,i),u=!0;const f=U;function a(){const{delay:o=0,duration:i=300,easing:c=e,tick:a=n,css:d}=l||Z;d&&(r=O(t,1,0,i,o,c,d));const p=$()+o,h=p+i;L(()=>K(t,!1,"start")),v(n=>{if(u){if(n>=h)return a(0,1),K(t,!1,"end"),--f.r||s(f.c),!1;if(n>=p){const t=c((n-p)/i);a(1-t,t)}}return u})}return f.r+=1,c(l)?J().then(()=>{l=l(),a()}):a(),{end(n){n&&l.tick&&l.tick(1,0),u&&(r&&M(t,r),u=!1)}}}(o,st,{}),g=!1},d(t){t&&x(o),E&&E.d(t),t&&m&&m.end(),y()}}}function ft(t,n,e){let{notification:o={},withoutStyles:i=!1}=n;const{removeNotification:r}=lt(),{id:s,text:c,removeAfter:l}=o,u=()=>r(s);let f=null;var a;l&&(f=setTimeout(u,l)),a=()=>{l&&f&&clearTimeout(f)},R().$$.on_destroy.push(a);let{$$slots:d={},$$scope:$}=n;return t.$set=t=>{"notification"in t&&e("notification",o=t.notification),"withoutStyles"in t&&e("withoutStyles",i=t.withoutStyles),"$$scope"in t&&e("$$scope",$=t.$$scope)},{notification:o,withoutStyles:i,text:c,getClass:t=>{const n=t?`-${t}`:"";return`notification${n}${i?"":` default-notification-style${n}`}`},removeNotificationHandler:u,$$slots:d,$$scope:$}}class at extends rt{constructor(t){super(),it(this,t,ft,ut,l,["notification","withoutStyles"])}}const dt=[];const $t=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"],pt=(t,n)=>{if(!(t=>!(!t||!t.text)&&("string"==typeof t.text&&!!$t.includes(t.position)))(t))throw new Error("Notification object is not valid");const{id:e=(new Date).getTime(),removeAfter:o=+t.removeAfter,...i}=t;n(t=>[...t,{id:e,removeAfter:o,...i}])};var ht=(()=>{const{subscribe:t,set:e,update:o}=function(t,e=n){let o;const i=[];function r(n){if(l(t,n)&&(t=n,o)){const n=!dt.length;for(let n=0;n{const t=i.indexOf(l);-1!==t&&i.splice(t,1),0===i.length&&(o(),o=null)}}}}([]);return{subscribe:t,addNotification:t=>pt(t,o),removeNotification:t=>((t,n)=>n(n=>n.filter(n=>n.id!==t)))(t,o),clearNotifications:()=>(t=>t([]))(e)}})();function mt(t,n,e){const o=Object.create(t);return o.notification=n[e],o}function gt(t,n,e){const o=Object.create(t);return o.position=n[e],o}function yt(t){var n,e,o,i,r=[wt,vt],s=[];function c(t,n){return n.item?0:1}return n=c(0,t),e=s[n]=r[n](t),{c(){e.c(),o=k()},m(t,e){s[n].m(t,e),b(t,o,e),i=!0},p(t,i){var l=n;(n=c(0,i))===l?s[n].p(t,i):(V(),Y(s[l],1,1,()=>{s[l]=null}),W(),(e=s[n])||(e=s[n]=r[n](i)).c(),X(e,1),e.m(o.parentNode,o))},i(t){i||(X(e),i=!0)},o(t){Y(e),i=!1},d(t){s[n].d(t),t&&x(o)}}}function vt(t){var n,e=new at({props:{notification:t.notification,withoutStyles:t.withoutStyles}});return{c(){e.$$.fragment.c()},m(t,o){nt(e,t,o),n=!0},p(t,n){var o={};t.$store&&(o.notification=n.notification),t.withoutStyles&&(o.withoutStyles=n.withoutStyles),e.$set(o)},i(t){n||(X(e.$$.fragment,t),n=!0)},o(t){Y(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function wt(t){var n,e,o=t.item;function i(t){return{props:{notification:t.notification}}}if(o)var r=new o(i(t));return{c(){r&&r.$$.fragment.c(),n=k()},m(t,o){r&&nt(r,t,o),b(t,n,o),e=!0},p(t,e){var s={};if(t.$store&&(s.notification=e.notification),o!==(o=e.item)){if(r){V();const t=r;Y(t.$$.fragment,1,0,()=>{et(t,1)}),W()}o?((r=new o(i(e))).$$.fragment.c(),X(r.$$.fragment,1),nt(r,n.parentNode,n)):r=null}else o&&r.$set(s)},i(t){e||(r&&X(r.$$.fragment,t),e=!0)},o(t){r&&Y(r.$$.fragment,t),e=!1},d(t){t&&x(n),r&&et(r,t)}}}function bt(t,n){var e,o,i,r=n.notification.position===n.position&&yt(n);return{key:t,first:null,c(){e=k(),r&&r.c(),o=k(),this.first=e},m(t,n){b(t,e,n),r&&r.m(t,n),b(t,o,n),i=!0},p(t,n){n.notification.position===n.position?r?(r.p(t,n),X(r,1)):((r=yt(n)).c(),X(r,1),r.m(o.parentNode,o)):r&&(V(),Y(r,1,1,()=>{r=null}),W())},i(t){i||(X(r),i=!0)},o(t){Y(r),i=!1},d(t){t&&x(e),r&&r.d(t),t&&x(o)}}}function xt(t){var n,e,o,i,r=[],s=new Map;let c=t.$store;const l=t=>t.notification.id;for(let n=0;ny.get(i)?(w.add(o),b(n)):(v.add(i),d--):(l(e,s),d--)}for(;d--;){const n=t[d];g.has(n.key)||l(n,s)}for(;$;)b(m[$-1]);return m}(r,t,l,1,n,o,s,e,tt,bt,null,mt),W()},i(t){if(!i){for(let t=0;tY(c[t],1,1,()=>{c[t]=null});return{c(){r&&r.c(),n=N(),e=_("div");for(let t=0;te.unsubscribe():e}(n,e))}(t,ht,t=>{e("$store",o=t)});let{item:i=null,withoutStyles:r=!1}=n;!function(t,n){R().$$.context.set(t,n)}(ct,ht);let{$$slots:s={},$$scope:c}=n;return t.$set=t=>{"item"in t&&e("item",i=t.item),"withoutStyles"in t&&e("withoutStyles",r=t.withoutStyles),"$$scope"in t&&e("$$scope",c=t.$$scope)},{item:i,withoutStyles:r,getClass:(t="")=>{return`position-${t}${r?"":` default-position-style-${t}`}`},$store:o,$$slots:s,$$scope:c}}t.default=class extends rt{constructor(t){super(),it(this,t,St,_t,l,["item","withoutStyles"])}},t.getNotificationsContext=lt,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/build/index.mjs b/build/index.mjs deleted file mode 100644 index 7d7a514..0000000 --- a/build/index.mjs +++ /dev/null @@ -1 +0,0 @@ -function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function i(){return Object.create(null)}function r(t){t.forEach(o)}function c(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function l(t,n,e){if(t){const o=u(t,n,e);return t[0](o)}}function u(t,n,o){return t[1]?e({},e(n.$$scope.ctx,t[1](o?o(n):{}))):n.$$scope.ctx}function f(t,n,o,i){return t[1]?e({},e(n.$$scope.changed||{},t[1](i?i(o):{}))):n.$$scope.changed||{}}const a="undefined"!=typeof window;let d=a?()=>window.performance.now():()=>Date.now(),$=a?t=>requestAnimationFrame(t):t;const p=new Set;let h,m=!1;function g(){p.forEach(t=>{t[0](d())||(p.delete(t),t[1]())}),(m=p.size>0)&&$(g)}function y(t){let n;return m||(m=!0,$(g)),{promise:new Promise(e=>{p.add(n=[t,e])}),abort(){p.delete(n)}}}function v(t,n){t.appendChild(n)}function w(t,n,e){t.insertBefore(n,e||null)}function b(t){t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function S(t){return document.createTextNode(t)}function _(){return S(" ")}function k(){return S("")}function N(t,n,e){null==e?t.removeAttribute(n):t.setAttribute(n,e)}let C,E=0,j={};function A(t,n,e,o,i,r,c,s=0){const l=16.666/o;let u="{\n";for(let t=0;t<=1;t+=l){const o=n+(e-n)*r(t);u+=100*t+`%{${c(o,1-o)}}\n`}const f=u+`100% {${c(e,1-e)}}\n}`,a=`__svelte_${function(t){let n=5381,e=t.length;for(;e--;)n=(n<<5)-n^t.charCodeAt(e);return n>>>0}(f)}_${s}`;if(!j[a]){if(!h){const t=x("style");document.head.appendChild(t),h=t.sheet}j[a]=!0,h.insertRule(`@keyframes ${a} ${f}`,h.cssRules.length)}const d=t.style.animation||"";return t.style.animation=`${d?`${d}, `:""}${a} ${o}ms linear ${i}ms 1 both`,E+=1,a}function O(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>t.indexOf(n)<0:t=>-1===t.indexOf("__svelte")).join(", "),n&&!--E&&$(()=>{if(E)return;let t=h.cssRules.length;for(;t--;)h.deleteRule(t);j={}})}function M(t){C=t}function R(){if(!C)throw new Error("Function called outside component initialization");return C}const T=[],P=[],q=[],z=[],B=Promise.resolve();let D,F=!1;function H(t){q.push(t)}function L(){const t=new Set;do{for(;T.length;){const t=T.shift();M(t),G(t.$$)}for(;P.length;)P.pop()();for(let n=0;n{D=null}),D}function J(t,n,e){t.dispatchEvent(function(t,n){const e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,n),e}(`${n?"intro":"outro"}${e}`))}const K=new Set;let Q;function U(){Q={r:0,c:[],p:Q}}function V(){Q.r||r(Q.c),Q=Q.p}function W(t,n){t&&t.i&&(K.delete(t),t.i(n))}function X(t,n,e,o){if(t&&t.o){if(K.has(t))return;K.add(t),Q.c.push(()=>{K.delete(t),o&&(e&&t.d(1),o())}),t.o(n)}}const Y={duration:0};function Z(t,n){X(t,1,1,()=>{n.delete(t.key)})}function tt(t,n,e){const{fragment:i,on_mount:s,on_destroy:l,after_update:u}=t.$$;i.m(n,e),H(()=>{const n=s.map(o).filter(c);l?l.push(...n):r(n),t.$$.on_mount=[]}),u.forEach(H)}function nt(t,n){t.$$.fragment&&(r(t.$$.on_destroy),t.$$.fragment.d(n),t.$$.on_destroy=t.$$.fragment=null,t.$$.ctx={})}function et(t,n){t.$$.dirty||(T.push(t),F||(F=!0,B.then(L)),t.$$.dirty=i()),t.$$.dirty[n]=!0}function ot(n,e,o,c,s,l){const u=C;M(n);const f=e.props||{},a=n.$$={fragment:null,ctx:null,props:l,update:t,not_equal:s,bound:i(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(u?u.$$.context:[]),callbacks:i(),dirty:null};let d=!1;a.ctx=o?o(n,f,(t,e,o=e)=>(a.ctx&&s(a.ctx[t],a.ctx[t]=o)&&(a.bound[t]&&a.bound[t](o),d&&et(n,t)),e)):f,a.update(),d=!0,r(a.before_update),a.fragment=c(a.ctx),e.target&&(e.hydrate?a.fragment.l(function(t){return Array.from(t.childNodes)}(e.target)):a.fragment.c(),e.intro&&W(n.$$.fragment),tt(n,e.target,e.anchor),L()),M(u)}class it{$destroy(){nt(this,1),this.$destroy=t}$on(t,n){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(){}}function rt(t,{delay:n=0,duration:e=400}){const o=+getComputedStyle(t).opacity;return{delay:n,duration:e,css:t=>`opacity: ${t*o}`}}const ct={subscribe:null,addNotification:null,removeNotification:null,clearNotifications:null},st=()=>(function(t){return R().$$.context.get(t)})(ct);function lt(e){var o,i,s,a,$,p,h,m,g,k;const C=e.$$slots.default,E=l(C,e,null);return{c(){var t,n,r,c;o=x("div"),i=x("div"),E||(s=S(e.text)),E&&E.c(),a=_(),$=x("button"),p=S("×"),N(i,"class",e.getClass("content")+" svelte-1nm9ptj"),N($,"class",e.getClass("button")+" svelte-1nm9ptj"),N($,"aria-label","delete notification"),N(o,"class",e.getClass()+" svelte-1nm9ptj"),N(o,"role","status"),N(o,"aria-live","polite"),t=$,n="click",r=e.removeNotificationHandler,t.addEventListener(n,r,c),k=()=>t.removeEventListener(n,r,c)},l(t){E&&E.l(div0_nodes)},m(t,n){w(t,o,n),v(o,i),E?E.m(i,null):v(i,s),v(o,a),v(o,$),v($,p),g=!0},p(t,n){E&&E.p&&t.$$scope&&E.p(f(C,n,t,null),u(C,n,null))},i(e){g||(W(E,e),H(()=>{m&&m.end(1),h||(h=function(e,o,i){let r,s,l=o(e,i),u=!1,f=0;function a(){r&&O(e,r)}function $(){const{delay:o=0,duration:i=300,easing:c=n,tick:$=t,css:p}=l||Y;p&&(r=A(e,0,1,i,o,c,p,f++)),$(0,1);const h=d()+o,m=h+i;s&&s.abort(),u=!0,H(()=>J(e,!0,"start")),s=y(t=>{if(u){if(t>=m)return $(1,0),J(e,!0,"end"),a(),u=!1;if(t>=h){const n=c((t-h)/i);$(n,1-n)}}return u})}let p=!1;return{start(){p||(O(e),c(l)?(l=l(),I().then($)):$())},invalidate(){p=!1},end(){u&&(a(),u=!1)}}}(o,rt,{})),h.start()}),g=!0)},o(e){X(E,e),h&&h.invalidate(),m=function(e,o,i){let s,l=o(e,i),u=!0;const f=Q;function a(){const{delay:o=0,duration:i=300,easing:c=n,tick:a=t,css:$}=l||Y;$&&(s=A(e,1,0,i,o,c,$));const p=d()+o,h=p+i;H(()=>J(e,!1,"start")),y(t=>{if(u){if(t>=h)return a(0,1),J(e,!1,"end"),--f.r||r(f.c),!1;if(t>=p){const n=c((t-p)/i);a(1-n,n)}}return u})}return f.r+=1,c(l)?I().then(()=>{l=l(),a()}):a(),{end(t){t&&l.tick&&l.tick(1,0),u&&(s&&O(e,s),u=!1)}}}(o,rt,{}),g=!1},d(t){t&&b(o),E&&E.d(t),t&&m&&m.end(),k()}}}function ut(t,n,e){let{notification:o={},withoutStyles:i=!1}=n;const{removeNotification:r}=st(),{id:c,text:s,removeAfter:l}=o,u=()=>r(c);let f=null;var a;l&&(f=setTimeout(u,l)),a=()=>{l&&f&&clearTimeout(f)},R().$$.on_destroy.push(a);let{$$slots:d={},$$scope:$}=n;return t.$set=t=>{"notification"in t&&e("notification",o=t.notification),"withoutStyles"in t&&e("withoutStyles",i=t.withoutStyles),"$$scope"in t&&e("$$scope",$=t.$$scope)},{notification:o,withoutStyles:i,text:s,getClass:t=>{const n=t?`-${t}`:"";return`notification${n}${i?"":` default-notification-style${n}`}`},removeNotificationHandler:u,$$slots:d,$$scope:$}}class ft extends it{constructor(t){super(),ot(this,t,ut,lt,s,["notification","withoutStyles"])}}const at=[];const dt=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"],$t=(t,n)=>{if(!(t=>!(!t||!t.text)&&("string"==typeof t.text&&!!dt.includes(t.position)))(t))throw new Error("Notification object is not valid");const{id:e=(new Date).getTime(),removeAfter:o=+t.removeAfter,...i}=t;n(t=>[...t,{id:e,removeAfter:o,...i}])};var pt=(()=>{const{subscribe:n,set:e,update:o}=function(n,e=t){let o;const i=[];function r(t){if(s(n,t)&&(n=t,o)){const t=!at.length;for(let t=0;t{const t=i.indexOf(l);-1!==t&&i.splice(t,1),0===i.length&&(o(),o=null)}}}}([]);return{subscribe:n,addNotification:t=>$t(t,o),removeNotification:t=>((t,n)=>n(n=>n.filter(n=>n.id!==t)))(t,o),clearNotifications:()=>(t=>t([]))(e)}})();function ht(t,n,e){const o=Object.create(t);return o.notification=n[e],o}function mt(t,n,e){const o=Object.create(t);return o.position=n[e],o}function gt(t){var n,e,o,i,r=[vt,yt],c=[];function s(t,n){return n.item?0:1}return n=s(0,t),e=c[n]=r[n](t),{c(){e.c(),o=k()},m(t,e){c[n].m(t,e),w(t,o,e),i=!0},p(t,i){var l=n;(n=s(0,i))===l?c[n].p(t,i):(U(),X(c[l],1,1,()=>{c[l]=null}),V(),(e=c[n])||(e=c[n]=r[n](i)).c(),W(e,1),e.m(o.parentNode,o))},i(t){i||(W(e),i=!0)},o(t){X(e),i=!1},d(t){c[n].d(t),t&&b(o)}}}function yt(t){var n,e=new ft({props:{notification:t.notification,withoutStyles:t.withoutStyles}});return{c(){e.$$.fragment.c()},m(t,o){tt(e,t,o),n=!0},p(t,n){var o={};t.$store&&(o.notification=n.notification),t.withoutStyles&&(o.withoutStyles=n.withoutStyles),e.$set(o)},i(t){n||(W(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function vt(t){var n,e,o=t.item;function i(t){return{props:{notification:t.notification}}}if(o)var r=new o(i(t));return{c(){r&&r.$$.fragment.c(),n=k()},m(t,o){r&&tt(r,t,o),w(t,n,o),e=!0},p(t,e){var c={};if(t.$store&&(c.notification=e.notification),o!==(o=e.item)){if(r){U();const t=r;X(t.$$.fragment,1,0,()=>{nt(t,1)}),V()}o?((r=new o(i(e))).$$.fragment.c(),W(r.$$.fragment,1),tt(r,n.parentNode,n)):r=null}else o&&r.$set(c)},i(t){e||(r&&W(r.$$.fragment,t),e=!0)},o(t){r&&X(r.$$.fragment,t),e=!1},d(t){t&&b(n),r&&nt(r,t)}}}function wt(t,n){var e,o,i,r=n.notification.position===n.position&>(n);return{key:t,first:null,c(){e=k(),r&&r.c(),o=k(),this.first=e},m(t,n){w(t,e,n),r&&r.m(t,n),w(t,o,n),i=!0},p(t,n){n.notification.position===n.position?r?(r.p(t,n),W(r,1)):((r=gt(n)).c(),W(r,1),r.m(o.parentNode,o)):r&&(U(),X(r,1,1,()=>{r=null}),V())},i(t){i||(W(r),i=!0)},o(t){X(r),i=!1},d(t){t&&b(e),r&&r.d(t),t&&b(o)}}}function bt(t){var n,e,o,i,r=[],c=new Map;let s=t.$store;const l=t=>t.notification.id;for(let n=0;ny.get(i)?(w.add(o),b(n)):(v.add(i),d--):(l(e,c),d--)}for(;d--;){const n=t[d];g.has(n.key)||l(n,c)}for(;$;)b(m[$-1]);return m}(r,t,l,1,n,o,c,e,Z,wt,null,ht),V()},i(t){if(!i){for(let t=0;tX(s[t],1,1,()=>{s[t]=null});return{c(){r&&r.c(),n=_(),e=x("div");for(let t=0;te.unsubscribe():e}(n,e))}(t,pt,t=>{e("$store",o=t)});let{item:i=null,withoutStyles:r=!1}=n;!function(t,n){R().$$.context.set(t,n)}(ct,pt);let{$$slots:c={},$$scope:s}=n;return t.$set=t=>{"item"in t&&e("item",i=t.item),"withoutStyles"in t&&e("withoutStyles",r=t.withoutStyles),"$$scope"in t&&e("$$scope",s=t.$$scope)},{item:i,withoutStyles:r,getClass:(t="")=>{return`position-${t}${r?"":` default-position-style-${t}`}`},$store:o,$$slots:c,$$scope:s}}export default class extends it{constructor(t){super(),ot(this,t,St,xt,s,["item","withoutStyles"])}}export{st as getNotificationsContext}; diff --git a/src/components/Notifications.svelte b/src/components/Notifications.svelte index 331af00..5f23708 100644 --- a/src/components/Notifications.svelte +++ b/src/components/Notifications.svelte @@ -61,8 +61,6 @@ }; setContext(context, store); - - $: console.log(item);