@ssgoi/react 0.0.7 → 2.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.
@@ -1,14 +0,0 @@
1
- import { createContext, useContext } from "react";
2
- import type { SsgoiContext } from "./types";
3
-
4
- const SsgoiContextInstance = createContext<SsgoiContext | null>(null);
5
-
6
- export const SsgoiProvider = SsgoiContextInstance.Provider;
7
-
8
- export const useSsgoi = () => {
9
- const context = useContext(SsgoiContextInstance);
10
- if (!context) {
11
- throw new Error("useSsgoi must be used within SsgoiProvider");
12
- }
13
- return context;
14
- };
package/src/lib/index.ts DELETED
@@ -1,4 +0,0 @@
1
- export { transition } from "./transition";
2
- export * from "./types";
3
- export { Ssgoi } from "./ssgoi";
4
- export { SsgoiTransition } from "./ssgoi-transition";
@@ -1,21 +0,0 @@
1
- "use client";
2
-
3
- import type { ReactNode } from "react";
4
- import { transition } from "./transition";
5
- import { useSsgoi } from "./context";
6
-
7
- export const SsgoiTransition = ({
8
- children,
9
- id,
10
- }: {
11
- children: ReactNode;
12
- id: string;
13
- }) => {
14
- const getTransition = useSsgoi();
15
-
16
- return (
17
- <div ref={transition(getTransition(id))} data-ssgoi-transition={id}>
18
- {children}
19
- </div>
20
- );
21
- };
package/src/lib/ssgoi.tsx DELETED
@@ -1,20 +0,0 @@
1
- "use client";
2
- import React, { useMemo } from "react";
3
- import type { ReactNode } from "react";
4
- import type { SsgoiConfig, SsgoiContext } from "./types";
5
- import { SsgoiProvider } from "./context";
6
- import { createSggoiTransitionContext } from "@ssgoi/core";
7
-
8
- interface SsgoiProps {
9
- config: SsgoiConfig;
10
- children: ReactNode;
11
- }
12
-
13
- export const Ssgoi: React.FC<SsgoiProps> = ({ config, children }) => {
14
- const contextValue = useMemo<SsgoiContext>(
15
- () => createSggoiTransitionContext(config),
16
- [config]
17
- );
18
-
19
- return <SsgoiProvider value={contextValue}>{children}</SsgoiProvider>;
20
- };
@@ -1,3 +0,0 @@
1
- import { transition as _transition } from "@ssgoi/core";
2
-
3
- export const transition = _transition;
@@ -1 +0,0 @@
1
- export * from '@ssgoi/core/transitions';
package/src/lib/types.ts DELETED
@@ -1 +0,0 @@
1
- export * from "@ssgoi/core/types";
@@ -1 +0,0 @@
1
- export * from '@ssgoi/core/view-transitions';
package/src/vite-env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />