@donotdev/ui 0.1.1 → 0.1.43

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 (288) hide show
  1. package/LICENSE.md +21 -242
  2. package/README.md +1 -19
  3. package/assets/apple-touch-icon.png +0 -0
  4. package/assets/favicon.ico +0 -0
  5. package/assets/fonts/Inter-latin-ext.woff2 +0 -0
  6. package/assets/fonts/Inter-latin.woff2 +0 -0
  7. package/assets/fonts/PlayfairDisplay-latin-ext.woff2 +0 -0
  8. package/assets/fonts/PlayfairDisplay-latin.woff2 +0 -0
  9. package/assets/fonts/Roboto-400-cyrillic-ext.woff2 +0 -0
  10. package/assets/fonts/Roboto-400-cyrillic.woff2 +0 -0
  11. package/assets/fonts/Roboto-400-greek-ext.woff2 +0 -0
  12. package/assets/fonts/Roboto-400-greek.woff2 +0 -0
  13. package/assets/fonts/Roboto-400-latin-ext.woff2 +0 -0
  14. package/assets/fonts/Roboto-400-latin.woff2 +0 -0
  15. package/assets/fonts/Roboto-400-vietnamese.woff2 +0 -0
  16. package/assets/fonts/Roboto-700-cyrillic-ext.woff2 +0 -0
  17. package/assets/fonts/Roboto-700-cyrillic.woff2 +0 -0
  18. package/assets/fonts/Roboto-700-greek-ext.woff2 +0 -0
  19. package/assets/fonts/Roboto-700-greek.woff2 +0 -0
  20. package/assets/fonts/Roboto-700-latin-ext.woff2 +0 -0
  21. package/assets/fonts/Roboto-700-latin.woff2 +0 -0
  22. package/assets/fonts/Roboto-700-vietnamese.woff2 +0 -0
  23. package/assets/icon-192x192.png +0 -0
  24. package/assets/icon-512x512.png +0 -0
  25. package/assets/logo.png +0 -0
  26. package/assets/logo.svg +1 -1
  27. package/assets/manifest.json +0 -0
  28. package/dist/CookieConsent-5NH5DNTP.js +1 -0
  29. package/dist/{GoToDialog-RU5RP7S2.js → GoToDialog-CICRYHHG.js} +1 -1
  30. package/dist/chunk-MIPTBUWY.js +1 -0
  31. package/dist/components/common/FeatureCard.d.ts +9 -6
  32. package/dist/components/common/FeatureCard.d.ts.map +1 -1
  33. package/dist/components/common/FeatureCard.js +43 -32
  34. package/dist/components/cookie-consent/CookieConsent.d.ts +3 -3
  35. package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
  36. package/dist/components/cookie-consent/CookieConsent.js +36 -35
  37. package/dist/components/index.d.ts +0 -1
  38. package/dist/components/index.d.ts.map +1 -1
  39. package/dist/components/index.js +0 -1
  40. package/dist/components/layout/components/header/CacheSettings.d.ts.map +1 -1
  41. package/dist/components/layout/components/header/CacheSettings.js +6 -2
  42. package/dist/crud/components/EntityCardList.d.ts.map +1 -1
  43. package/dist/crud/components/EntityCardList.js +17 -4
  44. package/dist/crud/components/EntityDisplayRenderer.js +4 -4
  45. package/dist/crud/components/EntityFormRenderer.d.ts +6 -1
  46. package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
  47. package/dist/crud/components/EntityFormRenderer.js +31 -21
  48. package/dist/crud/components/EntityList.d.ts.map +1 -1
  49. package/dist/crud/components/EntityList.js +56 -72
  50. package/dist/crud/components/EntityRecommendations.d.ts.map +1 -1
  51. package/dist/crud/components/EntityWorkflow.d.ts.map +1 -1
  52. package/dist/crud/components/EntityWorkflow.js +1 -1
  53. package/dist/crud/crudImports.d.ts +0 -1
  54. package/dist/crud/crudImports.d.ts.map +1 -1
  55. package/dist/crud/crudImports.js +0 -1
  56. package/dist/dndev-next.css +659 -107
  57. package/dist/dndev.css +794 -113
  58. package/dist/files/inter-cyrillic-300-normal.woff +0 -0
  59. package/dist/files/inter-cyrillic-300-normal.woff2 +0 -0
  60. package/dist/files/inter-cyrillic-400-normal.woff +0 -0
  61. package/dist/files/inter-cyrillic-400-normal.woff2 +0 -0
  62. package/dist/files/inter-cyrillic-600-normal.woff +0 -0
  63. package/dist/files/inter-cyrillic-600-normal.woff2 +0 -0
  64. package/dist/files/inter-cyrillic-700-normal.woff +0 -0
  65. package/dist/files/inter-cyrillic-700-normal.woff2 +0 -0
  66. package/dist/files/inter-cyrillic-ext-300-normal.woff +0 -0
  67. package/dist/files/inter-cyrillic-ext-300-normal.woff2 +0 -0
  68. package/dist/files/inter-cyrillic-ext-400-normal.woff +0 -0
  69. package/dist/files/inter-cyrillic-ext-400-normal.woff2 +0 -0
  70. package/dist/files/inter-cyrillic-ext-600-normal.woff +0 -0
  71. package/dist/files/inter-cyrillic-ext-600-normal.woff2 +0 -0
  72. package/dist/files/inter-cyrillic-ext-700-normal.woff +0 -0
  73. package/dist/files/inter-cyrillic-ext-700-normal.woff2 +0 -0
  74. package/dist/files/inter-greek-300-normal.woff +0 -0
  75. package/dist/files/inter-greek-300-normal.woff2 +0 -0
  76. package/dist/files/inter-greek-400-normal.woff +0 -0
  77. package/dist/files/inter-greek-400-normal.woff2 +0 -0
  78. package/dist/files/inter-greek-600-normal.woff +0 -0
  79. package/dist/files/inter-greek-600-normal.woff2 +0 -0
  80. package/dist/files/inter-greek-700-normal.woff +0 -0
  81. package/dist/files/inter-greek-700-normal.woff2 +0 -0
  82. package/dist/files/inter-greek-ext-300-normal.woff +0 -0
  83. package/dist/files/inter-greek-ext-300-normal.woff2 +0 -0
  84. package/dist/files/inter-greek-ext-400-normal.woff +0 -0
  85. package/dist/files/inter-greek-ext-400-normal.woff2 +0 -0
  86. package/dist/files/inter-greek-ext-600-normal.woff +0 -0
  87. package/dist/files/inter-greek-ext-600-normal.woff2 +0 -0
  88. package/dist/files/inter-greek-ext-700-normal.woff +0 -0
  89. package/dist/files/inter-greek-ext-700-normal.woff2 +0 -0
  90. package/dist/files/inter-latin-300-normal.woff +0 -0
  91. package/dist/files/inter-latin-300-normal.woff2 +0 -0
  92. package/dist/files/inter-latin-400-normal.woff +0 -0
  93. package/dist/files/inter-latin-400-normal.woff2 +0 -0
  94. package/dist/files/inter-latin-600-normal.woff +0 -0
  95. package/dist/files/inter-latin-600-normal.woff2 +0 -0
  96. package/dist/files/inter-latin-700-normal.woff +0 -0
  97. package/dist/files/inter-latin-700-normal.woff2 +0 -0
  98. package/dist/files/inter-latin-ext-300-normal.woff +0 -0
  99. package/dist/files/inter-latin-ext-300-normal.woff2 +0 -0
  100. package/dist/files/inter-latin-ext-400-normal.woff +0 -0
  101. package/dist/files/inter-latin-ext-400-normal.woff2 +0 -0
  102. package/dist/files/inter-latin-ext-600-normal.woff +0 -0
  103. package/dist/files/inter-latin-ext-600-normal.woff2 +0 -0
  104. package/dist/files/inter-latin-ext-700-normal.woff +0 -0
  105. package/dist/files/inter-latin-ext-700-normal.woff2 +0 -0
  106. package/dist/files/inter-vietnamese-300-normal.woff +0 -0
  107. package/dist/files/inter-vietnamese-300-normal.woff2 +0 -0
  108. package/dist/files/inter-vietnamese-400-normal.woff +0 -0
  109. package/dist/files/inter-vietnamese-400-normal.woff2 +0 -0
  110. package/dist/files/inter-vietnamese-600-normal.woff +0 -0
  111. package/dist/files/inter-vietnamese-600-normal.woff2 +0 -0
  112. package/dist/files/inter-vietnamese-700-normal.woff +0 -0
  113. package/dist/files/inter-vietnamese-700-normal.woff2 +0 -0
  114. package/dist/files/playfair-display-cyrillic-400-normal.woff +0 -0
  115. package/dist/files/playfair-display-cyrillic-400-normal.woff2 +0 -0
  116. package/dist/files/playfair-display-cyrillic-500-normal.woff +0 -0
  117. package/dist/files/playfair-display-cyrillic-500-normal.woff2 +0 -0
  118. package/dist/files/playfair-display-cyrillic-600-normal.woff +0 -0
  119. package/dist/files/playfair-display-cyrillic-600-normal.woff2 +0 -0
  120. package/dist/files/playfair-display-cyrillic-700-normal.woff +0 -0
  121. package/dist/files/playfair-display-cyrillic-700-normal.woff2 +0 -0
  122. package/dist/files/playfair-display-latin-400-normal.woff +0 -0
  123. package/dist/files/playfair-display-latin-400-normal.woff2 +0 -0
  124. package/dist/files/playfair-display-latin-500-normal.woff +0 -0
  125. package/dist/files/playfair-display-latin-500-normal.woff2 +0 -0
  126. package/dist/files/playfair-display-latin-600-normal.woff +0 -0
  127. package/dist/files/playfair-display-latin-600-normal.woff2 +0 -0
  128. package/dist/files/playfair-display-latin-700-normal.woff +0 -0
  129. package/dist/files/playfair-display-latin-700-normal.woff2 +0 -0
  130. package/dist/files/playfair-display-latin-ext-400-normal.woff +0 -0
  131. package/dist/files/playfair-display-latin-ext-400-normal.woff2 +0 -0
  132. package/dist/files/playfair-display-latin-ext-500-normal.woff +0 -0
  133. package/dist/files/playfair-display-latin-ext-500-normal.woff2 +0 -0
  134. package/dist/files/playfair-display-latin-ext-600-normal.woff +0 -0
  135. package/dist/files/playfair-display-latin-ext-600-normal.woff2 +0 -0
  136. package/dist/files/playfair-display-latin-ext-700-normal.woff +0 -0
  137. package/dist/files/playfair-display-latin-ext-700-normal.woff2 +0 -0
  138. package/dist/files/playfair-display-vietnamese-400-normal.woff +0 -0
  139. package/dist/files/playfair-display-vietnamese-400-normal.woff2 +0 -0
  140. package/dist/files/playfair-display-vietnamese-500-normal.woff +0 -0
  141. package/dist/files/playfair-display-vietnamese-500-normal.woff2 +0 -0
  142. package/dist/files/playfair-display-vietnamese-600-normal.woff +0 -0
  143. package/dist/files/playfair-display-vietnamese-600-normal.woff2 +0 -0
  144. package/dist/files/playfair-display-vietnamese-700-normal.woff +0 -0
  145. package/dist/files/playfair-display-vietnamese-700-normal.woff2 +0 -0
  146. package/dist/files/press-start-2p-cyrillic-400-normal.woff +0 -0
  147. package/dist/files/press-start-2p-cyrillic-400-normal.woff2 +0 -0
  148. package/dist/files/press-start-2p-cyrillic-ext-400-normal.woff +0 -0
  149. package/dist/files/press-start-2p-cyrillic-ext-400-normal.woff2 +0 -0
  150. package/dist/files/press-start-2p-greek-400-normal.woff +0 -0
  151. package/dist/files/press-start-2p-greek-400-normal.woff2 +0 -0
  152. package/dist/files/press-start-2p-latin-400-normal.woff +0 -0
  153. package/dist/files/press-start-2p-latin-400-normal.woff2 +0 -0
  154. package/dist/files/press-start-2p-latin-ext-400-normal.woff +0 -0
  155. package/dist/files/press-start-2p-latin-ext-400-normal.woff2 +0 -0
  156. package/dist/files/roboto-cyrillic-400-normal.woff +0 -0
  157. package/dist/files/roboto-cyrillic-400-normal.woff2 +0 -0
  158. package/dist/files/roboto-cyrillic-700-normal.woff +0 -0
  159. package/dist/files/roboto-cyrillic-700-normal.woff2 +0 -0
  160. package/dist/files/roboto-cyrillic-ext-400-normal.woff +0 -0
  161. package/dist/files/roboto-cyrillic-ext-400-normal.woff2 +0 -0
  162. package/dist/files/roboto-cyrillic-ext-700-normal.woff +0 -0
  163. package/dist/files/roboto-cyrillic-ext-700-normal.woff2 +0 -0
  164. package/dist/files/roboto-greek-400-normal.woff +0 -0
  165. package/dist/files/roboto-greek-400-normal.woff2 +0 -0
  166. package/dist/files/roboto-greek-700-normal.woff +0 -0
  167. package/dist/files/roboto-greek-700-normal.woff2 +0 -0
  168. package/dist/files/roboto-greek-ext-400-normal.woff +0 -0
  169. package/dist/files/roboto-greek-ext-400-normal.woff2 +0 -0
  170. package/dist/files/roboto-greek-ext-700-normal.woff +0 -0
  171. package/dist/files/roboto-greek-ext-700-normal.woff2 +0 -0
  172. package/dist/files/roboto-latin-400-normal.woff +0 -0
  173. package/dist/files/roboto-latin-400-normal.woff2 +0 -0
  174. package/dist/files/roboto-latin-700-normal.woff +0 -0
  175. package/dist/files/roboto-latin-700-normal.woff2 +0 -0
  176. package/dist/files/roboto-latin-ext-400-normal.woff +0 -0
  177. package/dist/files/roboto-latin-ext-400-normal.woff2 +0 -0
  178. package/dist/files/roboto-latin-ext-700-normal.woff +0 -0
  179. package/dist/files/roboto-latin-ext-700-normal.woff2 +0 -0
  180. package/dist/files/roboto-math-400-normal.woff +0 -0
  181. package/dist/files/roboto-math-400-normal.woff2 +0 -0
  182. package/dist/files/roboto-math-700-normal.woff +0 -0
  183. package/dist/files/roboto-math-700-normal.woff2 +0 -0
  184. package/dist/files/roboto-symbols-400-normal.woff +0 -0
  185. package/dist/files/roboto-symbols-400-normal.woff2 +0 -0
  186. package/dist/files/roboto-symbols-700-normal.woff +0 -0
  187. package/dist/files/roboto-symbols-700-normal.woff2 +0 -0
  188. package/dist/files/roboto-vietnamese-400-normal.woff +0 -0
  189. package/dist/files/roboto-vietnamese-400-normal.woff2 +0 -0
  190. package/dist/files/roboto-vietnamese-700-normal.woff +0 -0
  191. package/dist/files/roboto-vietnamese-700-normal.woff2 +0 -0
  192. package/dist/files/space-grotesk-latin-300-normal.woff +0 -0
  193. package/dist/files/space-grotesk-latin-300-normal.woff2 +0 -0
  194. package/dist/files/space-grotesk-latin-400-normal.woff +0 -0
  195. package/dist/files/space-grotesk-latin-400-normal.woff2 +0 -0
  196. package/dist/files/space-grotesk-latin-500-normal.woff +0 -0
  197. package/dist/files/space-grotesk-latin-500-normal.woff2 +0 -0
  198. package/dist/files/space-grotesk-latin-600-normal.woff +0 -0
  199. package/dist/files/space-grotesk-latin-600-normal.woff2 +0 -0
  200. package/dist/files/space-grotesk-latin-700-normal.woff +0 -0
  201. package/dist/files/space-grotesk-latin-700-normal.woff2 +0 -0
  202. package/dist/files/space-grotesk-latin-ext-300-normal.woff +0 -0
  203. package/dist/files/space-grotesk-latin-ext-300-normal.woff2 +0 -0
  204. package/dist/files/space-grotesk-latin-ext-400-normal.woff +0 -0
  205. package/dist/files/space-grotesk-latin-ext-400-normal.woff2 +0 -0
  206. package/dist/files/space-grotesk-latin-ext-500-normal.woff +0 -0
  207. package/dist/files/space-grotesk-latin-ext-500-normal.woff2 +0 -0
  208. package/dist/files/space-grotesk-latin-ext-600-normal.woff +0 -0
  209. package/dist/files/space-grotesk-latin-ext-600-normal.woff2 +0 -0
  210. package/dist/files/space-grotesk-latin-ext-700-normal.woff +0 -0
  211. package/dist/files/space-grotesk-latin-ext-700-normal.woff2 +0 -0
  212. package/dist/files/space-grotesk-vietnamese-300-normal.woff +0 -0
  213. package/dist/files/space-grotesk-vietnamese-300-normal.woff2 +0 -0
  214. package/dist/files/space-grotesk-vietnamese-400-normal.woff +0 -0
  215. package/dist/files/space-grotesk-vietnamese-400-normal.woff2 +0 -0
  216. package/dist/files/space-grotesk-vietnamese-500-normal.woff +0 -0
  217. package/dist/files/space-grotesk-vietnamese-500-normal.woff2 +0 -0
  218. package/dist/files/space-grotesk-vietnamese-600-normal.woff +0 -0
  219. package/dist/files/space-grotesk-vietnamese-600-normal.woff2 +0 -0
  220. package/dist/files/space-grotesk-vietnamese-700-normal.woff +0 -0
  221. package/dist/files/space-grotesk-vietnamese-700-normal.woff2 +0 -0
  222. package/dist/index.js +4 -4
  223. package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
  224. package/dist/internal/devtools/utils/virtualModuleInspector.d.ts.map +1 -1
  225. package/dist/internal/devtools/utils/virtualModuleInspector.js +12 -1
  226. package/dist/internal/initializers/BaseStoresInitializer.d.ts +3 -1
  227. package/dist/internal/initializers/BaseStoresInitializer.d.ts.map +1 -1
  228. package/dist/internal/initializers/BaseStoresInitializer.js +8 -4
  229. package/dist/internal/initializers/NextJsStoresInitializer.d.ts +1 -1
  230. package/dist/internal/initializers/NextJsStoresInitializer.d.ts.map +1 -1
  231. package/dist/internal/initializers/NextJsStoresInitializer.js +2 -13
  232. package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
  233. package/dist/internal/layout/DnDevLayout.js +32 -13
  234. package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
  235. package/dist/internal/layout/components/AutoMetaTags.js +3 -7
  236. package/dist/internal/layout/config/presets/moolti.d.ts.map +1 -1
  237. package/dist/internal/layout/config/presets/moolti.js +11 -13
  238. package/dist/internal/layout/zones/DnDevFooter.d.ts +1 -1
  239. package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
  240. package/dist/internal/layout/zones/DnDevFooter.js +1 -1
  241. package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
  242. package/dist/providers/NextJsAppProviders.js +12 -8
  243. package/dist/routing/AuthGuard.d.ts.map +1 -1
  244. package/dist/routing/AuthGuard.js +1 -1
  245. package/dist/routing/AuthReturnTo.d.ts.map +1 -1
  246. package/dist/routing/GoToInput.d.ts.map +1 -1
  247. package/dist/routing/GoToInput.js +5 -5
  248. package/dist/routing/Link.d.ts.map +1 -1
  249. package/dist/routing/Link.js +14 -0
  250. package/dist/routing/hooks/hooks.next.js +1 -1
  251. package/dist/routing/hooks/hooks.vite.js +1 -1
  252. package/dist/routing/hooks/useNavigate.next.d.ts +2 -6
  253. package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
  254. package/dist/routing/hooks/useNavigate.next.js +5 -52
  255. package/dist/routing/hooks/useNavigate.vite.d.ts +2 -6
  256. package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
  257. package/dist/routing/hooks/useNavigate.vite.js +5 -52
  258. package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
  259. package/dist/routing/hooks/useRedirectGuard.next.js +5 -1
  260. package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
  261. package/dist/routing/hooks/useRedirectGuard.vite.js +5 -1
  262. package/dist/routing/useGoTo.d.ts.map +1 -1
  263. package/dist/routing/useGoTo.js +12 -17
  264. package/dist/styles/index.css +794 -113
  265. package/dist/symbol-index.json +1 -1
  266. package/dist/utils/useAuthSafe.d.ts.map +1 -1
  267. package/dist/utils/useSeo.d.ts +1 -1
  268. package/dist/utils/useSeo.d.ts.map +1 -1
  269. package/dist/utils/useSeo.js +3 -1
  270. package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
  271. package/dist/vite-routing/AppRoutes.js +7 -2
  272. package/dist/vite-routing/RootLayout.d.ts.map +1 -1
  273. package/dist/vite-routing/RootLayout.js +1 -4
  274. package/guidelines/COMPONENTS.md +0 -0
  275. package/guidelines/GOTCHAS.md +0 -0
  276. package/guidelines/LAYOUTS.md +0 -0
  277. package/guidelines/PAGES.md +0 -0
  278. package/guidelines/ROUTING.md +0 -0
  279. package/guidelines/SEO.md +0 -0
  280. package/package.json +13 -13
  281. package/dist/CookieConsent-UVTR7CWW.js +0 -1
  282. package/dist/chunk-ETE4RC7M.js +0 -1
  283. package/dist/components/license/LicenseWatermark.d.ts +0 -25
  284. package/dist/components/license/LicenseWatermark.d.ts.map +0 -1
  285. package/dist/components/license/LicenseWatermark.js +0 -109
  286. package/dist/components/license/watermarkData.d.ts +0 -7
  287. package/dist/components/license/watermarkData.d.ts.map +0 -1
  288. package/dist/components/license/watermarkData.js +0 -18
@@ -1,11 +1,7 @@
1
1
  import type { NavigateOptions } from './types';
2
2
  /**
3
- * Navigation hook with auth interception.
4
- *
5
- * @grill-refuted Returns a new function ref each render (no useCallback). Safe because
6
- * AuthGuard's useEffect that depends on navigate is guarded by `shouldRedirect && redirectTo` -
7
- * the effect body is a no-op when not redirecting, and after redirect the component unmounts.
8
- * React 19 - no useCallback unless profiler proves bottleneck.
3
+ * Navigation hook. Auth is handled by AuthGuard (cold-load redirect).
4
+ * Protected routes are hidden from unauthorized users via useAccessibleRoutes.
9
5
  */
10
6
  export declare function useNavigate(): (to: string, options?: NavigateOptions) => void;
11
7
  export declare function useBack(): () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useNavigate.next.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useNavigate.next.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA8B/C;;;;;;;GAOG;AACH,wBAAgB,WAAW,KAOjB,IAAI,MAAM,EAAE,UAAU,eAAe,UAkC9C;AAED,wBAAgB,OAAO,eAGtB;AAED,wBAAgB,UAAU,eAGzB;AAED,wBAAgB,WAAW,KAEjB,IAAI,MAAM,UACnB"}
1
+ {"version":3,"file":"useNavigate.next.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useNavigate.next.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,WAAW,KAIjB,IAAI,MAAM,EAAE,UAAU,eAAe,UAwB9C;AAED,wBAAgB,OAAO,eAGtB;AAED,wBAAgB,UAAU,eAGzB;AAED,wBAAgB,WAAW,KAEjB,IAAI,MAAM,UACnB"}
@@ -2,73 +2,26 @@
2
2
  // packages/ui/src/routing/hooks/useNavigate.next.ts
3
3
  /**
4
4
  * @fileoverview Next.js-specific navigation hooks
5
- * @description Navigation hooks for Next.js App Router with auth interception
5
+ * @description Navigation hooks for Next.js App Router
6
6
  *
7
- * @version 0.1.0
7
+ * @version 0.2.0
8
8
  * @since 0.0.1
9
9
  * @author AMBROISE PARK Consulting
10
10
  */
11
11
  import { useRouter as useNextRouter } from 'next/navigation';
12
- import { isClient, useOverlayStore, useAuthConfig, FEATURE_STATUS, getRoutes, safeSessionStorage, } from '@donotdev/core';
13
- import { useAuthSafe } from '../../utils/useAuthSafe';
12
+ import { isClient, useOverlayStore } from '@donotdev/core';
14
13
  /**
15
- * Check if a route requires auth by reading discovered routes.
16
- *
17
- * Uses exact path match + startsWith for nested routes. Does NOT handle
18
- * parameterized routes (e.g. `/blog/:slug`). Current protected routes are
19
- * all exact paths. If parameterized auth routes are added, this needs
20
- * pattern matching (pathToRegexp or similar).
21
- *
22
- * @grill-refuted getRoutes() timing is safe - virtual module hydrates synchronously
23
- * before React renders. If routes aren't loaded, returns false (fail-open).
24
- * Cold load is covered by AuthGuard as belt-and-suspenders.
25
- */
26
- function routeRequiresAuth(path) {
27
- try {
28
- const routes = getRoutes();
29
- if (!routes?.length)
30
- return false;
31
- const route = routes.find((r) => r.path === path || path.startsWith(r.path + '/'));
32
- if (!route)
33
- return false;
34
- if (route.auth === true)
35
- return true;
36
- if (typeof route.auth === 'object' && route.auth?.required)
37
- return true;
38
- return false;
39
- }
40
- catch {
41
- return false;
42
- }
43
- }
44
- /**
45
- * Navigation hook with auth interception.
46
- *
47
- * @grill-refuted Returns a new function ref each render (no useCallback). Safe because
48
- * AuthGuard's useEffect that depends on navigate is guarded by `shouldRedirect && redirectTo` -
49
- * the effect body is a no-op when not redirecting, and after redirect the component unmounts.
50
- * React 19 - no useCallback unless profiler proves bottleneck.
14
+ * Navigation hook. Auth is handled by AuthGuard (cold-load redirect).
15
+ * Protected routes are hidden from unauthorized users via useAccessibleRoutes.
51
16
  */
52
17
  export function useNavigate() {
53
18
  const router = useNextRouter();
54
19
  const closeAll = useOverlayStore((state) => state.closeAll);
55
- const user = useAuthSafe('user');
56
- const status = useAuthSafe('status');
57
- const authConfig = useAuthConfig();
58
20
  return (to, options) => {
59
21
  if (to === 'back') {
60
22
  closeAll();
61
23
  return router.back();
62
24
  }
63
- // Auth interception: block SPA nav to protected routes when not auth'd.
64
- // Skip while INITIALIZING - user may be authenticated but not resolved yet.
65
- if (!user && status !== FEATURE_STATUS.INITIALIZING && routeRequiresAuth(to)) {
66
- safeSessionStorage.setItem('dndev.auth.returnTo', to);
67
- safeSessionStorage.setItem('dndev.auth.guardToast', '1');
68
- closeAll();
69
- /** @grill-refuted authRoute! safe - useAuthConfig() guarantees DEFAULT_AUTH merge provides '/' */
70
- return router.replace(authConfig.authRoute);
71
- }
72
25
  closeAll();
73
26
  if (options?.preserveScroll && isClient()) {
74
27
  const scrollY = window.scrollY;
@@ -1,11 +1,7 @@
1
1
  import type { NavigateOptions } from './types';
2
2
  /**
3
- * Navigation hook with auth interception.
4
- *
5
- * @grill-refuted Returns a new function ref each render (no useCallback). Safe because
6
- * AuthGuard's useEffect that depends on navigate is guarded by `shouldRedirect && redirectTo` -
7
- * the effect body is a no-op when not redirecting, and after redirect the component unmounts.
8
- * React 19 - no useCallback unless profiler proves bottleneck.
3
+ * Navigation hook. Auth is handled by AuthGuard (cold-load redirect).
4
+ * Protected routes are hidden from unauthorized users via useAccessibleRoutes.
9
5
  */
10
6
  export declare function useNavigate(): (to: string, options?: NavigateOptions) => void | Promise<void>;
11
7
  export declare function useBack(): () => void | Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"useNavigate.vite.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useNavigate.vite.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA8B/C;;;;;;;GAOG;AACH,wBAAgB,WAAW,KAOjB,IAAI,MAAM,EAAE,UAAU,eAAe,0BAqB9C;AAED,wBAAgB,OAAO,+BAGtB;AAED,wBAAgB,UAAU,eAIzB;AAED,wBAAgB,WAAW,KACjB,KAAK,MAAM,UAGpB"}
1
+ {"version":3,"file":"useNavigate.vite.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useNavigate.vite.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,WAAW,KAIjB,IAAI,MAAM,EAAE,UAAU,eAAe,0BAW9C;AAED,wBAAgB,OAAO,+BAGtB;AAED,wBAAgB,UAAU,eAIzB;AAED,wBAAgB,WAAW,KACjB,KAAK,MAAM,UAGpB"}
@@ -2,73 +2,26 @@
2
2
  // packages/ui/src/routing/hooks/useNavigate.vite.ts
3
3
  /**
4
4
  * @fileoverview Vite-specific navigation hooks
5
- * @description Navigation hooks for React Router (Vite) with auth interception
5
+ * @description Navigation hooks for React Router (Vite)
6
6
  *
7
- * @version 0.1.0
7
+ * @version 0.2.0
8
8
  * @since 0.0.1
9
9
  * @author AMBROISE PARK Consulting
10
10
  */
11
11
  import { useNavigate as useRouterNavigate } from 'react-router-dom';
12
- import { isClient, useOverlayStore, useAuthConfig, FEATURE_STATUS, getRoutes, safeSessionStorage, } from '@donotdev/core';
13
- import { useAuthSafe } from '../../utils/useAuthSafe';
12
+ import { isClient, useOverlayStore } from '@donotdev/core';
14
13
  /**
15
- * Check if a route requires auth by reading discovered routes.
16
- *
17
- * Uses exact path match + startsWith for nested routes. Does NOT handle
18
- * parameterized routes (e.g. `/blog/:slug`). Current protected routes are
19
- * all exact paths. If parameterized auth routes are added, this needs
20
- * pattern matching (pathToRegexp or similar).
21
- *
22
- * @grill-refuted getRoutes() timing is safe - virtual module hydrates synchronously
23
- * before React renders. If routes aren't loaded, returns false (fail-open).
24
- * Cold load is covered by AuthGuard as belt-and-suspenders.
25
- */
26
- function routeRequiresAuth(path) {
27
- try {
28
- const routes = getRoutes();
29
- if (!routes?.length)
30
- return false;
31
- const route = routes.find((r) => r.path === path || path.startsWith(r.path + '/'));
32
- if (!route)
33
- return false;
34
- if (route.auth === true)
35
- return true;
36
- if (typeof route.auth === 'object' && route.auth?.required)
37
- return true;
38
- return false;
39
- }
40
- catch {
41
- return false;
42
- }
43
- }
44
- /**
45
- * Navigation hook with auth interception.
46
- *
47
- * @grill-refuted Returns a new function ref each render (no useCallback). Safe because
48
- * AuthGuard's useEffect that depends on navigate is guarded by `shouldRedirect && redirectTo` -
49
- * the effect body is a no-op when not redirecting, and after redirect the component unmounts.
50
- * React 19 - no useCallback unless profiler proves bottleneck.
14
+ * Navigation hook. Auth is handled by AuthGuard (cold-load redirect).
15
+ * Protected routes are hidden from unauthorized users via useAccessibleRoutes.
51
16
  */
52
17
  export function useNavigate() {
53
18
  const routerNavigate = useRouterNavigate();
54
19
  const closeAll = useOverlayStore((state) => state.closeAll);
55
- const user = useAuthSafe('user');
56
- const status = useAuthSafe('status');
57
- const authConfig = useAuthConfig();
58
20
  return (to, options) => {
59
21
  if (to === 'back') {
60
22
  closeAll();
61
23
  return routerNavigate(-1);
62
24
  }
63
- // Auth interception: block SPA nav to protected routes when not auth'd.
64
- // Skip while INITIALIZING - user may be authenticated but not resolved yet.
65
- if (!user && status !== FEATURE_STATUS.INITIALIZING && routeRequiresAuth(to)) {
66
- safeSessionStorage.setItem('dndev.auth.returnTo', to);
67
- safeSessionStorage.setItem('dndev.auth.guardToast', '1');
68
- closeAll();
69
- /** @grill-refuted authRoute! safe - useAuthConfig() guarantees DEFAULT_AUTH merge provides '/' */
70
- return routerNavigate(authConfig.authRoute, { replace: true });
71
- }
72
25
  closeAll();
73
26
  if (options?.replace)
74
27
  return routerNavigate(to, { replace: true });
@@ -1 +1 @@
1
- {"version":3,"file":"useRedirectGuard.next.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useRedirectGuard.next.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK9D,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IACxB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mEAAmE;IACnE,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC;CAC3D;AAED,iDAAiD;AACjD,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,cAAc,EAAE,OAAO,CAAC;IACxB,uDAAuD;IACvD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gDAAgD;IAChD,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CA4FrB"}
1
+ {"version":3,"file":"useRedirectGuard.next.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useRedirectGuard.next.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK9D,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IACxB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mEAAmE;IACnE,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC;CAC3D;AAED,iDAAiD;AACjD,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,cAAc,EAAE,OAAO,CAAC;IACxB,uDAAuD;IACvD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gDAAgD;IAChD,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CAgGrB"}
@@ -32,7 +32,11 @@ export function useRedirectGuard(options = {}) {
32
32
  const status = useAuthSafe('status');
33
33
  // Determine redirect state
34
34
  const redirectState = useMemo(() => {
35
- const noAction = { shouldRedirect: false, redirectTo: null, isChecking: false };
35
+ const noAction = {
36
+ shouldRedirect: false,
37
+ redirectTo: null,
38
+ isChecking: false,
39
+ };
36
40
  // SSR-safe: return safe defaults on server
37
41
  if (!isClient())
38
42
  return noAction;
@@ -1 +1 @@
1
- {"version":3,"file":"useRedirectGuard.vite.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useRedirectGuard.vite.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK9D,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IACxB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mEAAmE;IACnE,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC;CAC3D;AAED,iDAAiD;AACjD,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,cAAc,EAAE,OAAO,CAAC;IACxB,uDAAuD;IACvD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gDAAgD;IAChD,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CA4FrB"}
1
+ {"version":3,"file":"useRedirectGuard.vite.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useRedirectGuard.vite.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK9D,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IACxB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mEAAmE;IACnE,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC;CAC3D;AAED,iDAAiD;AACjD,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,cAAc,EAAE,OAAO,CAAC;IACxB,uDAAuD;IACvD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gDAAgD;IAChD,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CAgGrB"}
@@ -32,7 +32,11 @@ export function useRedirectGuard(options = {}) {
32
32
  const status = useAuthSafe('status');
33
33
  // Determine redirect state
34
34
  const redirectState = useMemo(() => {
35
- const noAction = { shouldRedirect: false, redirectTo: null, isChecking: false };
35
+ const noAction = {
36
+ shouldRedirect: false,
37
+ redirectTo: null,
38
+ isChecking: false,
39
+ };
36
40
  // SSR-safe: return safe defaults on server
37
41
  if (!isClient())
38
42
  return noAction;
@@ -1 +1 @@
1
- {"version":3,"file":"useGoTo.d.ts","sourceRoot":"","sources":["../../src/routing/useGoTo.ts"],"names":[],"mappings":"AAmBA;;;GAGG;AACH,eAAO,MAAM,OAAO;;;;2BA4BT,MAAM;uBAQN,MAAM;2BAcN,MAAM;CAehB,CAAC"}
1
+ {"version":3,"file":"useGoTo.d.ts","sourceRoot":"","sources":["../../src/routing/useGoTo.ts"],"names":[],"mappings":"AAmBA;;;GAGG;AACH,eAAO,MAAM,OAAO;;;;2BAwBY,MAAM;uBAKV,MAAM;2BASvB,MAAM;CAehB,CAAC"}
@@ -7,7 +7,7 @@
7
7
  * @since 0.0.1
8
8
  * @author AMBROISE PARK Consulting
9
9
  */
10
- import { useCallback, useMemo } from 'react';
10
+ import { useCallback } from 'react';
11
11
  import { useNavigationStore } from '@donotdev/core';
12
12
  // Platform-specific hooks via conditional exports
13
13
  import { useNavigate } from '@donotdev/ui/routing/hooks';
@@ -26,28 +26,23 @@ export const useGoTo = () => {
26
26
  const isFavoriteStore = useNavigationStore((state) => state.isFavorite);
27
27
  const addRecentStore = useNavigationStore((state) => state.addRecent);
28
28
  // Get favorite items
29
- const favoriteItems = useMemo(() => {
30
- if (!navigationItems.length)
31
- return [];
32
- return navigationItems.filter((item) => favorites.includes(item.path));
33
- }, [favorites, navigationItems]);
29
+ const favoriteItems = navigationItems.length
30
+ ? navigationItems.filter((item) => favorites.includes(item.path))
31
+ : [];
34
32
  // Get recent items
35
- const recentItems = useMemo(() => {
36
- if (!navigationItems.length)
37
- return [];
38
- const items = navigationItems.filter((item) => recent.includes(item.path));
39
- return items.slice(0, 5);
40
- }, [recent, navigationItems]);
33
+ const recentItems = navigationItems.length
34
+ ? navigationItems.filter((item) => recent.includes(item.path)).slice(0, 5)
35
+ : [];
41
36
  // Toggle favorite (delegates to navigation store)
42
- const toggleFavorite = useCallback((path) => {
37
+ const toggleFavorite = (path) => {
43
38
  toggleFavoriteStore(path);
44
- }, [toggleFavoriteStore]);
39
+ };
45
40
  // Check if item is favorite (delegates to navigation store)
46
- const isFavorite = useCallback((path) => isFavoriteStore(path), [isFavoriteStore]);
41
+ const isFavorite = (path) => isFavoriteStore(path);
47
42
  // Add to recent (delegates to navigation store)
48
- const addRecent = useCallback((path) => {
43
+ const addRecent = (path) => {
49
44
  addRecentStore(path);
50
- }, [addRecentStore]);
45
+ };
51
46
  // Navigate to item
52
47
  const navigateToItem = useCallback((path) => {
53
48
  addRecent(path);