@ssgoi/react 2.5.6 → 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 -0
- package/dist/core/dist/types.js +73 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +11 -8
- package/dist/types.cjs +1 -1
- package/dist/types.js +9 -6
- package/package.json +2 -2
- package/dist/node_modules/.pnpm/@ssgoi_core@2.5.6/node_modules/@ssgoi/core/dist/types.cjs +0 -1
- package/dist/node_modules/.pnpm/@ssgoi_core@2.5.6/node_modules/@ssgoi/core/dist/types.js +0 -25
- /package/dist/{packages/react → react}/src/lib/context.cjs +0 -0
- /package/dist/{packages/react → react}/src/lib/context.js +0 -0
- /package/dist/{packages/react → react}/src/lib/ssgoi-transition.cjs +0 -0
- /package/dist/{packages/react → react}/src/lib/ssgoi-transition.js +0 -0
- /package/dist/{packages/react → react}/src/lib/ssgoi.cjs +0 -0
- /package/dist/{packages/react → react}/src/lib/ssgoi.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
function f(n) {
|
|
2
|
+
return ("tick" in n || "css" in n) && !("springs" in n);
|
|
3
|
+
}
|
|
4
|
+
function e(n) {
|
|
5
|
+
return "springs" in n;
|
|
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
|
+
}
|
|
64
|
+
export {
|
|
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
|
|
73
|
+
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@ssgoi/core"),i=require("./
|
|
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,14 +1,17 @@
|
|
|
1
1
|
import { transition as n } from "@ssgoi/core";
|
|
2
|
-
import { isCssAnimation as t, isMultiSpring as
|
|
3
|
-
import { Ssgoi as
|
|
4
|
-
import { SsgoiTransition as
|
|
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
|
-
|
|
6
|
+
d as Ssgoi,
|
|
7
|
+
u as SsgoiTransition,
|
|
8
8
|
t as isCssAnimation,
|
|
9
|
-
|
|
9
|
+
e as isMultiSpring,
|
|
10
10
|
a as isSingleSpring,
|
|
11
|
-
|
|
11
|
+
m as isTickAnimation,
|
|
12
|
+
s as normalizeMultiSpringSchedule,
|
|
13
|
+
l as normalizeToMultiSpring,
|
|
12
14
|
n as transition,
|
|
13
|
-
|
|
15
|
+
p as validateAnimationMode,
|
|
16
|
+
S as validateSpringItem
|
|
14
17
|
};
|
package/dist/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./
|
|
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,8 +1,11 @@
|
|
|
1
|
-
import { isCssAnimation 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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
8
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",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(i){return("tick"in i||"css"in i)&&!("springs"in i)}function o(i){return"springs"in i}function n(i){return"css"in i&&typeof i.css=="function"}function t(i){return"tick"in i&&typeof i.tick=="function"}function r(i){if(n(i)&&t(i))throw new Error("SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other.")}exports.isCssAnimation=n;exports.isMultiSpring=o;exports.isSingleSpring=e;exports.isTickAnimation=t;exports.validateAnimationMode=r;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
function s(i) {
|
|
2
|
-
return ("tick" in i || "css" in i) && !("springs" in i);
|
|
3
|
-
}
|
|
4
|
-
function o(i) {
|
|
5
|
-
return "springs" in i;
|
|
6
|
-
}
|
|
7
|
-
function n(i) {
|
|
8
|
-
return "css" in i && typeof i.css == "function";
|
|
9
|
-
}
|
|
10
|
-
function t(i) {
|
|
11
|
-
return "tick" in i && typeof i.tick == "function";
|
|
12
|
-
}
|
|
13
|
-
function r(i) {
|
|
14
|
-
if (n(i) && t(i))
|
|
15
|
-
throw new Error(
|
|
16
|
-
"SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other."
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
n as isCssAnimation,
|
|
21
|
-
o as isMultiSpring,
|
|
22
|
-
s as isSingleSpring,
|
|
23
|
-
t as isTickAnimation,
|
|
24
|
-
r as validateAnimationMode
|
|
25
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|