@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
|
@@ -124,7 +124,7 @@ const ErrorFallback = ({ error, resetError, componentStack, eventId, onGoBack, o
|
|
|
124
124
|
backgroundColor: '#ffffff',
|
|
125
125
|
marginBottom: '2rem',
|
|
126
126
|
padding: '1rem',
|
|
127
|
-
textAlign: '
|
|
127
|
+
textAlign: 'start',
|
|
128
128
|
border: '1px solid #fecaca',
|
|
129
129
|
borderRadius: '8px',
|
|
130
130
|
}, children: [_jsxs("div", { style: {
|
|
@@ -74,7 +74,7 @@ const DebugTools = ({ className }) => {
|
|
|
74
74
|
return (_jsx(PortalButton, { onClick: () => setIsVisible(true), className: "dndev-z-overlay", style: {
|
|
75
75
|
position: 'fixed',
|
|
76
76
|
top: 'calc(var(--gap-lg) + var(--header-height))',
|
|
77
|
-
|
|
77
|
+
insetInlineStart: 'calc(var(--gap-sm) + var(--sidebar-width))',
|
|
78
78
|
}, icon: Bug, title: "Show Debug Tools" }));
|
|
79
79
|
}
|
|
80
80
|
return (_jsx(Portal, { children: _jsx("div", { className: cn('dndev-z-overlay drag-handle', className), style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DesignTab.d.ts","sourceRoot":"","sources":["../../../../src/internal/devtools/components/DesignTab.tsx"],"names":[],"mappings":"AA+CA,eAAO,MAAM,SAAS,+
|
|
1
|
+
{"version":3,"file":"DesignTab.d.ts","sourceRoot":"","sources":["../../../../src/internal/devtools/components/DesignTab.tsx"],"names":[],"mappings":"AA+CA,eAAO,MAAM,SAAS,+CAozBrB,CAAC"}
|
|
@@ -33,7 +33,8 @@ export const DesignTab = () => {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
catch (e) {
|
|
36
|
-
|
|
36
|
+
if (process.env.NODE_ENV === 'development')
|
|
37
|
+
console.warn('Cache operation failed:', e);
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
40
|
// Save analysis to localStorage
|
|
@@ -47,7 +48,8 @@ export const DesignTab = () => {
|
|
|
47
48
|
}));
|
|
48
49
|
}
|
|
49
50
|
catch (e) {
|
|
50
|
-
|
|
51
|
+
if (process.env.NODE_ENV === 'development')
|
|
52
|
+
console.warn('Cache operation failed:', e);
|
|
51
53
|
}
|
|
52
54
|
};
|
|
53
55
|
useEffect(() => {
|
|
@@ -151,6 +153,8 @@ export const DesignTab = () => {
|
|
|
151
153
|
};
|
|
152
154
|
// Get CSS variables from :root
|
|
153
155
|
const getCSSVariables = () => {
|
|
156
|
+
if (typeof document === 'undefined')
|
|
157
|
+
return {};
|
|
154
158
|
const root = document.documentElement;
|
|
155
159
|
const style = getComputedStyle(root);
|
|
156
160
|
const vars = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envVarDiscovery.d.ts","sourceRoot":"","sources":["../../../../src/internal/devtools/utils/envVarDiscovery.ts"],"names":[],"mappings":"AA8BA;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,QAAQ,EAAE,MAAM,EAAE,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWxB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,
|
|
1
|
+
{"version":3,"file":"envVarDiscovery.d.ts","sourceRoot":"","sources":["../../../../src/internal/devtools/utils/envVarDiscovery.ts"],"names":[],"mappings":"AA8BA;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,QAAQ,EAAE,MAAM,EAAE,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWxB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,CA6CA;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,QAAQ,EAAE,MAAM,EAAE,GACjB,MAAM,GAAG,SAAS,CAOpB"}
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
function matchesPattern(key, pattern) {
|
|
15
15
|
const normalizedKey = key.toUpperCase();
|
|
16
16
|
const normalizedPattern = pattern.toUpperCase();
|
|
17
|
-
if (normalizedPattern.includes('*')) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
if (normalizedPattern.includes('*') || normalizedPattern.includes('?')) {
|
|
18
|
+
// Escape regex metacharacters before converting wildcards
|
|
19
|
+
const escaped = normalizedPattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
20
|
+
const regexPattern = escaped.replace(/\\\*/g, '.*').replace(/\\\?/g, '.');
|
|
21
21
|
const regex = new RegExp(`^${regexPattern}$`);
|
|
22
22
|
return regex.test(normalizedKey);
|
|
23
23
|
}
|
|
@@ -49,7 +49,6 @@ export function discoverEnvVarsByPattern(env, patterns) {
|
|
|
49
49
|
export function groupEnvVarsByCategory(env) {
|
|
50
50
|
const result = {};
|
|
51
51
|
Object.entries(env).forEach(([key, value]) => {
|
|
52
|
-
const upperKey = key.toUpperCase();
|
|
53
52
|
if (matchesPattern(key, '*STRIPE*') ||
|
|
54
53
|
matchesPattern(key, '*PRICE*ID*') ||
|
|
55
54
|
matchesPattern(key, '*PRICE_ID*')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtualModuleInspector.d.ts","sourceRoot":"","sources":["../../../../src/internal/devtools/utils/virtualModuleInspector.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,OAAO,EAER,MAAM,UAAU,CAAC;AAElB,qBAAa,sBAAsB;WACpB,eAAe,IAAI,OAAO,CAAC,mBAAmB,CAAC;WA4E/C,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC;IA2D3D,MAAM,CAAC,sBAAsB,IAAI,UAAU;IAoB3C,MAAM,CAAC,kBAAkB,IAAI,OAAO;
|
|
1
|
+
{"version":3,"file":"virtualModuleInspector.d.ts","sourceRoot":"","sources":["../../../../src/internal/devtools/utils/virtualModuleInspector.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,OAAO,EAER,MAAM,UAAU,CAAC;AAElB,qBAAa,sBAAsB;WACpB,eAAe,IAAI,OAAO,CAAC,mBAAmB,CAAC;WA4E/C,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC;IA2D3D,MAAM,CAAC,sBAAsB,IAAI,UAAU;IAoB3C,MAAM,CAAC,kBAAkB,IAAI,OAAO;WA6GvB,kBAAkB,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAgF9D"}
|
|
@@ -149,6 +149,19 @@ export class VirtualModuleInspector {
|
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
static getCSSVariableData() {
|
|
152
|
+
if (typeof document === 'undefined')
|
|
153
|
+
return {
|
|
154
|
+
dndevVariables: {},
|
|
155
|
+
allCSSPropsCount: 0,
|
|
156
|
+
dndevVarsCount: 0,
|
|
157
|
+
utilityTests: {},
|
|
158
|
+
actualHeader: null,
|
|
159
|
+
keyVariables: {
|
|
160
|
+
headerHeight: 'not set',
|
|
161
|
+
sidebarWidth: 'not set',
|
|
162
|
+
debugEnabled: 'not set',
|
|
163
|
+
},
|
|
164
|
+
};
|
|
152
165
|
const documentStyle = getComputedStyle(document.documentElement);
|
|
153
166
|
// Get all CSS custom properties
|
|
154
167
|
const allCSSProps = Array.from(document.documentElement.style);
|
|
@@ -23,6 +23,8 @@ export interface BaseStoresInitializerProps {
|
|
|
23
23
|
customStores?: CustomStoreConfig[];
|
|
24
24
|
skipStoreInit?: boolean;
|
|
25
25
|
serverCookies?: string;
|
|
26
|
+
/** Render children before stores are ready. Used by Next.js so SSR/SEO content is not blank. */
|
|
27
|
+
renderBeforeReady?: boolean;
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
28
30
|
* BaseStoresInitializer - Initializes all framework stores
|
|
@@ -34,5 +36,5 @@ export interface BaseStoresInitializerProps {
|
|
|
34
36
|
* @since 0.0.1
|
|
35
37
|
* @author AMBROISE PARK Consulting
|
|
36
38
|
*/
|
|
37
|
-
export declare function BaseStoresInitializer({ children, handlers, customStores, skipStoreInit, serverCookies, }: BaseStoresInitializerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
39
|
+
export declare function BaseStoresInitializer({ children, handlers, customStores, skipStoreInit, serverCookies, renderBeforeReady, }: BaseStoresInitializerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
38
40
|
//# sourceMappingURL=BaseStoresInitializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseStoresInitializer.d.ts","sourceRoot":"","sources":["../../../src/internal/initializers/BaseStoresInitializer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BaseStoresInitializer.d.ts","sourceRoot":"","sources":["../../../src/internal/initializers/BaseStoresInitializer.tsx"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAa,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA6DvC;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,aAAa,CAAC;IACxB,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gGAAgG;IAChG,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAiID;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,QAAQ,EACR,YAAiB,EACjB,aAAqB,EACrB,aAAa,EACb,iBAAyB,GAC1B,EAAE,0BAA0B,kDAiL5B"}
|
|
@@ -11,6 +11,7 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
11
|
*/
|
|
12
12
|
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
13
13
|
import { useThemeStore, useNavigationStore, useOverlayStore, useNetworkStore, useAbortControllerStore, useConsentStore, useLanguageStore, useConsentReady, useThemeReady, getPlatformEnvVar, } from '@donotdev/core';
|
|
14
|
+
import { initRipple } from '@donotdev/components';
|
|
14
15
|
import { useI18nReady, getI18nInstance, getSupportedLanguages, } from '@donotdev/core';
|
|
15
16
|
import { handleError, isClient, getDndevConfig, globalEmitter, } from '@donotdev/core';
|
|
16
17
|
import { useAppConfig } from '@donotdev/core';
|
|
@@ -134,7 +135,12 @@ async function initializeStore(config, handlers, appConfig, serverCookies) {
|
|
|
134
135
|
if (consentCookie) {
|
|
135
136
|
const cookieParts = consentCookie.split('=');
|
|
136
137
|
if (cookieParts.length > 1 && cookieParts[1]) {
|
|
137
|
-
|
|
138
|
+
try {
|
|
139
|
+
cookieValue = decodeURIComponent(cookieParts[1].trim());
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
/* malformed cookie */
|
|
143
|
+
}
|
|
138
144
|
}
|
|
139
145
|
}
|
|
140
146
|
}
|
|
@@ -145,7 +151,12 @@ async function initializeStore(config, handlers, appConfig, serverCookies) {
|
|
|
145
151
|
if (consentCookie) {
|
|
146
152
|
const cookieParts = consentCookie.split('=');
|
|
147
153
|
if (cookieParts.length > 1 && cookieParts[1]) {
|
|
148
|
-
|
|
154
|
+
try {
|
|
155
|
+
cookieValue = decodeURIComponent(cookieParts[1].trim());
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
/* malformed cookie */
|
|
159
|
+
}
|
|
149
160
|
}
|
|
150
161
|
}
|
|
151
162
|
}
|
|
@@ -196,7 +207,7 @@ async function initializeStore(config, handlers, appConfig, serverCookies) {
|
|
|
196
207
|
* @since 0.0.1
|
|
197
208
|
* @author AMBROISE PARK Consulting
|
|
198
209
|
*/
|
|
199
|
-
export function BaseStoresInitializer({ children, handlers, customStores = [], skipStoreInit = false, serverCookies, }) {
|
|
210
|
+
export function BaseStoresInitializer({ children, handlers, customStores = [], skipStoreInit = false, serverCookies, renderBeforeReady = false, }) {
|
|
200
211
|
const hasInitialized = useRef(false);
|
|
201
212
|
const appConfig = useAppConfig();
|
|
202
213
|
useEffect(() => {
|
|
@@ -277,6 +288,8 @@ export function BaseStoresInitializer({ children, handlers, customStores = [], s
|
|
|
277
288
|
useLayoutEffect(() => {
|
|
278
289
|
if (!isClient() || !criticalReady)
|
|
279
290
|
return;
|
|
291
|
+
// Initialize ripple effect for all .dndev-interactive elements
|
|
292
|
+
initRipple();
|
|
280
293
|
let removed = false;
|
|
281
294
|
let frameworkReady = false;
|
|
282
295
|
let routeReady = false;
|
|
@@ -323,7 +336,7 @@ export function BaseStoresInitializer({ children, handlers, customStores = [], s
|
|
|
323
336
|
clearTimeout(fallbackTimeout);
|
|
324
337
|
};
|
|
325
338
|
}, [criticalReady]);
|
|
326
|
-
if (!criticalReady)
|
|
339
|
+
if (!criticalReady && !renderBeforeReady)
|
|
327
340
|
return null;
|
|
328
341
|
return _jsx(_Fragment, { children: children });
|
|
329
342
|
}
|
|
@@ -17,6 +17,6 @@ interface NextJsStoresInitializerProps {
|
|
|
17
17
|
* @since 0.0.1
|
|
18
18
|
* @author AMBROISE PARK Consulting
|
|
19
19
|
*/
|
|
20
|
-
export declare function NextJsStoresInitializer({ children, serverCookies, customStores, skipStoreInit, }: NextJsStoresInitializerProps): import("react/jsx-runtime").JSX.Element
|
|
20
|
+
export declare function NextJsStoresInitializer({ children, serverCookies, customStores, skipStoreInit, }: NextJsStoresInitializerProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export {};
|
|
22
22
|
//# sourceMappingURL=NextJsStoresInitializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextJsStoresInitializer.d.ts","sourceRoot":"","sources":["../../../src/internal/initializers/NextJsStoresInitializer.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAOxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,4BAA4B;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,aAAa,GACd,EAAE,4BAA4B,
|
|
1
|
+
{"version":3,"file":"NextJsStoresInitializer.d.ts","sourceRoot":"","sources":["../../../src/internal/initializers/NextJsStoresInitializer.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAOxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,4BAA4B;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,aAAa,GACd,EAAE,4BAA4B,2CAqD9B"}
|
|
@@ -9,7 +9,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
9
9
|
* @since 0.0.1
|
|
10
10
|
* @author AMBROISE PARK Consulting
|
|
11
11
|
*/
|
|
12
|
-
import { useEffect
|
|
12
|
+
import { useEffect } from 'react';
|
|
13
13
|
import { isTest, isClient, getDndevConfig } from '@donotdev/core';
|
|
14
14
|
import { useThemeStore } from '@donotdev/core';
|
|
15
15
|
import { BaseStoresInitializer, } from './BaseStoresInitializer';
|
|
@@ -32,12 +32,6 @@ function createNextJsHandlers() {
|
|
|
32
32
|
export function NextJsStoresInitializer({ children, serverCookies, customStores, skipStoreInit, }) {
|
|
33
33
|
const skip = skipStoreInit ?? isTest();
|
|
34
34
|
const handlers = createNextJsHandlers();
|
|
35
|
-
const [isMounted, setIsMounted] = useState(false);
|
|
36
|
-
// Ensure component only renders BaseStoresInitializer after client mount
|
|
37
|
-
// This prevents SSR issues with React 19 + Next.js 16
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
setIsMounted(true);
|
|
40
|
-
}, []);
|
|
41
35
|
// Next.js SSR: Hydrate theme store from cookies before render
|
|
42
36
|
// Flow: 1) Next.js layout reads cookie and applies theme class (SSR)
|
|
43
37
|
// 2) This component hydrates Zustand store with theme from cookie (client-side only)
|
|
@@ -73,10 +67,5 @@ export function NextJsStoresInitializer({ children, serverCookies, customStores,
|
|
|
73
67
|
}
|
|
74
68
|
}
|
|
75
69
|
}, [skip, serverCookies]);
|
|
76
|
-
|
|
77
|
-
// Return null during SSR to prevent hook calls in children (DnDevLayout, etc.)
|
|
78
|
-
if (!isMounted) {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
return (_jsx(BaseStoresInitializer, { handlers: handlers, customStores: customStores, skipStoreInit: skip, serverCookies: serverCookies, children: children }));
|
|
70
|
+
return (_jsx(BaseStoresInitializer, { handlers: handlers, customStores: customStores, skipStoreInit: skip, serverCookies: serverCookies, renderBeforeReady: true, children: children }));
|
|
82
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DnDevLayout.d.ts","sourceRoot":"","sources":["../../../src/internal/layout/DnDevLayout.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAIV,YAAY,EACb,MAAM,gBAAgB,CAAC;AA0CxB,UAAU,yBAAyB;IACjC,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW,GAAI,kCAIzB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"DnDevLayout.d.ts","sourceRoot":"","sources":["../../../src/internal/layout/DnDevLayout.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAIV,YAAY,EACb,MAAM,gBAAgB,CAAC;AA0CxB,UAAU,yBAAyB;IACjC,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW,GAAI,kCAIzB,yBAAyB,4CAqY3B,CAAC"}
|
|
@@ -64,40 +64,53 @@ export const DnDevLayout = ({ children, layout, className, }) => {
|
|
|
64
64
|
const preset = useLayout('layoutPreset');
|
|
65
65
|
const routePresetOverride = useLayout('routePresetOverride');
|
|
66
66
|
const isMobile = useBreakpoint('isMobileOrTablet');
|
|
67
|
-
const { app, features } = useAppConfig();
|
|
67
|
+
const { app, features, customPresets } = useAppConfig();
|
|
68
68
|
const debugEnabled = isDev() && features?.debug === true;
|
|
69
69
|
// Subscribe to language changes for zone re-renders
|
|
70
70
|
useTranslation('dndev');
|
|
71
71
|
// Layout config props
|
|
72
72
|
const breadcrumbs = layout?.breadcrumbs ?? 'smart';
|
|
73
|
-
const
|
|
74
|
-
const footerInline = footerMode === 'scroll' || isMobile;
|
|
73
|
+
const routeHideBreadcrumbs = useLayout('routeHideBreadcrumbs');
|
|
75
74
|
// Route detection for animations
|
|
76
75
|
const location = useLocation();
|
|
77
76
|
const pathname = location.pathname;
|
|
78
77
|
const mainRef = useRef(null);
|
|
79
78
|
// Platform content handling
|
|
80
79
|
const content = children;
|
|
80
|
+
// Merge custom presets with built-in registry
|
|
81
|
+
const effectiveRegistry = useMemo(() => {
|
|
82
|
+
if (!customPresets)
|
|
83
|
+
return presetRegistry;
|
|
84
|
+
return { ...presetRegistry, ...customPresets };
|
|
85
|
+
}, [customPresets]);
|
|
81
86
|
// Effective preset: route override > app default > fallback
|
|
82
87
|
const effectivePreset = useMemo(() => {
|
|
83
88
|
return routePresetOverride || preset || 'landing';
|
|
84
89
|
}, [routePresetOverride, preset]);
|
|
85
90
|
// Get preset config (presets only override what's different, defaults fill the rest)
|
|
86
91
|
const config = useMemo(() => {
|
|
87
|
-
const presetConfig = (
|
|
92
|
+
const presetConfig = (effectiveRegistry[effectivePreset] ??
|
|
88
93
|
presetRegistry.landing);
|
|
89
94
|
return {
|
|
90
95
|
name: presetConfig.name,
|
|
91
96
|
header: presetConfig.header,
|
|
92
97
|
sidebar: presetConfig.sidebar,
|
|
93
98
|
footer: presetConfig.footer,
|
|
99
|
+
footerMode: presetConfig.footerMode,
|
|
94
100
|
mobile: presetConfig.mobile,
|
|
95
101
|
};
|
|
96
|
-
}, [effectivePreset]);
|
|
102
|
+
}, [effectivePreset, effectiveRegistry]);
|
|
103
|
+
// Footer mode: consumer layout prop > preset config > default (mobile=scroll, desktop=fixed)
|
|
104
|
+
const footerMode = layout?.footerMode ?? config.footerMode;
|
|
105
|
+
const footerInline = footerMode === 'scroll' || (isMobile && footerMode !== 'fixed');
|
|
97
106
|
// Resolve header with consumer overrides
|
|
98
107
|
const resolvedHeader = useMemo(() => {
|
|
108
|
+
// Function = custom mode: consumer owns zone visuals, DnDevHeader wraps with structural behavior
|
|
99
109
|
if (typeof layout?.header === 'function') {
|
|
100
|
-
return _jsx(layout.header, {});
|
|
110
|
+
return (_jsx(DnDevHeader, { children: _jsx(layout.header, {}) }));
|
|
111
|
+
}
|
|
112
|
+
if (typeof config.header === 'function') {
|
|
113
|
+
return (_jsx(DnDevHeader, { children: config.header() }));
|
|
101
114
|
}
|
|
102
115
|
// Determine effective header config (mobile overrides desktop when on mobile)
|
|
103
116
|
const effectiveHeader = isMobile
|
|
@@ -157,8 +170,12 @@ export const DnDevLayout = ({ children, layout, className, }) => {
|
|
|
157
170
|
}, [layout?.header, layout?.mobile?.header, config, isMobile]);
|
|
158
171
|
// Resolve sidebar with consumer overrides
|
|
159
172
|
const resolvedSidebar = useMemo(() => {
|
|
173
|
+
// Function = custom mode: consumer owns zone visuals, DnDevSidebar wraps with resize behavior
|
|
160
174
|
if (typeof layout?.sidebar === 'function') {
|
|
161
|
-
return _jsx(layout.sidebar, {});
|
|
175
|
+
return (_jsx(DnDevSidebar, { children: _jsx(layout.sidebar, {}) }));
|
|
176
|
+
}
|
|
177
|
+
if (typeof config.sidebar === 'function') {
|
|
178
|
+
return (_jsx(DnDevSidebar, { children: config.sidebar() }));
|
|
162
179
|
}
|
|
163
180
|
if (layout?.sidebar && typeof layout.sidebar === 'object') {
|
|
164
181
|
// If consumer provides a function (including () => null), use it; otherwise fall back
|
|
@@ -181,13 +198,16 @@ export const DnDevLayout = ({ children, layout, className, }) => {
|
|
|
181
198
|
}, [layout?.sidebar, config.sidebar]);
|
|
182
199
|
// Resolve footer with consumer overrides
|
|
183
200
|
const resolvedFooter = useMemo(() => {
|
|
201
|
+
// Function = custom mode: consumer owns zone visuals, DnDevFooter wraps with structural behavior
|
|
184
202
|
if (layout?.footer) {
|
|
185
|
-
return _jsx(layout.footer, {});
|
|
203
|
+
return (_jsx(DnDevFooter, { children: _jsx(layout.footer, {}) }));
|
|
186
204
|
}
|
|
187
|
-
// Preset can hide footer with footer: null
|
|
188
205
|
if (config.footer === null) {
|
|
189
206
|
return null;
|
|
190
207
|
}
|
|
208
|
+
if (typeof config.footer === 'function') {
|
|
209
|
+
return (_jsx(DnDevFooter, { children: config.footer() }));
|
|
210
|
+
}
|
|
191
211
|
return _jsx(DnDevFooter, { app: app });
|
|
192
212
|
}, [layout?.footer, config.footer, app]);
|
|
193
213
|
// Resolve mergedbar with consumer overrides
|
|
@@ -198,41 +218,63 @@ export const DnDevLayout = ({ children, layout, className, }) => {
|
|
|
198
218
|
return _jsx(layout.mergedbar, {});
|
|
199
219
|
}
|
|
200
220
|
const mergedBarConfig = config.mobile.mergedBar;
|
|
221
|
+
// Narrow zone configs: function zones don't provide slots for mergedBar fallback
|
|
222
|
+
const headerSlots = typeof config.header === 'object' ? config.header : undefined;
|
|
223
|
+
const sidebarSlots = typeof config.sidebar === 'object' ? config.sidebar : undefined;
|
|
224
|
+
// Consumer sidebar/mobile.sidebar overrides propagate to mergedBar when not explicitly overridden
|
|
225
|
+
const layoutSidebarSlots = layout?.sidebar && typeof layout.sidebar === 'object'
|
|
226
|
+
? layout.sidebar
|
|
227
|
+
: undefined;
|
|
228
|
+
const layoutMobileSidebarSlots = layout?.mobile?.sidebar;
|
|
201
229
|
if (layout?.mergedbar && typeof layout.mergedbar === 'object') {
|
|
202
230
|
// If consumer provides a function (including () => null), use it; otherwise fall back
|
|
203
231
|
const triggerSlot = layout.mergedbar.trigger !== undefined
|
|
204
232
|
? layout.mergedbar.trigger
|
|
205
233
|
: (mergedBarConfig.trigger ??
|
|
206
|
-
|
|
234
|
+
headerSlots?.start ??
|
|
207
235
|
DEFAULT_SLOTS.header.start);
|
|
208
236
|
const topSlot = layout.mergedbar.top !== undefined
|
|
209
237
|
? layout.mergedbar.top
|
|
210
|
-
: (
|
|
238
|
+
: (layoutMobileSidebarSlots?.top ??
|
|
239
|
+
layoutSidebarSlots?.top ??
|
|
240
|
+
mergedBarConfig.top ??
|
|
241
|
+
DEFAULT_SLOTS.mobile.mergedBar.top);
|
|
211
242
|
const contentSlot = layout.mergedbar.content !== undefined
|
|
212
243
|
? layout.mergedbar.content
|
|
213
|
-
: (
|
|
214
|
-
|
|
244
|
+
: (layoutMobileSidebarSlots?.content ??
|
|
245
|
+
layoutSidebarSlots?.content ??
|
|
246
|
+
mergedBarConfig.content ??
|
|
247
|
+
sidebarSlots?.content ??
|
|
215
248
|
DEFAULT_SLOTS.sidebar.content);
|
|
216
249
|
const bottomSlot = layout.mergedbar.bottom !== undefined
|
|
217
250
|
? layout.mergedbar.bottom
|
|
218
|
-
: (
|
|
219
|
-
|
|
251
|
+
: (layoutMobileSidebarSlots?.bottom ??
|
|
252
|
+
layoutSidebarSlots?.bottom ??
|
|
253
|
+
mergedBarConfig.bottom ??
|
|
254
|
+
sidebarSlots?.bottom ??
|
|
220
255
|
DEFAULT_SLOTS.sidebar.bottom);
|
|
221
256
|
return (_jsx(DnDevMergedBar, { position: mergedBarConfig.position, height: mergedBarConfig.height, trigger: triggerSlot(), top: topSlot(), content: contentSlot(), bottom: bottomSlot() }));
|
|
222
257
|
}
|
|
223
258
|
// No consumer override - use preset or defaults
|
|
224
259
|
const triggerSlot = mergedBarConfig.trigger ??
|
|
225
|
-
|
|
260
|
+
headerSlots?.start ??
|
|
226
261
|
DEFAULT_SLOTS.header.start;
|
|
227
|
-
const topSlot =
|
|
228
|
-
|
|
229
|
-
|
|
262
|
+
const topSlot = layoutMobileSidebarSlots?.top ??
|
|
263
|
+
layoutSidebarSlots?.top ??
|
|
264
|
+
mergedBarConfig.top ??
|
|
265
|
+
DEFAULT_SLOTS.mobile.mergedBar.top;
|
|
266
|
+
const contentSlot = layoutMobileSidebarSlots?.content ??
|
|
267
|
+
layoutSidebarSlots?.content ??
|
|
268
|
+
mergedBarConfig.content ??
|
|
269
|
+
sidebarSlots?.content ??
|
|
230
270
|
DEFAULT_SLOTS.sidebar.content;
|
|
231
|
-
const bottomSlot =
|
|
232
|
-
|
|
271
|
+
const bottomSlot = layoutMobileSidebarSlots?.bottom ??
|
|
272
|
+
layoutSidebarSlots?.bottom ??
|
|
273
|
+
mergedBarConfig.bottom ??
|
|
274
|
+
sidebarSlots?.bottom ??
|
|
233
275
|
DEFAULT_SLOTS.sidebar.bottom;
|
|
234
276
|
return (_jsx(DnDevMergedBar, { position: mergedBarConfig.position, height: mergedBarConfig.height, trigger: triggerSlot(), top: topSlot(), content: contentSlot(), bottom: bottomSlot() }));
|
|
235
|
-
}, [layout?.mergedbar, config]);
|
|
277
|
+
}, [layout?.mergedbar, layout?.sidebar, layout?.mobile?.sidebar, config]);
|
|
236
278
|
// Apply routing animation data attribute (useLayoutEffect = before paint)
|
|
237
279
|
useLayoutEffect(() => {
|
|
238
280
|
if (!isClient() || !mainRef.current)
|
|
@@ -254,5 +296,5 @@ export const DnDevLayout = ({ children, layout, className, }) => {
|
|
|
254
296
|
};
|
|
255
297
|
startTransition(updateDOM);
|
|
256
298
|
}, [effectivePreset]);
|
|
257
|
-
return (_jsxs("div", { className: cn('dndev-layout', className), "data-footer-inline": footerInline || undefined, children: [resolvedHeader, resolvedSidebar, _jsxs("main", { ref: mainRef, role: "main", className: "main", children: [breadcrumbs !== 'never' && (_jsx("div", { className: "breadcrumbs-container", children: _jsx(Breadcrumbs, { variant: breadcrumbs === 'always' ? 'default' : 'smart' }) })), debugEnabled && (_jsx(Suspense, { fallback: null, children: _jsx(DebugTools, {}) })), layout?.wrapper ? layout.wrapper({ children: content }) : content, footerInline && resolvedFooter] }), !footerInline && resolvedFooter, resolvedMergedBar, _jsx(GoToWrapper, {})] }));
|
|
299
|
+
return (_jsxs("div", { className: cn('dndev-layout', className), "data-footer-inline": footerInline || undefined, "data-has-mergedbar": resolvedMergedBar ? '' : undefined, children: [resolvedHeader, resolvedSidebar, _jsxs("main", { ref: mainRef, role: "main", className: "main", children: [breadcrumbs !== 'never' && !routeHideBreadcrumbs && (_jsx("div", { className: "breadcrumbs-container", children: _jsx(Breadcrumbs, { variant: breadcrumbs === 'always' ? 'default' : 'smart' }) })), debugEnabled && (_jsx(Suspense, { fallback: null, children: _jsx(DebugTools, {}) })), layout?.wrapper ? layout.wrapper({ children: content }) : content, footerInline && resolvedFooter] }), !footerInline && resolvedFooter, resolvedMergedBar, _jsx(GoToWrapper, {})] }));
|
|
258
300
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoMetaTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/AutoMetaTags.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AutoMetaTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/AutoMetaTags.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAqN3C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,EAAE,aAqT1B,CAAC;AAEF;;;GAGG;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -10,7 +10,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
10
10
|
* - Zero-configuration SEO setup
|
|
11
11
|
* - Open Graph and Twitter Card support with image dimensions
|
|
12
12
|
* - hreflang alternate links (auto from i18n config)
|
|
13
|
-
* - Speculation Rules API (prefetch/prerender for Chromium)
|
|
13
|
+
* - Speculation Rules API (prefetch/prerender for Chromium) - opt-in, requires CSP config
|
|
14
14
|
* - BreadcrumbList + WebSite JSON-LD structured data
|
|
15
15
|
* - Internationalization integration
|
|
16
16
|
* - Canonical URL management
|
|
@@ -48,6 +48,22 @@ function matchRoutePath(pattern, pathname) {
|
|
|
48
48
|
}
|
|
49
49
|
return true;
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Resolve SEO field with i18n fallback
|
|
53
|
+
* @description
|
|
54
|
+
* - `undefined` → i18n lookup
|
|
55
|
+
* - `string` → use literal value
|
|
56
|
+
* - `null` → omit (return undefined)
|
|
57
|
+
*/
|
|
58
|
+
function resolveSeoField(seoValue, translationKey, t) {
|
|
59
|
+
if (seoValue === null)
|
|
60
|
+
return undefined; // Explicit null = omit
|
|
61
|
+
if (seoValue !== undefined)
|
|
62
|
+
return seoValue; // Explicit string = use it
|
|
63
|
+
// undefined = i18n lookup
|
|
64
|
+
const translated = t(translationKey);
|
|
65
|
+
return translated !== translationKey ? translated : undefined;
|
|
66
|
+
}
|
|
51
67
|
/**
|
|
52
68
|
* Get route metadata from window object (injected by build system).
|
|
53
69
|
* Resolves dynamic routes by pattern (e.g. /cars/:id) so PageMeta (including namespace) is used for SEO.
|
|
@@ -75,7 +91,7 @@ function getRouteMetadata(pathname, isClient) {
|
|
|
75
91
|
// Fallback: first path segment as namespace (e.g. /cars/abc123 → ns: cars)
|
|
76
92
|
const segments = pathname.split('/').filter(Boolean);
|
|
77
93
|
if (segments.length > 0) {
|
|
78
|
-
return {
|
|
94
|
+
return { namespace: segments[0] };
|
|
79
95
|
}
|
|
80
96
|
return {};
|
|
81
97
|
}
|
|
@@ -98,8 +114,7 @@ function buildBreadcrumbSchema(pathname, baseUrl, siteName) {
|
|
|
98
114
|
items.push({
|
|
99
115
|
'@type': 'ListItem',
|
|
100
116
|
position: i + 2,
|
|
101
|
-
name: segments[i]
|
|
102
|
-
.split('-')
|
|
117
|
+
name: segments[i].split('-')
|
|
103
118
|
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
104
119
|
.join(' '),
|
|
105
120
|
item: `${baseUrl}${currentPath}`,
|
|
@@ -176,10 +191,7 @@ function buildSpeculationRules() {
|
|
|
176
191
|
prefetch: [
|
|
177
192
|
{
|
|
178
193
|
where: {
|
|
179
|
-
and: [
|
|
180
|
-
{ href_matches: '/*' },
|
|
181
|
-
{ not: { href_matches: '/api/*' } },
|
|
182
|
-
],
|
|
194
|
+
and: [{ href_matches: '/*' }, { not: { href_matches: '/api/*' } }],
|
|
183
195
|
},
|
|
184
196
|
eagerness: 'conservative',
|
|
185
197
|
},
|
|
@@ -206,7 +218,7 @@ export const AutoMetaTags = () => {
|
|
|
206
218
|
const seoConfig = useSeoConfig();
|
|
207
219
|
const isClient = useIsClient();
|
|
208
220
|
const appMeta = useAppConfig('app');
|
|
209
|
-
const siteName = appMeta?.name || '';
|
|
221
|
+
const siteName = (seoConfig && seoConfig.siteName) || appMeta?.name || '';
|
|
210
222
|
const baseUrl = getPlatformEnvVar('APP_URL') || '';
|
|
211
223
|
// Get route metadata — computed from current pathname and client flag
|
|
212
224
|
const routeMeta = getRouteMetadata(location.pathname, isClient);
|
|
@@ -222,27 +234,41 @@ export const AutoMetaTags = () => {
|
|
|
222
234
|
const { defaultNamespace = 'home', defaultImage } = seoConfig;
|
|
223
235
|
// Construct absolute URL for canonical link
|
|
224
236
|
const currentUrl = `${baseUrl}${location.pathname}`;
|
|
225
|
-
const ns = routeMeta.
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
const pageDescription = routeMeta.description || t(`${ns}:description`);
|
|
229
|
-
// Get the meta object and destructure it properly
|
|
237
|
+
const ns = routeMeta.namespace || defaultNamespace;
|
|
238
|
+
const seo = routeMeta.seo;
|
|
239
|
+
// Get the meta object from i18n (for image, type, keywords, author, fullTitle)
|
|
230
240
|
const metaObject = t(`${ns}:meta`, { returnObjects: true });
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
241
|
+
// Title resolution priority:
|
|
242
|
+
// 1. i18n meta.fullTitle → translated, language-aware (wins)
|
|
243
|
+
// 2. seo.fullTitle (static PageMeta) → fallback for non-i18n apps
|
|
244
|
+
// 3. seo.title (explicit) → "title | siteName"
|
|
245
|
+
// 4. i18n ns:title → "translated | siteName"
|
|
246
|
+
// 5. siteName only (when seo.title === null or no translation)
|
|
247
|
+
let fullTitle;
|
|
248
|
+
if (metaObject?.fullTitle) {
|
|
249
|
+
// i18n fullTitle (ns:meta.fullTitle) → translated, takes priority
|
|
250
|
+
fullTitle = metaObject.fullTitle;
|
|
251
|
+
}
|
|
252
|
+
else if (seo?.fullTitle) {
|
|
253
|
+
// Static fullTitle in PageMeta → fallback for non-i18n apps
|
|
254
|
+
fullTitle = seo.fullTitle;
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
// Standard resolution: title | siteName
|
|
258
|
+
const pageTitle = resolveSeoField(seo?.title, `${ns}:title`, t);
|
|
259
|
+
fullTitle = pageTitle ? `${pageTitle} | ${siteName}` : siteName;
|
|
260
|
+
}
|
|
261
|
+
// Description resolution: seo.description > i18n
|
|
262
|
+
const description = resolveSeoField(seo?.description, `${ns}:description`, t);
|
|
263
|
+
// Other meta fields: seo > i18n meta object > defaults
|
|
264
|
+
const pageImage = seo?.image || metaObject?.image || defaultImage;
|
|
265
|
+
const pageType = seo?.type || metaObject?.type || 'website';
|
|
266
|
+
const pageKeywords = seo?.keywords || metaObject?.keywords;
|
|
234
267
|
const pageAuthor = routeMeta.author || metaObject?.author;
|
|
235
|
-
// Only use values that are actually defined (not empty strings or undefined)
|
|
236
|
-
const title = pageTitle && pageTitle !== `${ns}:title` ? pageTitle : undefined;
|
|
237
|
-
const description = pageDescription && pageDescription !== `${ns}:description`
|
|
238
|
-
? pageDescription
|
|
239
|
-
: undefined;
|
|
240
268
|
const image = pageImage || undefined;
|
|
241
269
|
const type = pageType || 'website';
|
|
242
270
|
const keywords = pageKeywords || undefined;
|
|
243
271
|
const author = pageAuthor || undefined;
|
|
244
|
-
// Build full title with site name if title exists, otherwise just use site name
|
|
245
|
-
const fullTitle = title ? `${title} | ${siteName}` : siteName;
|
|
246
272
|
// Use relative image path instead of constructing absolute URL
|
|
247
273
|
// This prevents crashes from invalid baseUrl and works in all modes
|
|
248
274
|
const imagePath = image && image.startsWith('http') ? image : image ? image : undefined;
|
|
@@ -252,7 +278,7 @@ export const AutoMetaTags = () => {
|
|
|
252
278
|
image: imagePath,
|
|
253
279
|
url: currentUrl,
|
|
254
280
|
type,
|
|
255
|
-
noindex: routeMeta.noindex || false,
|
|
281
|
+
noindex: seo?.noindex || routeMeta.noindex || false,
|
|
256
282
|
keywords,
|
|
257
283
|
author,
|
|
258
284
|
publishDate: routeMeta.publishDate,
|
|
@@ -263,8 +289,10 @@ export const AutoMetaTags = () => {
|
|
|
263
289
|
if (!seoConfig || !metaData)
|
|
264
290
|
return null;
|
|
265
291
|
const { twitterHandle, staticTags = {} } = seoConfig;
|
|
266
|
-
// Feature flags — all default to true (ON by default)
|
|
267
|
-
|
|
292
|
+
// Feature flags — all default to true (ON by default), except speculationRules (CSP conflict)
|
|
293
|
+
// Speculation rules require inline script which conflicts with strict CSP.
|
|
294
|
+
// Opt-in only: set seo.speculationRules: true and add CSP hash to your headers.
|
|
295
|
+
const speculationRulesEnabled = seoConfig.speculationRules === true;
|
|
268
296
|
const hreflangEnabled = seoConfig.hreflang !== false;
|
|
269
297
|
const breadcrumbSchemaEnabled = seoConfig.breadcrumbSchema !== false;
|
|
270
298
|
const websiteSchemaEnabled = seoConfig.websiteSchema !== false;
|
|
@@ -273,9 +301,9 @@ export const AutoMetaTags = () => {
|
|
|
273
301
|
const languages = i18nConfig?.languages || [];
|
|
274
302
|
const defaultLanguage = i18nConfig?.defaultLanguage || 'en';
|
|
275
303
|
const shouldEmitHreflang = hreflangEnabled && languages.length >= 2;
|
|
276
|
-
return (_jsxs(Helmet, { children: [_jsx("title", { children: metaData.title }), metaData.description && (_jsx("meta", { name: "description", content: metaData.description })), _jsx("link", { rel: "canonical", href: metaData.url }), metaData.keywords && (_jsx("meta", { name: "keywords", content: Array.isArray(metaData.keywords)
|
|
304
|
+
return (_jsxs(Helmet, { children: [_jsx("title", { children: metaData.title }), metaData.description && (_jsx("meta", { name: "description", content: metaData.description })), baseUrl && _jsx("link", { rel: "canonical", href: metaData.url }), metaData.keywords && (_jsx("meta", { name: "keywords", content: Array.isArray(metaData.keywords)
|
|
277
305
|
? metaData.keywords.join(', ')
|
|
278
|
-
: metaData.keywords })), metaData.author && _jsx("meta", { name: "author", content: metaData.author }), metaData.noindex && _jsx("meta", { name: "robots", content: "noindex, nofollow" }), _jsx("meta", { property: "og:title", content: metaData.title }), metaData.description && (_jsx("meta", { property: "og:description", content: metaData.description })), _jsx("meta", { property: "og:url", content: metaData.url }), _jsx("meta", { property: "og:type", content: metaData.type }), metaData.image && _jsx("meta", { property: "og:image", content: metaData.image }), metaData.image &&
|
|
306
|
+
: metaData.keywords })), metaData.author && _jsx("meta", { name: "author", content: metaData.author }), metaData.noindex && _jsx("meta", { name: "robots", content: "noindex, nofollow" }), _jsx("meta", { property: "og:title", content: metaData.title }), metaData.description && (_jsx("meta", { property: "og:description", content: metaData.description })), baseUrl && _jsx("meta", { property: "og:url", content: metaData.url }), _jsx("meta", { property: "og:type", content: metaData.type }), metaData.image && _jsx("meta", { property: "og:image", content: metaData.image }), metaData.image && _jsx("meta", { property: "og:image:width", content: "1200" }), metaData.image && _jsx("meta", { property: "og:image:height", content: "630" }), _jsx("meta", { property: "og:site_name", content: siteName }), metaData.type === 'article' && (_jsxs(_Fragment, { children: [metaData.author && (_jsx("meta", { property: "article:author", content: metaData.author })), metaData.publishDate && (_jsx("meta", { property: "article:published_time", content: metaData.publishDate })), metaData.modifiedDate && (_jsx("meta", { property: "article:modified_time", content: metaData.modifiedDate }))] })), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:title", content: metaData.title }), metaData.description && (_jsx("meta", { name: "twitter:description", content: metaData.description })), metaData.image && _jsx("meta", { name: "twitter:image", content: metaData.image }), twitterHandle && (_jsx("meta", { name: "twitter:site", content: `@${twitterHandle}` })), metaData.author && (_jsx("meta", { name: "twitter:creator", content: metaData.author })), _jsx("meta", { name: "format-detection", content: "telephone=no" }), _jsx("meta", { name: "mobile-web-app-capable", content: "yes" }), _jsx("meta", { name: "apple-mobile-web-app-status-bar-style", content: "default" }), Object.entries(staticTags).map(([name, content]) => (_jsx("meta", { name: name, content: content }, name))), shouldEmitHreflang &&
|
|
279
307
|
languages.map((lang) => (_jsx("link", { rel: "alternate", hrefLang: lang, href: `${baseUrl}${lang === defaultLanguage ? '' : `/${lang}`}${location.pathname}` }, `hreflang-${lang}`))), shouldEmitHreflang && (_jsx("link", { rel: "alternate", hrefLang: "x-default", href: `${baseUrl}${location.pathname}` })), baseUrl && (_jsx("link", { rel: "alternate", type: "application/rss+xml", title: `${siteName} Blog`, href: `${baseUrl}/rss.xml` })), metaData.image && metaData.image.startsWith('http') && (_jsx("link", { rel: "dns-prefetch", href: new URL(metaData.image).origin })), _jsx("script", { type: "application/ld+json", children: JSON.stringify({
|
|
280
308
|
'@context': 'https://schema.org',
|
|
281
309
|
'@type': metaData.type === 'article' ? 'Article' : 'WebPage',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
+
import type { SeoMeta } from '@donotdev/core';
|
|
2
3
|
interface MetaTagsConfig {
|
|
3
4
|
/** Base URL for canonical links */
|
|
4
5
|
baseUrl?: string;
|
|
@@ -26,6 +27,7 @@ interface RouteMetadata {
|
|
|
26
27
|
author?: string;
|
|
27
28
|
publishDate?: string;
|
|
28
29
|
modifiedDate?: string;
|
|
30
|
+
seo?: SeoMeta;
|
|
29
31
|
}
|
|
30
32
|
interface NextJsAutoMetaTagsProps {
|
|
31
33
|
/** Configuration for meta tags */
|