@ssgoi/core 3.4.0 → 4.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.
- package/dist/animator/integrator/double-spring-integrator.d.ts +25 -0
- package/dist/animator/integrator/double-spring-integrator.d.ts.map +1 -0
- package/dist/animator/integrator/index.d.ts +13 -0
- package/dist/animator/integrator/index.d.ts.map +1 -0
- package/dist/animator/integrator/inertia-integrator.d.ts +19 -0
- package/dist/animator/integrator/inertia-integrator.d.ts.map +1 -0
- package/dist/animator/integrator/provider.d.ts +22 -0
- package/dist/animator/integrator/provider.d.ts.map +1 -0
- package/dist/animator/integrator/spring-integrator.d.ts +13 -0
- package/dist/animator/integrator/spring-integrator.d.ts.map +1 -0
- package/dist/animator/integrator/types.d.ts +34 -0
- package/dist/animator/integrator/types.d.ts.map +1 -0
- package/dist/animator/multi-animator.d.ts +2 -2
- package/dist/animator/multi-animator.d.ts.map +1 -1
- package/dist/animator/{animate → runner}/css-runner.d.ts +2 -2
- package/dist/animator/runner/css-runner.d.ts.map +1 -0
- package/dist/animator/runner/provider.d.ts +35 -0
- package/dist/animator/runner/provider.d.ts.map +1 -0
- package/dist/animator/{animate → runner}/tick-runner.d.ts +2 -2
- package/dist/animator/runner/tick-runner.d.ts.map +1 -0
- package/dist/animator/runner/ticker.d.ts.map +1 -0
- package/dist/animator/{animate → runner}/types.d.ts +6 -3
- package/dist/animator/runner/types.d.ts.map +1 -0
- package/dist/animator/{index.d.ts → single-animator.d.ts} +17 -9
- package/dist/animator/single-animator.d.ts.map +1 -0
- package/dist/animator/{animation.d.ts → types.d.ts} +2 -2
- package/dist/animator/types.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +480 -535
- package/dist/provider-B6Xnh0BA.cjs +1 -0
- package/dist/provider-CMBovM_W.js +134 -0
- package/dist/transition/transition-strategy.d.ts +2 -2
- package/dist/transition/transition-strategy.d.ts.map +1 -1
- package/dist/transitions/blur.d.ts +4 -7
- package/dist/transitions/blur.d.ts.map +1 -1
- package/dist/transitions/bounce.d.ts +4 -7
- package/dist/transitions/bounce.d.ts.map +1 -1
- package/dist/transitions/fade.d.ts +4 -7
- package/dist/transitions/fade.d.ts.map +1 -1
- package/dist/transitions/fly.d.ts +2 -5
- package/dist/transitions/fly.d.ts.map +1 -1
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.d.ts +5 -0
- package/dist/transitions/index.d.ts.map +1 -1
- package/dist/transitions/index.js +153 -194
- package/dist/transitions/mask.d.ts +2 -5
- package/dist/transitions/mask.d.ts.map +1 -1
- package/dist/transitions/none.d.ts +2 -5
- package/dist/transitions/none.d.ts.map +1 -1
- package/dist/transitions/rotate.d.ts +4 -7
- package/dist/transitions/rotate.d.ts.map +1 -1
- package/dist/transitions/scale.d.ts +4 -7
- package/dist/transitions/scale.d.ts.map +1 -1
- package/dist/transitions/slide.d.ts +4 -7
- package/dist/transitions/slide.d.ts.map +1 -1
- package/dist/transitions/utils.d.ts +8 -0
- package/dist/transitions/utils.d.ts.map +1 -0
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +59 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +6 -6
- package/dist/view-transitions/blind.d.ts +2 -3
- package/dist/view-transitions/blind.d.ts.map +1 -1
- package/dist/view-transitions/curtain-reveal.d.ts +2 -3
- package/dist/view-transitions/curtain-reveal.d.ts.map +1 -1
- package/dist/view-transitions/depth.d.ts +19 -0
- package/dist/view-transitions/depth.d.ts.map +1 -0
- package/dist/view-transitions/drill.d.ts +2 -2
- package/dist/view-transitions/drill.d.ts.map +1 -1
- package/dist/view-transitions/fade.d.ts +2 -3
- package/dist/view-transitions/fade.d.ts.map +1 -1
- package/dist/view-transitions/film.d.ts +2 -1
- package/dist/view-transitions/film.d.ts.map +1 -1
- package/dist/view-transitions/hero.d.ts +2 -2
- package/dist/view-transitions/hero.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +15 -15
- package/dist/view-transitions/index.d.ts +6 -2
- package/dist/view-transitions/index.d.ts.map +1 -1
- package/dist/view-transitions/index.js +1076 -678
- package/dist/view-transitions/instagram.d.ts +2 -2
- package/dist/view-transitions/instagram.d.ts.map +1 -1
- package/dist/view-transitions/jaemin.d.ts +2 -6
- package/dist/view-transitions/jaemin.d.ts.map +1 -1
- package/dist/view-transitions/pinterest.d.ts +2 -2
- package/dist/view-transitions/pinterest.d.ts.map +1 -1
- package/dist/view-transitions/rotate.d.ts +5 -2
- package/dist/view-transitions/rotate.d.ts.map +1 -1
- package/dist/view-transitions/scroll.d.ts +2 -2
- package/dist/view-transitions/scroll.d.ts.map +1 -1
- package/dist/view-transitions/sheet.d.ts +19 -0
- package/dist/view-transitions/sheet.d.ts.map +1 -0
- package/dist/view-transitions/slide.d.ts +2 -2
- package/dist/view-transitions/slide.d.ts.map +1 -1
- package/dist/view-transitions/snap.d.ts +14 -0
- package/dist/view-transitions/snap.d.ts.map +1 -0
- package/dist/view-transitions/strip.d.ts +6 -2
- package/dist/view-transitions/strip.d.ts.map +1 -1
- package/dist/view-transitions/swap.d.ts +13 -0
- package/dist/view-transitions/swap.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/animator/animate/css-runner.d.ts.map +0 -1
- package/dist/animator/animate/index.d.ts +0 -42
- package/dist/animator/animate/index.d.ts.map +0 -1
- package/dist/animator/animate/tick-runner.d.ts.map +0 -1
- package/dist/animator/animate/types.d.ts.map +0 -1
- package/dist/animator/animation.d.ts.map +0 -1
- package/dist/animator/index.d.ts.map +0 -1
- package/dist/animator/spring-core.d.ts +0 -82
- package/dist/animator/spring-core.d.ts.map +0 -1
- package/dist/animator/ticker.d.ts.map +0 -1
- package/dist/jaemin-BG8HRXG1.cjs +0 -1
- package/dist/jaemin-BWkrXq0V.js +0 -131
- /package/dist/animator/{ticker.d.ts → runner/ticker.d.ts} +0 -0
|
@@ -1,78 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { D as v, b as T, I as j, a as q } from "../provider-CMBovM_W.js";
|
|
2
|
+
function m(e, t) {
|
|
3
|
+
return e != null && e.spring || e != null && e.inertia || e != null && e.integrator ? e : { spring: t.spring };
|
|
4
|
+
}
|
|
5
|
+
const k = (e = {}) => {
|
|
6
|
+
const { from: t = 0, to: n = 1, key: c } = e, r = m(e.physics, {
|
|
7
|
+
spring: { stiffness: 300, damping: 30 }
|
|
8
|
+
});
|
|
6
9
|
return {
|
|
7
10
|
in: () => ({
|
|
8
|
-
|
|
11
|
+
physics: r,
|
|
9
12
|
css: (s) => ({
|
|
10
|
-
opacity: t + (
|
|
13
|
+
opacity: t + (n - t) * s
|
|
11
14
|
})
|
|
12
15
|
}),
|
|
13
16
|
out: () => ({
|
|
14
|
-
|
|
17
|
+
physics: r,
|
|
15
18
|
css: (s) => ({
|
|
16
|
-
opacity: t + (
|
|
19
|
+
opacity: t + (n - t) * s
|
|
17
20
|
})
|
|
18
21
|
}),
|
|
19
|
-
...
|
|
22
|
+
...c && { key: c }
|
|
20
23
|
};
|
|
21
|
-
},
|
|
22
|
-
const {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
spring: a,
|
|
27
|
-
key: e
|
|
28
|
-
} = $, s = {
|
|
29
|
-
stiffness: (a == null ? void 0 : a.stiffness) ?? 300,
|
|
30
|
-
damping: (a == null ? void 0 : a.damping) ?? 30
|
|
31
|
-
}, u = (r) => {
|
|
32
|
-
switch (n) {
|
|
24
|
+
}, S = (e = {}) => {
|
|
25
|
+
const { start: t = 0, opacity: n = 0, axis: c = "both", key: r } = e, s = m(e.physics, {
|
|
26
|
+
spring: { stiffness: 300, damping: 30 }
|
|
27
|
+
}), $ = (a) => {
|
|
28
|
+
switch (c) {
|
|
33
29
|
case "x":
|
|
34
|
-
return `scaleX(${
|
|
30
|
+
return `scaleX(${a})`;
|
|
35
31
|
case "y":
|
|
36
|
-
return `scaleY(${
|
|
32
|
+
return `scaleY(${a})`;
|
|
37
33
|
case "both":
|
|
38
34
|
default:
|
|
39
|
-
return `scale(${
|
|
35
|
+
return `scale(${a})`;
|
|
40
36
|
}
|
|
41
|
-
},
|
|
42
|
-
const
|
|
37
|
+
}, u = (a) => {
|
|
38
|
+
const o = t + (1 - t) * a;
|
|
43
39
|
return {
|
|
44
|
-
transform:
|
|
45
|
-
opacity:
|
|
40
|
+
transform: $(o),
|
|
41
|
+
opacity: n + (1 - n) * a
|
|
46
42
|
};
|
|
47
43
|
};
|
|
48
44
|
return {
|
|
49
|
-
in: () => ({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}),
|
|
53
|
-
out: () => ({
|
|
54
|
-
spring: s,
|
|
55
|
-
css: o
|
|
56
|
-
}),
|
|
57
|
-
...e && { key: e }
|
|
45
|
+
in: () => ({ physics: s, css: u }),
|
|
46
|
+
out: () => ({ physics: s, css: u }),
|
|
47
|
+
...r && { key: r }
|
|
58
48
|
};
|
|
59
|
-
}, w = (
|
|
49
|
+
}, w = (e = {}) => {
|
|
60
50
|
const {
|
|
61
51
|
direction: t,
|
|
62
|
-
distance:
|
|
63
|
-
opacity:
|
|
64
|
-
fade:
|
|
65
|
-
axis:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const d = l * c;
|
|
75
|
-
switch (f) {
|
|
52
|
+
distance: n = 100,
|
|
53
|
+
opacity: c = 0,
|
|
54
|
+
fade: r = !0,
|
|
55
|
+
axis: s,
|
|
56
|
+
key: $
|
|
57
|
+
} = e, u = m(e.physics, {
|
|
58
|
+
spring: { stiffness: 400, damping: 35 }
|
|
59
|
+
}), o = t || (s === "x" ? "left" : s === "y" ? "up" : "left"), l = (g) => {
|
|
60
|
+
const i = 1 - g;
|
|
61
|
+
if (typeof n == "number") {
|
|
62
|
+
const d = i * n;
|
|
63
|
+
switch (o) {
|
|
76
64
|
case "left":
|
|
77
65
|
return `translate3d(${-d}px, 0, 0)`;
|
|
78
66
|
case "right":
|
|
@@ -83,50 +71,42 @@ const b = ($ = {}) => {
|
|
|
83
71
|
return `translate3d(0, ${d}px, 0)`;
|
|
84
72
|
}
|
|
85
73
|
} else
|
|
86
|
-
switch (
|
|
74
|
+
switch (o) {
|
|
87
75
|
case "left":
|
|
88
|
-
return `translate3d(calc(-1 * ${
|
|
76
|
+
return `translate3d(calc(-1 * ${n} * ${i}), 0, 0)`;
|
|
89
77
|
case "right":
|
|
90
|
-
return `translate3d(calc(${
|
|
78
|
+
return `translate3d(calc(${n} * ${i}), 0, 0)`;
|
|
91
79
|
case "up":
|
|
92
|
-
return `translate3d(0, calc(-1 * ${
|
|
80
|
+
return `translate3d(0, calc(-1 * ${n} * ${i}), 0)`;
|
|
93
81
|
case "down":
|
|
94
|
-
return `translate3d(0, calc(${
|
|
82
|
+
return `translate3d(0, calc(${n} * ${i}), 0)`;
|
|
95
83
|
}
|
|
96
|
-
},
|
|
97
|
-
const
|
|
98
|
-
transform:
|
|
84
|
+
}, f = (g) => {
|
|
85
|
+
const i = {
|
|
86
|
+
transform: l(g)
|
|
99
87
|
};
|
|
100
|
-
return
|
|
88
|
+
return r && (i.opacity = c + (1 - c) * g), i;
|
|
101
89
|
};
|
|
102
90
|
return {
|
|
103
|
-
in: () => ({
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}),
|
|
107
|
-
out: () => ({
|
|
108
|
-
spring: o,
|
|
109
|
-
css: m
|
|
110
|
-
}),
|
|
111
|
-
...u && { key: u }
|
|
91
|
+
in: () => ({ physics: u, css: f }),
|
|
92
|
+
out: () => ({ physics: u, css: f }),
|
|
93
|
+
...$ && { key: $ }
|
|
112
94
|
};
|
|
113
|
-
}, C = (
|
|
95
|
+
}, C = (e = {}) => {
|
|
114
96
|
const {
|
|
115
97
|
degrees: t = 360,
|
|
116
|
-
clockwise:
|
|
117
|
-
scale:
|
|
118
|
-
fade:
|
|
119
|
-
origin:
|
|
120
|
-
axis:
|
|
98
|
+
clockwise: n = !0,
|
|
99
|
+
scale: c = !1,
|
|
100
|
+
fade: r = !0,
|
|
101
|
+
origin: s = "center",
|
|
102
|
+
axis: $ = "2d",
|
|
121
103
|
perspective: u = 800,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const d = (1 - l) * i;
|
|
129
|
-
switch (s) {
|
|
104
|
+
key: a
|
|
105
|
+
} = e, o = m(e.physics, {
|
|
106
|
+
spring: { stiffness: 500, damping: 25 }
|
|
107
|
+
}), l = n ? t : -t, f = (i) => {
|
|
108
|
+
const d = (1 - i) * l;
|
|
109
|
+
switch ($) {
|
|
130
110
|
case "x":
|
|
131
111
|
return `perspective(${u}px) rotateX(${d}deg)`;
|
|
132
112
|
case "y":
|
|
@@ -137,114 +117,88 @@ const b = ($ = {}) => {
|
|
|
137
117
|
default:
|
|
138
118
|
return `rotate(${d}deg)`;
|
|
139
119
|
}
|
|
140
|
-
},
|
|
141
|
-
const d = {},
|
|
142
|
-
return
|
|
120
|
+
}, g = (i) => {
|
|
121
|
+
const d = {}, y = [f(i)];
|
|
122
|
+
return c && y.push(`scale(${i})`), d.transform = y.join(" "), d.transformOrigin = s, r && (d.opacity = i), d;
|
|
143
123
|
};
|
|
144
124
|
return {
|
|
145
|
-
in: () => ({
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}),
|
|
149
|
-
out: () => ({
|
|
150
|
-
spring: f,
|
|
151
|
-
css: y
|
|
152
|
-
}),
|
|
153
|
-
...r && { key: r }
|
|
125
|
+
in: () => ({ physics: o, css: g }),
|
|
126
|
+
out: () => ({ physics: o, css: g }),
|
|
127
|
+
...a && { key: a }
|
|
154
128
|
};
|
|
155
|
-
},
|
|
129
|
+
}, I = (e = {}) => {
|
|
156
130
|
const {
|
|
157
131
|
height: t = 20,
|
|
158
|
-
intensity:
|
|
159
|
-
scale:
|
|
160
|
-
fade:
|
|
161
|
-
direction:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
const g = 0.8 + f * 0.2 + y * 0.05 * l;
|
|
171
|
-
m.push(`scale(${g})`);
|
|
132
|
+
intensity: n = 1,
|
|
133
|
+
scale: c = !0,
|
|
134
|
+
fade: r = !0,
|
|
135
|
+
direction: s = "up",
|
|
136
|
+
key: $
|
|
137
|
+
} = e, u = m(e.physics, {
|
|
138
|
+
spring: { stiffness: 800, damping: 15 }
|
|
139
|
+
}), a = (o) => {
|
|
140
|
+
const l = {}, f = [], g = Math.sin(o * Math.PI * (1 + n)), i = 1 - o, d = g * t * i;
|
|
141
|
+
if (s === "up" ? f.push(`translateY(${-Math.abs(d)}px)`) : f.push(`translateY(${Math.abs(d)}px)`), c) {
|
|
142
|
+
const y = 0.8 + o * 0.2 + g * 0.05 * i;
|
|
143
|
+
f.push(`scale(${y})`);
|
|
172
144
|
}
|
|
173
|
-
return
|
|
145
|
+
return l.transform = f.join(" "), r && (l.opacity = o), l;
|
|
174
146
|
};
|
|
175
147
|
return {
|
|
176
|
-
in: () => ({
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}),
|
|
180
|
-
out: () => ({
|
|
181
|
-
spring: o,
|
|
182
|
-
css: r
|
|
183
|
-
}),
|
|
184
|
-
...u && { key: u }
|
|
148
|
+
in: () => ({ physics: u, css: a }),
|
|
149
|
+
out: () => ({ physics: u, css: a }),
|
|
150
|
+
...$ && { key: $ }
|
|
185
151
|
};
|
|
186
|
-
},
|
|
187
|
-
const {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
spring: e,
|
|
193
|
-
key: s
|
|
194
|
-
} = $, u = {
|
|
195
|
-
stiffness: (e == null ? void 0 : e.stiffness) ?? 300,
|
|
196
|
-
damping: (e == null ? void 0 : e.damping) ?? 30
|
|
197
|
-
}, o = (r) => {
|
|
198
|
-
const f = 1 - r, i = {};
|
|
199
|
-
return typeof t == "number" ? i.filter = `blur(${f * t}px)` : i.filter = `blur(calc(${t} * ${f}))`, n && (i.transform = `scale(${0.8 + r * 0.2})`), a && (i.opacity = c + (1 - c) * r), i;
|
|
152
|
+
}, P = (e = {}) => {
|
|
153
|
+
const { amount: t = 10, opacity: n = 0, scale: c = !1, fade: r = !0, key: s } = e, $ = m(e.physics, {
|
|
154
|
+
spring: { stiffness: 300, damping: 30 }
|
|
155
|
+
}), u = (a) => {
|
|
156
|
+
const o = 1 - a, l = {};
|
|
157
|
+
return typeof t == "number" ? l.filter = `blur(${o * t}px)` : l.filter = `blur(calc(${t} * ${o}))`, c && (l.transform = `scale(${0.8 + a * 0.2})`), r && (l.opacity = n + (1 - n) * a), l;
|
|
200
158
|
};
|
|
201
159
|
return {
|
|
202
|
-
in: () => ({
|
|
203
|
-
|
|
204
|
-
css: o
|
|
205
|
-
}),
|
|
206
|
-
out: () => ({
|
|
207
|
-
spring: u,
|
|
208
|
-
css: o
|
|
209
|
-
}),
|
|
160
|
+
in: () => ({ physics: $, css: u }),
|
|
161
|
+
out: () => ({ physics: $, css: u }),
|
|
210
162
|
...s && { key: s }
|
|
211
163
|
};
|
|
212
|
-
},
|
|
213
|
-
const { x: t = 0, y:
|
|
214
|
-
stiffness: (
|
|
215
|
-
damping: (
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
164
|
+
}, D = (e = {}) => {
|
|
165
|
+
const { x: t = 0, y: n = -100, opacity: c = 0, spring: r, key: s } = e, $ = {
|
|
166
|
+
stiffness: (r == null ? void 0 : r.stiffness) ?? 400,
|
|
167
|
+
damping: (r == null ? void 0 : r.damping) ?? 35,
|
|
168
|
+
doubleSpring: (r == null ? void 0 : r.doubleSpring) ?? !1
|
|
169
|
+
}, u = (a) => {
|
|
170
|
+
const o = 1 - a;
|
|
171
|
+
let l, f;
|
|
172
|
+
return typeof t == "number" ? l = `${o * t}px` : l = `calc(${t} * ${o})`, typeof n == "number" ? f = `${o * n}px` : f = `calc(${n} * ${o})`, {
|
|
173
|
+
transform: `translate3d(${l}, ${f}, 0)`,
|
|
174
|
+
opacity: c + (1 - c) * a
|
|
222
175
|
};
|
|
223
176
|
};
|
|
224
177
|
return {
|
|
225
178
|
in: () => ({
|
|
226
|
-
spring:
|
|
179
|
+
spring: $,
|
|
227
180
|
css: u
|
|
228
181
|
}),
|
|
229
182
|
out: () => ({
|
|
230
|
-
spring:
|
|
183
|
+
spring: $,
|
|
231
184
|
css: u
|
|
232
185
|
}),
|
|
233
|
-
...
|
|
186
|
+
...s && { key: s }
|
|
234
187
|
};
|
|
235
|
-
},
|
|
188
|
+
}, M = (e = {}) => {
|
|
236
189
|
const {
|
|
237
190
|
shape: t = "circle",
|
|
238
|
-
origin:
|
|
239
|
-
scale:
|
|
240
|
-
fade:
|
|
241
|
-
spring:
|
|
242
|
-
key:
|
|
243
|
-
} =
|
|
244
|
-
stiffness: (
|
|
245
|
-
damping: (
|
|
246
|
-
|
|
247
|
-
|
|
191
|
+
origin: n = "center",
|
|
192
|
+
scale: c = 1.5,
|
|
193
|
+
fade: r = !1,
|
|
194
|
+
spring: s,
|
|
195
|
+
key: $
|
|
196
|
+
} = e, u = {
|
|
197
|
+
stiffness: (s == null ? void 0 : s.stiffness) ?? 300,
|
|
198
|
+
damping: (s == null ? void 0 : s.damping) ?? 30,
|
|
199
|
+
doubleSpring: (s == null ? void 0 : s.doubleSpring) ?? !1
|
|
200
|
+
}, a = () => {
|
|
201
|
+
switch (n) {
|
|
248
202
|
case "top":
|
|
249
203
|
return "50% 0%";
|
|
250
204
|
case "bottom":
|
|
@@ -265,61 +219,66 @@ const b = ($ = {}) => {
|
|
|
265
219
|
default:
|
|
266
220
|
return "50% 50%";
|
|
267
221
|
}
|
|
268
|
-
},
|
|
269
|
-
const
|
|
222
|
+
}, o = (f) => {
|
|
223
|
+
const g = f * c * 100, i = a();
|
|
270
224
|
switch (t) {
|
|
271
225
|
case "ellipse":
|
|
272
|
-
return `ellipse(${
|
|
226
|
+
return `ellipse(${g}% ${g * 0.75}% at ${i})`;
|
|
273
227
|
case "square": {
|
|
274
|
-
const
|
|
275
|
-
return `polygon(${
|
|
228
|
+
const d = f * c * 100, [y, x] = i.split(" "), b = parseFloat(y), h = parseFloat(x), p = d / 2;
|
|
229
|
+
return `polygon(${b - p}% ${h - p}%, ${b + p}% ${h - p}%, ${b + p}% ${h + p}%, ${b - p}% ${h + p}%)`;
|
|
276
230
|
}
|
|
277
231
|
case "circle":
|
|
278
232
|
default:
|
|
279
|
-
return `circle(${
|
|
233
|
+
return `circle(${g}% at ${i})`;
|
|
280
234
|
}
|
|
281
|
-
},
|
|
282
|
-
const
|
|
283
|
-
clipPath:
|
|
235
|
+
}, l = (f) => {
|
|
236
|
+
const g = {
|
|
237
|
+
clipPath: o(f)
|
|
284
238
|
};
|
|
285
|
-
return
|
|
239
|
+
return r && (g.opacity = f), g;
|
|
286
240
|
};
|
|
287
241
|
return {
|
|
288
242
|
in: () => ({
|
|
289
243
|
spring: u,
|
|
290
|
-
css:
|
|
244
|
+
css: l
|
|
291
245
|
}),
|
|
292
246
|
out: () => ({
|
|
293
247
|
spring: u,
|
|
294
|
-
css:
|
|
248
|
+
css: l
|
|
295
249
|
}),
|
|
296
|
-
|
|
250
|
+
...$ && { key: $ }
|
|
297
251
|
};
|
|
298
|
-
},
|
|
299
|
-
const { spring: t, key:
|
|
252
|
+
}, z = (e = {}) => {
|
|
253
|
+
const { spring: t, key: n } = e, c = {
|
|
300
254
|
stiffness: (t == null ? void 0 : t.stiffness) ?? 1e3,
|
|
301
|
-
damping: (t == null ? void 0 : t.damping) ?? 100
|
|
255
|
+
damping: (t == null ? void 0 : t.damping) ?? 100,
|
|
256
|
+
doubleSpring: (t == null ? void 0 : t.doubleSpring) ?? !1
|
|
302
257
|
};
|
|
303
258
|
return {
|
|
304
259
|
in: () => ({
|
|
305
|
-
spring:
|
|
260
|
+
spring: c,
|
|
306
261
|
css: () => ({})
|
|
307
262
|
}),
|
|
308
263
|
out: () => ({
|
|
309
|
-
spring:
|
|
264
|
+
spring: c,
|
|
310
265
|
css: () => ({})
|
|
311
266
|
}),
|
|
312
|
-
...
|
|
267
|
+
...n && { key: n }
|
|
313
268
|
};
|
|
314
269
|
};
|
|
315
270
|
export {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
271
|
+
v as DoubleSpringIntegrator,
|
|
272
|
+
T as InertiaIntegrator,
|
|
273
|
+
j as IntegratorProvider,
|
|
274
|
+
q as SpringIntegrator,
|
|
275
|
+
P as blur,
|
|
276
|
+
I as bounce,
|
|
277
|
+
k as fade,
|
|
278
|
+
D as fly,
|
|
279
|
+
M as mask,
|
|
280
|
+
z as none,
|
|
322
281
|
C as rotate,
|
|
323
|
-
|
|
282
|
+
S as scale,
|
|
324
283
|
w as slide
|
|
325
284
|
};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { Transition, TransitionKey } from '../types';
|
|
1
|
+
import { SpringConfig, Transition, TransitionKey } from '../types';
|
|
2
2
|
interface MaskOptions {
|
|
3
3
|
shape?: "circle" | "ellipse" | "square";
|
|
4
4
|
origin?: "center" | "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
5
5
|
scale?: number;
|
|
6
6
|
fade?: boolean;
|
|
7
|
-
spring?:
|
|
8
|
-
stiffness?: number;
|
|
9
|
-
damping?: number;
|
|
10
|
-
};
|
|
7
|
+
spring?: Partial<SpringConfig>;
|
|
11
8
|
key?: TransitionKey;
|
|
12
9
|
}
|
|
13
10
|
export declare const mask: (options?: MaskOptions) => Transition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/mask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/mask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,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,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,UAwFhD,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { Transition, TransitionKey } from '../types';
|
|
1
|
+
import { SpringConfig, Transition, TransitionKey } from '../types';
|
|
2
2
|
interface NoneOptions {
|
|
3
|
-
spring?:
|
|
4
|
-
stiffness?: number;
|
|
5
|
-
damping?: number;
|
|
6
|
-
};
|
|
3
|
+
spring?: Partial<SpringConfig>;
|
|
7
4
|
key?: TransitionKey;
|
|
8
5
|
}
|
|
9
6
|
export declare const none: (options?: NoneOptions) => Transition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/none.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/none.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,UAoBhD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Transition, TransitionKey } from '../types';
|
|
2
|
-
|
|
1
|
+
import { PhysicsOptions, Transition, TransitionKey } from '../types';
|
|
2
|
+
type RotateOptions = {
|
|
3
3
|
degrees?: number;
|
|
4
4
|
clockwise?: boolean;
|
|
5
5
|
scale?: boolean;
|
|
@@ -7,12 +7,9 @@ interface RotateOptions {
|
|
|
7
7
|
origin?: string;
|
|
8
8
|
axis?: "2d" | "x" | "y" | "z";
|
|
9
9
|
perspective?: number;
|
|
10
|
-
|
|
11
|
-
stiffness?: number;
|
|
12
|
-
damping?: number;
|
|
13
|
-
};
|
|
10
|
+
physics?: PhysicsOptions;
|
|
14
11
|
key?: TransitionKey;
|
|
15
|
-
}
|
|
12
|
+
};
|
|
16
13
|
export declare const rotate: (options?: RotateOptions) => Transition;
|
|
17
14
|
export {};
|
|
18
15
|
//# sourceMappingURL=rotate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/rotate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/rotate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,KAAK,aAAa,GAAG;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,UAuDpD,CAAC"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { Transition, TransitionKey } from '../types';
|
|
2
|
-
|
|
1
|
+
import { PhysicsOptions, Transition, TransitionKey } from '../types';
|
|
2
|
+
type ScaleOptions = {
|
|
3
3
|
start?: number;
|
|
4
4
|
opacity?: number;
|
|
5
5
|
axis?: "x" | "y" | "both";
|
|
6
|
-
|
|
7
|
-
stiffness?: number;
|
|
8
|
-
damping?: number;
|
|
9
|
-
};
|
|
6
|
+
physics?: PhysicsOptions;
|
|
10
7
|
key?: TransitionKey;
|
|
11
|
-
}
|
|
8
|
+
};
|
|
12
9
|
export declare const scale: (options?: ScaleOptions) => Transition;
|
|
13
10
|
export {};
|
|
14
11
|
//# sourceMappingURL=scale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/scale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/scale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,KAAK,YAAY,GAAG;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,UA+BlD,CAAC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { Transition, TransitionKey } from '../types';
|
|
2
|
-
|
|
1
|
+
import { PhysicsOptions, Transition, TransitionKey } from '../types';
|
|
2
|
+
type SlideOptions = {
|
|
3
3
|
direction?: "left" | "right" | "up" | "down";
|
|
4
4
|
distance?: number | string;
|
|
5
5
|
opacity?: number;
|
|
6
6
|
fade?: boolean;
|
|
7
7
|
axis?: "x" | "y";
|
|
8
|
-
|
|
9
|
-
stiffness?: number;
|
|
10
|
-
damping?: number;
|
|
11
|
-
};
|
|
8
|
+
physics?: PhysicsOptions;
|
|
12
9
|
key?: TransitionKey;
|
|
13
|
-
}
|
|
10
|
+
};
|
|
14
11
|
export declare const slide: (options?: SlideOptions) => Transition;
|
|
15
12
|
export {};
|
|
16
13
|
//# sourceMappingURL=slide.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/slide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/slide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,KAAK,YAAY,GAAG;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,UAmElD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PhysicsOptions, SpringConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Get physics options with fallback to default spring
|
|
4
|
+
*/
|
|
5
|
+
export declare function getPhysics(physics: PhysicsOptions | undefined, fallback: {
|
|
6
|
+
spring: SpringConfig;
|
|
7
|
+
}): PhysicsOptions;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7D;;GAEG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,cAAc,GAAG,SAAS,EACnC,QAAQ,EAAE;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACjC,cAAc,CAKhB"}
|
package/dist/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function S(n){return("tick"in n||"css"in n)&&!("springs"in n)}function r(n){return"springs"in n}function o(n){return"css"in n&&typeof n.css=="function"}function a(n){return"tick"in n&&typeof n.tick=="function"}function c(n){if(o(n)&&a(n))throw new Error("SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other.")}function l(n){if(n.tick&&n.css)throw new Error("SpringItem cannot have both 'tick' and 'css' defined. Use one or the other.")}async function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function S(n){return("tick"in n||"css"in n)&&!("springs"in n)}function r(n){return"springs"in n}function o(n){return"css"in n&&typeof n.css=="function"}function a(n){return"tick"in n&&typeof n.tick=="function"}function c(n){if(o(n)&&a(n))throw new Error("SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other.")}function l(n){if(n.tick&&n.css)throw new Error("SpringItem cannot have both 'tick' and 'css' defined. Use one or the other.")}async function g(n){const i=await n;return r(i)?(i.springs.forEach(l),i):(c(i),{prepare:i.prepare,wait:i.wait,onStart:i.onStart,onEnd:i.onEnd,springs:[{physics:i.physics,tick:i.tick,css:i.css}],schedule:"parallel"})}function m(n,i){const u=n.schedule??"parallel",p=n.springs.map(s=>{let e;switch(u){case"parallel":e=0;break;case"sequential":e=1;break;case"stagger":e=Math.max(0,Math.min(1,s.offset??0));break;default:e=0}const{css:t,offset:y,...f}=s,h=t?typeof t=="function"?i?{element:i,style:t}:void 0:{element:t.element,style:t.style}:void 0;return{...f,css:h,normalizedOffset:e}}),{schedule:k,...d}=n;return{...d,springs:p}}exports.isCssAnimation=o;exports.isMultiSpring=r;exports.isSingleSpring=S;exports.isTickAnimation=a;exports.normalizeMultiSpringSchedule=m;exports.normalizeToMultiSpring=g;exports.validateAnimationMode=c;exports.validateSpringItem=l;
|