@donotdev/ui 0.1.1 → 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 (288) hide show
  1. package/LICENSE.md +21 -242
  2. package/README.md +1 -19
  3. package/assets/apple-touch-icon.png +0 -0
  4. package/assets/favicon.ico +0 -0
  5. package/assets/fonts/Inter-latin-ext.woff2 +0 -0
  6. package/assets/fonts/Inter-latin.woff2 +0 -0
  7. package/assets/fonts/PlayfairDisplay-latin-ext.woff2 +0 -0
  8. package/assets/fonts/PlayfairDisplay-latin.woff2 +0 -0
  9. package/assets/fonts/Roboto-400-cyrillic-ext.woff2 +0 -0
  10. package/assets/fonts/Roboto-400-cyrillic.woff2 +0 -0
  11. package/assets/fonts/Roboto-400-greek-ext.woff2 +0 -0
  12. package/assets/fonts/Roboto-400-greek.woff2 +0 -0
  13. package/assets/fonts/Roboto-400-latin-ext.woff2 +0 -0
  14. package/assets/fonts/Roboto-400-latin.woff2 +0 -0
  15. package/assets/fonts/Roboto-400-vietnamese.woff2 +0 -0
  16. package/assets/fonts/Roboto-700-cyrillic-ext.woff2 +0 -0
  17. package/assets/fonts/Roboto-700-cyrillic.woff2 +0 -0
  18. package/assets/fonts/Roboto-700-greek-ext.woff2 +0 -0
  19. package/assets/fonts/Roboto-700-greek.woff2 +0 -0
  20. package/assets/fonts/Roboto-700-latin-ext.woff2 +0 -0
  21. package/assets/fonts/Roboto-700-latin.woff2 +0 -0
  22. package/assets/fonts/Roboto-700-vietnamese.woff2 +0 -0
  23. package/assets/icon-192x192.png +0 -0
  24. package/assets/icon-512x512.png +0 -0
  25. package/assets/logo.png +0 -0
  26. package/assets/logo.svg +1 -1
  27. package/assets/manifest.json +0 -0
  28. package/dist/CookieConsent-5NH5DNTP.js +1 -0
  29. package/dist/{GoToDialog-RU5RP7S2.js → GoToDialog-CICRYHHG.js} +1 -1
  30. package/dist/chunk-MIPTBUWY.js +1 -0
  31. package/dist/components/common/FeatureCard.d.ts +9 -6
  32. package/dist/components/common/FeatureCard.d.ts.map +1 -1
  33. package/dist/components/common/FeatureCard.js +43 -32
  34. package/dist/components/cookie-consent/CookieConsent.d.ts +3 -3
  35. package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
  36. package/dist/components/cookie-consent/CookieConsent.js +36 -35
  37. package/dist/components/index.d.ts +0 -1
  38. package/dist/components/index.d.ts.map +1 -1
  39. package/dist/components/index.js +0 -1
  40. package/dist/components/layout/components/header/CacheSettings.d.ts.map +1 -1
  41. package/dist/components/layout/components/header/CacheSettings.js +6 -2
  42. package/dist/crud/components/EntityCardList.d.ts.map +1 -1
  43. package/dist/crud/components/EntityCardList.js +17 -4
  44. package/dist/crud/components/EntityDisplayRenderer.js +4 -4
  45. package/dist/crud/components/EntityFormRenderer.d.ts +6 -1
  46. package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
  47. package/dist/crud/components/EntityFormRenderer.js +31 -21
  48. package/dist/crud/components/EntityList.d.ts.map +1 -1
  49. package/dist/crud/components/EntityList.js +56 -72
  50. package/dist/crud/components/EntityRecommendations.d.ts.map +1 -1
  51. package/dist/crud/components/EntityWorkflow.d.ts.map +1 -1
  52. package/dist/crud/components/EntityWorkflow.js +1 -1
  53. package/dist/crud/crudImports.d.ts +0 -1
  54. package/dist/crud/crudImports.d.ts.map +1 -1
  55. package/dist/crud/crudImports.js +0 -1
  56. package/dist/dndev-next.css +644 -107
  57. package/dist/dndev.css +778 -117
  58. package/dist/files/inter-cyrillic-300-normal.woff +0 -0
  59. package/dist/files/inter-cyrillic-300-normal.woff2 +0 -0
  60. package/dist/files/inter-cyrillic-400-normal.woff +0 -0
  61. package/dist/files/inter-cyrillic-400-normal.woff2 +0 -0
  62. package/dist/files/inter-cyrillic-600-normal.woff +0 -0
  63. package/dist/files/inter-cyrillic-600-normal.woff2 +0 -0
  64. package/dist/files/inter-cyrillic-700-normal.woff +0 -0
  65. package/dist/files/inter-cyrillic-700-normal.woff2 +0 -0
  66. package/dist/files/inter-cyrillic-ext-300-normal.woff +0 -0
  67. package/dist/files/inter-cyrillic-ext-300-normal.woff2 +0 -0
  68. package/dist/files/inter-cyrillic-ext-400-normal.woff +0 -0
  69. package/dist/files/inter-cyrillic-ext-400-normal.woff2 +0 -0
  70. package/dist/files/inter-cyrillic-ext-600-normal.woff +0 -0
  71. package/dist/files/inter-cyrillic-ext-600-normal.woff2 +0 -0
  72. package/dist/files/inter-cyrillic-ext-700-normal.woff +0 -0
  73. package/dist/files/inter-cyrillic-ext-700-normal.woff2 +0 -0
  74. package/dist/files/inter-greek-300-normal.woff +0 -0
  75. package/dist/files/inter-greek-300-normal.woff2 +0 -0
  76. package/dist/files/inter-greek-400-normal.woff +0 -0
  77. package/dist/files/inter-greek-400-normal.woff2 +0 -0
  78. package/dist/files/inter-greek-600-normal.woff +0 -0
  79. package/dist/files/inter-greek-600-normal.woff2 +0 -0
  80. package/dist/files/inter-greek-700-normal.woff +0 -0
  81. package/dist/files/inter-greek-700-normal.woff2 +0 -0
  82. package/dist/files/inter-greek-ext-300-normal.woff +0 -0
  83. package/dist/files/inter-greek-ext-300-normal.woff2 +0 -0
  84. package/dist/files/inter-greek-ext-400-normal.woff +0 -0
  85. package/dist/files/inter-greek-ext-400-normal.woff2 +0 -0
  86. package/dist/files/inter-greek-ext-600-normal.woff +0 -0
  87. package/dist/files/inter-greek-ext-600-normal.woff2 +0 -0
  88. package/dist/files/inter-greek-ext-700-normal.woff +0 -0
  89. package/dist/files/inter-greek-ext-700-normal.woff2 +0 -0
  90. package/dist/files/inter-latin-300-normal.woff +0 -0
  91. package/dist/files/inter-latin-300-normal.woff2 +0 -0
  92. package/dist/files/inter-latin-400-normal.woff +0 -0
  93. package/dist/files/inter-latin-400-normal.woff2 +0 -0
  94. package/dist/files/inter-latin-600-normal.woff +0 -0
  95. package/dist/files/inter-latin-600-normal.woff2 +0 -0
  96. package/dist/files/inter-latin-700-normal.woff +0 -0
  97. package/dist/files/inter-latin-700-normal.woff2 +0 -0
  98. package/dist/files/inter-latin-ext-300-normal.woff +0 -0
  99. package/dist/files/inter-latin-ext-300-normal.woff2 +0 -0
  100. package/dist/files/inter-latin-ext-400-normal.woff +0 -0
  101. package/dist/files/inter-latin-ext-400-normal.woff2 +0 -0
  102. package/dist/files/inter-latin-ext-600-normal.woff +0 -0
  103. package/dist/files/inter-latin-ext-600-normal.woff2 +0 -0
  104. package/dist/files/inter-latin-ext-700-normal.woff +0 -0
  105. package/dist/files/inter-latin-ext-700-normal.woff2 +0 -0
  106. package/dist/files/inter-vietnamese-300-normal.woff +0 -0
  107. package/dist/files/inter-vietnamese-300-normal.woff2 +0 -0
  108. package/dist/files/inter-vietnamese-400-normal.woff +0 -0
  109. package/dist/files/inter-vietnamese-400-normal.woff2 +0 -0
  110. package/dist/files/inter-vietnamese-600-normal.woff +0 -0
  111. package/dist/files/inter-vietnamese-600-normal.woff2 +0 -0
  112. package/dist/files/inter-vietnamese-700-normal.woff +0 -0
  113. package/dist/files/inter-vietnamese-700-normal.woff2 +0 -0
  114. package/dist/files/playfair-display-cyrillic-400-normal.woff +0 -0
  115. package/dist/files/playfair-display-cyrillic-400-normal.woff2 +0 -0
  116. package/dist/files/playfair-display-cyrillic-500-normal.woff +0 -0
  117. package/dist/files/playfair-display-cyrillic-500-normal.woff2 +0 -0
  118. package/dist/files/playfair-display-cyrillic-600-normal.woff +0 -0
  119. package/dist/files/playfair-display-cyrillic-600-normal.woff2 +0 -0
  120. package/dist/files/playfair-display-cyrillic-700-normal.woff +0 -0
  121. package/dist/files/playfair-display-cyrillic-700-normal.woff2 +0 -0
  122. package/dist/files/playfair-display-latin-400-normal.woff +0 -0
  123. package/dist/files/playfair-display-latin-400-normal.woff2 +0 -0
  124. package/dist/files/playfair-display-latin-500-normal.woff +0 -0
  125. package/dist/files/playfair-display-latin-500-normal.woff2 +0 -0
  126. package/dist/files/playfair-display-latin-600-normal.woff +0 -0
  127. package/dist/files/playfair-display-latin-600-normal.woff2 +0 -0
  128. package/dist/files/playfair-display-latin-700-normal.woff +0 -0
  129. package/dist/files/playfair-display-latin-700-normal.woff2 +0 -0
  130. package/dist/files/playfair-display-latin-ext-400-normal.woff +0 -0
  131. package/dist/files/playfair-display-latin-ext-400-normal.woff2 +0 -0
  132. package/dist/files/playfair-display-latin-ext-500-normal.woff +0 -0
  133. package/dist/files/playfair-display-latin-ext-500-normal.woff2 +0 -0
  134. package/dist/files/playfair-display-latin-ext-600-normal.woff +0 -0
  135. package/dist/files/playfair-display-latin-ext-600-normal.woff2 +0 -0
  136. package/dist/files/playfair-display-latin-ext-700-normal.woff +0 -0
  137. package/dist/files/playfair-display-latin-ext-700-normal.woff2 +0 -0
  138. package/dist/files/playfair-display-vietnamese-400-normal.woff +0 -0
  139. package/dist/files/playfair-display-vietnamese-400-normal.woff2 +0 -0
  140. package/dist/files/playfair-display-vietnamese-500-normal.woff +0 -0
  141. package/dist/files/playfair-display-vietnamese-500-normal.woff2 +0 -0
  142. package/dist/files/playfair-display-vietnamese-600-normal.woff +0 -0
  143. package/dist/files/playfair-display-vietnamese-600-normal.woff2 +0 -0
  144. package/dist/files/playfair-display-vietnamese-700-normal.woff +0 -0
  145. package/dist/files/playfair-display-vietnamese-700-normal.woff2 +0 -0
  146. package/dist/files/press-start-2p-cyrillic-400-normal.woff +0 -0
  147. package/dist/files/press-start-2p-cyrillic-400-normal.woff2 +0 -0
  148. package/dist/files/press-start-2p-cyrillic-ext-400-normal.woff +0 -0
  149. package/dist/files/press-start-2p-cyrillic-ext-400-normal.woff2 +0 -0
  150. package/dist/files/press-start-2p-greek-400-normal.woff +0 -0
  151. package/dist/files/press-start-2p-greek-400-normal.woff2 +0 -0
  152. package/dist/files/press-start-2p-latin-400-normal.woff +0 -0
  153. package/dist/files/press-start-2p-latin-400-normal.woff2 +0 -0
  154. package/dist/files/press-start-2p-latin-ext-400-normal.woff +0 -0
  155. package/dist/files/press-start-2p-latin-ext-400-normal.woff2 +0 -0
  156. package/dist/files/roboto-cyrillic-400-normal.woff +0 -0
  157. package/dist/files/roboto-cyrillic-400-normal.woff2 +0 -0
  158. package/dist/files/roboto-cyrillic-700-normal.woff +0 -0
  159. package/dist/files/roboto-cyrillic-700-normal.woff2 +0 -0
  160. package/dist/files/roboto-cyrillic-ext-400-normal.woff +0 -0
  161. package/dist/files/roboto-cyrillic-ext-400-normal.woff2 +0 -0
  162. package/dist/files/roboto-cyrillic-ext-700-normal.woff +0 -0
  163. package/dist/files/roboto-cyrillic-ext-700-normal.woff2 +0 -0
  164. package/dist/files/roboto-greek-400-normal.woff +0 -0
  165. package/dist/files/roboto-greek-400-normal.woff2 +0 -0
  166. package/dist/files/roboto-greek-700-normal.woff +0 -0
  167. package/dist/files/roboto-greek-700-normal.woff2 +0 -0
  168. package/dist/files/roboto-greek-ext-400-normal.woff +0 -0
  169. package/dist/files/roboto-greek-ext-400-normal.woff2 +0 -0
  170. package/dist/files/roboto-greek-ext-700-normal.woff +0 -0
  171. package/dist/files/roboto-greek-ext-700-normal.woff2 +0 -0
  172. package/dist/files/roboto-latin-400-normal.woff +0 -0
  173. package/dist/files/roboto-latin-400-normal.woff2 +0 -0
  174. package/dist/files/roboto-latin-700-normal.woff +0 -0
  175. package/dist/files/roboto-latin-700-normal.woff2 +0 -0
  176. package/dist/files/roboto-latin-ext-400-normal.woff +0 -0
  177. package/dist/files/roboto-latin-ext-400-normal.woff2 +0 -0
  178. package/dist/files/roboto-latin-ext-700-normal.woff +0 -0
  179. package/dist/files/roboto-latin-ext-700-normal.woff2 +0 -0
  180. package/dist/files/roboto-math-400-normal.woff +0 -0
  181. package/dist/files/roboto-math-400-normal.woff2 +0 -0
  182. package/dist/files/roboto-math-700-normal.woff +0 -0
  183. package/dist/files/roboto-math-700-normal.woff2 +0 -0
  184. package/dist/files/roboto-symbols-400-normal.woff +0 -0
  185. package/dist/files/roboto-symbols-400-normal.woff2 +0 -0
  186. package/dist/files/roboto-symbols-700-normal.woff +0 -0
  187. package/dist/files/roboto-symbols-700-normal.woff2 +0 -0
  188. package/dist/files/roboto-vietnamese-400-normal.woff +0 -0
  189. package/dist/files/roboto-vietnamese-400-normal.woff2 +0 -0
  190. package/dist/files/roboto-vietnamese-700-normal.woff +0 -0
  191. package/dist/files/roboto-vietnamese-700-normal.woff2 +0 -0
  192. package/dist/files/space-grotesk-latin-300-normal.woff +0 -0
  193. package/dist/files/space-grotesk-latin-300-normal.woff2 +0 -0
  194. package/dist/files/space-grotesk-latin-400-normal.woff +0 -0
  195. package/dist/files/space-grotesk-latin-400-normal.woff2 +0 -0
  196. package/dist/files/space-grotesk-latin-500-normal.woff +0 -0
  197. package/dist/files/space-grotesk-latin-500-normal.woff2 +0 -0
  198. package/dist/files/space-grotesk-latin-600-normal.woff +0 -0
  199. package/dist/files/space-grotesk-latin-600-normal.woff2 +0 -0
  200. package/dist/files/space-grotesk-latin-700-normal.woff +0 -0
  201. package/dist/files/space-grotesk-latin-700-normal.woff2 +0 -0
  202. package/dist/files/space-grotesk-latin-ext-300-normal.woff +0 -0
  203. package/dist/files/space-grotesk-latin-ext-300-normal.woff2 +0 -0
  204. package/dist/files/space-grotesk-latin-ext-400-normal.woff +0 -0
  205. package/dist/files/space-grotesk-latin-ext-400-normal.woff2 +0 -0
  206. package/dist/files/space-grotesk-latin-ext-500-normal.woff +0 -0
  207. package/dist/files/space-grotesk-latin-ext-500-normal.woff2 +0 -0
  208. package/dist/files/space-grotesk-latin-ext-600-normal.woff +0 -0
  209. package/dist/files/space-grotesk-latin-ext-600-normal.woff2 +0 -0
  210. package/dist/files/space-grotesk-latin-ext-700-normal.woff +0 -0
  211. package/dist/files/space-grotesk-latin-ext-700-normal.woff2 +0 -0
  212. package/dist/files/space-grotesk-vietnamese-300-normal.woff +0 -0
  213. package/dist/files/space-grotesk-vietnamese-300-normal.woff2 +0 -0
  214. package/dist/files/space-grotesk-vietnamese-400-normal.woff +0 -0
  215. package/dist/files/space-grotesk-vietnamese-400-normal.woff2 +0 -0
  216. package/dist/files/space-grotesk-vietnamese-500-normal.woff +0 -0
  217. package/dist/files/space-grotesk-vietnamese-500-normal.woff2 +0 -0
  218. package/dist/files/space-grotesk-vietnamese-600-normal.woff +0 -0
  219. package/dist/files/space-grotesk-vietnamese-600-normal.woff2 +0 -0
  220. package/dist/files/space-grotesk-vietnamese-700-normal.woff +0 -0
  221. package/dist/files/space-grotesk-vietnamese-700-normal.woff2 +0 -0
  222. package/dist/index.js +4 -4
  223. package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
  224. package/dist/internal/devtools/utils/virtualModuleInspector.d.ts.map +1 -1
  225. package/dist/internal/devtools/utils/virtualModuleInspector.js +12 -1
  226. package/dist/internal/initializers/BaseStoresInitializer.d.ts +3 -1
  227. package/dist/internal/initializers/BaseStoresInitializer.d.ts.map +1 -1
  228. package/dist/internal/initializers/BaseStoresInitializer.js +8 -4
  229. package/dist/internal/initializers/NextJsStoresInitializer.d.ts +1 -1
  230. package/dist/internal/initializers/NextJsStoresInitializer.d.ts.map +1 -1
  231. package/dist/internal/initializers/NextJsStoresInitializer.js +2 -13
  232. package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
  233. package/dist/internal/layout/DnDevLayout.js +32 -13
  234. package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
  235. package/dist/internal/layout/components/AutoMetaTags.js +3 -7
  236. package/dist/internal/layout/config/presets/moolti.d.ts.map +1 -1
  237. package/dist/internal/layout/config/presets/moolti.js +11 -13
  238. package/dist/internal/layout/zones/DnDevFooter.d.ts +1 -1
  239. package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
  240. package/dist/internal/layout/zones/DnDevFooter.js +1 -1
  241. package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
  242. package/dist/providers/NextJsAppProviders.js +12 -8
  243. package/dist/routing/AuthGuard.d.ts.map +1 -1
  244. package/dist/routing/AuthGuard.js +1 -1
  245. package/dist/routing/AuthReturnTo.d.ts.map +1 -1
  246. package/dist/routing/GoToInput.d.ts.map +1 -1
  247. package/dist/routing/GoToInput.js +5 -5
  248. package/dist/routing/Link.d.ts.map +1 -1
  249. package/dist/routing/Link.js +14 -0
  250. package/dist/routing/hooks/hooks.next.js +1 -1
  251. package/dist/routing/hooks/hooks.vite.js +1 -1
  252. package/dist/routing/hooks/useNavigate.next.d.ts +2 -6
  253. package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
  254. package/dist/routing/hooks/useNavigate.next.js +5 -52
  255. package/dist/routing/hooks/useNavigate.vite.d.ts +2 -6
  256. package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
  257. package/dist/routing/hooks/useNavigate.vite.js +5 -52
  258. package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
  259. package/dist/routing/hooks/useRedirectGuard.next.js +5 -1
  260. package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
  261. package/dist/routing/hooks/useRedirectGuard.vite.js +5 -1
  262. package/dist/routing/useGoTo.d.ts.map +1 -1
  263. package/dist/routing/useGoTo.js +12 -17
  264. package/dist/styles/index.css +778 -117
  265. package/dist/symbol-index.json +1 -1
  266. package/dist/utils/useAuthSafe.d.ts.map +1 -1
  267. package/dist/utils/useSeo.d.ts +1 -1
  268. package/dist/utils/useSeo.d.ts.map +1 -1
  269. package/dist/utils/useSeo.js +3 -1
  270. package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
  271. package/dist/vite-routing/AppRoutes.js +7 -2
  272. package/dist/vite-routing/RootLayout.d.ts.map +1 -1
  273. package/dist/vite-routing/RootLayout.js +1 -4
  274. package/guidelines/COMPONENTS.md +0 -0
  275. package/guidelines/GOTCHAS.md +0 -0
  276. package/guidelines/LAYOUTS.md +0 -0
  277. package/guidelines/PAGES.md +0 -0
  278. package/guidelines/ROUTING.md +0 -0
  279. package/guidelines/SEO.md +0 -0
  280. package/package.json +13 -13
  281. package/dist/CookieConsent-UVTR7CWW.js +0 -1
  282. package/dist/chunk-ETE4RC7M.js +0 -1
  283. package/dist/components/license/LicenseWatermark.d.ts +0 -25
  284. package/dist/components/license/LicenseWatermark.d.ts.map +0 -1
  285. package/dist/components/license/LicenseWatermark.js +0 -109
  286. package/dist/components/license/watermarkData.d.ts +0 -7
  287. package/dist/components/license/watermarkData.d.ts.map +0 -1
  288. package/dist/components/license/watermarkData.js +0 -18
@@ -7,7 +7,8 @@ import { handleError, useConsent, getCookieExamples, hasOptionalCookies as check
7
7
  import { CONSENT_CATEGORY, } from '@donotdev/core';
8
8
  import { useTranslation } from '@donotdev/core';
9
9
  import { isClient } from '@donotdev/core';
10
- function CookieConsent({ position = 'bottom', showBranding = true, brandingText = 'Powered by DoNotDev Framework', className = '', }) {
10
+ const MAX_WIDTH = 480;
11
+ function CookieConsent({ position = 'bottom', className = '', }) {
11
12
  const hasConsented = useConsent('hasConsented');
12
13
  const categories = useConsent('categories');
13
14
  const acceptAll = useConsent('acceptAll');
@@ -24,8 +25,7 @@ function CookieConsent({ position = 'bottom', showBranding = true, brandingText
24
25
  setShowBanner(true);
25
26
  }
26
27
  }, [storeShowBanner]);
27
- // Get categories that are actually required by the app's features
28
- // Store only includes categories that are needed (from featureMatrix or requiredCookies config)
28
+ // Get categories actually required by the app's features
29
29
  const requiredCategories = Object.keys(categories);
30
30
  const categoryDefs = [
31
31
  {
@@ -62,32 +62,27 @@ function CookieConsent({ position = 'bottom', showBranding = true, brandingText
62
62
  locked: false,
63
63
  },
64
64
  ].filter((cat) => requiredCategories.includes(cat.id));
65
- // Check if app has optional categories based on detected features
66
65
  const hasOptionalCategories = checkHasOptionalCookies();
67
- // Auto-accept if only necessary cookies (GDPR/CCPA compliant - necessary cookies don't need consent)
66
+ // Auto-accept if only necessary cookies (GDPR/CCPA — necessary don't need consent)
68
67
  useEffect(() => {
69
68
  if (!hasConsented && !hasOptionalCategories) {
70
- acceptAll(); // Accepts only necessary cookies, show notice instead of banner
69
+ acceptAll();
71
70
  }
72
71
  }, [hasConsented, hasOptionalCategories, acceptAll]);
73
- // Sync local draft state with store when categories change
74
- // Default all optional categories to ON for better UX (easier to uncheck than check all)
72
+ // Sync local draft state when accordion opens — default optional ON for easier UX
75
73
  useEffect(() => {
76
- const defaultedCategories = { ...categories };
77
- // Default all optional categories to true if accordion is open and they're undefined
74
+ const defaulted = { ...categories };
78
75
  if (showPreferences) {
79
- // Use Record type assertion for mutable access to union type
80
- const mutableCategories = defaultedCategories;
81
- Object.keys(mutableCategories).forEach((cat) => {
82
- if (cat !== CONSENT_CATEGORY.NECESSARY &&
83
- mutableCategories[cat] === false) {
84
- mutableCategories[cat] = true;
76
+ const mutable = defaulted;
77
+ Object.keys(mutable).forEach((cat) => {
78
+ if (cat !== CONSENT_CATEGORY.NECESSARY && mutable[cat] === false) {
79
+ mutable[cat] = true;
85
80
  }
86
81
  });
87
82
  }
88
- setPreferenceCategories(defaultedCategories);
83
+ setPreferenceCategories(defaulted);
89
84
  }, [categories, showPreferences]);
90
- // Track if banner was dismissed without consent
85
+ // Dismiss on outside click when banner is showing pre-consent
91
86
  useEffect(() => {
92
87
  if (!isClient() || hasConsented || !showBanner)
93
88
  return;
@@ -112,7 +107,6 @@ function CookieConsent({ position = 'bottom', showBranding = true, brandingText
112
107
  Object.entries(preferenceCategories).forEach(([cat, val]) => {
113
108
  if (cat !== CONSENT_CATEGORY.NECESSARY && val !== undefined) {
114
109
  const categoryKey = cat;
115
- // Check if category value exists in CONSENT_CATEGORY values (not keys)
116
110
  if (Object.values(CONSENT_CATEGORY).includes(categoryKey)) {
117
111
  updateCategory(categoryKey, Boolean(val));
118
112
  }
@@ -140,30 +134,37 @@ function CookieConsent({ position = 'bottom', showBranding = true, brandingText
140
134
  declineAll();
141
135
  setShowBanner(false);
142
136
  };
143
- const bannerContent = (_jsxs(Stack, { children: [_jsx(Text, { as: "p", variant: "muted", level: "small", children: t('cookieBannerDescription') }), hasOptionalCategories && (_jsx(Accordion, { type: "single", collapsible: true, value: showPreferences ? 'preferences' : '', onValueChange: (value) => setShowPreferences(value === 'preferences'), items: [
137
+ const bannerContent = (_jsxs(Stack, { gap: "medium", children: [_jsx(Text, { as: "p", variant: "muted", level: "small", style: { lineHeight: 1.55 }, children: t('cookieBannerDescription') }), hasOptionalCategories && (_jsx(Accordion, { type: "single", collapsible: true, value: showPreferences ? 'preferences' : '', onValueChange: (value) => setShowPreferences(value === 'preferences'), items: [
144
138
  {
145
139
  value: 'preferences',
146
- trigger: (_jsxs(Stack, { direction: "row", align: "center", gap: "tight", children: [_jsx(Settings, { className: "dndev-size-md" }), t('customize')] })),
147
- content: (_jsx(Stack, { children: categoryDefs.map((cat) => {
140
+ trigger: (_jsxs(Stack, { direction: "row", align: "center", gap: "tight", children: [_jsx(Settings, { className: "dndev-size-sm" }), _jsx(Text, { as: "span", level: "small", weight: "medium", children: t('customize') })] })),
141
+ content: (_jsx(Stack, { gap: "tight", children: categoryDefs.map((cat) => {
148
142
  const Icon = cat.icon;
149
143
  const enabled = preferenceCategories[cat.id] ?? false;
150
- return (_jsx(Card, { content: _jsxs(Stack, { direction: "row", align: "center", justify: "between", children: [_jsxs(Stack, { direction: "row", align: "start", gap: "tight", style: { flex: 1 }, children: [_jsx(Icon, { className: "dndev-size-md", style: {
151
- color: 'var(--primary)',
152
- marginTop: '0.125rem',
153
- } }), _jsxs(Stack, { gap: "tight", children: [_jsx(Text, { as: "span", level: "body", style: { fontWeight: 600 }, children: cat.title }), _jsx(Text, { as: "span", variant: "muted", level: "small", children: cat.description }), cat.examples && (_jsx(Text, { as: "span", variant: "muted", level: "small", style: { fontStyle: 'italic' }, children: cat.examples }))] })] }), cat.locked ? (_jsx(Text, { as: "span", variant: "muted", level: "small", children: t('alwaysOn') })) : (_jsx(Switch, { checked: enabled, onCheckedChange: (val) => setPreferenceCategories((prev) => ({
154
- ...prev,
155
- [cat.id]: val,
156
- })) }))] }) }, cat.id));
144
+ return (_jsxs(Stack, { direction: "row", align: "start", justify: "between", gap: "medium", style: {
145
+ padding: '0.75rem',
146
+ borderRadius: 'var(--radius-surface, 0.5rem)',
147
+ background: 'var(--muted)',
148
+ }, children: [_jsxs(Stack, { direction: "row", align: "start", gap: "tight", style: { flex: 1, minWidth: 0 }, children: [_jsx(Icon, { className: "dndev-size-sm", style: {
149
+ color: 'var(--primary)',
150
+ marginTop: '0.15rem',
151
+ flexShrink: 0,
152
+ } }), _jsxs(Stack, { gap: "none", style: { minWidth: 0 }, children: [_jsx(Text, { as: "span", level: "small", weight: "semibold", children: cat.title }), _jsx(Text, { as: "span", variant: "muted", level: "caption", style: { lineHeight: 1.45 }, children: cat.description })] })] }), cat.locked ? (_jsx(Text, { as: "span", variant: "muted", level: "caption", weight: "medium", style: { flexShrink: 0 }, children: t('alwaysOn') })) : (_jsx(Switch, { checked: enabled, onCheckedChange: (val) => setPreferenceCategories((prev) => ({
153
+ ...prev,
154
+ [cat.id]: val,
155
+ })) }))] }, cat.id));
157
156
  }) })),
158
157
  },
159
158
  ] }))] }));
160
- const bannerFooter = showPreferences ? (_jsxs(Stack, { direction: "row", gap: "tight", style: { width: '100%' }, children: [_jsx(Button, { onClick: handleSave, variant: BUTTON_VARIANT.DEFAULT, style: { flex: 1 }, children: t('savePreferences', 'Save Preferences') }), _jsx(Button, { onClick: () => setShowPreferences(false), variant: BUTTON_VARIANT.OUTLINE, style: { flex: 1 }, children: t('form.cancel', 'Cancel') })] })) : (_jsxs(Stack, { direction: "row", gap: "tight", style: { width: '100%' }, children: [_jsx(Button, { onClick: handleAcceptAll, variant: BUTTON_VARIANT.DEFAULT, style: { flex: 1 }, children: t('acceptAll') }), hasOptionalCategories && (_jsx(Button, { onClick: handleDeclineAll, variant: BUTTON_VARIANT.OUTLINE, style: { flex: 1 }, children: t('declineOptional') }))] }));
161
- return (_jsxs(_Fragment, { children: [showBanner && (_jsx(Card, { ref: bannerRef, className: cn('dndev-fixed dndev-z-modal', className), icon: Cookie, title: t('cookiePreferences'), content: bannerContent, footer: bannerFooter, style: {
159
+ const bannerFooter = showPreferences ? (_jsxs(Stack, { direction: "row", gap: "tight", style: { width: '100%' }, children: [_jsx(Button, { onClick: () => setShowPreferences(false), variant: BUTTON_VARIANT.OUTLINE, style: { flex: 1 }, children: t('form.cancel', 'Cancel') }), _jsx(Button, { onClick: handleSave, variant: BUTTON_VARIANT.DEFAULT, style: { flex: 1 }, children: t('savePreferences', 'Save Preferences') })] })) : (_jsxs(Stack, { direction: "row", gap: "tight", style: { width: '100%' }, children: [hasOptionalCategories && (_jsx(Button, { onClick: handleDeclineAll, variant: BUTTON_VARIANT.OUTLINE, style: { flex: 1 }, children: t('declineOptional') })), _jsx(Button, { onClick: handleAcceptAll, variant: BUTTON_VARIANT.DEFAULT, style: { flex: 1 }, children: t('acceptAll') })] }));
160
+ return (_jsxs(_Fragment, { children: [showBanner && (_jsx(Card, { ref: bannerRef, elevated: true, icon: Cookie, title: t('cookiePreferences'), content: bannerContent, footer: bannerFooter, className: cn('dndev-fixed dndev-z-modal', className), style: {
162
161
  [position === 'top' ? 'top' : 'bottom']: 'var(--gap-md)',
163
162
  insetInlineStart: 'var(--gap-md)',
164
- insetInlineEnd: 'var(--gap-md)',
165
- maxWidth: '100%',
166
- width: 'calc(100% - var(--gap-md) * 2)',
167
- } })), !showBanner && !hasConsented && (_jsx(Button, { onClick: () => setShowBanner(true), className: "dndev-fixed dndev-z-toast", style: { bottom: 'var(--gap-md)', insetInlineStart: 'var(--gap-md)' }, icon: Cookie, title: t('cookiePreferences') }))] }));
163
+ width: `min(${MAX_WIDTH}px, calc(100vw - var(--gap-md) * 2))`,
164
+ height: 'auto',
165
+ } })), !showBanner && !hasConsented && (_jsx(Button, { onClick: () => setShowBanner(true), variant: BUTTON_VARIANT.OUTLINE, floating: true, icon: Cookie, display: "compact", tooltip: t('cookiePreferences'), "aria-label": t('cookiePreferences'), className: "dndev-fixed dndev-z-toast", style: {
166
+ [position === 'top' ? 'top' : 'bottom']: 'var(--gap-md)',
167
+ insetInlineStart: 'var(--gap-md)',
168
+ } }))] }));
168
169
  }
169
170
  export default CookieConsent;
@@ -10,5 +10,4 @@ export * from './auth';
10
10
  export * from './common';
11
11
  export * from './cookie-consent';
12
12
  export * from './layout';
13
- export * from './license/LicenseWatermark';
14
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC"}
@@ -11,4 +11,3 @@ export * from './auth';
11
11
  export * from './common';
12
12
  export * from './cookie-consent';
13
13
  export * from './layout';
14
- export * from './license/LicenseWatermark';
@@ -1 +1 @@
1
- {"version":3,"file":"CacheSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/CacheSettings.tsx"],"names":[],"mappings":"AA0BA;;;;;;;;;GASG;AACH,iBAAS,aAAa,4CAuPrB;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"CacheSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/CacheSettings.tsx"],"names":[],"mappings":"AA0BA;;;;;;;;;GASG;AACH,iBAAS,aAAa,4CA+PrB;AAED,eAAe,aAAa,CAAC"}
@@ -89,7 +89,9 @@ function CacheSettings() {
89
89
  console.error('Failed to clear IndexedDB:', err);
90
90
  }
91
91
  }
92
- if (cacheOptions.webSQL && typeof window !== 'undefined' && 'openDatabase' in window) {
92
+ if (cacheOptions.webSQL &&
93
+ typeof window !== 'undefined' &&
94
+ 'openDatabase' in window) {
93
95
  try {
94
96
  const db = globalThis.openDatabase('', '', '', '');
95
97
  if (db && db.transaction) {
@@ -111,7 +113,9 @@ function CacheSettings() {
111
113
  }
112
114
  }
113
115
  // Clear Application Cache API
114
- if (cacheOptions.applicationCache && typeof window !== 'undefined' && 'caches' in window) {
116
+ if (cacheOptions.applicationCache &&
117
+ typeof window !== 'undefined' &&
118
+ 'caches' in window) {
115
119
  try {
116
120
  const keys = await caches.keys();
117
121
  await Promise.all(keys.map(async (key) => {
@@ -1 +1 @@
1
- {"version":3,"file":"EntityCardList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityCardList.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,mBAAmB,EAAgB,MAAM,gBAAgB,CAAC;AAYxE,YAAY,EAAE,mBAAmB,EAAE,CAAC;AA0GpC;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,OAAO,EACP,IAAmB,EACnB,SAA0B,EAAE,2BAA2B;AACvD,YAAY,EACZ,MAAM,EACN,WAAmB,EACnB,WAAW,EACX,IAAI,EACJ,iBAAiB,EACjB,UAAU,EACV,WAAmB,EACnB,WAAW,EACX,OAAO,GACR,EAAE,mBAAmB,kDA2MrB"}
1
+ {"version":3,"file":"EntityCardList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityCardList.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,mBAAmB,EAAgB,MAAM,gBAAgB,CAAC;AAWxE,YAAY,EAAE,mBAAmB,EAAE,CAAC;AA0GpC;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,OAAO,EACP,IAAmB,EACnB,SAA0B,EAAE,2BAA2B;AACvD,YAAY,EACZ,MAAM,EACN,WAAmB,EACnB,WAAW,EACX,IAAI,EACJ,iBAAiB,EACjB,UAAU,EACV,WAAmB,EACnB,WAAW,EACX,OAAO,GACR,EAAE,mBAAmB,kDA4OrB"}
@@ -96,7 +96,12 @@ queryOptions, filter, hideFilters = false, resultLabel, tone, renderCardOverlay,
96
96
  const navigate = useNavigate();
97
97
  const base = basePath ?? `/${entity.collection}`;
98
98
  // useCrudCardList -> handles fetching + client-side filter/search/sort via `processed`
99
- const { items: rawData, processed, loading: fetchLoading, } = useCrudCardList(entity, { enabled: !isPreview, staleTime, queryOptions, clientSort });
99
+ const { items: rawData, processed, loading: fetchLoading, error: fetchError, } = useCrudCardList(entity, {
100
+ enabled: !isPreview,
101
+ staleTime,
102
+ queryOptions,
103
+ clientSort,
104
+ });
100
105
  // In preview mode: use preview data, skip loading state
101
106
  const loading = isPreview ? false : fetchLoading;
102
107
  // Favorites - always enabled, no props needed
@@ -104,7 +109,7 @@ queryOptions, filter, hideFilters = false, resultLabel, tone, renderCardOverlay,
104
109
  collection: entity.collection,
105
110
  });
106
111
  // Favorites toggle from CrudStore (persists across navigation)
107
- const { showFavoritesOnly, setShowFavoritesOnly } = useCrudFilters({
112
+ const { showFavoritesOnly, setShowFavoritesOnly, filters, setFilters } = useCrudFilters({
108
113
  collection: entity.collection,
109
114
  });
110
115
  // Apply UI-specific filters (favorites, consumer filter prop) on top of processed
@@ -159,14 +164,22 @@ queryOptions, filter, hideFilters = false, resultLabel, tone, renderCardOverlay,
159
164
  defaultValue: data.length === 1
160
165
  ? 'Found 1 occurrence'
161
166
  : `Found ${data.length} occurrences`,
162
- }), 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', {
163
172
  defaultValue: `No ${entity.name.toLowerCase()} found`,
164
173
  }) }), _jsx(Text, { style: { color: 'var(--muted-foreground)' }, children: tCrud('emptyState.description', {
165
174
  defaultValue: `No ${entity.name.toLowerCase()} available at this time.`,
166
175
  }) })] })) : (_jsx(Grid, { cols: cols, children: data.map((item) => {
167
176
  const itemIsFavorite = isFavorite(item.id);
168
177
  const detailHref = isPreview || onClick ? undefined : `${base}/${item.id}`;
169
- return (_jsx(CrudCard, { item: item, entity: entity, detailHref: detailHref, onClick: isPreview ? undefined : (onClick ? () => handleView(item.id) : undefined), renderOverlay: renderCardOverlay?.(item), renderActions: _jsx(Heart, { fill: itemIsFavorite ? '#ef4444' : '#ffffff', stroke: itemIsFavorite ? '#ef4444' : 'var(--muted-foreground)', onClick: (e) => {
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) => {
170
183
  e.preventDefault();
171
184
  e.stopPropagation();
172
185
  if (!isPreview)
@@ -94,9 +94,9 @@ export function EntityDisplayRenderer({ entity, id, t, className = '', loadingMe
94
94
  }, [id, get, isAvailable, isPreview]);
95
95
  // In preview mode: use preview data directly
96
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);
97
+ const displayData = isPreview ? preview : storeData || data;
98
+ const displayError = isPreview ? null : storeError || fetchError;
99
+ const isLoading = isPreview ? false : loading || isFetching || !id;
100
100
  // Filter fields: respect visibility AND skip empty values
101
101
  // MUST be called before any early returns (Rules of Hooks)
102
102
  const visibleFields = useMemo(() => {
@@ -115,7 +115,7 @@ export function EntityDisplayRenderer({ entity, id, t, className = '', loadingMe
115
115
  if (fieldConfig.visibility === 'hidden') {
116
116
  return false;
117
117
  }
118
- // Get field value
118
+ // Get field value (displayData may be preview T or store row; entity is AnyEntity in props)
119
119
  const value = displayData[fieldName];
120
120
  // Hide if value is empty/null/undefined
121
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,kDAid5B;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();
@@ -214,6 +208,14 @@ export function EntityFormRenderer({ entity, onSubmit, t, className = '', submit
214
208
  successText: tCrud('form.saved', { defaultValue: 'Saved' }),
215
209
  };
216
210
  }
211
+ if (formStatus === 'error') {
212
+ return {
213
+ loading: false,
214
+ errorText: tCrud('form.error', {
215
+ defaultValue: 'Error — try again',
216
+ }),
217
+ };
218
+ }
217
219
  return { loading: false };
218
220
  }, [formStatus, uploadProgress, tCrud]);
219
221
  return (_jsx(FormProvider, { ...form, children: _jsx(UploadProvider, { formId: formId, children: _jsxs("div", { style: {
@@ -221,7 +223,10 @@ export function EntityFormRenderer({ entity, onSubmit, t, className = '', submit
221
223
  width: '100%',
222
224
  gridColumn: '1 / -1',
223
225
  display: 'contents',
224
- }, 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 }) => {
225
230
  // Evaluate dynamic conditions for this field
226
231
  const cond = fieldConditions[name];
227
232
  if (cond && !cond.visible)
@@ -284,7 +289,12 @@ export function EntityFormRenderer({ entity, onSubmit, t, className = '', submit
284
289
  }, loading: buttonState.loading, loadingText: buttonState.loadingText, progress: buttonState.progress, variant: secondaryButtonVariant, className: "dndev-w-full", children: secondaryButtonText }, "secondary"));
285
290
  }
286
291
  // Primary submit button (always shown)
287
- buttons.push(_jsx(Button, { type: "submit", loading: buttonState.loading, loadingText: buttonState.loadingText, progress: buttonState.progress, variant: buttonState.successText ? 'success' : submitVariant, disabled: !!buttonState.successText, className: "dndev-w-full", children: buttonState.successText ||
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 ||
288
298
  submitText ||
289
299
  tCrud('form.submit', { defaultValue: 'Submit' }) }, "submit"));
290
300
  const buttonCount = buttons.length;
@@ -1 +1 @@
1
- {"version":3,"file":"EntityList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityList.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAetD,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,OAAO,EACP,WAAmB,EACnB,UAAmB,EACnB,QAAQ,EAAE,YAAY,EACtB,YAAY,EACZ,UAAiB,EACjB,OAAO,EACP,IAAI,GACL,EAAE,eAAe,kDA6SjB"}
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"}
@@ -14,11 +14,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
14
14
  * @author AMBROISE PARK Consulting
15
15
  */
16
16
  import { RefreshCw, Plus, Trash2, Edit, Search } from 'lucide-react';
17
- import { useMemo, useCallback, useState } from 'react';
17
+ import { useCallback, useState } from 'react';
18
18
  import { DataTable, Button, Stack, ActionButton, Section, Input, } from '@donotdev/components';
19
19
  import { useTranslation } from '@donotdev/core';
20
20
  import { isCrudModuleAvailable, translateFieldLabel, useCrud, useCrudList, useCrudPageSize, EntityFilters, formatValue, useReferenceResolver, } from '../crudImports';
21
- import { useNavigate } from '../../routing';
21
+ import { Link, useNavigate } from '../../routing';
22
22
  /**
23
23
  * Entity List Component - Table view for admin/internal operations
24
24
  *
@@ -60,7 +60,9 @@ export function EntityList({ entity, basePath, onClick, hideFilters = false, pag
60
60
  }),
61
61
  });
62
62
  // In preview mode: use preview data, skip loading state
63
- const filteredData = isPreview ? preview : fetchedData;
63
+ const filteredData = isPreview
64
+ ? preview
65
+ : fetchedData;
64
66
  const loading = isPreview ? false : fetchLoading;
65
67
  // useCrud -> handles actions (delete)
66
68
  const { delete: deleteItem } = useCrud(entity);
@@ -68,15 +70,9 @@ export function EntityList({ entity, basePath, onClick, hideFilters = false, pag
68
70
  // Entity + crud namespaces so formatValue can resolve crud:price.* etc.
69
71
  const { t } = useTranslation([entity.namespace, 'crud']);
70
72
  // Refresh handler - triggers manual refetch in useList
71
- const handleRefresh = useCallback(async () => {
73
+ const handleRefresh = async () => {
72
74
  await refreshList();
73
- }, [refreshList]);
74
- // Edit button: always navigate to basePath/:id
75
- const handleEdit = useCallback((id) => {
76
- if (isPreview)
77
- return;
78
- navigate(`${base}/${id}`);
79
- }, [base, navigate, isPreview]);
75
+ };
80
76
  // Row click: onClick(id) if provided, else navigate to basePath/:id
81
77
  const handleView = useCallback((id) => {
82
78
  if (isPreview)
@@ -88,70 +84,57 @@ export function EntityList({ entity, basePath, onClick, hideFilters = false, pag
88
84
  navigate(`${base}/${id}`);
89
85
  }
90
86
  }, [base, navigate, onClick, isPreview]);
91
- // Add New: navigate to basePath/new
92
- const handleCreate = useCallback(() => {
93
- if (isPreview)
94
- return;
95
- navigate(`${base}/new`);
96
- }, [base, navigate, isPreview]);
97
87
  // Delete handler - store handles optimistic removal automatically
98
- const handleDelete = useCallback(async (itemId) => {
88
+ const handleDelete = async (itemId) => {
99
89
  if (isPreview)
100
90
  return;
101
91
  await deleteItem(itemId);
102
- }, [deleteItem, isPreview]);
92
+ };
103
93
  // Generate columns from entity.listFields or entity.fields
104
- const columns = useMemo(() => {
105
- const fieldsToShow = entity.listFields || Object.keys(entity.fields);
106
- const baseColumns = fieldsToShow
107
- .map((fieldName) => {
108
- const fieldConfig = entity.fields[fieldName];
109
- if (!fieldConfig)
110
- return null;
111
- const label = translateFieldLabel(fieldName, fieldConfig, t);
112
- const fieldType = fieldConfig.type || 'text';
113
- const isNumeric = fieldType === 'number' || fieldType === 'range';
114
- const align = isNumeric ? 'end' : 'start';
115
- return {
116
- key: fieldName,
117
- title: label,
118
- dataIndex: fieldName,
119
- sortable: !isPreview,
120
- filterable: !isPreview,
121
- align,
122
- render: (value, record) => formatValue(value, fieldConfig, t, {
123
- compact: true,
124
- referenceData,
125
- item: record,
126
- }),
127
- };
128
- })
129
- .filter(Boolean);
130
- // Add actions column at the front (for mobile accessibility)
131
- baseColumns.unshift({
132
- key: '_actions',
133
- title: tCrud('actions.label', { defaultValue: 'Actions' }),
134
- dataIndex: undefined,
135
- sortable: false,
136
- width: 120,
137
- align: 'center',
138
- render: (_, record) => (_jsxs(Stack, { direction: "row", gap: "tight", align: "center", justify: "center", children: [_jsx(Button, { variant: "outline", icon: Edit, disabled: isPreview, onClick: (e) => {
139
- e.stopPropagation();
140
- handleEdit(record.id);
141
- }, "aria-label": tCrud('edit', { defaultValue: 'Edit' }) }), _jsx(ActionButton, { action: async () => {
142
- await handleDelete(record.id);
143
- }, confirmText: tCrud('delete.confirm', {
144
- defaultValue: 'Are you sure you want to delete this item?',
145
- }), confirmTitle: tCrud('delete.title', {
146
- defaultValue: 'Delete Item',
147
- }), loadingText: tCrud('delete.loading', {
148
- defaultValue: 'Deleting...',
149
- }), variant: "destructive", icon: Trash2, disabled: isPreview, "aria-label": tCrud('delete', { defaultValue: 'Delete' }), children: tCrud('delete', { defaultValue: 'Delete' }) })] })),
150
- });
151
- return baseColumns;
152
- // Note: 't' and 'tCrud' are assumed stable across renders (i18next returns the same reference
153
- // unless the language changes). If i18n language switching causes stale columns, add i18n.language to deps.
154
- }, [entity, t, tCrud, handleEdit, handleDelete, isPreview]);
94
+ const fieldsToShow = entity.listFields || Object.keys(entity.fields);
95
+ const dataColumns = fieldsToShow
96
+ .map((fieldName) => {
97
+ const fieldConfig = entity.fields[fieldName];
98
+ if (!fieldConfig)
99
+ return null;
100
+ const label = translateFieldLabel(fieldName, fieldConfig, t);
101
+ const fieldType = fieldConfig.type || 'text';
102
+ const isNumeric = fieldType === 'number' || fieldType === 'range';
103
+ const align = isNumeric ? 'end' : 'start';
104
+ return {
105
+ key: fieldName,
106
+ title: label,
107
+ dataIndex: fieldName,
108
+ sortable: !isPreview,
109
+ filterable: !isPreview,
110
+ align,
111
+ render: (value, record) => formatValue(value, fieldConfig, t, {
112
+ compact: true,
113
+ referenceData,
114
+ item: record,
115
+ }),
116
+ };
117
+ })
118
+ .filter(Boolean);
119
+ // Actions column at the front (for mobile accessibility)
120
+ const actionsColumn = {
121
+ key: '_actions',
122
+ title: tCrud('actions.label', { defaultValue: 'Actions' }),
123
+ dataIndex: undefined,
124
+ sortable: false,
125
+ width: 120,
126
+ align: 'center',
127
+ render: (_, record) => (_jsxs(Stack, { direction: "row", gap: "tight", align: "center", justify: "center", children: [isPreview ? (_jsx(Button, { variant: "outline", icon: Edit, disabled: true, "aria-label": tCrud('edit', { defaultValue: 'Edit' }) })) : (_jsx(Button, { variant: "outline", icon: Edit, render: ({ children, ...renderProps }) => (_jsx(Link, { path: `${base}/${record.id}`, onClick: (e) => e.stopPropagation(), ...renderProps, children: children })), "aria-label": tCrud('edit', { defaultValue: 'Edit' }) })), _jsx(ActionButton, { action: async () => {
128
+ await handleDelete(record.id);
129
+ }, confirmText: tCrud('delete.confirm', {
130
+ defaultValue: 'Are you sure you want to delete this item?',
131
+ }), confirmTitle: tCrud('delete.title', {
132
+ defaultValue: 'Delete Item',
133
+ }), loadingText: tCrud('delete.loading', {
134
+ defaultValue: 'Deleting...',
135
+ }), variant: "destructive", icon: Trash2, disabled: isPreview, "aria-label": tCrud('delete', { defaultValue: 'Delete' }), children: tCrud('delete', { defaultValue: 'Delete' }) })] })),
136
+ };
137
+ const columns = [actionsColumn, ...dataColumns];
155
138
  // Entity name for section title
156
139
  const entityName = t('name', { defaultValue: entity.name });
157
140
  // Result count
@@ -162,7 +145,7 @@ export function EntityList({ entity, basePath, onClick, hideFilters = false, pag
162
145
  defaultValue: `Browse ${entityName} - Filters`,
163
146
  }), collapsible: true, defaultOpen: true, tone: tone, children: _jsxs(Stack, { children: [_jsxs(Stack, { direction: "row", gap: "tight", align: "center", className: "dndev-w-full", style: { display: 'grid', gridTemplateColumns: '1fr auto auto' }, children: [_jsx(Input, { placeholder: tCrud('search.placeholder', {
164
147
  defaultValue: 'Search...',
165
- }), value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), icon: Search, className: "dndev-w-full", disabled: isPreview }), _jsx(Button, { icon: RefreshCw, variant: "outline", onClick: handleRefresh, disabled: isPreview || loading, display: "compact", "aria-label": tCrud('refresh', { defaultValue: 'Refresh' }) }), _jsx(Button, { icon: Plus, onClick: handleCreate, display: "compact", disabled: isPreview, children: tCrud('addNew', { defaultValue: 'Add New' }) })] }), !hideFilters && (_jsx(EntityFilters, { entity: entity, data: rawData, fieldsToFilter: entity.listFields }))] }) }), _jsx(Section, { title: loading
148
+ }), value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), icon: Search, className: "dndev-w-full", disabled: isPreview }), _jsx(Button, { icon: RefreshCw, variant: "outline", onClick: handleRefresh, disabled: isPreview || loading, display: "compact", "aria-label": tCrud('refresh', { defaultValue: 'Refresh' }) }), isPreview ? (_jsx(Button, { icon: Plus, display: "compact", disabled: true, children: tCrud('addNew', { defaultValue: 'Add New' }) })) : (_jsx(Button, { icon: Plus, display: "compact", render: ({ children, ...renderProps }) => (_jsx(Link, { path: `${base}/new`, ...renderProps, children: children })), children: tCrud('addNew', { defaultValue: 'Add New' }) }))] }), !hideFilters && (_jsx(EntityFilters, { entity: entity, data: rawData, fieldsToFilter: entity.listFields }))] }) }), _jsx(Section, { title: loading
166
149
  ? tCrud('results.title.fetching', {
167
150
  defaultValue: 'Fetching...',
168
151
  })
@@ -183,7 +166,8 @@ export function EntityList({ entity, basePath, onClick, hideFilters = false, pag
183
166
  defaultValue: 'Items per page',
184
167
  }),
185
168
  // Persisted page size — always controlled via CrudStore
186
- pageSize: storedPageSize, onPageSizeChange: setStoredPageSize, ...(!isPreview && effectiveMode === 'server' && {
169
+ pageSize: storedPageSize, onPageSizeChange: setStoredPageSize, ...(!isPreview &&
170
+ effectiveMode === 'server' && {
187
171
  currentPage,
188
172
  total: listData?.total,
189
173
  onPageChange: setCurrentPage,
@@ -1 +1 @@
1
- {"version":3,"file":"EntityRecommendations.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityRecommendations.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAKjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,IAAmB,EACnB,IAAI,EACJ,SAAS,GACV,EAAE,0BAA0B,kDA8D5B"}
1
+ {"version":3,"file":"EntityRecommendations.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityRecommendations.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAKjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,IAAmB,EACnB,IAAI,EACJ,SAAS,GACV,EAAE,0BAA0B,kDAmE5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityWorkflow.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityWorkflow.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,cAAc,EAEd,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,+BAA+B;AAC/B,MAAM,WAAW,mBAAmB;IAClC,mDAAmD;IACnD,QAAQ,EAAE,cAAc,CAAC;IACzB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,iCAAiC;IACjC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,oBAAoB,KAAK,SAAS,CAAC;IACnD,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EAAE,MAAM,EAChB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,UAAU,EACV,QAAQ,EACR,SAAS,GACV,EAAE,mBAAmB,kDA4FrB"}
1
+ {"version":3,"file":"EntityWorkflow.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityWorkflow.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,cAAc,EAEd,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,+BAA+B;AAC/B,MAAM,WAAW,mBAAmB;IAClC,mDAAmD;IACnD,QAAQ,EAAE,cAAc,CAAC;IACzB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,iCAAiC;IACjC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,oBAAoB,KAAK,SAAS,CAAC;IACnD,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EAAE,MAAM,EAChB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,UAAU,EACV,QAAQ,EACR,SAAS,GACV,EAAE,mBAAmB,kDA2FrB"}
@@ -71,5 +71,5 @@ export function EntityWorkflow({ workflow: config, onComplete, onStepChange, def
71
71
  ? t('workflow.submit', { defaultValue: 'Submit' })
72
72
  : t('workflow.next', { defaultValue: 'Next' }), cancelText: isFirst
73
73
  ? null
74
- : t('workflow.previous', { defaultValue: 'Previous' }), onCancel: isFirst ? undefined : wf.goPrevious, loading: isSubmitting, warnOnUnsavedChanges: false, hideVisibilityInfo: true })) : null, currentStep.allowSkip && !isLast && (_jsx(Button, { variant: "ghost", onClick: wf.skipStep, className: "dndev-w-full", children: t('workflow.skip', { defaultValue: 'Skip this step' }) }))] }));
74
+ : t('workflow.previous', { defaultValue: 'Previous' }), onCancel: isFirst ? undefined : wf.goPrevious, loading: isSubmitting, hideVisibilityInfo: true })) : null, currentStep.allowSkip && !isLast && (_jsx(Button, { variant: "ghost", onClick: wf.skipStep, className: "dndev-w-full", children: t('workflow.skip', { defaultValue: 'Skip this step' }) }))] }));
75
75
  }
@@ -16,7 +16,6 @@ import * as crudModule from '@donotdev/crud';
16
16
  /** true when @donotdev/crud resolved with real exports */
17
17
  export declare const isCrudModuleAvailable: boolean;
18
18
  export declare const useEntityForm: typeof crudModule.useEntityForm;
19
- export declare const useUnsavedChangesWarning: typeof crudModule.useUnsavedChangesWarning;
20
19
  export declare const useFormStore: import("zustand").UseBoundStore<import("zustand").StoreApi<crudModule.FormStoreState & crudModule.FormStoreActions & import("@donotdev/stores").DoNotDevStore>>;
21
20
  export declare const useFieldConditions: typeof crudModule.useFieldConditions;
22
21
  export declare const useCrud: typeof crudModule.useCrud;