@ssgoi/react 5.0.0 → 6.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/index.cjs +1 -1
- package/dist/index.js +6 -15
- package/dist/{react/src/lib → lib}/context.cjs +1 -1
- package/dist/lib/context.d.ts +3 -3
- package/dist/{react/src/lib → lib}/context.js +1 -2
- package/dist/lib/index.d.ts +1 -2
- package/dist/lib/ssgoi-transition.cjs +2 -0
- package/dist/lib/ssgoi-transition.d.ts +9 -0
- package/dist/lib/ssgoi-transition.js +25 -0
- package/dist/lib/ssgoi.cjs +2 -0
- package/dist/lib/ssgoi.d.ts +8 -1
- package/dist/lib/ssgoi.js +17 -0
- package/dist/lib/types.d.ts +0 -4
- package/dist/lib/view-transitions.d.ts +1 -0
- package/dist/types.cjs +1 -1
- package/dist/types.js +1 -9
- package/dist/view-transitions.cjs +1 -0
- package/dist/view-transitions.d.ts +2 -0
- package/dist/view-transitions.js +1 -0
- package/package.json +7 -19
- package/dist/core/dist/types.cjs +0 -1
- package/dist/core/dist/types.js +0 -72
- package/dist/lib/presets/index.d.ts +0 -1
- package/dist/lib/transition-scope.d.ts +0 -28
- package/dist/lib/transition.d.ts +0 -28
- package/dist/lib/transitions/index.d.ts +0 -1
- package/dist/lib/view-transitions/index.d.ts +0 -1
- package/dist/presets/index.cjs +0 -1
- package/dist/presets/index.d.ts +0 -2
- package/dist/presets/index.js +0 -1
- package/dist/react/src/lib/ssgoi-transition.cjs +0 -2
- package/dist/react/src/lib/ssgoi-transition.js +0 -30
- package/dist/react/src/lib/ssgoi.cjs +0 -2
- package/dist/react/src/lib/ssgoi.js +0 -21
- package/dist/react/src/lib/transition-scope.cjs +0 -2
- package/dist/react/src/lib/transition-scope.js +0 -9
- package/dist/react/src/lib/transition.cjs +0 -2
- package/dist/react/src/lib/transition.js +0 -15
- package/dist/transitions/index.cjs +0 -1
- package/dist/transitions/index.d.ts +0 -2
- package/dist/transitions/index.js +0 -1
- package/dist/view-transitions/index.cjs +0 -1
- package/dist/view-transitions/index.d.ts +0 -2
- package/dist/view-transitions/index.js +0 -1
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 t=require("@ssgoi/core/types"),o=require("./lib/ssgoi.cjs"),i=require("./lib/ssgoi-transition.cjs"),r=require("@ssgoi/core");exports.Ssgoi=o.Ssgoi;exports.SsgoiTransition=i.SsgoiTransition;Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});Object.keys(r).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { TransitionScope as T } from "./react/src/lib/transition-scope.js";
|
|
1
|
+
export * from "@ssgoi/core/types";
|
|
2
|
+
import { Ssgoi as e } from "./lib/ssgoi.js";
|
|
3
|
+
import { SsgoiTransition as i } from "./lib/ssgoi-transition.js";
|
|
4
|
+
export * from "@ssgoi/core";
|
|
6
5
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
T as TransitionScope,
|
|
10
|
-
r as isCssAnimation,
|
|
11
|
-
m as isMultiAnimation,
|
|
12
|
-
e as isSingleAnimation,
|
|
13
|
-
s as isTickAnimation,
|
|
14
|
-
a as normalizeSchedule,
|
|
15
|
-
l as normalizeToMultiAnimation,
|
|
16
|
-
n as transition
|
|
6
|
+
e as Ssgoi,
|
|
7
|
+
i as SsgoiTransition
|
|
17
8
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),t=o.createContext(null),r=t.Provider,s=()=>{const e=o.useContext(t);if(!e)throw new Error("useSsgoi must be used within
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),t=o.createContext(null),r=t.Provider,s=()=>{const e=o.useContext(t);if(!e)throw new Error("useSsgoi must be used within Ssgoi provider");return e};exports.SsgoiProvider=r;exports.useSsgoi=s;
|
package/dist/lib/context.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const SsgoiProvider: import('react').Provider<
|
|
3
|
-
export declare const useSsgoi: () =>
|
|
1
|
+
import { SsgoiContext } from '@ssgoi/core/types';
|
|
2
|
+
export declare const SsgoiProvider: import('react').Provider<SsgoiContext | null>;
|
|
3
|
+
export declare const useSsgoi: () => SsgoiContext;
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import { createContext as e, useContext as r } from "react";
|
|
3
3
|
const t = e(null), n = t.Provider, i = () => {
|
|
4
4
|
const o = r(t);
|
|
5
|
-
if (!o)
|
|
6
|
-
throw new Error("useSsgoi must be used within SsgoiProvider");
|
|
5
|
+
if (!o) throw new Error("useSsgoi must be used within Ssgoi provider");
|
|
7
6
|
return o;
|
|
8
7
|
};
|
|
9
8
|
export {
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),u=require("./context.cjs"),a=({children:o,id:t,as:e,className:n,...s})=>{const{refFor:i}=u.useSsgoi(),r=e||"div";return c.jsx(r,{ref:i(t),"data-ssgoi-transition":t,className:n,...s,children:o})};exports.SsgoiTransition=a;
|
|
@@ -5,5 +5,14 @@ type SsgoiTransitionProps<T extends ElementType = "div"> = {
|
|
|
5
5
|
as?: T;
|
|
6
6
|
className?: string;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Marks a subtree as a Ssgoi page boundary.
|
|
10
|
+
*
|
|
11
|
+
* The ssgoi context hands out a stable, path-bound ref callback via
|
|
12
|
+
* `refFor(id)` — the same function reference across renders for the same
|
|
13
|
+
* id, so React doesn't see a fresh ref each commit and won't churn the
|
|
14
|
+
* attach/detach cycle. Unmount is detected internally via the shared
|
|
15
|
+
* MutationObserver in the dispatcher; nothing extra to wire up here.
|
|
16
|
+
*/
|
|
8
17
|
export declare const SsgoiTransition: <T extends ElementType = "div">({ children, id, as, className, ...rest }: SsgoiTransitionProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
9
18
|
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useSsgoi as m } from "./context.js";
|
|
4
|
+
const c = ({
|
|
5
|
+
children: t,
|
|
6
|
+
id: o,
|
|
7
|
+
as: n,
|
|
8
|
+
className: r,
|
|
9
|
+
...s
|
|
10
|
+
}) => {
|
|
11
|
+
const { refFor: i } = m();
|
|
12
|
+
return /* @__PURE__ */ e(
|
|
13
|
+
n || "div",
|
|
14
|
+
{
|
|
15
|
+
ref: i(o),
|
|
16
|
+
"data-ssgoi-transition": o,
|
|
17
|
+
className: r,
|
|
18
|
+
...s,
|
|
19
|
+
children: t
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
c as SsgoiTransition
|
|
25
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),n=require("./context.cjs"),u=require("@ssgoi/core/internal"),c=o.memo(({config:e,host:t,children:r})=>{const i=o.useMemo(()=>u.createSggoiTransitionContext(e,{host:t}),[e,t]);return s.jsx(n.SsgoiProvider,{value:i,children:r})});exports.Ssgoi=c;
|
package/dist/lib/ssgoi.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { SsgoiConfig } from '
|
|
2
|
+
import { SsgoiConfig } from '@ssgoi/core/types';
|
|
3
|
+
import { HostAnimation } from '@ssgoi/core/internal';
|
|
3
4
|
interface SsgoiProps {
|
|
4
5
|
config: SsgoiConfig;
|
|
6
|
+
/**
|
|
7
|
+
* Optional external host that owns playback across transitions. Pass one in
|
|
8
|
+
* (typically from `SsgoiDebugProvider`) to drive play/pause/rate from
|
|
9
|
+
* outside the tree.
|
|
10
|
+
*/
|
|
11
|
+
host?: HostAnimation;
|
|
5
12
|
children: ReactNode;
|
|
6
13
|
}
|
|
7
14
|
export declare const Ssgoi: React.FC<SsgoiProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import i, { useMemo as s } from "react";
|
|
4
|
+
import { SsgoiProvider as n } from "./context.js";
|
|
5
|
+
import { createSggoiTransitionContext as p } from "@ssgoi/core/internal";
|
|
6
|
+
const u = i.memo(
|
|
7
|
+
({ config: o, host: r, children: t }) => {
|
|
8
|
+
const e = s(
|
|
9
|
+
() => p(o, { host: r }),
|
|
10
|
+
[o, r]
|
|
11
|
+
);
|
|
12
|
+
return /* @__PURE__ */ m(n, { value: e, children: t });
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
export {
|
|
16
|
+
u as Ssgoi
|
|
17
|
+
};
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@ssgoi/core';
|
package/dist/types.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 t=require("@ssgoi/core/types");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/dist/types.js
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
o as isCssAnimation,
|
|
4
|
-
m as isMultiAnimation,
|
|
5
|
-
t as isSingleAnimation,
|
|
6
|
-
a as isTickAnimation,
|
|
7
|
-
e as normalizeSchedule,
|
|
8
|
-
l as normalizeToMultiAnimation
|
|
9
|
-
};
|
|
1
|
+
export * from "@ssgoi/core/types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@ssgoi/core");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ssgoi/core";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.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",
|
|
@@ -20,29 +20,17 @@
|
|
|
20
20
|
"require": "./dist/index.cjs",
|
|
21
21
|
"default": "./dist/index.js"
|
|
22
22
|
},
|
|
23
|
-
"./transitions": {
|
|
24
|
-
"types": "./dist/transitions/index.d.ts",
|
|
25
|
-
"import": "./dist/transitions/index.js",
|
|
26
|
-
"require": "./dist/transitions/index.cjs",
|
|
27
|
-
"default": "./dist/transitions/index.js"
|
|
28
|
-
},
|
|
29
|
-
"./view-transitions": {
|
|
30
|
-
"types": "./dist/view-transitions/index.d.ts",
|
|
31
|
-
"import": "./dist/view-transitions/index.js",
|
|
32
|
-
"require": "./dist/view-transitions/index.cjs",
|
|
33
|
-
"default": "./dist/view-transitions/index.js"
|
|
34
|
-
},
|
|
35
23
|
"./types": {
|
|
36
24
|
"types": "./dist/types.d.ts",
|
|
37
25
|
"import": "./dist/types.js",
|
|
38
26
|
"require": "./dist/types.cjs",
|
|
39
27
|
"default": "./dist/types.js"
|
|
40
28
|
},
|
|
41
|
-
"./
|
|
42
|
-
"types": "./dist/
|
|
43
|
-
"import": "./dist/
|
|
44
|
-
"require": "./dist/
|
|
45
|
-
"default": "./dist/
|
|
29
|
+
"./view-transitions": {
|
|
30
|
+
"types": "./dist/view-transitions.d.ts",
|
|
31
|
+
"import": "./dist/view-transitions.js",
|
|
32
|
+
"require": "./dist/view-transitions.cjs",
|
|
33
|
+
"default": "./dist/view-transitions.js"
|
|
46
34
|
},
|
|
47
35
|
"./unplugin": {
|
|
48
36
|
"types": "./dist/unplugin/index.d.ts",
|
|
@@ -78,7 +66,7 @@
|
|
|
78
66
|
"dependencies": {
|
|
79
67
|
"unplugin": "^2.3.2",
|
|
80
68
|
"@babel/core": "^7.26.10",
|
|
81
|
-
"@ssgoi/core": "^
|
|
69
|
+
"@ssgoi/core": "^6.0.0"
|
|
82
70
|
},
|
|
83
71
|
"devDependencies": {
|
|
84
72
|
"@types/babel__core": "^7.20.5",
|
package/dist/core/dist/types.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function m(n){return("tick"in n||"css"in n)&&!("items"in n)}function a(n){return"items"in n}function d(n){return"css"in n&&typeof n.css=="function"}function f(n){return"tick"in n&&typeof n.tick=="function"}async function p(n){const e=await n;return a(e)?{prepare:e.prepare,wait:e.wait,onReady:e.onReady,onStart:e.onStart,onEnd:e.onEnd,items:e.items,schedule:e.schedule}:{prepare:e.prepare,wait:e.wait,onReady:e.onReady,onStart:e.onStart,onEnd:e.onEnd,items:[{physics:e.physics,tick:e.tick,css:e.css}],schedule:"parallel"}}function y(n,e){const o=n.schedule??"parallel",c=n.items.map(s=>{let t;switch(o){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}const{css:i,offset:k,...l}=s,u=i?typeof i=="function"?e?{element:e,style:i}:void 0:{element:i.element,style:i.style}:void 0;return{...l,css:u,normalizedOffset:t}}),{schedule:h,...r}=n;return{...r,items:c}}exports.isCssAnimation=d;exports.isMultiAnimation=a;exports.isSingleAnimation=m;exports.isTickAnimation=f;exports.normalizeSchedule=y;exports.normalizeToMultiAnimation=p;
|
package/dist/core/dist/types.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
function d(n) {
|
|
2
|
-
return ("tick" in n || "css" in n) && !("items" in n);
|
|
3
|
-
}
|
|
4
|
-
function u(n) {
|
|
5
|
-
return "items" in n;
|
|
6
|
-
}
|
|
7
|
-
function p(n) {
|
|
8
|
-
return "css" in n && typeof n.css == "function";
|
|
9
|
-
}
|
|
10
|
-
function y(n) {
|
|
11
|
-
return "tick" in n && typeof n.tick == "function";
|
|
12
|
-
}
|
|
13
|
-
async function h(n) {
|
|
14
|
-
const e = await n;
|
|
15
|
-
return u(e) ? {
|
|
16
|
-
prepare: e.prepare,
|
|
17
|
-
wait: e.wait,
|
|
18
|
-
onReady: e.onReady,
|
|
19
|
-
onStart: e.onStart,
|
|
20
|
-
onEnd: e.onEnd,
|
|
21
|
-
items: e.items,
|
|
22
|
-
schedule: e.schedule
|
|
23
|
-
} : {
|
|
24
|
-
prepare: e.prepare,
|
|
25
|
-
wait: e.wait,
|
|
26
|
-
onReady: e.onReady,
|
|
27
|
-
onStart: e.onStart,
|
|
28
|
-
onEnd: e.onEnd,
|
|
29
|
-
items: [
|
|
30
|
-
{
|
|
31
|
-
physics: e.physics,
|
|
32
|
-
tick: e.tick,
|
|
33
|
-
css: e.css
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
schedule: "parallel"
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function k(n, e) {
|
|
40
|
-
const a = n.schedule ?? "parallel", o = n.items.map(
|
|
41
|
-
(s) => {
|
|
42
|
-
let t;
|
|
43
|
-
switch (a) {
|
|
44
|
-
case "parallel":
|
|
45
|
-
t = 0;
|
|
46
|
-
break;
|
|
47
|
-
case "sequential":
|
|
48
|
-
t = 1;
|
|
49
|
-
break;
|
|
50
|
-
case "stagger":
|
|
51
|
-
t = Math.max(0, Math.min(1, s.offset ?? 0));
|
|
52
|
-
break;
|
|
53
|
-
default:
|
|
54
|
-
t = 0;
|
|
55
|
-
}
|
|
56
|
-
const { css: i, offset: f, ...r } = s, l = i ? typeof i == "function" ? e ? { element: e, style: i } : void 0 : { element: i.element, style: i.style } : void 0;
|
|
57
|
-
return { ...r, css: l, normalizedOffset: t };
|
|
58
|
-
}
|
|
59
|
-
), { schedule: m, ...c } = n;
|
|
60
|
-
return {
|
|
61
|
-
...c,
|
|
62
|
-
items: o
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
export {
|
|
66
|
-
p as isCssAnimation,
|
|
67
|
-
u as isMultiAnimation,
|
|
68
|
-
d as isSingleAnimation,
|
|
69
|
-
y as isTickAnimation,
|
|
70
|
-
k as normalizeSchedule,
|
|
71
|
-
h as normalizeToMultiAnimation
|
|
72
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@ssgoi/core/presets';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
type TransitionScopeProps = {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* TransitionScope creates a boundary for local-scoped transitions.
|
|
7
|
-
*
|
|
8
|
-
* Child elements with `scope: 'local'` will:
|
|
9
|
-
* - Skip IN animation when mounted simultaneously with the scope
|
|
10
|
-
* - Skip OUT animation when unmounted simultaneously with the scope
|
|
11
|
-
*
|
|
12
|
-
* This is useful for:
|
|
13
|
-
* - Page transitions where child elements shouldn't animate individually
|
|
14
|
-
* - Modal/dialog content that appears/disappears with the container
|
|
15
|
-
* - List items that shouldn't animate when the entire list mounts/unmounts
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```tsx
|
|
19
|
-
* <TransitionScope>
|
|
20
|
-
* <div ref={transition(fadeIn(), { scope: 'local' })}>
|
|
21
|
-
* This will only animate when added/removed independently,
|
|
22
|
-
* not when the entire scope mounts/unmounts.
|
|
23
|
-
* </div>
|
|
24
|
-
* </TransitionScope>
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare function TransitionScope({ children }: TransitionScopeProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export {};
|
package/dist/lib/transition.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Transition, TransitionKey, TransitionScope } from '@ssgoi/core';
|
|
2
|
-
type TransitionOptions = Transition<undefined> & {
|
|
3
|
-
key?: TransitionKey;
|
|
4
|
-
scope?: TransitionScope;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* React ref callback for element transitions
|
|
8
|
-
*
|
|
9
|
-
* OUT transition is automatically triggered by MutationObserver
|
|
10
|
-
* when the element is removed from the DOM - works with React 18+
|
|
11
|
-
*
|
|
12
|
-
* The returned ref callback has a stable reference (cached by key),
|
|
13
|
-
* so it won't cause unnecessary re-renders when used with React refs.
|
|
14
|
-
*
|
|
15
|
-
* Note: key is optional in the type signature because it can be auto-injected
|
|
16
|
-
* by babel-plugin-ssgoi at build time. However, it is required at runtime.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```tsx
|
|
20
|
-
* <div ref={transition({
|
|
21
|
-
* key: 'fade',
|
|
22
|
-
* in: (el) => ({ tick: (p) => el.style.opacity = String(p) }),
|
|
23
|
-
* out: (el) => ({ tick: (p) => el.style.opacity = String(p) }),
|
|
24
|
-
* })} />
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare const transition: (options: TransitionOptions) => import('@ssgoi/core').RefCallback;
|
|
28
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@ssgoi/core/transitions';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@ssgoi/core/view-transitions';
|
package/dist/presets/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@ssgoi/core/presets");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/dist/presets/index.d.ts
DELETED
package/dist/presets/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "@ssgoi/core/presets";
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),g=require("react"),S=require("./transition.cjs"),f=require("./context.cjs"),m=({children:o,id:t,as:i,className:s,...e})=>{const{getTransition:r}=f.useSsgoi(),a=i||"div",n=r(t),c=g.useMemo(()=>S.transition(n),[n]);return u.jsx(a,{ref:c,"data-ssgoi-transition":t,className:s,...e,children:o})};exports.SsgoiTransition=m;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as f } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo as p } from "react";
|
|
4
|
-
import { transition as c } from "./transition.js";
|
|
5
|
-
import { useSsgoi as g } from "./context.js";
|
|
6
|
-
const T = ({
|
|
7
|
-
children: n,
|
|
8
|
-
id: o,
|
|
9
|
-
as: i,
|
|
10
|
-
className: r,
|
|
11
|
-
...s
|
|
12
|
-
}) => {
|
|
13
|
-
const { getTransition: m } = g(), e = i || "div", t = m(o), a = p(
|
|
14
|
-
() => c(t),
|
|
15
|
-
[t]
|
|
16
|
-
);
|
|
17
|
-
return /* @__PURE__ */ f(
|
|
18
|
-
e,
|
|
19
|
-
{
|
|
20
|
-
ref: a,
|
|
21
|
-
"data-ssgoi-transition": o,
|
|
22
|
-
className: r,
|
|
23
|
-
...s,
|
|
24
|
-
children: n
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
T as SsgoiTransition
|
|
30
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("react"),i=require("./context.cjs"),n=require("@ssgoi/core"),u=t.memo(({config:e,children:o})=>{const r=t.useMemo(()=>({getTransition:n.createSggoiTransitionContext(e,{outFirst:!1})}),[e]);return s.jsx(i.SsgoiProvider,{value:r,children:o})});exports.Ssgoi=u;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import i, { useMemo as m } from "react";
|
|
4
|
-
import { SsgoiProvider as s } from "./context.js";
|
|
5
|
-
import { createSggoiTransitionContext as n } from "@ssgoi/core";
|
|
6
|
-
const f = i.memo(
|
|
7
|
-
({ config: o, children: t }) => {
|
|
8
|
-
const r = m(
|
|
9
|
-
() => ({
|
|
10
|
-
getTransition: n(o, {
|
|
11
|
-
outFirst: !1
|
|
12
|
-
})
|
|
13
|
-
}),
|
|
14
|
-
[o]
|
|
15
|
-
);
|
|
16
|
-
return /* @__PURE__ */ e(s, { value: r, children: t });
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
export {
|
|
20
|
-
f as Ssgoi
|
|
21
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("@ssgoi/core");function r({children:e}){return t.jsx("div",{ref:n.createTransitionScope(),style:{display:"contents"},children:e})}exports.TransitionScope=r;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { createTransitionScope as t } from "@ssgoi/core";
|
|
4
|
-
function n({ children: o }) {
|
|
5
|
-
return /* @__PURE__ */ r("div", { ref: t(), style: { display: "contents" }, children: o });
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
n as TransitionScope
|
|
9
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@ssgoi/core"),t=e=>{if(!e.key)throw new Error("[ssgoi] transition() requires a 'key' property. Either provide it manually or use plugin for auto-injection. import plugin from @ssgoi/react/unplugin/webpack; see: https://ssgoi.dev/en/docs/core-concepts/react-plugin");return r.transition(e,"auto")};exports.transition=t;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { transition as t } from "@ssgoi/core";
|
|
3
|
-
const o = (r) => {
|
|
4
|
-
if (!r.key)
|
|
5
|
-
throw new Error(
|
|
6
|
-
"[ssgoi] transition() requires a 'key' property. Either provide it manually or use plugin for auto-injection. import plugin from @ssgoi/react/unplugin/webpack; see: https://ssgoi.dev/en/docs/core-concepts/react-plugin"
|
|
7
|
-
);
|
|
8
|
-
return t(
|
|
9
|
-
r,
|
|
10
|
-
"auto"
|
|
11
|
-
);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
o as transition
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@ssgoi/core/transitions");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "@ssgoi/core/transitions";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@ssgoi/core/view-transitions");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "@ssgoi/core/view-transitions";
|