@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.
- package/LICENSE.md +21 -242
- package/README.md +1 -19
- package/assets/apple-touch-icon.png +0 -0
- package/assets/favicon.ico +0 -0
- package/assets/fonts/Inter-latin-ext.woff2 +0 -0
- package/assets/fonts/Inter-latin.woff2 +0 -0
- package/assets/fonts/PlayfairDisplay-latin-ext.woff2 +0 -0
- package/assets/fonts/PlayfairDisplay-latin.woff2 +0 -0
- package/assets/fonts/Roboto-400-cyrillic-ext.woff2 +0 -0
- package/assets/fonts/Roboto-400-cyrillic.woff2 +0 -0
- package/assets/fonts/Roboto-400-greek-ext.woff2 +0 -0
- package/assets/fonts/Roboto-400-greek.woff2 +0 -0
- package/assets/fonts/Roboto-400-latin-ext.woff2 +0 -0
- package/assets/fonts/Roboto-400-latin.woff2 +0 -0
- package/assets/fonts/Roboto-400-vietnamese.woff2 +0 -0
- package/assets/fonts/Roboto-700-cyrillic-ext.woff2 +0 -0
- package/assets/fonts/Roboto-700-cyrillic.woff2 +0 -0
- package/assets/fonts/Roboto-700-greek-ext.woff2 +0 -0
- package/assets/fonts/Roboto-700-greek.woff2 +0 -0
- package/assets/fonts/Roboto-700-latin-ext.woff2 +0 -0
- package/assets/fonts/Roboto-700-latin.woff2 +0 -0
- package/assets/fonts/Roboto-700-vietnamese.woff2 +0 -0
- package/assets/icon-192x192.png +0 -0
- package/assets/icon-512x512.png +0 -0
- package/assets/logo.png +0 -0
- package/assets/logo.svg +1 -1
- package/assets/manifest.json +0 -0
- package/dist/CookieConsent-5NH5DNTP.js +1 -0
- package/dist/{GoToDialog-CR4VOVXT.js → GoToDialog-CICRYHHG.js} +1 -1
- package/dist/chunk-MIPTBUWY.js +1 -0
- package/dist/components/auth/AuthHeader.d.ts +6 -1
- package/dist/components/auth/AuthHeader.d.ts.map +1 -1
- package/dist/components/auth/AuthHeader.js +4 -4
- package/dist/components/common/FeatureCard.d.ts +11 -6
- package/dist/components/common/FeatureCard.d.ts.map +1 -1
- package/dist/components/common/FeatureCard.js +43 -32
- package/dist/components/common/FeatureDisabled.d.ts +1 -0
- package/dist/components/common/FeatureDisabled.d.ts.map +1 -1
- package/dist/components/common/TechBento.d.ts +1 -0
- package/dist/components/common/TechBento.d.ts.map +1 -1
- package/dist/components/common/icon.d.ts +1 -0
- package/dist/components/common/icon.d.ts.map +1 -1
- package/dist/components/cookie-consent/CookieConsent.d.ts +4 -3
- package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
- package/dist/components/cookie-consent/CookieConsent.js +36 -35
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -1
- package/dist/components/layout/PageConfig.d.ts +25 -0
- package/dist/components/layout/PageConfig.d.ts.map +1 -0
- package/dist/components/layout/PageConfig.js +47 -0
- package/dist/components/layout/components/Breadcrumbs.d.ts +2 -0
- package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts +1 -0
- package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppBranding.d.ts +1 -0
- package/dist/components/layout/components/header/AppBranding.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppIcon.d.ts +1 -0
- package/dist/components/layout/components/header/AppIcon.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppTitle.d.ts +1 -0
- package/dist/components/layout/components/header/AppTitle.d.ts.map +1 -1
- package/dist/components/layout/components/header/CacheSettings.d.ts.map +1 -1
- package/dist/components/layout/components/header/CacheSettings.js +6 -2
- package/dist/components/layout/components/header/GameTitle.d.ts +1 -0
- package/dist/components/layout/components/header/GameTitle.d.ts.map +1 -1
- package/dist/components/layout/components/header/HeaderMenu.d.ts +1 -0
- package/dist/components/layout/components/header/HeaderMenu.d.ts.map +1 -1
- package/dist/components/layout/components/header/HeaderNavigation.d.ts +1 -0
- package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
- package/dist/components/layout/components/header/SettingsMenu.d.ts +1 -0
- package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +1 -0
- package/dist/crud/components/EntityCardList.d.ts +1 -1
- package/dist/crud/components/EntityCardList.d.ts.map +1 -1
- package/dist/crud/components/EntityCardList.js +47 -23
- package/dist/crud/components/EntityDisplayRenderer.d.ts +1 -1
- package/dist/crud/components/EntityDisplayRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityDisplayRenderer.js +14 -13
- package/dist/crud/components/EntityFormRenderer.d.ts +6 -1
- package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityFormRenderer.js +46 -38
- package/dist/crud/components/EntityList.d.ts +1 -1
- package/dist/crud/components/EntityList.d.ts.map +1 -1
- package/dist/crud/components/EntityList.js +80 -80
- package/dist/crud/components/EntityRecommendations.d.ts +1 -1
- package/dist/crud/components/EntityRecommendations.d.ts.map +1 -1
- package/dist/crud/components/EntityRecommendations.js +4 -4
- package/dist/crud/components/EntityWorkflow.d.ts.map +1 -1
- package/dist/crud/components/EntityWorkflow.js +1 -1
- package/dist/crud/crudImports.d.ts +1 -1
- package/dist/crud/crudImports.d.ts.map +1 -1
- package/dist/crud/crudImports.js +1 -1
- package/dist/dndev-next.css +831 -171
- package/dist/dndev.css +1000 -185
- package/dist/files/inter-cyrillic-300-normal.woff +0 -0
- package/dist/files/inter-cyrillic-300-normal.woff2 +0 -0
- package/dist/files/inter-cyrillic-400-normal.woff +0 -0
- package/dist/files/inter-cyrillic-400-normal.woff2 +0 -0
- package/dist/files/inter-cyrillic-600-normal.woff +0 -0
- package/dist/files/inter-cyrillic-600-normal.woff2 +0 -0
- package/dist/files/inter-cyrillic-700-normal.woff +0 -0
- package/dist/files/inter-cyrillic-700-normal.woff2 +0 -0
- package/dist/files/inter-cyrillic-ext-300-normal.woff +0 -0
- package/dist/files/inter-cyrillic-ext-300-normal.woff2 +0 -0
- package/dist/files/inter-cyrillic-ext-400-normal.woff +0 -0
- package/dist/files/inter-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/files/inter-cyrillic-ext-600-normal.woff +0 -0
- package/dist/files/inter-cyrillic-ext-600-normal.woff2 +0 -0
- package/dist/files/inter-cyrillic-ext-700-normal.woff +0 -0
- package/dist/files/inter-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/files/inter-greek-300-normal.woff +0 -0
- package/dist/files/inter-greek-300-normal.woff2 +0 -0
- package/dist/files/inter-greek-400-normal.woff +0 -0
- package/dist/files/inter-greek-400-normal.woff2 +0 -0
- package/dist/files/inter-greek-600-normal.woff +0 -0
- package/dist/files/inter-greek-600-normal.woff2 +0 -0
- package/dist/files/inter-greek-700-normal.woff +0 -0
- package/dist/files/inter-greek-700-normal.woff2 +0 -0
- package/dist/files/inter-greek-ext-300-normal.woff +0 -0
- package/dist/files/inter-greek-ext-300-normal.woff2 +0 -0
- package/dist/files/inter-greek-ext-400-normal.woff +0 -0
- package/dist/files/inter-greek-ext-400-normal.woff2 +0 -0
- package/dist/files/inter-greek-ext-600-normal.woff +0 -0
- package/dist/files/inter-greek-ext-600-normal.woff2 +0 -0
- package/dist/files/inter-greek-ext-700-normal.woff +0 -0
- package/dist/files/inter-greek-ext-700-normal.woff2 +0 -0
- package/dist/files/inter-latin-300-normal.woff +0 -0
- package/dist/files/inter-latin-300-normal.woff2 +0 -0
- package/dist/files/inter-latin-400-normal.woff +0 -0
- package/dist/files/inter-latin-400-normal.woff2 +0 -0
- package/dist/files/inter-latin-600-normal.woff +0 -0
- package/dist/files/inter-latin-600-normal.woff2 +0 -0
- package/dist/files/inter-latin-700-normal.woff +0 -0
- package/dist/files/inter-latin-700-normal.woff2 +0 -0
- package/dist/files/inter-latin-ext-300-normal.woff +0 -0
- package/dist/files/inter-latin-ext-300-normal.woff2 +0 -0
- package/dist/files/inter-latin-ext-400-normal.woff +0 -0
- package/dist/files/inter-latin-ext-400-normal.woff2 +0 -0
- package/dist/files/inter-latin-ext-600-normal.woff +0 -0
- package/dist/files/inter-latin-ext-600-normal.woff2 +0 -0
- package/dist/files/inter-latin-ext-700-normal.woff +0 -0
- package/dist/files/inter-latin-ext-700-normal.woff2 +0 -0
- package/dist/files/inter-vietnamese-300-normal.woff +0 -0
- package/dist/files/inter-vietnamese-300-normal.woff2 +0 -0
- package/dist/files/inter-vietnamese-400-normal.woff +0 -0
- package/dist/files/inter-vietnamese-400-normal.woff2 +0 -0
- package/dist/files/inter-vietnamese-600-normal.woff +0 -0
- package/dist/files/inter-vietnamese-600-normal.woff2 +0 -0
- package/dist/files/inter-vietnamese-700-normal.woff +0 -0
- package/dist/files/inter-vietnamese-700-normal.woff2 +0 -0
- package/dist/files/playfair-display-cyrillic-400-normal.woff +0 -0
- package/dist/files/playfair-display-cyrillic-400-normal.woff2 +0 -0
- package/dist/files/playfair-display-cyrillic-500-normal.woff +0 -0
- package/dist/files/playfair-display-cyrillic-500-normal.woff2 +0 -0
- package/dist/files/playfair-display-cyrillic-600-normal.woff +0 -0
- package/dist/files/playfair-display-cyrillic-600-normal.woff2 +0 -0
- package/dist/files/playfair-display-cyrillic-700-normal.woff +0 -0
- package/dist/files/playfair-display-cyrillic-700-normal.woff2 +0 -0
- package/dist/files/playfair-display-latin-400-normal.woff +0 -0
- package/dist/files/playfair-display-latin-400-normal.woff2 +0 -0
- package/dist/files/playfair-display-latin-500-normal.woff +0 -0
- package/dist/files/playfair-display-latin-500-normal.woff2 +0 -0
- package/dist/files/playfair-display-latin-600-normal.woff +0 -0
- package/dist/files/playfair-display-latin-600-normal.woff2 +0 -0
- package/dist/files/playfair-display-latin-700-normal.woff +0 -0
- package/dist/files/playfair-display-latin-700-normal.woff2 +0 -0
- package/dist/files/playfair-display-latin-ext-400-normal.woff +0 -0
- package/dist/files/playfair-display-latin-ext-400-normal.woff2 +0 -0
- package/dist/files/playfair-display-latin-ext-500-normal.woff +0 -0
- package/dist/files/playfair-display-latin-ext-500-normal.woff2 +0 -0
- package/dist/files/playfair-display-latin-ext-600-normal.woff +0 -0
- package/dist/files/playfair-display-latin-ext-600-normal.woff2 +0 -0
- package/dist/files/playfair-display-latin-ext-700-normal.woff +0 -0
- package/dist/files/playfair-display-latin-ext-700-normal.woff2 +0 -0
- package/dist/files/playfair-display-vietnamese-400-normal.woff +0 -0
- package/dist/files/playfair-display-vietnamese-400-normal.woff2 +0 -0
- package/dist/files/playfair-display-vietnamese-500-normal.woff +0 -0
- package/dist/files/playfair-display-vietnamese-500-normal.woff2 +0 -0
- package/dist/files/playfair-display-vietnamese-600-normal.woff +0 -0
- package/dist/files/playfair-display-vietnamese-600-normal.woff2 +0 -0
- package/dist/files/playfair-display-vietnamese-700-normal.woff +0 -0
- package/dist/files/playfair-display-vietnamese-700-normal.woff2 +0 -0
- package/dist/files/press-start-2p-cyrillic-400-normal.woff +0 -0
- package/dist/files/press-start-2p-cyrillic-400-normal.woff2 +0 -0
- package/dist/files/press-start-2p-cyrillic-ext-400-normal.woff +0 -0
- package/dist/files/press-start-2p-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/files/press-start-2p-greek-400-normal.woff +0 -0
- package/dist/files/press-start-2p-greek-400-normal.woff2 +0 -0
- package/dist/files/press-start-2p-latin-400-normal.woff +0 -0
- package/dist/files/press-start-2p-latin-400-normal.woff2 +0 -0
- package/dist/files/press-start-2p-latin-ext-400-normal.woff +0 -0
- package/dist/files/press-start-2p-latin-ext-400-normal.woff2 +0 -0
- package/dist/files/roboto-cyrillic-400-normal.woff +0 -0
- package/dist/files/roboto-cyrillic-400-normal.woff2 +0 -0
- package/dist/files/roboto-cyrillic-700-normal.woff +0 -0
- package/dist/files/roboto-cyrillic-700-normal.woff2 +0 -0
- package/dist/files/roboto-cyrillic-ext-400-normal.woff +0 -0
- package/dist/files/roboto-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/files/roboto-cyrillic-ext-700-normal.woff +0 -0
- package/dist/files/roboto-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/files/roboto-greek-400-normal.woff +0 -0
- package/dist/files/roboto-greek-400-normal.woff2 +0 -0
- package/dist/files/roboto-greek-700-normal.woff +0 -0
- package/dist/files/roboto-greek-700-normal.woff2 +0 -0
- package/dist/files/roboto-greek-ext-400-normal.woff +0 -0
- package/dist/files/roboto-greek-ext-400-normal.woff2 +0 -0
- package/dist/files/roboto-greek-ext-700-normal.woff +0 -0
- package/dist/files/roboto-greek-ext-700-normal.woff2 +0 -0
- package/dist/files/roboto-latin-400-normal.woff +0 -0
- package/dist/files/roboto-latin-400-normal.woff2 +0 -0
- package/dist/files/roboto-latin-700-normal.woff +0 -0
- package/dist/files/roboto-latin-700-normal.woff2 +0 -0
- package/dist/files/roboto-latin-ext-400-normal.woff +0 -0
- package/dist/files/roboto-latin-ext-400-normal.woff2 +0 -0
- package/dist/files/roboto-latin-ext-700-normal.woff +0 -0
- package/dist/files/roboto-latin-ext-700-normal.woff2 +0 -0
- package/dist/files/roboto-math-400-normal.woff +0 -0
- package/dist/files/roboto-math-400-normal.woff2 +0 -0
- package/dist/files/roboto-math-700-normal.woff +0 -0
- package/dist/files/roboto-math-700-normal.woff2 +0 -0
- package/dist/files/roboto-symbols-400-normal.woff +0 -0
- package/dist/files/roboto-symbols-400-normal.woff2 +0 -0
- package/dist/files/roboto-symbols-700-normal.woff +0 -0
- package/dist/files/roboto-symbols-700-normal.woff2 +0 -0
- package/dist/files/roboto-vietnamese-400-normal.woff +0 -0
- package/dist/files/roboto-vietnamese-400-normal.woff2 +0 -0
- package/dist/files/roboto-vietnamese-700-normal.woff +0 -0
- package/dist/files/roboto-vietnamese-700-normal.woff2 +0 -0
- package/dist/files/space-grotesk-latin-300-normal.woff +0 -0
- package/dist/files/space-grotesk-latin-300-normal.woff2 +0 -0
- package/dist/files/space-grotesk-latin-400-normal.woff +0 -0
- package/dist/files/space-grotesk-latin-400-normal.woff2 +0 -0
- package/dist/files/space-grotesk-latin-500-normal.woff +0 -0
- package/dist/files/space-grotesk-latin-500-normal.woff2 +0 -0
- package/dist/files/space-grotesk-latin-600-normal.woff +0 -0
- package/dist/files/space-grotesk-latin-600-normal.woff2 +0 -0
- package/dist/files/space-grotesk-latin-700-normal.woff +0 -0
- package/dist/files/space-grotesk-latin-700-normal.woff2 +0 -0
- package/dist/files/space-grotesk-latin-ext-300-normal.woff +0 -0
- package/dist/files/space-grotesk-latin-ext-300-normal.woff2 +0 -0
- package/dist/files/space-grotesk-latin-ext-400-normal.woff +0 -0
- package/dist/files/space-grotesk-latin-ext-400-normal.woff2 +0 -0
- package/dist/files/space-grotesk-latin-ext-500-normal.woff +0 -0
- package/dist/files/space-grotesk-latin-ext-500-normal.woff2 +0 -0
- package/dist/files/space-grotesk-latin-ext-600-normal.woff +0 -0
- package/dist/files/space-grotesk-latin-ext-600-normal.woff2 +0 -0
- package/dist/files/space-grotesk-latin-ext-700-normal.woff +0 -0
- package/dist/files/space-grotesk-latin-ext-700-normal.woff2 +0 -0
- package/dist/files/space-grotesk-vietnamese-300-normal.woff +0 -0
- package/dist/files/space-grotesk-vietnamese-300-normal.woff2 +0 -0
- package/dist/files/space-grotesk-vietnamese-400-normal.woff +0 -0
- package/dist/files/space-grotesk-vietnamese-400-normal.woff2 +0 -0
- package/dist/files/space-grotesk-vietnamese-500-normal.woff +0 -0
- package/dist/files/space-grotesk-vietnamese-500-normal.woff2 +0 -0
- package/dist/files/space-grotesk-vietnamese-600-normal.woff +0 -0
- package/dist/files/space-grotesk-vietnamese-600-normal.woff2 +0 -0
- package/dist/files/space-grotesk-vietnamese-700-normal.woff +0 -0
- package/dist/files/space-grotesk-vietnamese-700-normal.woff2 +0 -0
- package/dist/index.js +4 -4
- package/dist/internal/common/ErrorFallback.js +1 -1
- package/dist/internal/devtools/DebugTools.js +1 -1
- package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/DesignTab.js +6 -2
- package/dist/internal/devtools/utils/envVarDiscovery.d.ts.map +1 -1
- package/dist/internal/devtools/utils/envVarDiscovery.js +4 -5
- package/dist/internal/devtools/utils/virtualModuleInspector.d.ts.map +1 -1
- package/dist/internal/devtools/utils/virtualModuleInspector.js +13 -0
- package/dist/internal/initializers/BaseStoresInitializer.d.ts +3 -1
- package/dist/internal/initializers/BaseStoresInitializer.d.ts.map +1 -1
- package/dist/internal/initializers/BaseStoresInitializer.js +17 -4
- package/dist/internal/initializers/NextJsStoresInitializer.d.ts +1 -1
- package/dist/internal/initializers/NextJsStoresInitializer.d.ts.map +1 -1
- package/dist/internal/initializers/NextJsStoresInitializer.js +2 -13
- package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
- package/dist/internal/layout/DnDevLayout.js +65 -23
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +57 -29
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts +2 -0
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/NextJsAutoMetaTags.js +45 -15
- package/dist/internal/layout/components/PWAUpdateNotification.d.ts.map +1 -1
- package/dist/internal/layout/components/PWAUpdateNotification.js +15 -2
- package/dist/internal/layout/config/presets/moolti.d.ts.map +1 -1
- package/dist/internal/layout/config/presets/moolti.js +11 -13
- package/dist/internal/layout/zones/DnDevFooter.d.ts +3 -1
- package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevFooter.js +5 -1
- package/dist/internal/layout/zones/DnDevHeader.d.ts +3 -1
- package/dist/internal/layout/zones/DnDevHeader.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevHeader.js +7 -2
- package/dist/internal/layout/zones/DnDevSidebar.d.ts +3 -1
- package/dist/internal/layout/zones/DnDevSidebar.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevSidebar.js +9 -3
- package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
- package/dist/providers/NextJsAppProviders.js +14 -8
- package/dist/routing/AuthGuard.d.ts +7 -22
- package/dist/routing/AuthGuard.d.ts.map +1 -1
- package/dist/routing/AuthGuard.js +19 -64
- package/dist/routing/AuthReturnTo.d.ts +13 -0
- package/dist/routing/AuthReturnTo.d.ts.map +1 -0
- package/dist/routing/AuthReturnTo.js +61 -0
- package/dist/routing/DnDevNavigationMenu.d.ts +1 -0
- package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
- package/dist/routing/GoTo.d.ts +1 -0
- package/dist/routing/GoTo.d.ts.map +1 -1
- package/dist/routing/GoToInput.d.ts.map +1 -1
- package/dist/routing/GoToInput.js +5 -5
- package/dist/routing/Link.d.ts.map +1 -1
- package/dist/routing/Link.js +14 -0
- package/dist/routing/hooks/hooks.next.js +1 -1
- package/dist/routing/hooks/hooks.vite.js +1 -1
- package/dist/routing/hooks/useNavigate.next.d.ts +4 -0
- package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.next.js +10 -7
- package/dist/routing/hooks/useNavigate.vite.d.ts +4 -0
- package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.vite.js +16 -13
- package/dist/routing/hooks/useRedirectGuard.next.d.ts +2 -0
- package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
- package/dist/routing/hooks/useRedirectGuard.next.js +15 -27
- package/dist/routing/hooks/useRedirectGuard.vite.d.ts +2 -0
- package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useRedirectGuard.vite.js +15 -27
- package/dist/routing/index.d.ts +1 -0
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +1 -0
- package/dist/routing/useGoTo.d.ts.map +1 -1
- package/dist/routing/useGoTo.js +12 -17
- package/dist/styles/index.css +1000 -185
- package/dist/symbol-index.json +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/sanitizeSvg.d.ts +4 -0
- package/dist/utils/sanitizeSvg.d.ts.map +1 -1
- package/dist/utils/sanitizeSvg.js +4 -0
- package/dist/utils/useAISafe.d.ts +28 -0
- package/dist/utils/useAISafe.d.ts.map +1 -0
- package/dist/utils/useAISafe.js +53 -0
- package/dist/utils/useAuthSafe.d.ts +39 -0
- package/dist/utils/useAuthSafe.d.ts.map +1 -1
- package/dist/utils/useAuthSafe.js +5 -0
- package/dist/utils/useAuthVisibility.d.ts +1 -0
- package/dist/utils/useAuthVisibility.d.ts.map +1 -1
- package/dist/utils/useBillingVisibility.d.ts +1 -0
- package/dist/utils/useBillingVisibility.d.ts.map +1 -1
- package/dist/utils/useSeo.d.ts +121 -0
- package/dist/utils/useSeo.d.ts.map +1 -0
- package/dist/utils/useSeo.js +116 -0
- package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.js +20 -5
- package/dist/vite-routing/RootLayout.d.ts.map +1 -1
- package/dist/vite-routing/RootLayout.js +6 -7
- package/guidelines/COMPONENTS.md +136 -0
- package/guidelines/GOTCHAS.md +66 -0
- package/guidelines/LAYOUTS.md +310 -0
- package/guidelines/PAGES.md +205 -0
- package/guidelines/ROUTING.md +499 -0
- package/guidelines/SEO.md +275 -0
- package/package.json +17 -12
- package/dist/CookieConsent-UVTR7CWW.js +0 -1
- package/dist/chunk-XHGRMKOY.js +0 -1
- package/dist/components/license/LicenseWatermark.d.ts +0 -25
- package/dist/components/license/LicenseWatermark.d.ts.map +0 -1
- package/dist/components/license/LicenseWatermark.js +0 -109
- package/dist/components/license/watermarkData.d.ts +0 -7
- package/dist/components/license/watermarkData.d.ts.map +0 -1
- 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, {
|
|
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 =
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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 })) :
|
|
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:
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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
|
-
//
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
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
|
-
|
|
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;
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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:
|
|
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:
|
|
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;
|
|
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"}
|