@donotdev/ui 0.0.31 → 0.1.1
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 +3 -3
- package/dist/{GoToDialog-CR4VOVXT.js → GoToDialog-RU5RP7S2.js} +1 -1
- package/dist/chunk-ETE4RC7M.js +1 -0
- package/dist/components/auth/AuthHeader.d.ts +8 -3
- package/dist/components/auth/AuthHeader.d.ts.map +1 -1
- package/dist/components/auth/AuthHeader.js +6 -6
- package/dist/components/auth/AuthMenu.d.ts +2 -2
- package/dist/components/auth/AuthMenu.js +1 -1
- package/dist/components/common/FeatureCard.d.ts +2 -0
- package/dist/components/common/FeatureCard.d.ts.map +1 -1
- package/dist/components/common/FeatureCard.js +1 -1
- package/dist/components/common/FeatureDisabled.d.ts +2 -1
- package/dist/components/common/FeatureDisabled.d.ts.map +1 -1
- package/dist/components/common/FeatureDisabled.js +2 -2
- package/dist/components/common/ProgressBar.d.ts +1 -1
- package/dist/components/common/ProgressBar.js +2 -2
- package/dist/components/common/RedirectOverlay.d.ts +1 -1
- package/dist/components/common/RedirectOverlay.js +2 -2
- package/dist/components/common/Skeleton.d.ts +7 -7
- package/dist/components/common/Skeleton.js +8 -8
- 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 +2 -1
- package/dist/components/common/icon.d.ts.map +1 -1
- package/dist/components/common/icon.js +2 -2
- package/dist/components/common/index.d.ts +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/cookie-consent/ConsentBanner.d.ts +1 -1
- package/dist/components/cookie-consent/ConsentBanner.js +2 -2
- package/dist/components/cookie-consent/CookieConsent.d.ts +1 -0
- package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
- package/dist/components/cookie-consent/index.d.ts +1 -1
- package/dist/components/cookie-consent/index.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/layout/GameContainer.d.ts +1 -1
- package/dist/components/layout/GameContainer.js +2 -2
- package/dist/components/layout/GameFlow.d.ts +2 -2
- package/dist/components/layout/GameFlow.js +2 -2
- 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/PageContainer.d.ts +1 -1
- package/dist/components/layout/PageContainer.js +2 -2
- package/dist/components/layout/components/Breadcrumbs.d.ts +3 -1
- package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/layout/components/Breadcrumbs.js +2 -2
- package/dist/components/layout/components/DropdownNavigation.d.ts +1 -1
- package/dist/components/layout/components/DropdownNavigation.js +2 -2
- package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts +2 -1
- package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts.map +1 -1
- package/dist/components/layout/components/FloatingLanguageSwitcher.js +2 -2
- package/dist/components/layout/components/Notifications.d.ts +4 -4
- package/dist/components/layout/components/Notifications.js +3 -3
- package/dist/components/layout/components/header/AppBranding.d.ts +3 -2
- package/dist/components/layout/components/header/AppBranding.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppBranding.js +2 -2
- package/dist/components/layout/components/header/AppIcon.d.ts +2 -1
- package/dist/components/layout/components/header/AppIcon.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppIcon.js +2 -2
- package/dist/components/layout/components/header/AppTitle.d.ts +2 -1
- package/dist/components/layout/components/header/AppTitle.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppTitle.js +2 -2
- package/dist/components/layout/components/header/CacheSettings.d.ts +1 -1
- package/dist/components/layout/components/header/CacheSettings.js +5 -5
- package/dist/components/layout/components/header/GameTitle.d.ts +2 -1
- package/dist/components/layout/components/header/GameTitle.d.ts.map +1 -1
- package/dist/components/layout/components/header/GameTitle.js +2 -2
- package/dist/components/layout/components/header/HeaderMenu.d.ts +2 -1
- package/dist/components/layout/components/header/HeaderMenu.d.ts.map +1 -1
- package/dist/components/layout/components/header/HeaderMenu.js +2 -2
- package/dist/components/layout/components/header/HeaderNavigation.d.ts +2 -1
- package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
- package/dist/components/layout/components/header/HeaderNavigation.js +2 -2
- package/dist/components/layout/components/header/SettingsMenu.d.ts +2 -1
- package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
- package/dist/components/layout/components/header/SettingsMenu.js +2 -2
- package/dist/components/layout/components/header/ThemeToggle.d.ts +1 -1
- package/dist/components/layout/components/header/ThemeToggle.js +2 -2
- package/dist/components/layout/components/index.d.ts +1 -1
- package/dist/components/layout/components/index.js +1 -1
- package/dist/components/layout/index.d.ts +2 -1
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +2 -1
- package/dist/components/license/LicenseWatermark.d.ts +1 -1
- package/dist/components/license/LicenseWatermark.js +2 -2
- package/dist/components/license/watermarkData.js +1 -1
- package/dist/crud/components/CrudCardLink.d.ts +1 -1
- 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 +33 -22
- 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 +1 -1
- package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityFormRenderer.js +18 -20
- 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 +41 -25
- package/dist/crud/components/EntityRecommendations.d.ts +2 -2
- package/dist/crud/components/EntityRecommendations.d.ts.map +1 -1
- package/dist/crud/components/EntityRecommendations.js +6 -6
- package/dist/crud/components/EntityWorkflow.js +1 -1
- package/dist/crud/components/Form.d.ts +10 -10
- package/dist/crud/components/Form.js +12 -12
- package/dist/crud/components/index.d.ts +1 -1
- package/dist/crud/components/index.js +1 -1
- package/dist/crud/crudImports.d.ts +2 -1
- package/dist/crud/crudImports.d.ts.map +1 -1
- package/dist/crud/crudImports.js +2 -1
- package/dist/crud/index.d.ts +1 -1
- package/dist/crud/index.js +1 -1
- package/dist/data/techLogos.d.ts +1 -1
- package/dist/data/techLogos.js +1 -1
- package/dist/dndev-next.css +374 -81
- package/dist/dndev.css +455 -80
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/internal/common/DnDevErrorBoundary.d.ts +2 -2
- package/dist/internal/common/DnDevErrorBoundary.js +2 -2
- package/dist/internal/common/ErrorFallback.d.ts +1 -1
- package/dist/internal/common/ErrorFallback.js +3 -3
- package/dist/internal/common/GlobalErrorFallback.d.ts +1 -1
- package/dist/internal/common/GlobalErrorFallback.js +2 -2
- package/dist/internal/common/RouteErrorFallback.d.ts +1 -1
- package/dist/internal/common/RouteErrorFallback.js +2 -2
- package/dist/internal/devtools/DebugTools.js +2 -2
- package/dist/internal/devtools/components/AuthDebugButton.js +1 -1
- package/dist/internal/devtools/components/ConfigTab.js +1 -1
- package/dist/internal/devtools/components/CookieTab.js +1 -1
- package/dist/internal/devtools/components/DebugDialog.js +1 -1
- package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/DesignTab.js +7 -3
- package/dist/internal/devtools/components/LayoutReset.js +2 -2
- package/dist/internal/devtools/components/MaskedValue.js +1 -1
- package/dist/internal/devtools/components/StoresTab.js +1 -1
- package/dist/internal/devtools/components/index.d.ts +1 -1
- package/dist/internal/devtools/components/index.js +1 -1
- package/dist/internal/devtools/index.d.ts +1 -1
- package/dist/internal/devtools/index.js +1 -1
- package/dist/internal/devtools/types.d.ts +9 -9
- package/dist/internal/devtools/utils/envVarDiscovery.d.ts.map +1 -1
- package/dist/internal/devtools/utils/envVarDiscovery.js +5 -6
- package/dist/internal/devtools/utils/index.d.ts +1 -1
- package/dist/internal/devtools/utils/index.js +1 -1
- package/dist/internal/devtools/utils/maskSensitive.js +1 -1
- package/dist/internal/devtools/utils/virtualModuleInspector.d.ts.map +1 -1
- package/dist/internal/devtools/utils/virtualModuleInspector.js +3 -1
- package/dist/internal/initializers/BaseStoresInitializer.d.ts +3 -3
- package/dist/internal/initializers/BaseStoresInitializer.d.ts.map +1 -1
- package/dist/internal/initializers/BaseStoresInitializer.js +13 -4
- package/dist/internal/initializers/NextJsStoresInitializer.d.ts +1 -1
- package/dist/internal/initializers/NextJsStoresInitializer.js +2 -2
- package/dist/internal/initializers/ViteStoresInitializer.d.ts +1 -1
- package/dist/internal/initializers/ViteStoresInitializer.js +2 -2
- package/dist/internal/initializers/index.d.ts +1 -1
- package/dist/internal/initializers/index.js +1 -1
- package/dist/internal/layout/DnDevLayout.d.ts +2 -2
- package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
- package/dist/internal/layout/DnDevLayout.js +45 -18
- package/dist/internal/layout/components/AutoMetaTags.d.ts +4 -2
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +193 -57
- package/dist/internal/layout/components/FaviconHead.d.ts +1 -1
- package/dist/internal/layout/components/FaviconHead.js +2 -2
- package/dist/internal/layout/components/FontPreloadLinks.d.ts +1 -1
- package/dist/internal/layout/components/FontPreloadLinks.js +1 -1
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts +3 -1
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/NextJsAutoMetaTags.js +47 -17
- package/dist/internal/layout/components/PWAUpdateNotification.d.ts +1 -1
- package/dist/internal/layout/components/PWAUpdateNotification.d.ts.map +1 -1
- package/dist/internal/layout/components/PWAUpdateNotification.js +17 -4
- package/dist/internal/layout/components/PerformanceHints.js +1 -1
- package/dist/internal/layout/components/footer/FooterBranding.d.ts +1 -1
- package/dist/internal/layout/components/footer/FooterBranding.js +2 -2
- package/dist/internal/layout/components/footer/FooterCopyright.d.ts +1 -1
- package/dist/internal/layout/components/footer/FooterCopyright.js +2 -2
- package/dist/internal/layout/components/footer/FooterLegalLinks.d.ts +1 -1
- package/dist/internal/layout/components/footer/FooterLegalLinks.js +2 -2
- package/dist/internal/layout/components/index.d.ts +1 -1
- package/dist/internal/layout/components/index.js +1 -1
- package/dist/internal/layout/config/defaults.js +1 -1
- package/dist/internal/layout/config/index.d.ts +1 -1
- package/dist/internal/layout/config/index.js +1 -1
- package/dist/internal/layout/config/presets/admin.d.ts +1 -1
- package/dist/internal/layout/config/presets/blog.d.ts +1 -1
- package/dist/internal/layout/config/presets/docs.js +1 -1
- package/dist/internal/layout/config/presets/game.js +1 -1
- package/dist/internal/layout/config/presets/index.d.ts +1 -1
- package/dist/internal/layout/config/presets/landing.js +1 -1
- package/dist/internal/layout/config/presets/moolti.js +1 -1
- package/dist/internal/layout/config/presets/plain.d.ts +2 -2
- package/dist/internal/layout/config/presets/plain.d.ts.map +1 -1
- package/dist/internal/layout/config/presets/plain.js +12 -1
- package/dist/internal/layout/renderers/index.d.ts +1 -1
- package/dist/internal/layout/renderers/index.js +1 -1
- 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 +6 -2
- 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 +8 -3
- package/dist/internal/layout/zones/DnDevMergedBar.js +1 -1
- 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 +10 -4
- package/dist/internal/layout/zones/index.d.ts +1 -1
- package/dist/internal/layout/zones/index.js +1 -1
- package/dist/internal/providers/NavigationProvider.d.ts +1 -1
- package/dist/internal/providers/NavigationProvider.js +2 -2
- package/dist/internal/providers/SentryInitializer.d.ts +1 -1
- package/dist/internal/providers/SentryInitializer.js +2 -2
- package/dist/internal/providers/UIProviders.d.ts +1 -1
- package/dist/internal/providers/UIProviders.js +3 -3
- package/dist/internal/providers/index.d.ts +1 -1
- package/dist/internal/providers/index.js +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/next.js +1 -1
- package/dist/providers/NextJsAppProviders.d.ts +1 -1
- package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
- package/dist/providers/NextJsAppProviders.js +5 -3
- package/dist/providers/ViteAppProviders.d.ts +1 -1
- package/dist/providers/ViteAppProviders.js +2 -2
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +1 -1
- package/dist/routing/404.d.ts +2 -2
- package/dist/routing/404.js +3 -3
- package/dist/routing/AuthGuard.d.ts +14 -29
- package/dist/routing/AuthGuard.d.ts.map +1 -1
- package/dist/routing/AuthGuard.js +27 -72
- package/dist/routing/AuthGuardFallback.d.ts +1 -1
- package/dist/routing/AuthGuardFallback.js +2 -2
- 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 +2 -1
- package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
- package/dist/routing/DnDevNavigationMenu.js +2 -2
- package/dist/routing/GoTo.d.ts +1 -0
- package/dist/routing/GoTo.d.ts.map +1 -1
- package/dist/routing/GoTo.js +1 -1
- package/dist/routing/GoToDialog.js +1 -1
- package/dist/routing/GoToInput.js +1 -1
- package/dist/routing/GoToWrapper.d.ts +1 -1
- package/dist/routing/GoToWrapper.js +2 -2
- package/dist/routing/Link.d.ts +2 -2
- package/dist/routing/Link.js +2 -2
- package/dist/routing/NavigationItem.d.ts +1 -1
- package/dist/routing/NavigationItem.js +2 -2
- package/dist/routing/hooks/hooks.next.d.ts +1 -1
- package/dist/routing/hooks/hooks.next.js +1 -1
- package/dist/routing/hooks/hooks.vite.d.ts +1 -1
- package/dist/routing/hooks/hooks.vite.js +1 -1
- package/dist/routing/hooks/index.d.ts +1 -1
- package/dist/routing/hooks/index.js +1 -1
- package/dist/routing/hooks/types.d.ts +1 -1
- package/dist/routing/hooks/useLocation.next.js +1 -1
- package/dist/routing/hooks/useLocation.vite.js +1 -1
- package/dist/routing/hooks/useNavigate.next.d.ts +8 -0
- package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.next.js +59 -9
- package/dist/routing/hooks/useNavigate.vite.d.ts +8 -0
- package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.vite.js +65 -15
- package/dist/routing/hooks/useQueryParams.next.js +1 -1
- package/dist/routing/hooks/useQueryParams.vite.js +1 -1
- 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 +12 -28
- 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 +12 -28
- package/dist/routing/hooks/useRouteParam.next.js +1 -1
- package/dist/routing/hooks/useRouteParam.vite.js +1 -1
- package/dist/routing/index.d.ts +2 -1
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +2 -1
- package/dist/routing/useGoTo.js +1 -1
- package/dist/routing/useNavigation.d.ts +2 -2
- package/dist/routing/useNavigation.js +3 -3
- package/dist/routing/useRouteDiscovery.d.ts +7 -7
- package/dist/routing/useRouteDiscovery.js +6 -6
- package/dist/styles/index.css +455 -80
- package/dist/styles/index.d.ts +1 -1
- package/dist/styles/index.js +1 -1
- package/dist/styles/layoutConstants.d.ts +6 -6
- package/dist/styles/layoutConstants.js +5 -5
- package/dist/symbol-index.json +1 -0
- package/dist/utils/assetResolver.d.ts +5 -5
- package/dist/utils/assetResolver.js +4 -4
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/sanitizeSvg.d.ts +4 -0
- package/dist/utils/sanitizeSvg.d.ts.map +1 -1
- package/dist/utils/sanitizeSvg.js +5 -1
- package/dist/utils/tList.js +1 -1
- 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 +6 -1
- package/dist/utils/useAuthVisibility.d.ts +1 -0
- package/dist/utils/useAuthVisibility.d.ts.map +1 -1
- package/dist/utils/useAuthVisibility.js +1 -1
- package/dist/utils/useBillingVisibility.d.ts +1 -0
- package/dist/utils/useBillingVisibility.d.ts.map +1 -1
- package/dist/utils/useBillingVisibility.js +1 -1
- package/dist/utils/useCrudSafe.js +1 -1
- package/dist/utils/useFormStoreSafe.js +1 -1
- package/dist/utils/useOAuthSafe.d.ts +1 -1
- package/dist/utils/useSeo.d.ts +121 -0
- package/dist/utils/useSeo.d.ts.map +1 -0
- package/dist/utils/useSeo.js +114 -0
- package/dist/utils/useStripeBillingSafe.js +1 -1
- package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.js +15 -5
- package/dist/vite-routing/RootLayout.d.ts +1 -1
- package/dist/vite-routing/RootLayout.d.ts.map +1 -1
- package/dist/vite-routing/RootLayout.js +11 -9
- package/dist/vite-routing/index.d.ts +1 -1
- package/dist/vite-routing/index.js +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +1 -1
- 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 +12 -7
- package/dist/chunk-XHGRMKOY.js +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @description Layout orchestrator using zone components.
|
|
4
4
|
* Handles CSS grid setup, data attributes, and zone rendering.
|
|
5
5
|
*
|
|
6
|
-
* @version 0.0
|
|
6
|
+
* @version 0.1.0
|
|
7
7
|
* @since 0.0.1
|
|
8
8
|
* @author AMBROISE PARK Consulting
|
|
9
9
|
*/
|
|
@@ -25,7 +25,7 @@ interface DnDevLayoutComponentProps {
|
|
|
25
25
|
* The store is initialized from appConfig.preset and can be changed at runtime
|
|
26
26
|
* via useLayout('setLayoutPreset').
|
|
27
27
|
*
|
|
28
|
-
* @version 0.0
|
|
28
|
+
* @version 0.1.0
|
|
29
29
|
* @since 0.0.1
|
|
30
30
|
* @author AMBROISE PARK Consulting
|
|
31
31
|
*/
|
|
@@ -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,4CAyV3B,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
6
6
|
* @description Layout orchestrator using zone components.
|
|
7
7
|
* Handles CSS grid setup, data attributes, and zone rendering.
|
|
8
8
|
*
|
|
9
|
-
* @version 0.0
|
|
9
|
+
* @version 0.1.0
|
|
10
10
|
* @since 0.0.1
|
|
11
11
|
* @author AMBROISE PARK Consulting
|
|
12
12
|
*/
|
|
@@ -55,7 +55,7 @@ const LAYOUT_DENSITY_DEFAULTS = {
|
|
|
55
55
|
* The store is initialized from appConfig.preset and can be changed at runtime
|
|
56
56
|
* via useLayout('setLayoutPreset').
|
|
57
57
|
*
|
|
58
|
-
* @version 0.0
|
|
58
|
+
* @version 0.1.0
|
|
59
59
|
* @since 0.0.1
|
|
60
60
|
* @author AMBROISE PARK Consulting
|
|
61
61
|
*/
|
|
@@ -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,11 +198,18 @@ 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, {}) });
|
|
204
|
+
}
|
|
205
|
+
if (config.footer === null) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
if (typeof config.footer === 'function') {
|
|
209
|
+
return _jsx(DnDevFooter, { children: config.footer() });
|
|
186
210
|
}
|
|
187
211
|
return _jsx(DnDevFooter, { app: app });
|
|
188
|
-
}, [layout?.footer, app]);
|
|
212
|
+
}, [layout?.footer, config.footer, app]);
|
|
189
213
|
// Resolve mergedbar with consumer overrides
|
|
190
214
|
const resolvedMergedBar = useMemo(() => {
|
|
191
215
|
if (!config.mobile?.mergedBar)
|
|
@@ -194,12 +218,15 @@ export const DnDevLayout = ({ children, layout, className, }) => {
|
|
|
194
218
|
return _jsx(layout.mergedbar, {});
|
|
195
219
|
}
|
|
196
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;
|
|
197
224
|
if (layout?.mergedbar && typeof layout.mergedbar === 'object') {
|
|
198
225
|
// If consumer provides a function (including () => null), use it; otherwise fall back
|
|
199
226
|
const triggerSlot = layout.mergedbar.trigger !== undefined
|
|
200
227
|
? layout.mergedbar.trigger
|
|
201
228
|
: (mergedBarConfig.trigger ??
|
|
202
|
-
|
|
229
|
+
headerSlots?.start ??
|
|
203
230
|
DEFAULT_SLOTS.header.start);
|
|
204
231
|
const topSlot = layout.mergedbar.top !== undefined
|
|
205
232
|
? layout.mergedbar.top
|
|
@@ -207,25 +234,25 @@ export const DnDevLayout = ({ children, layout, className, }) => {
|
|
|
207
234
|
const contentSlot = layout.mergedbar.content !== undefined
|
|
208
235
|
? layout.mergedbar.content
|
|
209
236
|
: (mergedBarConfig.content ??
|
|
210
|
-
|
|
237
|
+
sidebarSlots?.content ??
|
|
211
238
|
DEFAULT_SLOTS.sidebar.content);
|
|
212
239
|
const bottomSlot = layout.mergedbar.bottom !== undefined
|
|
213
240
|
? layout.mergedbar.bottom
|
|
214
241
|
: (mergedBarConfig.bottom ??
|
|
215
|
-
|
|
242
|
+
sidebarSlots?.bottom ??
|
|
216
243
|
DEFAULT_SLOTS.sidebar.bottom);
|
|
217
244
|
return (_jsx(DnDevMergedBar, { position: mergedBarConfig.position, height: mergedBarConfig.height, trigger: triggerSlot(), top: topSlot(), content: contentSlot(), bottom: bottomSlot() }));
|
|
218
245
|
}
|
|
219
246
|
// No consumer override - use preset or defaults
|
|
220
247
|
const triggerSlot = mergedBarConfig.trigger ??
|
|
221
|
-
|
|
248
|
+
headerSlots?.start ??
|
|
222
249
|
DEFAULT_SLOTS.header.start;
|
|
223
250
|
const topSlot = mergedBarConfig.top ?? DEFAULT_SLOTS.mobile.mergedBar.top;
|
|
224
251
|
const contentSlot = mergedBarConfig.content ??
|
|
225
|
-
|
|
252
|
+
sidebarSlots?.content ??
|
|
226
253
|
DEFAULT_SLOTS.sidebar.content;
|
|
227
254
|
const bottomSlot = mergedBarConfig.bottom ??
|
|
228
|
-
|
|
255
|
+
sidebarSlots?.bottom ??
|
|
229
256
|
DEFAULT_SLOTS.sidebar.bottom;
|
|
230
257
|
return (_jsx(DnDevMergedBar, { position: mergedBarConfig.position, height: mergedBarConfig.height, trigger: triggerSlot(), top: topSlot(), content: contentSlot(), bottom: bottomSlot() }));
|
|
231
258
|
}, [layout?.mergedbar, config]);
|
|
@@ -250,5 +277,5 @@ export const DnDevLayout = ({ children, layout, className, }) => {
|
|
|
250
277
|
};
|
|
251
278
|
startTransition(updateDOM);
|
|
252
279
|
}, [effectivePreset]);
|
|
253
|
-
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, {})] }));
|
|
280
|
+
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, {})] }));
|
|
254
281
|
};
|
|
@@ -7,8 +7,10 @@ import type { ComponentType } from 'react';
|
|
|
7
7
|
*
|
|
8
8
|
* Features:
|
|
9
9
|
* - Automatic route-based meta tag generation
|
|
10
|
-
* - i18n integration
|
|
11
|
-
* - Open Graph and Twitter Cards
|
|
10
|
+
* - i18n integration with hreflang
|
|
11
|
+
* - Open Graph and Twitter Cards with image dimensions
|
|
12
|
+
* - Speculation Rules API
|
|
13
|
+
* - BreadcrumbList + WebSite JSON-LD
|
|
12
14
|
* - 100% Lighthouse SEO compliance
|
|
13
15
|
*/
|
|
14
16
|
export declare const AutoMetaTags: ComponentType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoMetaTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/AutoMetaTags.tsx"],"names":[],"mappings":"
|
|
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;AAyN3C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,EAAE,aAyT1B,CAAC;AAEF;;;GAGG;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -3,48 +3,22 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
// packages/ui/src/internal/layout/components/AutoMetaTags.tsx
|
|
4
4
|
/**
|
|
5
5
|
* @fileoverview Automatic meta tags system integrated with DnDev framework
|
|
6
|
-
* @description Zero-config SEO with route-based meta generation
|
|
6
|
+
* @description Zero-config SEO/GEO with route-based meta generation.
|
|
7
|
+
* All features ON by default, opt-out per feature via appConfig.seo.{feature}: false.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
* generation based on route metadata and translation files. It ensures optimal
|
|
10
|
-
* search engine optimization without requiring manual configuration for each page.
|
|
11
|
-
*
|
|
12
|
-
* **Key Features:**
|
|
9
|
+
* Features:
|
|
13
10
|
* - Zero-configuration SEO setup
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
11
|
+
* - Open Graph and Twitter Card support with image dimensions
|
|
12
|
+
* - hreflang alternate links (auto from i18n config)
|
|
13
|
+
* - Speculation Rules API (prefetch/prerender for Chromium) - opt-in, requires CSP config
|
|
14
|
+
* - BreadcrumbList + WebSite JSON-LD structured data
|
|
16
15
|
* - Internationalization integration
|
|
17
16
|
* - Canonical URL management
|
|
18
|
-
* - Structured data support
|
|
19
|
-
*
|
|
20
|
-
* **SEO Capabilities:**
|
|
21
|
-
* - Dynamic title and description generation
|
|
22
|
-
* - Social media sharing optimization
|
|
23
|
-
* - Search engine indexing control
|
|
24
|
-
* - Multi-language support
|
|
25
|
-
* - Image and video metadata
|
|
26
|
-
*
|
|
27
|
-
* **Framework Integration:**
|
|
28
|
-
* - Uses Helmet for meta tag management
|
|
29
|
-
* - Integrates with i18n system for translations
|
|
30
|
-
* - Leverages platform location for routing
|
|
31
|
-
* - Supports both static and dynamic content
|
|
32
17
|
*
|
|
33
|
-
* @version 0.0
|
|
18
|
+
* @version 0.2.0
|
|
34
19
|
* @since 0.0.1
|
|
35
20
|
* @author AMBROISE PARK Consulting
|
|
36
|
-
*
|
|
37
|
-
* **Usage Pattern:**
|
|
38
|
-
* ```tsx
|
|
39
|
-
* <AutoMetaTags
|
|
40
|
-
* config={{
|
|
41
|
-
* siteName: "My App",
|
|
42
|
-
* defaultImage: "/og-image.jpg"
|
|
43
|
-
* }}
|
|
44
|
-
* />
|
|
45
|
-
* ```
|
|
46
21
|
*/
|
|
47
|
-
// packages/core/ui/src/components/layout/components/AutoMetaTags.tsx
|
|
48
22
|
import { useMemo } from 'react';
|
|
49
23
|
import { Helmet } from 'react-helmet-async';
|
|
50
24
|
import { useTranslation, useIsClient } from '@donotdev/core';
|
|
@@ -74,6 +48,22 @@ function matchRoutePath(pattern, pathname) {
|
|
|
74
48
|
}
|
|
75
49
|
return true;
|
|
76
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
|
+
}
|
|
77
67
|
/**
|
|
78
68
|
* Get route metadata from window object (injected by build system).
|
|
79
69
|
* Resolves dynamic routes by pattern (e.g. /cars/:id) so PageMeta (including namespace) is used for SEO.
|
|
@@ -101,10 +91,117 @@ function getRouteMetadata(pathname, isClient) {
|
|
|
101
91
|
// Fallback: first path segment as namespace (e.g. /cars/abc123 → ns: cars)
|
|
102
92
|
const segments = pathname.split('/').filter(Boolean);
|
|
103
93
|
if (segments.length > 0) {
|
|
104
|
-
return {
|
|
94
|
+
return { namespace: segments[0] };
|
|
105
95
|
}
|
|
106
96
|
return {};
|
|
107
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Build BreadcrumbList JSON-LD from URL path segments
|
|
100
|
+
*/
|
|
101
|
+
function buildBreadcrumbSchema(pathname, baseUrl, siteName) {
|
|
102
|
+
const segments = pathname.split('/').filter(Boolean);
|
|
103
|
+
const items = [
|
|
104
|
+
{
|
|
105
|
+
'@type': 'ListItem',
|
|
106
|
+
position: 1,
|
|
107
|
+
name: siteName,
|
|
108
|
+
item: baseUrl || '/',
|
|
109
|
+
},
|
|
110
|
+
];
|
|
111
|
+
let currentPath = '';
|
|
112
|
+
for (let i = 0; i < segments.length; i++) {
|
|
113
|
+
currentPath += `/${segments[i]}`;
|
|
114
|
+
items.push({
|
|
115
|
+
'@type': 'ListItem',
|
|
116
|
+
position: i + 2,
|
|
117
|
+
name: segments[i]
|
|
118
|
+
.split('-')
|
|
119
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
120
|
+
.join(' '),
|
|
121
|
+
item: `${baseUrl}${currentPath}`,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
'@context': 'https://schema.org',
|
|
126
|
+
'@type': 'BreadcrumbList',
|
|
127
|
+
itemListElement: items,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Build WebSite JSON-LD with SearchAction (sitelinks search box)
|
|
132
|
+
*/
|
|
133
|
+
function buildWebSiteSchema(baseUrl, siteName) {
|
|
134
|
+
return {
|
|
135
|
+
'@context': 'https://schema.org',
|
|
136
|
+
'@type': 'WebSite',
|
|
137
|
+
name: siteName,
|
|
138
|
+
url: baseUrl || '/',
|
|
139
|
+
potentialAction: {
|
|
140
|
+
'@type': 'SearchAction',
|
|
141
|
+
target: {
|
|
142
|
+
'@type': 'EntryPoint',
|
|
143
|
+
urlTemplate: `${baseUrl}/search?q={search_term_string}`,
|
|
144
|
+
},
|
|
145
|
+
'query-input': 'required name=search_term_string',
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Build Organization JSON-LD from app metadata (links, description)
|
|
151
|
+
* Only emitted on homepage when links are configured
|
|
152
|
+
*/
|
|
153
|
+
function buildOrganizationSchema(baseUrl, siteName, description, links) {
|
|
154
|
+
const sameAs = links
|
|
155
|
+
? Object.values(links).filter((url) => !!url)
|
|
156
|
+
: [];
|
|
157
|
+
return {
|
|
158
|
+
'@context': 'https://schema.org',
|
|
159
|
+
'@type': 'Organization',
|
|
160
|
+
name: siteName,
|
|
161
|
+
url: baseUrl || '/',
|
|
162
|
+
...(description && { description }),
|
|
163
|
+
...(sameAs.length > 0 && { sameAs }),
|
|
164
|
+
logo: {
|
|
165
|
+
'@type': 'ImageObject',
|
|
166
|
+
url: `${baseUrl}/icon-512x512.png`,
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Build speculation rules for prefetch/prerender of public internal links
|
|
172
|
+
* Excludes auth-gated and API routes
|
|
173
|
+
*/
|
|
174
|
+
function buildSpeculationRules() {
|
|
175
|
+
return {
|
|
176
|
+
prerender: [
|
|
177
|
+
{
|
|
178
|
+
where: {
|
|
179
|
+
and: [
|
|
180
|
+
{ href_matches: '/*' },
|
|
181
|
+
{ not: { href_matches: '/api/*' } },
|
|
182
|
+
{ not: { href_matches: '/admin/*' } },
|
|
183
|
+
{ not: { href_matches: '/login*' } },
|
|
184
|
+
{ not: { href_matches: '/signin*' } },
|
|
185
|
+
{ not: { href_matches: '/signup*' } },
|
|
186
|
+
{ not: { href_matches: '/logout*' } },
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
eagerness: 'moderate',
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
prefetch: [
|
|
193
|
+
{
|
|
194
|
+
where: {
|
|
195
|
+
and: [
|
|
196
|
+
{ href_matches: '/*' },
|
|
197
|
+
{ not: { href_matches: '/api/*' } },
|
|
198
|
+
],
|
|
199
|
+
},
|
|
200
|
+
eagerness: 'conservative',
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
};
|
|
204
|
+
}
|
|
108
205
|
/**
|
|
109
206
|
* AutoMetaTags component
|
|
110
207
|
*
|
|
@@ -113,8 +210,10 @@ function getRouteMetadata(pathname, isClient) {
|
|
|
113
210
|
*
|
|
114
211
|
* Features:
|
|
115
212
|
* - Automatic route-based meta tag generation
|
|
116
|
-
* - i18n integration
|
|
117
|
-
* - Open Graph and Twitter Cards
|
|
213
|
+
* - i18n integration with hreflang
|
|
214
|
+
* - Open Graph and Twitter Cards with image dimensions
|
|
215
|
+
* - Speculation Rules API
|
|
216
|
+
* - BreadcrumbList + WebSite JSON-LD
|
|
118
217
|
* - 100% Lighthouse SEO compliance
|
|
119
218
|
*/
|
|
120
219
|
export const AutoMetaTags = () => {
|
|
@@ -122,10 +221,16 @@ export const AutoMetaTags = () => {
|
|
|
122
221
|
const location = useLocation();
|
|
123
222
|
const seoConfig = useSeoConfig();
|
|
124
223
|
const isClient = useIsClient();
|
|
125
|
-
const
|
|
224
|
+
const appMeta = useAppConfig('app');
|
|
225
|
+
const siteName = (seoConfig && seoConfig.siteName) || appMeta?.name || '';
|
|
126
226
|
const baseUrl = getPlatformEnvVar('APP_URL') || '';
|
|
127
227
|
// Get route metadata — computed from current pathname and client flag
|
|
128
228
|
const routeMeta = getRouteMetadata(location.pathname, isClient);
|
|
229
|
+
// Read i18n languages from build-time config (for hreflang)
|
|
230
|
+
const i18nConfig = useMemo(() => {
|
|
231
|
+
const config = getDndevConfig();
|
|
232
|
+
return config?.i18n;
|
|
233
|
+
}, []);
|
|
129
234
|
// Memoize computed values for performance — must be called before any early return
|
|
130
235
|
const metaData = useMemo(() => {
|
|
131
236
|
if (!seoConfig)
|
|
@@ -133,27 +238,41 @@ export const AutoMetaTags = () => {
|
|
|
133
238
|
const { defaultNamespace = 'home', defaultImage } = seoConfig;
|
|
134
239
|
// Construct absolute URL for canonical link
|
|
135
240
|
const currentUrl = `${baseUrl}${location.pathname}`;
|
|
136
|
-
const ns = routeMeta.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const pageDescription = routeMeta.description || t(`${ns}:description`);
|
|
140
|
-
// Get the meta object and destructure it properly
|
|
241
|
+
const ns = routeMeta.namespace || defaultNamespace;
|
|
242
|
+
const seo = routeMeta.seo;
|
|
243
|
+
// Get the meta object from i18n (for image, type, keywords, author, fullTitle)
|
|
141
244
|
const metaObject = t(`${ns}:meta`, { returnObjects: true });
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
245
|
+
// Title resolution priority:
|
|
246
|
+
// 1. i18n meta.fullTitle → translated, language-aware (wins)
|
|
247
|
+
// 2. seo.fullTitle (static PageMeta) → fallback for non-i18n apps
|
|
248
|
+
// 3. seo.title (explicit) → "title | siteName"
|
|
249
|
+
// 4. i18n ns:title → "translated | siteName"
|
|
250
|
+
// 5. siteName only (when seo.title === null or no translation)
|
|
251
|
+
let fullTitle;
|
|
252
|
+
if (metaObject?.fullTitle) {
|
|
253
|
+
// i18n fullTitle (ns:meta.fullTitle) → translated, takes priority
|
|
254
|
+
fullTitle = metaObject.fullTitle;
|
|
255
|
+
}
|
|
256
|
+
else if (seo?.fullTitle) {
|
|
257
|
+
// Static fullTitle in PageMeta → fallback for non-i18n apps
|
|
258
|
+
fullTitle = seo.fullTitle;
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
// Standard resolution: title | siteName
|
|
262
|
+
const pageTitle = resolveSeoField(seo?.title, `${ns}:title`, t);
|
|
263
|
+
fullTitle = pageTitle ? `${pageTitle} | ${siteName}` : siteName;
|
|
264
|
+
}
|
|
265
|
+
// Description resolution: seo.description > i18n
|
|
266
|
+
const description = resolveSeoField(seo?.description, `${ns}:description`, t);
|
|
267
|
+
// Other meta fields: seo > i18n meta object > defaults
|
|
268
|
+
const pageImage = seo?.image || metaObject?.image || defaultImage;
|
|
269
|
+
const pageType = seo?.type || metaObject?.type || 'website';
|
|
270
|
+
const pageKeywords = seo?.keywords || metaObject?.keywords;
|
|
145
271
|
const pageAuthor = routeMeta.author || metaObject?.author;
|
|
146
|
-
// Only use values that are actually defined (not empty strings or undefined)
|
|
147
|
-
const title = pageTitle && pageTitle !== `${ns}:title` ? pageTitle : undefined;
|
|
148
|
-
const description = pageDescription && pageDescription !== `${ns}:description`
|
|
149
|
-
? pageDescription
|
|
150
|
-
: undefined;
|
|
151
272
|
const image = pageImage || undefined;
|
|
152
273
|
const type = pageType || 'website';
|
|
153
274
|
const keywords = pageKeywords || undefined;
|
|
154
275
|
const author = pageAuthor || undefined;
|
|
155
|
-
// Build full title with site name if title exists, otherwise just use site name
|
|
156
|
-
const fullTitle = title ? `${title} | ${siteName}` : siteName;
|
|
157
276
|
// Use relative image path instead of constructing absolute URL
|
|
158
277
|
// This prevents crashes from invalid baseUrl and works in all modes
|
|
159
278
|
const imagePath = image && image.startsWith('http') ? image : image ? image : undefined;
|
|
@@ -163,7 +282,7 @@ export const AutoMetaTags = () => {
|
|
|
163
282
|
image: imagePath,
|
|
164
283
|
url: currentUrl,
|
|
165
284
|
type,
|
|
166
|
-
noindex: routeMeta.noindex || false,
|
|
285
|
+
noindex: seo?.noindex || routeMeta.noindex || false,
|
|
167
286
|
keywords,
|
|
168
287
|
author,
|
|
169
288
|
publishDate: routeMeta.publishDate,
|
|
@@ -174,9 +293,22 @@ export const AutoMetaTags = () => {
|
|
|
174
293
|
if (!seoConfig || !metaData)
|
|
175
294
|
return null;
|
|
176
295
|
const { twitterHandle, staticTags = {} } = seoConfig;
|
|
177
|
-
|
|
296
|
+
// Feature flags — all default to true (ON by default), except speculationRules (CSP conflict)
|
|
297
|
+
// Speculation rules require inline script which conflicts with strict CSP.
|
|
298
|
+
// Opt-in only: set seo.speculationRules: true and add CSP hash to your headers.
|
|
299
|
+
const speculationRulesEnabled = seoConfig.speculationRules === true;
|
|
300
|
+
const hreflangEnabled = seoConfig.hreflang !== false;
|
|
301
|
+
const breadcrumbSchemaEnabled = seoConfig.breadcrumbSchema !== false;
|
|
302
|
+
const websiteSchemaEnabled = seoConfig.websiteSchema !== false;
|
|
303
|
+
const organizationSchemaEnabled = seoConfig.organizationSchema !== false;
|
|
304
|
+
// hreflang: only emit when 2+ languages configured
|
|
305
|
+
const languages = i18nConfig?.languages || [];
|
|
306
|
+
const defaultLanguage = i18nConfig?.defaultLanguage || 'en';
|
|
307
|
+
const shouldEmitHreflang = hreflangEnabled && languages.length >= 2;
|
|
308
|
+
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)
|
|
178
309
|
? metaData.keywords.join(', ')
|
|
179
|
-
: 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 }), _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))),
|
|
310
|
+
: 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 &&
|
|
311
|
+
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({
|
|
180
312
|
'@context': 'https://schema.org',
|
|
181
313
|
'@type': metaData.type === 'article' ? 'Article' : 'WebPage',
|
|
182
314
|
name: metaData.title,
|
|
@@ -209,7 +341,11 @@ export const AutoMetaTags = () => {
|
|
|
209
341
|
: '/logo.svg',
|
|
210
342
|
},
|
|
211
343
|
},
|
|
212
|
-
}) })
|
|
344
|
+
}) }), breadcrumbSchemaEnabled && location.pathname !== '/' && (_jsx("script", { type: "application/ld+json", children: JSON.stringify(buildBreadcrumbSchema(location.pathname, baseUrl, siteName)) })), websiteSchemaEnabled && baseUrl && (_jsx("script", { type: "application/ld+json", children: JSON.stringify(buildWebSiteSchema(baseUrl, siteName)) })), organizationSchemaEnabled &&
|
|
345
|
+
baseUrl &&
|
|
346
|
+
location.pathname === '/' &&
|
|
347
|
+
appMeta?.links &&
|
|
348
|
+
Object.values(appMeta.links).some(Boolean) && (_jsx("script", { type: "application/ld+json", children: JSON.stringify(buildOrganizationSchema(baseUrl, siteName, appMeta.description, appMeta.links)) })), speculationRulesEnabled && (_jsx("script", { type: "speculationrules", children: JSON.stringify(buildSpeculationRules()) }))] }));
|
|
213
349
|
};
|
|
214
350
|
/**
|
|
215
351
|
* AutoMetaTags retrieves all configuration from AppConfigProvider.
|
|
@@ -13,7 +13,7 @@ import type { ComponentType } from 'react';
|
|
|
13
13
|
* - Apple touch icons
|
|
14
14
|
* - Prevents default favicon requests
|
|
15
15
|
*
|
|
16
|
-
* @version 0.0
|
|
16
|
+
* @version 0.1.0
|
|
17
17
|
* @since 0.0.1
|
|
18
18
|
* @author AMBROISE PARK Consulting
|
|
19
19
|
* @note This component must be rendered inside <head> via React head management
|
|
@@ -15,7 +15,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
15
15
|
* - apple-touch-icons: These ARE placed in <head> via React head management
|
|
16
16
|
* - theme-color: Progressive enhancement - intentionally used for modern browsers
|
|
17
17
|
*
|
|
18
|
-
* @version 0.0
|
|
18
|
+
* @version 0.1.0
|
|
19
19
|
* @since 0.0.1
|
|
20
20
|
* @author AMBROISE PARK Consulting
|
|
21
21
|
*/
|
|
@@ -36,7 +36,7 @@ import { AssetResolver } from '../../../utils/assetResolver';
|
|
|
36
36
|
* - Apple touch icons
|
|
37
37
|
* - Prevents default favicon requests
|
|
38
38
|
*
|
|
39
|
-
* @version 0.0
|
|
39
|
+
* @version 0.1.0
|
|
40
40
|
* @since 0.0.1
|
|
41
41
|
* @author AMBROISE PARK Consulting
|
|
42
42
|
* @note This component must be rendered inside <head> via React head management
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview FontPreloadLinks - Server-only component for Next.js
|
|
3
3
|
* @description Reads public/dndev-font-preloads.json (written at build by FontPreloadWebpackPlugin) and renders preload link tags for Lighthouse-friendly LCP. Include in root layout so initial HTML contains the links.
|
|
4
4
|
*
|
|
5
|
-
* @version 0.0
|
|
5
|
+
* @version 0.1.0
|
|
6
6
|
* @since 0.0.1
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
4
4
|
* @fileoverview FontPreloadLinks - Server-only component for Next.js
|
|
5
5
|
* @description Reads public/dndev-font-preloads.json (written at build by FontPreloadWebpackPlugin) and renders preload link tags for Lighthouse-friendly LCP. Include in root layout so initial HTML contains the links.
|
|
6
6
|
*
|
|
7
|
-
* @version 0.0
|
|
7
|
+
* @version 0.1.0
|
|
8
8
|
* @since 0.0.1
|
|
9
9
|
* @author AMBROISE PARK Consulting
|
|
10
10
|
*/
|
|
@@ -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 */
|
|
@@ -46,7 +48,7 @@ interface NextJsAutoMetaTagsProps {
|
|
|
46
48
|
*
|
|
47
49
|
* Uses Next.js hooks directly instead of platform-aware hooks
|
|
48
50
|
*
|
|
49
|
-
* @version 0.0
|
|
51
|
+
* @version 0.1.0
|
|
50
52
|
* @since 0.0.1
|
|
51
53
|
* @author AMBROISE PARK Consulting
|
|
52
54
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextJsAutoMetaTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/NextJsAutoMetaTags.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NextJsAutoMetaTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/NextJsAutoMetaTags.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,UAAU,cAAc;IACtB,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED,UAAU,aAAa;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,UAAU,uBAAuB;IAC/B,kCAAkC;IAClC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAkFD;;;;;;;;GAQG;AACH,QAAA,MAAM,kBAAkB,EAAE,aAAa,CAAC,uBAAuB,CA6M9D,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|