@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
@@ -1 +1 @@
1
- {"version":3,"file":"NextJsAutoMetaTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/NextJsAutoMetaTags.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,UAAU,cAAc;IACtB,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED,UAAU,aAAa;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,uBAAuB;IAC/B,kCAAkC;IAClC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AA+DD;;;;;;;;GAQG;AACH,QAAA,MAAM,kBAAkB,EAAE,aAAa,CAAC,uBAAuB,CA8L9D,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"NextJsAutoMetaTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/NextJsAutoMetaTags.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,UAAU,cAAc;IACtB,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED,UAAU,aAAa;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,UAAU,uBAAuB;IAC/B,kCAAkC;IAClC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAkFD;;;;;;;;GAQG;AACH,QAAA,MAAM,kBAAkB,EAAE,aAAa,CAAC,uBAAuB,CA6M9D,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -39,6 +39,22 @@ function matchRoutePath(pattern, pathname) {
39
39
  }
40
40
  return true;
41
41
  }
42
+ /**
43
+ * Resolve SEO field with i18n fallback
44
+ * @description
45
+ * - `undefined` → i18n lookup
46
+ * - `string` → use literal value
47
+ * - `null` → omit (return undefined)
48
+ */
49
+ function resolveSeoField(seoValue, translationKey, t) {
50
+ if (seoValue === null)
51
+ return undefined; // Explicit null = omit
52
+ if (seoValue !== undefined)
53
+ return seoValue; // Explicit string = use it
54
+ // undefined = i18n lookup
55
+ const translated = t(translationKey);
56
+ return translated !== translationKey ? translated : undefined;
57
+ }
42
58
  /**
43
59
  * Get route metadata from config (injected by build system).
44
60
  * Resolves dynamic routes by pattern so PageMeta (including namespace) is used for SEO.
@@ -101,26 +117,40 @@ const NextJsAutoMetaTags = ({ config = {}, routeMeta: routeMetaOverride, title:
101
117
  // Construct absolute URL for canonical link
102
118
  const currentUrl = `${baseUrl}${pathname || '/'}`;
103
119
  const ns = finalRouteMeta.ns || defaultNamespace;
104
- // Get meta tags from translation files
105
- const pageTitle = finalRouteMeta.title || t(`${ns}:title`);
106
- const pageDescription = finalRouteMeta.description || t(`${ns}:description`);
107
- // Get the meta object and destructure it properly
120
+ const seo = finalRouteMeta.seo;
121
+ // Get the meta object from i18n (for image, type, keywords, author, fullTitle)
108
122
  const metaObject = t(`${ns}:meta`, { returnObjects: true });
109
- const pageImage = finalRouteMeta.image || metaObject?.image || defaultImage;
110
- const pageType = finalRouteMeta.type || metaObject?.type || 'website';
111
- const pageKeywords = finalRouteMeta.keywords || metaObject?.keywords;
123
+ // Title resolution priority:
124
+ // 1. i18n meta.fullTitle → translated, language-aware (wins)
125
+ // 2. seo.fullTitle (static PageMeta) → fallback for non-i18n apps
126
+ // 3. seo.title (explicit) → "title | siteName"
127
+ // 4. i18n ns:title → "translated | siteName"
128
+ // 5. siteName only (when seo.title === null or no translation)
129
+ let fullTitle;
130
+ if (metaObject?.fullTitle) {
131
+ // i18n fullTitle (ns:meta.fullTitle) → translated, takes priority
132
+ fullTitle = metaObject.fullTitle;
133
+ }
134
+ else if (seo?.fullTitle) {
135
+ // Static fullTitle in PageMeta → fallback for non-i18n apps
136
+ fullTitle = seo.fullTitle;
137
+ }
138
+ else {
139
+ // Standard resolution: title | siteName
140
+ const pageTitle = resolveSeoField(seo?.title, `${ns}:title`, t);
141
+ fullTitle = pageTitle ? `${pageTitle} | ${siteName}` : siteName;
142
+ }
143
+ // Description resolution: seo.description > i18n
144
+ const description = resolveSeoField(seo?.description, `${ns}:description`, t);
145
+ // Other meta fields: seo > i18n meta object > defaults
146
+ const pageImage = seo?.image || metaObject?.image || defaultImage;
147
+ const pageType = seo?.type || metaObject?.type || 'website';
148
+ const pageKeywords = seo?.keywords || metaObject?.keywords;
112
149
  const pageAuthor = finalRouteMeta.author || metaObject?.author;
113
- // Only use values that are actually defined (not empty strings or undefined)
114
- const title = pageTitle && pageTitle !== `${ns}:title` ? pageTitle : undefined;
115
- const description = pageDescription && pageDescription !== `${ns}:description`
116
- ? pageDescription
117
- : undefined;
118
150
  const image = pageImage || undefined;
119
151
  const type = pageType || 'website';
120
152
  const keywords = pageKeywords || undefined;
121
153
  const author = pageAuthor || undefined;
122
- // Build full title with site name if title exists, otherwise just use site name
123
- const fullTitle = title ? `${title} | ${siteName}` : siteName;
124
154
  // Use relative image path instead of constructing absolute URL
125
155
  // This prevents crashes from invalid baseUrl and works in all modes
126
156
  const imagePath = image && image.startsWith('http') ? image : image ? image : undefined;
@@ -130,7 +160,7 @@ const NextJsAutoMetaTags = ({ config = {}, routeMeta: routeMetaOverride, title:
130
160
  image: imagePath,
131
161
  url: currentUrl,
132
162
  type,
133
- noindex: finalRouteMeta.noindex || false,
163
+ noindex: seo?.noindex || finalRouteMeta.noindex || false,
134
164
  keywords,
135
165
  author,
136
166
  publishDate: finalRouteMeta.publishDate,
@@ -1 +1 @@
1
- {"version":3,"file":"PWAUpdateNotification.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/PWAUpdateNotification.tsx"],"names":[],"mappings":"AAwBA,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,qBAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE,0BAA0B,QAsHtE;AAED,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"PWAUpdateNotification.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/PWAUpdateNotification.tsx"],"names":[],"mappings":"AAwBA,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,qBAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE,0BAA0B,QAoItE;AAED,eAAe,qBAAqB,CAAC"}
@@ -49,6 +49,11 @@ function PWAUpdateNotification({ onUpdate }) {
49
49
  window.location.reload();
50
50
  };
51
51
  navigator.serviceWorker.addEventListener('controllerchange', handleControllerChange);
52
+ // Track listeners for cleanup
53
+ let currentReg = null;
54
+ let handleUpdateFound = null;
55
+ let trackedWorker = null;
56
+ let handleStateChange = null;
52
57
  const checkForUpdates = async () => {
53
58
  // CSR guard: Check client again
54
59
  if (!isClient())
@@ -56,11 +61,13 @@ function PWAUpdateNotification({ onUpdate }) {
56
61
  try {
57
62
  const reg = await navigator.serviceWorker.ready;
58
63
  registrationRef.current = reg;
59
- const handleUpdateFound = () => {
64
+ currentReg = reg;
65
+ handleUpdateFound = () => {
60
66
  const newWorker = reg.installing;
61
67
  if (!newWorker)
62
68
  return;
63
- const handleStateChange = () => {
69
+ trackedWorker = newWorker;
70
+ handleStateChange = () => {
64
71
  if (newWorker.state === 'installed' &&
65
72
  navigator.serviceWorker.controller &&
66
73
  !toastIdRef.current) {
@@ -109,6 +116,12 @@ function PWAUpdateNotification({ onUpdate }) {
109
116
  if (isClient() && 'serviceWorker' in navigator) {
110
117
  navigator.serviceWorker.removeEventListener('controllerchange', handleControllerChange);
111
118
  }
119
+ if (currentReg && handleUpdateFound) {
120
+ currentReg.removeEventListener('updatefound', handleUpdateFound);
121
+ }
122
+ if (trackedWorker && handleStateChange) {
123
+ trackedWorker.removeEventListener('statechange', handleStateChange);
124
+ }
112
125
  clearInterval(interval);
113
126
  };
114
127
  }, [onUpdate]);
@@ -1 +1 @@
1
- {"version":3,"file":"moolti.d.ts","sourceRoot":"","sources":["../../../../../src/internal/layout/config/presets/moolti.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAUnD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,EAAE,YAgD1B,CAAC"}
1
+ {"version":3,"file":"moolti.d.ts","sourceRoot":"","sources":["../../../../../src/internal/layout/config/presets/moolti.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA6BnD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,EAAE,YAqB1B,CAAC"}
@@ -14,7 +14,10 @@ import { LanguageSelector } from '@donotdev/core';
14
14
  import { AuthHeader } from '../../../../components/auth';
15
15
  import { AppBranding, ThemeToggle, } from '../../../../components/layout/components';
16
16
  import { DnDevNavigationMenu, GoTo } from '../../../../routing';
17
- import { FooterCopyright } from '../../components';
17
+ import { FooterCopyright, FooterLegalLinks } from '../../components';
18
+ const sidebarTop = () => _jsx(AppBranding, { display: DISPLAY.AUTO });
19
+ const sidebarContent = () => (_jsxs(_Fragment, { children: [_jsx(GoTo, { display: DISPLAY.AUTO }), _jsx(DnDevNavigationMenu, { vertical: true, display: DISPLAY.AUTO })] }));
20
+ const sidebarBottom = () => (_jsxs(Stack, { direction: "column", gap: "tight", align: "stretch", children: [_jsx(AuthHeader, { display: DISPLAY.AUTO }), _jsx(LanguageSelector, { display: DISPLAY.AUTO }), _jsx(ThemeToggle, { display: DISPLAY.AUTO }), _jsx(FooterLegalLinks, { direction: "column" }), _jsx(FooterCopyright, {})] }));
18
21
  /**
19
22
  * Moolti preset - SaaS app layout
20
23
  *
@@ -30,9 +33,9 @@ import { FooterCopyright } from '../../components';
30
33
  export const mooltiPreset = {
31
34
  name: 'moolti',
32
35
  sidebar: {
33
- top: () => _jsx(AppBranding, { display: DISPLAY.AUTO }),
34
- content: () => (_jsxs(_Fragment, { children: [_jsx(GoTo, { display: DISPLAY.AUTO }), _jsx(DnDevNavigationMenu, { vertical: true, display: DISPLAY.AUTO })] })),
35
- bottom: () => (_jsxs(Stack, { direction: "column", gap: "tight", align: "stretch", children: [_jsx(AuthHeader, { display: DISPLAY.AUTO }), _jsx(LanguageSelector, { display: DISPLAY.AUTO }), _jsx(ThemeToggle, { display: DISPLAY.AUTO }), _jsx(FooterCopyright, {})] })),
36
+ top: sidebarTop,
37
+ content: sidebarContent,
38
+ bottom: sidebarBottom,
36
39
  defaultWidth: 256,
37
40
  minWidth: 48,
38
41
  maxWidth: 400,
@@ -40,15 +43,10 @@ export const mooltiPreset = {
40
43
  mobile: {
41
44
  mergedBar: {
42
45
  position: 'top',
43
- // Desktop → Mobile mapping:
44
- trigger: () => _jsx(AppBranding, { display: DISPLAY.AUTO }), // sidebar.top → trigger (AppBranding)
45
- top: () => null, // No header.center → top is null
46
- content: () => (
47
- // sidebar.content → content (GoTo + NavigationMenu)
48
- _jsxs(_Fragment, { children: [_jsx(GoTo, { display: DISPLAY.AUTO }), _jsx(DnDevNavigationMenu, { vertical: true, display: DISPLAY.AUTO })] })),
49
- bottom: () => (
50
- // sidebar.bottom → bottom (Auth, Language, Theme, Footer)
51
- _jsxs(Stack, { direction: "column", gap: "tight", align: "stretch", children: [_jsx(AuthHeader, { display: DISPLAY.AUTO }), _jsx(LanguageSelector, { display: DISPLAY.AUTO }), _jsx(ThemeToggle, { display: DISPLAY.AUTO }), _jsx(FooterCopyright, {})] })),
46
+ trigger: sidebarTop,
47
+ top: () => null,
48
+ content: sidebarContent,
49
+ bottom: sidebarBottom,
52
50
  },
53
51
  },
54
52
  };
@@ -1,6 +1,8 @@
1
1
  import type { AppMetadata } from '@donotdev/core';
2
2
  import type { ReactNode } from 'react';
3
3
  export interface DnDevFooterProps {
4
+ /** Custom mode: full zone replacement. When provided, app prop is ignored and no polish CSS applies. */
5
+ children?: ReactNode;
4
6
  /** App metadata for copyright/links */
5
7
  app?: AppMetadata;
6
8
  }
@@ -24,7 +26,7 @@ export interface DnDevFooterProps {
24
26
  * preset-specific visibility (moolti/plain hide footer, blog hides on mobile).
25
27
  * DO NOT change role, tag, or className.
26
28
  */
27
- declare function DnDevFooterComponent({ app }: DnDevFooterProps): ReactNode;
29
+ declare function DnDevFooterComponent({ children, app, }: DnDevFooterProps): ReactNode;
28
30
  export declare const DnDevFooter: import("react").MemoExoticComponent<typeof DnDevFooterComponent>;
29
31
  export {};
30
32
  //# sourceMappingURL=DnDevFooter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DnDevFooter.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/zones/DnDevFooter.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAUlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,GAAG,CAAC,EAAE,WAAW,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,oBAAoB,CAAC,EAAE,GAAQ,EAAE,EAAE,gBAAgB,GAAG,SAAS,CA8EvE;AAED,eAAO,MAAM,WAAW,kEAA6B,CAAC"}
1
+ {"version":3,"file":"DnDevFooter.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/zones/DnDevFooter.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAUlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,gBAAgB;IAC/B,wGAAwG;IACxG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,uCAAuC;IACvC,GAAG,CAAC,EAAE,WAAW,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,oBAAoB,CAAC,EAC5B,QAAQ,EACR,GAAQ,GACT,EAAE,gBAAgB,GAAG,SAAS,CAuF9B;AAED,eAAO,MAAM,WAAW,kEAA6B,CAAC"}
@@ -38,11 +38,15 @@ import { getLegalLinks, } from '../components/footer/useLegalLinks';
38
38
  * preset-specific visibility (moolti/plain hide footer, blog hides on mobile).
39
39
  * DO NOT change role, tag, or className.
40
40
  */
41
- function DnDevFooterComponent({ app = {} }) {
41
+ function DnDevFooterComponent({ children, app = {}, }) {
42
42
  const { t } = useTranslation('dndev');
43
43
  const isLaptopOrDesktop = useBreakpoint('isLaptopOrDesktop');
44
44
  // Get legal links (defaults or custom) — must be called before any return
45
45
  const links = getLegalLinks(app?.footer);
46
+ // Custom mode: consumer owns zone visuals, structural wrapper only
47
+ if (children !== undefined) {
48
+ return (_jsx("footer", { role: "contentinfo", className: "footer", "data-custom": true, children: children }));
49
+ }
46
50
  // Explicit null hides footer
47
51
  if (app?.footer === null) {
48
52
  return null;
@@ -1,5 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  export interface DnDevHeaderProps {
3
+ /** Custom mode: full zone replacement. When provided, slot props are ignored and no polish CSS applies. */
4
+ children?: ReactNode;
3
5
  /** Start slot - ReactNode from preset or consumer override */
4
6
  start?: ReactNode | null;
5
7
  /** Center slot - ReactNode from preset or consumer override */
@@ -20,7 +22,7 @@ export interface DnDevHeaderProps {
20
22
  * and preset-specific rules (e.g. landing compact mode, mergedBar hiding).
21
23
  * DO NOT change role, tag, or classNames.
22
24
  */
23
- declare function DnDevHeaderComponent({ start, center, end, }: DnDevHeaderProps): ReactNode;
25
+ declare function DnDevHeaderComponent({ children, start, center, end, }: DnDevHeaderProps): ReactNode;
24
26
  export declare const DnDevHeader: import("react").MemoExoticComponent<typeof DnDevHeaderComponent>;
25
27
  export {};
26
28
  //# sourceMappingURL=DnDevHeader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DnDevHeader.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/zones/DnDevHeader.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B,4DAA4D;IAC5D,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,oBAAoB,CAAC,EAC5B,KAAK,EACL,MAAM,EACN,GAAG,GACJ,EAAE,gBAAgB,GAAG,SAAS,CAgB9B;AAED,eAAO,MAAM,WAAW,kEAA6B,CAAC"}
1
+ {"version":3,"file":"DnDevHeader.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/zones/DnDevHeader.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAC/B,2GAA2G;IAC3G,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B,4DAA4D;IAC5D,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,oBAAoB,CAAC,EAC5B,QAAQ,EACR,KAAK,EACL,MAAM,EACN,GAAG,GACJ,EAAE,gBAAgB,GAAG,SAAS,CAsB9B;AAED,eAAO,MAAM,WAAW,kEAA6B,CAAC"}
@@ -28,8 +28,13 @@ import { cn } from '@donotdev/components';
28
28
  * and preset-specific rules (e.g. landing compact mode, mergedBar hiding).
29
29
  * DO NOT change role, tag, or classNames.
30
30
  */
31
- function DnDevHeaderComponent({ start, center, end, }) {
32
- // Check if center has content
31
+ function DnDevHeaderComponent({ children, start, center, end, }) {
32
+ // Custom mode: children provided = consumer owns zone visuals
33
+ const isCustom = children !== undefined;
34
+ if (isCustom) {
35
+ return (_jsx("header", { role: "banner", className: "header", "data-custom": true, children: children }));
36
+ }
37
+ // Slotted mode: framework slot layout with polish CSS
33
38
  const hasCenter = center !== null && center !== undefined;
34
39
  return (_jsxs("header", { role: "banner", className: "header", children: [_jsx("div", { className: "header-start", children: start }), hasCenter && _jsx("div", { className: "header-center", children: center }), _jsx("div", { className: "header-end", children: end })] }));
35
40
  }
@@ -1,5 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  export interface DnDevSidebarProps {
3
+ /** Custom mode: full zone replacement. When provided, slot props are ignored and no polish CSS applies. */
4
+ children?: ReactNode;
3
5
  /** Top slot - ReactNode from preset or consumer override */
4
6
  top?: ReactNode | null;
5
7
  /** Content slot - ReactNode from preset or consumer override */
@@ -23,7 +25,7 @@ export interface DnDevSidebarProps {
23
25
  * targets `aside[role='navigation'].sidebar`. Removing it silently breaks every sidebar feature.
24
26
  * DO NOT remove or change role="navigation" under any circumstance.
25
27
  */
26
- declare function DnDevSidebarComponent({ top, content, bottom, defaultWidth, minWidth, maxWidth, }: DnDevSidebarProps): ReactNode;
28
+ declare function DnDevSidebarComponent({ children, top, content, bottom, defaultWidth, minWidth, maxWidth, }: DnDevSidebarProps): ReactNode;
27
29
  export declare const DnDevSidebar: import("react").MemoExoticComponent<typeof DnDevSidebarComponent>;
28
30
  export {};
29
31
  //# sourceMappingURL=DnDevSidebar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DnDevSidebar.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/zones/DnDevSidebar.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,MAAM,WAAW,iBAAiB;IAChC,4DAA4D;IAC5D,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACvB,gEAAgE;IAChE,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,iBAAS,qBAAqB,CAAC,EAC7B,GAAG,EACH,OAAO,EACP,MAAM,EACN,YAAiD,EACjD,QAAyC,EACzC,QAAyC,GAC1C,EAAE,iBAAiB,GAAG,SAAS,CAyM/B;AAED,eAAO,MAAM,YAAY,mEAA8B,CAAC"}
1
+ {"version":3,"file":"DnDevSidebar.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/zones/DnDevSidebar.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,MAAM,WAAW,iBAAiB;IAChC,2GAA2G;IAC3G,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4DAA4D;IAC5D,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACvB,gEAAgE;IAChE,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,iBAAS,qBAAqB,CAAC,EAC7B,QAAQ,EACR,GAAG,EACH,OAAO,EACP,MAAM,EACN,YAAiD,EACjD,QAAyC,EACzC,QAAyC,GAC1C,EAAE,iBAAiB,GAAG,SAAS,CA+M/B;AAED,eAAO,MAAM,YAAY,mEAA8B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // packages/ui/src/internal/layout/zones/DnDevSidebar.tsx
3
3
  /**
4
4
  * @fileoverview DnDevSidebar Zone Component
@@ -28,7 +28,9 @@ const RESIZE_HANDLE_WIDTH = 6;
28
28
  * targets `aside[role='navigation'].sidebar`. Removing it silently breaks every sidebar feature.
29
29
  * DO NOT remove or change role="navigation" under any circumstance.
30
30
  */
31
- function DnDevSidebarComponent({ top, content, bottom, defaultWidth = DEFAULT_SLOTS.sidebar.defaultWidth, minWidth = DEFAULT_SLOTS.sidebar.minWidth, maxWidth = DEFAULT_SLOTS.sidebar.maxWidth, }) {
31
+ function DnDevSidebarComponent({ children, top, content, bottom, defaultWidth = DEFAULT_SLOTS.sidebar.defaultWidth, minWidth = DEFAULT_SLOTS.sidebar.minWidth, maxWidth = DEFAULT_SLOTS.sidebar.maxWidth, }) {
32
+ // Custom mode: children provided = consumer owns zone visuals, data-custom skips polish CSS
33
+ const isCustom = children !== undefined;
32
34
  // Resize state
33
35
  const sidebarWidth = useLayout('sidebarWidth') ?? defaultWidth;
34
36
  const setSidebarWidth = useLayout('setSidebarWidth');
@@ -170,6 +172,10 @@ function DnDevSidebarComponent({ top, content, bottom, defaultWidth = DEFAULT_SL
170
172
  * resize handle styles, collapsed styles — essentially ALL sidebar behavior.
171
173
  * aria-label provides the accessible name. Both attributes are required.
172
174
  */
173
- _jsxs("aside", { ref: asideRef, role: "navigation", "aria-label": "Site navigation", className: "sidebar", "data-dragging": isDragging, "data-collapsed": isCollapsed, children: [top && _jsx("div", { className: "sidebar-top", children: top }), _jsx("div", { className: "sidebar-content", children: content }), bottom && _jsx("div", { className: "sidebar-bottom", children: bottom }), _jsx("div", { className: "dndev-sidebar-resize-handle", onPointerDown: handlePointerDown, onDoubleClick: toggleCollapse, onKeyDown: handleKeyDown, role: "separator", "aria-label": "Resize sidebar. Double-click or Enter to toggle. Home to collapse, End to fit content.", "aria-valuenow": sidebarWidth, "aria-valuemin": minWidth, "aria-valuemax": maxWidth, "aria-orientation": "vertical", tabIndex: 0 })] }));
175
+ _jsxs("aside", { ref: asideRef, role: "navigation", "aria-label": "Site navigation", className: "sidebar", "data-dragging": isDragging, "data-collapsed": isCollapsed, "data-custom": isCustom || undefined, children: [isCustom ? (
176
+ /* Custom mode: consumer component fills content area, no slot divs */
177
+ children) : (
178
+ /* Slotted mode: framework slot layout with polish CSS */
179
+ _jsxs(_Fragment, { children: [top && _jsx("div", { className: "sidebar-top", children: top }), _jsx("div", { className: "sidebar-content", children: content }), bottom && _jsx("div", { className: "sidebar-bottom", children: bottom })] })), _jsx("div", { className: "dndev-sidebar-resize-handle", onPointerDown: handlePointerDown, onDoubleClick: toggleCollapse, onKeyDown: handleKeyDown, role: "separator", "aria-label": "Resize sidebar. Double-click or Enter to toggle. Home to collapse, End to fit content.", "aria-valuenow": sidebarWidth, "aria-valuemin": minWidth, "aria-valuemax": maxWidth, "aria-orientation": "vertical", tabIndex: 0 })] }));
174
180
  }
175
181
  export const DnDevSidebar = memo(DnDevSidebarComponent);
@@ -1 +1 @@
1
- {"version":3,"file":"NextJsAppProviders.d.ts","sourceRoot":"","sources":["../../src/providers/NextJsAppProviders.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AA6DxD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAiDhE"}
1
+ {"version":3,"file":"NextJsAppProviders.d.ts","sourceRoot":"","sources":["../../src/providers/NextJsAppProviders.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AA0DxD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CA2DhE"}
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  // packages/ui/src/providers/NextJsAppProviders.tsx
4
4
  /**
5
5
  * @fileoverview NextJsAppProviders component
@@ -9,7 +9,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
9
  * @since 0.0.1
10
10
  * @author AMBROISE PARK Consulting
11
11
  */
12
- import { lazy, Suspense } from 'react';
12
+ import { lazy, Suspense, useEffect, useState } from 'react';
13
13
  import { HelmetProvider } from 'react-helmet-async';
14
14
  import { QueryProviders, AppConfigProvider } from '@donotdev/core';
15
15
  import { useConsent } from '@donotdev/core';
@@ -20,6 +20,8 @@ import PerformanceHints from '../internal/layout/components/PerformanceHints';
20
20
  import { DnDevLayout } from '../internal/layout/DnDevLayout';
21
21
  import { SentryInitializer } from '../internal/providers/SentryInitializer';
22
22
  import { UIProviders } from '../internal/providers/UIProviders';
23
+ import { PasswordResetCallback } from '../utils/useAuthSafe';
24
+ import { AuthReturnTo } from '../routing/AuthReturnTo';
23
25
  // Null fallback for lazy components that fail to load (e.g., optional auth dependency absent)
24
26
  const NullFallback = () => null;
25
27
  // Lazy load client-only components — each wrapped with catch to prevent hanging
@@ -28,9 +30,6 @@ const CookieConsent = lazy(() => import('../components/cookie-consent/CookieCons
28
30
  const PWAUpdateNotification = lazy(() => import('../internal/layout/components/PWAUpdateNotification')
29
31
  .then((m) => ({ default: m.default }))
30
32
  .catch(() => ({ default: NullFallback })));
31
- const LicenseWatermark = lazy(() => import('../components/license/LicenseWatermark')
32
- .then((m) => ({ default: m.LicenseWatermark }))
33
- .catch(() => ({ default: NullFallback })));
34
33
  const RedirectOverlay = lazy(() => import('../components/common/RedirectOverlay')
35
34
  .then((m) => ({ default: m.RedirectOverlay }))
36
35
  .catch(() => ({ default: NullFallback })));
@@ -44,13 +43,20 @@ const RedirectOverlay = lazy(() => import('../components/common/RedirectOverlay'
44
43
  */
45
44
  function ConsentBanner() {
46
45
  const hasConsented = useConsent('hasConsented');
47
- // Don't show if user has already consented
48
- if (hasConsented) {
46
+ const showBanner = useConsent('showBanner');
47
+ if (hasConsented && !showBanner) {
49
48
  return null;
50
49
  }
51
50
  return (_jsx(Suspense, { fallback: null, children: _jsx(CookieConsent, {}) }));
52
51
  }
53
52
  export function NextJsAppProviders(props) {
54
53
  const { config = {}, layout, children, serverCookies, customStores } = props;
55
- return (_jsxs(AppConfigProvider, { config: config, platform: "nextjs", children: [_jsx(SentryInitializer, {}), _jsx(HelmetProvider, { children: _jsxs(NextJsStoresInitializer, { serverCookies: serverCookies, customStores: customStores, children: [_jsx(FaviconHead, {}), _jsx(PerformanceHints, {}), _jsx(QueryProviders, { children: _jsxs(UIProviders, { children: [_jsx(DnDevLayout, { layout: layout, children: children }), _jsx(ConsentBanner, {}), _jsx(Suspense, { fallback: null, children: _jsx(PWAUpdateNotification, {}) }), _jsx(Suspense, { fallback: null, children: _jsx(LicenseWatermark, {}) }), _jsx(Suspense, { fallback: null, children: _jsx(RedirectOverlay, {}) })] }) })] }) })] }));
54
+ const [isMounted, setIsMounted] = useState(false);
55
+ useEffect(() => {
56
+ setIsMounted(true);
57
+ }, []);
58
+ if (!isMounted) {
59
+ return _jsx(_Fragment, { children: children });
60
+ }
61
+ return (_jsxs(AppConfigProvider, { config: config, platform: "nextjs", children: [_jsx(SentryInitializer, {}), _jsx(HelmetProvider, { children: _jsxs(NextJsStoresInitializer, { serverCookies: serverCookies, customStores: customStores, children: [_jsx(FaviconHead, {}), _jsx(PerformanceHints, {}), _jsx(QueryProviders, { children: _jsxs(UIProviders, { children: [_jsx(DnDevLayout, { layout: layout, children: children }), _jsx(ConsentBanner, {}), _jsx(AuthReturnTo, {}), _jsx(PasswordResetCallback, {}), _jsx(Suspense, { fallback: null, children: _jsx(PWAUpdateNotification, {}) }), _jsx(Suspense, { fallback: null, children: _jsx(RedirectOverlay, {}) })] }) })] }) })] }));
56
62
  }
@@ -1,13 +1,6 @@
1
- /**
2
- * @fileoverview AuthGuard component
3
- * @description Protects routes based on authentication configuration
4
- *
5
- * @version 0.1.0
6
- * @since 0.0.1
7
- * @author AMBROISE PARK Consulting
8
- */
9
- import { type ReactNode, type ComponentType } from 'react';
10
- import { USER_ROLES, SUBSCRIPTION_TIERS, type PageAuth } from '@donotdev/core';
1
+ import type { ReactNode, ComponentType } from 'react';
2
+ import { USER_ROLES, SUBSCRIPTION_TIERS } from '@donotdev/core';
3
+ import type { PageAuth } from '@donotdev/core';
11
4
  /**
12
5
  * Props for AuthGuard component
13
6
  */
@@ -20,19 +13,11 @@ interface AuthGuardProps {
20
13
  fallback?: ComponentType;
21
14
  }
22
15
  /**
23
- * AuthGuard component that protects routes based on authentication config
24
- *
25
- * 🎯 SINGLE SOURCE OF TRUTH: Only uses @donotdev/core, never directly calls auth
26
- *
27
- * Role System (from store):
28
- * - 'guest': No authentication
29
- * - 'user': Authenticated Firebase user
30
- * - 'admin': Authenticated user with Firebase custom claim isAdmin: true
16
+ * AuthGuard - cold-load redirect safety net
31
17
  *
32
- * Subscription System (from store):
33
- * - 'free': Basic features
34
- * - 'pro': Professional features
35
- * - 'premium': Premium features
18
+ * For SPA navigation, auth is intercepted in useNavigate (before page mount).
19
+ * This component handles the cold-load case: user pastes a protected URL directly.
20
+ * It redirects to authRoute, saves returnTo, and AuthReturnTo handles the redirect back.
36
21
  *
37
22
  * @version 0.1.0
38
23
  * @since 0.0.1
@@ -1 +1 @@
1
- {"version":3,"file":"AuthGuard.d.ts","sourceRoot":"","sources":["../../src/routing/AuthGuard.tsx"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAGf,OAAO,EAGL,UAAU,EACV,kBAAkB,EAClB,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AAWxB;;GAEG;AACH,UAAU,cAAc;IACtB,wCAAwC;IACxC,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAC;IACvB,wCAAwC;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,QAAQ,EACR,QAAQ,EAAE,QAAoC,GAC/C,EAAE,cAAc,2CA6HhB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,CAG9D;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,uBAAiB,CAAC;AAE3C;;;;;;GAMG;AACH,wBAAgB,WAAW,IACvB,OAAO,UAAU,CAAC,KAAK,GACvB,OAAO,UAAU,CAAC,IAAI,GACtB,OAAO,UAAU,CAAC,KAAK,CAS1B;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,IAAI,EACA,OAAO,UAAU,CAAC,KAAK,GACvB,OAAO,UAAU,CAAC,IAAI,GACtB,OAAO,UAAU,CAAC,KAAK,GAC1B,OAAO,CAIT;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY;;;;;;EAW3B;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EACvC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,IAAI,EAAE,QAAQ,GAAG,KAAK,WAEW,CAAC,6CAOnC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;IAC3B,iCAAiC;kBACrB,KAAK;IAEjB,oCAAoC;oBACtB,QAAQ;IAEtB,yCAAyC;gBAC/B,QAAQ;IAKlB,uDAAuD;iBAC5C,QAAQ;IAKnB,gCAAgC;iBAExB,CAAC,OAAO,kBAAkB,EAAE,MAAM,OAAO,kBAAkB,CAAC,KACjE,QAAQ;IAKX,eAAe;eACN,QAAQ;IAKjB,mBAAmB;mBACN,QAAQ;IAKrB,sCAAsC;oBACxB,QAAQ;IAMtB,wBAAwB;uBACL,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,KAAG,QAAQ;CAItE,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"AuthGuard.d.ts","sourceRoot":"","sources":["../../src/routing/AuthGuard.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAEL,UAAU,EACV,kBAAkB,EAGnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM/C;;GAEG;AACH,UAAU,cAAc;IACtB,wCAAwC;IACxC,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAC;IACvB,wCAAwC;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,QAAQ,EACR,QAAQ,EAAE,QAAoC,GAC/C,EAAE,cAAc,2CA0ChB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,CAG9D;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,uBAAiB,CAAC;AAE3C;;;;;;GAMG;AACH,wBAAgB,WAAW,IACvB,OAAO,UAAU,CAAC,KAAK,GACvB,OAAO,UAAU,CAAC,IAAI,GACtB,OAAO,UAAU,CAAC,KAAK,CAS1B;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,IAAI,EACA,OAAO,UAAU,CAAC,KAAK,GACvB,OAAO,UAAU,CAAC,IAAI,GACtB,OAAO,UAAU,CAAC,KAAK,GAC1B,OAAO,CAIT;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY;;;;;;EAW3B;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EACvC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,IAAI,EAAE,QAAQ,GAAG,KAAK,WAEW,CAAC,6CAOnC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;IAC3B,iCAAiC;kBACrB,KAAK;IAEjB,oCAAoC;oBACtB,QAAQ;IAEtB,yCAAyC;gBAC/B,QAAQ;IAKlB,uDAAuD;iBAC5C,QAAQ;IAKnB,gCAAgC;iBAExB,CAAC,OAAO,kBAAkB,EAAE,MAAM,OAAO,kBAAkB,CAAC,KACjE,QAAQ;IAKX,eAAe;eACN,QAAQ;IAKjB,mBAAmB;mBACN,QAAQ;IAKrB,sCAAsC;oBACxB,QAAQ;IAMtB,wBAAwB;uBACL,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,KAAG,QAAQ;CAItE,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,36 +1,27 @@
1
1
  'use client';
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  // packages/ui/src/routing/AuthGuard.tsx
4
4
  /**
5
5
  * @fileoverview AuthGuard component
6
- * @description Protects routes based on authentication configuration
6
+ * @description Cold-load safety net for protected routes. Redirects unauthenticated
7
+ * users to authRoute. SPA navigation is intercepted earlier in useNavigate.
7
8
  *
8
9
  * @version 0.1.0
9
10
  * @since 0.0.1
10
11
  * @author AMBROISE PARK Consulting
11
12
  */
12
- import { useEffect, useState, lazy, Suspense, } from 'react';
13
- import { Spinner, Stack } from '@donotdev/components';
14
- import { useAuthConfig, FEATURE_STATUS, USER_ROLES, SUBSCRIPTION_TIERS, } from '@donotdev/core';
13
+ import { useEffect } from 'react';
14
+ import { Spinner } from '@donotdev/components';
15
+ import { FEATURE_STATUS, USER_ROLES, SUBSCRIPTION_TIERS, isClient, safeSessionStorage, } from '@donotdev/core';
15
16
  // Platform-specific hooks via conditional exports
16
17
  import { useRedirectGuard, useNavigate } from '@donotdev/ui/routing/hooks';
17
18
  import { useAuthSafe } from '../utils/useAuthSafe';
18
- // Lazy load consent component for auth routes
19
- const CookieConsent = lazy(() => import('../components/cookie-consent/CookieConsent'));
20
19
  /**
21
- * AuthGuard component that protects routes based on authentication config
20
+ * AuthGuard - cold-load redirect safety net
22
21
  *
23
- * 🎯 SINGLE SOURCE OF TRUTH: Only uses @donotdev/core, never directly calls auth
24
- *
25
- * Role System (from store):
26
- * - 'guest': No authentication
27
- * - 'user': Authenticated Firebase user
28
- * - 'admin': Authenticated user with Firebase custom claim isAdmin: true
29
- *
30
- * Subscription System (from store):
31
- * - 'free': Basic features
32
- * - 'pro': Professional features
33
- * - 'premium': Premium features
22
+ * For SPA navigation, auth is intercepted in useNavigate (before page mount).
23
+ * This component handles the cold-load case: user pastes a protected URL directly.
24
+ * It redirects to authRoute, saves returnTo, and AuthReturnTo handles the redirect back.
34
25
  *
35
26
  * @version 0.1.0
36
27
  * @since 0.0.1
@@ -39,69 +30,33 @@ const CookieConsent = lazy(() => import('../components/cookie-consent/CookieCons
39
30
  export function AuthGuard({ auth, children, fallback: Fallback = () => _jsx(Spinner, { overlay: true }), }) {
40
31
  const navigate = useNavigate();
41
32
  const user = useAuthSafe('user');
42
- const can = useAuthSafe('can');
43
33
  const status = useAuthSafe('status');
44
- const [slowWarning, setSlowWarning] = useState(false);
45
- // Check if redirect should happen BEFORE rendering fallback
46
34
  const { shouldRedirect, redirectTo, isChecking } = useRedirectGuard({
47
35
  auth,
48
36
  });
49
- useEffect(() => {
50
- // Soft timeout at 5 seconds - show warning, don't force redirect
51
- // Firebase auth typically resolves in 200ms-800ms (broadband), 1-3s (cold start)
52
- const timer = setTimeout(() => {
53
- if (status === FEATURE_STATUS.INITIALIZING) {
54
- setSlowWarning(true);
55
- if (process.env.NODE_ENV === 'development') {
56
- console.warn('[AuthGuard] Auth taking longer than usual (>5s)');
57
- }
58
- }
59
- }, 5000);
60
- return () => clearTimeout(timer);
61
- }, [status]);
62
- // Redirect if needed
37
+ // Redirect if needed - save current path when redirecting unauthenticated user
63
38
  useEffect(() => {
64
39
  if (shouldRedirect && redirectTo) {
40
+ if (!user && isClient()) {
41
+ safeSessionStorage.setItem('dndev.auth.returnTo', window.location.pathname + window.location.search);
42
+ safeSessionStorage.setItem('dndev.auth.guardToast', '1');
43
+ }
65
44
  navigate(redirectTo, { replace: true });
66
45
  }
67
- }, [shouldRedirect, redirectTo, navigate]);
46
+ }, [shouldRedirect, redirectTo, navigate, user]);
47
+ // Return-to after OAuth is handled by AuthReturnTo (mounted in RootLayout).
68
48
  // Public route - no auth required
69
49
  if (auth === false) {
70
50
  return _jsx(_Fragment, { children: children });
71
51
  }
72
- // Early return: show loader if redirect will happen or checking auth state
73
- // This prevents content flash before redirect
52
+ // Show spinner while redirect will happen or auth is still checking
74
53
  if (shouldRedirect || isChecking) {
75
54
  return _jsx(Spinner, { overlay: true });
76
55
  }
77
- // Show slow auth warning after 5s timeout (only if not redirecting)
78
- if (status === FEATURE_STATUS.INITIALIZING && slowWarning) {
79
- return (_jsx(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-md)', minHeight: '100vh' }, children: _jsxs("div", { className: "dndev-w-full", style: { maxWidth: '28rem', textAlign: 'center' }, children: [_jsx("h2", { style: { marginBottom: 'var(--gap-md)' }, children: "Loading is taking longer than usual" }), _jsx("p", { style: {
80
- marginBottom: 'var(--gap-md)',
81
- color: 'var(--muted-foreground)',
82
- }, children: "This might be due to a slow connection. Please wait or try refreshing the page." }), _jsx("button", { onClick: () => window.location.reload(), style: {
83
- padding: 'var(--gap-sm) var(--gap-md)',
84
- backgroundColor: 'var(--primary)',
85
- color: 'var(--primary-foreground)',
86
- border: 'none',
87
- borderRadius: 'var(--radius)',
88
- cursor: 'pointer',
89
- }, children: "Refresh Page" })] }) }));
90
- }
91
- // Still checking auth state (but not redirecting) - show fallback
56
+ // Still initializing auth - show fallback spinner
92
57
  if (status === FEATURE_STATUS.INITIALIZING) {
93
58
  return _jsx(Fallback, {});
94
59
  }
95
- // Check if it's a consent issue (no functional cookies for auth)
96
- // This is a special case where we don't redirect, but show consent UI
97
- if (auth &&
98
- typeof auth === 'object' &&
99
- auth.required &&
100
- !user &&
101
- can &&
102
- !can.navigate(auth)) {
103
- return (_jsx(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-md)', minHeight: '100vh' }, children: _jsxs("div", { className: "dndev-w-full", style: { maxWidth: '28rem' }, children: [_jsx("h2", { style: { marginBottom: 'var(--gap-md)' }, children: "Authentication Required" }), _jsx("p", { style: { marginBottom: 'var(--gap-md)' }, children: "This page requires authentication. Please accept functional cookies to continue." }), _jsx(Suspense, { fallback: _jsx("div", { children: "Loading consent..." }), children: _jsx(CookieConsent, {}) })] }) }));
104
- }
105
60
  // All checks passed, render children
106
61
  return _jsx(_Fragment, { children: children });
107
62
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * AuthReturnTo - Restores navigation after OAuth redirect.
3
+ *
4
+ * OAuth always lands on `/` (origin). This component watches for sign-in,
5
+ * reads the saved returnTo path, and navigates back. Runs once per sign-in.
6
+ *
7
+ * Also shows a warning toast when the user was redirected by the auth guard
8
+ * (flag set by useNavigate, consumed here on mount of the landing page).
9
+ *
10
+ * @component
11
+ */
12
+ export declare function AuthReturnTo(): null;
13
+ //# sourceMappingURL=AuthReturnTo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthReturnTo.d.ts","sourceRoot":"","sources":["../../src/routing/AuthReturnTo.tsx"],"names":[],"mappings":"AA0BA;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,SA8B3B"}