@donotdev/ui 0.3.1 → 0.3.3
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/README.md +2 -3
- package/dist/components/auth/AuthHeader.js +1 -93
- package/dist/components/auth/AuthMenu.d.ts.map +1 -1
- package/dist/components/auth/AuthMenu.js +3 -286
- package/dist/components/auth/index.js +1 -9
- package/dist/components/common/FeatureCard.d.ts.map +1 -1
- package/dist/components/common/FeatureCard.js +1 -86
- package/dist/components/common/FeatureDisabled.js +1 -67
- package/dist/components/common/IconPlaceholder.d.ts +24 -0
- package/dist/components/common/IconPlaceholder.d.ts.map +1 -0
- package/dist/components/common/IconPlaceholder.js +1 -0
- package/dist/components/common/LazyLucideIcon.d.ts +39 -0
- package/dist/components/common/LazyLucideIcon.d.ts.map +1 -0
- package/dist/components/common/LazyLucideIcon.js +1 -0
- package/dist/components/common/ProgressBar.js +1 -84
- package/dist/components/common/RedirectOverlay.js +1 -243
- package/dist/components/common/Skeleton.js +1 -144
- package/dist/components/common/TechBento.d.ts.map +1 -1
- package/dist/components/common/TechBento.js +1 -53
- package/dist/components/common/icon.d.ts +1 -1
- package/dist/components/common/icon.d.ts.map +1 -1
- package/dist/components/common/icon.js +1 -84
- package/dist/components/common/iconByName.d.ts +33 -0
- package/dist/components/common/iconByName.d.ts.map +1 -0
- package/dist/components/common/iconByName.js +1 -0
- package/dist/components/common/index.js +1 -16
- package/dist/components/cookie-consent/ConsentBanner.d.ts +3 -1
- package/dist/components/cookie-consent/ConsentBanner.d.ts.map +1 -1
- package/dist/components/cookie-consent/ConsentBanner.js +1 -31
- package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
- package/dist/components/cookie-consent/CookieConsent.js +1 -183
- package/dist/components/cookie-consent/index.js +1 -11
- package/dist/components/cookie-consent/useCookieNoticeRequired.d.ts +7 -0
- package/dist/components/cookie-consent/useCookieNoticeRequired.d.ts.map +1 -0
- package/dist/components/cookie-consent/useCookieNoticeRequired.js +1 -0
- package/dist/components/index.js +1 -13
- package/dist/components/layout/GameContainer.d.ts.map +1 -1
- package/dist/components/layout/GameContainer.js +1 -72
- package/dist/components/layout/GameFlow.d.ts.map +1 -1
- package/dist/components/layout/GameFlow.js +1 -93
- package/dist/components/layout/PageConfig.d.ts.map +1 -1
- package/dist/components/layout/PageConfig.js +1 -47
- package/dist/components/layout/PageContainer.d.ts.map +1 -1
- package/dist/components/layout/PageContainer.js +1 -38
- package/dist/components/layout/components/Breadcrumbs.d.ts +2 -1
- package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/layout/components/Breadcrumbs.js +1 -89
- package/dist/components/layout/components/DropdownNavigation.d.ts.map +1 -1
- package/dist/components/layout/components/DropdownNavigation.js +1 -30
- package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts.map +1 -1
- package/dist/components/layout/components/FloatingLanguageSwitcher.js +1 -26
- package/dist/components/layout/components/Notifications.js +1 -182
- package/dist/components/layout/components/header/AppBranding.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppBranding.js +1 -54
- package/dist/components/layout/components/header/AppIcon.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppIcon.js +1 -59
- package/dist/components/layout/components/header/AppTitle.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppTitle.js +1 -40
- package/dist/components/layout/components/header/CacheSettings.js +1 -225
- package/dist/components/layout/components/header/GameTitle.d.ts.map +1 -1
- package/dist/components/layout/components/header/GameTitle.js +1 -66
- package/dist/components/layout/components/header/HeaderMenu.js +1 -75
- package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
- package/dist/components/layout/components/header/HeaderNavigation.js +1 -66
- package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
- package/dist/components/layout/components/header/SettingsMenu.js +1 -85
- package/dist/components/layout/components/header/ThemeToggle.d.ts.map +1 -1
- package/dist/components/layout/components/header/ThemeToggle.js +1 -93
- package/dist/components/layout/components/index.js +1 -25
- package/dist/components/layout/index.js +1 -14
- package/dist/crud/components/ChildRowsPicker.js +1 -68
- package/dist/crud/components/CrudCardLink.js +1 -14
- package/dist/crud/components/EntityCardList.d.ts +4 -1
- package/dist/crud/components/EntityCardList.d.ts.map +1 -1
- package/dist/crud/components/EntityCardList.js +1 -184
- package/dist/crud/components/EntityDisplayRenderer.js +1 -130
- package/dist/crud/components/EntityFormRenderer.js +1 -433
- package/dist/crud/components/EntityList.js +1 -521
- package/dist/crud/components/EntityRecommendations.js +1 -87
- package/dist/crud/components/EntityWorkflow.js +1 -55
- package/dist/crud/components/Form.d.ts.map +1 -1
- package/dist/crud/components/Form.js +1 -198
- package/dist/crud/components/cellEditFor.js +1 -74
- package/dist/crud/components/entityParent.js +1 -76
- package/dist/crud/components/index.js +1 -16
- package/dist/crud/components/useRecordBreadcrumb.d.ts +3 -1
- package/dist/crud/components/useRecordBreadcrumb.d.ts.map +1 -1
- package/dist/crud/components/useRecordBreadcrumb.js +1 -43
- package/dist/crud/crudImports.js +1 -51
- package/dist/crud/index.js +1 -11
- package/dist/data/techLogos.js +1 -99
- package/dist/dndev-next.css +113 -41
- package/dist/dndev.css +113 -41
- package/dist/index.js +1 -5
- package/dist/internal/common/DnDevErrorBoundary.js +1 -55
- package/dist/internal/common/ErrorFallback.js +3 -214
- package/dist/internal/common/GlobalErrorFallback.js +1 -45
- package/dist/internal/common/RouteErrorFallback.js +3 -140
- package/dist/internal/devtools/DebugTools.js +1 -131
- package/dist/internal/devtools/components/AuthDebugButton.js +1 -72
- package/dist/internal/devtools/components/ConfigTab.js +1 -61
- package/dist/internal/devtools/components/CookieTab.js +1 -156
- package/dist/internal/devtools/components/DebugDialog.js +1 -48
- package/dist/internal/devtools/components/DesignTab.js +1 -469
- package/dist/internal/devtools/components/LayoutReset.js +1 -214
- package/dist/internal/devtools/components/MaskedValue.js +1 -39
- package/dist/internal/devtools/components/StoresTab.js +1 -90
- package/dist/internal/devtools/components/index.js +1 -16
- package/dist/internal/devtools/index.js +1 -13
- package/dist/internal/devtools/types.js +0 -2
- package/dist/internal/devtools/utils/envVarDiscovery.js +1 -106
- package/dist/internal/devtools/utils/index.js +1 -12
- package/dist/internal/devtools/utils/maskSensitive.js +1 -59
- package/dist/internal/devtools/utils/virtualModuleInspector.js +1 -309
- package/dist/internal/initializers/BaseStoresInitializer.js +1 -367
- package/dist/internal/initializers/NextJsStoresInitializer.js +1 -78
- package/dist/internal/initializers/ViteStoresInitializer.js +1 -20
- package/dist/internal/initializers/index.js +1 -11
- package/dist/internal/layout/DnDevLayout.js +1 -321
- package/dist/internal/layout/components/AutoMetaTags.d.ts +5 -0
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +1 -338
- package/dist/internal/layout/components/FaviconHead.d.ts +18 -14
- package/dist/internal/layout/components/FaviconHead.d.ts.map +1 -1
- package/dist/internal/layout/components/FaviconHead.js +1 -60
- package/dist/internal/layout/components/FontPreloadLinks.js +1 -31
- package/dist/internal/layout/components/HeadTags.js +1 -20
- package/dist/internal/layout/components/PWAUpdateNotification.js +1 -131
- package/dist/internal/layout/components/footer/FooterBranding.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/FooterBranding.js +1 -35
- package/dist/internal/layout/components/footer/FooterCopyright.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/FooterCopyright.js +1 -37
- package/dist/internal/layout/components/footer/FooterLegalLinks.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/FooterLegalLinks.js +1 -44
- package/dist/internal/layout/components/footer/useLegalLinks.d.ts +4 -2
- package/dist/internal/layout/components/footer/useLegalLinks.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/useLegalLinks.js +1 -21
- package/dist/internal/layout/components/headTagElement.d.ts +16 -0
- package/dist/internal/layout/components/headTagElement.d.ts.map +1 -0
- package/dist/internal/layout/components/headTagElement.js +1 -0
- package/dist/internal/layout/components/index.js +1 -13
- package/dist/internal/layout/components/prerenderedHead.d.ts +15 -0
- package/dist/internal/layout/components/prerenderedHead.d.ts.map +1 -0
- package/dist/internal/layout/components/prerenderedHead.js +1 -0
- package/dist/internal/layout/components/trailingSlash.d.ts +13 -0
- package/dist/internal/layout/components/trailingSlash.d.ts.map +1 -0
- package/dist/internal/layout/components/trailingSlash.js +1 -0
- package/dist/internal/layout/config/defaults.js +1 -47
- package/dist/internal/layout/config/index.js +1 -11
- package/dist/internal/layout/config/presets/admin.js +1 -35
- package/dist/internal/layout/config/presets/blog.js +1 -31
- package/dist/internal/layout/config/presets/docs.js +1 -51
- package/dist/internal/layout/config/presets/game.js +1 -53
- package/dist/internal/layout/config/presets/index.js +1 -24
- package/dist/internal/layout/config/presets/landing.js +1 -42
- package/dist/internal/layout/config/presets/moolti.js +1 -52
- package/dist/internal/layout/config/presets/plain.js +1 -25
- package/dist/internal/layout/renderers/index.js +0 -10
- package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevFooter.js +1 -67
- package/dist/internal/layout/zones/DnDevHeader.js +1 -41
- package/dist/internal/layout/zones/DnDevMergedBar.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevMergedBar.js +1 -52
- package/dist/internal/layout/zones/DnDevSidebar.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevSidebar.js +1 -181
- package/dist/internal/layout/zones/index.js +1 -14
- package/dist/internal/providers/NavigationProvider.d.ts.map +1 -1
- package/dist/internal/providers/NavigationProvider.js +1 -71
- package/dist/internal/providers/SentryInitializer.d.ts.map +1 -1
- package/dist/internal/providers/SentryInitializer.js +1 -36
- package/dist/internal/providers/UIProviders.js +1 -79
- package/dist/internal/providers/index.js +1 -12
- package/dist/next.js +1 -11
- package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
- package/dist/providers/NextJsAppProviders.js +1 -107
- package/dist/providers/ViteAppProviders.d.ts +11 -9
- package/dist/providers/ViteAppProviders.d.ts.map +1 -1
- package/dist/providers/ViteAppProviders.js +1 -117
- package/dist/providers/index.js +1 -11
- package/dist/routing/404.js +1 -108
- package/dist/routing/AuthGuard.js +1 -178
- package/dist/routing/AuthGuardFallback.d.ts.map +1 -1
- package/dist/routing/AuthGuardFallback.js +1 -67
- package/dist/routing/AuthReturnTo.js +1 -68
- package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
- package/dist/routing/DnDevNavigationMenu.js +1 -138
- package/dist/routing/GoTo.d.ts.map +1 -1
- package/dist/routing/GoTo.js +1 -38
- package/dist/routing/GoToDialog.d.ts.map +1 -1
- package/dist/routing/GoToDialog.js +1 -97
- package/dist/routing/GoToInput.d.ts.map +1 -1
- package/dist/routing/GoToInput.js +1 -49
- package/dist/routing/GoToWrapper.d.ts.map +1 -1
- package/dist/routing/GoToWrapper.js +1 -59
- package/dist/routing/Link.d.ts +10 -2
- package/dist/routing/Link.d.ts.map +1 -1
- package/dist/routing/Link.js +1 -109
- package/dist/routing/NavigationItem.d.ts.map +1 -1
- package/dist/routing/NavigationItem.js +1 -44
- package/dist/routing/NotFoundDocument.d.ts +33 -0
- package/dist/routing/NotFoundDocument.d.ts.map +1 -0
- package/dist/routing/NotFoundDocument.js +1 -0
- package/dist/routing/SignedInRedirect.js +1 -47
- package/dist/routing/hooks/hooks.next.js +1 -1
- package/dist/routing/hooks/hooks.vite.js +1 -1
- package/dist/routing/hooks/index.js +1 -26
- package/dist/routing/hooks/types.js +0 -2
- package/dist/routing/hooks/useLocation.next.js +1 -35
- package/dist/routing/hooks/useLocation.vite.js +1 -13
- package/dist/routing/hooks/useMatch.next.js +1 -31
- package/dist/routing/hooks/useMatch.vite.js +1 -6
- package/dist/routing/hooks/useNavigate.next.js +1 -64
- package/dist/routing/hooks/useNavigate.vite.js +1 -61
- package/dist/routing/hooks/useParams.next.js +1 -9
- package/dist/routing/hooks/useParams.vite.js +1 -6
- package/dist/routing/hooks/useQueryParams.next.js +1 -66
- package/dist/routing/hooks/useQueryParams.vite.js +1 -66
- package/dist/routing/hooks/useRedirectGuard.next.js +1 -119
- package/dist/routing/hooks/useRedirectGuard.vite.js +1 -117
- package/dist/routing/hooks/useRouteParam.next.js +1 -38
- package/dist/routing/hooks/useRouteParam.vite.js +1 -38
- package/dist/routing/hooks/useRoutePath.next.d.ts +5 -3
- package/dist/routing/hooks/useRoutePath.next.d.ts.map +1 -1
- package/dist/routing/hooks/useRoutePath.next.js +1 -36
- package/dist/routing/hooks/useRoutePath.vite.js +1 -25
- package/dist/routing/hooks/useSearchParams.next.js +1 -22
- package/dist/routing/hooks/useSearchParams.vite.js +1 -22
- package/dist/routing/hooks/useUrlLanguage.next.js +1 -50
- package/dist/routing/hooks/useUrlLanguage.vite.js +1 -41
- package/dist/routing/index.d.ts +1 -0
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +1 -32
- package/dist/routing/link/InternalLink.next.d.ts +23 -0
- package/dist/routing/link/InternalLink.next.d.ts.map +1 -0
- package/dist/routing/link/InternalLink.next.js +1 -0
- package/dist/routing/link/InternalLink.vite.d.ts +22 -0
- package/dist/routing/link/InternalLink.vite.d.ts.map +1 -0
- package/dist/routing/link/InternalLink.vite.js +1 -0
- package/dist/routing/link/absolutePath.d.ts +17 -0
- package/dist/routing/link/absolutePath.d.ts.map +1 -0
- package/dist/routing/link/absolutePath.js +1 -0
- package/dist/routing/link/link.next.d.ts +12 -0
- package/dist/routing/link/link.next.d.ts.map +1 -0
- package/dist/routing/link/link.next.js +1 -0
- package/dist/routing/link/link.vite.d.ts +12 -0
- package/dist/routing/link/link.vite.d.ts.map +1 -0
- package/dist/routing/link/link.vite.js +1 -0
- package/dist/routing/link/types.d.ts +30 -0
- package/dist/routing/link/types.d.ts.map +1 -0
- package/dist/routing/link/types.js +0 -0
- package/dist/routing/parentRoute.js +1 -43
- package/dist/routing/useGoTo.d.ts.map +1 -1
- package/dist/routing/useGoTo.js +1 -59
- package/dist/routing/useNavigation.d.ts.map +1 -1
- package/dist/routing/useNavigation.js +1 -114
- package/dist/routing/useRouteDiscovery.d.ts +4 -0
- package/dist/routing/useRouteDiscovery.d.ts.map +1 -1
- package/dist/routing/useRouteDiscovery.js +1 -313
- package/dist/rsc.d.ts +28 -0
- package/dist/rsc.d.ts.map +1 -0
- package/dist/rsc.js +1 -0
- package/dist/styles/index.css +113 -41
- package/dist/styles/index.js +1 -10
- package/dist/styles/layoutConstants.js +1 -134
- package/dist/symbol-index.json +1 -1
- package/dist/utils/assetResolver.d.ts +19 -19
- package/dist/utils/assetResolver.d.ts.map +1 -1
- package/dist/utils/assetResolver.js +1 -297
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -23
- package/dist/utils/sanitizeSvg.js +1 -51
- package/dist/utils/tList.js +1 -42
- package/dist/utils/useAISafe.d.ts.map +1 -1
- package/dist/utils/useAISafe.js +1 -53
- package/dist/utils/useAuthSafe.d.ts.map +1 -1
- package/dist/utils/useAuthSafe.js +1 -78
- package/dist/utils/useAuthVisibility.d.ts.map +1 -1
- package/dist/utils/useAuthVisibility.js +1 -63
- package/dist/utils/useBillingVisibility.d.ts.map +1 -1
- package/dist/utils/useBillingVisibility.js +1 -57
- package/dist/utils/useCrudSafe.d.ts.map +1 -1
- package/dist/utils/useCrudSafe.js +1 -75
- package/dist/utils/useDeleteAccountSafe.js +1 -52
- package/dist/utils/useFormStoreSafe.d.ts.map +1 -1
- package/dist/utils/useFormStoreSafe.js +1 -85
- package/dist/utils/useOAuthSafe.d.ts.map +1 -1
- package/dist/utils/useOAuthSafe.js +1 -38
- package/dist/utils/useStripeBillingSafe.d.ts.map +1 -1
- package/dist/utils/useStripeBillingSafe.js +1 -81
- package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.js +1 -235
- package/dist/vite-routing/RootLayout.d.ts.map +1 -1
- package/dist/vite-routing/RootLayout.js +1 -205
- package/dist/vite-routing/index.js +1 -11
- package/dist/vite.js +1 -10
- package/guidelines/COMPONENTS.md +3 -3
- package/guidelines/PAGES.md +3 -0
- package/guidelines/ROUTING.md +16 -0
- package/guidelines/SEO.md +160 -142
- package/package.json +18 -8
- package/dist/ChildRowsPicker-63M4EQUQ.js +0 -1
- package/dist/ChildRowsPicker-ISP365ON.js +0 -1
- package/dist/ChildRowsPicker-PQFE6NCR.js +0 -1
- package/dist/ChildRowsPicker-XXFFSMWY.js +0 -1
- package/dist/CookieConsent-QOUAY6B4.js +0 -1
- package/dist/GoToDialog-KSBGOIWO.js +0 -1
- package/dist/GoToDialog-XBK5EZF4.js +0 -1
- package/dist/chunk-3CIZFGST.js +0 -1
- package/dist/chunk-LHMKU342.js +0 -1
- package/dist/chunk-MS7ZIW5Z.js +0 -1
- package/dist/chunk-O2XFH626.js +0 -1
- package/dist/chunk-P2DHZWPY.js +0 -1
- package/dist/components/common/lucideIconByName.d.ts +0 -9
- package/dist/components/common/lucideIconByName.d.ts.map +0 -1
- package/dist/components/common/lucideIconByName.js +0 -32
- package/dist/internal/layout/components/PerformanceHints.d.ts +0 -71
- package/dist/internal/layout/components/PerformanceHints.d.ts.map +0 -1
- package/dist/internal/layout/components/PerformanceHints.js +0 -71
- package/dist/internal/layout/components/i18nSeoMeta.d.ts +0 -54
- package/dist/internal/layout/components/i18nSeoMeta.d.ts.map +0 -1
- package/dist/internal/layout/components/i18nSeoMeta.js +0 -53
- package/dist/utils/useSeo.d.ts +0 -129
- package/dist/utils/useSeo.d.ts.map +0 -1
- package/dist/utils/useSeo.js +0 -151
|
@@ -1,321 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
// packages/ui/src/internal/layout/DnDevLayout.tsx
|
|
4
|
-
/**
|
|
5
|
-
* @fileoverview DnDevLayout Component
|
|
6
|
-
* @description Layout orchestrator using zone components.
|
|
7
|
-
* Handles CSS grid setup, data attributes, and zone rendering.
|
|
8
|
-
*
|
|
9
|
-
* @version 0.1.0
|
|
10
|
-
* @since 0.0.1
|
|
11
|
-
* @author AMBROISE PARK Consulting
|
|
12
|
-
*/
|
|
13
|
-
import { useLayoutEffect, useEffect, useRef, useMemo, Suspense, startTransition, lazy, } from 'react';
|
|
14
|
-
import { cn, Stack } from '@donotdev/components';
|
|
15
|
-
import { isClient, isNextJs, isDev, useBreakpoint } from '@donotdev/core';
|
|
16
|
-
import { useLayout } from '@donotdev/core';
|
|
17
|
-
import { useTranslation } from '@donotdev/core';
|
|
18
|
-
import { useAppConfig } from '@donotdev/core';
|
|
19
|
-
import { LAYOUT_PRESET, DENSITY } from '@donotdev/core';
|
|
20
|
-
import { useRoutePath } from '@donotdev/ui/routing/hooks';
|
|
21
|
-
import Breadcrumbs from '../../components/layout/components/Breadcrumbs';
|
|
22
|
-
import { GoToWrapper } from '../../routing';
|
|
23
|
-
import { DEFAULT_SLOTS } from './config/defaults';
|
|
24
|
-
import { presetRegistry } from './config/presets';
|
|
25
|
-
import { DnDevHeader, DnDevSidebar, DnDevFooter, DnDevMergedBar, } from './zones';
|
|
26
|
-
const DebugTools = lazy(() => {
|
|
27
|
-
return import('../devtools')
|
|
28
|
-
.then((m) => {
|
|
29
|
-
return { default: m.DebugTools };
|
|
30
|
-
})
|
|
31
|
-
.catch(() => {
|
|
32
|
-
return { default: () => _jsx(_Fragment, {}) };
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
/**
|
|
36
|
-
* Layout preset to density mapping
|
|
37
|
-
*/
|
|
38
|
-
const LAYOUT_DENSITY_DEFAULTS = {
|
|
39
|
-
[LAYOUT_PRESET.ADMIN]: DENSITY.COMPACT,
|
|
40
|
-
[LAYOUT_PRESET.MOOLTI]: DENSITY.COMPACT,
|
|
41
|
-
[LAYOUT_PRESET.LANDING]: DENSITY.EXPRESSIVE,
|
|
42
|
-
[LAYOUT_PRESET.GAME]: DENSITY.EXPRESSIVE,
|
|
43
|
-
[LAYOUT_PRESET.DOCS]: DENSITY.STANDARD,
|
|
44
|
-
[LAYOUT_PRESET.BLOG]: DENSITY.STANDARD,
|
|
45
|
-
[LAYOUT_PRESET.PLAIN]: DENSITY.STANDARD,
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* DnDevLayout - Layout orchestrator with zone components
|
|
49
|
-
*
|
|
50
|
-
* Renders CSS grid zones using dedicated zone components.
|
|
51
|
-
* Handles data attributes and CSS variable overrides.
|
|
52
|
-
* MergedBar is always rendered - CSS controls visibility.
|
|
53
|
-
*
|
|
54
|
-
* Layout preset is always read from the store via useLayout('layoutPreset').
|
|
55
|
-
* The store is initialized from appConfig.preset and can be changed at runtime
|
|
56
|
-
* via useLayout('setLayoutPreset').
|
|
57
|
-
*
|
|
58
|
-
* @version 0.1.0
|
|
59
|
-
* @since 0.0.1
|
|
60
|
-
* @author AMBROISE PARK Consulting
|
|
61
|
-
*/
|
|
62
|
-
export const DnDevLayout = ({ children, layout, className, }) => {
|
|
63
|
-
// Store is single source of truth for preset
|
|
64
|
-
const preset = useLayout('layoutPreset');
|
|
65
|
-
const routePresetOverride = useLayout('routePresetOverride');
|
|
66
|
-
const isMobile = useBreakpoint('isMobileOrTablet');
|
|
67
|
-
const { app, features, customPresets, preset: configPreset } = useAppConfig();
|
|
68
|
-
const debugEnabled = isDev() && features?.debug === true;
|
|
69
|
-
// Subscribe to language changes for zone re-renders
|
|
70
|
-
useTranslation('dndev');
|
|
71
|
-
// Layout config props
|
|
72
|
-
const breadcrumbs = layout?.breadcrumbs ?? 'smart';
|
|
73
|
-
const routeHideBreadcrumbs = useLayout('routeHideBreadcrumbs');
|
|
74
|
-
// Route detection for animations
|
|
75
|
-
const pathname = useRoutePath();
|
|
76
|
-
const mainRef = useRef(null);
|
|
77
|
-
// Platform content handling
|
|
78
|
-
const content = children;
|
|
79
|
-
// Merge custom presets with built-in registry
|
|
80
|
-
const effectiveRegistry = useMemo(() => {
|
|
81
|
-
if (!customPresets)
|
|
82
|
-
return presetRegistry;
|
|
83
|
-
return { ...presetRegistry, ...customPresets };
|
|
84
|
-
}, [customPresets]);
|
|
85
|
-
// Effective preset: route override > store > appConfig > fallback.
|
|
86
|
-
// appConfig sits between the store and the fallback on purpose: the store starts
|
|
87
|
-
// at `layoutPreset: null` and only receives appConfig.preset from themeStore's
|
|
88
|
-
// async initialize() (a post-hydration effect). Falling straight through to
|
|
89
|
-
// 'landing' made SSR and the first client paint render the landing chrome for
|
|
90
|
-
// every non-landing app, then swap it out on hydration — a visible flash.
|
|
91
|
-
// appConfig is available synchronously on both server and client, so reading it
|
|
92
|
-
// here makes the first paint already correct; the later store init is a no-op.
|
|
93
|
-
const effectivePreset = useMemo(() => {
|
|
94
|
-
return routePresetOverride || preset || configPreset || 'landing';
|
|
95
|
-
}, [routePresetOverride, preset, configPreset]);
|
|
96
|
-
// Get preset config (presets only override what's different, defaults fill the rest)
|
|
97
|
-
const config = useMemo(() => {
|
|
98
|
-
// why: presetRegistry is Record<string, PresetConfig>; `landing` always exists but index access yields `| undefined`
|
|
99
|
-
const presetConfig = (effectiveRegistry[effectivePreset] ??
|
|
100
|
-
presetRegistry.landing);
|
|
101
|
-
return {
|
|
102
|
-
name: presetConfig.name,
|
|
103
|
-
header: presetConfig.header,
|
|
104
|
-
sidebar: presetConfig.sidebar,
|
|
105
|
-
footer: presetConfig.footer,
|
|
106
|
-
footerMode: presetConfig.footerMode,
|
|
107
|
-
mobile: presetConfig.mobile,
|
|
108
|
-
};
|
|
109
|
-
}, [effectivePreset, effectiveRegistry]);
|
|
110
|
-
// Footer mode: consumer layout prop > preset config > default (mobile=scroll, desktop=fixed)
|
|
111
|
-
const footerMode = layout?.footerMode ?? config.footerMode;
|
|
112
|
-
const footerInline = footerMode === 'scroll' || (isMobile && footerMode !== 'fixed');
|
|
113
|
-
// Resolve header with consumer overrides
|
|
114
|
-
const resolvedHeader = useMemo(() => {
|
|
115
|
-
// Function = custom mode: consumer owns zone visuals, DnDevHeader wraps with structural behavior
|
|
116
|
-
if (typeof layout?.header === 'function') {
|
|
117
|
-
return (_jsx(DnDevHeader, { children: _jsx(layout.header, {}) }));
|
|
118
|
-
}
|
|
119
|
-
if (typeof config.header === 'function') {
|
|
120
|
-
return _jsx(DnDevHeader, { children: config.header() });
|
|
121
|
-
}
|
|
122
|
-
// Determine effective header config (mobile overrides desktop when on mobile)
|
|
123
|
-
const effectiveHeader = isMobile
|
|
124
|
-
? layout?.mobile?.header ||
|
|
125
|
-
config.mobile?.header ||
|
|
126
|
-
layout?.header ||
|
|
127
|
-
config.header
|
|
128
|
-
: layout?.header || config.header;
|
|
129
|
-
if (effectiveHeader && typeof effectiveHeader === 'object') {
|
|
130
|
-
// Priority: consumer mobile > preset mobile > consumer desktop > preset desktop > defaults
|
|
131
|
-
const startSlot = isMobile && layout?.mobile?.header?.start !== undefined
|
|
132
|
-
? layout.mobile.header.start
|
|
133
|
-
: isMobile && config.mobile?.header?.start !== undefined
|
|
134
|
-
? config.mobile.header.start
|
|
135
|
-
: layout?.header &&
|
|
136
|
-
typeof layout.header === 'object' &&
|
|
137
|
-
layout.header.start !== undefined
|
|
138
|
-
? layout.header.start
|
|
139
|
-
: (config.header?.start ?? DEFAULT_SLOTS.header.start);
|
|
140
|
-
const centerSlot = isMobile && layout?.mobile?.header?.center !== undefined
|
|
141
|
-
? layout.mobile.header.center
|
|
142
|
-
: isMobile && config.mobile?.header?.center !== undefined
|
|
143
|
-
? config.mobile.header.center
|
|
144
|
-
: layout?.header &&
|
|
145
|
-
typeof layout.header === 'object' &&
|
|
146
|
-
layout.header.center !== undefined
|
|
147
|
-
? layout.header.center
|
|
148
|
-
: (config.header?.center ?? DEFAULT_SLOTS.header.center);
|
|
149
|
-
const endSlot = isMobile && layout?.mobile?.header?.end !== undefined
|
|
150
|
-
? layout.mobile.header.end
|
|
151
|
-
: isMobile && config.mobile?.header?.end !== undefined
|
|
152
|
-
? config.mobile.header.end
|
|
153
|
-
: layout?.header &&
|
|
154
|
-
typeof layout.header === 'object' &&
|
|
155
|
-
layout.header.end !== undefined
|
|
156
|
-
? layout.header.end
|
|
157
|
-
: (config.header?.end ?? DEFAULT_SLOTS.header.end);
|
|
158
|
-
return (_jsx(DnDevHeader, { start: startSlot(), center: centerSlot(), end: endSlot() }));
|
|
159
|
-
}
|
|
160
|
-
// No consumer override - use preset or defaults
|
|
161
|
-
const effectiveStartSlot = isMobile
|
|
162
|
-
? (config.mobile?.header?.start ??
|
|
163
|
-
config.header?.start ??
|
|
164
|
-
DEFAULT_SLOTS.header.start)
|
|
165
|
-
: (config.header?.start ?? DEFAULT_SLOTS.header.start);
|
|
166
|
-
const effectiveCenterSlot = isMobile
|
|
167
|
-
? (config.mobile?.header?.center ??
|
|
168
|
-
config.header?.center ??
|
|
169
|
-
DEFAULT_SLOTS.header.center)
|
|
170
|
-
: (config.header?.center ?? DEFAULT_SLOTS.header.center);
|
|
171
|
-
const effectiveEndSlot = isMobile
|
|
172
|
-
? (config.mobile?.header?.end ??
|
|
173
|
-
config.header?.end ??
|
|
174
|
-
DEFAULT_SLOTS.header.end)
|
|
175
|
-
: (config.header?.end ?? DEFAULT_SLOTS.header.end);
|
|
176
|
-
return (_jsx(DnDevHeader, { start: effectiveStartSlot(), center: effectiveCenterSlot(), end: effectiveEndSlot() }));
|
|
177
|
-
}, [layout?.header, layout?.mobile?.header, config, isMobile]);
|
|
178
|
-
// Resolve sidebar with consumer overrides
|
|
179
|
-
const resolvedSidebar = useMemo(() => {
|
|
180
|
-
// Function = custom mode: consumer owns zone visuals, DnDevSidebar wraps with resize behavior
|
|
181
|
-
if (typeof layout?.sidebar === 'function') {
|
|
182
|
-
return (_jsx(DnDevSidebar, { children: _jsx(layout.sidebar, {}) }));
|
|
183
|
-
}
|
|
184
|
-
if (typeof config.sidebar === 'function') {
|
|
185
|
-
return _jsx(DnDevSidebar, { children: config.sidebar() });
|
|
186
|
-
}
|
|
187
|
-
if (layout?.sidebar && typeof layout.sidebar === 'object') {
|
|
188
|
-
// If consumer provides a function (including () => null), use it; otherwise fall back
|
|
189
|
-
const topSlot = layout.sidebar.top !== undefined
|
|
190
|
-
? layout.sidebar.top
|
|
191
|
-
: (config.sidebar?.top ?? DEFAULT_SLOTS.sidebar.top);
|
|
192
|
-
const contentSlot = layout.sidebar.content !== undefined
|
|
193
|
-
? layout.sidebar.content
|
|
194
|
-
: (config.sidebar?.content ?? DEFAULT_SLOTS.sidebar.content);
|
|
195
|
-
const bottomSlot = layout.sidebar.bottom !== undefined
|
|
196
|
-
? layout.sidebar.bottom
|
|
197
|
-
: (config.sidebar?.bottom ?? DEFAULT_SLOTS.sidebar.bottom);
|
|
198
|
-
return (_jsx(DnDevSidebar, { top: topSlot(), content: contentSlot(), bottom: bottomSlot(), defaultWidth: config.sidebar?.defaultWidth ?? DEFAULT_SLOTS.sidebar.defaultWidth, minWidth: config.sidebar?.minWidth ?? DEFAULT_SLOTS.sidebar.minWidth, maxWidth: config.sidebar?.maxWidth ?? DEFAULT_SLOTS.sidebar.maxWidth }));
|
|
199
|
-
}
|
|
200
|
-
// No consumer override - use preset or defaults
|
|
201
|
-
const topSlot = config.sidebar?.top ?? DEFAULT_SLOTS.sidebar.top;
|
|
202
|
-
const contentSlot = config.sidebar?.content ?? DEFAULT_SLOTS.sidebar.content;
|
|
203
|
-
const bottomSlot = config.sidebar?.bottom ?? DEFAULT_SLOTS.sidebar.bottom;
|
|
204
|
-
return (_jsx(DnDevSidebar, { top: topSlot(), content: contentSlot(), bottom: bottomSlot(), defaultWidth: config.sidebar?.defaultWidth ?? DEFAULT_SLOTS.sidebar.defaultWidth, minWidth: config.sidebar?.minWidth ?? DEFAULT_SLOTS.sidebar.minWidth, maxWidth: config.sidebar?.maxWidth ?? DEFAULT_SLOTS.sidebar.maxWidth }));
|
|
205
|
-
}, [layout?.sidebar, config.sidebar]);
|
|
206
|
-
// Resolve footer with consumer overrides
|
|
207
|
-
const resolvedFooter = useMemo(() => {
|
|
208
|
-
// Function = custom mode: consumer owns zone visuals, DnDevFooter wraps with structural behavior
|
|
209
|
-
if (layout?.footer) {
|
|
210
|
-
return (_jsx(DnDevFooter, { children: _jsx(layout.footer, {}) }));
|
|
211
|
-
}
|
|
212
|
-
if (config.footer === null) {
|
|
213
|
-
return null;
|
|
214
|
-
}
|
|
215
|
-
if (typeof config.footer === 'function') {
|
|
216
|
-
return _jsx(DnDevFooter, { children: config.footer() });
|
|
217
|
-
}
|
|
218
|
-
return _jsx(DnDevFooter, { app: app });
|
|
219
|
-
}, [layout?.footer, config.footer, app]);
|
|
220
|
-
// Resolve mergedbar with consumer overrides
|
|
221
|
-
const resolvedMergedBar = useMemo(() => {
|
|
222
|
-
if (!config.mobile?.mergedBar)
|
|
223
|
-
return null;
|
|
224
|
-
if (typeof layout?.mergedbar === 'function') {
|
|
225
|
-
return _jsx(layout.mergedbar, {});
|
|
226
|
-
}
|
|
227
|
-
const mergedBarConfig = config.mobile.mergedBar;
|
|
228
|
-
// Narrow zone configs: function zones don't provide slots for mergedBar fallback
|
|
229
|
-
const headerSlots = typeof config.header === 'object' ? config.header : undefined;
|
|
230
|
-
const sidebarSlots = typeof config.sidebar === 'object' ? config.sidebar : undefined;
|
|
231
|
-
// Consumer sidebar/mobile.sidebar overrides propagate to mergedBar when not explicitly overridden
|
|
232
|
-
const layoutSidebarSlots = layout?.sidebar && typeof layout.sidebar === 'object'
|
|
233
|
-
? layout.sidebar
|
|
234
|
-
: undefined;
|
|
235
|
-
const layoutMobileSidebarSlots = layout?.mobile?.sidebar;
|
|
236
|
-
if (layout?.mergedbar && typeof layout.mergedbar === 'object') {
|
|
237
|
-
// If consumer provides a function (including () => null), use it; otherwise fall back
|
|
238
|
-
const triggerSlot = layout.mergedbar.trigger !== undefined
|
|
239
|
-
? layout.mergedbar.trigger
|
|
240
|
-
: (mergedBarConfig.trigger ??
|
|
241
|
-
headerSlots?.start ??
|
|
242
|
-
DEFAULT_SLOTS.header.start);
|
|
243
|
-
const topSlot = layout.mergedbar.top !== undefined
|
|
244
|
-
? layout.mergedbar.top
|
|
245
|
-
: (layoutMobileSidebarSlots?.top ??
|
|
246
|
-
layoutSidebarSlots?.top ??
|
|
247
|
-
mergedBarConfig.top ??
|
|
248
|
-
DEFAULT_SLOTS.mobile.mergedBar.top);
|
|
249
|
-
const contentSlot = layout.mergedbar.content !== undefined
|
|
250
|
-
? layout.mergedbar.content
|
|
251
|
-
: (layoutMobileSidebarSlots?.content ??
|
|
252
|
-
layoutSidebarSlots?.content ??
|
|
253
|
-
mergedBarConfig.content ??
|
|
254
|
-
sidebarSlots?.content ??
|
|
255
|
-
DEFAULT_SLOTS.sidebar.content);
|
|
256
|
-
const bottomSlot = layout.mergedbar.bottom !== undefined
|
|
257
|
-
? layout.mergedbar.bottom
|
|
258
|
-
: (layoutMobileSidebarSlots?.bottom ??
|
|
259
|
-
layoutSidebarSlots?.bottom ??
|
|
260
|
-
mergedBarConfig.bottom ??
|
|
261
|
-
sidebarSlots?.bottom ??
|
|
262
|
-
DEFAULT_SLOTS.sidebar.bottom);
|
|
263
|
-
return (_jsx(DnDevMergedBar, { position: mergedBarConfig.position, height: mergedBarConfig.height, trigger: triggerSlot(), top: topSlot(), content: contentSlot(), bottom: bottomSlot() }));
|
|
264
|
-
}
|
|
265
|
-
// No consumer override - use preset or defaults
|
|
266
|
-
const triggerSlot = mergedBarConfig.trigger ??
|
|
267
|
-
headerSlots?.start ??
|
|
268
|
-
DEFAULT_SLOTS.header.start;
|
|
269
|
-
const topSlot = layoutMobileSidebarSlots?.top ??
|
|
270
|
-
layoutSidebarSlots?.top ??
|
|
271
|
-
mergedBarConfig.top ??
|
|
272
|
-
DEFAULT_SLOTS.mobile.mergedBar.top;
|
|
273
|
-
const contentSlot = layoutMobileSidebarSlots?.content ??
|
|
274
|
-
layoutSidebarSlots?.content ??
|
|
275
|
-
mergedBarConfig.content ??
|
|
276
|
-
sidebarSlots?.content ??
|
|
277
|
-
DEFAULT_SLOTS.sidebar.content;
|
|
278
|
-
const bottomSlot = layoutMobileSidebarSlots?.bottom ??
|
|
279
|
-
layoutSidebarSlots?.bottom ??
|
|
280
|
-
mergedBarConfig.bottom ??
|
|
281
|
-
sidebarSlots?.bottom ??
|
|
282
|
-
DEFAULT_SLOTS.sidebar.bottom;
|
|
283
|
-
return (_jsx(DnDevMergedBar, { position: mergedBarConfig.position, height: mergedBarConfig.height, trigger: triggerSlot(), top: topSlot(), content: contentSlot(), bottom: bottomSlot() }));
|
|
284
|
-
}, [layout?.mergedbar, layout?.sidebar, layout?.mobile?.sidebar, config]);
|
|
285
|
-
// Apply routing animation data attribute (useLayoutEffect = before paint)
|
|
286
|
-
useLayoutEffect(() => {
|
|
287
|
-
if (!isClient() || !mainRef.current)
|
|
288
|
-
return;
|
|
289
|
-
const routingAnimation = getComputedStyle(document.documentElement)
|
|
290
|
-
.getPropertyValue('--routing-animation')
|
|
291
|
-
.trim() || 'none';
|
|
292
|
-
mainRef.current.setAttribute('data-routing-animation', routingAnimation);
|
|
293
|
-
}, [pathname]);
|
|
294
|
-
const effectiveDensity = effectivePreset
|
|
295
|
-
? LAYOUT_DENSITY_DEFAULTS[effectivePreset] || DENSITY.STANDARD
|
|
296
|
-
: undefined;
|
|
297
|
-
// Mirror the preset onto <html>. Client-only by nature (documentElement is not
|
|
298
|
-
// ours to render), so it lands after hydration — which is why the attributes
|
|
299
|
-
// are rendered on the wrapper below. Kept because a few app or framework rules
|
|
300
|
-
// are scoped to :root[data-layout=...]. Density is not mirrored: the density
|
|
301
|
-
// tokens are declared on <html> from the wrapper's attribute (variables.css),
|
|
302
|
-
// and a [data-density] on <html> would match the nested-density rules there.
|
|
303
|
-
useLayoutEffect(() => {
|
|
304
|
-
if (!isClient() || !effectivePreset)
|
|
305
|
-
return;
|
|
306
|
-
const updateDOM = () => {
|
|
307
|
-
document.documentElement.setAttribute('data-layout', effectivePreset);
|
|
308
|
-
};
|
|
309
|
-
startTransition(updateDOM);
|
|
310
|
-
}, [effectivePreset]);
|
|
311
|
-
return (
|
|
312
|
-
// data-layout / data-density are rendered here, in the server HTML, not only
|
|
313
|
-
// pushed onto <html> by the effect above (client-only, after hydration):
|
|
314
|
-
// - a preset hides its chrome through CSS scoped to the wrapper
|
|
315
|
-
// (`[data-layout='plain'] header[role='banner'] { display: none }`);
|
|
316
|
-
// - the layout and density tokens are declared on <html> from these
|
|
317
|
-
// attributes (`:root:has(.dndev-layout[data-density='standard'])`), never
|
|
318
|
-
// on the wrapper itself, so the app's :root overrides in themes.css still
|
|
319
|
-
// win. Both resolve on the first paint, with or without JavaScript.
|
|
320
|
-
_jsxs("div", { className: cn('dndev-layout', className), "data-layout": effectivePreset || undefined, "data-density": effectiveDensity, "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, {})] }));
|
|
321
|
-
};
|
|
1
|
+
"use client";import{useLayoutEffect as x,useRef as y,useMemo as m,Suspense as ee,startTransition as te,lazy as re}from"react";import{cn as oe}from"@donotdev/components";import{isClient as H,isDev as ne,useBreakpoint as de}from"@donotdev/core";import{useLayout as A}from"@donotdev/core";import{useTranslation as ie}from"@donotdev/core";import{useAppConfig as ae}from"@donotdev/core";import{LAYOUT_PRESET as f,DENSITY as c}from"@donotdev/core";import{useRoutePath as se}from"@donotdev/ui/routing/hooks";import be from"../../components/layout/components/Breadcrumbs.js";import{GoToWrapper as ce}from"../../routing/index.js";import{DEFAULT_SLOTS as r}from"./config/defaults.js";import{presetRegistry as T}from"./config/presets/index.js";import{DnDevHeader as u,DnDevSidebar as g,DnDevFooter as E,DnDevMergedBar as F}from"./zones/index.js";import{Fragment as he,jsx as n,jsxs as G}from"react/jsx-runtime";var me=re(()=>import("../devtools/index.js").then(l=>({default:l.DebugTools})).catch(()=>({default:()=>n(he,{})}))),fe={[f.ADMIN]:c.COMPACT,[f.MOOLTI]:c.COMPACT,[f.LANDING]:c.EXPRESSIVE,[f.GAME]:c.EXPRESSIVE,[f.DOCS]:c.STANDARD,[f.BLOG]:c.STANDARD,[f.PLAIN]:c.STANDARD},Re=({children:l,layout:e,className:U})=>{let L=A("layoutPreset"),C=A("routePresetOverride"),d=de("isMobileOrTablet"),{app:M,features:Y,customPresets:S,preset:W}=ae(),_=ne()&&Y?.debug===!0;ie("dndev");let N=e?.breadcrumbs??"smart",k=A("routeHideBreadcrumbs"),w=se(),D=y(null),R=l,O=m(()=>S?{...T,...S}:T,[S]),s=m(()=>C||L||W||"landing",[C,L,W]),t=m(()=>{let o=O[s]??T.landing;return{name:o.name,header:o.header,sidebar:o.sidebar,footer:o.footer,footerMode:o.footerMode,mobile:o.mobile}},[s,O]),B=e?.footerMode??t.footerMode,v=B==="scroll"||d&&B!=="fixed",V=m(()=>{if(typeof e?.header=="function")return n(u,{children:n(e.header,{})});if(typeof t.header=="function")return n(u,{children:t.header()});let o=d?e?.mobile?.header||t.mobile?.header||e?.header||t.header:e?.header||t.header;if(o&&typeof o=="object"){let a=d&&e?.mobile?.header?.start!==void 0?e.mobile.header.start:d&&t.mobile?.header?.start!==void 0?t.mobile.header.start:e?.header&&typeof e.header=="object"&&e.header.start!==void 0?e.header.start:t.header?.start??r.header.start,p=d&&e?.mobile?.header?.center!==void 0?e.mobile.header.center:d&&t.mobile?.header?.center!==void 0?t.mobile.header.center:e?.header&&typeof e.header=="object"&&e.header.center!==void 0?e.header.center:t.header?.center??r.header.center,P=d&&e?.mobile?.header?.end!==void 0?e.mobile.header.end:d&&t.mobile?.header?.end!==void 0?t.mobile.header.end:e?.header&&typeof e.header=="object"&&e.header.end!==void 0?e.header.end:t.header?.end??r.header.end;return n(u,{start:a(),center:p(),end:P()})}let h=d?t.mobile?.header?.start??t.header?.start??r.header.start:t.header?.start??r.header.start,b=d?t.mobile?.header?.center??t.header?.center??r.header.center:t.header?.center??r.header.center,i=d?t.mobile?.header?.end??t.header?.end??r.header.end:t.header?.end??r.header.end;return n(u,{start:h(),center:b(),end:i()})},[e?.header,e?.mobile?.header,t,d]),X=m(()=>{if(typeof e?.sidebar=="function")return n(g,{children:n(e.sidebar,{})});if(typeof t.sidebar=="function")return n(g,{children:t.sidebar()});if(e?.sidebar&&typeof e.sidebar=="object"){let i=e.sidebar.top!==void 0?e.sidebar.top:t.sidebar?.top??r.sidebar.top,a=e.sidebar.content!==void 0?e.sidebar.content:t.sidebar?.content??r.sidebar.content,p=e.sidebar.bottom!==void 0?e.sidebar.bottom:t.sidebar?.bottom??r.sidebar.bottom;return n(g,{top:i(),content:a(),bottom:p(),defaultWidth:t.sidebar?.defaultWidth??r.sidebar.defaultWidth,minWidth:t.sidebar?.minWidth??r.sidebar.minWidth,maxWidth:t.sidebar?.maxWidth??r.sidebar.maxWidth})}let o=t.sidebar?.top??r.sidebar.top,h=t.sidebar?.content??r.sidebar.content,b=t.sidebar?.bottom??r.sidebar.bottom;return n(g,{top:o(),content:h(),bottom:b(),defaultWidth:t.sidebar?.defaultWidth??r.sidebar.defaultWidth,minWidth:t.sidebar?.minWidth??r.sidebar.minWidth,maxWidth:t.sidebar?.maxWidth??r.sidebar.maxWidth})},[e?.sidebar,t.sidebar]),I=m(()=>e?.footer?n(E,{children:n(e.footer,{})}):t.footer===null?null:typeof t.footer=="function"?n(E,{children:t.footer()}):n(E,{app:M}),[e?.footer,t.footer,M]),j=m(()=>{if(!t.mobile?.mergedBar)return null;if(typeof e?.mergedbar=="function")return n(e.mergedbar,{});let o=t.mobile.mergedBar,h=typeof t.header=="object"?t.header:void 0,b=typeof t.sidebar=="object"?t.sidebar:void 0,i=e?.sidebar&&typeof e.sidebar=="object"?e.sidebar:void 0,a=e?.mobile?.sidebar;if(e?.mergedbar&&typeof e.mergedbar=="object"){let K=e.mergedbar.trigger!==void 0?e.mergedbar.trigger:o.trigger??h?.start??r.header.start,Q=e.mergedbar.top!==void 0?e.mergedbar.top:a?.top??i?.top??o.top??r.mobile.mergedBar.top,Z=e.mergedbar.content!==void 0?e.mergedbar.content:a?.content??i?.content??o.content??b?.content??r.sidebar.content,$=e.mergedbar.bottom!==void 0?e.mergedbar.bottom:a?.bottom??i?.bottom??o.bottom??b?.bottom??r.sidebar.bottom;return n(F,{position:o.position,height:o.height,trigger:K(),top:Q(),content:Z(),bottom:$()})}let p=o.trigger??h?.start??r.header.start,P=a?.top??i?.top??o.top??r.mobile.mergedBar.top,J=a?.content??i?.content??o.content??b?.content??r.sidebar.content,q=a?.bottom??i?.bottom??o.bottom??b?.bottom??r.sidebar.bottom;return n(F,{position:o.position,height:o.height,trigger:p(),top:P(),content:J(),bottom:q()})},[e?.mergedbar,e?.sidebar,e?.mobile?.sidebar,t]);x(()=>{if(!H()||!D.current)return;let o=getComputedStyle(document.documentElement).getPropertyValue("--routing-animation").trim()||"none";D.current.setAttribute("data-routing-animation",o)},[w]);let z=s?fe[s]||c.STANDARD:void 0;return x(()=>{if(!H()||!s)return;te(()=>{document.documentElement.setAttribute("data-layout",s)})},[s]),G("div",{className:oe("dndev-layout",U),"data-layout":s||void 0,"data-density":z,"data-footer-inline":v||void 0,"data-has-mergedbar":j?"":void 0,children:[V,X,G("main",{ref:D,role:"main",className:"main",children:[N!=="never"&&!k&&n("div",{className:"breadcrumbs-container",children:n(be,{variant:N==="always"?"default":"smart"})}),_&&n(ee,{fallback:null,children:n(me,{})}),e?.wrapper?e.wrapper({children:R}):R,v&&I]}),!v&&I,j,n(ce,{})]})};export{Re as DnDevLayout};
|
|
@@ -12,6 +12,11 @@ import type { ComponentType } from 'react';
|
|
|
12
12
|
* - Speculation Rules API
|
|
13
13
|
* - BreadcrumbList + WebSite JSON-LD
|
|
14
14
|
* - 100% Lighthouse SEO compliance
|
|
15
|
+
* - Inside a NotFoundDocument (the 404, served for any unknown URL): site-level tags
|
|
16
|
+
* only, titled with the site name; nothing derived from the URL
|
|
17
|
+
* - Vite prerendered page (static HTML the build wrote: static route, blog post, entity
|
|
18
|
+
* record): the identity tags the build embedded, exactly the prerendered ones; elsewhere
|
|
19
|
+
* `routeSeo` / `routeHeadTags` (@donotdev/core), the derivation the build uses
|
|
15
20
|
*/
|
|
16
21
|
export declare const AutoMetaTags: ComponentType;
|
|
17
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoMetaTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/AutoMetaTags.tsx"],"names":[],"mappings":"AAuBA,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":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAmM3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,YAAY,EAAE,aAqM1B,CAAC;AAEF;;;GAGG;AAEH,eAAe,YAAY,CAAC"}
|