@ssgoi/react 2.5.5 → 3.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/core/dist/types.cjs +1 -1
- package/dist/core/dist/types.js +68 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +15 -9
- package/dist/types.cjs +1 -1
- package/dist/types.js +9 -3
- package/package.json +2 -2
package/dist/core/dist/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(n){return("tick"in n||"css"in n)&&!("springs"in n)}function r(n){return"springs"in n}function s(n){return"css"in n&&typeof n.css=="function"}function e(n){return"tick"in n&&typeof n.tick=="function"}function o(n){if(s(n)&&e(n))throw new Error("SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other.")}function a(n){if(n.tick&&n.css)throw new Error("SpringItem cannot have both 'tick' and 'css' defined. Use one or the other.")}function f(n){return r(n)?(n.springs.forEach(a),n):(o(n),{prepare:n.prepare,wait:n.wait,onStart:n.onStart,onEnd:n.onEnd,springs:[{spring:n.spring,tick:n.tick,css:n.css}],schedule:"parallel"})}function g(n){const c=n.schedule??"parallel",l=n.springs.map(t=>{let i;switch(c){case"parallel":i=0;break;case"sequential":i=1;break;case"stagger":i=Math.max(0,Math.min(1,t.offset??0));break;default:i=0}return{...t,normalizedOffset:i}}),{schedule:d,...u}=n;return{...u,springs:l}}exports.isCssAnimation=s;exports.isMultiSpring=r;exports.isSingleSpring=p;exports.isTickAnimation=e;exports.normalizeMultiSpringSchedule=g;exports.normalizeToMultiSpring=f;exports.validateAnimationMode=o;exports.validateSpringItem=a;
|
package/dist/core/dist/types.js
CHANGED
|
@@ -1,10 +1,73 @@
|
|
|
1
|
-
function
|
|
2
|
-
return "tick" in n && !("springs" in n);
|
|
1
|
+
function f(n) {
|
|
2
|
+
return ("tick" in n || "css" in n) && !("springs" in n);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function e(n) {
|
|
5
5
|
return "springs" in n;
|
|
6
6
|
}
|
|
7
|
+
function o(n) {
|
|
8
|
+
return "css" in n && typeof n.css == "function";
|
|
9
|
+
}
|
|
10
|
+
function c(n) {
|
|
11
|
+
return "tick" in n && typeof n.tick == "function";
|
|
12
|
+
}
|
|
13
|
+
function l(n) {
|
|
14
|
+
if (o(n) && c(n))
|
|
15
|
+
throw new Error(
|
|
16
|
+
"SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other."
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function p(n) {
|
|
20
|
+
if (n.tick && n.css)
|
|
21
|
+
throw new Error(
|
|
22
|
+
"SpringItem cannot have both 'tick' and 'css' defined. Use one or the other."
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function g(n) {
|
|
26
|
+
return e(n) ? (n.springs.forEach(p), n) : (l(n), {
|
|
27
|
+
prepare: n.prepare,
|
|
28
|
+
wait: n.wait,
|
|
29
|
+
onStart: n.onStart,
|
|
30
|
+
onEnd: n.onEnd,
|
|
31
|
+
springs: [
|
|
32
|
+
{
|
|
33
|
+
spring: n.spring,
|
|
34
|
+
tick: n.tick,
|
|
35
|
+
css: n.css
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
schedule: "parallel"
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function h(n) {
|
|
42
|
+
const r = n.schedule ?? "parallel", s = n.springs.map((t) => {
|
|
43
|
+
let i;
|
|
44
|
+
switch (r) {
|
|
45
|
+
case "parallel":
|
|
46
|
+
i = 0;
|
|
47
|
+
break;
|
|
48
|
+
case "sequential":
|
|
49
|
+
i = 1;
|
|
50
|
+
break;
|
|
51
|
+
case "stagger":
|
|
52
|
+
i = Math.max(0, Math.min(1, t.offset ?? 0));
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
i = 0;
|
|
56
|
+
}
|
|
57
|
+
return { ...t, normalizedOffset: i };
|
|
58
|
+
}), { schedule: u, ...a } = n;
|
|
59
|
+
return {
|
|
60
|
+
...a,
|
|
61
|
+
springs: s
|
|
62
|
+
};
|
|
63
|
+
}
|
|
7
64
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
65
|
+
o as isCssAnimation,
|
|
66
|
+
e as isMultiSpring,
|
|
67
|
+
f as isSingleSpring,
|
|
68
|
+
c as isTickAnimation,
|
|
69
|
+
h as normalizeMultiSpringSchedule,
|
|
70
|
+
g as normalizeToMultiSpring,
|
|
71
|
+
l as validateAnimationMode,
|
|
72
|
+
p as validateSpringItem
|
|
10
73
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@ssgoi/core"),i=require("./core/dist/types.cjs"),e=require("./react/src/lib/ssgoi.cjs"),t=require("./react/src/lib/ssgoi-transition.cjs");Object.defineProperty(exports,"transition",{enumerable:!0,get:()=>n.transition});exports.isCssAnimation=i.isCssAnimation;exports.isMultiSpring=i.isMultiSpring;exports.isSingleSpring=i.isSingleSpring;exports.isTickAnimation=i.isTickAnimation;exports.normalizeMultiSpringSchedule=i.normalizeMultiSpringSchedule;exports.normalizeToMultiSpring=i.normalizeToMultiSpring;exports.validateAnimationMode=i.validateAnimationMode;exports.validateSpringItem=i.validateSpringItem;exports.Ssgoi=e.Ssgoi;exports.SsgoiTransition=t.SsgoiTransition;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { transition as
|
|
2
|
-
import { isMultiSpring as
|
|
3
|
-
import { Ssgoi as
|
|
4
|
-
import { SsgoiTransition as
|
|
1
|
+
import { transition as n } from "@ssgoi/core";
|
|
2
|
+
import { isCssAnimation as t, isMultiSpring as e, isSingleSpring as a, isTickAnimation as m, normalizeMultiSpringSchedule as s, normalizeToMultiSpring as l, validateAnimationMode as p, validateSpringItem as S } from "./core/dist/types.js";
|
|
3
|
+
import { Ssgoi as d } from "./react/src/lib/ssgoi.js";
|
|
4
|
+
import { SsgoiTransition as u } from "./react/src/lib/ssgoi-transition.js";
|
|
5
5
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
d as Ssgoi,
|
|
7
|
+
u as SsgoiTransition,
|
|
8
|
+
t as isCssAnimation,
|
|
9
|
+
e as isMultiSpring,
|
|
10
|
+
a as isSingleSpring,
|
|
11
|
+
m as isTickAnimation,
|
|
12
|
+
s as normalizeMultiSpringSchedule,
|
|
13
|
+
l as normalizeToMultiSpring,
|
|
14
|
+
n as transition,
|
|
15
|
+
p as validateAnimationMode,
|
|
16
|
+
S as validateSpringItem
|
|
11
17
|
};
|
package/dist/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./core/dist/types.cjs");exports.isMultiSpring=i.isMultiSpring;exports.isSingleSpring=i.isSingleSpring;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./core/dist/types.cjs");exports.isCssAnimation=i.isCssAnimation;exports.isMultiSpring=i.isMultiSpring;exports.isSingleSpring=i.isSingleSpring;exports.isTickAnimation=i.isTickAnimation;exports.normalizeMultiSpringSchedule=i.normalizeMultiSpringSchedule;exports.normalizeToMultiSpring=i.normalizeToMultiSpring;exports.validateAnimationMode=i.validateAnimationMode;exports.validateSpringItem=i.validateSpringItem;
|
package/dist/types.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { isMultiSpring as
|
|
1
|
+
import { isCssAnimation as e, isMultiSpring as t, isSingleSpring as a, isTickAnimation as l, normalizeMultiSpringSchedule as o, normalizeToMultiSpring as r, validateAnimationMode as m, validateSpringItem as S } from "./core/dist/types.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
e as isCssAnimation,
|
|
4
|
+
t as isMultiSpring,
|
|
5
|
+
a as isSingleSpring,
|
|
6
|
+
l as isTickAnimation,
|
|
7
|
+
o as normalizeMultiSpringSchedule,
|
|
8
|
+
r as normalizeToMultiSpring,
|
|
9
|
+
m as validateAnimationMode,
|
|
10
|
+
S as validateSpringItem
|
|
5
11
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "React bindings for SSGOI - Native app-like page transitions for React applications",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@ssgoi/core": "^
|
|
48
|
+
"@ssgoi/core": "^3.0.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"react": "^19.0.0",
|