@ssgoi/react 5.0.0 → 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.
- package/dist/core/dist/types.cjs +1 -1
- package/dist/core/dist/types.js +27 -19
- package/dist/index.cjs +1 -1
- package/dist/index.js +12 -11
- package/dist/types.cjs +1 -1
- package/dist/types.js +5 -4
- 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 d(e){return("tick"in e||"css"in e)&&!("items"in e)}function a(e){return"items"in e}function y(e){return"css"in e&&typeof e.css=="function"}function p(e){return"tick"in e&&typeof e.tick=="function"}function o(e){return"keyframes"in e&&e.keyframes!==void 0&&e.keyframes!==null}async function k(e){const n=await e;return a(n)?{prepare:n.prepare,wait:n.wait,onReady:n.onReady,onStart:n.onStart,onEnd:n.onEnd,items:n.items,schedule:n.schedule}:{prepare:n.prepare,wait:n.wait,onReady:n.onReady,onStart:n.onStart,onEnd:n.onEnd,items:[{physics:n.physics,tick:n.tick,css:n.css}],schedule:"parallel"}}function h(e,n){const r=e.schedule??"parallel",c=e.items.map(s=>{let t;switch(r){case"parallel":t=0;break;case"sequential":t=1;break;case"stagger":t=Math.max(0,Math.min(1,s.offset??0));break;default:t=0}if(o(s)){const{offset:A,...m}=s;return{...m,normalizedOffset:t}}const{css:i,offset:w,...u}=s,f=i?typeof i=="function"?n?{element:n,style:i}:void 0:{element:i.element,style:i.style}:void 0;return{...u,css:f,normalizedOffset:t}}),{schedule:S,...l}=e;return{...l,items:c}}exports.isCssAnimation=y;exports.isKeyframesAnimation=o;exports.isMultiAnimation=a;exports.isSingleAnimation=d;exports.isTickAnimation=p;exports.normalizeSchedule=h;exports.normalizeToMultiAnimation=k;
|
package/dist/core/dist/types.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
function
|
|
1
|
+
function k(n) {
|
|
2
2
|
return ("tick" in n || "css" in n) && !("items" in n);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function f(n) {
|
|
5
5
|
return "items" in n;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function h(n) {
|
|
8
8
|
return "css" in n && typeof n.css == "function";
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function w(n) {
|
|
11
11
|
return "tick" in n && typeof n.tick == "function";
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
function m(n) {
|
|
14
|
+
return "keyframes" in n && n.keyframes !== void 0 && n.keyframes !== null;
|
|
15
|
+
}
|
|
16
|
+
async function A(n) {
|
|
14
17
|
const e = await n;
|
|
15
|
-
return
|
|
18
|
+
return f(e) ? {
|
|
16
19
|
prepare: e.prepare,
|
|
17
20
|
wait: e.wait,
|
|
18
21
|
onReady: e.onReady,
|
|
@@ -36,9 +39,9 @@ async function h(n) {
|
|
|
36
39
|
schedule: "parallel"
|
|
37
40
|
};
|
|
38
41
|
}
|
|
39
|
-
function
|
|
42
|
+
function S(n, e) {
|
|
40
43
|
const a = n.schedule ?? "parallel", o = n.items.map(
|
|
41
|
-
(
|
|
44
|
+
(i) => {
|
|
42
45
|
let t;
|
|
43
46
|
switch (a) {
|
|
44
47
|
case "parallel":
|
|
@@ -48,25 +51,30 @@ function k(n, e) {
|
|
|
48
51
|
t = 1;
|
|
49
52
|
break;
|
|
50
53
|
case "stagger":
|
|
51
|
-
t = Math.max(0, Math.min(1,
|
|
54
|
+
t = Math.max(0, Math.min(1, i.offset ?? 0));
|
|
52
55
|
break;
|
|
53
56
|
default:
|
|
54
57
|
t = 0;
|
|
55
58
|
}
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
if (m(i)) {
|
|
60
|
+
const { offset: y, ...u } = i;
|
|
61
|
+
return { ...u, normalizedOffset: t };
|
|
62
|
+
}
|
|
63
|
+
const { css: s, offset: p, ...c } = i, l = s ? typeof s == "function" ? e ? { element: e, style: s } : void 0 : { element: s.element, style: s.style } : void 0;
|
|
64
|
+
return { ...c, css: l, normalizedOffset: t };
|
|
58
65
|
}
|
|
59
|
-
), { schedule:
|
|
66
|
+
), { schedule: d, ...r } = n;
|
|
60
67
|
return {
|
|
61
|
-
...
|
|
68
|
+
...r,
|
|
62
69
|
items: o
|
|
63
70
|
};
|
|
64
71
|
}
|
|
65
72
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
h as isCssAnimation,
|
|
74
|
+
m as isKeyframesAnimation,
|
|
75
|
+
f as isMultiAnimation,
|
|
76
|
+
k as isSingleAnimation,
|
|
77
|
+
w as isTickAnimation,
|
|
78
|
+
S as normalizeSchedule,
|
|
79
|
+
A as normalizeToMultiAnimation
|
|
72
80
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./react/src/lib/transition.cjs"),i=require("./core/dist/types.cjs"),o=require("./react/src/lib/ssgoi.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./react/src/lib/transition.cjs"),i=require("./core/dist/types.cjs"),o=require("./react/src/lib/ssgoi.cjs"),s=require("./react/src/lib/ssgoi-transition.cjs"),t=require("./react/src/lib/transition-scope.cjs");exports.transition=n.transition;exports.isCssAnimation=i.isCssAnimation;exports.isKeyframesAnimation=i.isKeyframesAnimation;exports.isMultiAnimation=i.isMultiAnimation;exports.isSingleAnimation=i.isSingleAnimation;exports.isTickAnimation=i.isTickAnimation;exports.normalizeSchedule=i.normalizeSchedule;exports.normalizeToMultiAnimation=i.normalizeToMultiAnimation;exports.Ssgoi=o.Ssgoi;exports.SsgoiTransition=s.SsgoiTransition;exports.TransitionScope=t.TransitionScope;
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { transition as n } from "./react/src/lib/transition.js";
|
|
2
|
-
import { isCssAnimation as r,
|
|
3
|
-
import { Ssgoi as
|
|
4
|
-
import { SsgoiTransition as
|
|
5
|
-
import { TransitionScope as
|
|
2
|
+
import { isCssAnimation as r, isKeyframesAnimation as m, isMultiAnimation as e, isSingleAnimation as s, isTickAnimation as a, normalizeSchedule as f, normalizeToMultiAnimation as l } from "./core/dist/types.js";
|
|
3
|
+
import { Ssgoi as A } from "./react/src/lib/ssgoi.js";
|
|
4
|
+
import { SsgoiTransition as S } from "./react/src/lib/ssgoi-transition.js";
|
|
5
|
+
import { TransitionScope as c } from "./react/src/lib/transition-scope.js";
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
A as Ssgoi,
|
|
8
|
+
S as SsgoiTransition,
|
|
9
|
+
c as TransitionScope,
|
|
10
10
|
r as isCssAnimation,
|
|
11
|
-
m as
|
|
12
|
-
e as
|
|
13
|
-
s as
|
|
14
|
-
a as
|
|
11
|
+
m as isKeyframesAnimation,
|
|
12
|
+
e as isMultiAnimation,
|
|
13
|
+
s as isSingleAnimation,
|
|
14
|
+
a as isTickAnimation,
|
|
15
|
+
f as normalizeSchedule,
|
|
15
16
|
l as normalizeToMultiAnimation,
|
|
16
17
|
n as transition
|
|
17
18
|
};
|
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.isCssAnimation=i.isCssAnimation;exports.isMultiAnimation=i.isMultiAnimation;exports.isSingleAnimation=i.isSingleAnimation;exports.isTickAnimation=i.isTickAnimation;exports.normalizeSchedule=i.normalizeSchedule;exports.normalizeToMultiAnimation=i.normalizeToMultiAnimation;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./core/dist/types.cjs");exports.isCssAnimation=i.isCssAnimation;exports.isKeyframesAnimation=i.isKeyframesAnimation;exports.isMultiAnimation=i.isMultiAnimation;exports.isSingleAnimation=i.isSingleAnimation;exports.isTickAnimation=i.isTickAnimation;exports.normalizeSchedule=i.normalizeSchedule;exports.normalizeToMultiAnimation=i.normalizeToMultiAnimation;
|
package/dist/types.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { isCssAnimation as o,
|
|
1
|
+
import { isCssAnimation as o, isKeyframesAnimation as m, isMultiAnimation as a, isSingleAnimation as t, isTickAnimation as e, normalizeSchedule as s, normalizeToMultiAnimation as l } from "./core/dist/types.js";
|
|
2
2
|
export {
|
|
3
3
|
o as isCssAnimation,
|
|
4
|
-
m as
|
|
4
|
+
m as isKeyframesAnimation,
|
|
5
|
+
a as isMultiAnimation,
|
|
5
6
|
t as isSingleAnimation,
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
e as isTickAnimation,
|
|
8
|
+
s as normalizeSchedule,
|
|
8
9
|
l as normalizeToMultiAnimation
|
|
9
10
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/react",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "React bindings for SSGOI - Native app-like page transitions for React applications",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"unplugin": "^2.3.2",
|
|
80
80
|
"@babel/core": "^7.26.10",
|
|
81
|
-
"@ssgoi/core": "^5.
|
|
81
|
+
"@ssgoi/core": "^5.2.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@types/babel__core": "^7.20.5",
|