@ssgoi/core 2.1.2 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +10 -11
  2. package/dist/animator.d.ts.map +1 -1
  3. package/dist/create-ssgoi-transition-context.d.ts.map +1 -1
  4. package/dist/create-transition-callback.d.ts.map +1 -1
  5. package/dist/index.cjs +2 -1
  6. package/dist/index.js +326 -212
  7. package/dist/transition-strategy.d.ts +5 -0
  8. package/dist/transition-strategy.d.ts.map +1 -1
  9. package/dist/transition.d.ts.map +1 -1
  10. package/dist/transitions/blur.d.ts.map +1 -1
  11. package/dist/transitions/bounce.d.ts +1 -1
  12. package/dist/transitions/bounce.d.ts.map +1 -1
  13. package/dist/transitions/fly.d.ts.map +1 -1
  14. package/dist/transitions/index.cjs +1 -1
  15. package/dist/transitions/index.d.ts +1 -0
  16. package/dist/transitions/index.d.ts.map +1 -1
  17. package/dist/transitions/index.js +199 -142
  18. package/dist/transitions/mask.d.ts +31 -0
  19. package/dist/transitions/mask.d.ts.map +1 -0
  20. package/dist/transitions/none.d.ts +4 -4
  21. package/dist/transitions/none.d.ts.map +1 -1
  22. package/dist/transitions/rotate.d.ts +1 -1
  23. package/dist/transitions/scale.d.ts +1 -1
  24. package/dist/transitions/slide.d.ts +2 -2
  25. package/dist/transitions/slide.d.ts.map +1 -1
  26. package/dist/types.d.ts +31 -0
  27. package/dist/types.d.ts.map +1 -1
  28. package/dist/utils/get-positioned-parent.d.ts +7 -0
  29. package/dist/utils/get-positioned-parent.d.ts.map +1 -0
  30. package/dist/utils/get-rect.d.ts +7 -0
  31. package/dist/utils/get-rect.d.ts.map +1 -0
  32. package/dist/utils/get-scrolling-element.d.ts +6 -0
  33. package/dist/utils/get-scrolling-element.d.ts.map +1 -0
  34. package/dist/utils/index.d.ts +7 -0
  35. package/dist/utils/index.d.ts.map +1 -0
  36. package/dist/utils/parse-caller-location.d.ts +6 -0
  37. package/dist/utils/parse-caller-location.d.ts.map +1 -0
  38. package/dist/utils/prepare-outgoing.d.ts +6 -0
  39. package/dist/utils/prepare-outgoing.d.ts.map +1 -0
  40. package/dist/utils/sleep.d.ts +7 -0
  41. package/dist/utils/sleep.d.ts.map +1 -0
  42. package/dist/utils.d.ts.map +1 -1
  43. package/dist/view-transitions/blind.d.ts +13 -0
  44. package/dist/view-transitions/blind.d.ts.map +1 -0
  45. package/dist/view-transitions/fade.d.ts.map +1 -1
  46. package/dist/view-transitions/film.d.ts +8 -0
  47. package/dist/view-transitions/film.d.ts.map +1 -0
  48. package/dist/view-transitions/hero.d.ts.map +1 -1
  49. package/dist/view-transitions/index.cjs +35 -1
  50. package/dist/view-transitions/index.d.ts +3 -0
  51. package/dist/view-transitions/index.d.ts.map +1 -1
  52. package/dist/view-transitions/index.js +448 -202
  53. package/dist/view-transitions/pinterest.d.ts.map +1 -1
  54. package/dist/view-transitions/slide.d.ts +8 -0
  55. package/dist/view-transitions/slide.d.ts.map +1 -0
  56. package/package.json +15 -8
  57. package/dist/utils-8Eptbv7c.cjs +0 -2
  58. package/dist/utils-DTRMUQW4.js +0 -31
  59. package/dist/view-transitions/ripple.d.ts +0 -7
  60. package/dist/view-transitions/ripple.d.ts.map +0 -1
@@ -57,4 +57,9 @@ export interface TransitionStrategy<TAnimationValue = number> {
57
57
  * - Cleanup callback: Handles exit transitions
58
58
  */
59
59
  export declare const createDefaultStrategy: <TAnimationValue = number>(context: StrategyContext<TAnimationValue>) => TransitionStrategy<TAnimationValue>;
60
+ /**
61
+ * Page transition strategy - Always starts fresh without checking current animations
62
+ * This is used for page-level transitions where each transition should be independent
63
+ */
64
+ export declare const createPageTransitionStrategy: <TAnimationValue = number>() => TransitionStrategy<TAnimationValue>;
60
65
  //# sourceMappingURL=transition-strategy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transition-strategy.d.ts","sourceRoot":"","sources":["../src/lib/transition-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,mBAAmB,eAAoC,CAAC;AAErE,MAAM,WAAW,eAAe,CAAC,eAAe,GAAG,MAAM;IAEvD,gBAAgB,EAAE;QAChB,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;QACpC,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;KACzB,GAAG,IAAI,CAAC;CACV;AAED,MAAM,WAAW,cAAc,CAAC,eAAe,GAAG,MAAM;IACtD,MAAM,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC3C,KAAK,EAAE;QACL,QAAQ,EAAE,eAAe,CAAC;QAC1B,QAAQ,EAAE,eAAe,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC5E,CAAC;IACF,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB,CAAC,eAAe,GAAG,MAAM;IACzD,EAAE,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;IAChD,GAAG,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,kBAAkB,CAAC,eAAe,GAAG,MAAM;IAC1D,KAAK,EAAE,CACL,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,KACxC,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IAC9C,MAAM,EAAE,CACN,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,KACxC,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,eAAO,MAAM,qBAAqB,GAAI,eAAe,GAAG,MAAM,EAC5D,SAAS,eAAe,CAAC,eAAe,CAAC,KACxC,kBAAkB,CAAC,eAAe,CA0HpC,CAAC"}
1
+ {"version":3,"file":"transition-strategy.d.ts","sourceRoot":"","sources":["../src/lib/transition-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,mBAAmB,eAAoC,CAAC;AAErE,MAAM,WAAW,eAAe,CAAC,eAAe,GAAG,MAAM;IAEvD,gBAAgB,EAAE;QAChB,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;QACpC,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;KACzB,GAAG,IAAI,CAAC;CACV;AAED,MAAM,WAAW,cAAc,CAAC,eAAe,GAAG,MAAM;IACtD,MAAM,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC3C,KAAK,EAAE;QACL,QAAQ,EAAE,eAAe,CAAC;QAC1B,QAAQ,EAAE,eAAe,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC5E,CAAC;IACF,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB,CAAC,eAAe,GAAG,MAAM;IACzD,EAAE,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;IAChD,GAAG,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,kBAAkB,CAAC,eAAe,GAAG,MAAM;IAC1D,KAAK,EAAE,CACL,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,KACxC,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IAC9C,MAAM,EAAE,CACN,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,KACxC,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,eAAO,MAAM,qBAAqB,GAAI,eAAe,GAAG,MAAM,EAC5D,SAAS,eAAe,CAAC,eAAe,CAAC,KACxC,kBAAkB,CAAC,eAAe,CA0HpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GACvC,eAAe,GAAG,MAAM,OACrB,kBAAkB,CAAC,eAAe,CAkEtC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../src/lib/transition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,KAAK,EAAc,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA+D7C,wBAAgB,eAAe,IAAI,aAAa,CAY/C;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,UAAU,CAAC,eAAe,GAAG,MAAM,EACjD,OAAO,EAAE,iBAAiB,CAAC,SAAS,EAAE,eAAe,CAAC,GAAG;IACvD,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,KAAK,kBAAkB,CAAC,eAAe,CAAC,CAAC;CAC5G,GACA,kBAAkB,CAmBpB"}
1
+ {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../src/lib/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEV,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAgE7C,wBAAgB,eAAe,IAAI,aAAa,CAY/C;AAkBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,UAAU,CAAC,eAAe,GAAG,MAAM,EACjD,OAAO,EAAE,iBAAiB,CAAC,SAAS,EAAE,eAAe,CAAC,GAAG;IACvD,CAAC,mBAAmB,CAAC,CAAC,EAAE,CACtB,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,KACtC,kBAAkB,CAAC,eAAe,CAAC,CAAC;CAC1C,GACA,kBAAkB,CAoBpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB;;kBAe5B,WAAW;;wBArBb,MAAM;sBACR,MAAM;;yBAsBG,MAAM;;mBAmBV,WAAW;;wBA1Cd,MAAM;sBACR,MAAM;;yBA2CG,MAAM;;CAqB5B,CAAC"}
1
+ {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB;;kBAe5B,WAAW;;wBArBb,MAAM;sBACR,MAAM;;yBAsBG,MAAM;;mBAwBV,WAAW;;wBA/Cd,MAAM;sBACR,MAAM;;yBAgDG,MAAM;;CA0B5B,CAAC"}
@@ -4,7 +4,7 @@ interface BounceOptions {
4
4
  intensity?: number;
5
5
  scale?: boolean;
6
6
  fade?: boolean;
7
- direction?: 'up' | 'down';
7
+ direction?: "up" | "down";
8
8
  spring?: {
9
9
  stiffness?: number;
10
10
  damping?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"bounce.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/bounce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB;;kBAYhC,WAAW;;wBAlBb,MAAM;sBACR,MAAM;;yBAmBG,MAAM;;mBA0BV,WAAW;;wBA9Cd,MAAM;sBACR,MAAM;;yBA+CG,MAAM;;CA4B5B,CAAC"}
1
+ {"version":3,"file":"bounce.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/bounce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB;;kBAYhC,WAAW;;wBAlBb,MAAM;sBACR,MAAM;;yBAmBG,MAAM;;mBA2BV,WAAW;;wBA/Cd,MAAM;sBACR,MAAM;;yBAgDG,MAAM;;CA6B5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"fly.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,UAAU;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,GAAG,GAAI,UAAS,UAAe;;kBAkB1B,WAAW;;wBAxBb,MAAM;sBACR,MAAM;;yBAyBG,MAAM;;mBAQV,WAAW;;wBAlCd,MAAM;sBACR,MAAM;;yBAmCG,MAAM;;CAU5B,CAAC"}
1
+ {"version":3,"file":"fly.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,UAAU;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,GAAG,GAAI,UAAS,UAAe;;kBAkB1B,WAAW;;wBAxBb,MAAM;sBACR,MAAM;;yBAyBG,MAAM;;mBAcV,WAAW;;wBAxCd,MAAM;sBACR,MAAM;;yBAyCG,MAAM;;CAgB5B,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=($={})=>{const{from:n=0,to:s=1,spring:r={stiffness:300,damping:30},key:u}=$;return{in:l=>({spring:r,tick:y=>{const c=n+(s-n)*y;l.style.opacity=c.toString()}}),out:l=>({spring:r,tick:y=>{const c=n+(s-n)*y;l.style.opacity=c.toString()}}),...u&&{key:u}}},m=($={})=>{const{start:n=0,opacity:s=0,axis:r="both",spring:u={stiffness:300,damping:30},key:l}=$,y=c=>{switch(r){case"x":return`scaleX(${c})`;case"y":return`scaleY(${c})`;case"both":default:return`scale(${c})`}};return{in:c=>({spring:u,tick:t=>{const e=n+(1-n)*t;c.style.transform=y(e),c.style.opacity=(s+(1-s)*t).toString()}}),out:c=>({spring:u,tick:t=>{const e=n+(1-n)*t;c.style.transform=y(e),c.style.opacity=(s+(1-s)*t).toString()}}),...l&&{key:l}}},d=($={})=>{const{direction:n,distance:s=100,opacity:r=0,fade:u=!0,axis:l,spring:y={stiffness:400,damping:35},key:c}=$,e=n||(l==="x"?"left":l==="y"?"up":"left"),o=a=>typeof a=="number"?`${a}px`:a,f=a=>{const i=1-a,p=typeof s=="number"?i*s:`calc(${o(s)} * ${i})`;switch(e){case"left":return typeof s=="number"?`translateX(${-p}px)`:`translateX(calc(-1 * ${p}))`;case"right":return typeof s=="number"?`translateX(${p}px)`:`translateX(${p})`;case"up":return typeof s=="number"?`translateY(${-p}px)`:`translateY(calc(-1 * ${p}))`;case"down":return typeof s=="number"?`translateY(${p}px)`:`translateY(${p})`}};return{in:a=>({spring:y,tick:i=>{a.style.transform=f(i),u&&(a.style.opacity=(r+(1-r)*i).toString())}}),out:a=>({spring:y,tick:i=>{a.style.transform=f(i),u&&(a.style.opacity=(r+(1-r)*i).toString())}}),...c&&{key:c}}},g=($={})=>{const{degrees:n=360,clockwise:s=!0,scale:r=!1,fade:u=!0,origin:l="center",axis:y="2d",perspective:c=800,spring:t={stiffness:500,damping:25},key:e}=$,o=s?n:-n,f=a=>{const i=(1-a)*o;switch(y){case"x":return`perspective(${c}px) rotateX(${i}deg)`;case"y":return`perspective(${c}px) rotateY(${i}deg)`;case"z":return`rotateZ(${i}deg)`;case"2d":default:return`rotate(${i}deg)`}};return{in:a=>({spring:t,tick:i=>{const p=[f(i)];r&&p.push(`scale(${i})`),a.style.transform=p.join(" "),a.style.transformOrigin=l,u&&(a.style.opacity=i.toString())}}),out:a=>({spring:t,tick:i=>{const p=[f(i)];r&&p.push(`scale(${i})`),a.style.transform=p.join(" "),a.style.transformOrigin=l,u&&(a.style.opacity=i.toString())}}),...e&&{key:e}}},x=($={})=>{const{height:n=20,intensity:s=1,scale:r=!0,fade:u=!0,direction:l="up",spring:y={stiffness:800,damping:15},key:c}=$;return{in:t=>({spring:y,tick:e=>{const o=[],f=Math.sin(e*Math.PI*(1+s)),a=1-e,i=f*n*a;if(l==="up"?o.push(`translateY(${-Math.abs(i)}px)`):o.push(`translateY(${Math.abs(i)}px)`),r){const p=.8+e*.2+f*.05*a;o.push(`scale(${p})`)}t.style.transform=o.join(" "),u&&(t.style.opacity=e.toString())}}),out:t=>({spring:y,tick:e=>{const o=[],f=Math.sin(e*Math.PI*(1+s)),a=1-e,i=f*n*a;if(l==="up"?o.push(`translateY(${-Math.abs(i)}px)`):o.push(`translateY(${Math.abs(i)}px)`),r){const p=.8+e*.2+f*.05*a;o.push(`scale(${p})`)}t.style.transform=o.join(" "),u&&(t.style.opacity=e.toString())}}),...c&&{key:c}}},k=($={})=>{const{amount:n=10,opacity:s=0,scale:r=!1,fade:u=!0,spring:l={stiffness:300,damping:30},key:y}=$,c=t=>typeof t=="number"?`${t}px`:t;return{in:t=>({spring:l,tick:e=>{const o=1-e,f=typeof n=="number"?o*n:`calc(${c(n)} * ${o})`;t.style.filter=typeof n=="number"?`blur(${f}px)`:`blur(${f})`,r&&(t.style.transform=`scale(${.8+e*.2})`),u&&(t.style.opacity=(s+(1-s)*e).toString())}}),out:t=>({spring:l,tick:e=>{const o=1-e,f=typeof n=="number"?o*n:`calc(${c(n)} * ${o})`;t.style.filter=typeof n=="number"?`blur(${f}px)`:`blur(${f})`,r&&(t.style.transform=`scale(${.8+e*.2})`),u&&(t.style.opacity=(s+(1-s)*e).toString())}}),...y&&{key:y}}},h=($={})=>{const{x:n=0,y:s=-100,opacity:r=0,spring:u={stiffness:400,damping:35},key:l}=$,y=t=>typeof t=="number"?`${t}px`:t,c=t=>typeof t=="number"?`${t}px`:t;return{in:t=>({spring:u,tick:e=>{const o=typeof n=="number"?(1-e)*n:`calc(${y(n)} * ${1-e})`,f=typeof s=="number"?(1-e)*s:`calc(${c(s)} * ${1-e})`;t.style.transform=`translate(${typeof n=="number"?o+"px":o}, ${typeof s=="number"?f+"px":f})`,t.style.opacity=(r+(1-r)*e).toString()}}),out:t=>({spring:u,tick:e=>{const o=typeof n=="number"?(1-e)*n:`calc(${y(n)} * ${1-e})`,f=typeof s=="number"?(1-e)*s:`calc(${c(s)} * ${1-e})`;t.style.transform=`translate(${typeof n=="number"?o+"px":o}, ${typeof s=="number"?f+"px":f})`,t.style.opacity=(r+(1-r)*e).toString()}}),...l&&{key:l}}},S=($={})=>{const{spring:n={stiffness:1e3,damping:100},key:s}=$;return{in:r=>({spring:n,tick:u=>{}}),out:r=>({spring:n,tick:u=>{}}),...s&&{key:s}}};exports.blur=k;exports.bounce=x;exports.fade=b;exports.fly=h;exports.none=S;exports.rotate=g;exports.scale=m;exports.slide=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=($={})=>{const{from:e=0,to:s=1,spring:f={stiffness:300,damping:30},key:l}=$;return{in:u=>({spring:f,tick:y=>{const a=e+(s-e)*y;u.style.opacity=a.toString()}}),out:u=>({spring:f,tick:y=>{const a=e+(s-e)*y;u.style.opacity=a.toString()}}),...l&&{key:l}}},h=($={})=>{const{start:e=0,opacity:s=0,axis:f="both",spring:l={stiffness:300,damping:30},key:u}=$,y=a=>{switch(f){case"x":return`scaleX(${a})`;case"y":return`scaleY(${a})`;case"both":default:return`scale(${a})`}};return{in:a=>({spring:l,tick:n=>{const t=e+(1-e)*n;a.style.transform=y(t),a.style.opacity=(s+(1-s)*n).toString()}}),out:a=>({spring:l,tick:n=>{const t=e+(1-e)*n;a.style.transform=y(t),a.style.opacity=(s+(1-s)*n).toString()}}),...u&&{key:u}}},x=($={})=>{const{direction:e,distance:s=100,opacity:f=0,fade:l=!0,axis:u,spring:y={stiffness:400,damping:35},key:a}=$,t=e||(u==="x"?"left":u==="y"?"up":"left"),c=i=>typeof i=="number"?`${i}px`:i,o=i=>{const r=1-i,p=typeof s=="number"?r*s:`calc(${c(s)} * ${r})`;switch(t){case"left":return typeof s=="number"?`translateX(${-p}px)`:`translateX(calc(-1 * ${p}))`;case"right":return typeof s=="number"?`translateX(${p}px)`:`translateX(${p})`;case"up":return typeof s=="number"?`translateY(${-p}px)`:`translateY(calc(-1 * ${p}))`;case"down":return typeof s=="number"?`translateY(${p}px)`:`translateY(${p})`}};return{in:i=>({spring:y,tick:r=>{i.style.transform=o(r),l&&(i.style.opacity=(f+(1-f)*r).toString())}}),out:i=>({spring:y,tick:r=>{i.style.transform=o(r),l&&(i.style.opacity=(f+(1-f)*r).toString())}}),...a&&{key:a}}},k=($={})=>{const{degrees:e=360,clockwise:s=!0,scale:f=!1,fade:l=!0,origin:u="center",axis:y="2d",perspective:a=800,spring:n={stiffness:500,damping:25},key:t}=$,c=s?e:-e,o=i=>{const r=(1-i)*c;switch(y){case"x":return`perspective(${a}px) rotateX(${r}deg)`;case"y":return`perspective(${a}px) rotateY(${r}deg)`;case"z":return`rotateZ(${r}deg)`;case"2d":default:return`rotate(${r}deg)`}};return{in:i=>({spring:n,tick:r=>{const p=[o(r)];f&&p.push(`scale(${r})`),i.style.transform=p.join(" "),i.style.transformOrigin=u,l&&(i.style.opacity=r.toString())}}),out:i=>({spring:n,tick:r=>{const p=[o(r)];f&&p.push(`scale(${r})`),i.style.transform=p.join(" "),i.style.transformOrigin=u,l&&(i.style.opacity=r.toString())}}),...t&&{key:t}}},S=($={})=>{const{height:e=20,intensity:s=1,scale:f=!0,fade:l=!0,direction:u="up",spring:y={stiffness:800,damping:15},key:a}=$;return{in:n=>({spring:y,tick:t=>{const c=[],o=Math.sin(t*Math.PI*(1+s)),i=1-t,r=o*e*i;if(u==="up"?c.push(`translateY(${-Math.abs(r)}px)`):c.push(`translateY(${Math.abs(r)}px)`),f){const p=.8+t*.2+o*.05*i;c.push(`scale(${p})`)}n.style.transform=c.join(" "),l&&(n.style.opacity=t.toString())}}),out:n=>({spring:y,tick:t=>{const c=[],o=Math.sin(t*Math.PI*(1+s)),i=1-t,r=o*e*i;if(u==="up"?c.push(`translateY(${-Math.abs(r)}px)`):c.push(`translateY(${Math.abs(r)}px)`),f){const p=.8+t*.2+o*.05*i;c.push(`scale(${p})`)}n.style.transform=c.join(" "),l&&(n.style.opacity=t.toString())}}),...a&&{key:a}}},M=($={})=>{const{amount:e=10,opacity:s=0,scale:f=!1,fade:l=!0,spring:u={stiffness:300,damping:30},key:y}=$,a=n=>typeof n=="number"?`${n}px`:n;return{in:n=>({spring:u,tick:t=>{const c=1-t,o=typeof e=="number"?c*e:`calc(${a(e)} * ${c})`;n.style.filter=typeof e=="number"?`blur(${o}px)`:`blur(${o})`,f&&(n.style.transform=`scale(${.8+t*.2})`),l&&(n.style.opacity=(s+(1-s)*t).toString())}}),out:n=>({spring:u,tick:t=>{const c=1-t,o=typeof e=="number"?c*e:`calc(${a(e)} * ${c})`;n.style.filter=typeof e=="number"?`blur(${o}px)`:`blur(${o})`,f&&(n.style.transform=`scale(${.8+t*.2})`),l&&(n.style.opacity=(s+(1-s)*t).toString())}}),...y&&{key:y}}},Y=($={})=>{const{x:e=0,y:s=-100,opacity:f=0,spring:l={stiffness:400,damping:35},key:u}=$,y=n=>typeof n=="number"?`${n}px`:n,a=n=>typeof n=="number"?`${n}px`:n;return{in:n=>({spring:l,tick:t=>{const c=typeof e=="number"?(1-t)*e:`calc(${y(e)} * ${1-t})`,o=typeof s=="number"?(1-t)*s:`calc(${a(s)} * ${1-t})`;n.style.transform=`translate(${typeof e=="number"?c+"px":c}, ${typeof s=="number"?o+"px":o})`,n.style.opacity=(f+(1-f)*t).toString()}}),out:n=>({spring:l,tick:t=>{const c=typeof e=="number"?(1-t)*e:`calc(${y(e)} * ${1-t})`,o=typeof s=="number"?(1-t)*s:`calc(${a(s)} * ${1-t})`;n.style.transform=`translate(${typeof e=="number"?c+"px":c}, ${typeof s=="number"?o+"px":o})`,n.style.opacity=(f+(1-f)*t).toString()}}),...u&&{key:u}}},O=($={})=>{const{shape:e="circle",origin:s="center",scale:f=1.5,fade:l=!1,spring:u={stiffness:300,damping:30},key:y}=$,a=()=>{switch(s){case"top":return"50% 0%";case"bottom":return"50% 100%";case"left":return"0% 50%";case"right":return"100% 50%";case"top-left":return"0% 0%";case"top-right":return"100% 0%";case"bottom-left":return"0% 100%";case"bottom-right":return"100% 100%";case"center":default:return"50% 50%"}},n=t=>{const c=t*f*100,o=a();switch(e){case"ellipse":return`ellipse(${c}% ${c*.75}% at ${o})`;case"square":{const i=t*f*100,[r,p]=o.split(" "),m=parseFloat(r),d=parseFloat(p),b=i/2;return`polygon(${m-b}% ${d-b}%, ${m+b}% ${d-b}%, ${m+b}% ${d+b}%, ${m-b}% ${d+b}%)`}case"circle":default:return`circle(${c}% at ${o})`}};return{in:t=>({spring:u,tick:c=>{t.style.clipPath=n(c),l&&(t.style.opacity=c.toString())}}),out:t=>({spring:u,tick:c=>{t.style.clipPath=n(c),l&&(t.style.opacity=c.toString())}}),...y&&{key:y}}},V=($={})=>{const{spring:e={stiffness:1e3,damping:100},key:s}=$;return{in:()=>({spring:e,tick:()=>{}}),out:()=>({spring:e,tick:()=>{}}),...s&&{key:s}}};exports.blur=M;exports.bounce=S;exports.fade=g;exports.fly=Y;exports.mask=O;exports.none=V;exports.rotate=k;exports.scale=h;exports.slide=x;
@@ -5,5 +5,6 @@ export * from './rotate';
5
5
  export * from './bounce';
6
6
  export * from './blur';
7
7
  export * from './fly';
8
+ export * from './mask';
8
9
  export * from './none';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
@@ -1,74 +1,74 @@
1
- const m = ($ = {}) => {
1
+ const h = ($ = {}) => {
2
2
  const {
3
- from: n = 0,
3
+ from: e = 0,
4
4
  to: s = 1,
5
- spring: r = { stiffness: 300, damping: 30 },
6
- key: u
5
+ spring: f = { stiffness: 300, damping: 30 },
6
+ key: l
7
7
  } = $;
8
8
  return {
9
- in: (l) => ({
10
- spring: r,
9
+ in: (u) => ({
10
+ spring: f,
11
11
  tick: (y) => {
12
- const c = n + (s - n) * y;
13
- l.style.opacity = c.toString();
12
+ const a = e + (s - e) * y;
13
+ u.style.opacity = a.toString();
14
14
  }
15
15
  }),
16
- out: (l) => ({
17
- spring: r,
16
+ out: (u) => ({
17
+ spring: f,
18
18
  tick: (y) => {
19
- const c = n + (s - n) * y;
20
- l.style.opacity = c.toString();
19
+ const a = e + (s - e) * y;
20
+ u.style.opacity = a.toString();
21
21
  }
22
22
  }),
23
- ...u && { key: u }
23
+ ...l && { key: l }
24
24
  };
25
- }, b = ($ = {}) => {
25
+ }, d = ($ = {}) => {
26
26
  const {
27
- start: n = 0,
27
+ start: e = 0,
28
28
  opacity: s = 0,
29
- axis: r = "both",
30
- spring: u = { stiffness: 300, damping: 30 },
31
- key: l
32
- } = $, y = (c) => {
33
- switch (r) {
29
+ axis: f = "both",
30
+ spring: l = { stiffness: 300, damping: 30 },
31
+ key: u
32
+ } = $, y = (a) => {
33
+ switch (f) {
34
34
  case "x":
35
- return `scaleX(${c})`;
35
+ return `scaleX(${a})`;
36
36
  case "y":
37
- return `scaleY(${c})`;
37
+ return `scaleY(${a})`;
38
38
  case "both":
39
39
  default:
40
- return `scale(${c})`;
40
+ return `scale(${a})`;
41
41
  }
42
42
  };
43
43
  return {
44
- in: (c) => ({
45
- spring: u,
46
- tick: (t) => {
47
- const e = n + (1 - n) * t;
48
- c.style.transform = y(e), c.style.opacity = (s + (1 - s) * t).toString();
44
+ in: (a) => ({
45
+ spring: l,
46
+ tick: (n) => {
47
+ const t = e + (1 - e) * n;
48
+ a.style.transform = y(t), a.style.opacity = (s + (1 - s) * n).toString();
49
49
  }
50
50
  }),
51
- out: (c) => ({
52
- spring: u,
53
- tick: (t) => {
54
- const e = n + (1 - n) * t;
55
- c.style.transform = y(e), c.style.opacity = (s + (1 - s) * t).toString();
51
+ out: (a) => ({
52
+ spring: l,
53
+ tick: (n) => {
54
+ const t = e + (1 - e) * n;
55
+ a.style.transform = y(t), a.style.opacity = (s + (1 - s) * n).toString();
56
56
  }
57
57
  }),
58
- ...l && { key: l }
58
+ ...u && { key: u }
59
59
  };
60
60
  }, x = ($ = {}) => {
61
61
  const {
62
- direction: n,
62
+ direction: e,
63
63
  distance: s = 100,
64
- opacity: r = 0,
65
- fade: u = !0,
66
- axis: l,
64
+ opacity: f = 0,
65
+ fade: l = !0,
66
+ axis: u,
67
67
  spring: y = { stiffness: 400, damping: 35 },
68
- key: c
69
- } = $, e = n || (l === "x" ? "left" : l === "y" ? "up" : "left"), o = (a) => typeof a == "number" ? `${a}px` : a, f = (a) => {
70
- const i = 1 - a, p = typeof s == "number" ? i * s : `calc(${o(s)} * ${i})`;
71
- switch (e) {
68
+ key: a
69
+ } = $, t = e || (u === "x" ? "left" : u === "y" ? "up" : "left"), c = (i) => typeof i == "number" ? `${i}px` : i, o = (i) => {
70
+ const r = 1 - i, p = typeof s == "number" ? r * s : `calc(${c(s)} * ${r})`;
71
+ switch (t) {
72
72
  case "left":
73
73
  return typeof s == "number" ? `translateX(${-p}px)` : `translateX(calc(-1 * ${p}))`;
74
74
  case "right":
@@ -80,174 +80,231 @@ const m = ($ = {}) => {
80
80
  }
81
81
  };
82
82
  return {
83
- in: (a) => ({
83
+ in: (i) => ({
84
84
  spring: y,
85
- tick: (i) => {
86
- a.style.transform = f(i), u && (a.style.opacity = (r + (1 - r) * i).toString());
85
+ tick: (r) => {
86
+ i.style.transform = o(r), l && (i.style.opacity = (f + (1 - f) * r).toString());
87
87
  }
88
88
  }),
89
- out: (a) => ({
89
+ out: (i) => ({
90
90
  spring: y,
91
- tick: (i) => {
92
- a.style.transform = f(i), u && (a.style.opacity = (r + (1 - r) * i).toString());
91
+ tick: (r) => {
92
+ i.style.transform = o(r), l && (i.style.opacity = (f + (1 - f) * r).toString());
93
93
  }
94
94
  }),
95
- ...c && { key: c }
95
+ ...a && { key: a }
96
96
  };
97
- }, d = ($ = {}) => {
97
+ }, k = ($ = {}) => {
98
98
  const {
99
- degrees: n = 360,
99
+ degrees: e = 360,
100
100
  clockwise: s = !0,
101
- scale: r = !1,
102
- fade: u = !0,
103
- origin: l = "center",
101
+ scale: f = !1,
102
+ fade: l = !0,
103
+ origin: u = "center",
104
104
  axis: y = "2d",
105
- perspective: c = 800,
106
- spring: t = { stiffness: 500, damping: 25 },
107
- key: e
108
- } = $, o = s ? n : -n, f = (a) => {
109
- const i = (1 - a) * o;
105
+ perspective: a = 800,
106
+ spring: n = { stiffness: 500, damping: 25 },
107
+ key: t
108
+ } = $, c = s ? e : -e, o = (i) => {
109
+ const r = (1 - i) * c;
110
110
  switch (y) {
111
111
  case "x":
112
- return `perspective(${c}px) rotateX(${i}deg)`;
112
+ return `perspective(${a}px) rotateX(${r}deg)`;
113
113
  case "y":
114
- return `perspective(${c}px) rotateY(${i}deg)`;
114
+ return `perspective(${a}px) rotateY(${r}deg)`;
115
115
  case "z":
116
- return `rotateZ(${i}deg)`;
116
+ return `rotateZ(${r}deg)`;
117
117
  case "2d":
118
118
  default:
119
- return `rotate(${i}deg)`;
119
+ return `rotate(${r}deg)`;
120
120
  }
121
121
  };
122
122
  return {
123
- in: (a) => ({
124
- spring: t,
125
- tick: (i) => {
126
- const p = [f(i)];
127
- r && p.push(`scale(${i})`), a.style.transform = p.join(" "), a.style.transformOrigin = l, u && (a.style.opacity = i.toString());
123
+ in: (i) => ({
124
+ spring: n,
125
+ tick: (r) => {
126
+ const p = [o(r)];
127
+ f && p.push(`scale(${r})`), i.style.transform = p.join(" "), i.style.transformOrigin = u, l && (i.style.opacity = r.toString());
128
128
  }
129
129
  }),
130
- out: (a) => ({
131
- spring: t,
132
- tick: (i) => {
133
- const p = [f(i)];
134
- r && p.push(`scale(${i})`), a.style.transform = p.join(" "), a.style.transformOrigin = l, u && (a.style.opacity = i.toString());
130
+ out: (i) => ({
131
+ spring: n,
132
+ tick: (r) => {
133
+ const p = [o(r)];
134
+ f && p.push(`scale(${r})`), i.style.transform = p.join(" "), i.style.transformOrigin = u, l && (i.style.opacity = r.toString());
135
135
  }
136
136
  }),
137
- ...e && { key: e }
137
+ ...t && { key: t }
138
138
  };
139
- }, g = ($ = {}) => {
139
+ }, S = ($ = {}) => {
140
140
  const {
141
- height: n = 20,
141
+ height: e = 20,
142
142
  intensity: s = 1,
143
- scale: r = !0,
144
- fade: u = !0,
145
- direction: l = "up",
143
+ scale: f = !0,
144
+ fade: l = !0,
145
+ direction: u = "up",
146
146
  spring: y = { stiffness: 800, damping: 15 },
147
- key: c
147
+ key: a
148
148
  } = $;
149
149
  return {
150
- in: (t) => ({
150
+ in: (n) => ({
151
151
  spring: y,
152
- tick: (e) => {
153
- const o = [], f = Math.sin(e * Math.PI * (1 + s)), a = 1 - e, i = f * n * a;
154
- if (l === "up" ? o.push(`translateY(${-Math.abs(i)}px)`) : o.push(`translateY(${Math.abs(i)}px)`), r) {
155
- const p = 0.8 + e * 0.2 + f * 0.05 * a;
156
- o.push(`scale(${p})`);
152
+ tick: (t) => {
153
+ const c = [], o = Math.sin(t * Math.PI * (1 + s)), i = 1 - t, r = o * e * i;
154
+ if (u === "up" ? c.push(`translateY(${-Math.abs(r)}px)`) : c.push(`translateY(${Math.abs(r)}px)`), f) {
155
+ const p = 0.8 + t * 0.2 + o * 0.05 * i;
156
+ c.push(`scale(${p})`);
157
157
  }
158
- t.style.transform = o.join(" "), u && (t.style.opacity = e.toString());
158
+ n.style.transform = c.join(" "), l && (n.style.opacity = t.toString());
159
159
  }
160
160
  }),
161
- out: (t) => ({
161
+ out: (n) => ({
162
162
  spring: y,
163
- tick: (e) => {
164
- const o = [], f = Math.sin(e * Math.PI * (1 + s)), a = 1 - e, i = f * n * a;
165
- if (l === "up" ? o.push(`translateY(${-Math.abs(i)}px)`) : o.push(`translateY(${Math.abs(i)}px)`), r) {
166
- const p = 0.8 + e * 0.2 + f * 0.05 * a;
167
- o.push(`scale(${p})`);
163
+ tick: (t) => {
164
+ const c = [], o = Math.sin(t * Math.PI * (1 + s)), i = 1 - t, r = o * e * i;
165
+ if (u === "up" ? c.push(`translateY(${-Math.abs(r)}px)`) : c.push(`translateY(${Math.abs(r)}px)`), f) {
166
+ const p = 0.8 + t * 0.2 + o * 0.05 * i;
167
+ c.push(`scale(${p})`);
168
168
  }
169
- t.style.transform = o.join(" "), u && (t.style.opacity = e.toString());
169
+ n.style.transform = c.join(" "), l && (n.style.opacity = t.toString());
170
170
  }
171
171
  }),
172
- ...c && { key: c }
172
+ ...a && { key: a }
173
173
  };
174
- }, k = ($ = {}) => {
174
+ }, Y = ($ = {}) => {
175
175
  const {
176
- amount: n = 10,
176
+ amount: e = 10,
177
177
  opacity: s = 0,
178
- scale: r = !1,
179
- fade: u = !0,
180
- spring: l = { stiffness: 300, damping: 30 },
178
+ scale: f = !1,
179
+ fade: l = !0,
180
+ spring: u = { stiffness: 300, damping: 30 },
181
181
  key: y
182
- } = $, c = (t) => typeof t == "number" ? `${t}px` : t;
182
+ } = $, a = (n) => typeof n == "number" ? `${n}px` : n;
183
183
  return {
184
- in: (t) => ({
185
- spring: l,
186
- tick: (e) => {
187
- const o = 1 - e, f = typeof n == "number" ? o * n : `calc(${c(n)} * ${o})`;
188
- t.style.filter = typeof n == "number" ? `blur(${f}px)` : `blur(${f})`, r && (t.style.transform = `scale(${0.8 + e * 0.2})`), u && (t.style.opacity = (s + (1 - s) * e).toString());
184
+ in: (n) => ({
185
+ spring: u,
186
+ tick: (t) => {
187
+ const c = 1 - t, o = typeof e == "number" ? c * e : `calc(${a(e)} * ${c})`;
188
+ n.style.filter = typeof e == "number" ? `blur(${o}px)` : `blur(${o})`, f && (n.style.transform = `scale(${0.8 + t * 0.2})`), l && (n.style.opacity = (s + (1 - s) * t).toString());
189
189
  }
190
190
  }),
191
- out: (t) => ({
192
- spring: l,
193
- tick: (e) => {
194
- const o = 1 - e, f = typeof n == "number" ? o * n : `calc(${c(n)} * ${o})`;
195
- t.style.filter = typeof n == "number" ? `blur(${f}px)` : `blur(${f})`, r && (t.style.transform = `scale(${0.8 + e * 0.2})`), u && (t.style.opacity = (s + (1 - s) * e).toString());
191
+ out: (n) => ({
192
+ spring: u,
193
+ tick: (t) => {
194
+ const c = 1 - t, o = typeof e == "number" ? c * e : `calc(${a(e)} * ${c})`;
195
+ n.style.filter = typeof e == "number" ? `blur(${o}px)` : `blur(${o})`, f && (n.style.transform = `scale(${0.8 + t * 0.2})`), l && (n.style.opacity = (s + (1 - s) * t).toString());
196
196
  }
197
197
  }),
198
198
  ...y && { key: y }
199
199
  };
200
- }, h = ($ = {}) => {
200
+ }, M = ($ = {}) => {
201
201
  const {
202
- x: n = 0,
202
+ x: e = 0,
203
203
  y: s = -100,
204
- opacity: r = 0,
205
- spring: u = { stiffness: 400, damping: 35 },
206
- key: l
207
- } = $, y = (t) => typeof t == "number" ? `${t}px` : t, c = (t) => typeof t == "number" ? `${t}px` : t;
204
+ opacity: f = 0,
205
+ spring: l = { stiffness: 400, damping: 35 },
206
+ key: u
207
+ } = $, y = (n) => typeof n == "number" ? `${n}px` : n, a = (n) => typeof n == "number" ? `${n}px` : n;
208
+ return {
209
+ in: (n) => ({
210
+ spring: l,
211
+ tick: (t) => {
212
+ const c = typeof e == "number" ? (1 - t) * e : `calc(${y(e)} * ${1 - t})`, o = typeof s == "number" ? (1 - t) * s : `calc(${a(s)} * ${1 - t})`;
213
+ n.style.transform = `translate(${typeof e == "number" ? c + "px" : c}, ${typeof s == "number" ? o + "px" : o})`, n.style.opacity = (f + (1 - f) * t).toString();
214
+ }
215
+ }),
216
+ out: (n) => ({
217
+ spring: l,
218
+ tick: (t) => {
219
+ const c = typeof e == "number" ? (1 - t) * e : `calc(${y(e)} * ${1 - t})`, o = typeof s == "number" ? (1 - t) * s : `calc(${a(s)} * ${1 - t})`;
220
+ n.style.transform = `translate(${typeof e == "number" ? c + "px" : c}, ${typeof s == "number" ? o + "px" : o})`, n.style.opacity = (f + (1 - f) * t).toString();
221
+ }
222
+ }),
223
+ ...u && { key: u }
224
+ };
225
+ }, O = ($ = {}) => {
226
+ const {
227
+ shape: e = "circle",
228
+ origin: s = "center",
229
+ scale: f = 1.5,
230
+ fade: l = !1,
231
+ spring: u = { stiffness: 300, damping: 30 },
232
+ key: y
233
+ } = $, a = () => {
234
+ switch (s) {
235
+ case "top":
236
+ return "50% 0%";
237
+ case "bottom":
238
+ return "50% 100%";
239
+ case "left":
240
+ return "0% 50%";
241
+ case "right":
242
+ return "100% 50%";
243
+ case "top-left":
244
+ return "0% 0%";
245
+ case "top-right":
246
+ return "100% 0%";
247
+ case "bottom-left":
248
+ return "0% 100%";
249
+ case "bottom-right":
250
+ return "100% 100%";
251
+ case "center":
252
+ default:
253
+ return "50% 50%";
254
+ }
255
+ }, n = (t) => {
256
+ const c = t * f * 100, o = a();
257
+ switch (e) {
258
+ case "ellipse":
259
+ return `ellipse(${c}% ${c * 0.75}% at ${o})`;
260
+ case "square": {
261
+ const i = t * f * 100, [r, p] = o.split(" "), m = parseFloat(r), g = parseFloat(p), b = i / 2;
262
+ return `polygon(${m - b}% ${g - b}%, ${m + b}% ${g - b}%, ${m + b}% ${g + b}%, ${m - b}% ${g + b}%)`;
263
+ }
264
+ case "circle":
265
+ default:
266
+ return `circle(${c}% at ${o})`;
267
+ }
268
+ };
208
269
  return {
209
270
  in: (t) => ({
210
271
  spring: u,
211
- tick: (e) => {
212
- const o = typeof n == "number" ? (1 - e) * n : `calc(${y(n)} * ${1 - e})`, f = typeof s == "number" ? (1 - e) * s : `calc(${c(s)} * ${1 - e})`;
213
- t.style.transform = `translate(${typeof n == "number" ? o + "px" : o}, ${typeof s == "number" ? f + "px" : f})`, t.style.opacity = (r + (1 - r) * e).toString();
272
+ tick: (c) => {
273
+ t.style.clipPath = n(c), l && (t.style.opacity = c.toString());
214
274
  }
215
275
  }),
216
276
  out: (t) => ({
217
277
  spring: u,
218
- tick: (e) => {
219
- const o = typeof n == "number" ? (1 - e) * n : `calc(${y(n)} * ${1 - e})`, f = typeof s == "number" ? (1 - e) * s : `calc(${c(s)} * ${1 - e})`;
220
- t.style.transform = `translate(${typeof n == "number" ? o + "px" : o}, ${typeof s == "number" ? f + "px" : f})`, t.style.opacity = (r + (1 - r) * e).toString();
278
+ tick: (c) => {
279
+ t.style.clipPath = n(c), l && (t.style.opacity = c.toString());
221
280
  }
222
281
  }),
223
- ...l && { key: l }
282
+ ...y && { key: y }
224
283
  };
225
- }, S = ($ = {}) => {
226
- const {
227
- spring: n = { stiffness: 1e3, damping: 100 },
228
- key: s
229
- } = $;
284
+ }, V = ($ = {}) => {
285
+ const { spring: e = { stiffness: 1e3, damping: 100 }, key: s } = $;
230
286
  return {
231
- in: (r) => ({
232
- spring: n,
233
- tick: (u) => {
287
+ in: () => ({
288
+ spring: e,
289
+ tick: () => {
234
290
  }
235
291
  }),
236
- out: (r) => ({
237
- spring: n,
238
- tick: (u) => {
292
+ out: () => ({
293
+ spring: e,
294
+ tick: () => {
239
295
  }
240
296
  }),
241
297
  ...s && { key: s }
242
298
  };
243
299
  };
244
300
  export {
245
- k as blur,
246
- g as bounce,
247
- m as fade,
248
- h as fly,
249
- S as none,
250
- d as rotate,
251
- b as scale,
301
+ Y as blur,
302
+ S as bounce,
303
+ h as fade,
304
+ M as fly,
305
+ O as mask,
306
+ V as none,
307
+ k as rotate,
308
+ d as scale,
252
309
  x as slide
253
310
  };
@@ -0,0 +1,31 @@
1
+ import { TransitionKey } from '../types';
2
+ interface MaskOptions {
3
+ shape?: "circle" | "ellipse" | "square";
4
+ origin?: "center" | "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
5
+ scale?: number;
6
+ fade?: boolean;
7
+ spring?: {
8
+ stiffness?: number;
9
+ damping?: number;
10
+ };
11
+ key?: TransitionKey;
12
+ }
13
+ export declare const mask: (options?: MaskOptions) => {
14
+ key?: TransitionKey | undefined;
15
+ in: (element: HTMLElement) => {
16
+ spring: {
17
+ stiffness?: number;
18
+ damping?: number;
19
+ };
20
+ tick: (progress: number) => void;
21
+ };
22
+ out: (element: HTMLElement) => {
23
+ spring: {
24
+ stiffness?: number;
25
+ damping?: number;
26
+ };
27
+ tick: (progress: number) => void;
28
+ };
29
+ };
30
+ export {};
31
+ //# sourceMappingURL=mask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/mask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACxC,MAAM,CAAC,EACH,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB;;kBA4D5B,WAAW;;wBAlEb,MAAM;sBACR,MAAM;;yBAmEG,MAAM;;mBAQV,WAAW;;wBA5Ed,MAAM;sBACR,MAAM;;yBA6EG,MAAM;;CAU5B,CAAC"}
@@ -8,19 +8,19 @@ interface NoneOptions {
8
8
  }
9
9
  export declare const none: (options?: NoneOptions) => {
10
10
  key?: TransitionKey | undefined;
11
- in: (_element: HTMLElement) => {
11
+ in: () => {
12
12
  spring: {
13
13
  stiffness?: number;
14
14
  damping?: number;
15
15
  };
16
- tick: (_progress: number) => void;
16
+ tick: () => void;
17
17
  };
18
- out: (_element: HTMLElement) => {
18
+ out: () => {
19
19
  spring: {
20
20
  stiffness?: number;
21
21
  damping?: number;
22
22
  };
23
- tick: (_progress: number) => void;
23
+ tick: () => void;
24
24
  };
25
25
  };
26
26
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/none.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB;;mBAO3B,WAAW;;wBAbd,MAAM;sBACR,MAAM;;0BAcI,MAAM;;oBAIV,WAAW;;wBAnBf,MAAM;sBACR,MAAM;;0BAoBI,MAAM;;CAM7B,CAAC"}
1
+ {"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/none.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB;;;;wBAN9B,MAAM;sBACR,MAAM;;;;;;wBADJ,MAAM;sBACR,MAAM;;;;CAuBnB,CAAC"}