@donotdev/ui 0.2.2 → 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.
Files changed (160) hide show
  1. package/dist/{GoToDialog-CICRYHHG.js → GoToDialog-KSBGOIWO.js} +1 -1
  2. package/dist/chunk-MS7ZIW5Z.js +1 -0
  3. package/dist/components/auth/AuthHeader.d.ts.map +1 -1
  4. package/dist/components/auth/AuthHeader.js +0 -2
  5. package/dist/components/auth/AuthMenu.d.ts.map +1 -1
  6. package/dist/components/auth/AuthMenu.js +6 -40
  7. package/dist/components/common/icon.d.ts.map +1 -1
  8. package/dist/components/common/icon.js +2 -1
  9. package/dist/components/common/lucideIconByName.d.ts +9 -0
  10. package/dist/components/common/lucideIconByName.d.ts.map +1 -0
  11. package/dist/components/common/lucideIconByName.js +32 -0
  12. package/dist/components/layout/GameFlow.d.ts.map +1 -1
  13. package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
  14. package/dist/components/layout/components/Breadcrumbs.js +14 -9
  15. package/dist/components/layout/components/header/CacheSettings.d.ts.map +1 -1
  16. package/dist/components/layout/components/header/CacheSettings.js +6 -4
  17. package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
  18. package/dist/components/layout/components/header/SettingsMenu.js +2 -1
  19. package/dist/components/layout/components/header/ThemeToggle.d.ts.map +1 -1
  20. package/dist/components/layout/components/header/ThemeToggle.js +2 -1
  21. package/dist/crud/components/CrudCardLink.d.ts +6 -6
  22. package/dist/crud/components/CrudCardLink.d.ts.map +1 -1
  23. package/dist/crud/components/CrudCardLink.js +3 -9
  24. package/dist/crud/components/EntityCardList.d.ts.map +1 -1
  25. package/dist/crud/components/EntityCardList.js +3 -11
  26. package/dist/crud/components/EntityDisplayRenderer.d.ts.map +1 -1
  27. package/dist/crud/components/EntityDisplayRenderer.js +4 -1
  28. package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
  29. package/dist/crud/components/EntityFormRenderer.js +27 -5
  30. package/dist/crud/components/EntityList.d.ts +4 -4
  31. package/dist/crud/components/EntityList.d.ts.map +1 -1
  32. package/dist/crud/components/EntityList.js +136 -59
  33. package/dist/crud/components/Form.d.ts +1 -1
  34. package/dist/crud/components/Form.d.ts.map +1 -1
  35. package/dist/crud/components/Form.js +2 -2
  36. package/dist/crud/components/cellEditFor.d.ts +28 -0
  37. package/dist/crud/components/cellEditFor.d.ts.map +1 -0
  38. package/dist/crud/components/cellEditFor.js +54 -0
  39. package/dist/crud/components/entityParent.d.ts +40 -0
  40. package/dist/crud/components/entityParent.d.ts.map +1 -0
  41. package/dist/crud/components/entityParent.js +54 -0
  42. package/dist/crud/components/useRecordBreadcrumb.d.ts +11 -0
  43. package/dist/crud/components/useRecordBreadcrumb.d.ts.map +1 -0
  44. package/dist/crud/components/useRecordBreadcrumb.js +34 -0
  45. package/dist/crud/crudImports.d.ts +2 -0
  46. package/dist/crud/crudImports.d.ts.map +1 -1
  47. package/dist/crud/crudImports.js +2 -0
  48. package/dist/dndev-next.css +483 -145
  49. package/dist/dndev.css +483 -145
  50. package/dist/index.js +4 -4
  51. package/dist/internal/common/RouteErrorFallback.d.ts.map +1 -1
  52. package/dist/internal/common/RouteErrorFallback.js +2 -4
  53. package/dist/internal/devtools/components/ConfigTab.d.ts.map +1 -1
  54. package/dist/internal/devtools/components/ConfigTab.js +1 -1
  55. package/dist/internal/devtools/components/CookieTab.d.ts.map +1 -1
  56. package/dist/internal/devtools/components/CookieTab.js +1 -5
  57. package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
  58. package/dist/internal/devtools/components/DesignTab.js +18 -7
  59. package/dist/internal/devtools/components/StoresTab.d.ts.map +1 -1
  60. package/dist/internal/devtools/components/StoresTab.js +17 -3
  61. package/dist/internal/devtools/types.d.ts +3 -3
  62. package/dist/internal/devtools/types.d.ts.map +1 -1
  63. package/dist/internal/devtools/utils/maskSensitive.d.ts +1 -1
  64. package/dist/internal/devtools/utils/maskSensitive.d.ts.map +1 -1
  65. package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
  66. package/dist/internal/layout/DnDevLayout.js +21 -21
  67. package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
  68. package/dist/internal/layout/components/AutoMetaTags.js +39 -36
  69. package/dist/internal/layout/components/i18nSeoMeta.d.ts.map +1 -1
  70. package/dist/internal/layout/components/i18nSeoMeta.js +1 -0
  71. package/dist/internal/layout/zones/DnDevMergedBar.js +3 -3
  72. package/dist/internal/providers/UIProviders.d.ts.map +1 -1
  73. package/dist/internal/providers/UIProviders.js +7 -2
  74. package/dist/providers/NextJsAppProviders.d.ts +5 -1
  75. package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
  76. package/dist/providers/NextJsAppProviders.js +36 -5
  77. package/dist/providers/ViteAppProviders.d.ts.map +1 -1
  78. package/dist/providers/ViteAppProviders.js +42 -4
  79. package/dist/routing/404.js +4 -4
  80. package/dist/routing/AuthGuardFallback.d.ts.map +1 -1
  81. package/dist/routing/AuthGuardFallback.js +1 -2
  82. package/dist/routing/AuthReturnTo.d.ts.map +1 -1
  83. package/dist/routing/AuthReturnTo.js +9 -2
  84. package/dist/routing/GoTo.d.ts +0 -6
  85. package/dist/routing/GoTo.d.ts.map +1 -1
  86. package/dist/routing/GoTo.js +5 -8
  87. package/dist/routing/Link.d.ts +4 -2
  88. package/dist/routing/Link.d.ts.map +1 -1
  89. package/dist/routing/Link.js +8 -5
  90. package/dist/routing/SignedInRedirect.d.ts +27 -0
  91. package/dist/routing/SignedInRedirect.d.ts.map +1 -0
  92. package/dist/routing/SignedInRedirect.js +47 -0
  93. package/dist/routing/hooks/hooks.next.d.ts +2 -0
  94. package/dist/routing/hooks/hooks.next.d.ts.map +1 -1
  95. package/dist/routing/hooks/hooks.next.js +1 -1
  96. package/dist/routing/hooks/hooks.vite.d.ts +2 -0
  97. package/dist/routing/hooks/hooks.vite.d.ts.map +1 -1
  98. package/dist/routing/hooks/hooks.vite.js +1 -1
  99. package/dist/routing/hooks/useLocation.next.d.ts +12 -0
  100. package/dist/routing/hooks/useLocation.next.d.ts.map +1 -1
  101. package/dist/routing/hooks/useLocation.next.js +17 -4
  102. package/dist/routing/hooks/useMatch.next.d.ts +6 -0
  103. package/dist/routing/hooks/useMatch.next.d.ts.map +1 -1
  104. package/dist/routing/hooks/useMatch.next.js +8 -2
  105. package/dist/routing/hooks/useNavigate.next.d.ts +6 -1
  106. package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
  107. package/dist/routing/hooks/useNavigate.next.js +13 -4
  108. package/dist/routing/hooks/useNavigate.vite.d.ts +7 -1
  109. package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
  110. package/dist/routing/hooks/useNavigate.vite.js +20 -4
  111. package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
  112. package/dist/routing/hooks/useRedirectGuard.next.js +7 -1
  113. package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
  114. package/dist/routing/hooks/useRedirectGuard.vite.js +7 -1
  115. package/dist/routing/hooks/useRoutePath.next.d.ts +23 -0
  116. package/dist/routing/hooks/useRoutePath.next.d.ts.map +1 -0
  117. package/dist/routing/hooks/useRoutePath.next.js +36 -0
  118. package/dist/routing/hooks/useRoutePath.vite.d.ts +13 -0
  119. package/dist/routing/hooks/useRoutePath.vite.d.ts.map +1 -0
  120. package/dist/routing/hooks/useRoutePath.vite.js +25 -0
  121. package/dist/routing/hooks/useUrlLanguage.next.d.ts +28 -0
  122. package/dist/routing/hooks/useUrlLanguage.next.d.ts.map +1 -0
  123. package/dist/routing/hooks/useUrlLanguage.next.js +50 -0
  124. package/dist/routing/hooks/useUrlLanguage.vite.d.ts +22 -0
  125. package/dist/routing/hooks/useUrlLanguage.vite.d.ts.map +1 -0
  126. package/dist/routing/hooks/useUrlLanguage.vite.js +41 -0
  127. package/dist/routing/index.d.ts +3 -1
  128. package/dist/routing/index.d.ts.map +1 -1
  129. package/dist/routing/index.js +2 -1
  130. package/dist/routing/useNavigation.js +4 -4
  131. package/dist/styles/index.css +483 -145
  132. package/dist/symbol-index.json +1 -1
  133. package/dist/utils/assetResolver.d.ts.map +1 -1
  134. package/dist/utils/assetResolver.js +1 -0
  135. package/dist/utils/index.d.ts +2 -0
  136. package/dist/utils/index.d.ts.map +1 -1
  137. package/dist/utils/index.js +3 -0
  138. package/dist/utils/useDeleteAccountSafe.d.ts +17 -0
  139. package/dist/utils/useDeleteAccountSafe.d.ts.map +1 -0
  140. package/dist/utils/useDeleteAccountSafe.js +52 -0
  141. package/dist/utils/useFormStoreSafe.d.ts.map +1 -1
  142. package/dist/utils/useFormStoreSafe.js +1 -0
  143. package/dist/utils/useSeo.d.ts +10 -2
  144. package/dist/utils/useSeo.d.ts.map +1 -1
  145. package/dist/utils/useSeo.js +44 -9
  146. package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
  147. package/dist/vite-routing/AppRoutes.js +37 -4
  148. package/guidelines/COMPONENTS.md +2 -1
  149. package/guidelines/PAGES.md +7 -0
  150. package/guidelines/ROUTING.md +4 -0
  151. package/guidelines/SEO.md +52 -0
  152. package/package.json +9 -9
  153. package/dist/CookieConsent-5NH5DNTP.js +0 -1
  154. package/dist/CookieConsent-W7UE647Y.js +0 -1
  155. package/dist/GoToDialog-YGBON6FR.js +0 -1
  156. package/dist/chunk-DRFM6WXH.js +0 -1
  157. package/dist/chunk-MIPTBUWY.js +0 -1
  158. package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts +0 -57
  159. package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts.map +0 -1
  160. package/dist/internal/layout/components/NextJsAutoMetaTags.js +0 -182
@@ -1 +1 @@
1
- import{a as u,h as T}from"./chunk-MIPTBUWY.js";import"./chunk-O2XFH626.js";import{Link as G,Star as I}from"lucide-react";import{useCallback as k,useEffect as D,useRef as O}from"react";import{Badge as S,Command as R,CommandDialog as F}from"@donotdev/components";import{useOverlayStore as v,useTranslation as A}from"@donotdev/core";import{jsx as o,jsxs as t}from"react/jsx-runtime";var E=()=>{let{t:e}=A("dndev"),d=O(null),m=v(a=>a.isCommandDialogOpen),r=v(a=>a.closeCommandDialog),{navigationItems:f,favoriteItems:s,recentItems:i,toggleFavorite:b,isFavorite:c,navigateToItem:h}=T();D(()=>{m&&requestAnimationFrame(()=>{d.current?.focus()})},[m]);let C=k(a=>{h(a),r()},[h,r]),p=k((a,g=!0)=>a.map(n=>({label:n.label,value:n.path,description:n.path!==n.label?n.path:void 0,icon:o(u,{icon:n.icon,fallback:G}),badge:n.badge?o(S,{children:n.badge}):void 0,onSelect:()=>C(n.path),rightSlot:g?o("button",{type:"button",onClick:N=>{N.stopPropagation(),b(n.path)},className:"dndev-command-favorite-button","data-favorited":c(n.path),"aria-label":c(n.path)?e("globalGoTo.unfavorite","Remove from favorites"):e("globalGoTo.favorite","Add to favorites"),children:o(u,{icon:I,className:"dndev-size-sm"})}):void 0})),[C,b,c,e]),l=[];if(s.length>0&&l.push({heading:e("globalGoTo.favorites","Favorites"),items:p(s,!1)}),i.length>0){let a=i.flatMap(g=>p([g],!0));a.length>0&&l.push({heading:e("globalGoTo.recent","Recent"),separator:s.length>0,items:a})}l.push({heading:e("globalGoTo.allPages","All Pages"),separator:s.length>0||i.length>0,items:p(f)});let y=f.length>0;return t(F,{open:m,onOpenChange:a=>a?null:r(),children:[o(R,{placeholder:e("globalGoTo.placeholder","Search pages..."),emptyMessage:y?e("globalGoTo.noResults","No results found."):e("globalGoTo.empty","No pages available."),groups:l}),o("div",{className:"dndev-command-footer",children:t("div",{className:"dndev-command-footer-shortcuts",children:[t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"\u2318K"}),o("span",{children:e("globalGoTo.shortcutOpen","Open")})]}),t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"\u2191"}),o("kbd",{className:"dndev-command-footer-key",children:"\u2193"}),o("span",{children:e("globalGoTo.shortcutNavigate","Navigate")})]}),t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"\u21B5"}),o("span",{children:e("globalGoTo.shortcutSelect","Select")})]}),t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"Esc"}),o("span",{children:e("globalGoTo.shortcutClose","Close")})]})]})})]})},L=()=>v(d=>d.isCommandDialogOpen)?o(E,{}):null,K=L;export{K as default};
1
+ import{b as u,i as T}from"./chunk-MS7ZIW5Z.js";import"./chunk-O2XFH626.js";import{Link as G,Star as I}from"lucide-react";import{useCallback as k,useEffect as D,useRef as O}from"react";import{Badge as S,Command as R,CommandDialog as F}from"@donotdev/components";import{useOverlayStore as v,useTranslation as A}from"@donotdev/core";import{jsx as o,jsxs as t}from"react/jsx-runtime";var E=()=>{let{t:e}=A("dndev"),d=O(null),m=v(a=>a.isCommandDialogOpen),r=v(a=>a.closeCommandDialog),{navigationItems:f,favoriteItems:s,recentItems:i,toggleFavorite:b,isFavorite:c,navigateToItem:h}=T();D(()=>{m&&requestAnimationFrame(()=>{d.current?.focus()})},[m]);let C=k(a=>{h(a),r()},[h,r]),p=k((a,g=!0)=>a.map(n=>({label:n.label,value:n.path,description:n.path!==n.label?n.path:void 0,icon:o(u,{icon:n.icon,fallback:G}),badge:n.badge?o(S,{children:n.badge}):void 0,onSelect:()=>C(n.path),rightSlot:g?o("button",{type:"button",onClick:y=>{y.stopPropagation(),b(n.path)},className:"dndev-command-favorite-button","data-favorited":c(n.path),"aria-label":c(n.path)?e("globalGoTo.unfavorite","Remove from favorites"):e("globalGoTo.favorite","Add to favorites"),children:o(u,{icon:I,className:"dndev-size-sm"})}):void 0})),[C,b,c,e]),l=[];if(s.length>0&&l.push({heading:e("globalGoTo.favorites","Favorites"),items:p(s,!1)}),i.length>0){let a=i.flatMap(g=>p([g],!0));a.length>0&&l.push({heading:e("globalGoTo.recent","Recent"),separator:s.length>0,items:a})}l.push({heading:e("globalGoTo.allPages","All Pages"),separator:s.length>0||i.length>0,items:p(f)});let N=f.length>0;return t(F,{open:m,onOpenChange:a=>a?null:r(),children:[o(R,{placeholder:e("globalGoTo.placeholder","Search pages..."),emptyMessage:N?e("globalGoTo.noResults","No results found."):e("globalGoTo.empty","No pages available."),groups:l}),o("div",{className:"dndev-command-footer",children:t("div",{className:"dndev-command-footer-shortcuts",children:[t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"\u2318K"}),o("span",{children:e("globalGoTo.shortcutOpen","Open")})]}),t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"\u2191"}),o("kbd",{className:"dndev-command-footer-key",children:"\u2193"}),o("span",{children:e("globalGoTo.shortcutNavigate","Navigate")})]}),t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"\u21B5"}),o("span",{children:e("globalGoTo.shortcutSelect","Select")})]}),t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"Esc"}),o("span",{children:e("globalGoTo.shortcutClose","Close")})]})]})})]})},L=()=>v(d=>d.isCommandDialogOpen)?o(E,{}):null,K=L;export{K as default};
@@ -0,0 +1 @@
1
+ import*as p from"lucide-react";import{isValidElement as P}from"react";import{cn as f}from"@donotdev/components";import*as b from"lucide-react";var x=b;function C(e){return typeof e=="function"||typeof e=="object"&&e!==null&&"render"in e}function y(e){let t=x[e];return C(t)?t:void 0}import{jsx as c}from"react/jsx-runtime";function E(e){if(!e)return p.Palette;let t=e.replace(/['"]/g,"");return y(t)||p.Palette}var S=({icon:e,fallback:t,className:i,ariaHidden:s=!1})=>{let o=e||t;if(!o)return null;let a="dndev-size-md";if(typeof o=="function"||typeof o=="object"&&o!==null&&"render"in o)return c(o,{className:f(a,i),style:{flexShrink:0},"aria-hidden":s});if(typeof o=="string"){if(!/^[a-zA-Z0-9_-]+$/.test(o))return c("span",{className:f(a,i),style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o});let d=E(o);return c(d,{className:f(a,i),style:{flexShrink:0},"aria-hidden":s})}return P(o)?c("span",{className:i,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o}):c("span",{className:i,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o})},$=S;import*as v from"@donotdev/auth";import{DEGRADED_AUTH_API as k}from"@donotdev/core";var m=v?.useAuth;function T(e){return k[e]}function h(e){return m?m(e):T(e)}var q=typeof m=="function",B=v?.PasswordResetCallback??(()=>null);import{useMemo as A}from"react";import{useNavigationStore as K,useTranslation as F}from"@donotdev/core";import{USER_ROLES as w}from"@donotdev/core";import{useRoutePath as _}from"@donotdev/ui/routing/hooks";function g(){let e=_(),t=h("user"),i=!!t,{t:s}=F(),o=t?.role||w.GUEST,a=K(r=>!r||typeof r.getFilteredRoutes!="function"?[]:r.getFilteredRoutes({authenticated:i,role:o}));return A(()=>Array.isArray(a)?a.map(r=>({...r,label:j(r,s),isActive:D(r.path,e),hasChildren:!1,children:void 0})).sort((r,l)=>r.label.localeCompare(l.label,void 0,{sensitivity:"base"})):[],[a,e,s])}function ne(e){let t=g();return A(()=>t.find(i=>i.path===e),[t,e])}function j(e,t){let i=e.meta?.namespace;return typeof i!="string"||i===""?e.label:t(`${i}:title`,{defaultValue:e.label})}function D(e,t){return e==="/"?t==="/":t===e?!0:t.startsWith(e+"/")}import{useCallback as V}from"react";import{useNavigationStore as u}from"@donotdev/core";import{useNavigate as U}from"@donotdev/ui/routing/hooks";var ce=()=>{let e=U(),t=g()??[],i=u(n=>n.favorites),s=u(n=>n.recent),o=u(n=>n.toggleFavorite),a=u(n=>n.isFavorite),r=u(n=>n.addRecent),l=t.length?t.filter(n=>i.includes(n.path)):[],d=t.length?t.filter(n=>s.includes(n.path)).slice(0,5):[],R=n=>{o(n)},N=n=>a(n),I=n=>{r(n)},L=V(n=>{I(n),e(n)},[e,I]);return{navigationItems:t,favoriteItems:l,recentItems:d,toggleFavorite:R,isFavorite:N,navigateToItem:L}};export{y as a,S as b,$ as c,h as d,q as e,B as f,g,ne as h,ce as i};
@@ -1 +1 @@
1
- {"version":3,"file":"AuthHeader.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AuthHeader.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAEL,cAAc,EAGd,OAAO,EACR,MAAM,sBAAsB,CAAC;AAiE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;IAC/D,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,eAAe,CAqJrD,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"AuthHeader.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AuthHeader.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAEL,cAAc,EAGd,OAAO,EACR,MAAM,sBAAsB,CAAC;AAuE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;IAC/D,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,eAAe,CAqJrD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -23,7 +23,6 @@ const NullComponent = () => null;
23
23
  function SignInButton({ display, variant = BUTTON_VARIANT.OUTLINE, signInLabel, className, style, children, ...props }) {
24
24
  return (_jsx(Button, { variant: variant, icon: User, display: display, tooltip: signInLabel, className: className, style: style, ...props, children: children ?? signInLabel }));
25
25
  }
26
- // @ts-expect-error - lazy() type doesn't account for graceful degradation fallback
27
26
  const AuthPartnerButton = lazy(async () => {
28
27
  try {
29
28
  const module = await import('@donotdev/auth');
@@ -33,7 +32,6 @@ const AuthPartnerButton = lazy(async () => {
33
32
  return { default: NullComponent };
34
33
  }
35
34
  });
36
- // @ts-expect-error - lazy() type doesn't account for graceful degradation fallback
37
35
  const MultipleAuthProviders = lazy(async () => {
38
36
  try {
39
37
  const module = await import('@donotdev/auth');
@@ -1 +1 @@
1
- {"version":3,"file":"AuthMenu.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AuthMenu.tsx"],"names":[],"mappings":"AA0EA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAML,OAAO,EACR,MAAM,sBAAsB,CAAC;AA0E9B;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IACjC,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IAEjD,sBAAsB;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAEnC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AA4BD,eAAO,MAAM,QAAQ,GAAI,iFAOtB,aAAa,6BA2Of,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"AuthMenu.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AuthMenu.tsx"],"names":[],"mappings":"AAyEA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAML,OAAO,EACR,MAAM,sBAAsB,CAAC;AAwC9B;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IACjC,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IAEjD,sBAAsB;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAEnC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AA4BD,eAAO,MAAM,QAAQ,GAAI,iFAOtB,aAAa,6BAyOf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -70,17 +70,17 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
70
70
  * @author AMBROISE PARK Consulting
71
71
  */
72
72
  import { User, LogOut, Settings, UserCheck, Trash2 } from 'lucide-react';
73
- import * as LucideIcons from 'lucide-react';
74
73
  import React, { useMemo, lazy, Suspense } from 'react';
75
74
  import { Avatar, Button, BUTTON_VARIANT, DropdownMenu, Text, DISPLAY, } from '@donotdev/components';
76
75
  import { useTranslation } from '@donotdev/core';
77
- import { getEnabledAuthPartners, useAuthConfig, isClient, } from '@donotdev/core';
76
+ import { getEnabledAuthPartners, useAuthConfig } from '@donotdev/core';
78
77
  import { useBreakpoint } from '@donotdev/core';
79
78
  import { useNavigate } from '@donotdev/ui/routing/hooks';
80
79
  import { useNavigationItems } from '../../routing';
81
80
  import { useAuthSafe, useAuthVisibility } from '../../utils';
81
+ import { useDeleteAccountSafe } from '../../utils/useDeleteAccountSafe';
82
+ import { findLucideIcon } from '../common/lucideIconByName';
82
83
  const NullComponent = () => null;
83
- // @ts-expect-error - lazy() type doesn't account for graceful degradation fallback
84
84
  const ReauthDialog = lazy(async () => {
85
85
  try {
86
86
  const module = await import('@donotdev/auth');
@@ -90,7 +90,6 @@ const ReauthDialog = lazy(async () => {
90
90
  return { default: NullComponent };
91
91
  }
92
92
  });
93
- // @ts-expect-error - lazy() type doesn't account for graceful degradation fallback
94
93
  const ConfirmDeleteDialog = lazy(async () => {
95
94
  try {
96
95
  const module = await import('@donotdev/auth');
@@ -100,39 +99,6 @@ const ConfirmDeleteDialog = lazy(async () => {
100
99
  return { default: NullComponent };
101
100
  }
102
101
  });
103
- // Graceful degradation for useDeleteAccount hook
104
- // Resolved at module level (not render level) to avoid Rules of Hooks violation.
105
- // Once set, useDeleteAccount never changes identity during the app lifecycle.
106
- let useDeleteAccount = () => {
107
- // Fallback: always call useState to maintain stable hook order
108
- const [showConfirmDialog] = React.useState(false);
109
- const [showPasswordDialog] = React.useState(false);
110
- const [isDeleting] = React.useState(false);
111
- const [error] = React.useState(null);
112
- return {
113
- showConfirmDialog,
114
- showPasswordDialog,
115
- isDeleting,
116
- error,
117
- startDeleteFlow: () => { },
118
- confirmDelete: async () => { },
119
- cancel: () => { },
120
- };
121
- };
122
- // Preload useDeleteAccount (non-blocking)
123
- // The hook reference is swapped before the first render in practice,
124
- // but if the import resolves after first render, the fallback remains
125
- // stable for that session to avoid hook order changes mid-lifecycle.
126
- if (isClient()) {
127
- import('@donotdev/auth')
128
- .then((module) => {
129
- useDeleteAccount = module.useDeleteAccount;
130
- })
131
- .catch((e) => {
132
- if (process.env.NODE_ENV === 'development')
133
- console.warn('Failed to load @donotdev/auth:', e);
134
- });
135
- }
136
102
  /**
137
103
  * Resolves Lucide icon component from string name or component reference
138
104
  *
@@ -150,7 +116,7 @@ const getIcon = (iconName) => {
150
116
  if (typeof iconName === 'function')
151
117
  return iconName;
152
118
  const cleanIconName = iconName.replace(/['"]/g, '');
153
- const resolved = LucideIcons[cleanIconName];
119
+ const resolved = findLucideIcon(cleanIconName);
154
120
  if (!resolved && process.env.NODE_ENV === 'development') {
155
121
  console.warn(`[AuthMenu] Icon name "${cleanIconName}" not found in Lucide icons, falling back to Settings.`);
156
122
  }
@@ -170,8 +136,8 @@ export const AuthMenu = ({ loginPath, display = DISPLAY.AUTO, 'no-tooltip': noTo
170
136
  const configMenuItems = authConfig.authMenuItems || [];
171
137
  // Extract role from user (declared early so getUserTooltip can reference it)
172
138
  const role = user?.role;
173
- // Account deletion flow - managed by useDeleteAccount hook
174
- const deletion = useDeleteAccount();
139
+ // Account deletion flow - managed by useDeleteAccountSafe hook
140
+ const deletion = useDeleteAccountSafe();
175
141
  /**
176
142
  * Get user display name with fallbacks
177
143
  */
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/common/icon.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUtD,oCAAoC;AACpC,MAAM,WAAW,SAAS;IACxB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;IACvD,kEAAkE;IAClE,QAAQ,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,IAAI,EAAE,aAAa,CAAC,SAAS,CAyFlC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/common/icon.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAYtD,oCAAoC;AACpC,MAAM,WAAW,SAAS;IACxB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;IACvD,kEAAkE;IAClE,QAAQ,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,IAAI,EAAE,aAAa,CAAC,SAAS,CAyFlC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
@@ -11,11 +11,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
11
11
  import * as LucideIcons from 'lucide-react';
12
12
  import { isValidElement } from 'react';
13
13
  import { cn } from '@donotdev/components';
14
+ import { findLucideIcon } from './lucideIconByName';
14
15
  function getLucideIcon(name) {
15
16
  if (!name)
16
17
  return LucideIcons.Palette;
17
18
  const cleanIconName = name.replace(/['"]/g, '');
18
- return LucideIcons[cleanIconName] || LucideIcons.Palette;
19
+ return findLucideIcon(cleanIconName) || LucideIcons.Palette;
19
20
  }
20
21
  /**
21
22
  * Icon - Unified icon component (FLEXIBLE RUNTIME COMPONENT)
@@ -0,0 +1,9 @@
1
+ import type { LucideIcon } from 'lucide-react';
2
+ /**
3
+ * Finds a Lucide icon component by its export name (e.g. `"Rocket"`).
4
+ *
5
+ * @param name - Lucide export name
6
+ * @returns The icon component, or undefined when no icon export has that name
7
+ */
8
+ export declare function findLucideIcon(name: string): LucideIcon | undefined;
9
+ //# sourceMappingURL=lucideIconByName.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lucideIconByName.d.ts","sourceRoot":"","sources":["../../../src/components/common/lucideIconByName.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAkB/C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAGnE"}
@@ -0,0 +1,32 @@
1
+ // packages/ui/src/components/common/lucideIconByName.ts
2
+ /**
3
+ * @fileoverview Runtime Lucide icon lookup by export name
4
+ * @description Typed replacement for `(LucideIcons as any)[name]`. Internal to @donotdev/ui (not re-exported).
5
+ *
6
+ * @version 0.1.0
7
+ * @since 0.2.2
8
+ * @author AMBROISE PARK Consulting
9
+ */
10
+ import * as LucideIcons from 'lucide-react';
11
+ /** The lucide-react namespace viewed as a name-indexed lookup table. */
12
+ const LUCIDE_EXPORTS = LucideIcons;
13
+ /**
14
+ * Narrows a lucide-react export to an icon component (function or forwardRef object).
15
+ *
16
+ * @param value - Any lucide-react export
17
+ * @returns True when the export is renderable as an icon component
18
+ */
19
+ function isLucideIcon(value) {
20
+ return (typeof value === 'function' ||
21
+ (typeof value === 'object' && value !== null && 'render' in value));
22
+ }
23
+ /**
24
+ * Finds a Lucide icon component by its export name (e.g. `"Rocket"`).
25
+ *
26
+ * @param name - Lucide export name
27
+ * @returns The icon component, or undefined when no icon export has that name
28
+ */
29
+ export function findLucideIcon(name) {
30
+ const candidate = LUCIDE_EXPORTS[name];
31
+ return isLucideIcon(candidate) ? candidate : undefined;
32
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"GameFlow.d.ts","sourceRoot":"","sources":["../../../src/components/layout/GameFlow.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CACjC,MAAM,EACN,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC,CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,6DAA6D;IAC7D,cAAc,EAAE,cAAc,CAAC;IAC/B,oCAAoC;IACpC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iDAAiD;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAmCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,QAAQ,CAAC,EACvB,cAAc,EACd,aAAa,EACb,UAAU,EACV,QAAe,GAChB,EAAE,aAAa,sCAgCf"}
1
+ {"version":3,"file":"GameFlow.d.ts","sourceRoot":"","sources":["../../../src/components/layout/GameFlow.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CACjC,MAAM,EAEN,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC,CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,6DAA6D;IAC7D,cAAc,EAAE,cAAc,CAAC;IAC/B,oCAAoC;IACpC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iDAAiD;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAsCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,QAAQ,CAAC,EACvB,cAAc,EACd,aAAa,EACb,UAAU,EACV,QAAe,GAChB,EAAE,aAAa,sCAgCf"}
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/components/Breadcrumbs.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAU3C,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9C;AAED,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,iCAAiC;IACjC,SAAS,CAAC,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,QAAA,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,CA+EhD,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/components/Breadcrumbs.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAU3C,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9C;AAED,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,iCAAiC;IACjC,SAAS,CAAC,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,QAAA,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAqFhD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -19,9 +19,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  import { ChevronRight } from 'lucide-react';
20
20
  import { useMemo } from 'react';
21
21
  import { cn } from '@donotdev/components';
22
- import { useTranslation } from '@donotdev/core';
22
+ import { useLayout, useTranslation } from '@donotdev/core';
23
23
  // Platform-specific hooks via conditional exports
24
- import { useLocation } from '@donotdev/ui/routing/hooks';
24
+ import { useRoutePath } from '@donotdev/ui/routing/hooks';
25
25
  import { Link } from '../../../routing/Link';
26
26
  import { useAllRoutes } from '../../../routing/useRouteDiscovery';
27
27
  /**
@@ -35,8 +35,10 @@ import { useAllRoutes } from '../../../routing/useRouteDiscovery';
35
35
  */
36
36
  const Breadcrumbs = ({ items, separator: Separator = ChevronRight, showHome = true, homeHref = '/', variant = 'default', className, }) => {
37
37
  const { t } = useTranslation('dndev');
38
- const location = useLocation();
38
+ const pathname = useRoutePath();
39
39
  const allRoutes = useAllRoutes();
40
+ // Record shown by the page (set by EntityFormRenderer / EntityDisplayRenderer)
41
+ const recordLabel = useLayout('routeRecordLabel');
40
42
  // Build set of valid route paths for existence checking
41
43
  const validRoutes = useMemo(() => {
42
44
  return new Set(allRoutes.map((route) => route.path));
@@ -45,15 +47,18 @@ const Breadcrumbs = ({ items, separator: Separator = ChevronRight, showHome = tr
45
47
  const breadcrumbItems = items
46
48
  ? items
47
49
  : (() => {
48
- const pathSegments = location.pathname.split('/').filter(Boolean);
50
+ const pathSegments = pathname.split('/').filter(Boolean);
49
51
  const breadcrumbs = [];
50
52
  let currentPath = '';
51
53
  pathSegments.forEach((segment) => {
52
54
  currentPath += `/${segment}`;
53
- const label = segment
54
- .split('-')
55
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
56
- .join(' ');
55
+ // A record id segment shows the record's name, not the raw id
56
+ const label = recordLabel && decodeURIComponent(segment) === recordLabel.id
57
+ ? recordLabel.label
58
+ : segment
59
+ .split('-')
60
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
61
+ .join(' ');
57
62
  // Only add href if route actually exists
58
63
  const href = validRoutes.has(currentPath) ? currentPath : undefined;
59
64
  breadcrumbs.push({ label, href });
@@ -69,7 +74,7 @@ const Breadcrumbs = ({ items, separator: Separator = ChevronRight, showHome = tr
69
74
  : breadcrumbItems;
70
75
  // Smart variant: Hide breadcrumbs on simple pages (root or single segment)
71
76
  if (variant === 'smart') {
72
- const segments = location.pathname.split('/').filter(Boolean);
77
+ const segments = pathname.split('/').filter(Boolean);
73
78
  if (segments.length < 2) {
74
79
  return null; // Don't render breadcrumbs on simple pages
75
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CacheSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/CacheSettings.tsx"],"names":[],"mappings":"AA0BA;;;;;;;;;GASG;AACH,iBAAS,aAAa,gCA+PrB;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"CacheSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/CacheSettings.tsx"],"names":[],"mappings":"AAqDA;;;;;;;;;GASG;AACH,iBAAS,aAAa,gCAgQrB;AAED,eAAe,aAAa,CAAC"}
@@ -15,6 +15,7 @@ import { Button, BUTTON_VARIANT, Checkbox, Stack, useToast, } from '@donotdev/co
15
15
  import { useTranslation } from '@donotdev/core';
16
16
  // Platform-specific hooks via conditional exports
17
17
  import { useRefresh } from '@donotdev/ui/routing/hooks';
18
+ const legacyGlobals = globalThis;
18
19
  /**
19
20
  * CacheSettings - Cache settings component for clearing various caches
20
21
  *
@@ -91,9 +92,10 @@ function CacheSettings() {
91
92
  }
92
93
  if (cacheOptions.webSQL &&
93
94
  typeof window !== 'undefined' &&
94
- 'openDatabase' in window) {
95
+ 'openDatabase' in window &&
96
+ typeof legacyGlobals.openDatabase === 'function') {
95
97
  try {
96
- const db = globalThis.openDatabase('', '', '', '');
98
+ const db = legacyGlobals.openDatabase('', '', '', '');
97
99
  if (db && db.transaction) {
98
100
  db.transaction((tx) => {
99
101
  tx.executeSql('SELECT name FROM sqlite_master WHERE type="table"', [], (tx, results) => {
@@ -171,8 +173,8 @@ function CacheSettings() {
171
173
  if (cacheOptions.memoryCache) {
172
174
  try {
173
175
  // Force garbage collection if available (Chrome DevTools)
174
- if ('gc' in window && typeof globalThis.gc === 'function') {
175
- globalThis.gc();
176
+ if ('gc' in window && typeof legacyGlobals.gc === 'function') {
177
+ legacyGlobals.gc();
176
178
  }
177
179
  clearedItems.push('Memory Cache');
178
180
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/SettingsMenu.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,sBAAsB,CAAC;AAYhF,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;;;;GAMG;AACH,iBAAS,YAAY,CAAC,EACpB,OAAgC,GACjC,GAAE,iBAAsB,+BA+FxB;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"SettingsMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/SettingsMenu.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,sBAAsB,CAAC;AAahF,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;;;;GAMG;AACH,iBAAS,YAAY,CAAC,EACpB,OAAgC,GACjC,GAAE,iBAAsB,+BA+FxB;AAED,eAAe,YAAY,CAAC"}
@@ -14,6 +14,7 @@ import { Button, BUTTON_VARIANT, DropdownMenu, Stack, DISPLAY, } from '@donotdev
14
14
  import { useTranslation } from '@donotdev/core';
15
15
  import { useLanguageSelector, useTheme, Flag, } from '@donotdev/core';
16
16
  import CacheSettings from './CacheSettings';
17
+ import { findLucideIcon } from '../../../common/lucideIconByName';
17
18
  import { AuthHeader } from '../../../auth/AuthHeader';
18
19
  /**
19
20
  * SettingsMenu with fixed hooks order and error protection
@@ -32,7 +33,7 @@ function SettingsMenu({ variant = BUTTON_VARIANT.OUTLINE, } = {}) {
32
33
  if (!iconName)
33
34
  return LucideIcons.Palette;
34
35
  const cleanIconName = iconName.replace(/['"]/g, '');
35
- return LucideIcons[cleanIconName] || LucideIcons.Palette;
36
+ return findLucideIcon(cleanIconName) || LucideIcons.Palette;
36
37
  };
37
38
  const themeItems = availableThemes.map((themeInfo) => {
38
39
  const Icon = getIcon(themeInfo.meta?.icon);
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeToggle.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/ThemeToggle.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAEtD,OAAO,EAIL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAM9B,UAAU,gBAAgB;IACxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAUD;;;;;;;;;GASG;AACH,QAAA,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,CA8FhD,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"ThemeToggle.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/ThemeToggle.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAEtD,OAAO,EAIL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAQ9B,UAAU,gBAAgB;IACxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAUD;;;;;;;;;GASG;AACH,QAAA,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,CA8FhD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -13,11 +13,12 @@ import * as LucideIcons from 'lucide-react';
13
13
  import { Button, BUTTON_VARIANT, DropdownMenu, DISPLAY, } from '@donotdev/components';
14
14
  import { useTranslation } from '@donotdev/core';
15
15
  import { useTheme } from '@donotdev/core';
16
+ import { findLucideIcon } from '../../../common/lucideIconByName';
16
17
  const getIcon = (iconName) => {
17
18
  if (!iconName)
18
19
  return LucideIcons.Palette;
19
20
  const cleanIconName = iconName.replace(/['"]/g, '');
20
- return LucideIcons[cleanIconName] || LucideIcons.Palette;
21
+ return findLucideIcon(cleanIconName) || LucideIcons.Palette;
21
22
  };
22
23
  /**
23
24
  * ThemeToggle - Theme switching component
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * @fileoverview UI CrudCard wrapper
3
- * @description Thin wrapper around @donotdev/crud CrudCard that adds Link routing.
4
- * CrudCard (crud) is platform-agnostic; this wrapper adds web navigation via Link.
5
- *
6
- * @version 0.1.0
3
+ * @description Thin wrapper around @donotdev/crud CrudCard for web navigation.
4
+ * detailHref becomes the card's `href`: a real `<a href>` rendered through the app
5
+ * router's link (registered by UIProviders), with controls kept outside the link.
6
+ * @version 0.2.0
7
7
  * @since 0.0.1
8
8
  * @author AMBROISE PARK Consulting
9
9
  */
10
10
  import type { CrudCardProps } from '@donotdev/core';
11
11
  /**
12
- * CrudCard with Link wrapping for web navigation.
13
- * When detailHref is provided, wraps the card in a Link for a11y/SEO.
12
+ * CrudCard with link navigation.
13
+ * When detailHref is provided, the card links to it (crawlable, client-side navigation).
14
14
  */
15
15
  export declare function CrudCard({ detailHref, onClick, ...rest }: CrudCardProps & {
16
16
  detailHref?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CrudCardLink.d.ts","sourceRoot":"","sources":["../../../src/crud/components/CrudCardLink.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQpD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EACvB,UAAU,EACV,OAAO,EACP,GAAG,IAAI,EACR,EAAE,aAAa,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,sCAsBzC;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"CrudCardLink.d.ts","sourceRoot":"","sources":["../../../src/crud/components/CrudCardLink.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAOpD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EACvB,UAAU,EACV,OAAO,EACP,GAAG,IAAI,EACR,EAAE,aAAa,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,sCAUzC;AAED,eAAe,QAAQ,CAAC"}
@@ -1,20 +1,14 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Link } from '../../routing';
4
3
  import { isCrudModuleAvailable, CrudCard as BaseCrudCard, } from '../crudImports';
5
4
  /**
6
- * CrudCard with Link wrapping for web navigation.
7
- * When detailHref is provided, wraps the card in a Link for a11y/SEO.
5
+ * CrudCard with link navigation.
6
+ * When detailHref is provided, the card links to it (crawlable, client-side navigation).
8
7
  */
9
8
  export function CrudCard({ detailHref, onClick, ...rest }) {
10
9
  // Safe guard: isCrudModuleAvailable is a module-level constant (immutable after load).
11
10
  if (!isCrudModuleAvailable)
12
11
  return null;
13
- // When detailHref is set, Link handles navigation — don't pass onClick to inner card
14
- const card = (_jsx(BaseCrudCard, { ...rest, onClick: detailHref ? undefined : onClick }));
15
- if (detailHref) {
16
- return (_jsx(Link, { path: detailHref, "aria-label": rest.item?.id ? `View ${rest.item.id}` : undefined, children: card }));
17
- }
18
- return card;
12
+ return detailHref ? (_jsx(BaseCrudCard, { ...rest, href: detailHref })) : (_jsx(BaseCrudCard, { ...rest, onClick: onClick }));
19
13
  }
20
14
  export default CrudCard;
@@ -1 +1 @@
1
- {"version":3,"file":"EntityCardList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityCardList.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,mBAAmB,EAAgB,MAAM,gBAAgB,CAAC;AAYxE,YAAY,EAAE,mBAAmB,EAAE,CAAC;AA0GpC;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,OAAO,EACP,IAAmB,EACnB,SAA0B,EAAE,2BAA2B;AACvD,YAAY,EACZ,MAAM,EACN,WAAmB,EACnB,WAAW,EACX,IAAI,EACJ,iBAAiB,EACjB,UAAU,EACV,WAAmB,EACnB,WAAW,EACX,OAAO,GACR,EAAE,mBAAmB,sCA4OrB"}
1
+ {"version":3,"file":"EntityCardList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityCardList.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,mBAAmB,EAAgB,MAAM,gBAAgB,CAAC;AAYxE,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAwGpC;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,OAAO,EACP,IAAmB,EACnB,SAA0B,EAAE,2BAA2B;AACvD,YAAY,EACZ,MAAM,EACN,WAAmB,EACnB,WAAW,EACX,IAAI,EACJ,iBAAiB,EACjB,UAAU,EACV,WAAmB,EACnB,WAAW,EACX,OAAO,GACR,EAAE,mBAAmB,sCAsOrB"}
@@ -63,9 +63,7 @@ const BREAKPOINT_INDEX = {
63
63
  function CardListSkeleton({ cols, entity, }) {
64
64
  const slots = resolveSkeletonSlots(entity);
65
65
  const bp = useBreakpoint('current');
66
- const currentCols = (Array.isArray(cols)
67
- ? cols[BREAKPOINT_INDEX[bp] ?? 3]
68
- : cols) ?? 1;
66
+ const currentCols = (Array.isArray(cols) ? cols[BREAKPOINT_INDEX[bp] ?? 3] : cols) ?? 1;
69
67
  const count = currentCols * 3;
70
68
  const isImage = (name) => {
71
69
  const type = entity.fields[name]?.type;
@@ -163,15 +161,9 @@ queryOptions, filter, hideFilters = false, resultLabel, tone, renderCardOverlay,
163
161
  defaultValue: data.length === 1
164
162
  ? 'Found 1 occurrence'
165
163
  : `Found ${data.length} occurrences`,
166
- }), collapsible: collapsible, defaultOpen: collapsible ? true : undefined, tone: tone, children: loading ? (_jsx(CardListSkeleton, { cols: cols, entity: entity })) : fetchError ? (_jsxs(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-3xl)', textAlign: 'center' }, children: [_jsx(Text, { level: "h3", style: { color: 'var(--destructive)' }, children: tCrud('errors.fetchFailed', {
167
- defaultValue: `Failed to load ${entity.name.toLowerCase()}`,
168
- }) }), _jsx(Text, { level: "small", style: { color: 'var(--destructive)' }, children: fetchError instanceof Error
164
+ }), collapsible: collapsible, defaultOpen: collapsible ? true : undefined, tone: tone, children: loading ? (_jsx(CardListSkeleton, { cols: cols, entity: entity })) : fetchError ? (_jsxs(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-3xl)', textAlign: 'center' }, children: [_jsx(Text, { level: "h3", style: { color: 'var(--destructive)' }, children: tCrud('errors.fetchFailed', { entity: entityName }) }), _jsx(Text, { level: "small", style: { color: 'var(--destructive)' }, children: fetchError instanceof Error
169
165
  ? fetchError.message
170
- : String(fetchError) })] })) : data.length === 0 ? (_jsxs(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-3xl)', textAlign: 'center' }, children: [_jsx(Text, { level: "h3", style: { color: 'var(--muted-foreground)' }, children: tCrud('emptyState.title', {
171
- defaultValue: `No ${entity.name.toLowerCase()} found`,
172
- }) }), _jsx(Text, { style: { color: 'var(--muted-foreground)' }, children: tCrud('emptyState.description', {
173
- defaultValue: `No ${entity.name.toLowerCase()} available at this time.`,
174
- }) })] })) : (_jsx(Grid, { cols: cols, children: data.map((item) => {
166
+ : String(fetchError) })] })) : data.length === 0 ? (_jsxs(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-3xl)', textAlign: 'center' }, children: [_jsx(Text, { level: "h3", style: { color: 'var(--muted-foreground)' }, children: tCrud('emptyState.title') }), _jsx(Text, { style: { color: 'var(--muted-foreground)' }, children: tCrud('emptyState.description') })] })) : (_jsx(Grid, { cols: cols, children: data.map((item) => {
175
167
  const itemIsFavorite = isFavorite(item.id);
176
168
  const detailHref = isPreview || onClick ? undefined : `${base}/${item.id}`;
177
169
  return (_jsx(CrudCard, { item: item, entity: entity, detailHref: detailHref, onClick: isPreview
@@ -1 +1 @@
1
- {"version":3,"file":"EntityDisplayRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityDisplayRenderer.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAS/E,YAAY,EAAE,0BAA0B,EAAE,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,EAC3E,MAAM,EACN,EAAE,EACF,CAAC,EACD,SAAc,EACd,cAAc,EACd,eAAe,EACf,UAAU,EAAE,cAAc,EAC1B,aAAa,EACb,OAAO,GACR,EAAE,0BAA0B,CAAC,CAAC,CAAC,sCA+J/B;AAED,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"EntityDisplayRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityDisplayRenderer.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAU/E,YAAY,EAAE,0BAA0B,EAAE,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,EAC3E,MAAM,EACN,EAAE,EACF,CAAC,EACD,SAAc,EACd,cAAc,EACd,eAAe,EACf,UAAU,EAAE,cAAc,EAC1B,aAAa,EACb,OAAO,GACR,EAAE,0BAA0B,CAAC,CAAC,CAAC,sCAoK/B;AAED,eAAe,qBAAqB,CAAC"}
@@ -15,6 +15,7 @@ import { Stack, Spinner } from '@donotdev/components';
15
15
  import { useTranslation, isFieldVisible } from '@donotdev/core';
16
16
  import { useAuthSafe } from '../../utils/useAuthSafe';
17
17
  import { isCrudModuleAvailable, useCrudDoc, DisplayFieldRenderer, } from '../crudImports';
18
+ import { useRecordBreadcrumb } from './useRecordBreadcrumb';
18
19
  /**
19
20
  * EntityDisplayRenderer - Automatically fetches and displays entity data
20
21
  *
@@ -47,6 +48,8 @@ export function EntityDisplayRenderer({ entity, id, t, className = '', loadingMe
47
48
  const translate = t || tDual;
48
49
  // Preview: design-time showcase data, no read
49
50
  const displayData = isPreview ? preview : fetchedData;
51
+ // Breadcrumb shows the record's name instead of its id
52
+ useRecordBreadcrumb(entity, isPreview ? null : displayData);
50
53
  const displayError = isPreview ? null : error;
51
54
  const isLoading = isPreview ? false : loading || !id;
52
55
  // Filter fields: respect visibility AND skip empty values
@@ -111,7 +114,7 @@ export function EntityDisplayRenderer({ entity, id, t, className = '', loadingMe
111
114
  textAlign: 'center',
112
115
  }, className: className, children: _jsxs(Stack, { direction: "column", gap: "tight", children: [_jsx("h3", { style: { color: 'var(--muted-foreground)' }, children: notFoundMessage ||
113
116
  tCrud('errors.notFound', {
114
- defaultValue: `${entity.name} not found`,
117
+ entity: tDual('name', { defaultValue: entity.name }),
115
118
  }) }), displayError && (_jsx("p", { style: {
116
119
  color: 'var(--destructive)',
117
120
  fontSize: 'var(--font-size-sm)',
@@ -1 +1 @@
1
- {"version":3,"file":"EntityFormRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityFormRenderer.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EACV,uBAAuB,EACvB,YAAY,EAEb,MAAM,gBAAgB,CAAC;AAexB,YAAY,EAAE,uBAAuB,EAAE,CAAC;AA6BxC;;;;;;;;;;;;GAYG;AACH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EACtE,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,+BAIlC;AAoeD,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"EntityFormRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityFormRenderer.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EACV,uBAAuB,EACvB,YAAY,EAEb,MAAM,gBAAgB,CAAC;AAiBxB,YAAY,EAAE,uBAAuB,EAAE,CAAC;AA6BxC;;;;;;;;;;;;GAYG;AACH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EACtE,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,+BAIlC;AAggBD,eAAe,kBAAkB,CAAC"}
@@ -10,13 +10,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  * @since 0.0.1
11
11
  * @author AMBROISE PARK Consulting
12
12
  */
13
- import { useEffect, useId, useMemo, useState } from 'react';
13
+ import { useEffect, useId, useMemo, useRef, useState, } from 'react';
14
14
  import { FormProvider, useWatch } from 'react-hook-form';
15
15
  import { Badge, Button, DropdownMenu, Grid, Stack, Spinner, } from '@donotdev/components';
16
16
  import { hasRoleAccess, useTranslation } from '@donotdev/core';
17
17
  import { useNavigate } from '../../routing';
18
18
  import { useAuthSafe } from '../../utils/useAuthSafe';
19
19
  import { isCrudModuleAvailable, DisplayFieldRenderer, FormFieldRenderer, UploadProvider, useEntityForm, useFormStore, useFieldConditions, } from '../crudImports';
20
+ import { referencePrefillFromQuery } from './entityParent';
21
+ import { useRecordBreadcrumb } from './useRecordBreadcrumb';
20
22
  /**
21
23
  * Read-only field inside a form.
22
24
  *
@@ -72,8 +74,9 @@ function EntityFormRendererCore({ entity, onSubmit, t, className = '', submitTex
72
74
  // Visibility badges (developer-facing) are for admins/super only
73
75
  const isAdminOrSuper = viewerRole === 'admin' || viewerRole === 'super';
74
76
  const showVisibilityBadges = !hideVisibilityInfo && isAdminOrSuper;
75
- // Preview dropdown (View As) is available for user/admin/super
76
- const canPreviewRole = viewerRole === 'user' || viewerRole === 'admin' || viewerRole === 'super';
77
+ // Preview dropdown (View As) is available for user/admin/super, hidden with the badges
78
+ const canPreviewRole = !hideVisibilityInfo &&
79
+ (viewerRole === 'user' || viewerRole === 'admin' || viewerRole === 'super');
77
80
  // Preview role state for View As toggle
78
81
  const [previewRole, setPreviewRole] = useState(viewerRole === 'admin' || viewerRole === 'super' || viewerRole === 'user'
79
82
  ? viewerRole
@@ -105,6 +108,10 @@ function EntityFormRendererCore({ entity, onSubmit, t, className = '', submitTex
105
108
  checked: previewRole === role,
106
109
  onClick: () => setPreviewRole(role),
107
110
  })), [previewRole, viewerRole]);
111
+ // Breadcrumb shows the edited record's name instead of its id
112
+ useRecordBreadcrumb(entity, operation === 'edit'
113
+ ? defaultValues
114
+ : undefined);
108
115
  // useEntityForm handles all orchestration
109
116
  const form = useEntityForm(entity, {
110
117
  formId,
@@ -114,8 +121,21 @@ function EntityFormRendererCore({ entity, onSubmit, t, className = '', submitTex
114
121
  t: translate,
115
122
  loading,
116
123
  });
117
- const { control, handleSubmit, fields: rawFields, formStatus, uploadProgress, isDirty, hasUserInteracted, resetForm, } = form;
124
+ const { control, setValue, handleSubmit, fields: rawFields, formStatus, uploadProgress, isDirty, hasUserInteracted, resetForm, } = form;
118
125
  const isDirtyForBlocking = isDirty && hasUserInteracted;
126
+ // Create: prefill reference fields named in the URL (`?brandId=…`, from a nested
127
+ // EntityList's add button). After mount, client-only (no Suspense / hydration
128
+ // impact on SSR pages); runs after draft restore, so the URL parent wins.
129
+ const prefilled = useRef(false);
130
+ useEffect(() => {
131
+ if (operation !== 'create' || prefilled.current)
132
+ return;
133
+ prefilled.current = true;
134
+ const prefill = referencePrefillFromQuery(entity, new URLSearchParams(window.location.search), viewerRole);
135
+ for (const [field, value] of Object.entries(prefill)) {
136
+ setValue(field, value);
137
+ }
138
+ }, [operation, entity, viewerRole, setValue]);
119
139
  // Filter fields based on previewRole when visibility info is shown
120
140
  const renderableFields = useMemo(() => {
121
141
  if (!canPreviewRole)
@@ -268,7 +288,9 @@ function EntityFormRendererCore({ entity, onSubmit, t, className = '', submitTex
268
288
  const badgeLabel = roleLabels[config.visibility] ??
269
289
  config.visibility;
270
290
  // Wrap field with visibility badge when enabled
271
- const fieldElement = !effectiveEditable ? (_jsx(FormDisplayField, { name: name, config: effectiveConfig, control: control, t: translate }, name)) : (_jsx(FormFieldRenderer, { name: name, config: effectiveConfig, control: control, t: translate }, name));
291
+ const fieldElement = !effectiveEditable ? (_jsx(FormDisplayField, { name: name, config: effectiveConfig,
292
+ // why: RHF Control<T> is invariant in T; FormDisplayField reads by string name, so it takes the erased Control<FieldValues>
293
+ control: control, t: translate }, name)) : (_jsx(FormFieldRenderer, { name: name, config: effectiveConfig, control: control, t: translate }, name));
272
294
  // If no badge needed, return field directly
273
295
  if (!showBadge)
274
296
  return fieldElement;
@@ -4,11 +4,11 @@ export type { EntityListProps };
4
4
  * Entity List Component - Table view for admin/internal operations
5
5
  *
6
6
  * Features:
7
- * - Filters section (collapsible) with actions and filter inputs
8
- * - Results section (collapsible) with DataTable
7
+ * - Filters section (collapsible): closed unless filters are active (e.g. from the URL)
8
+ * - Results section with the search / refresh / add toolbar and the DataTable
9
9
  * - Excel-like table display with formatted values
10
- * - Edit and Delete actions (admin only)
10
+ * - Open-link icon per row, bulk select, bulk delete of the checked rows
11
11
  * - Auto-routing when handlers not provided
12
12
  */
13
- export declare function EntityList({ entity, basePath, onClick, hideFilters, pagination, pageSize: pageSizeProp, queryOptions, exportable, preview, tone, }: EntityListProps): import("react").JSX.Element | null;
13
+ export declare function EntityList({ entity, basePath, onClick, hideFilters, pagination, pageSize: pageSizeProp, queryOptions, exportable, editable, parent, preview, tone, }: EntityListProps): import("react").JSX.Element | null;
14
14
  //# sourceMappingURL=EntityList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntityList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityList.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAetD,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,OAAO,EACP,WAAmB,EACnB,UAAmB,EACnB,QAAQ,EAAE,YAAY,EACtB,YAAY,EACZ,UAAiB,EACjB,OAAO,EACP,IAAI,GACL,EAAE,eAAe,sCAqTjB"}
1
+ {"version":3,"file":"EntityList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityList.tsx"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAmBtD,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,OAAO,EACP,WAAmB,EACnB,UAAmB,EACnB,QAAQ,EAAE,YAAY,EACtB,YAAY,EACZ,UAAiB,EACjB,QAAe,EACf,MAAM,EACN,OAAO,EACP,IAAI,GACL,EAAE,eAAe,sCA2YjB"}