@wordpress/route 0.7.1-next.v.202603102151.0 → 0.8.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.
- package/build/index.cjs.map +2 -2
- package/build/private-apis.cjs +1 -0
- package/build/private-apis.cjs.map +2 -2
- package/build-module/index.mjs.map +2 -2
- package/build-module/private-apis.mjs +2 -0
- package/build-module/private-apis.mjs.map +2 -2
- package/build-types/index.d.ts +1 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +2 -0
- package/src/private-apis.ts +2 -0
package/build/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { useRouter } from '@tanstack/react-router';\nexport {\n\tLink,\n\tnotFound,\n\tredirect,\n\tuseLinkProps,\n\tuseNavigate,\n\tuseParams,\n\tuseSearch,\n} from '@tanstack/react-router';\nexport type {\n\tAnyRoute,\n\tLinkProps,\n\tNavigateOptions,\n\tRouteOptions,\n\tRouterOptions,\n\tToOptions,\n\tUseNavigateResult,\n} from '@tanstack/react-router';\n\n/**\n * Internal dependencies\n */\nexport { privateApis } from './private-apis';\n\n/**\n * Hook to invalidate the router cache and trigger a re-render.\n * This is useful when you want to refetch data without changing the URL.\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const invalidate = useInvalidate();\n *\n * const handleRefresh = () => {\n * invalidate();\n * };\n *\n * return <button onClick={handleRefresh}>Refresh</button>;\n * }\n * ```\n *\n * @return A function to invalidate the router.\n */\nexport function useInvalidate() {\n\tconst router = useRouter();\n\treturn () => router.invalidate();\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAA0B;AAC1B,IAAAA,uBAQO;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { useRouter } from '@tanstack/react-router';\nexport {\n\tLink,\n\tnotFound,\n\tredirect,\n\tuseLinkProps,\n\tuseNavigate,\n\tuseParams,\n\tuseSearch,\n} from '@tanstack/react-router';\n\nexport type {\n\tAnyRoute,\n\tAnyRouter,\n\tLinkProps,\n\tNavigateOptions,\n\tRouteOptions,\n\tRouterOptions,\n\tToOptions,\n\tUseNavigateResult,\n} from '@tanstack/react-router';\n\n/**\n * Internal dependencies\n */\nexport { privateApis } from './private-apis';\n\n/**\n * Hook to invalidate the router cache and trigger a re-render.\n * This is useful when you want to refetch data without changing the URL.\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const invalidate = useInvalidate();\n *\n * const handleRefresh = () => {\n * invalidate();\n * };\n *\n * return <button onClick={handleRefresh}>Refresh</button>;\n * }\n * ```\n *\n * @return A function to invalidate the router.\n */\nexport function useInvalidate() {\n\tconst router = useRouter();\n\treturn () => router.invalidate();\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAA0B;AAC1B,IAAAA,uBAQO;AAgBP,0BAA4B;AAqBrB,SAAS,gBAAgB;AAC/B,QAAM,aAAS,+BAAU;AACzB,SAAO,MAAM,OAAO,WAAW;AAChC;",
|
|
6
6
|
"names": ["import_react_router"]
|
|
7
7
|
}
|
package/build/private-apis.cjs
CHANGED
|
@@ -31,6 +31,7 @@ var privateApis = {};
|
|
|
31
31
|
// Router creation and setup
|
|
32
32
|
createBrowserHistory: import_react_router.createBrowserHistory,
|
|
33
33
|
createLazyRoute: import_react_router.createLazyRoute,
|
|
34
|
+
createMemoryHistory: import_react_router.createMemoryHistory,
|
|
34
35
|
createRouter: import_react_router.createRouter,
|
|
35
36
|
createRootRoute: import_react_router.createRootRoute,
|
|
36
37
|
createRoute: import_react_router.createRoute,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/private-apis.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { parseHref } from '@tanstack/history';\nimport {\n\tcreateBrowserHistory,\n\tcreateLazyRoute,\n\tcreateLink,\n\tcreateRootRoute,\n\tcreateRoute,\n\tcreateRouter,\n\tOutlet,\n\tredirect,\n\tRouterProvider,\n\tuseBlocker,\n\tuseCanGoBack,\n\tuseLoaderData,\n\tuseLocation,\n\tuseMatches,\n\tuseRouter,\n\tuseRouterState,\n} from '@tanstack/react-router';\n\n/**\n * Internal dependencies\n */\nimport { lock } from './lock-unlock';\n\n/**\n * Private APIs for the boot package only.\n * These are router setup and internal utilities that should not be used\n * by individual routes.\n */\nexport const privateApis = {};\n\n// Lock the private APIs so only authorized modules can access them\nlock( privateApis, {\n\t// Router creation and setup\n\tcreateBrowserHistory,\n\tcreateLazyRoute,\n\tcreateRouter,\n\tcreateRootRoute,\n\tcreateRoute,\n\tOutlet,\n\tRouterProvider,\n\n\t// Internal routing utilities\n\tredirect,\n\tcreateLink,\n\tuseCanGoBack,\n\tuseLoaderData,\n\tuseLocation,\n\tuseMatches,\n\tuseRouter,\n\tuseRouterState,\n\tuseBlocker,\n\n\t// History utilities\n\tparseHref,\n} );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0B;AAC1B,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { parseHref } from '@tanstack/history';\nimport {\n\tcreateBrowserHistory,\n\tcreateLazyRoute,\n\tcreateLink,\n\tcreateMemoryHistory,\n\tcreateRootRoute,\n\tcreateRoute,\n\tcreateRouter,\n\tOutlet,\n\tredirect,\n\tRouterProvider,\n\tuseBlocker,\n\tuseCanGoBack,\n\tuseLoaderData,\n\tuseLocation,\n\tuseMatches,\n\tuseRouter,\n\tuseRouterState,\n} from '@tanstack/react-router';\n\n/**\n * Internal dependencies\n */\nimport { lock } from './lock-unlock';\n\n/**\n * Private APIs for the boot package only.\n * These are router setup and internal utilities that should not be used\n * by individual routes.\n */\nexport const privateApis = {};\n\n// Lock the private APIs so only authorized modules can access them\nlock( privateApis, {\n\t// Router creation and setup\n\tcreateBrowserHistory,\n\tcreateLazyRoute,\n\tcreateMemoryHistory,\n\tcreateRouter,\n\tcreateRootRoute,\n\tcreateRoute,\n\tOutlet,\n\tRouterProvider,\n\n\t// Internal routing utilities\n\tredirect,\n\tcreateLink,\n\tuseCanGoBack,\n\tuseLoaderData,\n\tuseLocation,\n\tuseMatches,\n\tuseRouter,\n\tuseRouterState,\n\tuseBlocker,\n\n\t// History utilities\n\tparseHref,\n} );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0B;AAC1B,0BAkBO;AAKP,yBAAqB;AAOd,IAAM,cAAc,CAAC;AAAA,IAG5B,yBAAM,aAAa;AAAA;AAAA,EAElB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AACD,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { useRouter } from '@tanstack/react-router';\nexport {\n\tLink,\n\tnotFound,\n\tredirect,\n\tuseLinkProps,\n\tuseNavigate,\n\tuseParams,\n\tuseSearch,\n} from '@tanstack/react-router';\nexport type {\n\tAnyRoute,\n\tLinkProps,\n\tNavigateOptions,\n\tRouteOptions,\n\tRouterOptions,\n\tToOptions,\n\tUseNavigateResult,\n} from '@tanstack/react-router';\n\n/**\n * Internal dependencies\n */\nexport { privateApis } from './private-apis';\n\n/**\n * Hook to invalidate the router cache and trigger a re-render.\n * This is useful when you want to refetch data without changing the URL.\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const invalidate = useInvalidate();\n *\n * const handleRefresh = () => {\n * invalidate();\n * };\n *\n * return <button onClick={handleRefresh}>Refresh</button>;\n * }\n * ```\n *\n * @return A function to invalidate the router.\n */\nexport function useInvalidate() {\n\tconst router = useRouter();\n\treturn () => router.invalidate();\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,iBAAiB;AAC1B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { useRouter } from '@tanstack/react-router';\nexport {\n\tLink,\n\tnotFound,\n\tredirect,\n\tuseLinkProps,\n\tuseNavigate,\n\tuseParams,\n\tuseSearch,\n} from '@tanstack/react-router';\n\nexport type {\n\tAnyRoute,\n\tAnyRouter,\n\tLinkProps,\n\tNavigateOptions,\n\tRouteOptions,\n\tRouterOptions,\n\tToOptions,\n\tUseNavigateResult,\n} from '@tanstack/react-router';\n\n/**\n * Internal dependencies\n */\nexport { privateApis } from './private-apis';\n\n/**\n * Hook to invalidate the router cache and trigger a re-render.\n * This is useful when you want to refetch data without changing the URL.\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const invalidate = useInvalidate();\n *\n * const handleRefresh = () => {\n * invalidate();\n * };\n *\n * return <button onClick={handleRefresh}>Refresh</button>;\n * }\n * ```\n *\n * @return A function to invalidate the router.\n */\nexport function useInvalidate() {\n\tconst router = useRouter();\n\treturn () => router.invalidate();\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,iBAAiB;AAC1B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAgBP,SAAS,mBAAmB;AAqBrB,SAAS,gBAAgB;AAC/B,QAAM,SAAS,UAAU;AACzB,SAAO,MAAM,OAAO,WAAW;AAChC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
createBrowserHistory,
|
|
5
5
|
createLazyRoute,
|
|
6
6
|
createLink,
|
|
7
|
+
createMemoryHistory,
|
|
7
8
|
createRootRoute,
|
|
8
9
|
createRoute,
|
|
9
10
|
createRouter,
|
|
@@ -24,6 +25,7 @@ lock(privateApis, {
|
|
|
24
25
|
// Router creation and setup
|
|
25
26
|
createBrowserHistory,
|
|
26
27
|
createLazyRoute,
|
|
28
|
+
createMemoryHistory,
|
|
27
29
|
createRouter,
|
|
28
30
|
createRootRoute,
|
|
29
31
|
createRoute,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/private-apis.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { parseHref } from '@tanstack/history';\nimport {\n\tcreateBrowserHistory,\n\tcreateLazyRoute,\n\tcreateLink,\n\tcreateRootRoute,\n\tcreateRoute,\n\tcreateRouter,\n\tOutlet,\n\tredirect,\n\tRouterProvider,\n\tuseBlocker,\n\tuseCanGoBack,\n\tuseLoaderData,\n\tuseLocation,\n\tuseMatches,\n\tuseRouter,\n\tuseRouterState,\n} from '@tanstack/react-router';\n\n/**\n * Internal dependencies\n */\nimport { lock } from './lock-unlock';\n\n/**\n * Private APIs for the boot package only.\n * These are router setup and internal utilities that should not be used\n * by individual routes.\n */\nexport const privateApis = {};\n\n// Lock the private APIs so only authorized modules can access them\nlock( privateApis, {\n\t// Router creation and setup\n\tcreateBrowserHistory,\n\tcreateLazyRoute,\n\tcreateRouter,\n\tcreateRootRoute,\n\tcreateRoute,\n\tOutlet,\n\tRouterProvider,\n\n\t// Internal routing utilities\n\tredirect,\n\tcreateLink,\n\tuseCanGoBack,\n\tuseLoaderData,\n\tuseLocation,\n\tuseMatches,\n\tuseRouter,\n\tuseRouterState,\n\tuseBlocker,\n\n\t// History utilities\n\tparseHref,\n} );\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,iBAAiB;AAC1B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAKP,SAAS,YAAY;AAOd,IAAM,cAAc,CAAC;AAG5B,KAAM,aAAa;AAAA;AAAA,EAElB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AACD,CAAE;",
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { parseHref } from '@tanstack/history';\nimport {\n\tcreateBrowserHistory,\n\tcreateLazyRoute,\n\tcreateLink,\n\tcreateMemoryHistory,\n\tcreateRootRoute,\n\tcreateRoute,\n\tcreateRouter,\n\tOutlet,\n\tredirect,\n\tRouterProvider,\n\tuseBlocker,\n\tuseCanGoBack,\n\tuseLoaderData,\n\tuseLocation,\n\tuseMatches,\n\tuseRouter,\n\tuseRouterState,\n} from '@tanstack/react-router';\n\n/**\n * Internal dependencies\n */\nimport { lock } from './lock-unlock';\n\n/**\n * Private APIs for the boot package only.\n * These are router setup and internal utilities that should not be used\n * by individual routes.\n */\nexport const privateApis = {};\n\n// Lock the private APIs so only authorized modules can access them\nlock( privateApis, {\n\t// Router creation and setup\n\tcreateBrowserHistory,\n\tcreateLazyRoute,\n\tcreateMemoryHistory,\n\tcreateRouter,\n\tcreateRootRoute,\n\tcreateRoute,\n\tOutlet,\n\tRouterProvider,\n\n\t// Internal routing utilities\n\tredirect,\n\tcreateLink,\n\tuseCanGoBack,\n\tuseLoaderData,\n\tuseLocation,\n\tuseMatches,\n\tuseRouter,\n\tuseRouterState,\n\tuseBlocker,\n\n\t// History utilities\n\tparseHref,\n} );\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,iBAAiB;AAC1B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAKP,SAAS,YAAY;AAOd,IAAM,cAAc,CAAC;AAG5B,KAAM,aAAa;AAAA;AAAA,EAElB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AACD,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build-types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Link, notFound, redirect, useLinkProps, useNavigate, useParams, useSearch, } from '@tanstack/react-router';
|
|
2
|
-
export type { AnyRoute, LinkProps, NavigateOptions, RouteOptions, RouterOptions, ToOptions, UseNavigateResult, } from '@tanstack/react-router';
|
|
2
|
+
export type { AnyRoute, AnyRouter, LinkProps, NavigateOptions, RouteOptions, RouterOptions, ToOptions, UseNavigateResult, } from '@tanstack/react-router';
|
|
3
3
|
/**
|
|
4
4
|
* Internal dependencies
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACN,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,SAAS,EACT,SAAS,GACT,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACN,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,SAAS,EACT,SAAS,GACT,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACX,QAAQ,EACR,SAAS,EACT,SAAS,EACT,eAAe,EACf,YAAY,EACZ,aAAa,EACb,SAAS,EACT,iBAAiB,GACjB,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,wBAG5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-apis.d.ts","sourceRoot":"","sources":["../src/private-apis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private-apis.d.ts","sourceRoot":"","sources":["../src/private-apis.ts"],"names":[],"mappings":"AA6BA;;;;GAIG;AACH,eAAO,MAAM,WAAW,IAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/route",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Routing utilities for WordPress admin interfaces.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@tanstack/history": "^1.133.28",
|
|
47
47
|
"@tanstack/react-router": "^1.120.5",
|
|
48
|
-
"@wordpress/private-apis": "^1.
|
|
48
|
+
"@wordpress/private-apis": "^1.42.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"react": "^18.0.0"
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "c20787b1778ae64c2db65643b1c236309d68e6ba"
|
|
57
57
|
}
|
package/src/index.ts
CHANGED
package/src/private-apis.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
createBrowserHistory,
|
|
7
7
|
createLazyRoute,
|
|
8
8
|
createLink,
|
|
9
|
+
createMemoryHistory,
|
|
9
10
|
createRootRoute,
|
|
10
11
|
createRoute,
|
|
11
12
|
createRouter,
|
|
@@ -38,6 +39,7 @@ lock( privateApis, {
|
|
|
38
39
|
// Router creation and setup
|
|
39
40
|
createBrowserHistory,
|
|
40
41
|
createLazyRoute,
|
|
42
|
+
createMemoryHistory,
|
|
41
43
|
createRouter,
|
|
42
44
|
createRootRoute,
|
|
43
45
|
createRoute,
|