@ssgoi/core 4.0.0 → 4.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.
- package/dist/animator/integrator/double-spring-integrator.d.ts +6 -0
- package/dist/animator/integrator/double-spring-integrator.d.ts.map +1 -1
- package/dist/animator/integrator/inertia-integrator.d.ts +15 -0
- package/dist/animator/integrator/inertia-integrator.d.ts.map +1 -1
- package/dist/animator/integrator/provider.d.ts.map +1 -1
- package/dist/animator/integrator/spring-integrator.d.ts +6 -0
- package/dist/animator/integrator/spring-integrator.d.ts.map +1 -1
- package/dist/animator/multi-animator.d.ts +16 -11
- package/dist/animator/multi-animator.d.ts.map +1 -1
- package/dist/animator/runner/css-runner.d.ts.map +1 -1
- package/dist/animator/single-animator.d.ts +6 -4
- package/dist/animator/single-animator.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +603 -518
- package/dist/provider-Cs5iBqRD.cjs +1 -0
- package/dist/provider-Cu4NSF1Q.js +167 -0
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts +4 -1
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/navigation-detector-strategy.d.ts +42 -0
- package/dist/ssgoi-transition/navigation-detector-strategy.d.ts.map +1 -0
- package/dist/transition/create-transition-callback.d.ts.map +1 -1
- package/dist/transition/transition-strategy.d.ts +6 -6
- package/dist/transition/transition-strategy.d.ts.map +1 -1
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.js +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +84 -35
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +39 -46
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/wait-paint.d.ts +15 -0
- package/dist/utils/wait-paint.d.ts.map +1 -0
- package/dist/view-transitions/depth.d.ts.map +1 -1
- package/dist/view-transitions/drill.d.ts.map +1 -1
- package/dist/view-transitions/hero.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +15 -15
- package/dist/view-transitions/index.js +673 -688
- package/dist/view-transitions/pinterest.d.ts.map +1 -1
- package/dist/view-transitions/scroll.d.ts.map +1 -1
- package/dist/view-transitions/sheet.d.ts.map +1 -1
- package/dist/view-transitions/swap.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/provider-B6Xnh0BA.cjs +0 -1
- package/dist/provider-CMBovM_W.js +0 -134
- package/dist/ssgoi-transition/types.d.ts +0 -8
- package/dist/ssgoi-transition/types.d.ts.map +0 -1
|
@@ -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;AAQhE,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AA0UD,eAAO,MAAM,SAAS,GAAI,UAAS,gBAAqB,KAAG,
|
|
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;AAQhE,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGhE,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAMD,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,
|
|
1
|
+
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGhE,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAMD,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,eAkGpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/sheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAGhB,MAAM,UAAU,CAAC;AAkBlB,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAoBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/sheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAGhB,MAAM,UAAU,CAAC;AAkBlB,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAoBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eAqHlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/swap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAGhB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/swap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAGhB,MAAM,UAAU,CAAC;AAiBlB,UAAU,WAAW;IACnB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAoBD;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eAqEhD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var y=Object.defineProperty;var H=(i,e,t)=>e in i?y(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var r=(i,e,t)=>H(i,typeof e!="symbol"?e+"":e,t);class T{constructor(e){r(this,"omega");r(this,"zeta");const{stiffness:t,damping:s}=e,n=1;this.omega=Math.sqrt(t/n),this.zeta=s/(2*Math.sqrt(t*n))}step(e,t,s){const n=Math.min(s,.033),{omega:o,zeta:a}=this,{position:l,velocity:c}=e,p=-2*n*a*o*c,S=n*o*o*(t-l),d=c+p+S;return{position:l+n*d,velocity:d}}isSettled(e,t){const s=Math.abs(t-e.position),n=Math.abs(e.velocity);return s<.01&&n<.01}}class u{constructor(e){r(this,"leader");r(this,"follower");this.leader=new T({stiffness:e.stiffness,damping:e.damping});let t,s;typeof e.follower=="number"?(t=e.stiffness*e.follower,s=e.damping):e.follower?(t=e.follower.stiffness,s=e.follower.damping):(t=e.stiffness,s=e.damping),this.follower=new T({stiffness:t,damping:s})}step(e,t,s){const o=e._leader??{position:e.position,velocity:e.velocity},a=this.leader.step(o,t,s),l=this.follower.step(e,a.position,s);return{position:l.position,velocity:l.velocity,_leader:a}}isSettled(e,t){const s=e,n=Math.abs(t-e.position)<.01&&Math.abs(e.velocity)<.01;return s._leader?Math.abs(t-s._leader.position)<.01&&Math.abs(s._leader.velocity)<.01&&n:n}}const E=.01;class O{constructor(e){r(this,"acceleration");r(this,"resistance");r(this,"resistanceType");this.acceleration=e.acceleration,this.resistance=e.resistance,this.resistanceType=e.resistanceType??"quadratic"}step(e,t,s){const n=Math.min(s,.033),{acceleration:o,resistance:a,resistanceType:l}=this,{position:c,velocity:p}=e,S=t>c?1:-1;let d;l==="linear"?d=a*p:d=a*p*Math.abs(p);const m=S*o-d,w=p+m*n;let f=c+w*n;return(S>0&&f>t||S<0&&f<t)&&(f=t),{position:f,velocity:f===t?0:w}}isSettled(e,t){return Math.abs(t-e.position)<E}}class h{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});const t=e.spring??{stiffness:300,damping:30};if(t.doubleSpring){const s=t.doubleSpring;let n;return typeof s=="number"?n=s:typeof s=="object"&&(n={stiffness:s.stiffness,damping:s.damping}),new u({stiffness:t.stiffness,damping:t.damping,follower:n})}return new T({stiffness:t.stiffness,damping:t.damping})}static fromSpring(e){return h.from({spring:e})}}exports.DoubleSpringIntegrator=u;exports.InertiaIntegrator=O;exports.IntegratorProvider=h;exports.SETTLE_THRESHOLD=.05;exports.SpringIntegrator=T;
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
var u = Object.defineProperty;
|
|
2
|
-
var y = (i, e, t) => e in i ? u(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
-
var r = (i, e, t) => y(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
const E = 0.05;
|
|
5
|
-
class h {
|
|
6
|
-
// Damping ratio
|
|
7
|
-
constructor(e) {
|
|
8
|
-
r(this, "omega");
|
|
9
|
-
// Angular frequency
|
|
10
|
-
r(this, "zeta");
|
|
11
|
-
const { stiffness: t, damping: s } = e, n = 1;
|
|
12
|
-
this.omega = Math.sqrt(t / n), this.zeta = s / (2 * Math.sqrt(t * n));
|
|
13
|
-
}
|
|
14
|
-
step(e, t, s) {
|
|
15
|
-
const n = Math.min(s, 0.033), { omega: o, zeta: a } = this, { position: l, velocity: c } = e, p = -2 * n * a * o * c, S = n * o * o * (t - l), d = c + p + S;
|
|
16
|
-
return {
|
|
17
|
-
position: l + n * d,
|
|
18
|
-
velocity: d
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
isSettled(e, t) {
|
|
22
|
-
const s = Math.abs(t - e.position), n = Math.abs(e.velocity);
|
|
23
|
-
return s < 0.01 && n < 0.01;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
class O {
|
|
27
|
-
constructor(e) {
|
|
28
|
-
r(this, "leader");
|
|
29
|
-
r(this, "follower");
|
|
30
|
-
this.leader = new h({
|
|
31
|
-
stiffness: e.stiffness,
|
|
32
|
-
damping: e.damping
|
|
33
|
-
});
|
|
34
|
-
let t, s;
|
|
35
|
-
typeof e.follower == "number" ? (t = e.stiffness * e.follower, s = e.damping) : e.follower ? (t = e.follower.stiffness, s = e.follower.damping) : (t = e.stiffness, s = e.damping), this.follower = new h({
|
|
36
|
-
stiffness: t,
|
|
37
|
-
damping: s
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
step(e, t, s) {
|
|
41
|
-
const o = e._leader ?? {
|
|
42
|
-
position: e.position,
|
|
43
|
-
velocity: e.velocity
|
|
44
|
-
}, a = this.leader.step(o, t, s), l = this.follower.step(
|
|
45
|
-
e,
|
|
46
|
-
a.position,
|
|
47
|
-
s
|
|
48
|
-
);
|
|
49
|
-
return {
|
|
50
|
-
position: l.position,
|
|
51
|
-
velocity: l.velocity,
|
|
52
|
-
_leader: a
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
isSettled(e, t) {
|
|
56
|
-
const s = e, n = Math.abs(t - e.position) < 0.01 && Math.abs(e.velocity) < 0.01;
|
|
57
|
-
return s._leader ? Math.abs(t - s._leader.position) < 0.01 && Math.abs(s._leader.velocity) < 0.01 && n : n;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
const H = 0.01;
|
|
61
|
-
class I {
|
|
62
|
-
constructor(e) {
|
|
63
|
-
r(this, "acceleration");
|
|
64
|
-
r(this, "resistance");
|
|
65
|
-
r(this, "resistanceType");
|
|
66
|
-
this.acceleration = e.acceleration, this.resistance = e.resistance, this.resistanceType = e.resistanceType ?? "quadratic";
|
|
67
|
-
}
|
|
68
|
-
step(e, t, s) {
|
|
69
|
-
const n = Math.min(s, 0.033), { acceleration: o, resistance: a, resistanceType: l } = this, { position: c, velocity: p } = e, S = t > c ? 1 : -1;
|
|
70
|
-
let d;
|
|
71
|
-
l === "linear" ? d = a * p : d = a * p * Math.abs(p);
|
|
72
|
-
const m = S * o - d, w = p + m * n;
|
|
73
|
-
let f = c + w * n;
|
|
74
|
-
return (S > 0 && f > t || S < 0 && f < t) && (f = t), {
|
|
75
|
-
position: f,
|
|
76
|
-
velocity: f === t ? 0 : w
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
isSettled(e, t) {
|
|
80
|
-
return Math.abs(t - e.position) < H;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
class T {
|
|
84
|
-
/**
|
|
85
|
-
* Create an Integrator from physics config
|
|
86
|
-
*
|
|
87
|
-
* @param config Physics configuration (spring or inertia)
|
|
88
|
-
* @returns Appropriate Integrator instance
|
|
89
|
-
* @throws Error if both spring and inertia are provided
|
|
90
|
-
*/
|
|
91
|
-
static from(e) {
|
|
92
|
-
if (e.spring && e.inertia)
|
|
93
|
-
throw new Error(
|
|
94
|
-
"Cannot use both 'spring' and 'inertia' together. Choose one physics type."
|
|
95
|
-
);
|
|
96
|
-
if (e.inertia)
|
|
97
|
-
return new I({
|
|
98
|
-
acceleration: e.inertia.acceleration,
|
|
99
|
-
resistance: e.inertia.resistance,
|
|
100
|
-
resistanceType: e.inertia.resistanceType
|
|
101
|
-
});
|
|
102
|
-
const t = e.spring ?? { stiffness: 300, damping: 30 };
|
|
103
|
-
if (t.doubleSpring) {
|
|
104
|
-
const s = t.doubleSpring;
|
|
105
|
-
let n;
|
|
106
|
-
return typeof s == "number" ? n = s : typeof s == "object" && (n = {
|
|
107
|
-
stiffness: s.stiffness,
|
|
108
|
-
damping: s.damping
|
|
109
|
-
}), new O({
|
|
110
|
-
stiffness: t.stiffness,
|
|
111
|
-
damping: t.damping,
|
|
112
|
-
follower: n
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
return new h({
|
|
116
|
-
stiffness: t.stiffness,
|
|
117
|
-
damping: t.damping
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Create an Integrator from SpringConfig (legacy support)
|
|
122
|
-
* @deprecated Use from({ spring: config }) instead
|
|
123
|
-
*/
|
|
124
|
-
static fromSpring(e) {
|
|
125
|
-
return T.from({ spring: e });
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
export {
|
|
129
|
-
O as D,
|
|
130
|
-
T as I,
|
|
131
|
-
E as S,
|
|
132
|
-
h as a,
|
|
133
|
-
I as b
|
|
134
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GetTransitionConfig } from '../types';
|
|
2
|
-
export type PendingTransition = {
|
|
3
|
-
from?: string;
|
|
4
|
-
to?: string;
|
|
5
|
-
outResolve?: (transition: GetTransitionConfig) => void;
|
|
6
|
-
inResolve?: (transition: GetTransitionConfig) => void;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACvD,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACvD,CAAC"}
|