@ssgoi/react 5.2.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.
Files changed (44) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +6 -16
  3. package/dist/{react/src/lib → lib}/context.cjs +1 -1
  4. package/dist/lib/context.d.ts +3 -3
  5. package/dist/{react/src/lib → lib}/context.js +1 -2
  6. package/dist/lib/index.d.ts +1 -2
  7. package/dist/lib/ssgoi-transition.cjs +2 -0
  8. package/dist/lib/ssgoi-transition.d.ts +9 -0
  9. package/dist/lib/ssgoi-transition.js +25 -0
  10. package/dist/lib/ssgoi.cjs +2 -0
  11. package/dist/lib/ssgoi.d.ts +8 -1
  12. package/dist/lib/ssgoi.js +17 -0
  13. package/dist/lib/types.d.ts +0 -4
  14. package/dist/lib/view-transitions.d.ts +1 -0
  15. package/dist/types.cjs +1 -1
  16. package/dist/types.js +1 -10
  17. package/dist/view-transitions.cjs +1 -0
  18. package/dist/view-transitions.d.ts +2 -0
  19. package/dist/view-transitions.js +1 -0
  20. package/package.json +7 -19
  21. package/dist/core/dist/types.cjs +0 -1
  22. package/dist/core/dist/types.js +0 -80
  23. package/dist/lib/presets/index.d.ts +0 -1
  24. package/dist/lib/transition-scope.d.ts +0 -28
  25. package/dist/lib/transition.d.ts +0 -28
  26. package/dist/lib/transitions/index.d.ts +0 -1
  27. package/dist/lib/view-transitions/index.d.ts +0 -1
  28. package/dist/presets/index.cjs +0 -1
  29. package/dist/presets/index.d.ts +0 -2
  30. package/dist/presets/index.js +0 -1
  31. package/dist/react/src/lib/ssgoi-transition.cjs +0 -2
  32. package/dist/react/src/lib/ssgoi-transition.js +0 -30
  33. package/dist/react/src/lib/ssgoi.cjs +0 -2
  34. package/dist/react/src/lib/ssgoi.js +0 -21
  35. package/dist/react/src/lib/transition-scope.cjs +0 -2
  36. package/dist/react/src/lib/transition-scope.js +0 -9
  37. package/dist/react/src/lib/transition.cjs +0 -2
  38. package/dist/react/src/lib/transition.js +0 -15
  39. package/dist/transitions/index.cjs +0 -1
  40. package/dist/transitions/index.d.ts +0 -2
  41. package/dist/transitions/index.js +0 -1
  42. package/dist/view-transitions/index.cjs +0 -1
  43. package/dist/view-transitions/index.d.ts +0 -2
  44. 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 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;
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,18 +1,8 @@
1
- import { transition as n } from "./react/src/lib/transition.js";
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";
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
- A as Ssgoi,
8
- S as SsgoiTransition,
9
- c as TransitionScope,
10
- r as isCssAnimation,
11
- m as isKeyframesAnimation,
12
- e as isMultiAnimation,
13
- s as isSingleAnimation,
14
- a as isTickAnimation,
15
- f as normalizeSchedule,
16
- l as normalizeToMultiAnimation,
17
- n as transition
6
+ e as Ssgoi,
7
+ i as SsgoiTransition
18
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 SsgoiProvider");return e};exports.SsgoiProvider=r;exports.useSsgoi=s;
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;
@@ -1,3 +1,3 @@
1
- import { ReactSsgoiContext } from './types';
2
- export declare const SsgoiProvider: import('react').Provider<ReactSsgoiContext | null>;
3
- export declare const useSsgoi: () => ReactSsgoiContext;
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 {
@@ -1,5 +1,4 @@
1
- export { transition } from './transition';
2
1
  export * from './types';
3
2
  export { Ssgoi } from './ssgoi';
4
3
  export { SsgoiTransition } from './ssgoi-transition';
5
- export { TransitionScope } from './transition-scope';
4
+ export * from '@ssgoi/core';
@@ -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;
@@ -1,7 +1,14 @@
1
1
  import { default as React, ReactNode } from 'react';
2
- import { SsgoiConfig } from './types';
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
+ };
@@ -1,5 +1 @@
1
- import { SsgoiContext } from '@ssgoi/core/types';
2
1
  export * from '@ssgoi/core/types';
3
- export type ReactSsgoiContext = {
4
- getTransition: SsgoiContext;
5
- };
@@ -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 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;
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,10 +1 @@
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
- export {
3
- o as isCssAnimation,
4
- m as isKeyframesAnimation,
5
- a as isMultiAnimation,
6
- t as isSingleAnimation,
7
- e as isTickAnimation,
8
- s as normalizeSchedule,
9
- l as normalizeToMultiAnimation
10
- };
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,2 @@
1
+ export * from './lib/view-transitions'
2
+ export {}
@@ -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": "5.2.0",
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
- "./presets": {
42
- "types": "./dist/presets/index.d.ts",
43
- "import": "./dist/presets/index.js",
44
- "require": "./dist/presets/index.cjs",
45
- "default": "./dist/presets/index.js"
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": "^5.2.0"
69
+ "@ssgoi/core": "^6.0.0"
82
70
  },
83
71
  "devDependencies": {
84
72
  "@types/babel__core": "^7.20.5",
@@ -1 +0,0 @@
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;
@@ -1,80 +0,0 @@
1
- function k(n) {
2
- return ("tick" in n || "css" in n) && !("items" in n);
3
- }
4
- function f(n) {
5
- return "items" in n;
6
- }
7
- function h(n) {
8
- return "css" in n && typeof n.css == "function";
9
- }
10
- function w(n) {
11
- return "tick" in n && typeof n.tick == "function";
12
- }
13
- function m(n) {
14
- return "keyframes" in n && n.keyframes !== void 0 && n.keyframes !== null;
15
- }
16
- async function A(n) {
17
- const e = await n;
18
- return f(e) ? {
19
- prepare: e.prepare,
20
- wait: e.wait,
21
- onReady: e.onReady,
22
- onStart: e.onStart,
23
- onEnd: e.onEnd,
24
- items: e.items,
25
- schedule: e.schedule
26
- } : {
27
- prepare: e.prepare,
28
- wait: e.wait,
29
- onReady: e.onReady,
30
- onStart: e.onStart,
31
- onEnd: e.onEnd,
32
- items: [
33
- {
34
- physics: e.physics,
35
- tick: e.tick,
36
- css: e.css
37
- }
38
- ],
39
- schedule: "parallel"
40
- };
41
- }
42
- function S(n, e) {
43
- const a = n.schedule ?? "parallel", o = n.items.map(
44
- (i) => {
45
- let t;
46
- switch (a) {
47
- case "parallel":
48
- t = 0;
49
- break;
50
- case "sequential":
51
- t = 1;
52
- break;
53
- case "stagger":
54
- t = Math.max(0, Math.min(1, i.offset ?? 0));
55
- break;
56
- default:
57
- t = 0;
58
- }
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 };
65
- }
66
- ), { schedule: d, ...r } = n;
67
- return {
68
- ...r,
69
- items: o
70
- };
71
- }
72
- export {
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
80
- };
@@ -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 {};
@@ -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';
@@ -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]})});
@@ -1,2 +0,0 @@
1
- export * from '../lib/presets/index'
2
- export {}
@@ -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,2 +0,0 @@
1
- export * from '../lib/transitions/index'
2
- export {}
@@ -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,2 +0,0 @@
1
- export * from '../lib/view-transitions/index'
2
- export {}
@@ -1 +0,0 @@
1
- export * from "@ssgoi/core/view-transitions";