@donotdev/ui 0.2.1 → 0.2.3
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/dist/{GoToDialog-CICRYHHG.js → GoToDialog-KSBGOIWO.js} +1 -1
- package/dist/chunk-MS7ZIW5Z.js +1 -0
- package/dist/components/auth/AuthHeader.d.ts.map +1 -1
- package/dist/components/auth/AuthHeader.js +0 -2
- package/dist/components/auth/AuthMenu.d.ts.map +1 -1
- package/dist/components/auth/AuthMenu.js +6 -40
- package/dist/components/common/TechBento.d.ts +2 -6
- package/dist/components/common/TechBento.d.ts.map +1 -1
- package/dist/components/common/TechBento.js +14 -16
- package/dist/components/common/icon.d.ts.map +1 -1
- package/dist/components/common/icon.js +2 -1
- package/dist/components/common/lucideIconByName.d.ts +9 -0
- package/dist/components/common/lucideIconByName.d.ts.map +1 -0
- package/dist/components/common/lucideIconByName.js +32 -0
- package/dist/components/layout/GameFlow.d.ts.map +1 -1
- package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/layout/components/Breadcrumbs.js +14 -9
- package/dist/components/layout/components/header/CacheSettings.d.ts.map +1 -1
- package/dist/components/layout/components/header/CacheSettings.js +6 -4
- package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
- package/dist/components/layout/components/header/SettingsMenu.js +2 -1
- package/dist/components/layout/components/header/ThemeToggle.d.ts.map +1 -1
- package/dist/components/layout/components/header/ThemeToggle.js +2 -1
- package/dist/crud/components/CrudCardLink.d.ts +6 -6
- package/dist/crud/components/CrudCardLink.d.ts.map +1 -1
- package/dist/crud/components/CrudCardLink.js +3 -9
- package/dist/crud/components/EntityCardList.d.ts.map +1 -1
- package/dist/crud/components/EntityCardList.js +3 -11
- package/dist/crud/components/EntityDisplayRenderer.d.ts +1 -1
- package/dist/crud/components/EntityDisplayRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityDisplayRenderer.js +17 -58
- package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityFormRenderer.js +27 -5
- package/dist/crud/components/EntityList.d.ts +4 -4
- package/dist/crud/components/EntityList.d.ts.map +1 -1
- package/dist/crud/components/EntityList.js +136 -59
- package/dist/crud/components/Form.d.ts +1 -1
- package/dist/crud/components/Form.d.ts.map +1 -1
- package/dist/crud/components/Form.js +2 -2
- package/dist/crud/components/cellEditFor.d.ts +28 -0
- package/dist/crud/components/cellEditFor.d.ts.map +1 -0
- package/dist/crud/components/cellEditFor.js +54 -0
- package/dist/crud/components/entityParent.d.ts +40 -0
- package/dist/crud/components/entityParent.d.ts.map +1 -0
- package/dist/crud/components/entityParent.js +54 -0
- package/dist/crud/components/useRecordBreadcrumb.d.ts +11 -0
- package/dist/crud/components/useRecordBreadcrumb.d.ts.map +1 -0
- package/dist/crud/components/useRecordBreadcrumb.js +34 -0
- package/dist/crud/crudImports.d.ts +3 -0
- package/dist/crud/crudImports.d.ts.map +1 -1
- package/dist/crud/crudImports.js +3 -0
- package/dist/dndev-next.css +483 -145
- package/dist/dndev.css +483 -145
- package/dist/index.js +4 -4
- package/dist/internal/common/RouteErrorFallback.d.ts.map +1 -1
- package/dist/internal/common/RouteErrorFallback.js +2 -4
- package/dist/internal/devtools/components/ConfigTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/ConfigTab.js +1 -1
- package/dist/internal/devtools/components/CookieTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/CookieTab.js +1 -5
- package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/DesignTab.js +18 -7
- package/dist/internal/devtools/components/StoresTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/StoresTab.js +17 -3
- package/dist/internal/devtools/types.d.ts +3 -3
- package/dist/internal/devtools/types.d.ts.map +1 -1
- package/dist/internal/devtools/utils/maskSensitive.d.ts +1 -1
- package/dist/internal/devtools/utils/maskSensitive.d.ts.map +1 -1
- package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
- package/dist/internal/layout/DnDevLayout.js +21 -21
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +45 -58
- package/dist/internal/layout/components/footer/FooterLegalLinks.js +2 -2
- package/dist/internal/layout/components/footer/useLegalLinks.d.ts +0 -2
- package/dist/internal/layout/components/footer/useLegalLinks.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/useLegalLinks.js +0 -2
- package/dist/internal/layout/components/i18nSeoMeta.d.ts +54 -0
- package/dist/internal/layout/components/i18nSeoMeta.d.ts.map +1 -0
- package/dist/internal/layout/components/i18nSeoMeta.js +53 -0
- package/dist/internal/layout/components/index.d.ts +1 -1
- package/dist/internal/layout/components/index.js +1 -1
- package/dist/internal/layout/zones/DnDevMergedBar.js +3 -3
- package/dist/internal/providers/UIProviders.d.ts.map +1 -1
- package/dist/internal/providers/UIProviders.js +7 -2
- package/dist/providers/NextJsAppProviders.d.ts +5 -1
- package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
- package/dist/providers/NextJsAppProviders.js +36 -6
- package/dist/providers/ViteAppProviders.d.ts.map +1 -1
- package/dist/providers/ViteAppProviders.js +42 -4
- package/dist/routing/404.js +4 -4
- package/dist/routing/AuthGuard.d.ts +0 -4
- package/dist/routing/AuthGuard.d.ts.map +1 -1
- package/dist/routing/AuthGuard.js +0 -4
- package/dist/routing/AuthGuardFallback.d.ts.map +1 -1
- package/dist/routing/AuthGuardFallback.js +1 -2
- package/dist/routing/AuthReturnTo.d.ts.map +1 -1
- package/dist/routing/AuthReturnTo.js +9 -2
- package/dist/routing/GoTo.d.ts +0 -6
- package/dist/routing/GoTo.d.ts.map +1 -1
- package/dist/routing/GoTo.js +5 -8
- package/dist/routing/Link.d.ts +4 -2
- package/dist/routing/Link.d.ts.map +1 -1
- package/dist/routing/Link.js +8 -5
- package/dist/routing/SignedInRedirect.d.ts +27 -0
- package/dist/routing/SignedInRedirect.d.ts.map +1 -0
- package/dist/routing/SignedInRedirect.js +47 -0
- package/dist/routing/hooks/hooks.next.d.ts +2 -0
- package/dist/routing/hooks/hooks.next.d.ts.map +1 -1
- package/dist/routing/hooks/hooks.next.js +1 -1
- package/dist/routing/hooks/hooks.vite.d.ts +2 -0
- package/dist/routing/hooks/hooks.vite.d.ts.map +1 -1
- package/dist/routing/hooks/hooks.vite.js +1 -1
- package/dist/routing/hooks/useLocation.next.d.ts +12 -0
- package/dist/routing/hooks/useLocation.next.d.ts.map +1 -1
- package/dist/routing/hooks/useLocation.next.js +17 -4
- package/dist/routing/hooks/useMatch.next.d.ts +6 -0
- package/dist/routing/hooks/useMatch.next.d.ts.map +1 -1
- package/dist/routing/hooks/useMatch.next.js +8 -2
- package/dist/routing/hooks/useNavigate.next.d.ts +6 -1
- package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.next.js +13 -4
- package/dist/routing/hooks/useNavigate.vite.d.ts +7 -1
- package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.vite.js +20 -4
- package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
- package/dist/routing/hooks/useRedirectGuard.next.js +7 -1
- package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useRedirectGuard.vite.js +7 -1
- package/dist/routing/hooks/useRoutePath.next.d.ts +23 -0
- package/dist/routing/hooks/useRoutePath.next.d.ts.map +1 -0
- package/dist/routing/hooks/useRoutePath.next.js +36 -0
- package/dist/routing/hooks/useRoutePath.vite.d.ts +13 -0
- package/dist/routing/hooks/useRoutePath.vite.d.ts.map +1 -0
- package/dist/routing/hooks/useRoutePath.vite.js +25 -0
- package/dist/routing/hooks/useUrlLanguage.next.d.ts +28 -0
- package/dist/routing/hooks/useUrlLanguage.next.d.ts.map +1 -0
- package/dist/routing/hooks/useUrlLanguage.next.js +50 -0
- package/dist/routing/hooks/useUrlLanguage.vite.d.ts +22 -0
- package/dist/routing/hooks/useUrlLanguage.vite.d.ts.map +1 -0
- package/dist/routing/hooks/useUrlLanguage.vite.js +41 -0
- package/dist/routing/index.d.ts +3 -1
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +2 -1
- package/dist/routing/useNavigation.js +4 -4
- package/dist/styles/index.css +483 -145
- package/dist/symbol-index.json +1 -1
- package/dist/utils/assetResolver.d.ts.map +1 -1
- package/dist/utils/assetResolver.js +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -0
- package/dist/utils/useDeleteAccountSafe.d.ts +17 -0
- package/dist/utils/useDeleteAccountSafe.d.ts.map +1 -0
- package/dist/utils/useDeleteAccountSafe.js +52 -0
- package/dist/utils/useFormStoreSafe.d.ts.map +1 -1
- package/dist/utils/useFormStoreSafe.js +1 -0
- package/dist/utils/useSeo.d.ts +10 -2
- package/dist/utils/useSeo.d.ts.map +1 -1
- package/dist/utils/useSeo.js +44 -9
- package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.js +37 -4
- package/guidelines/COMPONENTS.md +2 -1
- package/guidelines/PAGES.md +7 -0
- package/guidelines/ROUTING.md +4 -0
- package/guidelines/SEO.md +64 -0
- package/package.json +9 -9
- package/dist/CookieConsent-5NH5DNTP.js +0 -1
- package/dist/CookieConsent-W7UE647Y.js +0 -1
- package/dist/GoToDialog-YGBON6FR.js +0 -1
- package/dist/chunk-DRFM6WXH.js +0 -1
- package/dist/chunk-MIPTBUWY.js +0 -1
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts +0 -57
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts.map +0 -1
- package/dist/internal/layout/components/NextJsAutoMetaTags.js +0 -182
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language of the current URL: its prefix, else the default language.
|
|
3
|
+
*
|
|
4
|
+
* @returns Language code (`/en/produits` → `en`)
|
|
5
|
+
*
|
|
6
|
+
* @version 0.1.0
|
|
7
|
+
* @since 0.2.3
|
|
8
|
+
* @author AMBROISE PARK Consulting
|
|
9
|
+
*/
|
|
10
|
+
export declare function useUrlLanguage(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Localize app paths in the current URL's language, for `href`s built outside `<Link>`.
|
|
13
|
+
* `<Link path>` and `navigate()` already do it.
|
|
14
|
+
*
|
|
15
|
+
* @returns `(path) => url`: `/produits` → `/en/produits` on an English page
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const localize = useLocalizedPath();
|
|
20
|
+
* <a href={localize('/produits')}>…</a>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @version 0.1.0
|
|
24
|
+
* @since 0.2.3
|
|
25
|
+
* @author AMBROISE PARK Consulting
|
|
26
|
+
*/
|
|
27
|
+
export declare function useLocalizedPath(): (path: string) => string;
|
|
28
|
+
//# sourceMappingURL=useUrlLanguage.next.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUrlLanguage.next.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useUrlLanguage.next.ts"],"names":[],"mappings":"AA0BA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAKvC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAI3D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
// packages/ui/src/routing/hooks/useUrlLanguage.next.ts
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Next.js language of the URL
|
|
5
|
+
* @description The language of the current URL and the localized form of app paths
|
|
6
|
+
* (default language at the root, others under `/<lang>`; see languagePath in
|
|
7
|
+
* @donotdev/core). On the server a rewritten default-language page reads
|
|
8
|
+
* `/<default>/…` and the browser reads `/…` (a per-request page: `/<lang>/dndev-session/…`,
|
|
9
|
+
* dropped by publicPathname): both give the same language and paths, so the server
|
|
10
|
+
* HTML and the hydration pass agree.
|
|
11
|
+
*
|
|
12
|
+
* @version 0.1.0
|
|
13
|
+
* @since 0.2.3
|
|
14
|
+
* @author AMBROISE PARK Consulting
|
|
15
|
+
*/
|
|
16
|
+
import { usePathname } from 'next/navigation';
|
|
17
|
+
import { getLanguageRouting, localizePath, publicPathname, splitLanguagePath, } from '@donotdev/core';
|
|
18
|
+
/**
|
|
19
|
+
* Language of the current URL: its prefix, else the default language.
|
|
20
|
+
*
|
|
21
|
+
* @returns Language code (`/en/produits` → `en`)
|
|
22
|
+
*
|
|
23
|
+
* @version 0.1.0
|
|
24
|
+
* @since 0.2.3
|
|
25
|
+
* @author AMBROISE PARK Consulting
|
|
26
|
+
*/
|
|
27
|
+
export function useUrlLanguage() {
|
|
28
|
+
return splitLanguagePath(publicPathname(usePathname() ?? '/'), getLanguageRouting()).language;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Localize app paths in the current URL's language, for `href`s built outside `<Link>`.
|
|
32
|
+
* `<Link path>` and `navigate()` already do it.
|
|
33
|
+
*
|
|
34
|
+
* @returns `(path) => url`: `/produits` → `/en/produits` on an English page
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* const localize = useLocalizedPath();
|
|
39
|
+
* <a href={localize('/produits')}>…</a>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @version 0.1.0
|
|
43
|
+
* @since 0.2.3
|
|
44
|
+
* @author AMBROISE PARK Consulting
|
|
45
|
+
*/
|
|
46
|
+
export function useLocalizedPath() {
|
|
47
|
+
const language = useUrlLanguage();
|
|
48
|
+
const routing = getLanguageRouting();
|
|
49
|
+
return (path) => localizePath(path, language, routing);
|
|
50
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language of the current URL: the router basename's language, else the default.
|
|
3
|
+
*
|
|
4
|
+
* @returns Language code
|
|
5
|
+
*
|
|
6
|
+
* @version 0.1.0
|
|
7
|
+
* @since 0.2.3
|
|
8
|
+
* @author AMBROISE PARK Consulting
|
|
9
|
+
*/
|
|
10
|
+
export declare function useUrlLanguage(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Localize app paths in the current URL's language, for `href`s built outside `<Link>`.
|
|
13
|
+
* `<Link path>` and `navigate()` already do it.
|
|
14
|
+
*
|
|
15
|
+
* @returns `(path) => url`: `/produits` → `/en/produits` on an English page
|
|
16
|
+
*
|
|
17
|
+
* @version 0.1.0
|
|
18
|
+
* @since 0.2.3
|
|
19
|
+
* @author AMBROISE PARK Consulting
|
|
20
|
+
*/
|
|
21
|
+
export declare function useLocalizedPath(): (path: string) => string;
|
|
22
|
+
//# sourceMappingURL=useUrlLanguage.vite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUrlLanguage.vite.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useUrlLanguage.vite.ts"],"names":[],"mappings":"AAsBA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAI3D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
// packages/ui/src/routing/hooks/useUrlLanguage.vite.ts
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Vite language of the URL
|
|
5
|
+
* @description The router runs under the language prefix as its basename
|
|
6
|
+
* (createAppRouter), so route paths never carry it. This reads the language from that
|
|
7
|
+
* basename and localizes app paths for `href`s.
|
|
8
|
+
*
|
|
9
|
+
* @version 0.1.0
|
|
10
|
+
* @since 0.2.3
|
|
11
|
+
* @author AMBROISE PARK Consulting
|
|
12
|
+
*/
|
|
13
|
+
import { useHref } from 'react-router-dom';
|
|
14
|
+
import { getLanguageRouting, localizePath, splitLanguagePath, } from '@donotdev/core';
|
|
15
|
+
/**
|
|
16
|
+
* Language of the current URL: the router basename's language, else the default.
|
|
17
|
+
*
|
|
18
|
+
* @returns Language code
|
|
19
|
+
*
|
|
20
|
+
* @version 0.1.0
|
|
21
|
+
* @since 0.2.3
|
|
22
|
+
* @author AMBROISE PARK Consulting
|
|
23
|
+
*/
|
|
24
|
+
export function useUrlLanguage() {
|
|
25
|
+
return splitLanguagePath(useHref('/'), getLanguageRouting()).language;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Localize app paths in the current URL's language, for `href`s built outside `<Link>`.
|
|
29
|
+
* `<Link path>` and `navigate()` already do it.
|
|
30
|
+
*
|
|
31
|
+
* @returns `(path) => url`: `/produits` → `/en/produits` on an English page
|
|
32
|
+
*
|
|
33
|
+
* @version 0.1.0
|
|
34
|
+
* @since 0.2.3
|
|
35
|
+
* @author AMBROISE PARK Consulting
|
|
36
|
+
*/
|
|
37
|
+
export function useLocalizedPath() {
|
|
38
|
+
const language = useUrlLanguage();
|
|
39
|
+
const routing = getLanguageRouting();
|
|
40
|
+
return (path) => localizePath(path, language, routing);
|
|
41
|
+
}
|
package/dist/routing/index.d.ts
CHANGED
|
@@ -11,12 +11,14 @@ export * from './Link';
|
|
|
11
11
|
export * from './AuthGuard';
|
|
12
12
|
export * from './AuthGuardFallback';
|
|
13
13
|
export { AuthReturnTo } from './AuthReturnTo';
|
|
14
|
+
export { SignedInRedirect } from './SignedInRedirect';
|
|
15
|
+
export type { SignedInRedirectProps } from './SignedInRedirect';
|
|
14
16
|
export * from './GoTo';
|
|
15
17
|
export { default as GoToWrapper } from './GoToWrapper';
|
|
16
18
|
export { default as GoToInput } from './GoToInput';
|
|
17
19
|
export * from './DnDevNavigationMenu';
|
|
18
20
|
export { default as NotFoundPage } from './404';
|
|
19
|
-
export { useNavigate, useBack, useRefresh, usePrefetch, useLocation, useParams, useRouteParam, useSearchParams, useMatch, useQueryParams, useRedirectGuard, } from '@donotdev/ui/routing/hooks';
|
|
21
|
+
export { useNavigate, useBack, useRefresh, usePrefetch, useLocation, useRoutePath, useParams, useRouteParam, useSearchParams, useMatch, useQueryParams, useRedirectGuard, useLocalizedPath, useUrlLanguage, } from '@donotdev/ui/routing/hooks';
|
|
20
22
|
export type { NavigateOptions, RedirectGuardOptions, RedirectGuardResult, } from '@donotdev/ui/routing/hooks';
|
|
21
23
|
export * from './useNavigation';
|
|
22
24
|
export * from './useGoTo';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routing/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAGH,cAAc,QAAQ,CAAC;AAGvB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,OAAO,CAAC;AAOhD,OAAO,EACL,WAAW,EACX,OAAO,EACP,UAAU,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,eAAe,EACf,QAAQ,EACR,cAAc,EACd,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routing/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAGH,cAAc,QAAQ,CAAC;AAGvB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,OAAO,CAAC;AAOhD,OAAO,EACL,WAAW,EACX,OAAO,EACP,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,SAAS,EACT,aAAa,EACb,eAAe,EACf,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
|
package/dist/routing/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from './Link';
|
|
|
15
15
|
export * from './AuthGuard';
|
|
16
16
|
export * from './AuthGuardFallback';
|
|
17
17
|
export { AuthReturnTo } from './AuthReturnTo';
|
|
18
|
+
export { SignedInRedirect } from './SignedInRedirect';
|
|
18
19
|
export * from './GoTo';
|
|
19
20
|
export { default as GoToWrapper } from './GoToWrapper';
|
|
20
21
|
export { default as GoToInput } from './GoToInput';
|
|
@@ -26,6 +27,6 @@ export { default as NotFoundPage } from './404';
|
|
|
26
27
|
// - hooks.vite.ts when bundled with Vite (vite-app condition)
|
|
27
28
|
// - hooks.next.ts when bundled with Next.js (default condition)
|
|
28
29
|
// NOTE: Explicit named exports required - esbuild can't re-export with 'export *' from external
|
|
29
|
-
export { useNavigate, useBack, useRefresh, usePrefetch, useLocation, useParams, useRouteParam, useSearchParams, useMatch, useQueryParams, useRedirectGuard, } from '@donotdev/ui/routing/hooks';
|
|
30
|
+
export { useNavigate, useBack, useRefresh, usePrefetch, useLocation, useRoutePath, useParams, useRouteParam, useSearchParams, useMatch, useQueryParams, useRedirectGuard, useLocalizedPath, useUrlLanguage, } from '@donotdev/ui/routing/hooks';
|
|
30
31
|
export * from './useNavigation';
|
|
31
32
|
export * from './useGoTo';
|
|
@@ -11,7 +11,7 @@ import { useMemo } from 'react';
|
|
|
11
11
|
import { useNavigationStore, useTranslation } from '@donotdev/core';
|
|
12
12
|
import { USER_ROLES } from '@donotdev/core';
|
|
13
13
|
// Platform-specific hooks via conditional exports
|
|
14
|
-
import {
|
|
14
|
+
import { useRoutePath } from '@donotdev/ui/routing/hooks';
|
|
15
15
|
import { useAuthSafe } from '../utils/useAuthSafe';
|
|
16
16
|
/**
|
|
17
17
|
* Smart navigation hook with auth filtering
|
|
@@ -33,7 +33,7 @@ import { useAuthSafe } from '../utils/useAuthSafe';
|
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
35
|
export function useNavigationItems() {
|
|
36
|
-
const
|
|
36
|
+
const pathname = useRoutePath();
|
|
37
37
|
// Get auth state - hooks must be called at top level
|
|
38
38
|
const user = useAuthSafe('user');
|
|
39
39
|
const authenticated = !!user;
|
|
@@ -65,12 +65,12 @@ export function useNavigationItems() {
|
|
|
65
65
|
.map((route) => ({
|
|
66
66
|
...route,
|
|
67
67
|
label: routeLabel(route, t),
|
|
68
|
-
isActive: isRouteActive(route.path,
|
|
68
|
+
isActive: isRouteActive(route.path, pathname),
|
|
69
69
|
hasChildren: false,
|
|
70
70
|
children: undefined,
|
|
71
71
|
}))
|
|
72
72
|
.sort((a, b) => a.label.localeCompare(b.label, undefined, { sensitivity: 'base' })); // Alphabetical sorting by label
|
|
73
|
-
}, [filteredRoutes,
|
|
73
|
+
}, [filteredRoutes, pathname, t]);
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Resolves a single navigation item from the store by path.
|