@real-router/react 0.9.0 → 0.10.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 +1 @@
1
- {"inputs":{"../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js":{"bytes":569,"imports":[],"format":"esm"},"src/constants.ts":{"bytes":225,"imports":[{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/context.ts":{"bytes":416,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRouter.tsx":{"bytes":364,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"../context"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useStableValue.tsx":{"bytes":976,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useIsActiveRoute.tsx":{"bytes":1060,"imports":[{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"},{"path":"src/hooks/useStableValue.tsx","kind":"import-statement","original":"./useStableValue"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/utils.ts":{"bytes":293,"imports":[{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/components/Link.tsx":{"bytes":2900,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/hooks/useIsActiveRoute.tsx","kind":"import-statement","original":"../hooks/useIsActiveRoute"},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"../hooks/useRouter"},{"path":"src/hooks/useStableValue.tsx","kind":"import-statement","original":"../hooks/useStableValue"},{"path":"src/utils.ts","kind":"import-statement","original":"../utils"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRouteNode.tsx":{"bytes":837,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/components/RouteView.tsx":{"bytes":3407,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouteNode.tsx","kind":"import-statement","original":"../hooks/useRouteNode"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRoute.tsx":{"bytes":403,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"../context"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useNavigator.tsx":{"bytes":394,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"../context"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRouteUtils.tsx":{"bytes":977,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRouterTransition.tsx":{"bytes":508,"imports":[{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/RouterProvider.tsx":{"bytes":1380,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"./context"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":973,"imports":[{"path":"src/components/Link.tsx","kind":"import-statement","original":"./components/Link"},{"path":"src/components/RouteView.tsx","kind":"import-statement","original":"./components/RouteView"},{"path":"src/hooks/useRouteNode.tsx","kind":"import-statement","original":"./hooks/useRouteNode"},{"path":"src/hooks/useRoute.tsx","kind":"import-statement","original":"./hooks/useRoute"},{"path":"src/hooks/useNavigator.tsx","kind":"import-statement","original":"./hooks/useNavigator"},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./hooks/useRouter"},{"path":"src/hooks/useRouteUtils.tsx","kind":"import-statement","original":"./hooks/useRouteUtils"},{"path":"src/hooks/useIsActiveRoute.tsx","kind":"import-statement","original":"./hooks/useIsActiveRoute"},{"path":"src/hooks/useRouterTransition.tsx","kind":"import-statement","original":"./hooks/useRouterTransition"},{"path":"src/RouterProvider.tsx","kind":"import-statement","original":"./RouterProvider"},{"path":"src/context.ts","kind":"import-statement","original":"./context"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/legacy.ts":{"bytes":973,"imports":[{"path":"src/components/Link.tsx","kind":"import-statement","original":"./components/Link"},{"path":"src/components/RouteView.tsx","kind":"import-statement","original":"./components/RouteView"},{"path":"src/hooks/useRouteNode.tsx","kind":"import-statement","original":"./hooks/useRouteNode"},{"path":"src/hooks/useRoute.tsx","kind":"import-statement","original":"./hooks/useRoute"},{"path":"src/hooks/useNavigator.tsx","kind":"import-statement","original":"./hooks/useNavigator"},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./hooks/useRouter"},{"path":"src/hooks/useRouteUtils.tsx","kind":"import-statement","original":"./hooks/useRouteUtils"},{"path":"src/hooks/useIsActiveRoute.tsx","kind":"import-statement","original":"./hooks/useIsActiveRoute"},{"path":"src/hooks/useRouterTransition.tsx","kind":"import-statement","original":"./hooks/useRouterTransition"},{"path":"src/RouterProvider.tsx","kind":"import-statement","original":"./RouterProvider"},{"path":"src/context.ts","kind":"import-statement","original":"./context"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/cjs/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":21277},"dist/cjs/index.js":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Link","NavigatorContext","RouteContext","RouteView","RouterContext","RouterProvider","useIsActiveRoute","useNavigator","useRoute","useRouteNode","useRouteUtils","useRouter","useRouterTransition"],"entryPoint":"src/index.ts","inputs":{"src/components/Link.tsx":{"bytesInOutput":2409},"src/constants.ts":{"bytesInOutput":77},"src/hooks/useIsActiveRoute.tsx":{"bytesInOutput":671},"src/hooks/useRouter.tsx":{"bytesInOutput":202},"src/context.ts":{"bytesInOutput":164},"src/hooks/useStableValue.tsx":{"bytesInOutput":157},"src/utils.ts":{"bytesInOutput":140},"src/index.ts":{"bytesInOutput":0},"src/components/RouteView.tsx":{"bytesInOutput":2130},"src/hooks/useRouteNode.tsx":{"bytesInOutput":742},"src/hooks/useRoute.tsx":{"bytesInOutput":225},"src/hooks/useNavigator.tsx":{"bytesInOutput":229},"src/hooks/useRouteUtils.tsx":{"bytesInOutput":225},"src/hooks/useRouterTransition.tsx":{"bytesInOutput":397},"src/RouterProvider.tsx":{"bytesInOutput":1001}},"bytes":9512},"dist/cjs/legacy.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":21277},"dist/cjs/legacy.js":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Link","NavigatorContext","RouteContext","RouteView","RouterContext","RouterProvider","useIsActiveRoute","useNavigator","useRoute","useRouteNode","useRouteUtils","useRouter","useRouterTransition"],"entryPoint":"src/legacy.ts","inputs":{"src/components/Link.tsx":{"bytesInOutput":2409},"src/constants.ts":{"bytesInOutput":77},"src/hooks/useIsActiveRoute.tsx":{"bytesInOutput":671},"src/hooks/useRouter.tsx":{"bytesInOutput":202},"src/context.ts":{"bytesInOutput":164},"src/hooks/useStableValue.tsx":{"bytesInOutput":157},"src/utils.ts":{"bytesInOutput":140},"src/legacy.ts":{"bytesInOutput":0},"src/components/RouteView.tsx":{"bytesInOutput":2130},"src/hooks/useRouteNode.tsx":{"bytesInOutput":742},"src/hooks/useRoute.tsx":{"bytesInOutput":225},"src/hooks/useNavigator.tsx":{"bytesInOutput":229},"src/hooks/useRouteUtils.tsx":{"bytesInOutput":225},"src/hooks/useRouterTransition.tsx":{"bytesInOutput":397},"src/RouterProvider.tsx":{"bytesInOutput":1001}},"bytes":9512}}}
1
+ {"inputs":{"../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js":{"bytes":569,"imports":[],"format":"esm"},"src/constants.ts":{"bytes":225,"imports":[{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/context.ts":{"bytes":416,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRouter.tsx":{"bytes":364,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"../context"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useStableValue.tsx":{"bytes":976,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useIsActiveRoute.tsx":{"bytes":1060,"imports":[{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"},{"path":"src/hooks/useStableValue.tsx","kind":"import-statement","original":"./useStableValue"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/utils.ts":{"bytes":293,"imports":[{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/components/Link.tsx":{"bytes":2900,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/hooks/useIsActiveRoute.tsx","kind":"import-statement","original":"../hooks/useIsActiveRoute"},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"../hooks/useRouter"},{"path":"src/hooks/useStableValue.tsx","kind":"import-statement","original":"../hooks/useStableValue"},{"path":"src/utils.ts","kind":"import-statement","original":"../utils"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/components/modern/RouteView/components.tsx":{"bytes":286,"imports":[{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/components/modern/RouteView/helpers.tsx":{"bytes":2980,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/components/modern/RouteView/components.tsx","kind":"import-statement","original":"./components"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRouteNode.tsx":{"bytes":837,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/components/modern/RouteView/RouteView.tsx":{"bytes":1073,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/modern/RouteView/components.tsx","kind":"import-statement","original":"./components"},{"path":"src/components/modern/RouteView/helpers.tsx","kind":"import-statement","original":"./helpers"},{"path":"src/hooks/useRouteNode.tsx","kind":"import-statement","original":"../../../hooks/useRouteNode"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/components/modern/RouteView/index.ts":{"bytes":145,"imports":[{"path":"src/components/modern/RouteView/RouteView.tsx","kind":"import-statement","original":"./RouteView"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRoute.tsx":{"bytes":403,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"../context"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useNavigator.tsx":{"bytes":394,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"../context"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRouteUtils.tsx":{"bytes":977,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRouterTransition.tsx":{"bytes":508,"imports":[{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/RouterProvider.tsx":{"bytes":1380,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"./context"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":987,"imports":[{"path":"src/components/Link.tsx","kind":"import-statement","original":"./components/Link"},{"path":"src/components/modern/RouteView/index.ts","kind":"import-statement","original":"./components/modern/RouteView"},{"path":"src/hooks/useRouteNode.tsx","kind":"import-statement","original":"./hooks/useRouteNode"},{"path":"src/hooks/useRoute.tsx","kind":"import-statement","original":"./hooks/useRoute"},{"path":"src/hooks/useNavigator.tsx","kind":"import-statement","original":"./hooks/useNavigator"},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./hooks/useRouter"},{"path":"src/hooks/useRouteUtils.tsx","kind":"import-statement","original":"./hooks/useRouteUtils"},{"path":"src/hooks/useIsActiveRoute.tsx","kind":"import-statement","original":"./hooks/useIsActiveRoute"},{"path":"src/hooks/useRouterTransition.tsx","kind":"import-statement","original":"./hooks/useRouterTransition"},{"path":"src/RouterProvider.tsx","kind":"import-statement","original":"./RouterProvider"},{"path":"src/context.ts","kind":"import-statement","original":"./context"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/legacy.ts":{"bytes":805,"imports":[{"path":"src/components/Link.tsx","kind":"import-statement","original":"./components/Link"},{"path":"src/hooks/useRouteNode.tsx","kind":"import-statement","original":"./hooks/useRouteNode"},{"path":"src/hooks/useRoute.tsx","kind":"import-statement","original":"./hooks/useRoute"},{"path":"src/hooks/useNavigator.tsx","kind":"import-statement","original":"./hooks/useNavigator"},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./hooks/useRouter"},{"path":"src/hooks/useRouteUtils.tsx","kind":"import-statement","original":"./hooks/useRouteUtils"},{"path":"src/hooks/useIsActiveRoute.tsx","kind":"import-statement","original":"./hooks/useIsActiveRoute"},{"path":"src/hooks/useRouterTransition.tsx","kind":"import-statement","original":"./hooks/useRouterTransition"},{"path":"src/RouterProvider.tsx","kind":"import-statement","original":"./RouterProvider"},{"path":"src/context.ts","kind":"import-statement","original":"./context"},{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/cjs/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":23036},"dist/cjs/index.js":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Link","NavigatorContext","RouteContext","RouteView","RouterContext","RouterProvider","useIsActiveRoute","useNavigator","useRoute","useRouteNode","useRouteUtils","useRouter","useRouterTransition"],"entryPoint":"src/index.ts","inputs":{"src/components/Link.tsx":{"bytesInOutput":2409},"src/constants.ts":{"bytesInOutput":77},"src/hooks/useIsActiveRoute.tsx":{"bytesInOutput":671},"src/hooks/useRouter.tsx":{"bytesInOutput":202},"src/context.ts":{"bytesInOutput":164},"src/hooks/useStableValue.tsx":{"bytesInOutput":157},"src/utils.ts":{"bytesInOutput":140},"src/index.ts":{"bytesInOutput":0},"src/components/modern/RouteView/RouteView.tsx":{"bytesInOutput":712},"src/components/modern/RouteView/components.tsx":{"bytesInOutput":171},"src/components/modern/RouteView/helpers.tsx":{"bytesInOutput":2366},"src/hooks/useRouteNode.tsx":{"bytesInOutput":742},"src/components/modern/RouteView/index.ts":{"bytesInOutput":0},"src/hooks/useRoute.tsx":{"bytesInOutput":225},"src/hooks/useNavigator.tsx":{"bytesInOutput":229},"src/hooks/useRouteUtils.tsx":{"bytesInOutput":225},"src/hooks/useRouterTransition.tsx":{"bytesInOutput":397},"src/RouterProvider.tsx":{"bytesInOutput":1001}},"bytes":10764},"dist/cjs/legacy.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":16253},"dist/cjs/legacy.js":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Link","NavigatorContext","RouteContext","RouterContext","RouterProvider","useIsActiveRoute","useNavigator","useRoute","useRouteNode","useRouteUtils","useRouter","useRouterTransition"],"entryPoint":"src/legacy.ts","inputs":{"src/components/Link.tsx":{"bytesInOutput":2409},"src/constants.ts":{"bytesInOutput":77},"src/hooks/useIsActiveRoute.tsx":{"bytesInOutput":671},"src/hooks/useRouter.tsx":{"bytesInOutput":202},"src/context.ts":{"bytesInOutput":164},"src/hooks/useStableValue.tsx":{"bytesInOutput":157},"src/utils.ts":{"bytesInOutput":140},"src/legacy.ts":{"bytesInOutput":0},"src/hooks/useRouteNode.tsx":{"bytesInOutput":742},"src/hooks/useRoute.tsx":{"bytesInOutput":225},"src/hooks/useNavigator.tsx":{"bytesInOutput":229},"src/hooks/useRouteUtils.tsx":{"bytesInOutput":225},"src/hooks/useRouterTransition.tsx":{"bytesInOutput":397},"src/RouterProvider.tsx":{"bytesInOutput":1001}},"bytes":7303}}}
@@ -0,0 +1 @@
1
+ import{createContext as e,memo as r,useMemo as t,useCallback as o,use as i,useSyncExternalStore as n}from"react";import{createActiveRouteSource as a,createRouteNodeSource as u,createTransitionSource as s,createRouteSource as c}from"@real-router/sources";import{jsx as l}from"react/jsx-runtime";import{getNavigator as m,getPluginApi as v}from"@real-router/core";import{getRouteUtils as f}from"@real-router/route-utils";var h=e(null),g=e(null),p=e(null),d=()=>{const e=i(g);if(!e)throw new Error("useRouter must be used within a RouterProvider");return e};function b(e){const r=JSON.stringify(e);return t(()=>e,[r])}function y(e,r,o=!1,i=!0){const u=d(),s=b(r),c=t(()=>a(u,e,s,{strict:o,ignoreQueryParams:i}),[u,e,s,o,i]);return n(c.subscribe,c.getSnapshot,c.getSnapshot)}var N=Object.freeze({}),S=Object.freeze({}),P=r(({routeName:e,routeParams:r=N,routeOptions:i=S,className:n,activeClassName:a="active",activeStrict:u=!1,ignoreQueryParams:s=!0,onClick:c,target:m,children:v,...f})=>{const h=d(),g=b(r),p=b(i),P=y(e,g,u,s),O=t(()=>"function"==typeof h.buildUrl?h.buildUrl(e,g):h.buildPath(e,g),[h,e,g]),w=o(r=>{c&&(c(r),r.defaultPrevented)||function(e){return!(0!==e.button||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(r)&&"_blank"!==m&&(r.preventDefault(),h.navigate(e,g,p).catch(()=>{}))},[c,m,h,e,g,p]),R=t(()=>P&&a?n?`${n} ${a}`.trim():a:n??void 0,[P,n,a]);return l("a",{...f,href:O,className:R,onClick:w,children:v})},function(e,r){return e.routeName===r.routeName&&e.className===r.className&&e.activeClassName===r.activeClassName&&e.activeStrict===r.activeStrict&&e.ignoreQueryParams===r.ignoreQueryParams&&e.onClick===r.onClick&&e.target===r.target&&e.style===r.style&&e.children===r.children&&JSON.stringify(e.routeParams)===JSON.stringify(r.routeParams)&&JSON.stringify(e.routeOptions)===JSON.stringify(r.routeOptions)});function O(e){const r=d(),o=t(()=>u(r,e),[r,e]),{route:i,previousRoute:a}=n(o.subscribe,o.getSnapshot,o.getSnapshot),s=t(()=>m(r),[r]);return t(()=>({navigator:s,route:i,previousRoute:a}),[s,i,a])}P.displayName="Link";var w=()=>{const e=i(h);if(!e)throw new Error("useRoute must be used within a RouteProvider");return e},R=()=>{const e=i(p);if(!e)throw new Error("useNavigator must be used within a RouterProvider");return e},C=()=>{const e=d();return f(v(e).getTree())};function k(){const e=d(),r=t(()=>s(e),[e]);return n(r.subscribe,r.getSnapshot,r.getSnapshot)}var J=({router:e,children:r})=>{const o=t(()=>m(e),[e]),i=t(()=>c(e),[e]),{route:a,previousRoute:u}=n(i.subscribe,i.getSnapshot,i.getSnapshot),s=t(()=>({navigator:o,route:a,previousRoute:u}),[o,a,u]);return l(g,{value:e,children:l(p,{value:o,children:l(h,{value:s,children:r})})})};export{P as Link,p as NavigatorContext,h as RouteContext,g as RouterContext,J as RouterProvider,y as useIsActiveRoute,R as useNavigator,w as useRoute,O as useRouteNode,C as useRouteUtils,d as useRouter,k as useRouterTransition};//# sourceMappingURL=chunk-35HV34W6.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/context.ts","../../src/hooks/useRouter.tsx","../../src/hooks/useStableValue.tsx","../../src/hooks/useIsActiveRoute.tsx","../../src/constants.ts","../../src/utils.ts","../../src/components/Link.tsx","../../src/hooks/useRouteNode.tsx","../../src/hooks/useRoute.tsx","../../src/hooks/useNavigator.tsx","../../src/hooks/useRouteUtils.tsx","../../src/hooks/useRouterTransition.tsx","../../src/RouterProvider.tsx"],"names":["useMemo","useSyncExternalStore","use","getNavigator","jsx"],"mappings":";AAOO,IAAM,YAAA,GAAe,cAAuC,IAAI;AAEhE,IAAM,aAAA,GAAgB,cAA6B,IAAI;AAEvD,IAAM,gBAAA,GAAmB,cAAgC,IAAI;ACH7D,IAAM,YAAY,MAAc;AACrC,EAAA,MAAM,MAAA,GAAS,IAAI,aAAa,CAAA;AAEhC,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,MAAM,IAAI,MAAM,gDAAgD,CAAA;AAAA,EAClE;AAEA,EAAA,OAAO,MAAA;AACT;ACMO,SAAS,eAAkB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A,EAAU;AAEzB,EAAA,MAAM,KAAA,GAAQF,QAAQ,MAAM,sBAAA,CAAuB,MAAM,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AAEpE,EAAA,OAAOC,oBAAAA;AAAA,IACL,KAAA,CAAM,SAAA;AAAA,IACN,KAAA,CAAM,WAAA;AAAA,IACN,KAAA,CAAM;AAAA,GACR;AACF;ACHO,IAAM,iBAAyC,CAAC;AAAA,EACrD,MAAA;AAAA,EACA;AACF,CAAA,KAAM;AACJ,EAAA,MAAM,SAAA,GAAYD,QAAQ,MAAMG,YAAAA,CAAa,MAAM,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AAK9D,EAAA,MAAM,KAAA,GAAQH,QAAQ,MAAM,iBAAA,CAAkB,MAAM,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AAC/D,EAAA,MAAM,EAAE,KAAA,EAAO,aAAA,EAAc,GAAIC,oBAAAA;AAAA,IAC/B,KAAA,CAAM,SAAA;AAAA,IACN,KAAA,CAAM,WAAA;AAAA,IACN,KAAA,CAAM;AAAA;AAAA,GACR;AAEA,EAAA,MAAM,iBAAA,GAAoBD,OAAAA;AAAA,IACxB,OAAO,EAAE,SAAA,EAAW,KAAA,EAAO,aAAA,EAAc,CAAA;AAAA,IACzC,CAAC,SAAA,EAAW,KAAA,EAAO,aAAa;AAAA,GAClC;AAEA,EAAA,uBACEI,GAAAA,CAAC,aAAA,EAAA,EAAc,KAAA,EAAO,MAAA,EACpB,0BAAAA,GAAAA,CAAC,gBAAA,EAAA,EAAiB,KAAA,EAAO,SAAA,EACvB,0BAAAA,GAAAA,CAAC,YAAA,EAAA,EAAa,OAAO,iBAAA,EAAoB,QAAA,EAAS,GACpD,CAAA,EACF,CAAA;AAEJ","file":"chunk-35HV34W6.mjs","sourcesContent":["// packages/react/modules/context.ts\n\nimport { createContext } from \"react\";\n\nimport type { RouteContext as RouteContextType } from \"./types\";\nimport type { Router, Navigator } from \"@real-router/core\";\n\nexport const RouteContext = createContext<RouteContextType | null>(null);\n\nexport const RouterContext = createContext<Router | null>(null);\n\nexport const NavigatorContext = createContext<Navigator | null>(null);\n","// packages/react/modules/hooks/useRouter.tsx\n\nimport { use } from \"react\";\n\nimport { RouterContext } from \"../context\";\n\nimport type { Router } from \"@real-router/core\";\n\nexport const useRouter = (): Router => {\n const router = use(RouterContext);\n\n if (!router) {\n throw new Error(\"useRouter must be used within a RouterProvider\");\n }\n\n return router;\n};\n","// packages/react/modules/hooks/useStableValue.tsx\n\nimport { useMemo } from \"react\";\n\n/**\n * Stabilizes a value reference based on deep equality (via JSON serialization).\n * Returns the same reference until the serialized value changes.\n *\n * Useful for object/array dependencies in hooks like useMemo, useCallback, useEffect\n * to prevent unnecessary re-renders when the value is structurally the same.\n *\n * @example\n * ```tsx\n * const stableParams = useStableValue(routeParams);\n * const href = useMemo(() => {\n * return router.buildUrl(routeName, stableParams);\n * }, [router, routeName, stableParams]);\n * ```\n *\n * @param value - The value to stabilize\n * @returns A stable reference to the value\n */\nexport function useStableValue<T>(value: T): T {\n const serialized = JSON.stringify(value);\n\n // We intentionally use serialized in deps to detect deep changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => value, [serialized]);\n}\n","import { createActiveRouteSource } from \"@real-router/sources\";\nimport { useMemo, useSyncExternalStore } from \"react\";\n\nimport { useRouter } from \"./useRouter\";\nimport { useStableValue } from \"./useStableValue\";\n\nimport type { Params } from \"@real-router/core\";\n\nexport function useIsActiveRoute(\n routeName: string,\n params?: Params,\n strict = false,\n ignoreQueryParams = true,\n): boolean {\n const router = useRouter();\n\n // useStableValue: JSON.stringify memoization of params object.\n // Without it, every render with a new params reference (e.g.,\n // <Link routeParams={{ id: '123' }} />) would recreate the store.\n const stableParams = useStableValue(params);\n\n const store = useMemo(\n () =>\n createActiveRouteSource(router, routeName, stableParams, {\n strict,\n ignoreQueryParams,\n }),\n [router, routeName, stableParams, strict, ignoreQueryParams],\n );\n\n return useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getSnapshot, // SSR: router returns same state on server and client\n );\n}\n","// packages/react/modules/constants.ts\n\n/**\n * Stable empty object for default params\n */\nexport const EMPTY_PARAMS = Object.freeze({});\n\n/**\n * Stable empty options object\n */\nexport const EMPTY_OPTIONS = Object.freeze({});\n","import type { MouseEvent } from \"react\";\n\n/**\n * Check if navigation should be handled by router\n */\nexport function shouldNavigate(evt: MouseEvent): boolean {\n return (\n evt.button === 0 && // left click\n !evt.metaKey &&\n !evt.altKey &&\n !evt.ctrlKey &&\n !evt.shiftKey\n );\n}\n","import { memo, useCallback, useMemo } from \"react\";\n\nimport { EMPTY_PARAMS, EMPTY_OPTIONS } from \"../constants\";\nimport { useIsActiveRoute } from \"../hooks/useIsActiveRoute\";\nimport { useRouter } from \"../hooks/useRouter\";\nimport { useStableValue } from \"../hooks/useStableValue\";\nimport { shouldNavigate } from \"../utils\";\n\nimport type { LinkProps } from \"../types\";\nimport type { FC, MouseEvent } from \"react\";\n\nfunction areLinkPropsEqual(\n prev: Readonly<LinkProps>,\n next: Readonly<LinkProps>,\n): boolean {\n return (\n prev.routeName === next.routeName &&\n prev.className === next.className &&\n prev.activeClassName === next.activeClassName &&\n prev.activeStrict === next.activeStrict &&\n prev.ignoreQueryParams === next.ignoreQueryParams &&\n prev.onClick === next.onClick &&\n prev.target === next.target &&\n prev.style === next.style &&\n prev.children === next.children &&\n JSON.stringify(prev.routeParams) === JSON.stringify(next.routeParams) &&\n JSON.stringify(prev.routeOptions) === JSON.stringify(next.routeOptions)\n );\n}\n\nexport const Link: FC<LinkProps> = memo(\n ({\n routeName,\n routeParams = EMPTY_PARAMS,\n routeOptions = EMPTY_OPTIONS,\n className,\n activeClassName = \"active\",\n activeStrict = false,\n ignoreQueryParams = true,\n onClick,\n target,\n children,\n ...props\n }) => {\n const router = useRouter();\n\n const stableParams = useStableValue(routeParams);\n const stableOptions = useStableValue(routeOptions);\n\n const isActive = useIsActiveRoute(\n routeName,\n stableParams,\n activeStrict,\n ignoreQueryParams,\n );\n\n const href = useMemo(() => {\n if (typeof router.buildUrl === \"function\") {\n return router.buildUrl(routeName, stableParams);\n }\n\n return router.buildPath(routeName, stableParams);\n }, [router, routeName, stableParams]);\n\n const handleClick = useCallback(\n (evt: MouseEvent<HTMLAnchorElement>) => {\n if (onClick) {\n onClick(evt);\n\n if (evt.defaultPrevented) {\n return;\n }\n }\n\n if (!shouldNavigate(evt) || target === \"_blank\") {\n return;\n }\n\n evt.preventDefault();\n router.navigate(routeName, stableParams, stableOptions).catch(() => {});\n },\n [onClick, target, router, routeName, stableParams, stableOptions],\n );\n\n const finalClassName = useMemo(() => {\n if (isActive && activeClassName) {\n return className\n ? `${className} ${activeClassName}`.trim()\n : activeClassName;\n }\n\n return className ?? undefined;\n }, [isActive, className, activeClassName]);\n\n return (\n <a\n {...props}\n href={href}\n className={finalClassName}\n onClick={handleClick}\n >\n {children}\n </a>\n );\n },\n areLinkPropsEqual,\n);\n\nLink.displayName = \"Link\";\n","import { getNavigator } from \"@real-router/core\";\nimport { createRouteNodeSource } from \"@real-router/sources\";\nimport { useMemo, useSyncExternalStore } from \"react\";\n\nimport { useRouter } from \"./useRouter\";\n\nimport type { RouteContext } from \"../types\";\n\nexport function useRouteNode(nodeName: string): RouteContext {\n const router = useRouter();\n\n const store = useMemo(\n () => createRouteNodeSource(router, nodeName),\n [router, nodeName],\n );\n\n const { route, previousRoute } = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getSnapshot, // SSR: router returns same state on server and client\n );\n\n const navigator = useMemo(() => getNavigator(router), [router]);\n\n return useMemo(\n (): RouteContext => ({ navigator, route, previousRoute }),\n [navigator, route, previousRoute],\n );\n}\n","// packages/react/modules/hooks/useRoute.tsx\n\nimport { use } from \"react\";\n\nimport { RouteContext } from \"../context\";\n\nimport type { RouteContext as RouteContextType } from \"../types\";\n\nexport const useRoute = (): RouteContextType => {\n const routeContext = use(RouteContext);\n\n if (!routeContext) {\n throw new Error(\"useRoute must be used within a RouteProvider\");\n }\n\n return routeContext;\n};\n","// packages/react/modules/hooks/useNavigator.tsx\n\nimport { use } from \"react\";\n\nimport { NavigatorContext } from \"../context\";\n\nimport type { Navigator } from \"@real-router/core\";\n\nexport const useNavigator = (): Navigator => {\n const navigator = use(NavigatorContext);\n\n if (!navigator) {\n throw new Error(\"useNavigator must be used within a RouterProvider\");\n }\n\n return navigator;\n};\n","// packages/react/modules/hooks/useRouteUtils.tsx\n\nimport { getPluginApi } from \"@real-router/core\";\nimport { getRouteUtils } from \"@real-router/route-utils\";\n\nimport { useRouter } from \"./useRouter\";\n\nimport type { RouteUtils } from \"@real-router/route-utils\";\n\n/**\n * Returns a pre-computed {@link RouteUtils} instance for the current router.\n *\n * Internally retrieves the route tree via `getPluginApi` and delegates\n * to `getRouteUtils`, which caches instances per tree reference (WeakMap).\n *\n * @returns RouteUtils instance with pre-computed chains and siblings\n *\n * @example\n * ```tsx\n * const utils = useRouteUtils();\n *\n * utils.getChain(\"users.profile\");\n * // → [\"users\", \"users.profile\"]\n *\n * utils.getSiblings(\"users\");\n * // → [\"admin\"]\n *\n * utils.isDescendantOf(\"users.profile\", \"users\");\n * // → true\n * ```\n */\nexport const useRouteUtils = (): RouteUtils => {\n const router = useRouter();\n\n return getRouteUtils(getPluginApi(router).getTree());\n};\n","import { createTransitionSource } from \"@real-router/sources\";\nimport { useMemo, useSyncExternalStore } from \"react\";\n\nimport { useRouter } from \"./useRouter\";\n\nimport type { RouterTransitionSnapshot } from \"@real-router/sources\";\n\nexport function useRouterTransition(): RouterTransitionSnapshot {\n const router = useRouter();\n\n const store = useMemo(() => createTransitionSource(router), [router]);\n\n return useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getSnapshot,\n );\n}\n","import { getNavigator } from \"@real-router/core\";\nimport { createRouteSource } from \"@real-router/sources\";\nimport { useMemo, useSyncExternalStore } from \"react\";\n\nimport { NavigatorContext, RouteContext, RouterContext } from \"./context\";\n\nimport type { Router } from \"@real-router/core\";\nimport type { FC, ReactNode } from \"react\";\n\nexport interface RouteProviderProps {\n router: Router;\n children: ReactNode;\n}\n\nexport const RouterProvider: FC<RouteProviderProps> = ({\n router,\n children,\n}) => {\n const navigator = useMemo(() => getNavigator(router), [router]);\n\n // useSyncExternalStore manages the router subscription lifecycle:\n // subscribe connects to router on first listener, unsubscribes on last.\n // This is Strict Mode safe — no useEffect cleanup needed.\n const store = useMemo(() => createRouteSource(router), [router]);\n const { route, previousRoute } = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getSnapshot, // SSR: router returns same state on server and client\n );\n\n const routeContextValue = useMemo(\n () => ({ navigator, route, previousRoute }),\n [navigator, route, previousRoute],\n );\n\n return (\n <RouterContext value={router}>\n <NavigatorContext value={navigator}>\n <RouteContext value={routeContextValue}>{children}</RouteContext>\n </NavigatorContext>\n </RouterContext>\n );\n};\n"]}
@@ -1,31 +1,8 @@
1
- import { Params, NavigationOptions, Navigator, State, Router } from '@real-router/core';
1
+ export { Link, LinkProps, NavigatorContext, RouteContext, RouterContext, RouterProvider, useIsActiveRoute, useNavigator, useRoute, useRouteNode, useRouteUtils, useRouter, useRouterTransition } from './legacy.mjs';
2
+ import { ReactNode, ReactElement } from 'react';
2
3
  export { Navigator } from '@real-router/core';
3
- import { RouterTransitionSnapshot } from '@real-router/sources';
4
4
  export { RouterTransitionSnapshot } from '@real-router/sources';
5
- import * as react from 'react';
6
- import { HTMLAttributes, MouseEventHandler, FC, ReactNode, ReactElement } from 'react';
7
- import { RouteUtils } from '@real-router/route-utils';
8
-
9
- interface RouteState<P extends Params = Params, MP extends Params = Params> {
10
- route: State<P, MP> | undefined;
11
- previousRoute?: State | undefined;
12
- }
13
- type RouteContext$1 = {
14
- navigator: Navigator;
15
- } & RouteState;
16
- interface LinkProps<P extends Params = Params> extends HTMLAttributes<HTMLAnchorElement> {
17
- routeName: string;
18
- routeParams?: P;
19
- routeOptions?: NavigationOptions;
20
- activeClassName?: string;
21
- activeStrict?: boolean;
22
- ignoreQueryParams?: boolean;
23
- target?: string;
24
- onClick?: MouseEventHandler<HTMLAnchorElement>;
25
- onMouseOver?: MouseEventHandler<HTMLAnchorElement>;
26
- }
27
-
28
- declare const Link: FC<LinkProps>;
5
+ import '@real-router/route-utils';
29
6
 
30
7
  interface RouteViewProps {
31
8
  /** Route tree node name to subscribe to. "" for root. */
@@ -38,6 +15,8 @@ interface MatchProps {
38
15
  readonly segment: string;
39
16
  /** Exact match only (no descendants). Defaults to false. */
40
17
  readonly exact?: boolean;
18
+ /** Preserve component state when deactivated (React Activity). Defaults to false. */
19
+ readonly keepAlive?: boolean;
41
20
  /** Content to render when matched. */
42
21
  readonly children: ReactNode;
43
22
  }
@@ -45,10 +24,7 @@ interface NotFoundProps {
45
24
  /** Content to render on UNKNOWN_ROUTE. */
46
25
  readonly children: ReactNode;
47
26
  }
48
- declare function RouteViewRoot({ nodeName, children, }: RouteViewProps): ReactElement | null;
49
- declare namespace RouteViewRoot {
50
- var displayName: string;
51
- }
27
+
52
28
  declare function Match(_props: MatchProps): null;
53
29
  declare namespace Match {
54
30
  var displayName: string;
@@ -57,55 +33,14 @@ declare function NotFound(_props: NotFoundProps): null;
57
33
  declare namespace NotFound {
58
34
  var displayName: string;
59
35
  }
36
+
37
+ declare function RouteViewRoot({ nodeName, children, }: Readonly<RouteViewProps>): ReactElement | null;
38
+ declare namespace RouteViewRoot {
39
+ var displayName: string;
40
+ }
60
41
  declare const RouteView: typeof RouteViewRoot & {
61
42
  Match: typeof Match;
62
43
  NotFound: typeof NotFound;
63
44
  };
64
45
 
65
- declare function useRouteNode(nodeName: string): RouteContext$1;
66
-
67
- declare const useRoute: () => RouteContext$1;
68
-
69
- declare const useNavigator: () => Navigator;
70
-
71
- declare const useRouter: () => Router;
72
-
73
- /**
74
- * Returns a pre-computed {@link RouteUtils} instance for the current router.
75
- *
76
- * Internally retrieves the route tree via `getPluginApi` and delegates
77
- * to `getRouteUtils`, which caches instances per tree reference (WeakMap).
78
- *
79
- * @returns RouteUtils instance with pre-computed chains and siblings
80
- *
81
- * @example
82
- * ```tsx
83
- * const utils = useRouteUtils();
84
- *
85
- * utils.getChain("users.profile");
86
- * // → ["users", "users.profile"]
87
- *
88
- * utils.getSiblings("users");
89
- * // → ["admin"]
90
- *
91
- * utils.isDescendantOf("users.profile", "users");
92
- * // → true
93
- * ```
94
- */
95
- declare const useRouteUtils: () => RouteUtils;
96
-
97
- declare function useIsActiveRoute(routeName: string, params?: Params, strict?: boolean, ignoreQueryParams?: boolean): boolean;
98
-
99
- declare function useRouterTransition(): RouterTransitionSnapshot;
100
-
101
- interface RouteProviderProps {
102
- router: Router;
103
- children: ReactNode;
104
- }
105
- declare const RouterProvider: FC<RouteProviderProps>;
106
-
107
- declare const RouteContext: react.Context<RouteContext$1 | null>;
108
- declare const RouterContext: react.Context<Router<object> | null>;
109
- declare const NavigatorContext: react.Context<Navigator | null>;
110
-
111
- export { Link, type LinkProps, NavigatorContext, RouteContext, RouteView, type MatchProps as RouteViewMatchProps, type NotFoundProps as RouteViewNotFoundProps, type RouteViewProps, RouterContext, RouterProvider, useIsActiveRoute, useNavigator, useRoute, useRouteNode, useRouteUtils, useRouter, useRouterTransition };
46
+ export { RouteView, type MatchProps as RouteViewMatchProps, type NotFoundProps as RouteViewNotFoundProps, type RouteViewProps };
@@ -1 +1 @@
1
- export{Link,NavigatorContext,RouteContext,RouteView,RouterContext,RouterProvider,useIsActiveRoute,useNavigator,useRoute,useRouteNode,useRouteUtils,useRouter,useRouterTransition}from"./chunk-A47RNKTS.mjs";//# sourceMappingURL=index.mjs.map
1
+ import{useRouteNode as e}from"./chunk-35HV34W6.mjs";export{Link,NavigatorContext,RouteContext,RouterContext,RouterProvider,useIsActiveRoute,useNavigator,useRoute,useRouteNode,useRouteUtils,useRouter,useRouterTransition}from"./chunk-35HV34W6.mjs";import{useRef as t,Children as r,isValidElement as o,Fragment as n,Activity as u}from"react";import{UNKNOWN_ROUTE as i}from"@real-router/core";import{startsWithSegment as s}from"@real-router/route-utils";import{jsx as c,Fragment as l}from"react/jsx-runtime";function a(e){return null}function d(e){return null}function p(e,t,r){return r?e===t:s(e,t)}function m(e,t){for(const n of r.toArray(e))o(n)&&(n.type===a||n.type===d?t.push(n):m(n.props.children,t))}function h(e,t,r,o){return r?c(u,{mode:o,children:e},t):c(n,{children:e},t)}function f({nodeName:r,children:o}){const{route:u}=e(r),s=t(new Set);if(!u)return null;const a=[];m(o,a);const{rendered:f}=function(e,t,r,o){let u=null,s=!1;const l=[];for(const n of e){if(n.type===d){u=n.props.children;continue}const{segment:e,exact:i=!1,keepAlive:c=!1}=n.props,a=r?`${r}.${e}`:e;!s&&p(t,a,i)?(s=!0,o.add(a),l.push(h(n.props.children,a,c,"visible"))):c&&o.has(a)&&l.push(h(n.props.children,a,c,"hidden"))}return s||t!==i||null===u||l.push(c(n,{children:u},"__route-view-not-found__")),{rendered:l,activeMatchFound:s}}(a,u.name,r,s.current);return f.length>0?c(l,{children:f}):null}a.displayName="RouteView.Match",d.displayName="RouteView.NotFound",f.displayName="RouteView";var R=Object.assign(f,{Match:a,NotFound:d});export{R as RouteView};//# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
1
+ {"version":3,"sources":["../../src/components/modern/RouteView/components.tsx","../../src/components/modern/RouteView/helpers.tsx","../../src/components/modern/RouteView/RouteView.tsx"],"names":["Fragment","jsx"],"mappings":";AAEO,SAAS,MAAM,MAAA,EAA0B;AAC9C,EAAA,OAAO,IAAA;AACT;AAEA,KAAA,CAAM,WAAA,GAAc,iBAAA;AAEb,SAAS,SAAS,MAAA,EAA6B;AACpD,EAAA,OAAO,IAAA;AACT;AAEA,QAAA,CAAS,WAAA,GAAc,oBAAA;ACHvB,SAAS,cAAA,CACP,SAAA,EACA,eAAA,EACA,KAAA,EACS;AACT,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,OAAO,SAAA,KAAc,eAAA;AAAA,EACvB;AAEA,EAA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A,IAAI,CAAC,KAAA,EAAO;AACV,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,WAA2B,EAAC;AAElC,EAAA,eAAA,CAAgB,UAAU,QAAQ,CAAA;AAElC,EAAA,MAAM,EAAE,UAAS,GAAI,eAAA;AAAA,IACnB,QAAA;AAAA,IACA,KAAA,CAAM,IAAA;AAAA,IACN,QAAA;AAAA,IACA,mBAAA,CAAoB;AAAA,GACtB;AAEA,EAAA,IAAI,QAAA,CAAS,SAAS,CAAA,EAAG;AACvB,IAAA,uBAAOC,GAAAA,CAAAD,QAAAA,EAAA,EAAG,QAAA,EAAA,QAAA,EAAS,CAAA;AAAA,EACrB;AAEA,EAAA,OAAO,IAAA;AACT;AAEA,aAAA,CAAc,WAAA,GAAc,WAAA;AAErB,IAAM,YAAY,MAAA,CAAO,MAAA,CAAO,eAAe,EAAE,KAAA,EAAO,UAAU","file":"index.mjs","sourcesContent":["import type { MatchProps, NotFoundProps } from \"./types\";\n\nexport function Match(_props: MatchProps): null {\n return null;\n}\n\nMatch.displayName = \"RouteView.Match\";\n\nexport function NotFound(_props: NotFoundProps): null {\n return null;\n}\n\nNotFound.displayName = \"RouteView.NotFound\";\n","import { UNKNOWN_ROUTE } from \"@real-router/core\";\nimport { startsWithSegment } from \"@real-router/route-utils\";\nimport { Activity, Children, Fragment, isValidElement } from \"react\";\n\nimport { Match, NotFound } from \"./components\";\n\nimport type { MatchProps, NotFoundProps } from \"./types\";\nimport type { ReactElement, ReactNode } from \"react\";\n\nfunction isSegmentMatch(\n routeName: string,\n fullSegmentName: string,\n exact: boolean,\n): boolean {\n if (exact) {\n return routeName === fullSegmentName;\n }\n\n return startsWithSegment(routeName, fullSegmentName);\n}\n\nexport function collectElements(\n children: ReactNode,\n result: ReactElement[],\n): void {\n // eslint-disable-next-line @eslint-react/no-children-to-array\n for (const child of Children.toArray(children)) {\n if (!isValidElement(child)) {\n continue;\n }\n\n if (child.type === Match || child.type === NotFound) {\n result.push(child);\n } else {\n collectElements(\n (child.props as { readonly children: ReactNode }).children,\n result,\n );\n }\n }\n}\n\nfunction renderMatchElement(\n matchChildren: ReactNode,\n fullSegmentName: string,\n keepAlive: boolean,\n mode: \"visible\" | \"hidden\",\n): ReactElement {\n if (keepAlive) {\n return (\n <Activity mode={mode} key={fullSegmentName}>\n {matchChildren}\n </Activity>\n );\n }\n\n return <Fragment key={fullSegmentName}>{matchChildren}</Fragment>;\n}\n\nexport function buildRenderList(\n elements: ReactElement[],\n routeName: string,\n nodeName: string,\n hasBeenActivated: Set<string>,\n): { rendered: ReactElement[]; activeMatchFound: boolean } {\n let notFoundChildren: ReactNode = null;\n let activeMatchFound = false;\n const rendered: ReactElement[] = [];\n\n for (const child of elements) {\n if (child.type === NotFound) {\n notFoundChildren = (child.props as NotFoundProps).children;\n continue;\n }\n\n const {\n segment,\n exact = false,\n keepAlive = false,\n } = child.props as MatchProps;\n const fullSegmentName = nodeName ? `${nodeName}.${segment}` : segment;\n const isActive =\n !activeMatchFound && isSegmentMatch(routeName, fullSegmentName, exact);\n\n if (isActive) {\n activeMatchFound = true;\n hasBeenActivated.add(fullSegmentName);\n rendered.push(\n renderMatchElement(\n (child.props as MatchProps).children,\n fullSegmentName,\n keepAlive,\n \"visible\",\n ),\n );\n } else if (keepAlive && hasBeenActivated.has(fullSegmentName)) {\n rendered.push(\n renderMatchElement(\n (child.props as MatchProps).children,\n fullSegmentName,\n keepAlive,\n \"hidden\",\n ),\n );\n }\n }\n\n if (\n !activeMatchFound &&\n routeName === UNKNOWN_ROUTE &&\n notFoundChildren !== null\n ) {\n rendered.push(\n <Fragment key=\"__route-view-not-found__\">{notFoundChildren}</Fragment>,\n );\n }\n\n return { rendered, activeMatchFound };\n}\n","import { useRef } from \"react\";\n\nimport { Match, NotFound } from \"./components\";\nimport { buildRenderList, collectElements } from \"./helpers\";\nimport { useRouteNode } from \"../../../hooks/useRouteNode\";\n\nimport type { RouteViewProps } from \"./types\";\nimport type { ReactElement } from \"react\";\n\nfunction RouteViewRoot({\n nodeName,\n children,\n}: Readonly<RouteViewProps>): ReactElement | null {\n const { route } = useRouteNode(nodeName);\n const hasBeenActivatedRef = useRef<Set<string>>(new Set());\n\n if (!route) {\n return null;\n }\n\n const elements: ReactElement[] = [];\n\n collectElements(children, elements);\n\n const { rendered } = buildRenderList(\n elements,\n route.name,\n nodeName,\n hasBeenActivatedRef.current,\n );\n\n if (rendered.length > 0) {\n return <>{rendered}</>;\n }\n\n return null;\n}\n\nRouteViewRoot.displayName = \"RouteView\";\n\nexport const RouteView = Object.assign(RouteViewRoot, { Match, NotFound });\n\nexport type {\n RouteViewProps,\n MatchProps as RouteViewMatchProps,\n NotFoundProps as RouteViewNotFoundProps,\n} from \"./types\";\n"]}
@@ -1,5 +1,76 @@
1
- export { Link, LinkProps, NavigatorContext, RouteContext, RouteView, RouteViewMatchProps, RouteViewNotFoundProps, RouteViewProps, RouterContext, RouterProvider, useIsActiveRoute, useNavigator, useRoute, useRouteNode, useRouteUtils, useRouter, useRouterTransition } from './index.mjs';
1
+ import { Params, NavigationOptions, Navigator, State, Router } from '@real-router/core';
2
2
  export { Navigator } from '@real-router/core';
3
+ import * as react from 'react';
4
+ import { HTMLAttributes, MouseEventHandler, FC, ReactNode } from 'react';
5
+ import { RouteUtils } from '@real-router/route-utils';
6
+ import { RouterTransitionSnapshot } from '@real-router/sources';
3
7
  export { RouterTransitionSnapshot } from '@real-router/sources';
4
- import 'react';
5
- import '@real-router/route-utils';
8
+
9
+ interface RouteState<P extends Params = Params, MP extends Params = Params> {
10
+ route: State<P, MP> | undefined;
11
+ previousRoute?: State | undefined;
12
+ }
13
+ type RouteContext$1 = {
14
+ navigator: Navigator;
15
+ } & RouteState;
16
+ interface LinkProps<P extends Params = Params> extends HTMLAttributes<HTMLAnchorElement> {
17
+ routeName: string;
18
+ routeParams?: P;
19
+ routeOptions?: NavigationOptions;
20
+ activeClassName?: string;
21
+ activeStrict?: boolean;
22
+ ignoreQueryParams?: boolean;
23
+ target?: string;
24
+ onClick?: MouseEventHandler<HTMLAnchorElement>;
25
+ onMouseOver?: MouseEventHandler<HTMLAnchorElement>;
26
+ }
27
+
28
+ declare const Link: FC<LinkProps>;
29
+
30
+ declare function useRouteNode(nodeName: string): RouteContext$1;
31
+
32
+ declare const useRoute: () => RouteContext$1;
33
+
34
+ declare const useNavigator: () => Navigator;
35
+
36
+ declare const useRouter: () => Router;
37
+
38
+ /**
39
+ * Returns a pre-computed {@link RouteUtils} instance for the current router.
40
+ *
41
+ * Internally retrieves the route tree via `getPluginApi` and delegates
42
+ * to `getRouteUtils`, which caches instances per tree reference (WeakMap).
43
+ *
44
+ * @returns RouteUtils instance with pre-computed chains and siblings
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * const utils = useRouteUtils();
49
+ *
50
+ * utils.getChain("users.profile");
51
+ * // → ["users", "users.profile"]
52
+ *
53
+ * utils.getSiblings("users");
54
+ * // → ["admin"]
55
+ *
56
+ * utils.isDescendantOf("users.profile", "users");
57
+ * // → true
58
+ * ```
59
+ */
60
+ declare const useRouteUtils: () => RouteUtils;
61
+
62
+ declare function useIsActiveRoute(routeName: string, params?: Params, strict?: boolean, ignoreQueryParams?: boolean): boolean;
63
+
64
+ declare function useRouterTransition(): RouterTransitionSnapshot;
65
+
66
+ interface RouteProviderProps {
67
+ router: Router;
68
+ children: ReactNode;
69
+ }
70
+ declare const RouterProvider: FC<RouteProviderProps>;
71
+
72
+ declare const RouteContext: react.Context<RouteContext$1 | null>;
73
+ declare const RouterContext: react.Context<Router<object> | null>;
74
+ declare const NavigatorContext: react.Context<Navigator | null>;
75
+
76
+ export { Link, type LinkProps, NavigatorContext, RouteContext, RouterContext, RouterProvider, useIsActiveRoute, useNavigator, useRoute, useRouteNode, useRouteUtils, useRouter, useRouterTransition };
@@ -1 +1 @@
1
- export{Link,NavigatorContext,RouteContext,RouteView,RouterContext,RouterProvider,useIsActiveRoute,useNavigator,useRoute,useRouteNode,useRouteUtils,useRouter,useRouterTransition}from"./chunk-A47RNKTS.mjs";//# sourceMappingURL=legacy.mjs.map
1
+ export{Link,NavigatorContext,RouteContext,RouterContext,RouterProvider,useIsActiveRoute,useNavigator,useRoute,useRouteNode,useRouteUtils,useRouter,useRouterTransition}from"./chunk-35HV34W6.mjs";//# sourceMappingURL=legacy.mjs.map
@@ -1 +1 @@
1
- {"inputs":{"src/constants.ts":{"bytes":225,"imports":[],"format":"esm"},"src/context.ts":{"bytes":416,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRouter.tsx":{"bytes":364,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"../context"}],"format":"esm"},"src/hooks/useStableValue.tsx":{"bytes":976,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useIsActiveRoute.tsx":{"bytes":1060,"imports":[{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"},{"path":"src/hooks/useStableValue.tsx","kind":"import-statement","original":"./useStableValue"}],"format":"esm"},"src/utils.ts":{"bytes":293,"imports":[],"format":"esm"},"src/components/Link.tsx":{"bytes":2900,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/hooks/useIsActiveRoute.tsx","kind":"import-statement","original":"../hooks/useIsActiveRoute"},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"../hooks/useRouter"},{"path":"src/hooks/useStableValue.tsx","kind":"import-statement","original":"../hooks/useStableValue"},{"path":"src/utils.ts","kind":"import-statement","original":"../utils"},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRouteNode.tsx":{"bytes":837,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"}],"format":"esm"},"src/components/RouteView.tsx":{"bytes":3407,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouteNode.tsx","kind":"import-statement","original":"../hooks/useRouteNode"},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRoute.tsx":{"bytes":403,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"../context"}],"format":"esm"},"src/hooks/useNavigator.tsx":{"bytes":394,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"../context"}],"format":"esm"},"src/hooks/useRouteUtils.tsx":{"bytes":977,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"}],"format":"esm"},"src/hooks/useRouterTransition.tsx":{"bytes":508,"imports":[{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"}],"format":"esm"},"src/RouterProvider.tsx":{"bytes":1380,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"./context"},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":973,"imports":[{"path":"src/components/Link.tsx","kind":"import-statement","original":"./components/Link"},{"path":"src/components/RouteView.tsx","kind":"import-statement","original":"./components/RouteView"},{"path":"src/hooks/useRouteNode.tsx","kind":"import-statement","original":"./hooks/useRouteNode"},{"path":"src/hooks/useRoute.tsx","kind":"import-statement","original":"./hooks/useRoute"},{"path":"src/hooks/useNavigator.tsx","kind":"import-statement","original":"./hooks/useNavigator"},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./hooks/useRouter"},{"path":"src/hooks/useRouteUtils.tsx","kind":"import-statement","original":"./hooks/useRouteUtils"},{"path":"src/hooks/useIsActiveRoute.tsx","kind":"import-statement","original":"./hooks/useIsActiveRoute"},{"path":"src/hooks/useRouterTransition.tsx","kind":"import-statement","original":"./hooks/useRouterTransition"},{"path":"src/RouterProvider.tsx","kind":"import-statement","original":"./RouterProvider"},{"path":"src/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/legacy.ts":{"bytes":973,"imports":[{"path":"src/components/Link.tsx","kind":"import-statement","original":"./components/Link"},{"path":"src/components/RouteView.tsx","kind":"import-statement","original":"./components/RouteView"},{"path":"src/hooks/useRouteNode.tsx","kind":"import-statement","original":"./hooks/useRouteNode"},{"path":"src/hooks/useRoute.tsx","kind":"import-statement","original":"./hooks/useRoute"},{"path":"src/hooks/useNavigator.tsx","kind":"import-statement","original":"./hooks/useNavigator"},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./hooks/useRouter"},{"path":"src/hooks/useRouteUtils.tsx","kind":"import-statement","original":"./hooks/useRouteUtils"},{"path":"src/hooks/useIsActiveRoute.tsx","kind":"import-statement","original":"./hooks/useIsActiveRoute"},{"path":"src/hooks/useRouterTransition.tsx","kind":"import-statement","original":"./hooks/useRouterTransition"},{"path":"src/RouterProvider.tsx","kind":"import-statement","original":"./RouterProvider"},{"path":"src/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"}},"outputs":{"dist/esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/esm/index.mjs":{"imports":[{"path":"dist/esm/chunk-A47RNKTS.mjs","kind":"import-statement"}],"exports":["Link","NavigatorContext","RouteContext","RouteView","RouterContext","RouterProvider","useIsActiveRoute","useNavigator","useRoute","useRouteNode","useRouteUtils","useRouter","useRouterTransition"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":468},"dist/esm/legacy.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/esm/legacy.mjs":{"imports":[{"path":"dist/esm/chunk-A47RNKTS.mjs","kind":"import-statement"}],"exports":["Link","NavigatorContext","RouteContext","RouteView","RouterContext","RouterProvider","useIsActiveRoute","useNavigator","useRoute","useRouteNode","useRouteUtils","useRouter","useRouterTransition"],"entryPoint":"src/legacy.ts","inputs":{"src/legacy.ts":{"bytesInOutput":0}},"bytes":468},"dist/esm/chunk-A47RNKTS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21274},"dist/esm/chunk-A47RNKTS.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Link","NavigatorContext","RouteContext","RouteView","RouterContext","RouterProvider","useIsActiveRoute","useNavigator","useRoute","useRouteNode","useRouteUtils","useRouter","useRouterTransition"],"inputs":{"src/context.ts":{"bytesInOutput":164},"src/hooks/useRouter.tsx":{"bytesInOutput":202},"src/hooks/useIsActiveRoute.tsx":{"bytesInOutput":671},"src/hooks/useStableValue.tsx":{"bytesInOutput":157},"src/components/Link.tsx":{"bytesInOutput":2409},"src/constants.ts":{"bytesInOutput":77},"src/utils.ts":{"bytesInOutput":140},"src/hooks/useRouteNode.tsx":{"bytesInOutput":742},"src/components/RouteView.tsx":{"bytesInOutput":2130},"src/hooks/useRoute.tsx":{"bytesInOutput":225},"src/hooks/useNavigator.tsx":{"bytesInOutput":229},"src/hooks/useRouteUtils.tsx":{"bytesInOutput":225},"src/hooks/useRouterTransition.tsx":{"bytesInOutput":397},"src/RouterProvider.tsx":{"bytesInOutput":1001}},"bytes":9452}}}
1
+ {"inputs":{"src/constants.ts":{"bytes":225,"imports":[],"format":"esm"},"src/context.ts":{"bytes":416,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRouter.tsx":{"bytes":364,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"../context"}],"format":"esm"},"src/hooks/useStableValue.tsx":{"bytes":976,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useIsActiveRoute.tsx":{"bytes":1060,"imports":[{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"},{"path":"src/hooks/useStableValue.tsx","kind":"import-statement","original":"./useStableValue"}],"format":"esm"},"src/utils.ts":{"bytes":293,"imports":[],"format":"esm"},"src/components/Link.tsx":{"bytes":2900,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/hooks/useIsActiveRoute.tsx","kind":"import-statement","original":"../hooks/useIsActiveRoute"},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"../hooks/useRouter"},{"path":"src/hooks/useStableValue.tsx","kind":"import-statement","original":"../hooks/useStableValue"},{"path":"src/utils.ts","kind":"import-statement","original":"../utils"},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/components/modern/RouteView/components.tsx":{"bytes":286,"imports":[],"format":"esm"},"src/components/modern/RouteView/helpers.tsx":{"bytes":2980,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/components/modern/RouteView/components.tsx","kind":"import-statement","original":"./components"},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useRouteNode.tsx":{"bytes":837,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"}],"format":"esm"},"src/components/modern/RouteView/RouteView.tsx":{"bytes":1073,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/modern/RouteView/components.tsx","kind":"import-statement","original":"./components"},{"path":"src/components/modern/RouteView/helpers.tsx","kind":"import-statement","original":"./helpers"},{"path":"src/hooks/useRouteNode.tsx","kind":"import-statement","original":"../../../hooks/useRouteNode"},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/components/modern/RouteView/index.ts":{"bytes":145,"imports":[{"path":"src/components/modern/RouteView/RouteView.tsx","kind":"import-statement","original":"./RouteView"}],"format":"esm"},"src/hooks/useRoute.tsx":{"bytes":403,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"../context"}],"format":"esm"},"src/hooks/useNavigator.tsx":{"bytes":394,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"../context"}],"format":"esm"},"src/hooks/useRouteUtils.tsx":{"bytes":977,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"}],"format":"esm"},"src/hooks/useRouterTransition.tsx":{"bytes":508,"imports":[{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./useRouter"}],"format":"esm"},"src/RouterProvider.tsx":{"bytes":1380,"imports":[{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/context.ts","kind":"import-statement","original":"./context"},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":987,"imports":[{"path":"src/components/Link.tsx","kind":"import-statement","original":"./components/Link"},{"path":"src/components/modern/RouteView/index.ts","kind":"import-statement","original":"./components/modern/RouteView"},{"path":"src/hooks/useRouteNode.tsx","kind":"import-statement","original":"./hooks/useRouteNode"},{"path":"src/hooks/useRoute.tsx","kind":"import-statement","original":"./hooks/useRoute"},{"path":"src/hooks/useNavigator.tsx","kind":"import-statement","original":"./hooks/useNavigator"},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./hooks/useRouter"},{"path":"src/hooks/useRouteUtils.tsx","kind":"import-statement","original":"./hooks/useRouteUtils"},{"path":"src/hooks/useIsActiveRoute.tsx","kind":"import-statement","original":"./hooks/useIsActiveRoute"},{"path":"src/hooks/useRouterTransition.tsx","kind":"import-statement","original":"./hooks/useRouterTransition"},{"path":"src/RouterProvider.tsx","kind":"import-statement","original":"./RouterProvider"},{"path":"src/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/legacy.ts":{"bytes":805,"imports":[{"path":"src/components/Link.tsx","kind":"import-statement","original":"./components/Link"},{"path":"src/hooks/useRouteNode.tsx","kind":"import-statement","original":"./hooks/useRouteNode"},{"path":"src/hooks/useRoute.tsx","kind":"import-statement","original":"./hooks/useRoute"},{"path":"src/hooks/useNavigator.tsx","kind":"import-statement","original":"./hooks/useNavigator"},{"path":"src/hooks/useRouter.tsx","kind":"import-statement","original":"./hooks/useRouter"},{"path":"src/hooks/useRouteUtils.tsx","kind":"import-statement","original":"./hooks/useRouteUtils"},{"path":"src/hooks/useIsActiveRoute.tsx","kind":"import-statement","original":"./hooks/useIsActiveRoute"},{"path":"src/hooks/useRouterTransition.tsx","kind":"import-statement","original":"./hooks/useRouterTransition"},{"path":"src/RouterProvider.tsx","kind":"import-statement","original":"./RouterProvider"},{"path":"src/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"}},"outputs":{"dist/esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6846},"dist/esm/index.mjs":{"imports":[{"path":"dist/esm/chunk-35HV34W6.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Link","NavigatorContext","RouteContext","RouteView","RouterContext","RouterProvider","useIsActiveRoute","useNavigator","useRoute","useRouteNode","useRouteUtils","useRouter","useRouterTransition"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/components/modern/RouteView/RouteView.tsx":{"bytesInOutput":712},"src/components/modern/RouteView/components.tsx":{"bytesInOutput":171},"src/components/modern/RouteView/helpers.tsx":{"bytesInOutput":2355},"src/components/modern/RouteView/index.ts":{"bytesInOutput":0}},"bytes":3892},"dist/esm/legacy.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/esm/legacy.mjs":{"imports":[{"path":"dist/esm/chunk-35HV34W6.mjs","kind":"import-statement"}],"exports":["Link","NavigatorContext","RouteContext","RouterContext","RouterProvider","useIsActiveRoute","useNavigator","useRoute","useRouteNode","useRouteUtils","useRouter","useRouterTransition"],"entryPoint":"src/legacy.ts","inputs":{"src/legacy.ts":{"bytesInOutput":0}},"bytes":442},"dist/esm/chunk-35HV34W6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16251},"dist/esm/chunk-35HV34W6.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/route-utils","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@real-router/core","kind":"import-statement","external":true},{"path":"@real-router/sources","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Link","NavigatorContext","RouteContext","RouterContext","RouterProvider","useIsActiveRoute","useNavigator","useRoute","useRouteNode","useRouteUtils","useRouter","useRouterTransition"],"inputs":{"src/context.ts":{"bytesInOutput":164},"src/hooks/useRouter.tsx":{"bytesInOutput":202},"src/hooks/useIsActiveRoute.tsx":{"bytesInOutput":671},"src/hooks/useStableValue.tsx":{"bytesInOutput":157},"src/components/Link.tsx":{"bytesInOutput":2409},"src/constants.ts":{"bytesInOutput":77},"src/utils.ts":{"bytesInOutput":140},"src/hooks/useRouteNode.tsx":{"bytesInOutput":742},"src/hooks/useRoute.tsx":{"bytesInOutput":225},"src/hooks/useNavigator.tsx":{"bytesInOutput":229},"src/hooks/useRouteUtils.tsx":{"bytesInOutput":225},"src/hooks/useRouterTransition.tsx":{"bytesInOutput":397},"src/RouterProvider.tsx":{"bytesInOutput":1001}},"bytes":7276}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@real-router/react",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "commonjs",
5
5
  "description": "React integration for Real-Router",
6
6
  "main": "./dist/cjs/index.js",
@@ -64,9 +64,9 @@
64
64
  "license": "MIT",
65
65
  "sideEffects": false,
66
66
  "dependencies": {
67
+ "@real-router/core": "^0.35.1",
67
68
  "@real-router/route-utils": "^0.1.4",
68
- "@real-router/sources": "^0.2.0",
69
- "@real-router/core": "^0.35.1"
69
+ "@real-router/sources": "^0.2.0"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@testing-library/dom": "10.4.1",
@@ -0,0 +1,47 @@
1
+ import { useRef } from "react";
2
+
3
+ import { Match, NotFound } from "./components";
4
+ import { buildRenderList, collectElements } from "./helpers";
5
+ import { useRouteNode } from "../../../hooks/useRouteNode";
6
+
7
+ import type { RouteViewProps } from "./types";
8
+ import type { ReactElement } from "react";
9
+
10
+ function RouteViewRoot({
11
+ nodeName,
12
+ children,
13
+ }: Readonly<RouteViewProps>): ReactElement | null {
14
+ const { route } = useRouteNode(nodeName);
15
+ const hasBeenActivatedRef = useRef<Set<string>>(new Set());
16
+
17
+ if (!route) {
18
+ return null;
19
+ }
20
+
21
+ const elements: ReactElement[] = [];
22
+
23
+ collectElements(children, elements);
24
+
25
+ const { rendered } = buildRenderList(
26
+ elements,
27
+ route.name,
28
+ nodeName,
29
+ hasBeenActivatedRef.current,
30
+ );
31
+
32
+ if (rendered.length > 0) {
33
+ return <>{rendered}</>;
34
+ }
35
+
36
+ return null;
37
+ }
38
+
39
+ RouteViewRoot.displayName = "RouteView";
40
+
41
+ export const RouteView = Object.assign(RouteViewRoot, { Match, NotFound });
42
+
43
+ export type {
44
+ RouteViewProps,
45
+ MatchProps as RouteViewMatchProps,
46
+ NotFoundProps as RouteViewNotFoundProps,
47
+ } from "./types";
@@ -0,0 +1,13 @@
1
+ import type { MatchProps, NotFoundProps } from "./types";
2
+
3
+ export function Match(_props: MatchProps): null {
4
+ return null;
5
+ }
6
+
7
+ Match.displayName = "RouteView.Match";
8
+
9
+ export function NotFound(_props: NotFoundProps): null {
10
+ return null;
11
+ }
12
+
13
+ NotFound.displayName = "RouteView.NotFound";