Comparing version 0.9.0 to 0.10.0
@@ -178,3 +178,4 @@ // node_modules/transitions-all-settled/lib/set-stack.js | ||
this.set("exit"); | ||
return this.setOnEnd("afterExit"); | ||
await this.setOnEnd("afterExit"); | ||
this.reset(); | ||
} | ||
@@ -181,0 +182,0 @@ set(state) { |
@@ -1,1 +0,1 @@ | ||
var o=class{constructor(){this.map=new Map}has(t,e){return this.map.has(t)?this.map.get(t).has(e):!1}push(t,e){this.map.has(t)?this.map.get(t).add(e):this.map.set(t,new Set([e]))}pop(t,e){let r=this.map.get(t);r&&(r.delete(e),r.size===0&&this.map.delete(t))}get empty(){return this.map.size===0}};var a=class{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}};function d(s){let t=!0,e=new o,r=new a;function n(){e.empty&&(v(),r.resolve(t))}function x(i){e.push(i.target,i.propertyName)}function g(i){e.has(i.target,i.propertyName)&&(e.pop(i.target,i.propertyName),n())}function E(i){e.has(i.target,i.propertyName)&&(t=!1,e.pop(i.target,i.propertyName),n())}function v(){s.removeEventListener("transitionrun",x),s.removeEventListener("transitionend",g),s.removeEventListener("transitioncancel",E)}return s.addEventListener("transitionrun",x),s.addEventListener("transitionend",g),s.addEventListener("transitioncancel",E),r.promise}var f=class{constructor(t){this.prefix=t}get beforeEnter(){return this.prefix+"--before-enter"}get enter(){return this.prefix+"--enter"}get afterEnter(){return this.prefix+"--after-enter"}get beforeExit(){return this.prefix+"--before-exit"}get exit(){return this.prefix+"--exit"}get afterExit(){return this.prefix+"--after-exit"}get all(){return[this.beforeEnter,this.enter,this.afterEnter,this.beforeExit,this.exit,this.afterExit]}};var c=class{constructor(t,e,r){this.el=t,this.effect=e,this.group=r,this.classes=new f(this.effect)}set(t){this.className(t)}reset(){this.el.classList.remove(...this.classes.all,this.effect)}async setOnEnd(t){await d(this.el)&&this.set(t)}get isEntering(){return this.el.classList.contains(this.classes.enter)}get isExiting(){return this.el.classList.contains(this.classes.exit)}className(t){this.el.classList.remove(...this.classes.all),this.el.classList.add(this.classes[t],this.effect)}};function l(){return new Promise(s=>requestAnimationFrame(s))}function w(s,t){return u(s).includes(t)}function u(s){return s.trim().split(/\s+/)}var h=class{constructor(t){this.elements=t}async enter(){if(!this.isEntering)return this.isExiting||this.set("beforeEnter"),await l(),this.set("enter"),this.setOnEnd("afterEnter")}async exit(){if(!this.isExiting)return this.isEntering||this.set("beforeExit"),await l(),this.set("exit"),this.setOnEnd("afterExit")}set(t){this.elements.map(e=>e.set(t))}reset(){this.elements.map(t=>t.reset())}setOnEnd(t){return Promise.allSettled(this.elements.map(e=>e.setOnEnd(t)))}get isExiting(){return this.elements.some(t=>t.isExiting)}get isEntering(){return this.elements.some(t=>t.isEntering)}};function m(...s){let t=[],e=L(s);for(let r of e)for(let n of r.effects)t.push(new c(r.node,n,r.name));return new h(t)}function L(s){let t=[];for(let e of s)if(typeof e=="string")for(let r of b(e))w(r.dataset.debutTarget,e)&&t.push(new p(r,e));else t.push(new p(e));return t}function b(s){return document.querySelectorAll(y(s))}function y(s){return`[data-debut-target*="${s}"]`}var p=class{static fromString(){}constructor(t,e){this.node=t,this.name=e,this.effects=u(t.dataset.debut)}};function G(...s){return m(...s).enter()}function H(...s){return m(...s).exit()}export{G as enter,H as exit,m as target}; | ||
var o=class{constructor(){this.map=new Map}has(t,e){return this.map.has(t)?this.map.get(t).has(e):!1}push(t,e){this.map.has(t)?this.map.get(t).add(e):this.map.set(t,new Set([e]))}pop(t,e){let r=this.map.get(t);r&&(r.delete(e),r.size===0&&this.map.delete(t))}get empty(){return this.map.size===0}};var a=class{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}};function d(s){let t=!0,e=new o,r=new a;function n(){e.empty&&(v(),r.resolve(t))}function x(i){e.push(i.target,i.propertyName)}function g(i){e.has(i.target,i.propertyName)&&(e.pop(i.target,i.propertyName),n())}function E(i){e.has(i.target,i.propertyName)&&(t=!1,e.pop(i.target,i.propertyName),n())}function v(){s.removeEventListener("transitionrun",x),s.removeEventListener("transitionend",g),s.removeEventListener("transitioncancel",E)}return s.addEventListener("transitionrun",x),s.addEventListener("transitionend",g),s.addEventListener("transitioncancel",E),r.promise}var f=class{constructor(t){this.prefix=t}get beforeEnter(){return this.prefix+"--before-enter"}get enter(){return this.prefix+"--enter"}get afterEnter(){return this.prefix+"--after-enter"}get beforeExit(){return this.prefix+"--before-exit"}get exit(){return this.prefix+"--exit"}get afterExit(){return this.prefix+"--after-exit"}get all(){return[this.beforeEnter,this.enter,this.afterEnter,this.beforeExit,this.exit,this.afterExit]}};var c=class{constructor(t,e,r){this.el=t,this.effect=e,this.group=r,this.classes=new f(this.effect)}set(t){this.className(t)}reset(){this.el.classList.remove(...this.classes.all,this.effect)}async setOnEnd(t){await d(this.el)&&this.set(t)}get isEntering(){return this.el.classList.contains(this.classes.enter)}get isExiting(){return this.el.classList.contains(this.classes.exit)}className(t){this.el.classList.remove(...this.classes.all),this.el.classList.add(this.classes[t],this.effect)}};function l(){return new Promise(s=>requestAnimationFrame(s))}function w(s,t){return m(s).includes(t)}function m(s){return s.trim().split(/\s+/)}var h=class{constructor(t){this.elements=t}async enter(){if(!this.isEntering)return this.isExiting||this.set("beforeEnter"),await l(),this.set("enter"),this.setOnEnd("afterEnter")}async exit(){this.isExiting||(this.isEntering||this.set("beforeExit"),await l(),this.set("exit"),await this.setOnEnd("afterExit"),this.reset())}set(t){this.elements.map(e=>e.set(t))}reset(){this.elements.map(t=>t.reset())}setOnEnd(t){return Promise.allSettled(this.elements.map(e=>e.setOnEnd(t)))}get isExiting(){return this.elements.some(t=>t.isExiting)}get isEntering(){return this.elements.some(t=>t.isEntering)}};function u(...s){let t=[],e=L(s);for(let r of e)for(let n of r.effects)t.push(new c(r.node,n,r.name));return new h(t)}function L(s){let t=[];for(let e of s)if(typeof e=="string")for(let r of b(e))w(r.dataset.debutTarget,e)&&t.push(new p(r,e));else t.push(new p(e));return t}function b(s){return document.querySelectorAll(y(s))}function y(s){return`[data-debut-target*="${s}"]`}var p=class{static fromString(){}constructor(t,e){this.node=t,this.name=e,this.effects=m(t.dataset.debut)}};function G(...s){return u(...s).enter()}function H(...s){return u(...s).exit()}export{G as enter,H as exit,u as target}; |
{ | ||
"name": "debut-css", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "James Kerr <kerr@hey.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12114
258