@ssgoi/core 5.0.2 → 5.2.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 (43) hide show
  1. package/dist/animator/multi-animator.d.ts.map +1 -1
  2. package/dist/animator/runner/keyframes-runner.d.ts +14 -0
  3. package/dist/animator/runner/keyframes-runner.d.ts.map +1 -0
  4. package/dist/animator/runner/provider.d.ts +12 -3
  5. package/dist/animator/runner/provider.d.ts.map +1 -1
  6. package/dist/animator/single-animator.d.ts +7 -0
  7. package/dist/animator/single-animator.d.ts.map +1 -1
  8. package/dist/index.cjs +1 -1
  9. package/dist/index.js +636 -506
  10. package/dist/{provider-Cu4NSF1Q.js → provider-B2B8CK6H.js} +37 -62
  11. package/dist/provider-BKaONTeg.cjs +1 -0
  12. package/dist/spring-integrator-95Mh7mdw.cjs +1 -0
  13. package/dist/spring-integrator-BM4a-82c.js +33 -0
  14. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts +2 -2
  15. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
  16. package/dist/ssgoi-transition/create-swipe-back-detector.d.ts +43 -0
  17. package/dist/ssgoi-transition/create-swipe-back-detector.d.ts.map +1 -0
  18. package/dist/ssgoi-transition/navigation-detector-strategy.d.ts +2 -2
  19. package/dist/transitions/index.cjs +1 -1
  20. package/dist/transitions/index.js +33 -32
  21. package/dist/types.cjs +1 -1
  22. package/dist/types.d.ts +77 -73
  23. package/dist/types.d.ts.map +1 -1
  24. package/dist/types.js +44 -36
  25. package/dist/utils/index.d.ts +0 -4
  26. package/dist/utils/index.d.ts.map +1 -1
  27. package/dist/view-transitions/film.d.ts.map +1 -1
  28. package/dist/view-transitions/index.cjs +15 -15
  29. package/dist/view-transitions/index.js +884 -775
  30. package/dist/view-transitions/instagram.d.ts.map +1 -1
  31. package/dist/view-transitions/pinterest.d.ts.map +1 -1
  32. package/package.json +1 -1
  33. package/dist/provider-Cs5iBqRD.cjs +0 -1
  34. package/dist/ssgoi-transition/create-navigation-direction-detector.d.ts +0 -20
  35. package/dist/ssgoi-transition/create-navigation-direction-detector.d.ts.map +0 -1
  36. package/dist/utils/is-android.d.ts +0 -5
  37. package/dist/utils/is-android.d.ts.map +0 -1
  38. package/dist/utils/is-desktop.d.ts +0 -5
  39. package/dist/utils/is-desktop.d.ts.map +0 -1
  40. package/dist/utils/is-ios.d.ts +0 -6
  41. package/dist/utils/is-ios.d.ts.map +0 -1
  42. package/dist/utils/match-platform.d.ts +0 -8
  43. package/dist/utils/match-platform.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"instagram.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/instagram.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAUhE,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAgPD,eAAO,MAAM,SAAS,GAAI,UAAS,gBAAqB,KAAG,eA2G1D,CAAC"}
1
+ {"version":3,"file":"instagram.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/instagram.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAWhE,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAgPD,eAAO,MAAM,SAAS,GAAI,UAAS,gBAAqB,KAAG,eAoI1D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pinterest.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/pinterest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAWhE,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AA0UD,eAAO,MAAM,SAAS,GAAI,UAAS,gBAAqB,KAAG,eAoG1D,CAAC"}
1
+ {"version":3,"file":"pinterest.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/pinterest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAahE,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AA0UD,eAAO,MAAM,SAAS,GAAI,UAAS,gBAAqB,KAAG,eA8H1D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssgoi/core",
3
- "version": "5.0.2",
3
+ "version": "5.2.0",
4
4
  "description": "Core animation engine for SSGOI - Native app-like page transitions with spring physics",
5
5
  "private": false,
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- "use strict";var L=Object.defineProperty;var _=(o,e,t)=>e in o?L(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var n=(o,e,t)=>_(o,typeof e!="symbol"?e+"":e,t);class u{constructor(e){n(this,"omega");n(this,"zeta");n(this,"restDelta");n(this,"restSpeed");const{stiffness:t,damping:s}=e,i=1;this.omega=Math.sqrt(t/i),this.zeta=s/(2*Math.sqrt(t*i)),this.restDelta=e.restDelta??.01,this.restSpeed=e.restSpeed??.01}step(e,t,s){const i=Math.min(s,.033),{omega:r,zeta:p}=this,{position:c,velocity:d}=e,h=-2*i*p*r*d,a=i*r*r*(t-c),l=d+h+a;return{position:c+i*l,velocity:l}}isSettled(e,t){const s=Math.abs(t-e.position),i=Math.abs(e.velocity);return s<this.restDelta&&i<this.restSpeed}}class E{constructor(e){n(this,"leader");n(this,"follower");n(this,"restDelta");n(this,"restSpeed");this.restDelta=e.restDelta??.01,this.restSpeed=e.restSpeed??.01,this.leader=new u({stiffness:e.stiffness,damping:e.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let t,s,i,r;typeof e.follower=="number"?(t=e.stiffness*e.follower,s=e.damping):e.follower?(t=e.follower.stiffness,s=e.follower.damping,i=e.follower.restDelta,r=e.follower.restSpeed):(t=e.stiffness,s=e.damping),this.follower=new u({stiffness:t,damping:s,restDelta:i??this.restDelta,restSpeed:r??this.restSpeed})}step(e,t,s){const r=e._leader??{position:e.position,velocity:e.velocity},p=this.leader.step(r,t,s),c=this.follower.step(e,p.position,s);return{position:c.position,velocity:c.velocity,_leader:p}}isSettled(e,t){const s=e,i=Math.abs(t-e.position)<this.restDelta&&Math.abs(e.velocity)<this.restSpeed;return s._leader?Math.abs(t-s._leader.position)<this.restDelta&&Math.abs(s._leader.velocity)<this.restSpeed&&i:i}}const v=.01,M=500,R=10;class O{constructor(e){n(this,"acceleration");n(this,"resistance");n(this,"resistanceType");n(this,"min");n(this,"max");n(this,"bounceStiffness");n(this,"bounceDamping");n(this,"restDelta");this.acceleration=e.acceleration,this.resistance=e.resistance,this.resistanceType=e.resistanceType??"quadratic",this.min=e.min,this.max=e.max,this.bounceStiffness=e.bounceStiffness??M,this.bounceDamping=e.bounceDamping??R,this.restDelta=e.restDelta??v}step(e,t,s){const i=Math.min(s,.033),{acceleration:r,resistance:p,resistanceType:c,min:d,max:h}=this,{position:a,velocity:l}=e,f=d!==void 0&&a<d,w=h!==void 0&&a>h;let b;if(f||w){const D=a-(f?d:h),I=-this.bounceStiffness*D,H=-this.bounceDamping*l;b=I+H}else{const m=t>a?1:-1;let D;c==="linear"?D=p*l:D=p*l*Math.abs(l),b=m*r-D}const y=l+b*i;let S=a+y*i;if(!f&&!w){const m=t>a?1:-1;(m>0&&S>t||m<0&&S<t)&&(S=t)}return{position:S,velocity:S===t?0:y}}isSettled(e,t){return Math.abs(t-e.position)<this.restDelta}}class T{static from(e){if(e.spring&&e.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(e.inertia)return new O({acceleration:e.inertia.acceleration,resistance:e.inertia.resistance,resistanceType:e.inertia.resistanceType,min:e.inertia.min,max:e.inertia.max,bounceStiffness:e.inertia.bounceStiffness,bounceDamping:e.inertia.bounceDamping,restDelta:e.inertia.restDelta});const t=e.spring??{stiffness:300,damping:30};if(t.doubleSpring){const s=t.doubleSpring;let i;return typeof s=="number"?i=s:typeof s=="object"&&(i={stiffness:s.stiffness,damping:s.damping}),new E({stiffness:t.stiffness,damping:t.damping,follower:i,restDelta:t.restDelta,restSpeed:t.restSpeed})}return new u({stiffness:t.stiffness,damping:t.damping,restDelta:t.restDelta,restSpeed:t.restSpeed})}static fromSpring(e){return T.from({spring:e})}}exports.DoubleSpringIntegrator=E;exports.InertiaIntegrator=O;exports.IntegratorProvider=T;exports.SETTLE_THRESHOLD=.05;exports.SpringIntegrator=u;
@@ -1,20 +0,0 @@
1
- /**
2
- * Navigation Direction Detector
3
- *
4
- * Detects navigation direction (push/back/forward) using history.state and popstate event.
5
- * Used to skip animations on back navigation for iOS Safari compatibility.
6
- *
7
- * How it works:
8
- * - Stores an incrementing index in history.state.ssgoiIndex
9
- * - On popstate, compares the new index with current to determine direction
10
- * - newIndex < currentIndex → back
11
- * - newIndex > currentIndex → forward
12
- * - No popstate → push (new navigation)
13
- */
14
- export type NavigationDirection = "push" | "back" | "forward";
15
- export declare function createNavigationDirectionDetector(): {
16
- initialize: () => void;
17
- onPageEnter: () => NavigationDirection;
18
- isBack: () => boolean;
19
- };
20
- //# sourceMappingURL=create-navigation-direction-detector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-navigation-direction-detector.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-navigation-direction-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAE9D,wBAAgB,iCAAiC;;uBA4CvB,mBAAmB;;EAyB5C"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Detects if the current runtime is Android
3
- */
4
- export declare function isAndroid(): boolean;
5
- //# sourceMappingURL=is-android.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-android.d.ts","sourceRoot":"","sources":["../../src/lib/utils/is-android.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Detects if the current runtime is a desktop browser (non-mobile)
3
- */
4
- export declare function isDesktop(): boolean;
5
- //# sourceMappingURL=is-desktop.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-desktop.d.ts","sourceRoot":"","sources":["../../src/lib/utils/is-desktop.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Detects if the current runtime is iOS (iPhone, iPad, iPod)
3
- * Also detects iPad on iOS 13+ which reports as MacIntel but has touch
4
- */
5
- export declare function isIOS(): boolean;
6
- //# sourceMappingURL=is-ios.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-ios.d.ts","sourceRoot":"","sources":["../../src/lib/utils/is-ios.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAU/B"}
@@ -1,8 +0,0 @@
1
- import { Platform } from '../types';
2
- /**
3
- * Check if current platform matches any of the specified platforms
4
- * @param platforms Array of platforms to check against
5
- * @returns true if current platform matches any in the array
6
- */
7
- export declare function matchPlatform(platforms: Platform[]): boolean;
8
- //# sourceMappingURL=match-platform.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"match-platform.d.ts","sourceRoot":"","sources":["../../src/lib/utils/match-platform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAKzC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAsB5D"}