@ssgoi/vue 2.2.0 → 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 +16 -7
- package/dist/types.cjs +1 -1
- package/dist/types.js +11 -1
- package/dist/{ssgoi-transition.vue.cjs → vue/src/lib/ssgoi-transition.vue.cjs} +1 -1
- package/dist/{ssgoi-transition.vue.js → vue/src/lib/ssgoi-transition.vue.js} +13 -13
- package/package.json +2 -2
- /package/dist/{context.cjs → vue/src/lib/context.cjs} +0 -0
- /package/dist/{context.js → vue/src/lib/context.js} +0 -0
- /package/dist/{ssgoi-transition.vue2.cjs → vue/src/lib/ssgoi-transition.vue2.cjs} +0 -0
- /package/dist/{ssgoi-transition.vue2.js → vue/src/lib/ssgoi-transition.vue2.js} +0 -0
- /package/dist/{ssgoi.vue.cjs → vue/src/lib/ssgoi.vue.cjs} +0 -0
- /package/dist/{ssgoi.vue.js → vue/src/lib/ssgoi.vue.js} +0 -0
- /package/dist/{ssgoi.vue2.cjs → vue/src/lib/ssgoi.vue2.cjs} +0 -0
- /package/dist/{ssgoi.vue2.js → vue/src/lib/ssgoi.vue2.js} +0 -0
- /package/dist/{transition.cjs → vue/src/lib/transition.cjs} +0 -0
- /package/dist/{transition.js → vue/src/lib/transition.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
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./vue/src/lib/transition.cjs"),i=require("./core/dist/types.cjs"),t=require("./vue/src/lib/ssgoi.vue.cjs"),e=require("./vue/src/lib/ssgoi-transition.vue.cjs");exports.transition=n.transition;exports.vTransition=n.vTransition;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=t.default;exports.SsgoiTransition=e.default;
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import { transition as
|
|
2
|
-
import {
|
|
3
|
-
import { default as
|
|
1
|
+
import { transition as o, vTransition as t } from "./vue/src/lib/transition.js";
|
|
2
|
+
import { isCssAnimation as a, isMultiSpring as e, isSingleSpring as s, isTickAnimation as l, normalizeMultiSpringSchedule as m, normalizeToMultiSpring as p, validateAnimationMode as S, validateSpringItem as g } from "./core/dist/types.js";
|
|
3
|
+
import { default as f } from "./vue/src/lib/ssgoi.vue.js";
|
|
4
|
+
import { default as x } from "./vue/src/lib/ssgoi-transition.vue.js";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
f as Ssgoi,
|
|
7
|
+
x as SsgoiTransition,
|
|
8
|
+
a as isCssAnimation,
|
|
9
|
+
e as isMultiSpring,
|
|
10
|
+
s as isSingleSpring,
|
|
11
|
+
l as isTickAnimation,
|
|
12
|
+
m as normalizeMultiSpringSchedule,
|
|
13
|
+
p as normalizeToMultiSpring,
|
|
14
|
+
o as transition,
|
|
15
|
+
t as vTransition,
|
|
16
|
+
S as validateAnimationMode,
|
|
17
|
+
g as validateSpringItem
|
|
9
18
|
};
|
package/dist/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
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 +1,11 @@
|
|
|
1
|
-
|
|
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
|
+
export {
|
|
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
|
|
11
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),a=require("./transition.cjs"),r=require("./context.cjs"),c=t.defineComponent({__name:"ssgoi-transition",props:{id:{},as:{default:"div"},class:{}},setup(e){const s=e,i=r.useSsgoi(),o=t.computed(()=>({...i(s.id),key:s.id}));return(n,u)=>t.withDirectives((t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"data-ssgoi-transition":e.id,class:t.normalizeClass(s.class)},{default:t.withCtx(()=>[t.renderSlot(n.$slots,"default")]),_:3},8,["data-ssgoi-transition","class"])),[[t.unref(a.vTransition),o.value]])}});exports.default=c;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as a, computed as e, withDirectives as r, createBlock as c, openBlock as l, resolveDynamicComponent as d, normalizeClass as m, withCtx as
|
|
1
|
+
import { defineComponent as a, computed as e, withDirectives as r, createBlock as c, openBlock as l, resolveDynamicComponent as d, normalizeClass as m, withCtx as u, renderSlot as f, unref as p } from "vue";
|
|
2
2
|
import { vTransition as g } from "./transition.js";
|
|
3
3
|
import { useSsgoi as v } from "./context.js";
|
|
4
|
-
const
|
|
4
|
+
const x = /* @__PURE__ */ a({
|
|
5
5
|
__name: "ssgoi-transition",
|
|
6
6
|
props: {
|
|
7
7
|
id: {},
|
|
8
8
|
as: { default: "div" },
|
|
9
9
|
class: {}
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
...
|
|
14
|
-
key:
|
|
11
|
+
setup(t) {
|
|
12
|
+
const s = t, n = v(), o = e(() => ({
|
|
13
|
+
...n(s.id),
|
|
14
|
+
key: s.id
|
|
15
15
|
}));
|
|
16
|
-
return (
|
|
17
|
-
"data-ssgoi-transition":
|
|
18
|
-
class: m(
|
|
16
|
+
return (i, C) => r((l(), c(d(t.as), {
|
|
17
|
+
"data-ssgoi-transition": t.id,
|
|
18
|
+
class: m(s.class)
|
|
19
19
|
}, {
|
|
20
|
-
default:
|
|
21
|
-
|
|
20
|
+
default: u(() => [
|
|
21
|
+
f(i.$slots, "default")
|
|
22
22
|
]),
|
|
23
23
|
_: 3
|
|
24
24
|
}, 8, ["data-ssgoi-transition", "class"])), [
|
|
25
|
-
[
|
|
25
|
+
[p(g), o.value]
|
|
26
26
|
]);
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
x as default
|
|
31
31
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/vue",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Vue bindings for SSGOI - Native app-like page transitions for Vue 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
|
"vue": "^3.5.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|