@bleedingdev/modern-js-i18n-runtime-extensions 3.9.0-ultramodern.11 → 3.9.0-ultramodern.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/cjs/index.js +10 -10
  2. package/dist/cjs/localeRedirectPolicy.js +6 -6
  3. package/dist/cjs/paths.js +3 -3
  4. package/dist/cjs/router-navigation/adapter.js +24 -166
  5. package/dist/esm/index.mjs +1 -1
  6. package/dist/esm/localeRedirectPolicy.mjs +1 -1
  7. package/dist/esm/paths.mjs +1 -1
  8. package/dist/esm/router-navigation/adapter.mjs +26 -168
  9. package/dist/esm-node/index.mjs +1 -1
  10. package/dist/esm-node/localeRedirectPolicy.mjs +1 -1
  11. package/dist/esm-node/paths.mjs +1 -1
  12. package/dist/esm-node/router-navigation/adapter.mjs +26 -168
  13. package/dist/types/index.d.ts +1 -1
  14. package/dist/types/localeRedirectPolicy.d.ts +1 -1
  15. package/dist/types/paths.d.ts +1 -1
  16. package/dist/types/router-navigation/adapter.d.ts +7 -55
  17. package/package.json +9 -9
  18. package/src/index.ts +1 -1
  19. package/src/localeRedirectPolicy.ts +2 -2
  20. package/src/paths.ts +2 -2
  21. package/src/router-navigation/adapter.tsx +62 -478
  22. package/tests/routerNavigation.test.tsx +80 -0
  23. package/dist/cjs/localisedUrls/config.js +0 -49
  24. package/dist/cjs/localisedUrls/index.js +0 -98
  25. package/dist/cjs/localisedUrls/normalise.js +0 -87
  26. package/dist/cjs/localisedUrls/pathname.js +0 -68
  27. package/dist/cjs/localisedUrls/patterns.js +0 -214
  28. package/dist/cjs/localisedUrls/redirect.js +0 -100
  29. package/dist/cjs/localisedUrls/resolve.js +0 -78
  30. package/dist/cjs/localisedUrls/routeIdentity.js +0 -118
  31. package/dist/cjs/localisedUrls/routes.js +0 -210
  32. package/dist/cjs/localisedUrls/types.js +0 -18
  33. package/dist/esm/localisedUrls/config.mjs +0 -11
  34. package/dist/esm/localisedUrls/index.mjs +0 -8
  35. package/dist/esm/localisedUrls/normalise.mjs +0 -37
  36. package/dist/esm/localisedUrls/pathname.mjs +0 -24
  37. package/dist/esm/localisedUrls/patterns.mjs +0 -152
  38. package/dist/esm/localisedUrls/redirect.mjs +0 -53
  39. package/dist/esm/localisedUrls/resolve.mjs +0 -37
  40. package/dist/esm/localisedUrls/routeIdentity.mjs +0 -77
  41. package/dist/esm/localisedUrls/routes.mjs +0 -169
  42. package/dist/esm/localisedUrls/types.mjs +0 -0
  43. package/dist/esm-node/localisedUrls/config.mjs +0 -12
  44. package/dist/esm-node/localisedUrls/index.mjs +0 -9
  45. package/dist/esm-node/localisedUrls/normalise.mjs +0 -38
  46. package/dist/esm-node/localisedUrls/pathname.mjs +0 -25
  47. package/dist/esm-node/localisedUrls/patterns.mjs +0 -153
  48. package/dist/esm-node/localisedUrls/redirect.mjs +0 -54
  49. package/dist/esm-node/localisedUrls/resolve.mjs +0 -38
  50. package/dist/esm-node/localisedUrls/routeIdentity.mjs +0 -78
  51. package/dist/esm-node/localisedUrls/routes.mjs +0 -170
  52. package/dist/esm-node/localisedUrls/types.mjs +0 -1
  53. package/dist/types/localisedUrls/config.d.ts +0 -9
  54. package/dist/types/localisedUrls/index.d.ts +0 -10
  55. package/dist/types/localisedUrls/normalise.d.ts +0 -10
  56. package/dist/types/localisedUrls/pathname.d.ts +0 -4
  57. package/dist/types/localisedUrls/patterns.d.ts +0 -11
  58. package/dist/types/localisedUrls/redirect.d.ts +0 -19
  59. package/dist/types/localisedUrls/resolve.d.ts +0 -7
  60. package/dist/types/localisedUrls/routeIdentity.d.ts +0 -24
  61. package/dist/types/localisedUrls/routes.d.ts +0 -3
  62. package/dist/types/localisedUrls/types.d.ts +0 -14
  63. package/src/localisedUrls/config.ts +0 -18
  64. package/src/localisedUrls/index.ts +0 -28
  65. package/src/localisedUrls/normalise.ts +0 -62
  66. package/src/localisedUrls/pathname.ts +0 -60
  67. package/src/localisedUrls/patterns.ts +0 -283
  68. package/src/localisedUrls/redirect.ts +0 -107
  69. package/src/localisedUrls/resolve.ts +0 -106
  70. package/src/localisedUrls/routeIdentity.ts +0 -107
  71. package/src/localisedUrls/routes.ts +0 -432
  72. package/src/localisedUrls/types.ts +0 -18
  73. package/tests/localisedUrls.test.ts +0 -532
@@ -1,192 +1,50 @@
1
1
  import "node:module";
2
- import { Fragment, jsx } from "react/jsx-runtime";
3
- import { RuntimeContext, isBrowser } from "@modern-js/runtime";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { RuntimeContext } from "@modern-js/runtime";
4
4
  import { InternalRuntimeContext } from "@modern-js/runtime/context";
5
5
  import { getRouterRuntimeState, subscribeRouterRuntimeState } from "@modern-js/runtime-extensions/router-state";
6
6
  import { useCallback, useContext, useSyncExternalStore } from "react";
7
- const normalizeUrlPart = (value, prefix)=>{
8
- if ('string' != typeof value || !value) return '';
9
- return value.startsWith(prefix) ? value : `${prefix}${value}`;
10
- };
11
- const normalizeLocation = (location)=>{
12
- if (!location || 'object' != typeof location) return null;
13
- const locationValue = location;
14
- if ('string' != typeof locationValue.pathname) return null;
15
- return {
16
- pathname: locationValue.pathname,
17
- search: normalizeUrlPart('string' == typeof locationValue.search ? locationValue.search : locationValue.searchStr, '?'),
18
- hash: normalizeUrlPart(locationValue.hash, '#')
19
- };
20
- };
21
- const getWindowLocation = ()=>{
22
- if (!isBrowser()) return null;
23
- return {
24
- pathname: window.location.pathname,
25
- search: window.location.search,
26
- hash: window.location.hash
27
- };
28
- };
29
- const getRouterFramework = (runtimeContext, internalContext, inReactRouter)=>{
30
- const framework = getRouterRuntimeState(internalContext)?.framework || getRouterRuntimeState(runtimeContext)?.framework;
31
- if (framework) return framework;
32
- if (internalContext.router?.useRouter || runtimeContext.router?.useRouter) return 'tanstack';
33
- if (internalContext.router?.useLocation || internalContext.router?.useHref || runtimeContext.router?.useLocation || runtimeContext.router?.useHref) return 'react-router';
34
- if (inReactRouter) return 'react-router';
35
- };
36
- const getRouterInstance = (internalContext, contextRouter)=>{
37
- if (contextRouter) return contextRouter;
38
- const router = getRouterRuntimeState(internalContext)?.instance;
39
- if (!router || 'object' != typeof router) return null;
40
- return router;
41
- };
42
- const getRouterStateLocation = (internalContext, contextRouter)=>{
43
- const router = getRouterInstance(internalContext, contextRouter);
44
- return normalizeLocation(router?.stores?.location?.get?.()) || normalizeLocation(router?.state?.location);
45
- };
46
- const getRouterParams = (internalContext, contextRouter)=>{
47
- const router = getRouterInstance(internalContext, contextRouter);
48
- const matches = router?.stores?.matches?.get?.() || router?.state?.matches;
49
- if (!Array.isArray(matches)) return {};
50
- return matches.reduce((params, match)=>{
51
- if (match?.params) Object.assign(params, match.params);
52
- return params;
53
- }, {});
54
- };
55
- const getRouterSnapshot = (internalContext, contextRouter)=>{
56
- const location = getRouterStateLocation(internalContext, contextRouter);
57
- const params = getRouterParams(internalContext, contextRouter);
58
- return JSON.stringify([
59
- location?.pathname ?? '',
60
- location?.search ?? '',
61
- location?.hash ?? '',
62
- Object.entries(params).sort(([left], [right])=>left.localeCompare(right))
63
- ]);
64
- };
7
+ const subscribeNone = ()=>()=>{};
8
+ const getEmptySnapshot = ()=>null;
65
9
  const createI18nRouterNavigation = ({ I18nNavigationProvider, useNativeI18nRouterAdapter })=>{
10
+ const NavigationProvider = I18nNavigationProvider;
66
11
  const useIntegratedRouterAdapter = ()=>{
67
12
  const runtimeContext = useContext(RuntimeContext);
68
13
  const internalContext = useContext(InternalRuntimeContext);
69
- const routerApi = internalContext.router || runtimeContext.router;
70
14
  const native = useNativeI18nRouterAdapter();
71
- const inReactRouter = native.hasRouter;
72
- const reactRouterNavigate = native.navigate;
73
- const reactRouterLocation = inReactRouter ? native.location : null;
74
- const reactRouterParams = native.params;
75
- const framework = getRouterFramework(runtimeContext, internalContext, inReactRouter);
76
- const contextUseRouter = inReactRouter || 'tanstack' !== framework ? void 0 : internalContext.router?.useRouter || runtimeContext.router?.useRouter;
77
- const contextRouter = contextUseRouter ? contextUseRouter({
78
- warn: false
79
- }) : null;
80
- const slotRouter = getRouterInstance(internalContext, contextRouter);
81
- const drivableSlotRouter = ('tanstack' === framework || 'react-router' === framework) && 'function' == typeof slotRouter?.navigate;
82
- const hasRouter = Boolean(reactRouterNavigate) || drivableSlotRouter;
83
- const subscribeToRouter = useCallback((update)=>{
84
- const unsubscribers = [];
85
- const unsubscribeFromSlot = subscribeRouterRuntimeState(internalContext, update);
86
- if ('function' == typeof unsubscribeFromSlot) unsubscribers.push(unsubscribeFromSlot);
87
- const router = getRouterInstance(internalContext, contextRouter);
88
- if (!router) return ()=>{
89
- for (const unsubscribe of unsubscribers)unsubscribe();
90
- };
91
- if ('react-router' === framework && !inReactRouter && 'function' == typeof router.subscribe) {
92
- const subscribe = router.subscribe;
93
- const unsubscribe = subscribe.call(router, update);
94
- if ('function' == typeof unsubscribe) unsubscribers.push(unsubscribe);
95
- }
96
- if ('tanstack' === framework && 'function' == typeof router.stores?.location?.subscribe) {
97
- const unsubscribe = router.stores.location.subscribe(update);
98
- if ('function' == typeof unsubscribe) unsubscribers.push(unsubscribe);
99
- }
100
- if ('tanstack' === framework && 'function' == typeof router.subscribe) {
101
- const subscribe = router.subscribe;
102
- for (const eventType of [
103
- 'onBeforeNavigate',
104
- 'onBeforeLoad'
105
- ]){
106
- const unsubscribe = subscribe.call(router, eventType, update);
107
- if ('function' == typeof unsubscribe) unsubscribers.push(unsubscribe);
108
- }
109
- }
15
+ const getCapability = useCallback(()=>getRouterRuntimeState(internalContext)?.navigation ?? getRouterRuntimeState(runtimeContext)?.navigation, [
16
+ internalContext,
17
+ runtimeContext
18
+ ]);
19
+ const subscribeCapability = useCallback((update)=>{
20
+ const stopInternal = subscribeRouterRuntimeState(internalContext, update);
21
+ const stopPublic = internalContext === runtimeContext ? void 0 : subscribeRouterRuntimeState(runtimeContext, update);
110
22
  return ()=>{
111
- for (const unsubscribe of unsubscribers)unsubscribe();
23
+ stopInternal();
24
+ stopPublic?.();
112
25
  };
113
26
  }, [
114
- contextRouter,
115
- framework,
116
- inReactRouter,
117
- internalContext
118
- ]);
119
- const getSnapshot = useCallback(()=>getRouterSnapshot(internalContext, contextRouter), [
120
- contextRouter,
121
- internalContext
122
- ]);
123
- useSyncExternalStore(subscribeToRouter, getSnapshot, getSnapshot);
124
- const navigate = useCallback((href, options)=>{
125
- const router = getRouterInstance(internalContext, contextRouter);
126
- const activeFramework = getRouterFramework(runtimeContext, internalContext, inReactRouter);
127
- if ('tanstack' === activeFramework) {
128
- if ('function' == typeof router?.navigate) return router.navigate({
129
- to: href,
130
- replace: options?.replace,
131
- ...options?.state === void 0 ? {} : {
132
- state: options.state
133
- }
134
- });
135
- throw new Error('TanStack router instance is not available.');
136
- }
137
- if (reactRouterNavigate) return reactRouterNavigate(href, options);
138
- if ('react-router' === activeFramework) {
139
- if ('function' == typeof router?.navigate) return router.navigate(href, options);
140
- throw new Error('React Router instance is not available.');
141
- }
142
- }, [
143
- contextRouter,
144
27
  internalContext,
145
- inReactRouter,
146
- reactRouterNavigate,
147
28
  runtimeContext
148
29
  ]);
149
- const location = (reactRouterLocation ? normalizeLocation(reactRouterLocation) : getRouterStateLocation(internalContext, contextRouter)) || getWindowLocation();
150
- const params = inReactRouter ? reactRouterParams : getRouterParams(internalContext, contextRouter);
151
- const Link = 'tanstack' === framework ? internalContext.router?.Link || runtimeContext.router?.Link || null : 'react-router' === framework || inReactRouter ? routerApi?.Link ?? null : null;
152
- return {
153
- framework,
154
- hasRouter,
155
- location,
156
- navigate: hasRouter ? navigate : null,
157
- Link,
158
- params,
159
- ...'tanstack' === framework ? {
160
- createLinkProps: createTanstackLinkProps
161
- } : {}
162
- };
163
- };
164
- const createTanstackLinkProps = (target)=>{
165
- const preload = void 0 !== target.preload ? target.preload : 'none' === target.prefetch ? false : target.prefetch;
30
+ const capability = useSyncExternalStore(subscribeCapability, getCapability, getCapability);
31
+ const snapshot = useSyncExternalStore(capability?.subscribe ?? subscribeNone, capability?.getSnapshot ?? getEmptySnapshot, capability?.getSnapshot ?? getEmptySnapshot);
32
+ if (native.hasRouter || !capability || !snapshot) return native;
33
+ const internalState = getRouterRuntimeState(internalContext);
166
34
  return {
167
- to: target.pathname,
168
- ...target.search ? {
169
- search: target.search
170
- } : {},
171
- ...target.hash ? {
172
- hash: target.hash
173
- } : {},
174
- ...void 0 === target.hashScrollIntoView ? {} : {
175
- hashScrollIntoView: target.hashScrollIntoView
176
- },
177
- ...void 0 === preload ? {} : {
178
- preload
179
- }
35
+ framework: internalState?.navigation === capability ? internalState.framework : getRouterRuntimeState(runtimeContext)?.framework,
36
+ hasRouter: true,
37
+ ...snapshot,
38
+ navigate: capability.navigate,
39
+ Link: capability.Link,
40
+ createLinkProps: capability.createLinkProps
180
41
  };
181
42
  };
182
43
  const I18nRouterNavigationProvider = ({ children })=>{
183
44
  const value = useIntegratedRouterAdapter();
184
45
  const native = useNativeI18nRouterAdapter();
185
- if (!value.hasRouter || native.hasRouter) return /*#__PURE__*/ jsx(Fragment, {
186
- children: children
187
- });
188
- return /*#__PURE__*/ jsx(I18nNavigationProvider, {
189
- value: value,
46
+ return /*#__PURE__*/ jsx(NavigationProvider, {
47
+ value: value.hasRouter && !native.hasRouter ? value : null,
190
48
  children: children
191
49
  });
192
50
  };
@@ -1,4 +1,4 @@
1
+ export * from '@modern-js/runtime-extensions/localised-urls';
1
2
  export * from './language-sync/controller.js';
2
3
  export * from './language-sync/react.js';
3
4
  export * from './localeRedirectPolicy.js';
4
- export * from './localisedUrls/index.js';
@@ -1,4 +1,4 @@
1
- import type { LocalisedUrlsOption } from './localisedUrls/index.js';
1
+ import type { LocalisedUrlsOption } from '@modern-js/runtime-extensions/localised-urls';
2
2
  interface LocaleRedirectRequest {
3
3
  url: string;
4
4
  header: () => {
@@ -1,4 +1,4 @@
1
- import { type LocalisedUrlsOption } from './localisedUrls/index.js';
1
+ import { type LocalisedUrlsOption } from '@modern-js/runtime-extensions/localised-urls';
2
2
  export interface LocalizedPathsConfig {
3
3
  languages: string[];
4
4
  localisedUrls?: LocalisedUrlsOption;
@@ -1,70 +1,22 @@
1
+ import { type RouterLinkTarget, type RouterNavigationCapability, type RouterNavigationSnapshot } from '@modern-js/runtime-extensions/router-state';
1
2
  import type React from 'react';
2
- /**
3
- * Fork-owned: the selected-router navigation adapter.
4
- *
5
- * `useNativeI18nRouterAdapter` only knows react-router's own hooks, so a bare
6
- * `appTools() + i18nPlugin()` app running the TanStack router would fall back
7
- * to plain `<a>` links and a non-reactive `window.location`. That breaks
8
- * language-invariant active state and, worse, leaves the i18n language stuck
9
- * after a client-side navigation to a localized URL.
10
- *
11
- * The subsystem lives in this fork-owned package rather than inside
12
- * upstream-owned `@modern-js/plugin-i18n`: that package only wires it in
13
- * through its existing `NavigationProvider` extension point, so the upstream
14
- * package keeps a seam instead of gaining a fork subsystem. The primitives the
15
- * adapter composes with - the navigation context provider, the native
16
- * react-router adapter and the adapter shape - are injected by that seam, so
17
- * nothing here imports `@modern-js/plugin-i18n` and no dependency cycle is
18
- * created.
19
- *
20
- * The adapter reads the actual selected router out of the fork-owned router
21
- * runtime-state slot, so it serves both routers without either plugin having
22
- * to know about i18n.
23
- */
24
- /** The primitives the host plugin injects; see `createI18nRouterNavigation`. */
25
3
  export interface I18nRouterNavigationDependencies<Adapter extends I18nRouterAdapterShape> {
26
4
  I18nNavigationProvider: React.ComponentType<React.PropsWithChildren<{
27
5
  value: Adapter;
28
6
  }>>;
29
7
  useNativeI18nRouterAdapter: () => Adapter;
30
8
  }
31
- export interface I18nRouterLinkTarget {
32
- pathname: string;
33
- href: string;
34
- search?: Record<string, unknown>;
35
- hash?: string;
36
- hashScrollIntoView?: boolean | ScrollIntoViewOptions;
37
- prefetch?: 'intent' | 'render' | 'viewport' | 'none';
38
- preload?: unknown;
39
- }
9
+ export type I18nRouterLinkTarget = RouterLinkTarget;
40
10
  export interface I18nRouterAdapterShape {
41
11
  framework?: string;
42
12
  hasRouter: boolean;
43
- location: {
44
- pathname: string;
45
- search: string;
46
- hash: string;
47
- } | null;
48
- navigate: ((href: string, options?: {
49
- replace?: boolean;
50
- state?: unknown;
51
- }) => void | Promise<void>) | null;
52
- Link: React.ComponentType<{
53
- to: string;
54
- children?: React.ReactNode;
55
- [key: string]: unknown;
56
- }> | null;
13
+ location: RouterNavigationSnapshot['location'] | null;
14
+ navigate: RouterNavigationCapability['navigate'] | null;
15
+ Link: RouterNavigationCapability['Link'] | null;
57
16
  params: Record<string, string>;
58
- createLinkProps?: (target: I18nRouterLinkTarget) => {
59
- to: string;
60
- [key: string]: unknown;
61
- };
17
+ createLinkProps?: RouterNavigationCapability['createLinkProps'];
62
18
  }
63
- /**
64
- * Build the selected-router navigation hook and provider from the host
65
- * plugin's own primitives. Injecting them is what keeps this fork-owned
66
- * subsystem free of any import edge back into the plugin that installs it.
67
- */
19
+ /** The router provider owns navigation; this seam only observes its capability. */
68
20
  export declare const createI18nRouterNavigation: <Adapter extends I18nRouterAdapterShape>({ I18nNavigationProvider, useNativeI18nRouterAdapter, }: I18nRouterNavigationDependencies<Adapter>) => {
69
21
  useIntegratedRouterAdapter: () => Adapter;
70
22
  I18nRouterNavigationProvider: ({ children, }: React.PropsWithChildren) => React.JSX.Element;
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern.js",
18
18
  "i18n"
19
19
  ],
20
- "version": "3.9.0-ultramodern.11",
20
+ "version": "3.9.0-ultramodern.13",
21
21
  "types": "./dist/types/index.d.ts",
22
22
  "main": "./dist/cjs/index.js",
23
23
  "module": "./dist/esm/index.mjs",
@@ -66,22 +66,22 @@
66
66
  "node": ">=26.7.0"
67
67
  },
68
68
  "dependencies": {
69
- "@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.0-ultramodern.11",
70
- "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.11",
69
+ "@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.0-ultramodern.13",
70
+ "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.13",
71
71
  "i18next-browser-languagedetector": "^8.2.1"
72
72
  },
73
73
  "peerDependencies": {
74
- "@modern-js/runtime": "3.9.0-ultramodern.11",
74
+ "@modern-js/runtime": "3.9.0-ultramodern.13",
75
75
  "react": "^19.2.8"
76
76
  },
77
77
  "devDependencies": {
78
- "@modern-js/runtime": "npm:@bleedingdev/modern-js-runtime@3.9.0-ultramodern.11",
79
- "@rslib/core": "1.0.0",
78
+ "@modern-js/runtime": "npm:@bleedingdev/modern-js-runtime@3.9.0-ultramodern.13",
79
+ "@rslib/core": "1.0.2",
80
80
  "@scripts/rstest-config": "2.66.0",
81
- "@types/node": "^26.4.1",
81
+ "@types/node": "^26.6.2",
82
82
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
83
- "react": "^19.2.8",
84
- "react-dom": "^19.2.8"
83
+ "react": "^19.3.0",
84
+ "react-dom": "^19.3.0"
85
85
  },
86
86
  "sideEffects": false,
87
87
  "publishConfig": {
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
+ export * from '@modern-js/runtime-extensions/localised-urls';
1
2
  export * from './language-sync/controller';
2
3
  export * from './language-sync/react';
3
4
  export * from './localeRedirectPolicy';
4
- export * from './localisedUrls/index';
@@ -1,11 +1,11 @@
1
- import type { LocalisedUrlsOption } from './localisedUrls/index';
1
+ import type { LocalisedUrlsOption } from '@modern-js/runtime-extensions/localised-urls';
2
2
  import {
3
3
  isDefaultLocaleRedirectSkipPath,
4
4
  localiseTargetPathname,
5
5
  matchesPathPrefix,
6
6
  shouldSkipLocaleRedirect,
7
7
  stripLanguagePrefix,
8
- } from './localisedUrls/index';
8
+ } from '@modern-js/runtime-extensions/localised-urls';
9
9
 
10
10
  interface LocaleRedirectRequest {
11
11
  url: string;
package/src/paths.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { splitUrlTarget } from '@modern-js/runtime-utils/url';
2
1
  import {
3
2
  canonicalTargetPathname,
4
3
  type LocalisedUrlsOption,
5
4
  localiseTargetPathname,
6
- } from './localisedUrls';
5
+ } from '@modern-js/runtime-extensions/localised-urls';
6
+ import { splitUrlTarget } from '@modern-js/runtime-utils/url';
7
7
 
8
8
  export interface LocalizedPathsConfig {
9
9
  languages: string[];