@ssgoi/react 7.4.0 → 7.5.0-beta.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 (61) hide show
  1. package/README.md +166 -144
  2. package/dist/context.cjs +2 -0
  3. package/dist/context.d.ts +16 -0
  4. package/dist/context.js +18 -0
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.d.ts +4 -1
  7. package/dist/index.js +8 -4
  8. package/dist/layout-boundary.cjs +2 -0
  9. package/dist/layout-boundary.d.ts +35 -0
  10. package/dist/layout-boundary.js +63 -0
  11. package/dist/legacy/nextjs/index.d.ts +9 -0
  12. package/dist/{routers → legacy}/nextjs/selected-segments-to-path.d.ts +3 -0
  13. package/dist/legacy/nextjs/ssgoi-route-boundary.cjs +2 -0
  14. package/dist/{routers → legacy}/nextjs/ssgoi-route-boundary.d.ts +14 -1
  15. package/dist/legacy/nextjs/ssgoi-route-boundary.js +14 -0
  16. package/dist/legacy/react-router.d.ts +20 -0
  17. package/dist/legacy/remix.d.ts +25 -0
  18. package/dist/legacy/route-boundary.cjs +2 -0
  19. package/dist/legacy/route-boundary.d.ts +33 -0
  20. package/dist/legacy/route-boundary.js +33 -0
  21. package/dist/{ssgoi-transition.d.ts → legacy/ssgoi-transition.d.ts} +1 -2
  22. package/dist/legacy/tanstack-router.d.ts +19 -0
  23. package/dist/legacy/unplugin/esbuild.d.ts +3 -0
  24. package/dist/legacy/unplugin/index.d.ts +17 -0
  25. package/dist/legacy/unplugin/rollup.d.ts +3 -0
  26. package/dist/legacy/unplugin/vite.d.ts +3 -0
  27. package/dist/legacy/unplugin/webpack.d.ts +3 -0
  28. package/dist/nextjs.cjs +1 -1
  29. package/dist/nextjs.d.ts +1 -1
  30. package/dist/nextjs.js +2 -2
  31. package/dist/react-router.cjs +1 -1
  32. package/dist/react-router.d.ts +1 -1
  33. package/dist/react-router.js +7 -10
  34. package/dist/remix.cjs +1 -1
  35. package/dist/remix.d.ts +1 -1
  36. package/dist/remix.js +7 -10
  37. package/dist/ssgoi.cjs +1 -1
  38. package/dist/ssgoi.d.ts +6 -0
  39. package/dist/ssgoi.js +23 -14
  40. package/dist/tanstack-router.cjs +1 -1
  41. package/dist/tanstack-router.d.ts +1 -1
  42. package/dist/tanstack-router.js +13 -12
  43. package/dist/unplugin/esbuild.d.ts +4 -2
  44. package/dist/unplugin/index.d.ts +6 -14
  45. package/dist/unplugin/rollup.d.ts +4 -2
  46. package/dist/unplugin/vite.d.ts +4 -2
  47. package/dist/unplugin/webpack.d.ts +4 -2
  48. package/package.json +34 -22
  49. package/dist/routers/nextjs/index.d.ts +0 -4
  50. package/dist/routers/nextjs/ssgoi-route-boundary.cjs +0 -2
  51. package/dist/routers/nextjs/ssgoi-route-boundary.js +0 -24
  52. package/dist/routers/react-router.d.ts +0 -7
  53. package/dist/routers/remix.d.ts +0 -8
  54. package/dist/routers/route-boundary.cjs +0 -2
  55. package/dist/routers/route-boundary.d.ts +0 -22
  56. package/dist/routers/route-boundary.js +0 -22
  57. package/dist/routers/tanstack-router.d.ts +0 -6
  58. /package/dist/{routers → legacy}/nextjs/selected-segments-to-path.cjs +0 -0
  59. /package/dist/{routers → legacy}/nextjs/selected-segments-to-path.js +0 -0
  60. /package/dist/{ssgoi-transition.cjs → legacy/ssgoi-transition.cjs} +0 -0
  61. /package/dist/{ssgoi-transition.js → legacy/ssgoi-transition.js} +0 -0
@@ -1,24 +0,0 @@
1
- "use client";
2
- import { jsx as o } from "react/jsx-runtime";
3
- import { Suspense as m } from "react";
4
- import { usePathname as s, useSelectedLayoutSegments as c } from "next/navigation";
5
- import { RouteBoundary as i } from "../route-boundary.js";
6
- function h(e) {
7
- return /* @__PURE__ */ o(m, { fallback: e.fallback ?? null, children: /* @__PURE__ */ o(d, { ...e }) });
8
- }
9
- function d({
10
- resolve: e,
11
- parallelRoutesKey: t = "children",
12
- fallback: r,
13
- ...u
14
- }) {
15
- const n = s(), l = c(t) ?? [];
16
- if (n == null) return r ?? null;
17
- const a = e?.({ pathname: n, selectedSegments: l }) ?? {
18
- id: n
19
- };
20
- return /* @__PURE__ */ o(i, { ...u, boundary: a });
21
- }
22
- export {
23
- h as SsgoiRouteBoundary
24
- };
@@ -1,7 +0,0 @@
1
- import { ElementType } from 'react';
2
- import { Location } from 'react-router';
3
- import { RouteBoundaryProps } from './route-boundary';
4
- export type SsgoiRouteBoundaryProps<T extends ElementType = "div"> = RouteBoundaryProps<Location, T>;
5
- /** @experimental React Router integration. The API may change. */
6
- export declare function SsgoiRouteBoundary<T extends ElementType = "div">({ resolve, ...props }: SsgoiRouteBoundaryProps<T>): import("react/jsx-runtime").JSX.Element;
7
- export type { RouteBoundaryState } from './route-boundary';
@@ -1,8 +0,0 @@
1
- import { ElementType } from 'react';
2
- import { useLocation } from '@remix-run/react';
3
- import { RouteBoundaryProps } from './route-boundary';
4
- export type RemixRouteLocation = ReturnType<typeof useLocation>;
5
- export type SsgoiRouteBoundaryProps<T extends ElementType = "div"> = RouteBoundaryProps<RemixRouteLocation, T>;
6
- /** @experimental Remix 2 integration. The API may change. */
7
- export declare function SsgoiRouteBoundary<T extends ElementType = "div">({ resolve, ...props }: SsgoiRouteBoundaryProps<T>): import("react/jsx-runtime").JSX.Element;
8
- export type { RouteBoundaryState } from './route-boundary';
@@ -1,2 +0,0 @@
1
- "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react");function a({boundary:e,routeKey:t,as:o,children:n,...i}){const r=o??"div";return u.createElement(r,{...i,key:t??e.key??e.id,"data-ssgoi-transition":e.id},n)}exports.RouteBoundary=a;
@@ -1,22 +0,0 @@
1
- import { ComponentPropsWithoutRef, ElementType, HTMLAttributes, ReactNode } from 'react';
2
- export interface RouteBoundaryState {
3
- id: string;
4
- /** Defaults to id. Keep this stable while a nested layout owns navigation. */
5
- key?: string | number;
6
- }
7
- export interface RouteLocation {
8
- pathname: string;
9
- }
10
- export type RouteBoundaryProps<Location extends RouteLocation = RouteLocation, T extends ElementType = "div"> = {
11
- children?: ReactNode;
12
- as?: T;
13
- /** A stable lifetime for a boundary inside a persistent route layout. */
14
- routeKey?: string | number;
15
- /** Resolve the logical route and its lifetime together during render. */
16
- resolve?: (location: Location) => RouteBoundaryState;
17
- } & Omit<ComponentPropsWithoutRef<T>, "as" | "children" | "resolve" | "routeKey">;
18
- export declare function RouteBoundary({ boundary, routeKey, as, children, ...rest }: HTMLAttributes<HTMLElement> & {
19
- as?: ElementType;
20
- routeKey?: string | number;
21
- boundary: RouteBoundaryState;
22
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,22 +0,0 @@
1
- "use client";
2
- import { createElement as r } from "react";
3
- function s({
4
- boundary: t,
5
- routeKey: e,
6
- as: o,
7
- children: n,
8
- ...i
9
- }) {
10
- return /* @__PURE__ */ r(
11
- o ?? "div",
12
- {
13
- ...i,
14
- key: e ?? t.key ?? t.id,
15
- "data-ssgoi-transition": t.id
16
- },
17
- n
18
- );
19
- }
20
- export {
21
- s as RouteBoundary
22
- };
@@ -1,6 +0,0 @@
1
- import { ElementType } from 'react';
2
- import { RouteBoundaryProps, RouteLocation } from './route-boundary';
3
- export type SsgoiRouteBoundaryProps<T extends ElementType = "div"> = RouteBoundaryProps<RouteLocation, T>;
4
- /** @experimental TanStack Router integration. The API may change. */
5
- export declare function SsgoiRouteBoundary<T extends ElementType = "div">({ resolve, ...props }: SsgoiRouteBoundaryProps<T>): import("react/jsx-runtime").JSX.Element;
6
- export type { RouteBoundaryState } from './route-boundary';