@donotdev/ui 0.1.0 → 0.1.42

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 (370) 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-CR4VOVXT.js → GoToDialog-CICRYHHG.js} +1 -1
  30. package/dist/chunk-MIPTBUWY.js +1 -0
  31. package/dist/components/auth/AuthHeader.d.ts +6 -1
  32. package/dist/components/auth/AuthHeader.d.ts.map +1 -1
  33. package/dist/components/auth/AuthHeader.js +4 -4
  34. package/dist/components/common/FeatureCard.d.ts +11 -6
  35. package/dist/components/common/FeatureCard.d.ts.map +1 -1
  36. package/dist/components/common/FeatureCard.js +43 -32
  37. package/dist/components/common/FeatureDisabled.d.ts +1 -0
  38. package/dist/components/common/FeatureDisabled.d.ts.map +1 -1
  39. package/dist/components/common/TechBento.d.ts +1 -0
  40. package/dist/components/common/TechBento.d.ts.map +1 -1
  41. package/dist/components/common/icon.d.ts +1 -0
  42. package/dist/components/common/icon.d.ts.map +1 -1
  43. package/dist/components/cookie-consent/CookieConsent.d.ts +4 -3
  44. package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
  45. package/dist/components/cookie-consent/CookieConsent.js +36 -35
  46. package/dist/components/index.d.ts +0 -1
  47. package/dist/components/index.d.ts.map +1 -1
  48. package/dist/components/index.js +0 -1
  49. package/dist/components/layout/PageConfig.d.ts +25 -0
  50. package/dist/components/layout/PageConfig.d.ts.map +1 -0
  51. package/dist/components/layout/PageConfig.js +47 -0
  52. package/dist/components/layout/components/Breadcrumbs.d.ts +2 -0
  53. package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
  54. package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts +1 -0
  55. package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts.map +1 -1
  56. package/dist/components/layout/components/header/AppBranding.d.ts +1 -0
  57. package/dist/components/layout/components/header/AppBranding.d.ts.map +1 -1
  58. package/dist/components/layout/components/header/AppIcon.d.ts +1 -0
  59. package/dist/components/layout/components/header/AppIcon.d.ts.map +1 -1
  60. package/dist/components/layout/components/header/AppTitle.d.ts +1 -0
  61. package/dist/components/layout/components/header/AppTitle.d.ts.map +1 -1
  62. package/dist/components/layout/components/header/CacheSettings.d.ts.map +1 -1
  63. package/dist/components/layout/components/header/CacheSettings.js +6 -2
  64. package/dist/components/layout/components/header/GameTitle.d.ts +1 -0
  65. package/dist/components/layout/components/header/GameTitle.d.ts.map +1 -1
  66. package/dist/components/layout/components/header/HeaderMenu.d.ts +1 -0
  67. package/dist/components/layout/components/header/HeaderMenu.d.ts.map +1 -1
  68. package/dist/components/layout/components/header/HeaderNavigation.d.ts +1 -0
  69. package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
  70. package/dist/components/layout/components/header/SettingsMenu.d.ts +1 -0
  71. package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
  72. package/dist/components/layout/index.d.ts +1 -0
  73. package/dist/components/layout/index.d.ts.map +1 -1
  74. package/dist/components/layout/index.js +1 -0
  75. package/dist/crud/components/EntityCardList.d.ts +1 -1
  76. package/dist/crud/components/EntityCardList.d.ts.map +1 -1
  77. package/dist/crud/components/EntityCardList.js +47 -23
  78. package/dist/crud/components/EntityDisplayRenderer.d.ts +1 -1
  79. package/dist/crud/components/EntityDisplayRenderer.d.ts.map +1 -1
  80. package/dist/crud/components/EntityDisplayRenderer.js +14 -13
  81. package/dist/crud/components/EntityFormRenderer.d.ts +6 -1
  82. package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
  83. package/dist/crud/components/EntityFormRenderer.js +46 -38
  84. package/dist/crud/components/EntityList.d.ts +1 -1
  85. package/dist/crud/components/EntityList.d.ts.map +1 -1
  86. package/dist/crud/components/EntityList.js +80 -80
  87. package/dist/crud/components/EntityRecommendations.d.ts +1 -1
  88. package/dist/crud/components/EntityRecommendations.d.ts.map +1 -1
  89. package/dist/crud/components/EntityRecommendations.js +4 -4
  90. package/dist/crud/components/EntityWorkflow.d.ts.map +1 -1
  91. package/dist/crud/components/EntityWorkflow.js +1 -1
  92. package/dist/crud/crudImports.d.ts +1 -1
  93. package/dist/crud/crudImports.d.ts.map +1 -1
  94. package/dist/crud/crudImports.js +1 -1
  95. package/dist/dndev-next.css +831 -171
  96. package/dist/dndev.css +1000 -185
  97. package/dist/files/inter-cyrillic-300-normal.woff +0 -0
  98. package/dist/files/inter-cyrillic-300-normal.woff2 +0 -0
  99. package/dist/files/inter-cyrillic-400-normal.woff +0 -0
  100. package/dist/files/inter-cyrillic-400-normal.woff2 +0 -0
  101. package/dist/files/inter-cyrillic-600-normal.woff +0 -0
  102. package/dist/files/inter-cyrillic-600-normal.woff2 +0 -0
  103. package/dist/files/inter-cyrillic-700-normal.woff +0 -0
  104. package/dist/files/inter-cyrillic-700-normal.woff2 +0 -0
  105. package/dist/files/inter-cyrillic-ext-300-normal.woff +0 -0
  106. package/dist/files/inter-cyrillic-ext-300-normal.woff2 +0 -0
  107. package/dist/files/inter-cyrillic-ext-400-normal.woff +0 -0
  108. package/dist/files/inter-cyrillic-ext-400-normal.woff2 +0 -0
  109. package/dist/files/inter-cyrillic-ext-600-normal.woff +0 -0
  110. package/dist/files/inter-cyrillic-ext-600-normal.woff2 +0 -0
  111. package/dist/files/inter-cyrillic-ext-700-normal.woff +0 -0
  112. package/dist/files/inter-cyrillic-ext-700-normal.woff2 +0 -0
  113. package/dist/files/inter-greek-300-normal.woff +0 -0
  114. package/dist/files/inter-greek-300-normal.woff2 +0 -0
  115. package/dist/files/inter-greek-400-normal.woff +0 -0
  116. package/dist/files/inter-greek-400-normal.woff2 +0 -0
  117. package/dist/files/inter-greek-600-normal.woff +0 -0
  118. package/dist/files/inter-greek-600-normal.woff2 +0 -0
  119. package/dist/files/inter-greek-700-normal.woff +0 -0
  120. package/dist/files/inter-greek-700-normal.woff2 +0 -0
  121. package/dist/files/inter-greek-ext-300-normal.woff +0 -0
  122. package/dist/files/inter-greek-ext-300-normal.woff2 +0 -0
  123. package/dist/files/inter-greek-ext-400-normal.woff +0 -0
  124. package/dist/files/inter-greek-ext-400-normal.woff2 +0 -0
  125. package/dist/files/inter-greek-ext-600-normal.woff +0 -0
  126. package/dist/files/inter-greek-ext-600-normal.woff2 +0 -0
  127. package/dist/files/inter-greek-ext-700-normal.woff +0 -0
  128. package/dist/files/inter-greek-ext-700-normal.woff2 +0 -0
  129. package/dist/files/inter-latin-300-normal.woff +0 -0
  130. package/dist/files/inter-latin-300-normal.woff2 +0 -0
  131. package/dist/files/inter-latin-400-normal.woff +0 -0
  132. package/dist/files/inter-latin-400-normal.woff2 +0 -0
  133. package/dist/files/inter-latin-600-normal.woff +0 -0
  134. package/dist/files/inter-latin-600-normal.woff2 +0 -0
  135. package/dist/files/inter-latin-700-normal.woff +0 -0
  136. package/dist/files/inter-latin-700-normal.woff2 +0 -0
  137. package/dist/files/inter-latin-ext-300-normal.woff +0 -0
  138. package/dist/files/inter-latin-ext-300-normal.woff2 +0 -0
  139. package/dist/files/inter-latin-ext-400-normal.woff +0 -0
  140. package/dist/files/inter-latin-ext-400-normal.woff2 +0 -0
  141. package/dist/files/inter-latin-ext-600-normal.woff +0 -0
  142. package/dist/files/inter-latin-ext-600-normal.woff2 +0 -0
  143. package/dist/files/inter-latin-ext-700-normal.woff +0 -0
  144. package/dist/files/inter-latin-ext-700-normal.woff2 +0 -0
  145. package/dist/files/inter-vietnamese-300-normal.woff +0 -0
  146. package/dist/files/inter-vietnamese-300-normal.woff2 +0 -0
  147. package/dist/files/inter-vietnamese-400-normal.woff +0 -0
  148. package/dist/files/inter-vietnamese-400-normal.woff2 +0 -0
  149. package/dist/files/inter-vietnamese-600-normal.woff +0 -0
  150. package/dist/files/inter-vietnamese-600-normal.woff2 +0 -0
  151. package/dist/files/inter-vietnamese-700-normal.woff +0 -0
  152. package/dist/files/inter-vietnamese-700-normal.woff2 +0 -0
  153. package/dist/files/playfair-display-cyrillic-400-normal.woff +0 -0
  154. package/dist/files/playfair-display-cyrillic-400-normal.woff2 +0 -0
  155. package/dist/files/playfair-display-cyrillic-500-normal.woff +0 -0
  156. package/dist/files/playfair-display-cyrillic-500-normal.woff2 +0 -0
  157. package/dist/files/playfair-display-cyrillic-600-normal.woff +0 -0
  158. package/dist/files/playfair-display-cyrillic-600-normal.woff2 +0 -0
  159. package/dist/files/playfair-display-cyrillic-700-normal.woff +0 -0
  160. package/dist/files/playfair-display-cyrillic-700-normal.woff2 +0 -0
  161. package/dist/files/playfair-display-latin-400-normal.woff +0 -0
  162. package/dist/files/playfair-display-latin-400-normal.woff2 +0 -0
  163. package/dist/files/playfair-display-latin-500-normal.woff +0 -0
  164. package/dist/files/playfair-display-latin-500-normal.woff2 +0 -0
  165. package/dist/files/playfair-display-latin-600-normal.woff +0 -0
  166. package/dist/files/playfair-display-latin-600-normal.woff2 +0 -0
  167. package/dist/files/playfair-display-latin-700-normal.woff +0 -0
  168. package/dist/files/playfair-display-latin-700-normal.woff2 +0 -0
  169. package/dist/files/playfair-display-latin-ext-400-normal.woff +0 -0
  170. package/dist/files/playfair-display-latin-ext-400-normal.woff2 +0 -0
  171. package/dist/files/playfair-display-latin-ext-500-normal.woff +0 -0
  172. package/dist/files/playfair-display-latin-ext-500-normal.woff2 +0 -0
  173. package/dist/files/playfair-display-latin-ext-600-normal.woff +0 -0
  174. package/dist/files/playfair-display-latin-ext-600-normal.woff2 +0 -0
  175. package/dist/files/playfair-display-latin-ext-700-normal.woff +0 -0
  176. package/dist/files/playfair-display-latin-ext-700-normal.woff2 +0 -0
  177. package/dist/files/playfair-display-vietnamese-400-normal.woff +0 -0
  178. package/dist/files/playfair-display-vietnamese-400-normal.woff2 +0 -0
  179. package/dist/files/playfair-display-vietnamese-500-normal.woff +0 -0
  180. package/dist/files/playfair-display-vietnamese-500-normal.woff2 +0 -0
  181. package/dist/files/playfair-display-vietnamese-600-normal.woff +0 -0
  182. package/dist/files/playfair-display-vietnamese-600-normal.woff2 +0 -0
  183. package/dist/files/playfair-display-vietnamese-700-normal.woff +0 -0
  184. package/dist/files/playfair-display-vietnamese-700-normal.woff2 +0 -0
  185. package/dist/files/press-start-2p-cyrillic-400-normal.woff +0 -0
  186. package/dist/files/press-start-2p-cyrillic-400-normal.woff2 +0 -0
  187. package/dist/files/press-start-2p-cyrillic-ext-400-normal.woff +0 -0
  188. package/dist/files/press-start-2p-cyrillic-ext-400-normal.woff2 +0 -0
  189. package/dist/files/press-start-2p-greek-400-normal.woff +0 -0
  190. package/dist/files/press-start-2p-greek-400-normal.woff2 +0 -0
  191. package/dist/files/press-start-2p-latin-400-normal.woff +0 -0
  192. package/dist/files/press-start-2p-latin-400-normal.woff2 +0 -0
  193. package/dist/files/press-start-2p-latin-ext-400-normal.woff +0 -0
  194. package/dist/files/press-start-2p-latin-ext-400-normal.woff2 +0 -0
  195. package/dist/files/roboto-cyrillic-400-normal.woff +0 -0
  196. package/dist/files/roboto-cyrillic-400-normal.woff2 +0 -0
  197. package/dist/files/roboto-cyrillic-700-normal.woff +0 -0
  198. package/dist/files/roboto-cyrillic-700-normal.woff2 +0 -0
  199. package/dist/files/roboto-cyrillic-ext-400-normal.woff +0 -0
  200. package/dist/files/roboto-cyrillic-ext-400-normal.woff2 +0 -0
  201. package/dist/files/roboto-cyrillic-ext-700-normal.woff +0 -0
  202. package/dist/files/roboto-cyrillic-ext-700-normal.woff2 +0 -0
  203. package/dist/files/roboto-greek-400-normal.woff +0 -0
  204. package/dist/files/roboto-greek-400-normal.woff2 +0 -0
  205. package/dist/files/roboto-greek-700-normal.woff +0 -0
  206. package/dist/files/roboto-greek-700-normal.woff2 +0 -0
  207. package/dist/files/roboto-greek-ext-400-normal.woff +0 -0
  208. package/dist/files/roboto-greek-ext-400-normal.woff2 +0 -0
  209. package/dist/files/roboto-greek-ext-700-normal.woff +0 -0
  210. package/dist/files/roboto-greek-ext-700-normal.woff2 +0 -0
  211. package/dist/files/roboto-latin-400-normal.woff +0 -0
  212. package/dist/files/roboto-latin-400-normal.woff2 +0 -0
  213. package/dist/files/roboto-latin-700-normal.woff +0 -0
  214. package/dist/files/roboto-latin-700-normal.woff2 +0 -0
  215. package/dist/files/roboto-latin-ext-400-normal.woff +0 -0
  216. package/dist/files/roboto-latin-ext-400-normal.woff2 +0 -0
  217. package/dist/files/roboto-latin-ext-700-normal.woff +0 -0
  218. package/dist/files/roboto-latin-ext-700-normal.woff2 +0 -0
  219. package/dist/files/roboto-math-400-normal.woff +0 -0
  220. package/dist/files/roboto-math-400-normal.woff2 +0 -0
  221. package/dist/files/roboto-math-700-normal.woff +0 -0
  222. package/dist/files/roboto-math-700-normal.woff2 +0 -0
  223. package/dist/files/roboto-symbols-400-normal.woff +0 -0
  224. package/dist/files/roboto-symbols-400-normal.woff2 +0 -0
  225. package/dist/files/roboto-symbols-700-normal.woff +0 -0
  226. package/dist/files/roboto-symbols-700-normal.woff2 +0 -0
  227. package/dist/files/roboto-vietnamese-400-normal.woff +0 -0
  228. package/dist/files/roboto-vietnamese-400-normal.woff2 +0 -0
  229. package/dist/files/roboto-vietnamese-700-normal.woff +0 -0
  230. package/dist/files/roboto-vietnamese-700-normal.woff2 +0 -0
  231. package/dist/files/space-grotesk-latin-300-normal.woff +0 -0
  232. package/dist/files/space-grotesk-latin-300-normal.woff2 +0 -0
  233. package/dist/files/space-grotesk-latin-400-normal.woff +0 -0
  234. package/dist/files/space-grotesk-latin-400-normal.woff2 +0 -0
  235. package/dist/files/space-grotesk-latin-500-normal.woff +0 -0
  236. package/dist/files/space-grotesk-latin-500-normal.woff2 +0 -0
  237. package/dist/files/space-grotesk-latin-600-normal.woff +0 -0
  238. package/dist/files/space-grotesk-latin-600-normal.woff2 +0 -0
  239. package/dist/files/space-grotesk-latin-700-normal.woff +0 -0
  240. package/dist/files/space-grotesk-latin-700-normal.woff2 +0 -0
  241. package/dist/files/space-grotesk-latin-ext-300-normal.woff +0 -0
  242. package/dist/files/space-grotesk-latin-ext-300-normal.woff2 +0 -0
  243. package/dist/files/space-grotesk-latin-ext-400-normal.woff +0 -0
  244. package/dist/files/space-grotesk-latin-ext-400-normal.woff2 +0 -0
  245. package/dist/files/space-grotesk-latin-ext-500-normal.woff +0 -0
  246. package/dist/files/space-grotesk-latin-ext-500-normal.woff2 +0 -0
  247. package/dist/files/space-grotesk-latin-ext-600-normal.woff +0 -0
  248. package/dist/files/space-grotesk-latin-ext-600-normal.woff2 +0 -0
  249. package/dist/files/space-grotesk-latin-ext-700-normal.woff +0 -0
  250. package/dist/files/space-grotesk-latin-ext-700-normal.woff2 +0 -0
  251. package/dist/files/space-grotesk-vietnamese-300-normal.woff +0 -0
  252. package/dist/files/space-grotesk-vietnamese-300-normal.woff2 +0 -0
  253. package/dist/files/space-grotesk-vietnamese-400-normal.woff +0 -0
  254. package/dist/files/space-grotesk-vietnamese-400-normal.woff2 +0 -0
  255. package/dist/files/space-grotesk-vietnamese-500-normal.woff +0 -0
  256. package/dist/files/space-grotesk-vietnamese-500-normal.woff2 +0 -0
  257. package/dist/files/space-grotesk-vietnamese-600-normal.woff +0 -0
  258. package/dist/files/space-grotesk-vietnamese-600-normal.woff2 +0 -0
  259. package/dist/files/space-grotesk-vietnamese-700-normal.woff +0 -0
  260. package/dist/files/space-grotesk-vietnamese-700-normal.woff2 +0 -0
  261. package/dist/index.js +4 -4
  262. package/dist/internal/common/ErrorFallback.js +1 -1
  263. package/dist/internal/devtools/DebugTools.js +1 -1
  264. package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
  265. package/dist/internal/devtools/components/DesignTab.js +6 -2
  266. package/dist/internal/devtools/utils/envVarDiscovery.d.ts.map +1 -1
  267. package/dist/internal/devtools/utils/envVarDiscovery.js +4 -5
  268. package/dist/internal/devtools/utils/virtualModuleInspector.d.ts.map +1 -1
  269. package/dist/internal/devtools/utils/virtualModuleInspector.js +13 -0
  270. package/dist/internal/initializers/BaseStoresInitializer.d.ts +3 -1
  271. package/dist/internal/initializers/BaseStoresInitializer.d.ts.map +1 -1
  272. package/dist/internal/initializers/BaseStoresInitializer.js +17 -4
  273. package/dist/internal/initializers/NextJsStoresInitializer.d.ts +1 -1
  274. package/dist/internal/initializers/NextJsStoresInitializer.d.ts.map +1 -1
  275. package/dist/internal/initializers/NextJsStoresInitializer.js +2 -13
  276. package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
  277. package/dist/internal/layout/DnDevLayout.js +65 -23
  278. package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
  279. package/dist/internal/layout/components/AutoMetaTags.js +57 -29
  280. package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts +2 -0
  281. package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts.map +1 -1
  282. package/dist/internal/layout/components/NextJsAutoMetaTags.js +45 -15
  283. package/dist/internal/layout/components/PWAUpdateNotification.d.ts.map +1 -1
  284. package/dist/internal/layout/components/PWAUpdateNotification.js +15 -2
  285. package/dist/internal/layout/config/presets/moolti.d.ts.map +1 -1
  286. package/dist/internal/layout/config/presets/moolti.js +11 -13
  287. package/dist/internal/layout/zones/DnDevFooter.d.ts +3 -1
  288. package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
  289. package/dist/internal/layout/zones/DnDevFooter.js +5 -1
  290. package/dist/internal/layout/zones/DnDevHeader.d.ts +3 -1
  291. package/dist/internal/layout/zones/DnDevHeader.d.ts.map +1 -1
  292. package/dist/internal/layout/zones/DnDevHeader.js +7 -2
  293. package/dist/internal/layout/zones/DnDevSidebar.d.ts +3 -1
  294. package/dist/internal/layout/zones/DnDevSidebar.d.ts.map +1 -1
  295. package/dist/internal/layout/zones/DnDevSidebar.js +9 -3
  296. package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
  297. package/dist/providers/NextJsAppProviders.js +14 -8
  298. package/dist/routing/AuthGuard.d.ts +7 -22
  299. package/dist/routing/AuthGuard.d.ts.map +1 -1
  300. package/dist/routing/AuthGuard.js +19 -64
  301. package/dist/routing/AuthReturnTo.d.ts +13 -0
  302. package/dist/routing/AuthReturnTo.d.ts.map +1 -0
  303. package/dist/routing/AuthReturnTo.js +61 -0
  304. package/dist/routing/DnDevNavigationMenu.d.ts +1 -0
  305. package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
  306. package/dist/routing/GoTo.d.ts +1 -0
  307. package/dist/routing/GoTo.d.ts.map +1 -1
  308. package/dist/routing/GoToInput.d.ts.map +1 -1
  309. package/dist/routing/GoToInput.js +5 -5
  310. package/dist/routing/Link.d.ts.map +1 -1
  311. package/dist/routing/Link.js +14 -0
  312. package/dist/routing/hooks/hooks.next.js +1 -1
  313. package/dist/routing/hooks/hooks.vite.js +1 -1
  314. package/dist/routing/hooks/useNavigate.next.d.ts +4 -0
  315. package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
  316. package/dist/routing/hooks/useNavigate.next.js +10 -7
  317. package/dist/routing/hooks/useNavigate.vite.d.ts +4 -0
  318. package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
  319. package/dist/routing/hooks/useNavigate.vite.js +16 -13
  320. package/dist/routing/hooks/useRedirectGuard.next.d.ts +2 -0
  321. package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
  322. package/dist/routing/hooks/useRedirectGuard.next.js +15 -27
  323. package/dist/routing/hooks/useRedirectGuard.vite.d.ts +2 -0
  324. package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
  325. package/dist/routing/hooks/useRedirectGuard.vite.js +15 -27
  326. package/dist/routing/index.d.ts +1 -0
  327. package/dist/routing/index.d.ts.map +1 -1
  328. package/dist/routing/index.js +1 -0
  329. package/dist/routing/useGoTo.d.ts.map +1 -1
  330. package/dist/routing/useGoTo.js +12 -17
  331. package/dist/styles/index.css +1000 -185
  332. package/dist/symbol-index.json +1 -0
  333. package/dist/utils/index.d.ts +1 -0
  334. package/dist/utils/index.d.ts.map +1 -1
  335. package/dist/utils/index.js +1 -0
  336. package/dist/utils/sanitizeSvg.d.ts +4 -0
  337. package/dist/utils/sanitizeSvg.d.ts.map +1 -1
  338. package/dist/utils/sanitizeSvg.js +4 -0
  339. package/dist/utils/useAISafe.d.ts +28 -0
  340. package/dist/utils/useAISafe.d.ts.map +1 -0
  341. package/dist/utils/useAISafe.js +53 -0
  342. package/dist/utils/useAuthSafe.d.ts +39 -0
  343. package/dist/utils/useAuthSafe.d.ts.map +1 -1
  344. package/dist/utils/useAuthSafe.js +5 -0
  345. package/dist/utils/useAuthVisibility.d.ts +1 -0
  346. package/dist/utils/useAuthVisibility.d.ts.map +1 -1
  347. package/dist/utils/useBillingVisibility.d.ts +1 -0
  348. package/dist/utils/useBillingVisibility.d.ts.map +1 -1
  349. package/dist/utils/useSeo.d.ts +121 -0
  350. package/dist/utils/useSeo.d.ts.map +1 -0
  351. package/dist/utils/useSeo.js +116 -0
  352. package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
  353. package/dist/vite-routing/AppRoutes.js +20 -5
  354. package/dist/vite-routing/RootLayout.d.ts.map +1 -1
  355. package/dist/vite-routing/RootLayout.js +6 -7
  356. package/guidelines/COMPONENTS.md +136 -0
  357. package/guidelines/GOTCHAS.md +66 -0
  358. package/guidelines/LAYOUTS.md +310 -0
  359. package/guidelines/PAGES.md +205 -0
  360. package/guidelines/ROUTING.md +499 -0
  361. package/guidelines/SEO.md +275 -0
  362. package/package.json +17 -12
  363. package/dist/CookieConsent-UVTR7CWW.js +0 -1
  364. package/dist/chunk-XHGRMKOY.js +0 -1
  365. package/dist/components/license/LicenseWatermark.d.ts +0 -25
  366. package/dist/components/license/LicenseWatermark.d.ts.map +0 -1
  367. package/dist/components/license/LicenseWatermark.js +0 -109
  368. package/dist/components/license/watermarkData.d.ts +0 -7
  369. package/dist/components/license/watermarkData.d.ts.map +0 -1
  370. package/dist/components/license/watermarkData.js +0 -18
@@ -0,0 +1,61 @@
1
+ 'use client';
2
+ // packages/ui/src/routing/AuthReturnTo.tsx
3
+ /**
4
+ * @fileoverview Auth Return-To Navigation + Guard Toast
5
+ * @description Consumes `dndev.auth.returnTo` from sessionStorage after OAuth
6
+ * redirect and navigates back to the pre-auth path.
7
+ * Also consumes `dndev.auth.guardToast` flag to show a toast when
8
+ * useNavigate blocked a SPA nav to a protected route.
9
+ *
10
+ * Mount once at layout/provider level (RootLayout). Renders nothing.
11
+ * Works on all routes - unlike AuthGuard which only runs on guarded pages.
12
+ *
13
+ * @version 0.1.0
14
+ * @since 0.6.0
15
+ * @author AMBROISE PARK Consulting
16
+ */
17
+ import { useEffect } from 'react';
18
+ import { useToast } from '@donotdev/components';
19
+ import { isClient, safeSessionStorage, useTranslation } from '@donotdev/core';
20
+ import { useAuthSafe } from '../utils/useAuthSafe';
21
+ import { useNavigate } from '@donotdev/ui/routing/hooks';
22
+ /**
23
+ * AuthReturnTo - Restores navigation after OAuth redirect.
24
+ *
25
+ * OAuth always lands on `/` (origin). This component watches for sign-in,
26
+ * reads the saved returnTo path, and navigates back. Runs once per sign-in.
27
+ *
28
+ * Also shows a warning toast when the user was redirected by the auth guard
29
+ * (flag set by useNavigate, consumed here on mount of the landing page).
30
+ *
31
+ * @component
32
+ */
33
+ export function AuthReturnTo() {
34
+ const user = useAuthSafe('user');
35
+ const navigate = useNavigate();
36
+ const { t } = useTranslation('dndev');
37
+ const { toast } = useToast();
38
+ // Show guard toast on landing page after auth redirect
39
+ useEffect(() => {
40
+ if (!isClient())
41
+ return;
42
+ const flag = safeSessionStorage.getItem('dndev.auth.guardToast');
43
+ if (!flag)
44
+ return;
45
+ safeSessionStorage.removeItem('dndev.auth.guardToast');
46
+ toast('warning', t('guard.signInRequired', 'Please sign in to access this page'));
47
+ }, []);
48
+ // Return-to after sign-in
49
+ useEffect(() => {
50
+ if (!user || !isClient())
51
+ return;
52
+ const returnTo = safeSessionStorage.getItem('dndev.auth.returnTo');
53
+ if (!returnTo)
54
+ return;
55
+ safeSessionStorage.removeItem('dndev.auth.returnTo');
56
+ if (returnTo !== window.location.pathname) {
57
+ navigate(returnTo, { replace: true });
58
+ }
59
+ }, [user, navigate]);
60
+ return null;
61
+ }
@@ -1,6 +1,7 @@
1
1
  import { type ComponentType } from 'react';
2
2
  import { DISPLAY } from '@donotdev/components';
3
3
  import type { NavigationItem } from './useNavigation';
4
+ /** Props for the DnDevNavigationMenu component. */
4
5
  export interface DnDevNavigationMenuProps {
5
6
  /** Routes to display (optional - auto-fetches if not provided) */
6
7
  routes?: NavigationItem[];
@@ -1 +1 @@
1
- {"version":3,"file":"DnDevNavigationMenu.d.ts","sourceRoot":"","sources":["../../src/routing/DnDevNavigationMenu.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAO,EAOL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAW9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,wBAAwB,CA8KvE,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"DnDevNavigationMenu.d.ts","sourceRoot":"","sources":["../../src/routing/DnDevNavigationMenu.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAO,EAOL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAW9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,mDAAmD;AACnD,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,wBAAwB,CA8KvE,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { DISPLAY } from '@donotdev/components';
2
+ /** Props for the GoTo command palette trigger. */
2
3
  export interface GoToProps {
3
4
  /**
4
5
  * Display - controls button presentation
@@ -1 +1 @@
1
- {"version":3,"file":"GoTo.d.ts","sourceRoot":"","sources":["../../src/routing/GoTo.tsx"],"names":[],"mappings":"AAaA,OAAO,EAA0B,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGvE,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,iCAIlB,SAAS,4CA0CX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"GoTo.d.ts","sourceRoot":"","sources":["../../src/routing/GoTo.tsx"],"names":[],"mappings":"AAaA,OAAO,EAA0B,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGvE,kDAAkD;AAClD,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,iCAIlB,SAAS,4CA0CX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"GoToInput.d.ts","sourceRoot":"","sources":["../../src/routing/GoToInput.tsx"],"names":[],"mappings":"AAgCA,QAAA,MAAM,SAAS,+CAwEd,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"GoToInput.d.ts","sourceRoot":"","sources":["../../src/routing/GoToInput.tsx"],"names":[],"mappings":"AA0BA,QAAA,MAAM,SAAS,+CAqEd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -9,7 +9,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
9
  * @author AMBROISE PARK Consulting
10
10
  */
11
11
  import { Search } from 'lucide-react';
12
- import { useCallback, useEffect, useState, useRef, } from 'react';
12
+ import { useEffect, useState, useRef } from 'react';
13
13
  import { Stack } from '@donotdev/components';
14
14
  import { useOverlayStore } from '@donotdev/core';
15
15
  import { useTranslation } from '@donotdev/core';
@@ -30,15 +30,15 @@ const GoToInput = () => {
30
30
  setValue('');
31
31
  }
32
32
  }, [isCommandDialogOpen]);
33
- const handleFocus = useCallback(() => {
33
+ const handleFocus = () => {
34
34
  useOverlayStore.getState().openCommandDialog(value);
35
- }, [value]);
36
- const handleKeyDown = useCallback((e) => {
35
+ };
36
+ const handleKeyDown = (e) => {
37
37
  if (e.key === 'Enter') {
38
38
  e.preventDefault();
39
39
  useOverlayStore.getState().openCommandDialog(value);
40
40
  }
41
- }, [value]);
41
+ };
42
42
  return (_jsxs(Stack, { direction: "row", align: "center", className: "dndev-relative dndev-w-full dndev-max-w-sm", role: "search", children: [_jsx(Search, { className: "dndev-absolute dndev-size-md", style: { insetInlineStart: '0.75rem', opacity: 0.5 }, "aria-hidden": "true" }), _jsx("input", { ref: inputRef, type: "text", value: value, onChange: (e) => setValue(e.target.value), onFocus: handleFocus, onKeyDown: handleKeyDown, placeholder: t('globalGoTo.searchPlaceholder', 'Search pages...'), className: "dndev-input dndev-w-full", style: { paddingInlineStart: '2.5rem', paddingInlineEnd: '5rem' }, "aria-label": t('globalGoTo.ariaLabel', 'Search navigation') }), _jsx("div", { className: "dndev-absolute dndev-flex dndev-items-center dndev-text-sm", style: { insetInlineEnd: '0.75rem', gap: '0.25rem', opacity: 0.5 }, "aria-hidden": "true", children: _jsx("kbd", { style: {
43
43
  padding: '0.25rem 0.5rem',
44
44
  fontSize: 'var(--font-size-xs)',
@@ -1 +1 @@
1
- {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/routing/Link.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAC1B,MAAM,OAAO,CAAC;AASf;;;;;;GAMG;AACH,MAAM,WAAW,SAAU,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,EAAE,aAAa,CAAC,SAAS,CA4IzC,CAAC"}
1
+ {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/routing/Link.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAC1B,MAAM,OAAO,CAAC;AASf;;;;;;GAMG;AACH,MAAM,WAAW,SAAU,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,EAAE,aAAa,CAAC,SAAS,CAyJzC,CAAC"}
@@ -29,6 +29,12 @@ export const Link = ({ path, replace, prefetch = true, children, icon, iconEnd =
29
29
  // Special framework trigger: #cookie-settings
30
30
  if (path === '#cookie-settings') {
31
31
  const handleCookieSettings = (e) => {
32
+ // Honor browser native open-in-new-tab on modifier+click or non-left-click.
33
+ if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) {
34
+ if (onClick)
35
+ onClick(e);
36
+ return;
37
+ }
32
38
  e.preventDefault();
33
39
  e.stopPropagation();
34
40
  try {
@@ -61,6 +67,14 @@ export const Link = ({ path, replace, prefetch = true, children, icon, iconEnd =
61
67
  }
62
68
  return; // Don't prevent default for external links
63
69
  }
70
+ // Honor browser native open-in-new-tab on modifier+click or non-left-click.
71
+ // Without this, preventDefault() below would block the browser default,
72
+ // and Ctrl/Cmd-click would silently navigate in the same tab.
73
+ if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) {
74
+ if (onClick)
75
+ onClick(e);
76
+ return; // browser handles new tab / new window
77
+ }
64
78
  // Internal links: use framework navigation
65
79
  e.preventDefault();
66
80
  if (onClick) {
@@ -1 +1 @@
1
- "use client";import{useRouter as f}from"next/navigation";import{useCallback as h}from"react";import{isClient as S,useOverlayStore as y}from"@donotdev/core";function d(){let e=f(),r=y(t=>t.closeAll);return h((t,s)=>{if(t==="back")return r(),e.back();if(r(),s?.preserveScroll&&S()){let o=window.scrollY;s?.replace?e.replace(t):e.push(t),requestAnimationFrame(()=>{window.scrollTo({top:o,behavior:"auto"})});return}return s?.replace?e.replace(t):e.push(t)},[e,r])}function k(){let e=f();return h(()=>e.back(),[e])}function T(){let e=f();return h(()=>e.refresh(),[e])}function v(){let e=f();return h(r=>e.prefetch(r),[e])}import{usePathname as b,useSearchParams as N}from"next/navigation";function m(){let e=b(),t=N().toString(),s=t?`?${t}`:void 0;return{pathname:e||"/",search:s,hash:"",state:null}}import{useParams as w}from"next/navigation";function g(){let e=w();return e||{}}function C(e){let t=g()[e];if(typeof t=="string")return t;if(Array.isArray(t)&&t.length>0)return t[0]}import{useSearchParams as I}from"next/navigation";function R(){return I()}import{usePathname as G}from"next/navigation";function $(e){let r=G(),t=e.replace(/:[^/]+/g,"([^/]+)").replace(/\*/g,".*"),s=new RegExp(`^${t}$`),o=r.match(s);if(!o)return null;let n=e.match(/:[^/]+/g)?.map(u=>u.slice(1))||[],a={};return n.forEach((u,c)=>{a[u]=o[c+1]||""}),{params:a,pathname:r,pattern:e}}import{useCallback as P}from"react";function K(){let e=R(),r=d(),t=m(),s=P((a,u)=>{let c=new URLSearchParams(e.toString());c.set(a,u);let l=c.toString(),x=`${t.pathname||"/"}${l?`?${l}`:""}`;r(x)},[e,r,t.pathname]),o=P(a=>{let u=new URLSearchParams(e.toString());u.delete(a);let c=u.toString(),i=`${t.pathname||"/"}${c?`?${c}`:""}`;r(i)},[e,r,t.pathname]),n=P(()=>{let a=t.pathname||"/";r(a)},[r,t.pathname]);return{query:e,setQuery:s,removeQuery:o,clearQueries:n}}import{useMemo as E}from"react";import{isClient as Q,FEATURE_STATUS as F}from"@donotdev/core";import{useAuthConfig as M}from"@donotdev/core";import*as O from"@donotdev/auth";import{DEGRADED_AUTH_API as U}from"@donotdev/core";var A=O?.useAuth;function L(e){return U[e]}function p(e){return A?A(e):L(e)}function j(e={}){let{auth:r,redirectTo:t,condition:s}=e,o=m(),n=M(),a=p("user"),u=p("can"),c=p("status");return E(()=>{if(!Q())return{shouldRedirect:!1,redirectTo:null,isChecking:!1};if(c===F.INITIALIZING)return{shouldRedirect:!1,redirectTo:null,isChecking:!0};if(s){let i=s(a,c);return{shouldRedirect:i,redirectTo:i&&t||null,isChecking:!1}}if(r!==!1&&r!==void 0){if(!u)return{shouldRedirect:!1,redirectTo:null,isChecking:!1};if(!u.navigate(r)){let i=null;return typeof r=="object"&&r.required&&!a?o.search?.includes("code=")||o.search?.includes("state=")||o.search?.includes("error=")?i=`${n.authRoute}${o.search}`:i=n.authRoute:typeof r=="object"&&r.role?i=n.roleRoute:typeof r=="object"&&r.tier?i=n.tierRoute:i=n.roleRoute,{shouldRedirect:!0,redirectTo:t||i,isChecking:!1}}}return{shouldRedirect:!1,redirectTo:null,isChecking:!1}},[r,c,a,u,s,t,o.search,n.authRoute,n.roleRoute,n.tierRoute])}export{k as useBack,m as useLocation,$ as useMatch,d as useNavigate,g as useParams,v as usePrefetch,K as useQueryParams,j as useRedirectGuard,T as useRefresh,C as useRouteParam,R as useSearchParams};
1
+ "use client";import{useRouter as p}from"next/navigation";import{isClient as k,useOverlayStore as v}from"@donotdev/core";function d(){let e=p(),r=v(t=>t.closeAll);return(t,s)=>{if(t==="back")return r(),e.back();if(r(),s?.preserveScroll&&k()){let o=window.scrollY;s?.replace?e.replace(t):e.push(t),requestAnimationFrame(()=>{window.scrollTo({top:o,behavior:"auto"})});return}return s?.replace?e.replace(t):e.push(t)}}function b(){let e=p();return()=>e.back()}function w(){let e=p();return()=>e.refresh()}function N(){let e=p();return r=>e.prefetch(r)}import{usePathname as T,useSearchParams as I}from"next/navigation";function l(){let e=T(),t=I().toString(),s=t?`?${t}`:void 0;return{pathname:e||"/",search:s,hash:"",state:null}}import{useParams as C}from"next/navigation";function g(){let e=C();return e||{}}function G(e){let t=g()[e];if(typeof t=="string")return t;if(Array.isArray(t)&&t.length>0)return t[0]}import{useSearchParams as $}from"next/navigation";function R(){return $()}import{usePathname as K}from"next/navigation";function O(e){let r=K(),t=e.replace(/:[^/]+/g,"([^/]+)").replace(/\*/g,".*"),s=new RegExp(`^${t}$`),o=r.match(s);if(!o)return null;let u=e.match(/:[^/]+/g)?.map(a=>a.slice(1))||[],n={};return u.forEach((a,c)=>{n[a]=o[c+1]||""}),{params:n,pathname:r,pattern:e}}import{useCallback as P}from"react";function U(){let e=R(),r=d(),t=l(),s=P((n,a)=>{let c=new URLSearchParams(e.toString());c.set(n,a);let f=c.toString(),i=`${t.pathname||"/"}${f?`?${f}`:""}`;r(i)},[e,r,t.pathname]),o=P(n=>{let a=new URLSearchParams(e.toString());a.delete(n);let c=a.toString(),m=`${t.pathname||"/"}${c?`?${c}`:""}`;r(m)},[e,r,t.pathname]),u=P(()=>{let n=t.pathname||"/";r(n)},[r,t.pathname]);return{query:e,setQuery:s,removeQuery:o,clearQueries:u}}import{useMemo as Q}from"react";import{isClient as F,FEATURE_STATUS as M}from"@donotdev/core";import{useAuthConfig as j}from"@donotdev/core";import*as S from"@donotdev/auth";import{DEGRADED_AUTH_API as L}from"@donotdev/core";var A=S?.useAuth;function E(e){return L[e]}function h(e){return A?A(e):E(e)}var ce=S?.PasswordResetCallback??(()=>null);function q(e={}){let{auth:r,redirectTo:t,condition:s}=e,o=l(),u=j(),n=h("user"),a=h("can"),c=h("status");return Q(()=>{let m={shouldRedirect:!1,redirectTo:null,isChecking:!1};if(!F())return m;if(c===M.INITIALIZING)return{...m,isChecking:!0};if(s){let i=s(n,c);return{shouldRedirect:i,redirectTo:i&&t||null,isChecking:!1}}if(r!==!1&&r!==void 0){if(!a)return m;if(!a.navigate(r)){let i=null;if(typeof r=="object"&&r.required&&!n){let y=o.search?.includes("code=")||o.search?.includes("state=")||o.search?.includes("error="),x=u.authRoute;y?i=`${x}${o.search}`:i=x}else typeof r=="object"&&r.role?i=u.roleRoute:typeof r=="object"&&r.tier?i=u.tierRoute:i=u.roleRoute;return{shouldRedirect:!0,redirectTo:t||i,isChecking:!1}}}return m},[r,c,n,a,s,t,o.search,u.authRoute,u.roleRoute,u.tierRoute])}export{b as useBack,l as useLocation,O as useMatch,d as useNavigate,g as useParams,N as usePrefetch,U as useQueryParams,q as useRedirectGuard,w as useRefresh,G as useRouteParam,R as useSearchParams};
@@ -1 +1 @@
1
- "use client";import{useCallback as m}from"react";import{useNavigate as P}from"react-router-dom";import{isClient as y,useOverlayStore as S}from"@donotdev/core";function h(){let e=P(),t=S(r=>r.closeAll);return m((r,i)=>r==="back"?(t(),e(-1)):(t(),i?.replace?e(r,{replace:!0}):e(r)),[e,t])}function v(){let e=P();return m(()=>e(-1),[e])}function k(){return m(()=>{y()&&window.location.reload()},[])}function T(){return m(e=>{},[])}import{useLocation as C}from"react-router-dom";function f(){return C()}import{useParams as I}from"react-router-dom";function d(){return I()}function b(e){let r=d()[e];if(typeof r=="string")return r;if(Array.isArray(r)&&r.length>0)return r[0]}import{useSearchParams as G}from"react-router-dom";function g(){return G()[0]}import{useMatch as w}from"react-router-dom";function L(e){return w(e)}import{useCallback as R}from"react";function N(){let e=g(),t=h(),r=f(),i=R((n,u)=>{let a=new URLSearchParams(e.toString());a.set(n,u);let l=a.toString(),A=`${r.pathname||"/"}${l?`?${l}`:""}`;t(A)},[e,t,r.pathname]),c=R(n=>{let u=new URLSearchParams(e.toString());u.delete(n);let a=u.toString(),o=`${r.pathname||"/"}${a?`?${a}`:""}`;t(o)},[e,t,r.pathname]),s=R(()=>{let n=r.pathname||"/";t(n)},[t,r.pathname]);return{query:e,setQuery:i,removeQuery:c,clearQueries:s}}import{useMemo as $}from"react";import{isClient as M,FEATURE_STATUS as Q}from"@donotdev/core";import{useAuthConfig as E}from"@donotdev/core";import*as K from"@donotdev/auth";import{DEGRADED_AUTH_API as O}from"@donotdev/core";var x=K?.useAuth;function U(e){return O[e]}function p(e){return x?x(e):U(e)}function _(e={}){let{auth:t,redirectTo:r,condition:i}=e,c=f(),s=E(),n=p("user"),u=p("can"),a=p("status");return $(()=>{if(!M())return{shouldRedirect:!1,redirectTo:null,isChecking:!1};if(a===Q.INITIALIZING)return{shouldRedirect:!1,redirectTo:null,isChecking:!0};if(i){let o=i(n,a);return{shouldRedirect:o,redirectTo:o&&r||null,isChecking:!1}}if(t!==!1&&t!==void 0){if(!u)return{shouldRedirect:!1,redirectTo:null,isChecking:!1};if(!u.navigate(t)){let o=null;return typeof t=="object"&&t.required&&!n?c.search.includes("code=")||c.search.includes("state=")||c.search.includes("error=")?o=`${s.authRoute}${c.search}`:o=s.authRoute:typeof t=="object"&&t.role?o=s.roleRoute:typeof t=="object"&&t.tier?o=s.tierRoute:o=s.roleRoute,{shouldRedirect:!0,redirectTo:r||o,isChecking:!1}}}return{shouldRedirect:!1,redirectTo:null,isChecking:!1}},[t,a,n,u,i,r,c.search,s.authRoute,s.roleRoute,s.tierRoute])}export{v as useBack,f as useLocation,L as useMatch,h as useNavigate,d as useParams,T as usePrefetch,N as useQueryParams,_ as useRedirectGuard,k as useRefresh,b as useRouteParam,g as useSearchParams};
1
+ "use client";import{useNavigate as P}from"react-router-dom";import{isClient as v,useOverlayStore as k}from"@donotdev/core";function h(){let e=P(),r=k(t=>t.closeAll);return(t,i)=>t==="back"?(r(),e(-1)):(r(),i?.replace?e(t,{replace:!0}):e(t))}function I(){let e=P();return()=>e(-1)}function b(){return()=>{v()&&window.location.reload()}}function w(){return e=>{}}import{useLocation as C}from"react-router-dom";function m(){return C()}import{useParams as G}from"react-router-dom";function d(){return G()}function T(e){let t=d()[e];if(typeof t=="string")return t;if(Array.isArray(t)&&t.length>0)return t[0]}import{useSearchParams as N}from"react-router-dom";function R(){return N()[0]}import{useMatch as L}from"react-router-dom";function K(e){return L(e)}import{useCallback as g}from"react";function U(){let e=R(),r=h(),t=m(),i=g((n,u)=>{let a=new URLSearchParams(e.toString());a.set(n,u);let l=a.toString(),o=`${t.pathname||"/"}${l?`?${l}`:""}`;r(o)},[e,r,t.pathname]),c=g(n=>{let u=new URLSearchParams(e.toString());u.delete(n);let a=u.toString(),f=`${t.pathname||"/"}${a?`?${a}`:""}`;r(f)},[e,r,t.pathname]),s=g(()=>{let n=t.pathname||"/";r(n)},[r,t.pathname]);return{query:e,setQuery:i,removeQuery:c,clearQueries:s}}import{useMemo as M}from"react";import{isClient as Q,FEATURE_STATUS as E}from"@donotdev/core";import{useAuthConfig as _}from"@donotdev/core";import*as y from"@donotdev/auth";import{DEGRADED_AUTH_API as O}from"@donotdev/core";var x=y?.useAuth;function $(e){return O[e]}function p(e){return x?x(e):$(e)}var ue=y?.PasswordResetCallback??(()=>null);function j(e={}){let{auth:r,redirectTo:t,condition:i}=e,c=m(),s=_(),n=p("user"),u=p("can"),a=p("status");return M(()=>{let f={shouldRedirect:!1,redirectTo:null,isChecking:!1};if(!Q())return f;if(a===E.INITIALIZING)return{...f,isChecking:!0};if(i){let o=i(n,a);return{shouldRedirect:o,redirectTo:o&&t||null,isChecking:!1}}if(r!==!1&&r!==void 0){if(!u)return f;if(!u.navigate(r)){let o=null;if(typeof r=="object"&&r.required&&!n){let S=c.search.includes("code=")||c.search.includes("state=")||c.search.includes("error="),A=s.authRoute;S?o=`${A}${c.search}`:o=A}else typeof r=="object"&&r.role?o=s.roleRoute:typeof r=="object"&&r.tier?o=s.tierRoute:o=s.roleRoute;return{shouldRedirect:!0,redirectTo:t||o,isChecking:!1}}}return f},[r,a,n,u,i,t,c.search,s.authRoute,s.roleRoute,s.tierRoute])}export{I as useBack,m as useLocation,K as useMatch,h as useNavigate,d as useParams,w as usePrefetch,U as useQueryParams,j as useRedirectGuard,b as useRefresh,T as useRouteParam,R as useSearchParams};
@@ -1,4 +1,8 @@
1
1
  import type { NavigateOptions } from './types';
2
+ /**
3
+ * Navigation hook. Auth is handled by AuthGuard (cold-load redirect).
4
+ * Protected routes are hidden from unauthorized users via useAccessibleRoutes.
5
+ */
2
6
  export declare function useNavigate(): (to: string, options?: NavigateOptions) => void;
3
7
  export declare function useBack(): () => void;
4
8
  export declare function useRefresh(): () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useNavigate.next.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useNavigate.next.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,WAAW,SAKlB,MAAM,YAAY,eAAe,UA0BzC;AAED,wBAAgB,OAAO,eAGtB;AAED,wBAAgB,UAAU,eAGzB;AAED,wBAAgB,WAAW,SAED,MAAM,UAC/B"}
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"}
@@ -4,17 +4,20 @@
4
4
  * @fileoverview Next.js-specific navigation hooks
5
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 { useCallback } from 'react';
13
12
  import { isClient, useOverlayStore } from '@donotdev/core';
13
+ /**
14
+ * Navigation hook. Auth is handled by AuthGuard (cold-load redirect).
15
+ * Protected routes are hidden from unauthorized users via useAccessibleRoutes.
16
+ */
14
17
  export function useNavigate() {
15
18
  const router = useNextRouter();
16
19
  const closeAll = useOverlayStore((state) => state.closeAll);
17
- return useCallback((to, options) => {
20
+ return (to, options) => {
18
21
  if (to === 'back') {
19
22
  closeAll();
20
23
  return router.back();
@@ -36,17 +39,17 @@ export function useNavigate() {
36
39
  if (options?.replace)
37
40
  return router.replace(to);
38
41
  return router.push(to);
39
- }, [router, closeAll]);
42
+ };
40
43
  }
41
44
  export function useBack() {
42
45
  const router = useNextRouter();
43
- return useCallback(() => router.back(), [router]);
46
+ return () => router.back();
44
47
  }
45
48
  export function useRefresh() {
46
49
  const router = useNextRouter();
47
- return useCallback(() => router.refresh(), [router]);
50
+ return () => router.refresh();
48
51
  }
49
52
  export function usePrefetch() {
50
53
  const router = useNextRouter();
51
- return useCallback((to) => router.prefetch(to), [router]);
54
+ return (to) => router.prefetch(to);
52
55
  }
@@ -1,4 +1,8 @@
1
1
  import type { NavigateOptions } from './types';
2
+ /**
3
+ * Navigation hook. Auth is handled by AuthGuard (cold-load redirect).
4
+ * Protected routes are hidden from unauthorized users via useAccessibleRoutes.
5
+ */
2
6
  export declare function useNavigate(): (to: string, options?: NavigateOptions) => void | Promise<void>;
3
7
  export declare function useBack(): () => void | Promise<void>;
4
8
  export declare function useRefresh(): () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useNavigate.vite.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useNavigate.vite.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,WAAW,SAKlB,MAAM,YAAY,eAAe,0BAazC;AAED,wBAAgB,OAAO,+BAGtB;AAED,wBAAgB,UAAU,eAIzB;AAED,wBAAgB,WAAW,UACA,MAAM,UAGhC"}
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"}
@@ -4,39 +4,42 @@
4
4
  * @fileoverview Vite-specific navigation hooks
5
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
- import { useCallback } from 'react';
12
11
  import { useNavigate as useRouterNavigate } from 'react-router-dom';
13
12
  import { isClient, useOverlayStore } from '@donotdev/core';
13
+ /**
14
+ * Navigation hook. Auth is handled by AuthGuard (cold-load redirect).
15
+ * Protected routes are hidden from unauthorized users via useAccessibleRoutes.
16
+ */
14
17
  export function useNavigate() {
15
- const navigate = useRouterNavigate();
18
+ const routerNavigate = useRouterNavigate();
16
19
  const closeAll = useOverlayStore((state) => state.closeAll);
17
- return useCallback((to, options) => {
20
+ return (to, options) => {
18
21
  if (to === 'back') {
19
22
  closeAll();
20
- return navigate(-1);
23
+ return routerNavigate(-1);
21
24
  }
22
25
  closeAll();
23
26
  if (options?.replace)
24
- return navigate(to, { replace: true });
25
- return navigate(to);
26
- }, [navigate, closeAll]);
27
+ return routerNavigate(to, { replace: true });
28
+ return routerNavigate(to);
29
+ };
27
30
  }
28
31
  export function useBack() {
29
32
  const navigate = useRouterNavigate();
30
- return useCallback(() => navigate(-1), [navigate]);
33
+ return () => navigate(-1);
31
34
  }
32
35
  export function useRefresh() {
33
- return useCallback(() => {
36
+ return () => {
34
37
  if (isClient())
35
38
  window.location.reload();
36
- }, []);
39
+ };
37
40
  }
38
41
  export function usePrefetch() {
39
- return useCallback((_to) => {
42
+ return (_to) => {
40
43
  // Vite: no-op
41
- }, []);
44
+ };
42
45
  }
@@ -1,4 +1,5 @@
1
1
  import type { PageAuth, FeatureStatus } from '@donotdev/core';
2
+ /** Configuration options for the redirect guard hook. */
2
3
  export interface RedirectGuardOptions {
3
4
  /** Auth configuration for this route */
4
5
  auth?: PageAuth | false;
@@ -7,6 +8,7 @@ export interface RedirectGuardOptions {
7
8
  /** Custom condition function to check if redirect should happen */
8
9
  condition?: (user: any, status: FeatureStatus) => boolean;
9
10
  }
11
+ /** Return value of the useRedirectGuard hook. */
10
12
  export interface RedirectGuardResult {
11
13
  /** Whether redirect should happen */
12
14
  shouldRedirect: boolean;
@@ -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,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,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,CA6GrB"}
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,21 +32,17 @@ export function useRedirectGuard(options = {}) {
32
32
  const status = useAuthSafe('status');
33
33
  // Determine redirect state
34
34
  const redirectState = useMemo(() => {
35
+ const noAction = {
36
+ shouldRedirect: false,
37
+ redirectTo: null,
38
+ isChecking: false,
39
+ };
35
40
  // SSR-safe: return safe defaults on server
36
- if (!isClient()) {
37
- return {
38
- shouldRedirect: false,
39
- redirectTo: null,
40
- isChecking: false,
41
- };
42
- }
41
+ if (!isClient())
42
+ return noAction;
43
43
  // Only INITIALIZING = still checking. DEGRADED/ERROR/READY = auth resolved (proceed with current user)
44
44
  if (status === FEATURE_STATUS.INITIALIZING) {
45
- return {
46
- shouldRedirect: false,
47
- redirectTo: null,
48
- isChecking: true,
49
- };
45
+ return { ...noAction, isChecking: true };
50
46
  }
51
47
  // Custom condition provided
52
48
  if (condition) {
@@ -59,27 +55,23 @@ export function useRedirectGuard(options = {}) {
59
55
  }
60
56
  // Use auth config to determine redirect
61
57
  if (auth !== false && auth !== undefined) {
62
- if (!can) {
63
- return {
64
- shouldRedirect: false,
65
- redirectTo: null,
66
- isChecking: false,
67
- };
68
- }
58
+ if (!can)
59
+ return noAction;
69
60
  // Check if user can navigate to this route
70
61
  if (!can.navigate(auth)) {
71
62
  let targetRoute = null;
72
- // Authentication failure (not logged in)
63
+ // Authentication failure (not logged in) → always redirect
73
64
  if (typeof auth === 'object' && auth.required && !user) {
74
65
  // Check if we have OAuth parameters that need to be preserved
75
66
  const hasOAuthParams = location.search?.includes('code=') ||
76
67
  location.search?.includes('state=') ||
77
68
  location.search?.includes('error=');
69
+ const authRoute = authConfig.authRoute;
78
70
  if (hasOAuthParams) {
79
- targetRoute = `${authConfig.authRoute}${location.search}`;
71
+ targetRoute = `${authRoute}${location.search}`;
80
72
  }
81
73
  else {
82
- targetRoute = authConfig.authRoute;
74
+ targetRoute = authRoute;
83
75
  }
84
76
  }
85
77
  // Authorization failure (wrong role)
@@ -102,11 +94,7 @@ export function useRedirectGuard(options = {}) {
102
94
  }
103
95
  }
104
96
  // No redirect needed
105
- return {
106
- shouldRedirect: false,
107
- redirectTo: null,
108
- isChecking: false,
109
- };
97
+ return noAction;
110
98
  }, [
111
99
  auth,
112
100
  status,
@@ -1,4 +1,5 @@
1
1
  import type { PageAuth, FeatureStatus } from '@donotdev/core';
2
+ /** Configuration options for the redirect guard hook. */
2
3
  export interface RedirectGuardOptions {
3
4
  /** Auth configuration for this route */
4
5
  auth?: PageAuth | false;
@@ -7,6 +8,7 @@ export interface RedirectGuardOptions {
7
8
  /** Custom condition function to check if redirect should happen */
8
9
  condition?: (user: any, status: FeatureStatus) => boolean;
9
10
  }
11
+ /** Return value of the useRedirectGuard hook. */
10
12
  export interface RedirectGuardResult {
11
13
  /** Whether redirect should happen */
12
14
  shouldRedirect: boolean;
@@ -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,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,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,CA6GrB"}
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,21 +32,17 @@ export function useRedirectGuard(options = {}) {
32
32
  const status = useAuthSafe('status');
33
33
  // Determine redirect state
34
34
  const redirectState = useMemo(() => {
35
+ const noAction = {
36
+ shouldRedirect: false,
37
+ redirectTo: null,
38
+ isChecking: false,
39
+ };
35
40
  // SSR-safe: return safe defaults on server
36
- if (!isClient()) {
37
- return {
38
- shouldRedirect: false,
39
- redirectTo: null,
40
- isChecking: false,
41
- };
42
- }
41
+ if (!isClient())
42
+ return noAction;
43
43
  // Only INITIALIZING = still checking. DEGRADED/ERROR/READY = auth resolved (proceed with current user)
44
44
  if (status === FEATURE_STATUS.INITIALIZING) {
45
- return {
46
- shouldRedirect: false,
47
- redirectTo: null,
48
- isChecking: true,
49
- };
45
+ return { ...noAction, isChecking: true };
50
46
  }
51
47
  // Custom condition provided
52
48
  if (condition) {
@@ -59,27 +55,23 @@ export function useRedirectGuard(options = {}) {
59
55
  }
60
56
  // Use auth config to determine redirect
61
57
  if (auth !== false && auth !== undefined) {
62
- if (!can) {
63
- return {
64
- shouldRedirect: false,
65
- redirectTo: null,
66
- isChecking: false,
67
- };
68
- }
58
+ if (!can)
59
+ return noAction;
69
60
  // Check if user can navigate to this route
70
61
  if (!can.navigate(auth)) {
71
62
  let targetRoute = null;
72
- // Authentication failure (not logged in)
63
+ // Authentication failure (not logged in) → always redirect
73
64
  if (typeof auth === 'object' && auth.required && !user) {
74
65
  // Check if we have OAuth parameters that need to be preserved
75
66
  const hasOAuthParams = location.search.includes('code=') ||
76
67
  location.search.includes('state=') ||
77
68
  location.search.includes('error=');
69
+ const authRoute = authConfig.authRoute;
78
70
  if (hasOAuthParams) {
79
- targetRoute = `${authConfig.authRoute}${location.search}`;
71
+ targetRoute = `${authRoute}${location.search}`;
80
72
  }
81
73
  else {
82
- targetRoute = authConfig.authRoute;
74
+ targetRoute = authRoute;
83
75
  }
84
76
  }
85
77
  // Authorization failure (wrong role)
@@ -102,11 +94,7 @@ export function useRedirectGuard(options = {}) {
102
94
  }
103
95
  }
104
96
  // No redirect needed
105
- return {
106
- shouldRedirect: false,
107
- redirectTo: null,
108
- isChecking: false,
109
- };
97
+ return noAction;
110
98
  }, [
111
99
  auth,
112
100
  status,
@@ -10,6 +10,7 @@
10
10
  export * from './Link';
11
11
  export * from './AuthGuard';
12
12
  export * from './AuthGuardFallback';
13
+ export { AuthReturnTo } from './AuthReturnTo';
13
14
  export * from './GoTo';
14
15
  export { default as GoToWrapper } from './GoToWrapper';
15
16
  export { default as GoToInput } from './GoToInput';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routing/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAGH,cAAc,QAAQ,CAAC;AAGvB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,OAAO,CAAC;AAOhD,OAAO,EACL,WAAW,EACX,OAAO,EACP,UAAU,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,eAAe,EACf,QAAQ,EACR,cAAc,EACd,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routing/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAGH,cAAc,QAAQ,CAAC;AAGvB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,OAAO,CAAC;AAOhD,OAAO,EACL,WAAW,EACX,OAAO,EACP,UAAU,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,eAAe,EACf,QAAQ,EACR,cAAc,EACd,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
@@ -14,6 +14,7 @@ export * from './Link';
14
14
  // Public API: HeaderNavigation (path prop for single item), DnDevNavigationMenu (full menu).
15
15
  export * from './AuthGuard';
16
16
  export * from './AuthGuardFallback';
17
+ export { AuthReturnTo } from './AuthReturnTo';
17
18
  export * from './GoTo';
18
19
  export { default as GoToWrapper } from './GoToWrapper';
19
20
  export { default as GoToInput } from './GoToInput';
@@ -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);