@ssgoi/react 7.4.0-beta.3 → 7.4.1
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/README.md +1 -1
- package/dist/context.cjs +2 -0
- package/dist/context.d.ts +16 -0
- package/dist/context.js +18 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -4
- package/dist/ssgoi.cjs +1 -1
- package/dist/ssgoi.js +12 -11
- package/dist/tanstack-router.cjs +1 -1
- package/dist/tanstack-router.js +12 -10
- package/package.json +25 -13
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @ssgoi/react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Native app-like page transitions for React and Next.js. Make a web app, PWA or WebView app (Capacitor, Tauri, Ionic) feel like a native app without replacing your router.
|
|
4
4
|
|
|
5
5
|
[](https://ssgoi.dev)
|
|
6
6
|
|
package/dist/context.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),n=require("@ssgoi/core/internal"),s=e.createContext(null),o=()=>n.IDLE_TRANSITION_STATE;function i(){const t=e.useContext(s);if(!t)throw new Error("useSsgoiTransition must be used within <Ssgoi>");return e.useSyncExternalStore(t.subscribe,t.getTransitionState,o)}exports.ssgoiContext=s;exports.useSsgoiTransition=i;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SsgoiContext } from '@ssgoi/core/internal';
|
|
2
|
+
import { SsgoiTransitionState } from '@ssgoi/core/types';
|
|
3
|
+
/** Provider-scoped dispatcher; `<Ssgoi>` owns the only value. */
|
|
4
|
+
export declare const ssgoiContext: import('react').Context<SsgoiContext | null>;
|
|
5
|
+
/**
|
|
6
|
+
* Reads the provider's transition lifecycle: whether a page transition is
|
|
7
|
+
* preparing or playing, and which routes it joins. Re-renders the caller on
|
|
8
|
+
* every change.
|
|
9
|
+
*
|
|
10
|
+
* Use it to defer work that would fight the animation, such as a
|
|
11
|
+
* programmatic scroll on the arriving page, until the status returns to
|
|
12
|
+
* `"idle"`.
|
|
13
|
+
*
|
|
14
|
+
* Must be called under `<Ssgoi>`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useSsgoiTransition(): SsgoiTransitionState;
|
package/dist/context.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext as o, useContext as e, useSyncExternalStore as s } from "react";
|
|
3
|
+
import { IDLE_TRANSITION_STATE as n } from "@ssgoi/core/internal";
|
|
4
|
+
const r = o(null), i = () => n;
|
|
5
|
+
function a() {
|
|
6
|
+
const t = e(r);
|
|
7
|
+
if (!t)
|
|
8
|
+
throw new Error("useSsgoiTransition must be used within <Ssgoi>");
|
|
9
|
+
return s(
|
|
10
|
+
t.subscribe,
|
|
11
|
+
t.getTransitionState,
|
|
12
|
+
i
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
r as ssgoiContext,
|
|
17
|
+
a as useSsgoiTransition
|
|
18
|
+
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@ssgoi/core/types"),o=require("./ssgoi.cjs"),i=require("./ssgoi-transition.cjs"),r=require("@ssgoi/core");exports.Ssgoi=o.Ssgoi;exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@ssgoi/core/types"),o=require("./ssgoi.cjs"),i=require("./context.cjs"),s=require("./ssgoi-transition.cjs"),r=require("@ssgoi/core");exports.Ssgoi=o.Ssgoi;exports.useSsgoiTransition=i.useSsgoiTransition;exports.SsgoiTransition=s.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.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export * from "@ssgoi/core/types";
|
|
2
|
-
import { Ssgoi as
|
|
3
|
-
import {
|
|
2
|
+
import { Ssgoi as t } from "./ssgoi.js";
|
|
3
|
+
import { useSsgoiTransition as s } from "./context.js";
|
|
4
|
+
import { SsgoiTransition as m } from "./ssgoi-transition.js";
|
|
4
5
|
export * from "@ssgoi/core";
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
t as Ssgoi,
|
|
8
|
+
m as SsgoiTransition,
|
|
9
|
+
s as useSsgoiTransition
|
|
8
10
|
};
|
package/dist/ssgoi.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),e=require("react"),c=require("@ssgoi/core/internal"),a=require("./context.cjs"),l={display:"contents"},g=e.memo(({config:o,host:r,children:u})=>{const s=e.useRef(null),t=e.useMemo(()=>c.createSggoiTransitionContext(o,{host:r}),[o,r]);return e.useEffect(()=>{const n=s.current;if(n)return c.observeSsgoiTransitions(n,t)},[t]),i.jsx(a.ssgoiContext.Provider,{value:t,children:i.jsx("div",{ref:s,"data-ssgoi-root":"",style:l,children:u})})});exports.Ssgoi=g;
|
package/dist/ssgoi.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { createSggoiTransitionContext as a, observeSsgoiTransitions as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import m, { useRef as c, useMemo as f, useEffect as u } from "react";
|
|
4
|
+
import { createSggoiTransitionContext as a, observeSsgoiTransitions as l } from "@ssgoi/core/internal";
|
|
5
|
+
import { ssgoiContext as g } from "./context.js";
|
|
6
|
+
const p = { display: "contents" }, y = m.memo(
|
|
7
|
+
({ config: t, host: r, children: n }) => {
|
|
8
|
+
const e = c(null), o = f(
|
|
9
|
+
() => a(t, { host: r }),
|
|
10
|
+
[t, r]
|
|
10
11
|
);
|
|
11
12
|
return u(() => {
|
|
12
|
-
const s =
|
|
13
|
+
const s = e.current;
|
|
13
14
|
if (s)
|
|
14
|
-
return
|
|
15
|
-
}, [
|
|
15
|
+
return l(s, o);
|
|
16
|
+
}, [o]), /* @__PURE__ */ i(g.Provider, { value: o, children: /* @__PURE__ */ i("div", { ref: e, "data-ssgoi-root": "", style: p, children: n }) });
|
|
16
17
|
}
|
|
17
18
|
);
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
y as Ssgoi
|
|
20
21
|
};
|
package/dist/tanstack-router.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("@tanstack/react-router"),c=require("./routers/route-boundary.cjs");function i({resolve:t,...n}){const o={pathname:u.useRouterState({select:s})},r=t?.(o)??{id:o.pathname};return a.jsx(c.RouteBoundary,{...n,boundary:r})}function s(t){const n=t.location.pathname,e=t.matches?.[t.matches.length-1]?.pathname;return e?e.length>1&&e.endsWith("/")&&!n.endsWith("/")?e.slice(0,-1):e:n}exports.SsgoiRouteBoundary=i;
|
package/dist/tanstack-router.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { useRouterState as
|
|
4
|
-
import { RouteBoundary as
|
|
5
|
-
function
|
|
6
|
-
resolve:
|
|
7
|
-
...
|
|
3
|
+
import { useRouterState as c } from "@tanstack/react-router";
|
|
4
|
+
import { RouteBoundary as i } from "./routers/route-boundary.js";
|
|
5
|
+
function p({
|
|
6
|
+
resolve: n,
|
|
7
|
+
...o
|
|
8
8
|
}) {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const e = { pathname: c({ select: m }) }, a = n?.(e) ?? { id: e.pathname };
|
|
10
|
+
return /* @__PURE__ */ r(i, { ...o, boundary: a });
|
|
11
|
+
}
|
|
12
|
+
function m(n) {
|
|
13
|
+
const o = n.location.pathname, t = n.matches?.[n.matches.length - 1]?.pathname;
|
|
14
|
+
return t ? t.length > 1 && t.endsWith("/") && !o.endsWith("/") ? t.slice(0, -1) : t : o;
|
|
13
15
|
}
|
|
14
16
|
export {
|
|
15
|
-
|
|
17
|
+
p as SsgoiRouteBoundary
|
|
16
18
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/react",
|
|
3
|
-
"version": "7.4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.4.1",
|
|
4
|
+
"description": "Native app-like page transitions for React and Next.js. Make a web app, PWA or WebView app feel native, with Remix, React Router and TanStack Router support.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"unplugin": "^2.3.2",
|
|
92
92
|
"@babel/core": "^7.26.10",
|
|
93
|
-
"@ssgoi/core": "^7.4.
|
|
93
|
+
"@ssgoi/core": "^7.4.1"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@babel/traverse": "7.28.5",
|
|
@@ -121,21 +121,33 @@
|
|
|
121
121
|
},
|
|
122
122
|
"keywords": [
|
|
123
123
|
"react",
|
|
124
|
+
"nextjs",
|
|
125
|
+
"next-js",
|
|
126
|
+
"next.js",
|
|
127
|
+
"remix",
|
|
128
|
+
"react-router",
|
|
129
|
+
"tanstack-router",
|
|
130
|
+
"drill-transition",
|
|
124
131
|
"page-transition",
|
|
125
132
|
"page-transitions",
|
|
133
|
+
"route-transition",
|
|
134
|
+
"navigation-animation",
|
|
135
|
+
"native-app",
|
|
136
|
+
"app-like",
|
|
137
|
+
"mobile-web",
|
|
138
|
+
"webview",
|
|
139
|
+
"pwa",
|
|
140
|
+
"capacitor",
|
|
141
|
+
"react-native-webview",
|
|
142
|
+
"hybrid-app",
|
|
126
143
|
"view-transitions",
|
|
127
144
|
"view-transition-api-alternative",
|
|
128
|
-
"animation",
|
|
129
|
-
"ssgoi",
|
|
130
|
-
"spring-physics",
|
|
131
|
-
"nextjs",
|
|
132
|
-
"next-js",
|
|
133
|
-
"cross-browser",
|
|
134
|
-
"navigation-animation",
|
|
135
|
-
"hero-transition",
|
|
136
145
|
"shared-element-transition",
|
|
137
|
-
"
|
|
138
|
-
"
|
|
146
|
+
"hero-transition",
|
|
147
|
+
"spring-physics",
|
|
148
|
+
"web-animations",
|
|
149
|
+
"animation",
|
|
150
|
+
"ssgoi"
|
|
139
151
|
],
|
|
140
152
|
"author": "MeurSyphus <tmdeoans@snu.ac.kr>",
|
|
141
153
|
"license": "MIT",
|