@ssgoi/core 0.0.3 → 2.0.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 (41) hide show
  1. package/README.md +252 -23
  2. package/dist/animator.d.ts +28 -17
  3. package/dist/animator.d.ts.map +1 -1
  4. package/dist/create-transition-callback.d.ts +3 -32
  5. package/dist/create-transition-callback.d.ts.map +1 -1
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +310 -195
  10. package/dist/presets/index.cjs +1 -0
  11. package/dist/presets/index.d.ts +16 -0
  12. package/dist/presets/index.d.ts.map +1 -0
  13. package/dist/presets/index.js +35 -0
  14. package/dist/transition-strategy.d.ts +60 -0
  15. package/dist/transition-strategy.d.ts.map +1 -0
  16. package/dist/transition.d.ts +7 -3
  17. package/dist/transition.d.ts.map +1 -1
  18. package/dist/transitions/blur.d.ts +2 -1
  19. package/dist/transitions/blur.d.ts.map +1 -1
  20. package/dist/transitions/bounce.d.ts +2 -0
  21. package/dist/transitions/bounce.d.ts.map +1 -1
  22. package/dist/transitions/fly.d.ts +27 -0
  23. package/dist/transitions/fly.d.ts.map +1 -0
  24. package/dist/transitions/index.cjs +1 -1
  25. package/dist/transitions/index.d.ts +1 -0
  26. package/dist/transitions/index.d.ts.map +1 -1
  27. package/dist/transitions/index.js +175 -111
  28. package/dist/transitions/rotate.d.ts +3 -0
  29. package/dist/transitions/rotate.d.ts.map +1 -1
  30. package/dist/transitions/scale.d.ts +3 -3
  31. package/dist/transitions/scale.d.ts.map +1 -1
  32. package/dist/transitions/slide.d.ts +3 -1
  33. package/dist/transitions/slide.d.ts.map +1 -1
  34. package/dist/types.d.ts +8 -6
  35. package/dist/types.d.ts.map +1 -1
  36. package/dist/view-transitions/index.cjs +1 -1
  37. package/dist/view-transitions/index.d.ts +1 -1
  38. package/dist/view-transitions/index.js +117 -126
  39. package/dist/view-transitions/scroll.d.ts +8 -0
  40. package/dist/view-transitions/scroll.d.ts.map +1 -0
  41. package/package.json +21 -4
package/dist/types.d.ts CHANGED
@@ -3,17 +3,19 @@ export type SpringConfig = {
3
3
  stiffness?: number;
4
4
  damping?: number;
5
5
  };
6
- export type TransitionConfig = {
6
+ export type TransitionConfig<TAnimationValue = number> = {
7
7
  spring?: SpringConfig;
8
- tick?: (progress: number) => void;
8
+ from?: TAnimationValue;
9
+ to?: TAnimationValue;
10
+ tick?: (progress: TAnimationValue) => void;
9
11
  prepare?: (element: HTMLElement) => void;
10
12
  onStart?: () => void;
11
13
  onEnd?: () => void;
12
14
  };
13
- export type GetTransitionConfig<TContext = undefined> = TContext extends undefined ? (node: HTMLElement) => TransitionConfig | Promise<TransitionConfig> : (node: HTMLElement, context: TContext) => TransitionConfig | Promise<TransitionConfig>;
14
- export type Transition<TContext = undefined> = {
15
- in?: GetTransitionConfig<TContext>;
16
- out?: GetTransitionConfig<TContext>;
15
+ export type GetTransitionConfig<TContext = undefined, TAnimationValue = number> = TContext extends undefined ? (node: HTMLElement) => TransitionConfig<TAnimationValue> | Promise<TransitionConfig<TAnimationValue>> : (node: HTMLElement, context: TContext) => TransitionConfig<TAnimationValue> | Promise<TransitionConfig<TAnimationValue>>;
16
+ export type Transition<TContext = undefined, TAnimationValue = number> = {
17
+ in?: GetTransitionConfig<TContext, TAnimationValue>;
18
+ out?: GetTransitionConfig<TContext, TAnimationValue>;
17
19
  };
18
20
  export type TransitionCallback = (element: HTMLElement | null) => void | (() => void);
19
21
  export type SggoiTransitionContext = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAE7B,MAAM,CAAC,EAAE,YAAY,CAAC;IAGtB,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAGlC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAGzC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAGrB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,QAAQ,GAAG,SAAS,IAClD,QAAQ,SAAS,SAAS,GACtB,CAAC,IAAI,EAAE,WAAW,KAAK,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,GACnE,CACE,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,QAAQ,KACd,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAExD,MAAM,MAAM,UAAU,CAAC,QAAQ,GAAG,SAAS,IAAI;IAC7C,EAAE,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACnC,GAAG,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,WAAW,GAAG,IAAI,KACxB,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAEzB,MAAM,MAAM,sBAAsB,GAAG;IACnC,YAAY,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAEjE,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,UAAU,EAAE,eAAe,CAAC;QAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,EAAE,CAAC;IACJ,iBAAiB,CAAC,EAAE,eAAe,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,KACT,UAAU,GAAG;IAAE,GAAG,EAAE,aAAa,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,eAAe,GAAG,MAAM,IAAI;IAEvD,MAAM,CAAC,EAAE,YAAY,CAAC;IAGtB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,EAAE,CAAC,EAAE,eAAe,CAAC;IAGrB,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,CAAC;IAG3C,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAGzC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAGrB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,QAAQ,GAAG,SAAS,EAAE,eAAe,GAAG,MAAM,IAC5E,QAAQ,SAAS,SAAS,GACtB,CAAC,IAAI,EAAE,WAAW,KAAK,gBAAgB,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,GACrG,CACE,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,QAAQ,KACd,gBAAgB,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;AAE1F,MAAM,MAAM,UAAU,CAAC,QAAQ,GAAG,SAAS,EAAE,eAAe,GAAG,MAAM,IAAI;IACvE,EAAE,CAAC,EAAE,mBAAmB,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;IACpD,GAAG,CAAC,EAAE,mBAAmB,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,WAAW,GAAG,IAAI,KACxB,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAEzB,MAAM,MAAM,sBAAsB,GAAG;IACnC,YAAY,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAEjE,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,UAAU,EAAE,eAAe,CAAC;QAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,EAAE,CAAC;IACJ,iBAAiB,CAAC,EAAE,eAAe,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,KACT,UAAU,GAAG;IAAE,GAAG,EAAE,aAAa,CAAA;CAAE,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../utils-BSgyev81.cjs"),C=(t={})=>{var e,i;const n={stiffness:((e=t.spring)==null?void 0:e.stiffness)??300,damping:((i=t.spring)==null?void 0:i.damping)??30};return{in:s=>({spring:n,tick:l=>{s.style.opacity=l.toString()}}),out:s=>({spring:n,tick:l=>{s.style.opacity=l.toString()},prepare:k.prepareOutgoing})}};function E(t,n){return t.querySelector(`[data-hero-key="${n}"]`)}function A(t,n){const e=t.getBoundingClientRect(),i=n.getBoundingClientRect();return new DOMRect(i.left-e.left,i.top-e.top,i.width,i.height)}const D=(t={})=>{var l,r;const n={stiffness:((l=t.spring)==null?void 0:l.stiffness)??300,damping:((r=t.spring)==null?void 0:r.damping)??30},e=t.timeout??300;let i=null,s=null;return{in:async(c,o)=>{const h=c,g=Array.from(h.querySelectorAll("[data-hero-key]"));if(g.length===0)return{spring:n,tick:()=>{}};if(!await new Promise(a=>{i?a(!0):(s=a,setTimeout(()=>{s=null,a(!1)},e))})||!i)return i=null,{spring:n,tick:()=>{}};const p=g.map(a=>{const f=a.getAttribute("data-hero-key");if(!f)return null;const u=E(i,f);if(!u)return null;const d=a,$=A(i,u),w=A(h,d),x=$.left-w.left-o.scrollOffset.x,M=$.top-w.top-o.scrollOffset.y,q=$.width/w.width,O=$.height/w.height,T=d.style.transform,P=d.style.position,b=d.style.transformOrigin;return{toEl:d,dx:x,dy:M,dw:q,dh:O,originalTransform:T,originalPosition:P,originalTransformOrigin:b}}).filter(Boolean);return i=null,p.length===0?{spring:n,tick:()=>{}}:{spring:n,prepare:()=>{p.forEach(({toEl:a})=>{a.style.position="relative",a.style.transformOrigin="top left"})},tick:a=>{p.forEach(({toEl:f,dx:u,dy:d,dw:$,dh:w})=>{f.style.transform=`translate(${(1-a)*u}px,${(1-a)*d}px) scale(${a+(1-a)*$}, ${a+(1-a)*w})`})},onEnd:()=>{p.forEach(({toEl:a,originalTransform:f,originalPosition:u,originalTransformOrigin:d})=>{a.style.transform=f,a.style.position=u,a.style.transformOrigin=d})}}},out:async c=>({onStart:()=>{i=c,s&&(s(!0),s=null)},prepare:o=>{k.prepareOutgoing(o),o.style.opacity="0"}})}};function S(t,n){const e=t.getBoundingClientRect(),i=n.getBoundingClientRect();return new DOMRect(i.left-e.left,i.top-e.top,i.width,i.height)}function H({detailRect:t,galleryRect:n,pageRect:e,scrollOffset:i},s){const l=n.left-t.left+(n.width-t.width)/2-i.x,r=n.top-t.top+(n.height-t.height)/2-i.y,c=n.width/t.width,o=n.height/t.height,h=Math.max(c,o),g=t.top/e.height*100,y=(e.width-(t.left+t.width))/e.width*100,p=(e.height-(t.top+t.height))/e.height*100,a=t.left/e.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,f=>{const u=1-f,d=g*u,$=y*u,w=p*u,x=a*u;s.style.clipPath=`inset(${d}% ${$}% ${w}% ${x}%)`,s.style.transform=`translate(${l*u}px, ${r*u}px) scale(${1+(h-1)*u})`}}function F({galleryRect:t,detailRect:n,scrollOffset:e},i){const s=n.left-t.left+(n.width-t.width)/2+e.x,l=n.top-t.top+(n.height-t.height)/2+e.y,r=n.width/t.width,c=n.height/t.height,o=Math.max(r,c);return h=>{i.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const g=1-h;i.style.transform=`translate(${s*g-e.x}px, ${l*g-e.y}px) scale(${1+(o-1)*g})`,i.style.opacity=`${1-g}`}}function I({galleryRect:t,detailRect:n,scrollOffset:e},i){const s=n.left-t.left+(n.width-t.width)/2-e.x,l=n.top-t.top+(n.height-t.height)/2-e.y,r=n.width/t.width,c=n.height/t.height,o=Math.max(r,c);return h=>{const g=1-h,y=h;i.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,i.style.transform=`translate(${s*g}px, ${l*g}px) scale(${1+(o-1)*g})`,i.style.opacity=`${y}`}}function L({detailRect:t,galleryRect:n,pageRect:e,scrollOffset:i},s){const l=n.left-t.left+(n.width-t.width)/2+i.x,r=n.top-t.top+(n.height-t.height)/2+i.y,c=n.width/t.width,o=n.height/t.height,h=Math.min(c,o),g=t.top/e.height*100,y=(e.width-(t.left+t.width))/e.width*100,p=(e.height-(t.top+t.height))/e.height*100,a=t.left/e.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,f=>{const u=1-f,d=g*u,$=y*u,w=p*u,x=a*u;s.style.clipPath=`inset(${d}% ${$}% ${w}% ${x}%)`,s.style.transform=`translate(${l*u-i.x}px, ${r*u-i.y}px) scale(${1+(h-1)*u})`}}function X(t,n,e){const i=t.querySelector("[data-pinterest-detail-key]"),s=n.querySelector("[data-pinterest-detail-key]");if(t.querySelectorAll("[data-pinterest-detail-key]").length>1||n.querySelectorAll("[data-pinterest-detail-key]").length>1)return null;let l=null,r=null,c=!1;if(!i&&s){r=s;const y=r.getAttribute("data-pinterest-detail-key");if(!y)return null;l=t.querySelector(`[data-pinterest-gallery-key="${y}"]`),l&&(c=!0)}else if(i&&!s){r=i;const y=r.getAttribute("data-pinterest-detail-key");if(!y)return null;l=n.querySelector(`[data-pinterest-gallery-key="${y}"]`),l&&(c=!1)}if(!l||!r)return null;const o=S(c?t:n,l),h=S(c?n:t,r),g=n.getBoundingClientRect();return c?{inAnimation:H({detailRect:h,galleryRect:o,pageRect:g,scrollOffset:e},n),outAnimation:F({galleryRect:o,detailRect:h,scrollOffset:e},t)}:{inAnimation:I({galleryRect:o,detailRect:h,scrollOffset:e},n),outAnimation:L({detailRect:h,galleryRect:o,pageRect:g,scrollOffset:e},t)}}const Y=(t={})=>{var r,c;const n={stiffness:((r=t.spring)==null?void 0:r.stiffness)??50,damping:((c=t.spring)==null?void 0:c.damping)??10},e=t.timeout??300;let i=null,s=null,l=null;return{in:async(o,{scrollOffset:h})=>{const g=o;return!await new Promise(p=>{i?p(!0):(s=p,setTimeout(()=>{s=null,p(!1)},e))})||!i?(i=null,{spring:n,tick:()=>{}}):(l=X(i,g,h),l?(i=null,{spring:n,tick:p=>{l&&l.inAnimation(p)}}):{spring:n,tick:()=>{}})},out:async o=>({spring:n,onStart:()=>{i=o,s&&(s(!0),s=null)},prepare:h=>{k.prepareOutgoing(h),h.style.zIndex="-1"},tick:h=>{l&&l.outAnimation(h)}})}};function B(t){const n=t.getBoundingClientRect(),e=t.clientHeight,s=50*(window.innerHeight-n.top)/e;return Math.min(Math.max(s,0),100)}const m=(t={})=>{var e,i;const n={stiffness:((e=t.spring)==null?void 0:e.stiffness)??300,damping:((i=t.spring)==null?void 0:i.damping)??200};return{in:s=>{const l=B(s);return{spring:n,tick:r=>{s.style.clipPath=`circle(${r*100}% at 50% ${l}%)`}}},out:s=>{const l=B(s);return{spring:n,tick:r=>{s.style.clipPath=`circle(${r*100}% at 50% ${l}%)`,s.style.zIndex="100"},prepare:k.prepareOutgoing}}}};exports.fade=C;exports.hero=D;exports.pinterest=Y;exports.ripple=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../utils-BSgyev81.cjs"),E=(t={})=>{var e,i;const n={stiffness:((e=t.spring)==null?void 0:e.stiffness)??300,damping:((i=t.spring)==null?void 0:i.damping)??30};return{in:s=>({spring:n,tick:l=>{s.style.opacity=l.toString()}}),out:s=>({spring:n,tick:l=>{s.style.opacity=l.toString()},prepare:k.prepareOutgoing})}};function m(t,n){return t.querySelector(`[data-hero-key="${n}"]`)}function A(t,n){const e=t.getBoundingClientRect(),i=n.getBoundingClientRect();return new DOMRect(i.left-e.left,i.top-e.top,i.width,i.height)}const C=(t={})=>{var l,h;const n={stiffness:((l=t.spring)==null?void 0:l.stiffness)??300,damping:((h=t.spring)==null?void 0:h.damping)??30},e=t.timeout??300;let i=null,s=null;return{in:async(r,a)=>{const u=r,g=Array.from(u.querySelectorAll("[data-hero-key]"));if(g.length===0)return{spring:n,tick:()=>{}};if(!await new Promise(o=>{i?o(!0):(s=o,setTimeout(()=>{s=null,o(!1)},e))})||!i)return i=null,{spring:n,tick:()=>{}};const p=g.map(o=>{const $=o.getAttribute("data-hero-key");if(!$)return null;const c=m(i,$);if(!c)return null;const d=o,w=A(i,c),f=A(u,d),x=w.left-f.left-a.scrollOffset.x,B=w.top-f.top-a.scrollOffset.y,q=w.width/f.width,T=w.height/f.height,M=d.style.transform,O=d.style.position,Y=d.style.transformOrigin;return{toEl:d,dx:x,dy:B,dw:q,dh:T,originalTransform:M,originalPosition:O,originalTransformOrigin:Y}}).filter(Boolean);return i=null,p.length===0?{spring:n,tick:()=>{}}:{spring:n,prepare:()=>{p.forEach(({toEl:o})=>{o.style.position="relative",o.style.transformOrigin="top left"})},tick:o=>{p.forEach(({toEl:$,dx:c,dy:d,dw:w,dh:f})=>{$.style.transform=`translate(${(1-o)*c}px,${(1-o)*d}px) scale(${o+(1-o)*w}, ${o+(1-o)*f})`})},onEnd:()=>{p.forEach(({toEl:o,originalTransform:$,originalPosition:c,originalTransformOrigin:d})=>{o.style.transform=$,o.style.position=c,o.style.transformOrigin=d})}}},out:async r=>({onStart:()=>{i=r,s&&(s(!0),s=null)},prepare:a=>{k.prepareOutgoing(a),a.style.opacity="0"}})}};function S(t,n){const e=t.getBoundingClientRect(),i=n.getBoundingClientRect();return new DOMRect(i.left-e.left,i.top-e.top,i.width,i.height)}function D({detailRect:t,galleryRect:n,pageRect:e,scrollOffset:i},s){const l=n.left-t.left+(n.width-t.width)/2-i.x,h=n.top-t.top+(n.height-t.height)/2-i.y,r=n.width/t.width,a=n.height/t.height,u=Math.max(r,a),g=t.top/e.height*100,y=(e.width-(t.left+t.width))/e.width*100,p=(e.height-(t.top+t.height))/e.height*100,o=t.left/e.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,$=>{const c=1-$,d=g*c,w=y*c,f=p*c,x=o*c;s.style.clipPath=`inset(${d}% ${w}% ${f}% ${x}%)`,s.style.transform=`translate(${l*c}px, ${h*c}px) scale(${1+(u-1)*c})`}}function P({galleryRect:t,detailRect:n,scrollOffset:e},i){const s=n.left-t.left+(n.width-t.width)/2+e.x,l=n.top-t.top+(n.height-t.height)/2+e.y,h=n.width/t.width,r=n.height/t.height,a=Math.max(h,r);return u=>{i.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const g=1-u;i.style.transform=`translate(${s*g-e.x}px, ${l*g-e.y}px) scale(${1+(a-1)*g})`,i.style.opacity=`${1-g}`}}function b({galleryRect:t,detailRect:n,scrollOffset:e},i){const s=n.left-t.left+(n.width-t.width)/2-e.x,l=n.top-t.top+(n.height-t.height)/2-e.y,h=n.width/t.width,r=n.height/t.height,a=Math.max(h,r);return u=>{const g=1-u,y=u;i.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,i.style.transform=`translate(${s*g}px, ${l*g}px) scale(${1+(a-1)*g})`,i.style.opacity=`${y}`}}function F({detailRect:t,galleryRect:n,pageRect:e,scrollOffset:i},s){const l=n.left-t.left+(n.width-t.width)/2+i.x,h=n.top-t.top+(n.height-t.height)/2+i.y,r=n.width/t.width,a=n.height/t.height,u=Math.min(r,a),g=t.top/e.height*100,y=(e.width-(t.left+t.width))/e.width*100,p=(e.height-(t.top+t.height))/e.height*100,o=t.left/e.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,$=>{const c=1-$,d=g*c,w=y*c,f=p*c,x=o*c;s.style.clipPath=`inset(${d}% ${w}% ${f}% ${x}%)`,s.style.transform=`translate(${l*c-i.x}px, ${h*c-i.y}px) scale(${1+(u-1)*c})`}}function L(t,n,e){const i=t.querySelector("[data-pinterest-detail-key]"),s=n.querySelector("[data-pinterest-detail-key]");if(t.querySelectorAll("[data-pinterest-detail-key]").length>1||n.querySelectorAll("[data-pinterest-detail-key]").length>1)return null;let l=null,h=null,r=!1;if(!i&&s){h=s;const y=h.getAttribute("data-pinterest-detail-key");if(!y)return null;l=t.querySelector(`[data-pinterest-gallery-key="${y}"]`),l&&(r=!0)}else if(i&&!s){h=i;const y=h.getAttribute("data-pinterest-detail-key");if(!y)return null;l=n.querySelector(`[data-pinterest-gallery-key="${y}"]`),l&&(r=!1)}if(!l||!h)return null;const a=S(r?t:n,l),u=S(r?n:t,h),g=n.getBoundingClientRect();return r?{inAnimation:D({detailRect:u,galleryRect:a,pageRect:g,scrollOffset:e},n),outAnimation:P({galleryRect:a,detailRect:u,scrollOffset:e},t)}:{inAnimation:b({galleryRect:a,detailRect:u,scrollOffset:e},n),outAnimation:F({detailRect:u,galleryRect:a,pageRect:g,scrollOffset:e},t)}}const X=(t={})=>{var h,r;const n={stiffness:((h=t.spring)==null?void 0:h.stiffness)??50,damping:((r=t.spring)==null?void 0:r.damping)??10},e=t.timeout??300;let i=null,s=null,l=null;return{in:async(a,{scrollOffset:u})=>{const g=a;return!await new Promise(p=>{i?p(!0):(s=p,setTimeout(()=>{s=null,p(!1)},e))})||!i?(i=null,{spring:n,tick:()=>{}}):(l=L(i,g,u),l?(i=null,{spring:n,tick:p=>{l&&l.inAnimation(p)}}):{spring:n,tick:()=>{}})},out:async a=>({spring:n,onStart:()=>{i=a,s&&(s(!0),s=null)},prepare:u=>{k.prepareOutgoing(u),u.style.zIndex="-1"},tick:u=>{l&&l.outAnimation(u)}})}},I=(t={})=>{var s,l;const n=t.direction??"up",e={stiffness:((s=t.spring)==null?void 0:s.stiffness)??300,damping:((l=t.spring)==null?void 0:l.damping)??30},i=n==="up";return{in:h=>({spring:e,tick:r=>{const a=i?(1-r)*100:(1-r)*-100;h.style.transform=`translateY(${a}%)`}}),out:h=>({spring:e,tick:r=>{const a=i?(1-r)*-100:(1-r)*100;h.style.transform=`translateY(${a}%)`},prepare:k.prepareOutgoing})}};exports.fade=E;exports.hero=C;exports.pinterest=X;exports.scroll=I;
@@ -1,5 +1,5 @@
1
1
  export * from './fade';
2
2
  export * from './hero';
3
3
  export * from './pinterest';
4
- export * from './ripple';
4
+ export * from './scroll';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -21,7 +21,7 @@ const X = (t = {}) => {
21
21
  })
22
22
  };
23
23
  };
24
- function D(t, n) {
24
+ function M(t, n) {
25
25
  return t.querySelector(`[data-hero-key="${n}"]`);
26
26
  }
27
27
  function A(t, n) {
@@ -33,16 +33,16 @@ function A(t, n) {
33
33
  i.height
34
34
  );
35
35
  }
36
- const Y = (t = {}) => {
37
- var l, r;
36
+ const b = (t = {}) => {
37
+ var l, h;
38
38
  const n = {
39
39
  stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? 300,
40
- damping: ((r = t.spring) == null ? void 0 : r.damping) ?? 30
40
+ damping: ((h = t.spring) == null ? void 0 : h.damping) ?? 30
41
41
  }, e = t.timeout ?? 300;
42
42
  let i = null, s = null;
43
43
  return {
44
- in: async (c, o) => {
45
- const h = c, g = Array.from(h.querySelectorAll("[data-hero-key]"));
44
+ in: async (a, r) => {
45
+ const u = a, g = Array.from(u.querySelectorAll("[data-hero-key]"));
46
46
  if (g.length === 0)
47
47
  return {
48
48
  spring: n,
@@ -50,9 +50,9 @@ const Y = (t = {}) => {
50
50
  }
51
51
  // No hero elements, skip animation
52
52
  };
53
- if (!await new Promise((a) => {
54
- i ? a(!0) : (s = a, setTimeout(() => {
55
- s = null, a(!1);
53
+ if (!await new Promise((o) => {
54
+ i ? o(!0) : (s = o, setTimeout(() => {
55
+ s = null, o(!1);
56
56
  }, e));
57
57
  }) || !i)
58
58
  return i = null, {
@@ -61,24 +61,24 @@ const Y = (t = {}) => {
61
61
  }
62
62
  // No fromNode, skip animation
63
63
  };
64
- const p = g.map((a) => {
65
- const f = a.getAttribute("data-hero-key");
66
- if (!f) return null;
67
- const u = D(i, f);
68
- if (!u) return null;
69
- const d = a, $ = A(i, u), w = A(h, d), x = $.left - w.left - o.scrollOffset.x, M = $.top - w.top - o.scrollOffset.y, q = $.width / w.width, T = $.height / w.height, C = d.style.transform, E = d.style.position, P = d.style.transformOrigin;
64
+ const y = g.map((o) => {
65
+ const $ = o.getAttribute("data-hero-key");
66
+ if (!$) return null;
67
+ const c = M(i, $);
68
+ if (!c) return null;
69
+ const d = o, w = A(i, c), f = A(u, d), x = w.left - f.left - r.scrollOffset.x, B = w.top - f.top - r.scrollOffset.y, q = w.width / f.width, T = w.height / f.height, Y = d.style.transform, m = d.style.position, E = d.style.transformOrigin;
70
70
  return {
71
71
  toEl: d,
72
72
  dx: x,
73
- dy: M,
73
+ dy: B,
74
74
  dw: q,
75
75
  dh: T,
76
- originalTransform: C,
77
- originalPosition: E,
78
- originalTransformOrigin: P
76
+ originalTransform: Y,
77
+ originalPosition: m,
78
+ originalTransformOrigin: E
79
79
  };
80
80
  }).filter(Boolean);
81
- return i = null, p.length === 0 ? {
81
+ return i = null, y.length === 0 ? {
82
82
  spring: n,
83
83
  tick: () => {
84
84
  }
@@ -86,35 +86,35 @@ const Y = (t = {}) => {
86
86
  } : {
87
87
  spring: n,
88
88
  prepare: () => {
89
- p.forEach(({ toEl: a }) => {
90
- a.style.position = "relative", a.style.transformOrigin = "top left";
89
+ y.forEach(({ toEl: o }) => {
90
+ o.style.position = "relative", o.style.transformOrigin = "top left";
91
91
  });
92
92
  },
93
- tick: (a) => {
94
- p.forEach(({ toEl: f, dx: u, dy: d, dw: $, dh: w }) => {
95
- f.style.transform = `translate(${(1 - a) * u}px,${(1 - a) * d}px) scale(${a + (1 - a) * $}, ${a + (1 - a) * w})`;
93
+ tick: (o) => {
94
+ y.forEach(({ toEl: $, dx: c, dy: d, dw: w, dh: f }) => {
95
+ $.style.transform = `translate(${(1 - o) * c}px,${(1 - o) * d}px) scale(${o + (1 - o) * w}, ${o + (1 - o) * f})`;
96
96
  });
97
97
  },
98
98
  onEnd: () => {
99
- p.forEach(
99
+ y.forEach(
100
100
  ({
101
- toEl: a,
102
- originalTransform: f,
103
- originalPosition: u,
101
+ toEl: o,
102
+ originalTransform: $,
103
+ originalPosition: c,
104
104
  originalTransformOrigin: d
105
105
  }) => {
106
- a.style.transform = f, a.style.position = u, a.style.transformOrigin = d;
106
+ o.style.transform = $, o.style.position = c, o.style.transformOrigin = d;
107
107
  }
108
108
  );
109
109
  }
110
110
  };
111
111
  },
112
- out: async (c) => ({
112
+ out: async (a) => ({
113
113
  onStart: () => {
114
- i = c, s && (s(!0), s = null);
114
+ i = a, s && (s(!0), s = null);
115
115
  },
116
- prepare: (o) => {
117
- k(o), o.style.opacity = "0";
116
+ prepare: (r) => {
117
+ k(r), r.style.opacity = "0";
118
118
  }
119
119
  })
120
120
  };
@@ -128,39 +128,39 @@ function S(t, n) {
128
128
  i.height
129
129
  );
130
130
  }
131
- function H({
131
+ function C({
132
132
  detailRect: t,
133
133
  galleryRect: n,
134
134
  pageRect: e,
135
135
  scrollOffset: i
136
136
  }, s) {
137
- const l = n.left - t.left + (n.width - t.width) / 2 - i.x, r = n.top - t.top + (n.height - t.height) / 2 - i.y, c = n.width / t.width, o = n.height / t.height, h = Math.max(c, o), g = t.top / e.height * 100, y = (e.width - (t.left + t.width)) / e.width * 100, p = (e.height - (t.top + t.height)) / e.height * 100, a = t.left / e.width * 100;
138
- return s.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (f) => {
139
- const u = 1 - f, d = g * u, $ = y * u, w = p * u, x = a * u;
140
- s.style.clipPath = `inset(${d}% ${$}% ${w}% ${x}%)`, s.style.transform = `translate(${l * u}px, ${r * u}px) scale(${1 + (h - 1) * u})`;
137
+ const l = n.left - t.left + (n.width - t.width) / 2 - i.x, h = n.top - t.top + (n.height - t.height) / 2 - i.y, a = n.width / t.width, r = n.height / t.height, u = Math.max(a, r), g = t.top / e.height * 100, p = (e.width - (t.left + t.width)) / e.width * 100, y = (e.height - (t.top + t.height)) / e.height * 100, o = t.left / e.width * 100;
138
+ return s.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, ($) => {
139
+ const c = 1 - $, d = g * c, w = p * c, f = y * c, x = o * c;
140
+ s.style.clipPath = `inset(${d}% ${w}% ${f}% ${x}%)`, s.style.transform = `translate(${l * c}px, ${h * c}px) scale(${1 + (u - 1) * c})`;
141
141
  };
142
142
  }
143
- function b({
143
+ function D({
144
144
  galleryRect: t,
145
145
  detailRect: n,
146
146
  scrollOffset: e
147
147
  }, i) {
148
- const s = n.left - t.left + (n.width - t.width) / 2 + e.x, l = n.top - t.top + (n.height - t.height) / 2 + e.y, r = n.width / t.width, c = n.height / t.height, o = Math.max(r, c);
149
- return (h) => {
148
+ const s = n.left - t.left + (n.width - t.width) / 2 + e.x, l = n.top - t.top + (n.height - t.height) / 2 + e.y, h = n.width / t.width, a = n.height / t.height, r = Math.max(h, a);
149
+ return (u) => {
150
150
  i.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`;
151
- const g = 1 - h;
152
- i.style.transform = `translate(${s * g - e.x}px, ${l * g - e.y}px) scale(${1 + (o - 1) * g})`, i.style.opacity = `${1 - g}`;
151
+ const g = 1 - u;
152
+ i.style.transform = `translate(${s * g - e.x}px, ${l * g - e.y}px) scale(${1 + (r - 1) * g})`, i.style.opacity = `${1 - g}`;
153
153
  };
154
154
  }
155
- function O({
155
+ function P({
156
156
  galleryRect: t,
157
157
  detailRect: n,
158
158
  scrollOffset: e
159
159
  }, i) {
160
- const s = n.left - t.left + (n.width - t.width) / 2 - e.x, l = n.top - t.top + (n.height - t.height) / 2 - e.y, r = n.width / t.width, c = n.height / t.height, o = Math.max(r, c);
161
- return (h) => {
162
- const g = 1 - h, y = h;
163
- i.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, i.style.transform = `translate(${s * g}px, ${l * g}px) scale(${1 + (o - 1) * g})`, i.style.opacity = `${y}`;
160
+ const s = n.left - t.left + (n.width - t.width) / 2 - e.x, l = n.top - t.top + (n.height - t.height) / 2 - e.y, h = n.width / t.width, a = n.height / t.height, r = Math.max(h, a);
161
+ return (u) => {
162
+ const g = 1 - u, p = u;
163
+ i.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, i.style.transform = `translate(${s * g}px, ${l * g}px) scale(${1 + (r - 1) * g})`, i.style.opacity = `${p}`;
164
164
  };
165
165
  }
166
166
  function F({
@@ -169,13 +169,13 @@ function F({
169
169
  pageRect: e,
170
170
  scrollOffset: i
171
171
  }, s) {
172
- const l = n.left - t.left + (n.width - t.width) / 2 + i.x, r = n.top - t.top + (n.height - t.height) / 2 + i.y, c = n.width / t.width, o = n.height / t.height, h = Math.min(c, o), g = t.top / e.height * 100, y = (e.width - (t.left + t.width)) / e.width * 100, p = (e.height - (t.top + t.height)) / e.height * 100, a = t.left / e.width * 100;
173
- return s.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (f) => {
174
- const u = 1 - f, d = g * u, $ = y * u, w = p * u, x = a * u;
175
- s.style.clipPath = `inset(${d}% ${$}% ${w}% ${x}%)`, s.style.transform = `translate(${l * u - i.x}px, ${r * u - i.y}px) scale(${1 + (h - 1) * u})`;
172
+ const l = n.left - t.left + (n.width - t.width) / 2 + i.x, h = n.top - t.top + (n.height - t.height) / 2 + i.y, a = n.width / t.width, r = n.height / t.height, u = Math.min(a, r), g = t.top / e.height * 100, p = (e.width - (t.left + t.width)) / e.width * 100, y = (e.height - (t.top + t.height)) / e.height * 100, o = t.left / e.width * 100;
173
+ return s.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, ($) => {
174
+ const c = 1 - $, d = g * c, w = p * c, f = y * c, x = o * c;
175
+ s.style.clipPath = `inset(${d}% ${w}% ${f}% ${x}%)`, s.style.transform = `translate(${l * c - i.x}px, ${h * c - i.y}px) scale(${1 + (u - 1) * c})`;
176
176
  };
177
177
  }
178
- function I(t, n, e) {
178
+ function L(t, n, e) {
179
179
  const i = t.querySelector(
180
180
  "[data-pinterest-detail-key]"
181
181
  ), s = n.querySelector(
@@ -183,67 +183,67 @@ function I(t, n, e) {
183
183
  );
184
184
  if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || n.querySelectorAll("[data-pinterest-detail-key]").length > 1)
185
185
  return null;
186
- let l = null, r = null, c = !1;
186
+ let l = null, h = null, a = !1;
187
187
  if (!i && s) {
188
- r = s;
189
- const y = r.getAttribute("data-pinterest-detail-key");
190
- if (!y) return null;
188
+ h = s;
189
+ const p = h.getAttribute("data-pinterest-detail-key");
190
+ if (!p) return null;
191
191
  l = t.querySelector(
192
- `[data-pinterest-gallery-key="${y}"]`
193
- ), l && (c = !0);
192
+ `[data-pinterest-gallery-key="${p}"]`
193
+ ), l && (a = !0);
194
194
  } else if (i && !s) {
195
- r = i;
196
- const y = r.getAttribute("data-pinterest-detail-key");
197
- if (!y) return null;
195
+ h = i;
196
+ const p = h.getAttribute("data-pinterest-detail-key");
197
+ if (!p) return null;
198
198
  l = n.querySelector(
199
- `[data-pinterest-gallery-key="${y}"]`
200
- ), l && (c = !1);
199
+ `[data-pinterest-gallery-key="${p}"]`
200
+ ), l && (a = !1);
201
201
  }
202
- if (!l || !r)
202
+ if (!l || !h)
203
203
  return null;
204
- const o = S(c ? t : n, l), h = S(c ? n : t, r), g = n.getBoundingClientRect();
205
- return c ? {
206
- inAnimation: H(
207
- { detailRect: h, galleryRect: o, pageRect: g, scrollOffset: e },
204
+ const r = S(a ? t : n, l), u = S(a ? n : t, h), g = n.getBoundingClientRect();
205
+ return a ? {
206
+ inAnimation: C(
207
+ { detailRect: u, galleryRect: r, pageRect: g, scrollOffset: e },
208
208
  n
209
209
  ),
210
- outAnimation: b(
211
- { galleryRect: o, detailRect: h, scrollOffset: e },
210
+ outAnimation: D(
211
+ { galleryRect: r, detailRect: u, scrollOffset: e },
212
212
  t
213
213
  )
214
214
  } : {
215
- inAnimation: O(
216
- { galleryRect: o, detailRect: h, scrollOffset: e },
215
+ inAnimation: P(
216
+ { galleryRect: r, detailRect: u, scrollOffset: e },
217
217
  n
218
218
  ),
219
219
  outAnimation: F(
220
- { detailRect: h, galleryRect: o, pageRect: g, scrollOffset: e },
220
+ { detailRect: u, galleryRect: r, pageRect: g, scrollOffset: e },
221
221
  t
222
222
  )
223
223
  };
224
224
  }
225
- const m = (t = {}) => {
226
- var r, c;
225
+ const I = (t = {}) => {
226
+ var h, a;
227
227
  const n = {
228
- stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ?? 50,
229
- damping: ((c = t.spring) == null ? void 0 : c.damping) ?? 10
228
+ stiffness: ((h = t.spring) == null ? void 0 : h.stiffness) ?? 50,
229
+ damping: ((a = t.spring) == null ? void 0 : a.damping) ?? 10
230
230
  }, e = t.timeout ?? 300;
231
231
  let i = null, s = null, l = null;
232
232
  return {
233
- in: async (o, { scrollOffset: h }) => {
234
- const g = o;
235
- return !await new Promise((p) => {
236
- i ? p(!0) : (s = p, setTimeout(() => {
237
- s = null, p(!1);
233
+ in: async (r, { scrollOffset: u }) => {
234
+ const g = r;
235
+ return !await new Promise((y) => {
236
+ i ? y(!0) : (s = y, setTimeout(() => {
237
+ s = null, y(!1);
238
238
  }, e));
239
239
  }) || !i ? (i = null, {
240
240
  spring: n,
241
241
  tick: () => {
242
242
  }
243
- }) : (l = I(i, g, h), l ? (i = null, {
243
+ }) : (l = L(i, g, u), l ? (i = null, {
244
244
  spring: n,
245
- tick: (p) => {
246
- l && l.inAnimation(p);
245
+ tick: (y) => {
246
+ l && l.inAnimation(y);
247
247
  }
248
248
  }) : {
249
249
  spring: n,
@@ -251,55 +251,46 @@ const m = (t = {}) => {
251
251
  }
252
252
  });
253
253
  },
254
- out: async (o) => ({
254
+ out: async (r) => ({
255
255
  spring: n,
256
256
  onStart: () => {
257
- i = o, s && (s(!0), s = null);
257
+ i = r, s && (s(!0), s = null);
258
258
  },
259
- prepare: (h) => {
260
- k(h), h.style.zIndex = "-1";
259
+ prepare: (u) => {
260
+ k(u), u.style.zIndex = "-1";
261
261
  },
262
- tick: (h) => {
263
- l && l.outAnimation(h);
262
+ tick: (u) => {
263
+ l && l.outAnimation(u);
264
264
  }
265
265
  })
266
266
  };
267
- };
268
- function B(t) {
269
- const n = t.getBoundingClientRect(), e = t.clientHeight, s = 50 * (window.innerHeight - n.top) / e;
270
- return Math.min(Math.max(s, 0), 100);
271
- }
272
- const z = (t = {}) => {
273
- var e, i;
274
- const n = {
275
- stiffness: ((e = t.spring) == null ? void 0 : e.stiffness) ?? 300,
276
- damping: ((i = t.spring) == null ? void 0 : i.damping) ?? 200
277
- };
267
+ }, G = (t = {}) => {
268
+ var s, l;
269
+ const n = t.direction ?? "up", e = {
270
+ stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? 300,
271
+ damping: ((l = t.spring) == null ? void 0 : l.damping) ?? 30
272
+ }, i = n === "up";
278
273
  return {
279
- in: (s) => {
280
- const l = B(s);
281
- return {
282
- spring: n,
283
- tick: (r) => {
284
- s.style.clipPath = `circle(${r * 100}% at 50% ${l}%)`;
285
- }
286
- };
287
- },
288
- out: (s) => {
289
- const l = B(s);
290
- return {
291
- spring: n,
292
- tick: (r) => {
293
- s.style.clipPath = `circle(${r * 100}% at 50% ${l}%)`, s.style.zIndex = "100";
294
- },
295
- prepare: k
296
- };
297
- }
274
+ in: (h) => ({
275
+ spring: e,
276
+ tick: (a) => {
277
+ const r = i ? (1 - a) * 100 : (1 - a) * -100;
278
+ h.style.transform = `translateY(${r}%)`;
279
+ }
280
+ }),
281
+ out: (h) => ({
282
+ spring: e,
283
+ tick: (a) => {
284
+ const r = i ? (1 - a) * -100 : (1 - a) * 100;
285
+ h.style.transform = `translateY(${r}%)`;
286
+ },
287
+ prepare: k
288
+ })
298
289
  };
299
290
  };
300
291
  export {
301
292
  X as fade,
302
- Y as hero,
303
- m as pinterest,
304
- z as ripple
293
+ b as hero,
294
+ I as pinterest,
295
+ G as scroll
305
296
  };
@@ -0,0 +1,8 @@
1
+ import { SpringConfig, SggoiTransition } from '../types';
2
+ interface ScrollOptions {
3
+ direction?: "up" | "down";
4
+ spring?: Partial<SpringConfig>;
5
+ }
6
+ export declare const scroll: (options?: ScrollOptions) => SggoiTransition;
7
+ export {};
8
+ //# sourceMappingURL=scroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG9D,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,eA8BpD,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ssgoi/core",
3
- "version": "0.0.3",
4
- "description": "A smooth page transition library",
3
+ "version": "2.0.0",
4
+ "description": "Core animation engine for SSGOI - Native app-like page transitions with spring physics",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs",
@@ -31,6 +31,12 @@
31
31
  "import": "./dist/types.js",
32
32
  "require": "./dist/types.cjs",
33
33
  "default": "./dist/types.js"
34
+ },
35
+ "./presets": {
36
+ "types": "./dist/presets/index.d.ts",
37
+ "import": "./dist/presets/index.js",
38
+ "require": "./dist/presets/index.cjs",
39
+ "default": "./dist/presets/index.js"
34
40
  }
35
41
  },
36
42
  "files": [
@@ -46,13 +52,23 @@
46
52
  "spring-physics",
47
53
  "ssgoi"
48
54
  ],
49
- "author": "",
55
+ "author": "MeurSyphus <tmdeoans@snu.ac.kr>",
50
56
  "license": "MIT",
51
57
  "repository": {
52
58
  "type": "git",
53
- "url": "https://github.com/yourusername/ssgoi.git",
59
+ "url": "git+https://github.com/meursyphus/ssgoi.git",
54
60
  "directory": "packages/core"
55
61
  },
62
+ "homepage": "https://ssgoi.dev",
63
+ "bugs": {
64
+ "url": "https://github.com/meursyphus/ssgoi/issues"
65
+ },
66
+ "publishConfig": {
67
+ "access": "public"
68
+ },
69
+ "engines": {
70
+ "node": ">=18.0.0"
71
+ },
56
72
  "devDependencies": {
57
73
  "@types/node": "^22.10.6",
58
74
  "typescript": "^5.7.3",
@@ -64,6 +80,7 @@
64
80
  },
65
81
  "scripts": {
66
82
  "dev": "vite",
83
+ "watch": "vite build --watch",
67
84
  "build": "tsc && vite build",
68
85
  "preview": "vite preview"
69
86
  }