@ssgoi/core 3.4.0 → 3.5.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/index.cjs +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -14
- package/dist/transitions/blur.d.ts +2 -5
- package/dist/transitions/blur.d.ts.map +1 -1
- package/dist/transitions/bounce.d.ts +2 -5
- package/dist/transitions/bounce.d.ts.map +1 -1
- package/dist/transitions/fade.d.ts +2 -5
- 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.js +181 -172
- 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 +2 -5
- package/dist/transitions/rotate.d.ts.map +1 -1
- package/dist/transitions/scale.d.ts +2 -5
- package/dist/transitions/scale.d.ts.map +1 -1
- package/dist/transitions/slide.d.ts +2 -5
- package/dist/transitions/slide.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/index.cjs +13 -13
- package/dist/view-transitions/index.d.ts +5 -2
- package/dist/view-transitions/index.d.ts.map +1 -1
- package/dist/view-transitions/index.js +980 -602
- package/dist/view-transitions/instagram.d.ts.map +1 -1
- package/dist/view-transitions/jaemin.d.ts +0 -4
- package/dist/view-transitions/jaemin.d.ts.map +1 -1
- package/dist/view-transitions/pinterest.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/swap.d.ts +13 -0
- package/dist/view-transitions/swap.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/jaemin-BG8HRXG1.cjs +0 -1
- package/dist/jaemin-BWkrXq0V.js +0 -131
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instagram.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/instagram.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"instagram.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/instagram.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAU9D,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAgPD,eAAO,MAAM,SAAS,GAAI,UAAS,gBAAqB,KAAG,eA+G1D,CAAC"}
|
|
@@ -5,9 +5,6 @@ interface JaeminOptions {
|
|
|
5
5
|
initialScale?: number;
|
|
6
6
|
rotationTriggerPoint?: number;
|
|
7
7
|
}
|
|
8
|
-
interface JaeminInternalOptions extends JaeminOptions {
|
|
9
|
-
containerMode?: "positioned-parent" | "viewport";
|
|
10
|
-
}
|
|
11
8
|
/**
|
|
12
9
|
* Jaemin Transition
|
|
13
10
|
*
|
|
@@ -20,6 +17,5 @@ interface JaeminInternalOptions extends JaeminOptions {
|
|
|
20
17
|
* Created by Jaemin
|
|
21
18
|
*/
|
|
22
19
|
export declare const jaemin: (options?: JaeminOptions) => SggoiTransition;
|
|
23
|
-
export declare const jaeminInternal: (options?: JaeminInternalOptions) => SggoiTransition;
|
|
24
20
|
export {};
|
|
25
21
|
//# sourceMappingURL=jaemin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jaemin.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/jaemin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAEhB,MAAM,UAAU,CAAC;AAIlB,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;
|
|
1
|
+
{"version":3,"file":"jaemin.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/jaemin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAEhB,MAAM,UAAU,CAAC;AAIlB,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAiBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,eAqIpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pinterest.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/pinterest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"pinterest.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/pinterest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAU9D,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA0UD,eAAO,MAAM,SAAS,GAAI,UAAS,gBAAqB,KAAG,eAyG1D,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SpringConfig, SggoiTransition } from '../types';
|
|
2
|
+
interface SheetOptions {
|
|
3
|
+
direction?: "enter" | "exit";
|
|
4
|
+
spring?: Partial<SpringConfig>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Mobile-optimized bottom sheet style transition
|
|
8
|
+
*
|
|
9
|
+
* Enter direction (forward navigation):
|
|
10
|
+
* - IN: Sheet slides up from bottom
|
|
11
|
+
* - OUT: Background page scales down (1 → 0.8) with fade
|
|
12
|
+
*
|
|
13
|
+
* Exit direction (back navigation):
|
|
14
|
+
* - IN: Background page scales up (0.8 → 1) with fade
|
|
15
|
+
* - OUT: Sheet slides down with high z-index
|
|
16
|
+
*/
|
|
17
|
+
export declare const sheet: (options?: SheetOptions) => SggoiTransition;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/sheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAGhB,MAAM,UAAU,CAAC;AAgBlB,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAChC;AAoBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eAuHlD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SpringConfig, SggoiTransition } from '../types';
|
|
2
|
+
interface SwapOptions {
|
|
3
|
+
spring?: Partial<SpringConfig>;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Swap transition for peer-level navigation (e.g. bottom tabs)
|
|
7
|
+
*
|
|
8
|
+
* - OUT: Fade out only (no scale)
|
|
9
|
+
* - IN: Scale up from smaller + fade in (waits for OUT to complete)
|
|
10
|
+
*/
|
|
11
|
+
export declare const swap: (options?: SwapOptions) => SggoiTransition;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=swap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/swap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAGhB,MAAM,UAAU,CAAC;AAclB,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAChC;AAoBD;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eAyEhD,CAAC"}
|
package/package.json
CHANGED
package/dist/jaemin-BG8HRXG1.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function b(i,a){function o(d){let l=0,y=0;const t=d.offsetWidth,g=d.offsetHeight;let s=d;for(;s;)l+=s.offsetTop,y+=s.offsetLeft,s=s.offsetParent;return l-=window.scrollY,y-=window.scrollX,{top:l,left:y,width:t,height:g}}const e=o(i),n=o(a);return new DOMRect(n.left-e.left,n.top-e.top,n.width,n.height)}const x=(i,a)=>{var o;i.style.position="absolute",i.style.width="100%",i.style.top=`${-1*(((o=a==null?void 0:a.scrollOffset)==null?void 0:o.y)??0)}px`,i.style.left="0"};function M(i,a="viewport"){if(a==="positioned-parent"){const o=i.positionedParent.getBoundingClientRect();return{top:o.top,left:o.left,width:o.width,height:o.height}}else{const o=b(document.body,i.positionedParent);return{top:i.scroll.y,left:0,width:o.width,height:window.innerHeight-o.top}}}const F=(i={})=>R(i),R=(i={})=>{var l,y;const a={stiffness:((l=i.spring)==null?void 0:l.stiffness)??50,damping:((y=i.spring)==null?void 0:y.damping)??30},o=i.initialRotation??45,e=i.initialScale??.01,n=i.rotationTriggerPoint??.8,d=i.containerMode??"viewport";return{out:async(t,g)=>{const s=t.style.opacity;return{spring:{stiffness:80,damping:25},from:1,to:0,prepare:()=>{x(t,g),t.style.opacity="1"},tick:w=>{t.style.opacity=String(w)},onEnd:()=>{t.style.opacity=s}}},in:async(t,g)=>{const s=M(g,d),w=t.style.transform,$=t.style.transformOrigin,O=t.style.position,v=t.style.zIndex;return{spring:a,from:0,to:1,prepare:()=>{const r=Math.min(s.width,s.height)*.4;if(t.style.setProperty("--max-border-radius",`${r}px`),t.style.setProperty("--border-radius-scale","1"),t.style.willChange="transform",t.style.backfaceVisibility="hidden",d==="positioned-parent")t.style.transformOrigin="50% 50%",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width=`${s.width}px`,t.style.height=`${s.height}px`;else{const f=s.left+s.width/2,h=s.top+s.height/2;t.style.transformOrigin=`${f}px ${h}px`,t.style.position="fixed",t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.width=`${s.width}px`,t.style.height=`${s.height}px`}t.style.zIndex="1000",t.style.overflow="hidden",t.style.transform=`rotate(${o}deg) scale(${e}) translateZ(0)`,t.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",t.style.opacity="1"},tick:r=>{let f;if(r<=.05)f=e;else if(r<=n){const c=(r-.05)/(n-.05),u=Math.pow(c,9);f=e+(.8-e)*u}else{const c=(r-n)/(1-n);f=.8+.2*(1-Math.pow(1-c,3))}let h;const p=.7;if(r<=p)h=o;else{const c=(r-p)/(1-p),u=1-Math.pow(1-c,2);h=o*(1-u)}let P;if(r<=p)P=1;else{const c=(r-p)/(1-p);P=1-Math.pow(c,.5)}t.style.transform=`rotate(${h.toFixed(2)}deg) scale(${f.toFixed(4)}) translateZ(0)`,t.style.setProperty("--border-radius-scale",P.toFixed(4))},onEnd:()=>{t.style.willChange="",t.style.backfaceVisibility="",t.style.removeProperty("--max-border-radius"),t.style.removeProperty("--border-radius-scale"),t.style.transform=w,t.style.transformOrigin=$,t.style.position=O,t.style.zIndex=v,t.style.top="",t.style.left="",t.style.width="",t.style.height="",t.style.overflow="",t.style.borderRadius=""}}}}};exports.getRect=b;exports.jaemin=F;exports.jaeminInternal=R;exports.prepareOutgoing=x;
|
package/dist/jaemin-BWkrXq0V.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
function R(i, a) {
|
|
2
|
-
function o(d) {
|
|
3
|
-
let l = 0, y = 0;
|
|
4
|
-
const t = d.offsetWidth, g = d.offsetHeight;
|
|
5
|
-
let s = d;
|
|
6
|
-
for (; s; )
|
|
7
|
-
l += s.offsetTop, y += s.offsetLeft, s = s.offsetParent;
|
|
8
|
-
return l -= window.scrollY, y -= window.scrollX, { top: l, left: y, width: t, height: g };
|
|
9
|
-
}
|
|
10
|
-
const e = o(i), n = o(a);
|
|
11
|
-
return new DOMRect(
|
|
12
|
-
n.left - e.left,
|
|
13
|
-
n.top - e.top,
|
|
14
|
-
n.width,
|
|
15
|
-
n.height
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
const O = (i, a) => {
|
|
19
|
-
var o;
|
|
20
|
-
i.style.position = "absolute", i.style.width = "100%", i.style.top = `${-1 * (((o = a == null ? void 0 : a.scrollOffset) == null ? void 0 : o.y) ?? 0)}px`, i.style.left = "0";
|
|
21
|
-
};
|
|
22
|
-
function v(i, a = "viewport") {
|
|
23
|
-
if (a === "positioned-parent") {
|
|
24
|
-
const o = i.positionedParent.getBoundingClientRect();
|
|
25
|
-
return {
|
|
26
|
-
top: o.top,
|
|
27
|
-
left: o.left,
|
|
28
|
-
width: o.width,
|
|
29
|
-
height: o.height
|
|
30
|
-
};
|
|
31
|
-
} else {
|
|
32
|
-
const o = R(document.body, i.positionedParent);
|
|
33
|
-
return {
|
|
34
|
-
top: i.scroll.y,
|
|
35
|
-
left: 0,
|
|
36
|
-
width: o.width,
|
|
37
|
-
height: window.innerHeight - o.top
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const F = (i = {}) => M(i), M = (i = {}) => {
|
|
42
|
-
var l, y;
|
|
43
|
-
const a = {
|
|
44
|
-
// Much slower animation - 4x duration by reducing stiffness further
|
|
45
|
-
stiffness: ((l = i.spring) == null ? void 0 : l.stiffness) ?? 50,
|
|
46
|
-
damping: ((y = i.spring) == null ? void 0 : y.damping) ?? 30
|
|
47
|
-
}, o = i.initialRotation ?? 45, e = i.initialScale ?? 0.01, n = i.rotationTriggerPoint ?? 0.8, d = i.containerMode ?? "viewport";
|
|
48
|
-
return {
|
|
49
|
-
out: async (t, g) => {
|
|
50
|
-
const s = t.style.opacity;
|
|
51
|
-
return {
|
|
52
|
-
spring: {
|
|
53
|
-
stiffness: 80,
|
|
54
|
-
damping: 25
|
|
55
|
-
},
|
|
56
|
-
from: 1,
|
|
57
|
-
to: 0,
|
|
58
|
-
prepare: () => {
|
|
59
|
-
O(t, g), t.style.opacity = "1";
|
|
60
|
-
},
|
|
61
|
-
tick: (w) => {
|
|
62
|
-
t.style.opacity = String(w);
|
|
63
|
-
},
|
|
64
|
-
onEnd: () => {
|
|
65
|
-
t.style.opacity = s;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
in: async (t, g) => {
|
|
70
|
-
const s = v(g, d), w = t.style.transform, b = t.style.transformOrigin, x = t.style.position, $ = t.style.zIndex;
|
|
71
|
-
return {
|
|
72
|
-
spring: a,
|
|
73
|
-
from: 0,
|
|
74
|
-
to: 1,
|
|
75
|
-
prepare: () => {
|
|
76
|
-
const r = Math.min(s.width, s.height) * 0.4;
|
|
77
|
-
if (t.style.setProperty(
|
|
78
|
-
"--max-border-radius",
|
|
79
|
-
`${r}px`
|
|
80
|
-
), t.style.setProperty("--border-radius-scale", "1"), t.style.willChange = "transform", t.style.backfaceVisibility = "hidden", d === "positioned-parent")
|
|
81
|
-
t.style.transformOrigin = "50% 50%", t.style.position = "absolute", t.style.top = "0px", t.style.left = "0px", t.style.width = `${s.width}px`, t.style.height = `${s.height}px`;
|
|
82
|
-
else {
|
|
83
|
-
const f = s.left + s.width / 2, h = s.top + s.height / 2;
|
|
84
|
-
t.style.transformOrigin = `${f}px ${h}px`, t.style.position = "fixed", t.style.top = `${s.top}px`, t.style.left = `${s.left}px`, t.style.width = `${s.width}px`, t.style.height = `${s.height}px`;
|
|
85
|
-
}
|
|
86
|
-
t.style.zIndex = "1000", t.style.overflow = "hidden", t.style.transform = `rotate(${o}deg) scale(${e}) translateZ(0)`, t.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", t.style.opacity = "1";
|
|
87
|
-
},
|
|
88
|
-
tick: (r) => {
|
|
89
|
-
let f;
|
|
90
|
-
if (r <= 0.05)
|
|
91
|
-
f = e;
|
|
92
|
-
else if (r <= n) {
|
|
93
|
-
const c = (r - 0.05) / (n - 0.05), u = Math.pow(c, 9);
|
|
94
|
-
f = e + (0.8 - e) * u;
|
|
95
|
-
} else {
|
|
96
|
-
const c = (r - n) / (1 - n);
|
|
97
|
-
f = 0.8 + 0.2 * (1 - Math.pow(1 - c, 3));
|
|
98
|
-
}
|
|
99
|
-
let h;
|
|
100
|
-
const p = 0.7;
|
|
101
|
-
if (r <= p)
|
|
102
|
-
h = o;
|
|
103
|
-
else {
|
|
104
|
-
const c = (r - p) / (1 - p), u = 1 - Math.pow(1 - c, 2);
|
|
105
|
-
h = o * (1 - u);
|
|
106
|
-
}
|
|
107
|
-
let P;
|
|
108
|
-
if (r <= p)
|
|
109
|
-
P = 1;
|
|
110
|
-
else {
|
|
111
|
-
const c = (r - p) / (1 - p);
|
|
112
|
-
P = 1 - Math.pow(c, 0.5);
|
|
113
|
-
}
|
|
114
|
-
t.style.transform = `rotate(${h.toFixed(2)}deg) scale(${f.toFixed(4)}) translateZ(0)`, t.style.setProperty(
|
|
115
|
-
"--border-radius-scale",
|
|
116
|
-
P.toFixed(4)
|
|
117
|
-
);
|
|
118
|
-
},
|
|
119
|
-
onEnd: () => {
|
|
120
|
-
t.style.willChange = "", t.style.backfaceVisibility = "", t.style.removeProperty("--max-border-radius"), t.style.removeProperty("--border-radius-scale"), t.style.transform = w, t.style.transformOrigin = b, t.style.position = x, t.style.zIndex = $, t.style.top = "", t.style.left = "", t.style.width = "", t.style.height = "", t.style.overflow = "", t.style.borderRadius = "";
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
export {
|
|
127
|
-
F as a,
|
|
128
|
-
R as g,
|
|
129
|
-
M as j,
|
|
130
|
-
O as p
|
|
131
|
-
};
|