Files
core/src/features/admin/index.js
T
hykocx fbcaed6816 docs(admin): document active item and breadcrumb logic for nav registration
- add note in DEV.md explaining basePath auto-deduction and breadcrumb slug convention
- update README.md to document new `basePath` param in `registerNavItem` and detail active item/breadcrumb behavior
- update navigation file listing in README.md to include new exported helpers
- implement `getNavItemBasePath` and `findActiveNavContext` in navigation.js
- use `basePath` in AdminSidebar to determine active item via longest-prefix match
- use `basePath` in AdminTop to build breadcrumb with section, item, and action labels
- expose new navigation helpers from admin index.js and registry.js
2026-04-26 19:40:40 -04:00

32 lines
1.1 KiB
JavaScript

/**
* Zen Admin — barrel serveur (Next.js-free).
*
* - Navigation : buildNavigationSections.
* - Registre d'extensions : registerWidget, registerWidgetFetcher, registerNavItem,
* registerNavSection, registerPage (import une seule fois depuis le layout
* racine de l'app consommatrice pour que les side effects s'exécutent).
*
* Ne re-exporte PAS protect.js — ce fichier importe `next/navigation` et
* `@zen/core/features/auth/actions` (qui importe `next/headers`) au niveau
* top-level. Ce barrel est importé par des modules externes pendant leur
* register(), avant que Next.js ait activé ses alias de modules.
* Importer les gardes explicitement via @zen/core/features/admin/protect.
*
* Client components sous @zen/core/features/admin/components.
*/
export { buildNavigationSections, buildBottomNavItems, getNavItemBasePath, findActiveNavContext } from './navigation.js';
export {
registerWidget,
registerWidgetFetcher,
registerNavItem,
registerNavSection,
registerPage,
collectWidgetData,
getWidgets,
getNavItems,
getNavSections,
getPage,
getPages,
} from './registry.js';