@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
@@ -87,61 +87,75 @@ function CardListSkeleton({ cols, entity, }) {
87
87
  * - Auto-routing when handler not provided
88
88
  */
89
89
  export function EntityCardList({ entity, basePath, onClick, cols = [1, 2, 3, 4], staleTime = 1000 * 60 * 30, // 30 minutes default cache
90
- queryOptions, filter, hideFilters = false, resultLabel, tone, collapsible = false, defaultOpen, }) {
90
+ queryOptions, filter, hideFilters = false, resultLabel, tone, renderCardOverlay, clientSort, collapsible = false, defaultOpen, preview, }) {
91
91
  // Safe guard: isCrudModuleAvailable is a module-level constant (immutable after load).
92
92
  // eslint-disable-next-line react-hooks/rules-of-hooks
93
93
  if (!isCrudModuleAvailable)
94
94
  return null;
95
+ const isPreview = !!preview;
95
96
  const navigate = useNavigate();
96
97
  const base = basePath ?? `/${entity.collection}`;
97
98
  // useCrudCardList -> handles fetching + client-side filter/search/sort via `processed`
98
- const { items: rawData, processed, loading, } = useCrudCardList(entity, { staleTime, queryOptions });
99
+ const { items: rawData, processed, loading: fetchLoading, error: fetchError, } = useCrudCardList(entity, {
100
+ enabled: !isPreview,
101
+ staleTime,
102
+ queryOptions,
103
+ clientSort,
104
+ });
105
+ // In preview mode: use preview data, skip loading state
106
+ const loading = isPreview ? false : fetchLoading;
99
107
  // Favorites - always enabled, no props needed
100
108
  const { isFavorite, toggleFavorite, favoritesFilter } = useEntityFavorites({
101
109
  collection: entity.collection,
102
110
  });
103
111
  // Favorites toggle from CrudStore (persists across navigation)
104
- const { showFavoritesOnly, setShowFavoritesOnly } = useCrudFilters({
112
+ const { showFavoritesOnly, setShowFavoritesOnly, filters, setFilters } = useCrudFilters({
105
113
  collection: entity.collection,
106
114
  });
107
115
  // Apply UI-specific filters (favorites, consumer filter prop) on top of processed
108
116
  // Favorites always sort to front; when showFavoritesOnly, only favorites are shown
109
- let data = processed;
110
- if (showFavoritesOnly) {
111
- data = data.filter(favoritesFilter);
112
- }
113
- if (filter) {
114
- data = data.filter(filter);
117
+ let data = isPreview
118
+ ? preview
119
+ : processed;
120
+ if (!isPreview) {
121
+ if (showFavoritesOnly) {
122
+ data = data.filter(favoritesFilter);
123
+ }
124
+ if (filter) {
125
+ data = data.filter(filter);
126
+ }
127
+ // Sort favorites to front (stable sort preserves relative order within each group)
128
+ data = data.toSorted((a, b) => {
129
+ const aFav = isFavorite(String(a.id)) ? 0 : 1;
130
+ const bFav = isFavorite(String(b.id)) ? 0 : 1;
131
+ return aFav - bFav;
132
+ });
115
133
  }
116
- // Sort favorites to front (stable sort preserves relative order within each group)
117
- data = data.toSorted((a, b) => {
118
- const aFav = isFavorite(String(a.id)) ? 0 : 1;
119
- const bFav = isFavorite(String(b.id)) ? 0 : 1;
120
- return aFav - bFav;
121
- });
122
134
  // Entity + crud namespaces so formatValue can resolve crud:price.* etc.
123
135
  const { t } = useTranslation([entity.namespace, 'crud']);
124
136
  const { t: tCrud } = useTranslation('crud');
125
137
  // Card click: onClick(id) if provided, else navigate to basePath/:id
126
138
  const handleView = useCallback((id) => {
139
+ if (isPreview)
140
+ return;
127
141
  if (onClick) {
128
142
  onClick(id);
129
143
  }
130
144
  else {
131
145
  navigate(`${base}/${id}`);
132
146
  }
133
- }, [base, navigate, onClick]);
147
+ }, [base, navigate, onClick, isPreview]);
134
148
  // Flat field names for filters (works with both string[] and ListCardLayout)
135
149
  const fieldsToFilter = useMemo(() => getListCardFieldNames(entity), [entity]);
136
150
  const entityName = t('name', { defaultValue: entity.name });
137
151
  return (_jsxs(_Fragment, { children: [!hideFilters && (_jsx(Section, { title: tCrud('filters.title', {
138
152
  entity: entityName,
139
153
  defaultValue: `Browse ${entityName} - Filters`,
140
- }), collapsible: collapsible, defaultOpen: defaultOpen, tone: tone, children: _jsx(Card, { children: _jsxs(Stack, { direction: "column", children: [_jsx(Button, { variant: showFavoritesOnly ? 'primary' : 'outline', icon: _jsx(Heart, { size: 18 }), onClick: () => setShowFavoritesOnly(!showFavoritesOnly), children: showFavoritesOnly
154
+ }), collapsible: collapsible, defaultOpen: defaultOpen, tone: tone, children: _jsx(Card, { children: _jsxs(Stack, { direction: "column", children: [_jsx(Button, { variant: !isPreview && showFavoritesOnly ? 'primary' : 'outline', icon: _jsx(Heart, { size: 18 }), onClick: () => setShowFavoritesOnly(!showFavoritesOnly), disabled: isPreview, children: showFavoritesOnly
141
155
  ? tCrud('favorites.showAll', { defaultValue: 'Show All' })
142
156
  : tCrud('favorites.showFavorites', {
143
157
  defaultValue: 'Show Favorites',
144
- }) }), _jsx(EntityFilters, { entity: entity, data: rawData, fieldsToFilter: fieldsToFilter })] }) }) })), _jsx(Section, { title: loading
158
+ }) }), !isPreview && (_jsx(EntityFilters, { entity: entity, data: rawData, fieldsToFilter: fieldsToFilter }))] }) }) })), _jsx(Section, { title: loading
145
159
  ? tCrud('results.title.fetching', { defaultValue: 'Fetching...' })
146
160
  : resultLabel
147
161
  ? resultLabel(data.length)
@@ -150,22 +164,32 @@ queryOptions, filter, hideFilters = false, resultLabel, tone, collapsible = fals
150
164
  defaultValue: data.length === 1
151
165
  ? 'Found 1 occurrence'
152
166
  : `Found ${data.length} occurrences`,
153
- }), collapsible: collapsible, defaultOpen: collapsible ? true : undefined, tone: tone, children: loading ? (_jsx(CardListSkeleton, { cols: cols, entity: entity })) : data.length === 0 ? (_jsxs(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-3xl)', textAlign: 'center' }, children: [_jsx(Text, { level: "h3", style: { color: 'var(--muted-foreground)' }, children: tCrud('emptyState.title', {
167
+ }), collapsible: collapsible, defaultOpen: collapsible ? true : undefined, tone: tone, children: loading ? (_jsx(CardListSkeleton, { cols: cols, entity: entity })) : fetchError ? (_jsxs(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-3xl)', textAlign: 'center' }, children: [_jsx(Text, { level: "h3", style: { color: 'var(--destructive)' }, children: tCrud('errors.fetchFailed', {
168
+ defaultValue: `Failed to load ${entity.name.toLowerCase()}`,
169
+ }) }), _jsx(Text, { level: "small", style: { color: 'var(--destructive)' }, children: fetchError instanceof Error
170
+ ? fetchError.message
171
+ : String(fetchError) })] })) : data.length === 0 ? (_jsxs(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-3xl)', textAlign: 'center' }, children: [_jsx(Text, { level: "h3", style: { color: 'var(--muted-foreground)' }, children: tCrud('emptyState.title', {
154
172
  defaultValue: `No ${entity.name.toLowerCase()} found`,
155
173
  }) }), _jsx(Text, { style: { color: 'var(--muted-foreground)' }, children: tCrud('emptyState.description', {
156
174
  defaultValue: `No ${entity.name.toLowerCase()} available at this time.`,
157
175
  }) })] })) : (_jsx(Grid, { cols: cols, children: data.map((item) => {
158
176
  const itemIsFavorite = isFavorite(item.id);
159
- const detailHref = onClick ? undefined : `${base}/${item.id}`;
160
- return (_jsx(CrudCard, { item: item, entity: entity, detailHref: detailHref, onClick: onClick ? () => handleView(item.id) : undefined, renderActions: _jsx(Heart, { fill: itemIsFavorite ? '#ef4444' : '#ffffff', stroke: itemIsFavorite ? '#ef4444' : 'var(--muted-foreground)', onClick: (e) => {
177
+ const detailHref = isPreview || onClick ? undefined : `${base}/${item.id}`;
178
+ return (_jsx(CrudCard, { item: item, entity: entity, detailHref: detailHref, onClick: isPreview
179
+ ? undefined
180
+ : onClick
181
+ ? () => handleView(item.id)
182
+ : undefined, renderOverlay: renderCardOverlay?.(item), renderActions: _jsx(Heart, { fill: itemIsFavorite ? '#ef4444' : '#ffffff', stroke: itemIsFavorite ? '#ef4444' : 'var(--muted-foreground)', onClick: (e) => {
161
183
  e.preventDefault();
162
184
  e.stopPropagation();
163
- toggleFavorite(item.id);
185
+ if (!isPreview)
186
+ toggleFavorite(item.id);
164
187
  }, style: {
165
- cursor: 'pointer',
188
+ cursor: isPreview ? 'default' : 'pointer',
166
189
  width: 'var(--icon-md)',
167
190
  height: 'var(--icon-md)',
168
191
  transition: 'fill 0.2s, stroke 0.2s',
192
+ opacity: isPreview ? 0.5 : 1,
169
193
  }, "aria-label": itemIsFavorite
170
194
  ? tCrud('favorites.remove', {
171
195
  defaultValue: 'Remove from favorites',
@@ -16,6 +16,6 @@ export type { EntityDisplayRendererProps };
16
16
  * <EntityDisplayRenderer entity={carEntity} id={carId} />
17
17
  * ```
18
18
  */
19
- export declare function EntityDisplayRenderer<T extends EntityRecord = EntityRecord>({ entity, id, t, className, loadingMessage, notFoundMessage, viewerRole: viewerRoleProp, excludeFields, }: EntityDisplayRendererProps<T>): import("react/jsx-runtime").JSX.Element | null;
19
+ export declare function EntityDisplayRenderer<T extends EntityRecord = EntityRecord>({ entity, id, t, className, loadingMessage, notFoundMessage, viewerRole: viewerRoleProp, excludeFields, preview, }: EntityDisplayRendererProps<T>): import("react/jsx-runtime").JSX.Element | null;
20
20
  export default EntityDisplayRenderer;
21
21
  //# sourceMappingURL=EntityDisplayRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntityDisplayRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityDisplayRenderer.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAS/E,YAAY,EAAE,0BAA0B,EAAE,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,EAC3E,MAAM,EACN,EAAE,EACF,CAAC,EACD,SAAc,EACd,cAAc,EACd,eAAe,EACf,UAAU,EAAE,cAAc,EAC1B,aAAa,GACd,EAAE,0BAA0B,CAAC,CAAC,CAAC,kDA8M/B;AAED,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"EntityDisplayRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityDisplayRenderer.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAS/E,YAAY,EAAE,0BAA0B,EAAE,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,EAC3E,MAAM,EACN,EAAE,EACF,CAAC,EACD,SAAc,EACd,cAAc,EACd,eAAe,EACf,UAAU,EAAE,cAAc,EAC1B,aAAa,EACb,OAAO,GACR,EAAE,0BAA0B,CAAC,CAAC,CAAC,kDAgN/B;AAED,eAAe,qBAAqB,CAAC"}
@@ -31,14 +31,15 @@ import { useAuthSafe } from '../../utils/useAuthSafe';
31
31
  * <EntityDisplayRenderer entity={carEntity} id={carId} />
32
32
  * ```
33
33
  */
34
- export function EntityDisplayRenderer({ entity, id, t, className = '', loadingMessage, notFoundMessage, viewerRole: viewerRoleProp, excludeFields, }) {
34
+ export function EntityDisplayRenderer({ entity, id, t, className = '', loadingMessage, notFoundMessage, viewerRole: viewerRoleProp, excludeFields, preview, }) {
35
35
  // Safe guard: isCrudModuleAvailable is a module-level constant (immutable after load).
36
36
  // eslint-disable-next-line react-hooks/rules-of-hooks
37
37
  if (!isCrudModuleAvailable)
38
38
  return null;
39
- // Auto-detect role from auth; prop overrides
39
+ const isPreview = !!preview;
40
+ // Auto-detect role from auth; prop overrides. Preview = design-time showcase, show all fields.
40
41
  const authRole = useAuthSafe('userRole');
41
- const viewerRole = viewerRoleProp ?? authRole;
42
+ const viewerRole = viewerRoleProp ?? (isPreview ? 'super' : authRole);
42
43
  const { get, loading, data: storeData, error: storeError, isAvailable, } = useCrud(entity);
43
44
  const [isFetching, setIsFetching] = useState(false);
44
45
  const [fetchError, setFetchError] = useState(null);
@@ -47,8 +48,10 @@ export function EntityDisplayRenderer({ entity, id, t, className = '', loadingMe
47
48
  const { t: tDual } = useTranslation([entity.namespace, 'crud']);
48
49
  const { t: tCrud } = useTranslation('crud');
49
50
  const translate = t || tDual;
50
- // Fetch data when id is available and service is ready
51
+ // Fetch data when id is available and service is ready (skip in preview mode)
51
52
  useEffect(() => {
53
+ if (isPreview)
54
+ return;
52
55
  // Early return if no ID
53
56
  if (!id) {
54
57
  setData(null);
@@ -88,14 +91,12 @@ export function EntityDisplayRenderer({ entity, id, t, className = '', loadingMe
88
91
  return () => {
89
92
  cancelled = true;
90
93
  };
91
- }, [id, get, isAvailable]);
92
- // Priority: store data (reactive, updated by other components) > local fetch data.
93
- // Store may already have the entity from a list view or prior navigation,
94
- // so we prefer it to avoid a redundant fetch. Local fetch is the fallback
95
- // when the entity isn't in the store yet (e.g., direct URL access).
96
- const displayData = storeData || data;
97
- const displayError = storeError || fetchError;
98
- const isLoading = loading || isFetching || !id;
94
+ }, [id, get, isAvailable, isPreview]);
95
+ // In preview mode: use preview data directly
96
+ // Priority: preview > store data (reactive) > local fetch data
97
+ const displayData = isPreview ? preview : storeData || data;
98
+ const displayError = isPreview ? null : storeError || fetchError;
99
+ const isLoading = isPreview ? false : loading || isFetching || !id;
99
100
  // Filter fields: respect visibility AND skip empty values
100
101
  // MUST be called before any early returns (Rules of Hooks)
101
102
  const visibleFields = useMemo(() => {
@@ -114,7 +115,7 @@ export function EntityDisplayRenderer({ entity, id, t, className = '', loadingMe
114
115
  if (fieldConfig.visibility === 'hidden') {
115
116
  return false;
116
117
  }
117
- // Get field value
118
+ // Get field value (displayData may be preview T or store row; entity is AnyEntity in props)
118
119
  const value = displayData[fieldName];
119
120
  // Hide if value is empty/null/undefined
120
121
  if (value === null || value === undefined) {
@@ -13,6 +13,11 @@ export type { EntityFormRendererProps };
13
13
  * @since 0.0.1
14
14
  * @author AMBROISE PARK Consulting
15
15
  */
16
- export declare function EntityFormRenderer<T extends EntityRecord = EntityRecord>({ entity, onSubmit, t, className, submitText, loading, defaultValues, submitVariant, secondaryButtonText, secondaryButtonVariant, onSecondarySubmit, viewerRole: viewerRoleProp, operation, formId: externalFormId, cancelText, cancelPath, successPath, onCancel, warnOnUnsavedChanges, unsavedChangesMessage, hideVisibilityInfo, }: EntityFormRendererProps<T>): import("react/jsx-runtime").JSX.Element | null;
16
+ /**
17
+ * EntityFormRenderer - public API.
18
+ * Applies instanceKey as React key on the inner component for clean state isolation
19
+ * when navigating between entities on the same route (e.g. /cars/:id).
20
+ */
21
+ export declare function EntityFormRenderer<T extends EntityRecord = EntityRecord>(props: EntityFormRendererProps<T>): import("react/jsx-runtime").JSX.Element;
17
22
  export default EntityFormRenderer;
18
23
  //# sourceMappingURL=EntityFormRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntityFormRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityFormRenderer.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,uBAAuB,EACvB,YAAY,EAEb,MAAM,gBAAgB,CAAC;AAgBxB,YAAY,EAAE,uBAAuB,EAAE,CAAC;AAExC;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,EACxE,MAAM,EACN,QAAQ,EACR,CAAC,EACD,SAAc,EACd,UAAU,EACV,OAAe,EACf,aAAa,EACb,aAAyB,EACzB,mBAAmB,EACnB,sBAAkC,EAClC,iBAAiB,EACjB,UAAU,EAAE,cAAc,EAC1B,SAA6C,EAC7C,MAAM,EAAE,cAAc,EACtB,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,oBAA2B,EAC3B,qBAAqB,EACrB,kBAA0B,GAC3B,EAAE,uBAAuB,CAAC,CAAC,CAAC,kDAgd5B;AAED,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"EntityFormRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityFormRenderer.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,uBAAuB,EACvB,YAAY,EAEb,MAAM,gBAAgB,CAAC;AAexB,YAAY,EAAE,uBAAuB,EAAE,CAAC;AAExC;;;;;;;;;;;;GAYG;AACH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EACtE,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,2CAIlC;AAoeD,eAAe,kBAAkB,CAAC"}
@@ -14,7 +14,7 @@ import { useEffect, useId, useMemo, useState } from 'react';
14
14
  import { FormProvider } from 'react-hook-form';
15
15
  import { Badge, Button, DropdownMenu, Grid, Stack, Spinner, } from '@donotdev/components';
16
16
  import { hasRoleAccess, useTranslation } from '@donotdev/core';
17
- import { isCrudModuleAvailable, DisplayFieldRenderer, FormFieldRenderer, UploadProvider, useEntityForm, useUnsavedChangesWarning, useFormStore, useFieldConditions, } from '../crudImports';
17
+ import { isCrudModuleAvailable, DisplayFieldRenderer, FormFieldRenderer, UploadProvider, useEntityForm, useFormStore, useFieldConditions, } from '../crudImports';
18
18
  import { useNavigate } from '../../routing';
19
19
  import { useAuthSafe } from '../../utils/useAuthSafe';
20
20
  /**
@@ -30,7 +30,16 @@ import { useAuthSafe } from '../../utils/useAuthSafe';
30
30
  * @since 0.0.1
31
31
  * @author AMBROISE PARK Consulting
32
32
  */
33
- export function EntityFormRenderer({ entity, onSubmit, t, className = '', submitText, loading = false, defaultValues, submitVariant = 'primary', secondaryButtonText, secondaryButtonVariant = 'outline', onSecondarySubmit, viewerRole: viewerRoleProp, operation = defaultValues ? 'edit' : 'create', formId: externalFormId, cancelText, cancelPath, successPath, onCancel, warnOnUnsavedChanges = true, unsavedChangesMessage, hideVisibilityInfo = false, }) {
33
+ /**
34
+ * EntityFormRenderer - public API.
35
+ * Applies instanceKey as React key on the inner component for clean state isolation
36
+ * when navigating between entities on the same route (e.g. /cars/:id).
37
+ */
38
+ export function EntityFormRenderer(props) {
39
+ const { instanceKey, ...rest } = props;
40
+ return _jsx(EntityFormRendererCore, { ...rest }, instanceKey);
41
+ }
42
+ function EntityFormRendererCore({ entity, onSubmit, t, className = '', submitText, loading = false, defaultValues, submitVariant = 'primary', secondaryButtonText, secondaryButtonVariant = 'outline', onSecondarySubmit, viewerRole: viewerRoleProp, operation = defaultValues ? 'edit' : 'create', formId: externalFormId, cancelText, cancelPath, successPath, onCancel, hideVisibilityInfo = false, }) {
34
43
  // Safe guard: isCrudModuleAvailable is a module-level constant (immutable after load).
35
44
  // Hooks below are either ALL called or NONE — no Rules-of-Hooks violation at runtime.
36
45
  // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -90,8 +99,9 @@ export function EntityFormRenderer({ entity, onSubmit, t, className = '', submit
90
99
  defaultValues,
91
100
  viewerRole,
92
101
  t: translate,
102
+ loading,
93
103
  });
94
- const { control, handleSubmit, formState: { errors }, fields: rawFields, formStatus, uploadProgress, cleanup, isDirty, hasUserInteracted, resetForm, } = form;
104
+ const { control, handleSubmit, formState: { errors }, fields: rawFields, formStatus, uploadProgress, isDirty, hasUserInteracted, resetForm, } = form;
95
105
  const isDirtyForBlocking = isDirty && hasUserInteracted;
96
106
  // Filter fields based on previewRole when visibility info is shown
97
107
  const renderableFields = useMemo(() => {
@@ -118,22 +128,6 @@ export function EntityFormRenderer({ entity, onSubmit, t, className = '', submit
118
128
  useFormStore.getState().setIsDirty(formId, isDirtyForBlocking);
119
129
  }
120
130
  }, [formId, isDirtyForBlocking]);
121
- // Cleanup on unmount
122
- useEffect(() => {
123
- return cleanup;
124
- }, [cleanup]);
125
- // Compute i18n messages once (DRY, performance)
126
- const unsavedChangesLeaveMessage = useMemo(() => unsavedChangesMessage ||
127
- tCrud('messages.unsavedChangesLeave', {
128
- defaultValue: 'You have unsaved changes. Are you sure you want to leave?',
129
- }), [unsavedChangesMessage, tCrud]);
130
- // Warn about unsaved changes when navigating away (browser refresh/close)
131
- // beforeunload is the only place we can't toast — browser requires native dialog
132
- useUnsavedChangesWarning({
133
- isDirty: isDirtyForBlocking,
134
- enabled: warnOnUnsavedChanges,
135
- message: unsavedChangesLeaveMessage,
136
- });
137
131
  // Handle cancel — auto-save ensures draft is persisted, no confirm needed
138
132
  const handleCancel = () => {
139
133
  resetForm();
@@ -151,24 +145,15 @@ export function EntityFormRenderer({ entity, onSubmit, t, className = '', submit
151
145
  // handleSubmit from react-hook-form expects: (data: EntityData) => void | Promise<void>
152
146
  // Our onSubmit prop is (data: T) => void | Promise<void>, where T extends EntityRecord
153
147
  // EntityData should be compatible with T, so we can safely pass it
148
+ // No try/catch here — errors MUST propagate to useEntityForm's orchestrator
149
+ // which properly calls setError() and does NOT clearDraft/reset.
154
150
  const handleFormSubmit = async (data) => {
155
- try {
156
- // Await onSubmit so navigation only happens after successful submission
157
- // Type assertion is safe: EntityData is the validated form data, T is EntityRecord
158
- await onSubmit(data);
159
- // Navigate only after successful submission
160
- if (successPath) {
161
- navigate(successPath);
162
- }
163
- else {
164
- // Default: navigate back (user came from list, go back there)
165
- navigate('back');
166
- }
167
- }
168
- catch (error) {
169
- // onSubmit rejected — stay on form so user can correct errors
170
- // Error display is handled by the caller's onSubmit implementation
171
- console.error(error);
151
+ await onSubmit(data);
152
+ // Navigate only when successPath is explicitly provided.
153
+ // Edit: stay on page (most common UX). Create: consumer navigates
154
+ // in onSubmit (knows the new ID) or provides successPath.
155
+ if (successPath) {
156
+ navigate(successPath);
172
157
  }
173
158
  };
174
159
  // Determine if cancel button should show
@@ -217,6 +202,20 @@ export function EntityFormRenderer({ entity, onSubmit, t, className = '', submit
217
202
  loadingText: tCrud('form.saving', { defaultValue: 'Saving...' }),
218
203
  };
219
204
  }
205
+ if (formStatus === 'success') {
206
+ return {
207
+ loading: false,
208
+ successText: tCrud('form.saved', { defaultValue: 'Saved' }),
209
+ };
210
+ }
211
+ if (formStatus === 'error') {
212
+ return {
213
+ loading: false,
214
+ errorText: tCrud('form.error', {
215
+ defaultValue: 'Error — try again',
216
+ }),
217
+ };
218
+ }
220
219
  return { loading: false };
221
220
  }, [formStatus, uploadProgress, tCrud]);
222
221
  return (_jsx(FormProvider, { ...form, children: _jsx(UploadProvider, { formId: formId, children: _jsxs("div", { style: {
@@ -224,7 +223,10 @@ export function EntityFormRenderer({ entity, onSubmit, t, className = '', submit
224
223
  width: '100%',
225
224
  gridColumn: '1 / -1',
226
225
  display: 'contents',
227
- }, children: [isLoading && _jsx(Spinner, { overlay: true }), _jsxs("form", { onSubmit: handleSubmit(handleFormSubmit), noValidate: true, className: className, style: { width: '100%', gridColumn: '1 / -1', display: 'contents' }, children: [renderableFields.map(({ name, config, editable }) => {
226
+ }, children: [isLoading && _jsx(Spinner, { overlay: true }), _jsxs("form", { onSubmit: (e) => {
227
+ console.log('[EntityFormRenderer] native form onSubmit event', { defaultPrevented: e.defaultPrevented });
228
+ return handleSubmit(handleFormSubmit)(e);
229
+ }, noValidate: true, className: className, style: { width: '100%', gridColumn: '1 / -1', display: 'contents' }, children: [renderableFields.map(({ name, config, editable }) => {
228
230
  // Evaluate dynamic conditions for this field
229
231
  const cond = fieldConditions[name];
230
232
  if (cond && !cond.visible)
@@ -287,7 +289,13 @@ export function EntityFormRenderer({ entity, onSubmit, t, className = '', submit
287
289
  }, loading: buttonState.loading, loadingText: buttonState.loadingText, progress: buttonState.progress, variant: secondaryButtonVariant, className: "dndev-w-full", children: secondaryButtonText }, "secondary"));
288
290
  }
289
291
  // Primary submit button (always shown)
290
- buttons.push(_jsx(Button, { type: "submit", loading: buttonState.loading, loadingText: buttonState.loadingText, progress: buttonState.progress, variant: submitVariant, className: "dndev-w-full", children: submitText ||
292
+ buttons.push(_jsx(Button, { type: "submit", loading: buttonState.loading, loadingText: buttonState.loadingText, progress: buttonState.progress, variant: buttonState.successText
293
+ ? 'success'
294
+ : buttonState.errorText
295
+ ? 'destructive'
296
+ : submitVariant, disabled: !!buttonState.successText, className: "dndev-w-full", children: buttonState.successText ||
297
+ buttonState.errorText ||
298
+ submitText ||
291
299
  tCrud('form.submit', { defaultValue: 'Submit' }) }, "submit"));
292
300
  const buttonCount = buttons.length;
293
301
  // Single button: use Stack
@@ -10,5 +10,5 @@ export type { EntityListProps };
10
10
  * - Edit and Delete actions (admin only)
11
11
  * - Auto-routing when handlers not provided
12
12
  */
13
- export declare function EntityList({ entity, basePath, onClick, hideFilters, pagination, pageSize: pageSizeProp, queryOptions, exportable, }: EntityListProps): import("react/jsx-runtime").JSX.Element | null;
13
+ export declare function EntityList({ entity, basePath, onClick, hideFilters, pagination, pageSize: pageSizeProp, queryOptions, exportable, preview, tone, }: EntityListProps): import("react/jsx-runtime").JSX.Element | null;
14
14
  //# sourceMappingURL=EntityList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntityList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityList.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AActD,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,OAAO,EACP,WAAmB,EACnB,UAAmB,EACnB,QAAQ,EAAE,YAAY,EACtB,YAAY,EACZ,UAAiB,GAClB,EAAE,eAAe,kDAyRjB"}
1
+ {"version":3,"file":"EntityList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityList.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAetD,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,OAAO,EACP,WAAmB,EACnB,UAAmB,EACnB,QAAQ,EAAE,YAAY,EACtB,YAAY,EACZ,UAAiB,EACjB,OAAO,EACP,IAAI,GACL,EAAE,eAAe,kDAqTjB"}