@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
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# SEO & Meta Tags
|
|
2
|
+
|
|
3
|
+
**Same `PageMeta` works on Vite and Next.js. i18n-first by default.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## How It Works
|
|
8
|
+
|
|
9
|
+
**Vite:** AutoMetaTags reads route manifest + i18n - Helmet renders meta tags
|
|
10
|
+
**Next.js:** Build generates `metadata-manifest.json` - `generateMetadata()` per page
|
|
11
|
+
|
|
12
|
+
**Same code, both platforms. No conditional logic needed.**
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Why This Matters: Crawlers & Initial HTML
|
|
17
|
+
|
|
18
|
+
**Problem:** Google/social crawlers don't execute JavaScript. They read the initial HTML.
|
|
19
|
+
|
|
20
|
+
**SPA without SSR:** Meta tags injected client-side - crawlers see empty `<head>` - bad SEO.
|
|
21
|
+
|
|
22
|
+
**With framework:**
|
|
23
|
+
|
|
24
|
+
| Platform | Static Pages | Dynamic Pages |
|
|
25
|
+
|----------|--------------|---------------|
|
|
26
|
+
| **Vite** | Prerender at build - meta in HTML | `<Seo>` + react-helmet-async - meta in prerendered HTML |
|
|
27
|
+
| **Next.js** | `generateMetadata()` - server renders meta | `<Seo>` client-side OR `generateMetadata()` with fetch |
|
|
28
|
+
|
|
29
|
+
**Verify:** View Page Source (not DevTools). Meta tags should be visible without JS.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Vite: Prerendering
|
|
34
|
+
|
|
35
|
+
**Enabled by default** in `vite.config.ts`:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
export default defineViteConfig({
|
|
39
|
+
prerender: true, // Default: true
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**What happens:**
|
|
44
|
+
1. Build discovers all routes from `src/pages/`
|
|
45
|
+
2. Renders each page to static HTML
|
|
46
|
+
3. `<Seo>` and AutoMetaTags populate `<head>` via react-helmet-async
|
|
47
|
+
4. Output: `dist/about/index.html` with full meta tags
|
|
48
|
+
|
|
49
|
+
**Dynamic routes** (e.g., `/products/:id`): Prerender with known IDs or use client-side `<Seo>`.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Next.js: Server Rendering
|
|
54
|
+
|
|
55
|
+
**Automatic.** Each page's `generateMetadata()` runs server-side.
|
|
56
|
+
|
|
57
|
+
**Static pages:** Meta resolved at build time from `metadata-manifest.json`.
|
|
58
|
+
**Dynamic pages:** Use `generateMetadata()` with `fetch()` or client-side `<Seo>`.
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
// Server-rendered metadata for dynamic route
|
|
62
|
+
export async function generateMetadata({ params }): Promise<Metadata> {
|
|
63
|
+
const product = await fetch(`/api/products/${params.id}`).then(r => r.json());
|
|
64
|
+
return { title: product.name, description: product.description };
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Standard Use: i18n-First
|
|
71
|
+
|
|
72
|
+
**Pattern:** Define `namespace` in PageMeta, translations provide SEO.
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
// src/pages/AboutPage.tsx
|
|
76
|
+
export const meta: PageMeta = {
|
|
77
|
+
namespace: 'about',
|
|
78
|
+
};
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
// src/locales/about_en.json
|
|
83
|
+
{
|
|
84
|
+
"title": "About Us",
|
|
85
|
+
"description": "Learn more about our company and mission.",
|
|
86
|
+
"meta": {
|
|
87
|
+
"keywords": ["about", "company", "mission"],
|
|
88
|
+
"image": "/og-about.png"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Result:** `<title>About Us | SiteName</title>`, meta description, OG tags - all from i18n.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Override: Static SEO
|
|
98
|
+
|
|
99
|
+
**Pattern:** Use `seo` field for static overrides or non-i18n apps.
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
export const meta: PageMeta = {
|
|
103
|
+
namespace: 'home',
|
|
104
|
+
seo: {
|
|
105
|
+
fullTitle: 'DoNotDev - Build Apps Fast', // Exact title, no "| SiteName"
|
|
106
|
+
description: 'Ship production apps in minutes.',
|
|
107
|
+
image: '/og-home.png',
|
|
108
|
+
type: 'website',
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## All SEO Options
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
export const meta: PageMeta = {
|
|
119
|
+
namespace: 'blog',
|
|
120
|
+
seo: {
|
|
121
|
+
// Title options (pick one)
|
|
122
|
+
title: 'Blog', // "Blog | SiteName"
|
|
123
|
+
fullTitle: 'My Blog', // "My Blog" (exact, no suffix)
|
|
124
|
+
title: null, // "SiteName" only
|
|
125
|
+
|
|
126
|
+
// Description
|
|
127
|
+
description: 'Latest posts',
|
|
128
|
+
description: null, // Omit description entirely
|
|
129
|
+
|
|
130
|
+
// Social sharing
|
|
131
|
+
image: '/og-blog.png', // OG/Twitter image
|
|
132
|
+
type: 'website', // 'website' | 'article' | 'product'
|
|
133
|
+
|
|
134
|
+
// Other
|
|
135
|
+
keywords: ['blog', 'news'],
|
|
136
|
+
noindex: true, // Hide from search engines
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Priority Chain
|
|
144
|
+
|
|
145
|
+
Resolution order (highest to lowest):
|
|
146
|
+
|
|
147
|
+
1. **`<Seo>` component** - Runtime dynamic data (always wins)
|
|
148
|
+
2. **i18n `meta.fullTitle`** - Translated, language-aware
|
|
149
|
+
3. **`seo.fullTitle`** - Static fallback
|
|
150
|
+
4. **i18n `title`** - "Translated | SiteName"
|
|
151
|
+
5. **`seo.title`** - "Static | SiteName"
|
|
152
|
+
6. **SiteName only** - Default fallback
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Dynamic Data: `<Seo>` Component
|
|
157
|
+
|
|
158
|
+
**Pattern:** For pages with runtime data (fetched content), use `<Seo>`.
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
import { Seo } from '@donotdev/ui';
|
|
162
|
+
|
|
163
|
+
export const meta: PageMeta = {
|
|
164
|
+
namespace: 'apartments',
|
|
165
|
+
route: { params: ['id'] },
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export default function ApartmentPage() {
|
|
169
|
+
const { id } = useParams<{ id: string }>();
|
|
170
|
+
const { data: apartment } = useApartment(id);
|
|
171
|
+
|
|
172
|
+
if (!apartment) return <Loading />;
|
|
173
|
+
|
|
174
|
+
return (
|
|
175
|
+
<>
|
|
176
|
+
<Seo
|
|
177
|
+
fullTitle={`${apartment.reference} - ${apartment.rent} | SiteName`}
|
|
178
|
+
description={apartment.description}
|
|
179
|
+
image={apartment.photos[0]}
|
|
180
|
+
type="product"
|
|
181
|
+
/>
|
|
182
|
+
<ApartmentDetails data={apartment} />
|
|
183
|
+
</>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**Works in SSR/prerender** - meta tags are in initial HTML.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## `<Seo>` Props
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
<Seo
|
|
196
|
+
// Title (pick one)
|
|
197
|
+
title="Page Title" // "Page Title | SiteName"
|
|
198
|
+
fullTitle="Exact Title" // "Exact Title"
|
|
199
|
+
|
|
200
|
+
// Content
|
|
201
|
+
description="Page description"
|
|
202
|
+
image="/og-image.png"
|
|
203
|
+
type="website" // 'website' | 'article' | 'product'
|
|
204
|
+
keywords={['key1', 'key2']}
|
|
205
|
+
noindex={false}
|
|
206
|
+
|
|
207
|
+
// Article-specific
|
|
208
|
+
publishDate="2024-01-15T00:00:00Z"
|
|
209
|
+
modifiedDate="2024-01-20T00:00:00Z"
|
|
210
|
+
|
|
211
|
+
// URL
|
|
212
|
+
canonicalUrl="https://example.com/page"
|
|
213
|
+
/>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Hook Alternative
|
|
219
|
+
|
|
220
|
+
```tsx
|
|
221
|
+
import { useSeo } from '@donotdev/ui';
|
|
222
|
+
|
|
223
|
+
export default function ProductPage() {
|
|
224
|
+
const { data: product } = useProduct(id);
|
|
225
|
+
|
|
226
|
+
const SeoTags = useSeo(product ? {
|
|
227
|
+
title: product.name,
|
|
228
|
+
description: product.description,
|
|
229
|
+
image: product.image,
|
|
230
|
+
} : null);
|
|
231
|
+
|
|
232
|
+
return (
|
|
233
|
+
<>
|
|
234
|
+
<SeoTags />
|
|
235
|
+
<ProductDetails data={product} />
|
|
236
|
+
</>
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Next.js: Manual `generateMetadata`
|
|
244
|
+
|
|
245
|
+
For advanced cases, override in the page file:
|
|
246
|
+
|
|
247
|
+
```tsx
|
|
248
|
+
// src/app/products/[id]/page.tsx (manual, not generated)
|
|
249
|
+
import type { Metadata } from 'next';
|
|
250
|
+
|
|
251
|
+
export async function generateMetadata({ params }): Promise<Metadata> {
|
|
252
|
+
const product = await fetchProduct(params.id);
|
|
253
|
+
return {
|
|
254
|
+
title: `${product.name} | Store`,
|
|
255
|
+
description: product.description,
|
|
256
|
+
openGraph: { images: [product.image] },
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
**For static pages, framework handles this automatically.**
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Checklist
|
|
266
|
+
|
|
267
|
+
- [ ] Set `namespace` in PageMeta for i18n-driven SEO
|
|
268
|
+
- [ ] Add `title`, `description`, `meta` to translation files
|
|
269
|
+
- [ ] Use `seo.fullTitle` to escape "Page | App" format
|
|
270
|
+
- [ ] Use `<Seo>` for pages with dynamic/fetched data
|
|
271
|
+
- [ ] Verify meta tags: View Source or browser DevTools
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
**Drop PageMeta, get SEO. Framework handles the rest.**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donotdev/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"files": [
|
|
36
36
|
"dist",
|
|
37
37
|
"assets",
|
|
38
|
+
"guidelines",
|
|
38
39
|
"package.json",
|
|
39
40
|
"README.md",
|
|
40
41
|
"LICENSE.md"
|
|
@@ -58,12 +59,13 @@
|
|
|
58
59
|
"react-hook-form": "^7.71.2"
|
|
59
60
|
},
|
|
60
61
|
"peerDependencies": {
|
|
61
|
-
"@donotdev/
|
|
62
|
-
"@donotdev/
|
|
63
|
-
"@donotdev/
|
|
64
|
-
"@donotdev/
|
|
65
|
-
"@donotdev/
|
|
66
|
-
"@donotdev/
|
|
62
|
+
"@donotdev/ai": "^0.1.1",
|
|
63
|
+
"@donotdev/auth": "^0.1.1",
|
|
64
|
+
"@donotdev/billing": "^0.1.1",
|
|
65
|
+
"@donotdev/components": "^0.1.1",
|
|
66
|
+
"@donotdev/core": "^0.1.1",
|
|
67
|
+
"@donotdev/crud": "^0.1.1",
|
|
68
|
+
"@donotdev/oauth": "^0.1.1",
|
|
67
69
|
"lucide-react": "^0.575.0",
|
|
68
70
|
"react": "^19.2.4",
|
|
69
71
|
"react-dom": "^19.2.4",
|
|
@@ -71,6 +73,9 @@
|
|
|
71
73
|
"valibot": "^1.2.0"
|
|
72
74
|
},
|
|
73
75
|
"peerDependenciesMeta": {
|
|
76
|
+
"@donotdev/ai": {
|
|
77
|
+
"optional": true
|
|
78
|
+
},
|
|
74
79
|
"@donotdev/auth": {
|
|
75
80
|
"optional": true
|
|
76
81
|
},
|
package/dist/chunk-XHGRMKOY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as l from"lucide-react";import{isValidElement as P}from"react";import{cn as m}from"@donotdev/components";import{jsx as c}from"react/jsx-runtime";function S(e){if(!e)return l.Palette;let t=e.replace(/['"]/g,"");return l[t]||l.Palette}var b=({icon:e,fallback:t,className:r,ariaHidden:s=!1})=>{let o=e||t;if(!o)return null;let i="dndev-size-md";if(typeof o=="function"||typeof o=="object"&&o!==null&&"render"in o)return c(o,{className:m(i,r),style:{flexShrink:0},"aria-hidden":s});if(typeof o=="string"){if(!/^[a-zA-Z0-9_-]+$/.test(o))return c("span",{className:m(i,r),style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o});let p=S(o);return c(p,{className:m(i,r),style:{flexShrink:0},"aria-hidden":s})}return P(o)?c("span",{className:r,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o}):c("span",{className:r,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o})},z=b;import*as E from"@donotdev/auth";import{DEGRADED_AUTH_API as L}from"@donotdev/core";var d=E?.useAuth;function T(e){return L[e]}function y(e){return d?d(e):T(e)}var O=typeof d=="function";import{useMemo as h}from"react";import{useNavigationStore as K}from"@donotdev/core";import{USER_ROLES as F}from"@donotdev/core";import{useLocation as k}from"@donotdev/ui/routing/hooks";function g(){let e=k(),t=y("user"),r=!!t,s=t?.role||F.GUEST,o=K(i=>!i||typeof i.getFilteredRoutes!="function"?[]:i.getFilteredRoutes({authenticated:r,role:s}));return h(()=>Array.isArray(o)?o.map(i=>({...i,isActive:_(i.path,e.pathname),hasChildren:!1,children:void 0})).sort((i,a)=>i.label.localeCompare(a.label,void 0,{sensitivity:"base"})):[],[o,e.pathname])}function J(e){let t=g();return h(()=>t.find(r=>r.path===e),[t,e])}function _(e,t){return e==="/"?t==="/":t===e?!0:t.startsWith(e+"/")}import{useCallback as f,useMemo as A}from"react";import{useNavigationStore as u}from"@donotdev/core";import{useNavigate as j}from"@donotdev/ui/routing/hooks";var te=()=>{let e=j(),t=g()??[],r=u(n=>n.favorites),s=u(n=>n.recent),o=u(n=>n.toggleFavorite),i=u(n=>n.isFavorite),a=u(n=>n.addRecent),v=A(()=>t.length?t.filter(n=>r.includes(n.path)):[],[r,t]),p=A(()=>t.length?t.filter(C=>s.includes(C.path)).slice(0,5):[],[s,t]),N=f(n=>{o(n)},[o]),R=f(n=>i(n),[i]),I=f(n=>{a(n)},[a]),x=f(n=>{I(n),e(n)},[e,I]);return{navigationItems:t,favoriteItems:v,recentItems:p,toggleFavorite:N,isFavorite:R,navigateToItem:x}};export{b as a,z as b,y as c,O as d,g as e,J as f,te as g};
|