@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,52 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
// packages/ui/src/internal/layout/config/presets/moolti.tsx
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview Moolti Preset Configuration
|
|
5
|
-
* @description SaaS app layout with sidebar only (no header/footer zones).
|
|
6
|
-
* All UI in sidebar for focused productivity.
|
|
7
|
-
*
|
|
8
|
-
* @version 0.1.0
|
|
9
|
-
* @since 0.0.1
|
|
10
|
-
* @author AMBROISE PARK Consulting
|
|
11
|
-
*/
|
|
12
|
-
import { DISPLAY, Stack } from '@donotdev/components';
|
|
13
|
-
import { LanguageSelector } from '@donotdev/core';
|
|
14
|
-
import { AuthHeader } from '../../../../components/auth';
|
|
15
|
-
import { AppBranding, ThemeToggle, } from '../../../../components/layout/components';
|
|
16
|
-
import { DnDevNavigationMenu, GoTo } from '../../../../routing';
|
|
17
|
-
import { FooterCopyright, FooterLegalLinks } from '../../components';
|
|
18
|
-
const sidebarTop = () => _jsx(AppBranding, { display: DISPLAY.AUTO });
|
|
19
|
-
const sidebarContent = () => (_jsxs(_Fragment, { children: [_jsx(GoTo, { display: DISPLAY.AUTO }), _jsx(DnDevNavigationMenu, { vertical: true, display: DISPLAY.AUTO })] }));
|
|
20
|
-
const sidebarBottom = () => (_jsxs(Stack, { direction: "column", gap: "tight", align: "stretch", children: [_jsx(AuthHeader, { display: DISPLAY.AUTO }), _jsx(LanguageSelector, { display: DISPLAY.AUTO }), _jsx(ThemeToggle, { display: DISPLAY.AUTO }), _jsx(FooterLegalLinks, { direction: "column" }), _jsx(FooterCopyright, {})] }));
|
|
21
|
-
/**
|
|
22
|
-
* Moolti preset - SaaS app layout
|
|
23
|
-
*
|
|
24
|
-
* Zones:
|
|
25
|
-
* - No header zone (branding in sidebar)
|
|
26
|
-
* - Sidebar: AppIcon + AppTitle top, GoTo + navigation, settings/footer at bottom
|
|
27
|
-
* - No footer zone (footer content in sidebar)
|
|
28
|
-
*
|
|
29
|
-
* Mobile behavior:
|
|
30
|
-
* - MergedBar at top (64px trigger → sheet)
|
|
31
|
-
* - Full sidebar content in sheet
|
|
32
|
-
*/
|
|
33
|
-
export const mooltiPreset = {
|
|
34
|
-
name: 'moolti',
|
|
35
|
-
sidebar: {
|
|
36
|
-
top: sidebarTop,
|
|
37
|
-
content: sidebarContent,
|
|
38
|
-
bottom: sidebarBottom,
|
|
39
|
-
defaultWidth: 256,
|
|
40
|
-
minWidth: 48,
|
|
41
|
-
maxWidth: 400,
|
|
42
|
-
},
|
|
43
|
-
mobile: {
|
|
44
|
-
mergedBar: {
|
|
45
|
-
position: 'top',
|
|
46
|
-
trigger: sidebarTop,
|
|
47
|
-
top: () => null,
|
|
48
|
-
content: sidebarContent,
|
|
49
|
-
bottom: sidebarBottom,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
};
|
|
1
|
+
import{DISPLAY as t,Stack as m}from"@donotdev/components";import{LanguageSelector as a}from"@donotdev/core";import{AuthHeader as p}from"../../../../components/auth/index.js";import{AppBranding as d,ThemeToggle as l}from"../../../../components/layout/components/index.js";import{DnDevNavigationMenu as s,GoTo as g}from"../../../../routing/index.js";import{FooterCopyright as c,FooterLegalLinks as f}from"../../components/index.js";import{Fragment as T,jsx as o,jsxs as n}from"react/jsx-runtime";var i=()=>o(d,{display:t.AUTO}),e=()=>n(T,{children:[o(g,{display:t.AUTO}),o(s,{vertical:!0,display:t.AUTO})]}),r=()=>n(m,{direction:"column",gap:"tight",align:"stretch",children:[o(p,{display:t.AUTO}),o(a,{display:t.AUTO}),o(l,{display:t.AUTO}),o(f,{direction:"column"}),o(c,{})]}),U={name:"moolti",sidebar:{top:i,content:e,bottom:r,defaultWidth:256,minWidth:48,maxWidth:400},mobile:{mergedBar:{position:"top",trigger:i,top:()=>null,content:e,bottom:r}}};export{U as mooltiPreset};
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Plain preset - no UI chrome, full viewport for content.
|
|
4
|
-
*
|
|
5
|
-
* Use cases:
|
|
6
|
-
* - Embedded widgets and iframes
|
|
7
|
-
* - Full-screen applications
|
|
8
|
-
* - Presentation modes
|
|
9
|
-
* - Modal overlays
|
|
10
|
-
* - Single-purpose utilities
|
|
11
|
-
*/
|
|
12
|
-
export const plainPreset = {
|
|
13
|
-
name: 'plain',
|
|
14
|
-
header: {
|
|
15
|
-
start: () => null,
|
|
16
|
-
center: () => null,
|
|
17
|
-
end: () => null,
|
|
18
|
-
},
|
|
19
|
-
sidebar: {
|
|
20
|
-
top: () => null,
|
|
21
|
-
content: () => null,
|
|
22
|
-
bottom: () => null,
|
|
23
|
-
},
|
|
24
|
-
footer: null,
|
|
25
|
-
};
|
|
1
|
+
var e={name:"plain",header:{start:()=>null,center:()=>null,end:()=>null},sidebar:{top:()=>null,content:()=>null,bottom:()=>null},footer:null};export{e as plainPreset};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// packages/ui/src/internal/layout/renderers/index.ts
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview Layout Renderers Barrel Exports
|
|
5
|
-
* @description Exports for layout rendering system.
|
|
6
|
-
*
|
|
7
|
-
* @version 0.1.0
|
|
8
|
-
* @since 0.0.1
|
|
9
|
-
* @author AMBROISE PARK Consulting
|
|
10
|
-
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DnDevFooter.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/zones/DnDevFooter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DnDevFooter.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/zones/DnDevFooter.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAalD,MAAM,WAAW,gBAAgB;IAC/B,wGAAwG;IACxG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,uCAAuC;IACvC,GAAG,CAAC,EAAE,WAAW,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,oBAAoB,CAAC,EAC5B,QAAQ,EACR,GAAQ,GACT,EAAE,gBAAgB,GAAG,SAAS,CAwF9B;AAED,eAAO,MAAM,WAAW,kEAA6B,CAAC"}
|
|
@@ -1,67 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
// packages/ui/src/internal/layout/zones/DnDevFooter.tsx
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview DnDevFooter Zone Component
|
|
5
|
-
* @description Footer zone with smart defaults.
|
|
6
|
-
*
|
|
7
|
-
* Default layout: Stack(FooterCopyright, FooterLegalLinks, FooterBranding)
|
|
8
|
-
* - Desktop: 2-zone [Copyright] | [Links + Branding]
|
|
9
|
-
* - Mobile: 2-line stacked, centered
|
|
10
|
-
*
|
|
11
|
-
* @version 0.1.0
|
|
12
|
-
* @since 0.0.1
|
|
13
|
-
* @author AMBROISE PARK Consulting
|
|
14
|
-
*/
|
|
15
|
-
import { memo } from 'react';
|
|
16
|
-
import { Stack } from '@donotdev/components';
|
|
17
|
-
import { useBreakpoint, useTranslation, maybeTranslate } from '@donotdev/core';
|
|
18
|
-
import { Link } from '../../../routing/Link';
|
|
19
|
-
import { FooterBranding } from '../components/footer/FooterBranding';
|
|
20
|
-
import { getLegalLinks, } from '../components/footer/useLegalLinks';
|
|
21
|
-
/**
|
|
22
|
-
* DnDevFooter - Simple footer: Copyright (left) | LegalLinks + DoNotDev (right)
|
|
23
|
-
*
|
|
24
|
-
* DoNotDev branding is ALWAYS appended and cannot be removed.
|
|
25
|
-
* Footer is automatically configured from app.footer config.
|
|
26
|
-
*
|
|
27
|
-
* Configuration precedence:
|
|
28
|
-
* 1. app.footer === null -> render nothing
|
|
29
|
-
* 2. app.footer.copyright === null -> hide copyright
|
|
30
|
-
* 3. app.footer.copyright === undefined -> default copyright
|
|
31
|
-
* 4. app.footer.copyright === string -> custom copyright
|
|
32
|
-
* 5. LegalLinks from app.footer.legalLinks (defaults if undefined)
|
|
33
|
-
* 6. DoNotDev branding always appended
|
|
34
|
-
*
|
|
35
|
-
* @critical The `<footer>` MUST have `role="contentinfo"` and className `"footer"`.
|
|
36
|
-
* ALL footer CSS in layout-variables.css targets `footer[role='contentinfo']`.
|
|
37
|
-
* This controls: grid placement, height, border, footer-mode scroll behavior,
|
|
38
|
-
* preset-specific visibility (moolti/plain hide footer, blog hides on mobile).
|
|
39
|
-
* DO NOT change role, tag, or className.
|
|
40
|
-
*/
|
|
41
|
-
function DnDevFooterComponent({ children, app = {}, }) {
|
|
42
|
-
const { t } = useTranslation('dndev');
|
|
43
|
-
const isLaptopOrDesktop = useBreakpoint('isLaptopOrDesktop');
|
|
44
|
-
// Get legal links (defaults or custom) — must be called before any return
|
|
45
|
-
const links = getLegalLinks(app?.footer);
|
|
46
|
-
// Custom mode: consumer owns zone visuals, structural wrapper only
|
|
47
|
-
if (children !== undefined) {
|
|
48
|
-
return (_jsx("footer", { role: "contentinfo", className: "footer", "data-custom": true, children: children }));
|
|
49
|
-
}
|
|
50
|
-
// Explicit null hides footer
|
|
51
|
-
if (app?.footer === null) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
// Copyright: null = hide, undefined = default, string = custom
|
|
55
|
-
const copyrightConfig = app.footer?.copyright;
|
|
56
|
-
const showCopyright = copyrightConfig !== null;
|
|
57
|
-
const copyrightText = copyrightConfig === undefined
|
|
58
|
-
? `© ${new Date().getFullYear()} ${app.name || 'App'}. ${t('footer.legal.allRightsReserved')}`
|
|
59
|
-
: copyrightConfig;
|
|
60
|
-
// Desktop/Wide: 2-zone layout [Copyright] | [Links + DoNotDev]
|
|
61
|
-
if (isLaptopOrDesktop) {
|
|
62
|
-
return (_jsx("footer", { role: "contentinfo", className: "footer", children: _jsxs(Stack, { direction: "row", align: "center", justify: "between", gap: "none", children: [showCopyright && (_jsx("div", { style: { display: 'flex', justifyContent: 'flex-start' }, children: _jsx("span", { className: "footer-copyright", children: copyrightText }) })), _jsx("div", { style: { display: 'flex', justifyContent: 'flex-end' }, children: _jsxs(Stack, { direction: "row", align: "center", children: [links.map((link) => (_jsx(Link, { path: link.path, style: { fontSize: 'var(--font-size-xs)' }, children: maybeTranslate(t, link.label) }, link.path))), _jsx(FooterBranding, {})] }) })] }) }));
|
|
63
|
-
}
|
|
64
|
-
// Mobile/Tablet: stacked layout
|
|
65
|
-
return (_jsx("footer", { role: "contentinfo", className: "footer", children: _jsxs(Stack, { align: "center", gap: "tight", children: [showCopyright && (_jsx("span", { className: "footer-copyright", children: copyrightText })), _jsxs(Stack, { direction: "row", wrap: "wrap", gap: "tight", justify: "center", align: "center", children: [links.map((link) => (_jsx(Link, { path: link.path, style: { fontSize: 'var(--font-size-xs)' }, children: maybeTranslate(t, link.label) }, link.path))), _jsx(FooterBranding, {})] })] }) }));
|
|
66
|
-
}
|
|
67
|
-
export const DnDevFooter = memo(DnDevFooterComponent);
|
|
1
|
+
"use client";import{memo as u}from"react";import{Stack as r}from"@donotdev/components";import{useBreakpoint as h,useTranslation as k,maybeTranslate as l}from"@donotdev/core";import{useCookieNoticeRequired as v}from"../../../components/cookie-consent/useCookieNoticeRequired.js";import{Link as m}from"../../../routing/Link.js";import{FooterBranding as d}from"../components/footer/FooterBranding.js";import{getLegalLinks as L}from"../components/footer/useLegalLinks.js";import{jsx as e,jsxs as n}from"react/jsx-runtime";function D({children:s,app:o={}}){let{t:a}=k("dndev"),g=h("isLaptopOrDesktop"),y=v(),p=L(o?.footer,y);if(s!==void 0)return e("footer",{role:"contentinfo",className:"footer","data-custom":!0,children:s});if(o?.footer===null)return null;let i=o.footer?.copyright,f=i!==null,c=i===void 0?`\xA9 ${new Date().getFullYear()} ${o.name||"App"}. ${a("footer.legal.allRightsReserved")}`:i;return g?e("footer",{role:"contentinfo",className:"footer",children:n(r,{direction:"row",align:"center",justify:"between",gap:"none",children:[f&&e("div",{style:{display:"flex",justifyContent:"flex-start"},children:e("span",{className:"footer-copyright",children:c})}),e("div",{style:{display:"flex",justifyContent:"flex-end"},children:n(r,{direction:"row",align:"center",children:[p.map(t=>e(m,{path:t.path,style:{fontSize:"var(--font-size-xs)"},children:l(a,t.label)},t.path)),e(d,{})]})})]})}):e("footer",{role:"contentinfo",className:"footer",children:n(r,{align:"center",gap:"tight",children:[f&&e("span",{className:"footer-copyright",children:c}),n(r,{direction:"row",wrap:"wrap",gap:"tight",justify:"center",align:"center",children:[p.map(t=>e(m,{path:t.path,style:{fontSize:"var(--font-size-xs)"},children:l(a,t.label)},t.path)),e(d,{})]})]})})}var b=u(D);export{b as DnDevFooter};
|
|
@@ -1,41 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
// packages/ui/src/internal/layout/zones/DnDevHeader.tsx
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview DnDevHeader Zone Component
|
|
5
|
-
* @description Header zone with smart defaults.
|
|
6
|
-
*
|
|
7
|
-
* Layout: start (start-aligned) | center (absolutely centered) | end (end-aligned)
|
|
8
|
-
* - start: [AppIcon, AppTitle] - start-aligned
|
|
9
|
-
* - center: null - absolutely centered overlay (regardless of start/end content)
|
|
10
|
-
* - end: [GoTo, Auth, Language, Theme] - end-aligned
|
|
11
|
-
*
|
|
12
|
-
* @version 0.1.0
|
|
13
|
-
* @since 0.0.1
|
|
14
|
-
* @author AMBROISE PARK Consulting
|
|
15
|
-
*/
|
|
16
|
-
import { memo } from 'react';
|
|
17
|
-
import { cn } from '@donotdev/components';
|
|
18
|
-
/**
|
|
19
|
-
* DnDevHeader - Header zone with smart defaults
|
|
20
|
-
*
|
|
21
|
-
* Layout: start (start-aligned) | center (absolutely centered) | end (end-aligned)
|
|
22
|
-
* Center is absolutely positioned overlay, independent of start/end content.
|
|
23
|
-
*
|
|
24
|
-
* @critical The `<header>` MUST have `role="banner"` and className `"header"`.
|
|
25
|
-
* ALL header CSS in layout-variables.css targets `header[role='banner']`.
|
|
26
|
-
* The inner divs MUST use classNames `"header-start"`, `"header-center"`, `"header-end"`.
|
|
27
|
-
* Removing or renaming any of these silently breaks header layout, spacing, visibility,
|
|
28
|
-
* and preset-specific rules (e.g. landing compact mode, mergedBar hiding).
|
|
29
|
-
* DO NOT change role, tag, or classNames.
|
|
30
|
-
*/
|
|
31
|
-
function DnDevHeaderComponent({ children, start, center, end, }) {
|
|
32
|
-
// Custom mode: children provided = consumer owns zone visuals
|
|
33
|
-
const isCustom = children !== undefined;
|
|
34
|
-
if (isCustom) {
|
|
35
|
-
return (_jsx("header", { role: "banner", className: "header", "data-custom": true, children: children }));
|
|
36
|
-
}
|
|
37
|
-
// Slotted mode: framework slot layout with polish CSS
|
|
38
|
-
const hasCenter = center !== null && center !== undefined;
|
|
39
|
-
return (_jsxs("header", { role: "banner", className: "header", children: [_jsx("div", { className: "header-start", children: start }), hasCenter && _jsx("div", { className: "header-center", children: center }), _jsx("div", { className: "header-end", children: end })] }));
|
|
40
|
-
}
|
|
41
|
-
export const DnDevHeader = memo(DnDevHeaderComponent);
|
|
1
|
+
import{memo as t}from"react";import"@donotdev/components";import{jsx as e,jsxs as c}from"react/jsx-runtime";function s({children:r,start:d,center:a,end:n}){if(r!==void 0)return e("header",{role:"banner",className:"header","data-custom":!0,children:r});let o=a!=null;return c("header",{role:"banner",className:"header",children:[e("div",{className:"header-start",children:d}),o&&e("div",{className:"header-center",children:a}),e("div",{className:"header-end",children:n})]})}var N=t(s);export{N as DnDevHeader};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DnDevMergedBar.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/zones/DnDevMergedBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DnDevMergedBar.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/zones/DnDevMergedBar.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAavC,MAAM,WAAW,mBAAmB;IAClC,mBAAmB;IACnB,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC3B,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,4DAA4D;IAC5D,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACvB,gEAAgE;IAChE,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;;;;;;;;;GAcG;AACH,iBAAS,uBAAuB,CAAC,EAC/B,QAAQ,EACR,MAAM,EACN,OAAO,EACP,GAAG,EACH,OAAO,EACP,MAAM,GACP,EAAE,mBAAmB,GAAG,SAAS,CAgEjC;AAED,eAAO,MAAM,cAAc,qEAAgC,CAAC"}
|
|
@@ -1,52 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
// packages/ui/src/internal/layout/zones/DnDevMergedBar.tsx
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview DnDevMergedBar Zone Component
|
|
5
|
-
* @description Mobile navigation bar with Sheet trigger.
|
|
6
|
-
*
|
|
7
|
-
* Position: fixed (top or bottom)
|
|
8
|
-
* Slots: trigger (visible bar) + top/content/bottom (Sheet content)
|
|
9
|
-
* CSS: display:none on desktop, display:flex on mobile
|
|
10
|
-
*
|
|
11
|
-
* @version 0.1.0
|
|
12
|
-
* @since 0.0.1
|
|
13
|
-
* @author AMBROISE PARK Consulting
|
|
14
|
-
*/
|
|
15
|
-
import { ChevronUp, Menu } from 'lucide-react';
|
|
16
|
-
import { memo, useState, useEffect } from 'react';
|
|
17
|
-
import { Stack, Button, Sheet, BUTTON_VARIANT, Separator, SEPARATOR_VARIANT, } from '@donotdev/components';
|
|
18
|
-
import { useTranslation } from '@donotdev/core';
|
|
19
|
-
import { useRoutePath } from '@donotdev/ui/routing/hooks';
|
|
20
|
-
/**
|
|
21
|
-
* DnDevMergedBar - Mobile navigation zone
|
|
22
|
-
*
|
|
23
|
-
* Renders position:fixed bar that CSS toggles.
|
|
24
|
-
* Slots are customizable per-preset with smart defaults:
|
|
25
|
-
* - trigger: What shows in the fixed bar (default: header.start or AppBranding)
|
|
26
|
-
* - top/content/bottom: Sheet content (default: derived from sidebar)
|
|
27
|
-
*
|
|
28
|
-
* @critical The outer `<div>` MUST have className `"merged-bar"` and `data-position`.
|
|
29
|
-
* ALL mergedBar CSS in layout-variables.css targets `.merged-bar` and `.merged-bar[data-position]`.
|
|
30
|
-
* This controls: position:fixed placement, display:none/flex toggling per preset + breakpoint,
|
|
31
|
-
* safe area padding, border, and z-index. Inner divs MUST keep `"merged-bar-trigger"`,
|
|
32
|
-
* `"merged-bar-sheet-content"`, `"merged-bar-sheet-scroll"` classNames.
|
|
33
|
-
* DO NOT change classNames or data attributes.
|
|
34
|
-
*/
|
|
35
|
-
function DnDevMergedBarComponent({ position, height, trigger, top, content, bottom, }) {
|
|
36
|
-
const { t } = useTranslation('dndev');
|
|
37
|
-
const Icon = position === 'top' ? Menu : ChevronUp;
|
|
38
|
-
// Sheet component accepts 'left'|'right'|'top'|'bottom' (physical), not logical properties.
|
|
39
|
-
// For RTL apps, this would need Sheet to support 'start'/'end' sides — tracked separately.
|
|
40
|
-
const sheetSide = position === 'top' ? 'left' : position;
|
|
41
|
-
const [open, setOpen] = useState(false);
|
|
42
|
-
const pathname = useRoutePath();
|
|
43
|
-
// Close sheet when route changes
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
setOpen(false);
|
|
46
|
-
}, [pathname]);
|
|
47
|
-
// Build sheet content
|
|
48
|
-
const sheetNode = (_jsxs(Stack, { direction: "column", className: "merged-bar-sheet-content", children: [top && (_jsxs(_Fragment, { children: [top, _jsx(Separator, { variant: SEPARATOR_VARIANT.MUTED })] })), content && _jsx("div", { className: "merged-bar-sheet-scroll", children: content }), bottom && (_jsxs(_Fragment, { children: [_jsx(Separator, { variant: SEPARATOR_VARIANT.MUTED }), bottom] }))] }));
|
|
49
|
-
const triggerButton = (_jsx(Button, { variant: BUTTON_VARIANT.GHOST, icon: Icon, "aria-label": "Open navigation" }));
|
|
50
|
-
return (_jsx("div", { className: "merged-bar", "data-position": position, children: _jsxs(Stack, { direction: "row", align: "center", justify: "between", className: "merged-bar-trigger", children: [trigger, _jsx(Sheet, { trigger: triggerButton, side: sheetSide, open: open, onOpenChange: setOpen, title: t('sheet.navigation', { defaultValue: 'Navigation' }), children: sheetNode })] }) }));
|
|
51
|
-
}
|
|
52
|
-
export const DnDevMergedBar = memo(DnDevMergedBarComponent);
|
|
1
|
+
"use client";import{ChevronUp as R,Menu as D}from"lucide-react";import{memo as S,useState as T,useEffect as b}from"react";import{Stack as s,Button as B,Sheet as M,BUTTON_VARIANT as A,Separator as c,SEPARATOR_VARIANT as d}from"@donotdev/components";import{useTranslation as O}from"@donotdev/core";import{useRoutePath as E}from"@donotdev/ui/routing/hooks";import{Fragment as l,jsx as e,jsxs as o}from"react/jsx-runtime";function P({position:t,height:U,trigger:m,top:a,content:r,bottom:n}){let{t:g}=O("dndev"),p=t==="top"?D:R,u=t==="top"?"left":t,[v,i]=T(!1),f=E();b(()=>{i(!1)},[f]);let h=o(s,{direction:"column",className:"merged-bar-sheet-content",children:[a&&o(l,{children:[a,e(c,{variant:d.MUTED})]}),r&&e("div",{className:"merged-bar-sheet-scroll",children:r}),n&&o(l,{children:[e(c,{variant:d.MUTED}),n]})]}),N=e(B,{variant:A.GHOST,icon:p,"aria-label":"Open navigation"});return e("div",{className:"merged-bar","data-position":t,children:o(s,{direction:"row",align:"center",justify:"between",className:"merged-bar-trigger",children:[m,e(M,{trigger:N,side:u,open:v,onOpenChange:i,title:g("sheet.navigation",{defaultValue:"Navigation"}),children:h})]})})}var y=S(P);export{y as DnDevMergedBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DnDevSidebar.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/zones/DnDevSidebar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DnDevSidebar.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/zones/DnDevSidebar.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvC,MAAM,WAAW,iBAAiB;IAChC,2GAA2G;IAC3G,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4DAA4D;IAC5D,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACvB,gEAAgE;IAChE,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,iBAAS,qBAAqB,CAAC,EAC7B,QAAQ,EACR,GAAG,EACH,OAAO,EACP,MAAM,EACN,YAAiD,EACjD,QAAyC,EACzC,QAAyC,GAC1C,EAAE,iBAAiB,GAAG,SAAS,CA+M/B;AAED,eAAO,MAAM,YAAY,mEAA8B,CAAC"}
|
|
@@ -1,181 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
// packages/ui/src/internal/layout/zones/DnDevSidebar.tsx
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview DnDevSidebar Zone Component
|
|
5
|
-
* @description Flat sidebar zone with resize mechanics built-in.
|
|
6
|
-
*
|
|
7
|
-
* Structure: aside > nav + resize-handle
|
|
8
|
-
* No nesting. Resize logic on aside directly.
|
|
9
|
-
*
|
|
10
|
-
* Slots: top | content | bottom
|
|
11
|
-
*
|
|
12
|
-
* @version 0.1.0
|
|
13
|
-
* @since 0.0.1
|
|
14
|
-
* @author AMBROISE PARK Consulting
|
|
15
|
-
*/
|
|
16
|
-
import { memo, useRef, useEffect, useState } from 'react';
|
|
17
|
-
import { useLayout } from '@donotdev/core';
|
|
18
|
-
import { DEFAULT_SLOTS } from '../config/defaults';
|
|
19
|
-
/** Resize handle width - matches CSS variable --sidebar-resize-handle-width */
|
|
20
|
-
const RESIZE_HANDLE_WIDTH = 6;
|
|
21
|
-
/**
|
|
22
|
-
* DnDevSidebar - Flat sidebar zone with built-in resize
|
|
23
|
-
*
|
|
24
|
-
* Structure: aside.sidebar > nav.sidebar-nav + div.resize-handle
|
|
25
|
-
* Resize logic lives on aside directly. No wrapper components.
|
|
26
|
-
*
|
|
27
|
-
* @critical The `<aside>` MUST have `role="navigation"` — ALL CSS in layout-variables.css
|
|
28
|
-
* targets `aside[role='navigation'].sidebar`. Removing it silently breaks every sidebar feature.
|
|
29
|
-
* DO NOT remove or change role="navigation" under any circumstance.
|
|
30
|
-
*/
|
|
31
|
-
function DnDevSidebarComponent({ children, top, content, bottom, defaultWidth = DEFAULT_SLOTS.sidebar.defaultWidth, minWidth = DEFAULT_SLOTS.sidebar.minWidth, maxWidth = DEFAULT_SLOTS.sidebar.maxWidth, }) {
|
|
32
|
-
// Custom mode: children provided = consumer owns zone visuals, data-custom skips polish CSS
|
|
33
|
-
const isCustom = children !== undefined;
|
|
34
|
-
// Resize state
|
|
35
|
-
const sidebarWidth = useLayout('sidebarWidth') ?? defaultWidth;
|
|
36
|
-
const setSidebarWidth = useLayout('setSidebarWidth');
|
|
37
|
-
const [isDragging, setIsDragging] = useState(false);
|
|
38
|
-
const tempWidthRef = useRef(sidebarWidth);
|
|
39
|
-
const asideRef = useRef(null);
|
|
40
|
-
const lastCollapsedRef = useRef(sidebarWidth <= 100);
|
|
41
|
-
const pointerDownRef = useRef(false); // Track pointer down without starting drag
|
|
42
|
-
// Calculate total width (content + handle)
|
|
43
|
-
const totalWidth = sidebarWidth + RESIZE_HANDLE_WIDTH;
|
|
44
|
-
// Collapsed state for compact display mode
|
|
45
|
-
const isCollapsed = sidebarWidth <= 100;
|
|
46
|
-
// Sync CSS variable for sidebar width (total = content width + handle width)
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
document.documentElement.style.setProperty('--custom-sidebar-width', `${totalWidth}px`);
|
|
49
|
-
}, [totalWidth]);
|
|
50
|
-
// Pointer down handler - sets up drag listeners
|
|
51
|
-
const handlePointerDown = () => {
|
|
52
|
-
pointerDownRef.current = true;
|
|
53
|
-
const handleMove = (e) => {
|
|
54
|
-
// Start actual drag on first move (not on pointer down - prevents double-click interference)
|
|
55
|
-
if (pointerDownRef.current) {
|
|
56
|
-
pointerDownRef.current = false;
|
|
57
|
-
setIsDragging(true);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
const handleUp = () => {
|
|
61
|
-
pointerDownRef.current = false;
|
|
62
|
-
document.removeEventListener('pointermove', handleMove);
|
|
63
|
-
document.removeEventListener('pointerup', handleUp);
|
|
64
|
-
};
|
|
65
|
-
document.addEventListener('pointermove', handleMove);
|
|
66
|
-
document.addEventListener('pointerup', handleUp);
|
|
67
|
-
};
|
|
68
|
-
// Drag move/up handlers - only active when isDragging
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (!isDragging)
|
|
71
|
-
return;
|
|
72
|
-
const handleMove = (e) => {
|
|
73
|
-
requestAnimationFrame(() => {
|
|
74
|
-
if (!asideRef.current)
|
|
75
|
-
return;
|
|
76
|
-
// Calculate content width: mouse X - sidebar left - handle width
|
|
77
|
-
const sidebarLeft = asideRef.current.getBoundingClientRect().left;
|
|
78
|
-
const totalWidth = e.clientX - sidebarLeft;
|
|
79
|
-
const contentWidth = totalWidth - RESIZE_HANDLE_WIDTH;
|
|
80
|
-
const newWidth = Math.max(minWidth, Math.min(contentWidth, maxWidth));
|
|
81
|
-
tempWidthRef.current = newWidth;
|
|
82
|
-
document.documentElement.style.setProperty('--custom-sidebar-width', `${newWidth + RESIZE_HANDLE_WIDTH}px`);
|
|
83
|
-
// Live update collapsed state (no React re-render, just DOM attribute)
|
|
84
|
-
const newCollapsed = newWidth <= 100;
|
|
85
|
-
if (newCollapsed !== lastCollapsedRef.current) {
|
|
86
|
-
asideRef.current.dataset.collapsed = String(newCollapsed);
|
|
87
|
-
lastCollapsedRef.current = newCollapsed;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
const handleUp = () => {
|
|
92
|
-
setIsDragging(false);
|
|
93
|
-
setSidebarWidth(tempWidthRef.current);
|
|
94
|
-
};
|
|
95
|
-
document.addEventListener('pointermove', handleMove);
|
|
96
|
-
document.addEventListener('pointerup', handleUp);
|
|
97
|
-
return () => {
|
|
98
|
-
document.removeEventListener('pointermove', handleMove);
|
|
99
|
-
document.removeEventListener('pointerup', handleUp);
|
|
100
|
-
};
|
|
101
|
-
}, [isDragging, setSidebarWidth, minWidth, maxWidth]);
|
|
102
|
-
/**
|
|
103
|
-
* Measure content width by temporarily showing full content.
|
|
104
|
-
* Forces reflow but only on double-click/End key, so acceptable.
|
|
105
|
-
*/
|
|
106
|
-
const measureContentWidth = () => {
|
|
107
|
-
const aside = asideRef.current;
|
|
108
|
-
if (!aside)
|
|
109
|
-
return defaultWidth;
|
|
110
|
-
// Store original state (use ref for fresh value)
|
|
111
|
-
const wasCollapsed = aside.dataset.collapsed;
|
|
112
|
-
const originalWidth = aside.style.width;
|
|
113
|
-
// 1. Temporarily show full content (uncollapse)
|
|
114
|
-
aside.dataset.collapsed = 'false';
|
|
115
|
-
// 2. Let content flow naturally
|
|
116
|
-
aside.style.width = 'max-content';
|
|
117
|
-
// 3. Force layout recalc + measure
|
|
118
|
-
const contentWidth = aside.offsetWidth - RESIZE_HANDLE_WIDTH;
|
|
119
|
-
// 4. Restore original state
|
|
120
|
-
aside.style.width = originalWidth;
|
|
121
|
-
aside.dataset.collapsed = wasCollapsed ?? 'false';
|
|
122
|
-
// 5. Return clamped value
|
|
123
|
-
return Math.min(maxWidth, Math.max(minWidth, contentWidth));
|
|
124
|
-
};
|
|
125
|
-
/** Check if currently collapsed (reads directly from DOM - source of truth) */
|
|
126
|
-
const isCurrentlyCollapsed = () => {
|
|
127
|
-
return asideRef.current?.dataset.collapsed === 'true';
|
|
128
|
-
};
|
|
129
|
-
/** Toggle between collapsed and content-fit */
|
|
130
|
-
const toggleCollapse = () => {
|
|
131
|
-
if (isCurrentlyCollapsed()) {
|
|
132
|
-
// Collapsed → fit to content
|
|
133
|
-
setSidebarWidth(measureContentWidth());
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
// Expanded → collapse
|
|
137
|
-
setSidebarWidth(minWidth);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
// Keyboard resize
|
|
141
|
-
const handleKeyDown = (e) => {
|
|
142
|
-
switch (e.key) {
|
|
143
|
-
case 'ArrowLeft':
|
|
144
|
-
e.preventDefault();
|
|
145
|
-
setSidebarWidth(Math.max(minWidth, sidebarWidth - 16));
|
|
146
|
-
break;
|
|
147
|
-
case 'ArrowRight':
|
|
148
|
-
e.preventDefault();
|
|
149
|
-
setSidebarWidth(Math.min(maxWidth, sidebarWidth + 16));
|
|
150
|
-
break;
|
|
151
|
-
case 'Home':
|
|
152
|
-
e.preventDefault();
|
|
153
|
-
setSidebarWidth(minWidth);
|
|
154
|
-
break;
|
|
155
|
-
case 'End':
|
|
156
|
-
e.preventDefault();
|
|
157
|
-
setSidebarWidth(measureContentWidth());
|
|
158
|
-
break;
|
|
159
|
-
case 'Enter':
|
|
160
|
-
case ' ':
|
|
161
|
-
// Toggle on Enter/Space (same as double-click)
|
|
162
|
-
e.preventDefault();
|
|
163
|
-
toggleCollapse();
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
return (
|
|
168
|
-
/**
|
|
169
|
-
* CRITICAL: role="navigation" is required.
|
|
170
|
-
* ALL sidebar CSS selectors in layout-variables.css use `aside[role='navigation'].sidebar`.
|
|
171
|
-
* Removing role="navigation" breaks: grid placement, display:none for no-sidebar presets,
|
|
172
|
-
* resize handle styles, collapsed styles — essentially ALL sidebar behavior.
|
|
173
|
-
* aria-label provides the accessible name. Both attributes are required.
|
|
174
|
-
*/
|
|
175
|
-
_jsxs("aside", { ref: asideRef, role: "navigation", "aria-label": "Site navigation", className: "sidebar", "data-dragging": isDragging, "data-collapsed": isCollapsed, "data-custom": isCustom || undefined, children: [isCustom ? (
|
|
176
|
-
/* Custom mode: consumer component fills content area, no slot divs */
|
|
177
|
-
children) : (
|
|
178
|
-
/* Slotted mode: framework slot layout with polish CSS */
|
|
179
|
-
_jsxs(_Fragment, { children: [top && _jsx("div", { className: "sidebar-top", children: top }), _jsx("div", { className: "sidebar-content", children: content }), bottom && _jsx("div", { className: "sidebar-bottom", children: bottom })] })), _jsx("div", { className: "dndev-sidebar-resize-handle", onPointerDown: handlePointerDown, onDoubleClick: toggleCollapse, onKeyDown: handleKeyDown, role: "separator", "aria-label": "Resize sidebar. Double-click or Enter to toggle. Home to collapse, End to fit content.", "aria-valuenow": sidebarWidth, "aria-valuemin": minWidth, "aria-valuemax": maxWidth, "aria-orientation": "vertical", tabIndex: 0 })] }));
|
|
180
|
-
}
|
|
181
|
-
export const DnDevSidebar = memo(DnDevSidebarComponent);
|
|
1
|
+
"use client";import{memo as K,useRef as c,useEffect as W,useState as T}from"react";import{useLayout as M}from"@donotdev/core";import{DEFAULT_SLOTS as b}from"../config/defaults.js";import{Fragment as _,jsx as u,jsxs as k}from"react/jsx-runtime";var l=6;function U({children:h,top:D,content:P,bottom:E,defaultWidth:g=b.sidebar.defaultWidth,minWidth:n=b.sidebar.minWidth,maxWidth:s=b.sidebar.maxWidth}){let w=h!==void 0,a=M("sidebarWidth")??g,t=M("setSidebarWidth"),[m,R]=T(!1),y=c(a),r=c(null),L=c(a<=100),i=c(!1),C=a+l,x=a<=100;W(()=>{document.documentElement.style.setProperty("--custom-sidebar-width",`${C}px`)},[C]);let A=()=>{i.current=!0;let e=d=>{i.current&&(i.current=!1,R(!0))},o=()=>{i.current=!1,document.removeEventListener("pointermove",e),document.removeEventListener("pointerup",o)};document.addEventListener("pointermove",e),document.addEventListener("pointerup",o)};W(()=>{if(!m)return;let e=d=>{requestAnimationFrame(()=>{if(!r.current)return;let p=r.current.getBoundingClientRect().left,I=d.clientX-p-l,v=Math.max(n,Math.min(I,s));y.current=v,document.documentElement.style.setProperty("--custom-sidebar-width",`${v+l}px`);let f=v<=100;f!==L.current&&(r.current.dataset.collapsed=String(f),L.current=f)})},o=()=>{R(!1),t(y.current)};return document.addEventListener("pointermove",e),document.addEventListener("pointerup",o),()=>{document.removeEventListener("pointermove",e),document.removeEventListener("pointerup",o)}},[m,t,n,s]);let N=()=>{let e=r.current;if(!e)return g;let o=e.dataset.collapsed,d=e.style.width;e.dataset.collapsed="false",e.style.width="max-content";let p=e.offsetWidth-l;return e.style.width=d,e.dataset.collapsed=o??"false",Math.min(s,Math.max(n,p))},H=()=>r.current?.dataset.collapsed==="true",S=()=>{H()?t(N()):t(n)};return k("aside",{ref:r,role:"navigation","aria-label":"Site navigation",className:"sidebar","data-dragging":m,"data-collapsed":x,"data-custom":w||void 0,children:[w?h:k(_,{children:[D&&u("div",{className:"sidebar-top",children:D}),u("div",{className:"sidebar-content",children:P}),E&&u("div",{className:"sidebar-bottom",children:E})]}),u("div",{className:"dndev-sidebar-resize-handle",onPointerDown:A,onDoubleClick:S,onKeyDown:e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),t(Math.max(n,a-16));break;case"ArrowRight":e.preventDefault(),t(Math.min(s,a+16));break;case"Home":e.preventDefault(),t(n);break;case"End":e.preventDefault(),t(N());break;case"Enter":case" ":e.preventDefault(),S();break}},role:"separator","aria-label":"Resize sidebar. Double-click or Enter to toggle. Home to collapse, End to fit content.","aria-valuenow":a,"aria-valuemin":n,"aria-valuemax":s,"aria-orientation":"vertical",tabIndex:0})]})}var O=K(U);export{O as DnDevSidebar};
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview Zone Components Barrel Exports
|
|
4
|
-
* @description Layout zone components with smart defaults.
|
|
5
|
-
* Each zone renders its area and handles slot composition.
|
|
6
|
-
*
|
|
7
|
-
* @version 0.1.0
|
|
8
|
-
* @since 0.0.1
|
|
9
|
-
* @author AMBROISE PARK Consulting
|
|
10
|
-
*/
|
|
11
|
-
export { DnDevHeader } from './DnDevHeader';
|
|
12
|
-
export { DnDevSidebar } from './DnDevSidebar';
|
|
13
|
-
export { DnDevFooter } from './DnDevFooter';
|
|
14
|
-
export { DnDevMergedBar } from './DnDevMergedBar';
|
|
1
|
+
import{DnDevHeader as o}from"./DnDevHeader.js";import{DnDevSidebar as p}from"./DnDevSidebar.js";import{DnDevFooter as n}from"./DnDevFooter.js";import{DnDevMergedBar as a}from"./DnDevMergedBar.js";export{n as DnDevFooter,o as DnDevHeader,a as DnDevMergedBar,p as DnDevSidebar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationProvider.d.ts","sourceRoot":"","sources":["../../../src/internal/providers/NavigationProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NavigationProvider.d.ts","sourceRoot":"","sources":["../../../src/internal/providers/NavigationProvider.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAO5D;;GAEG;AACH,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAExD;;GAEG;AACH,UAAU,uBAAuB;IAC/B,6CAA6C;IAC7C,MAAM,EAAE,SAAS,CAAC;IAClB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,uBAAuB,qBAkBrE"}
|
|
@@ -1,71 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
// packages/ui/src/internal/providers/NavigationProvider.tsx
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview NavigationProvider - RouterProvider with Auto-Abort
|
|
5
|
-
* @description Wraps RouterProvider with automatic request cancellation and overlay closing on navigation
|
|
6
|
-
*
|
|
7
|
-
* This provider uses React Router v7's data router pattern (RouterProvider + createBrowserRouter).
|
|
8
|
-
* It automatically aborts pending requests and closes overlays when the user navigates to a new route,
|
|
9
|
-
* preventing memory leaks and race conditions.
|
|
10
|
-
*
|
|
11
|
-
* 🚨 CRITICAL: This component must NOT be lazy loaded
|
|
12
|
-
* - Uses React hooks (useEffect) and must load in the same chunk as React
|
|
13
|
-
* - Lazy loading causes "Invalid hook call" errors because React's dispatcher is null when chunk loads
|
|
14
|
-
* - Must be eagerly imported in ViteAppProviders to ensure React is available
|
|
15
|
-
*
|
|
16
|
-
* For current path/location, use `useLocation()` from '@donotdev/ui' directly.
|
|
17
|
-
* For route discovery/menus, use NavigationStore hooks directly.
|
|
18
|
-
*
|
|
19
|
-
* @version 0.1.0
|
|
20
|
-
* @since 0.0.1
|
|
21
|
-
* @author AMBROISE PARK Consulting
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```tsx
|
|
25
|
-
* const router = createAppRouter(HomePage);
|
|
26
|
-
* <NavigationProvider router={router}>
|
|
27
|
-
* <DnDevLayout />
|
|
28
|
-
* </NavigationProvider>
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
import React, { useEffect } from 'react';
|
|
32
|
-
import { RouterProvider } from 'react-router-dom';
|
|
33
|
-
import { useAbortControllerStore, useOverlayStore } from '@donotdev/core';
|
|
34
|
-
/**
|
|
35
|
-
* NavigationProvider - RouterProvider wrapper with auto-abort
|
|
36
|
-
*
|
|
37
|
-
* Automatically cancels pending requests and closes overlays when navigating.
|
|
38
|
-
* Uses React Router v7's data router pattern with navigation subscription.
|
|
39
|
-
*
|
|
40
|
-
* @param props - NavigationProvider props
|
|
41
|
-
* @returns RouterProvider with auto-abort functionality
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```tsx
|
|
45
|
-
* const router = createAppRouter(HomePage, '/app');
|
|
46
|
-
* <NavigationProvider router={router}>
|
|
47
|
-
* <DnDevLayout />
|
|
48
|
-
* </NavigationProvider>
|
|
49
|
-
* ```
|
|
50
|
-
*
|
|
51
|
-
* @version 0.1.0
|
|
52
|
-
* @since 0.0.1
|
|
53
|
-
* @author AMBROISE PARK Consulting
|
|
54
|
-
*/
|
|
55
|
-
export function NavigationProvider({ router }) {
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
// Subscribe to navigation events using router.subscribe()
|
|
58
|
-
// This replaces the useLocation() + useEffect pattern from the old implementation
|
|
59
|
-
const unsubscribe = router.subscribe(() => {
|
|
60
|
-
// When navigation occurs, abort all pending requests and close overlays
|
|
61
|
-
// This prevents memory leaks and race conditions
|
|
62
|
-
useAbortControllerStore.getState().abortAll();
|
|
63
|
-
useOverlayStore.getState().closeAll();
|
|
64
|
-
});
|
|
65
|
-
// Cleanup subscription on unmount
|
|
66
|
-
return unsubscribe;
|
|
67
|
-
}, [router]);
|
|
68
|
-
// RouterProvider manages its own children from the router configuration
|
|
69
|
-
// No need to render children prop (kept for backwards compatibility)
|
|
70
|
-
return _jsx(RouterProvider, { router: router });
|
|
71
|
-
}
|
|
1
|
+
"use client";import{useEffect as r}from"react";import{RouterProvider as t}from"react-router-dom";import{useAbortControllerStore as o,useOverlayStore as i}from"@donotdev/core";import{jsx as u}from"react/jsx-runtime";function f({router:e}){return r(()=>e.subscribe(()=>{o.getState().abortAll(),i.getState().closeAll()}),[e]),u(t,{router:e})}export{f as NavigationProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SentryInitializer.d.ts","sourceRoot":"","sources":["../../../src/internal/providers/SentryInitializer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SentryInitializer.d.ts","sourceRoot":"","sources":["../../../src/internal/providers/SentryInitializer.tsx"],"names":[],"mappings":"AAmBA;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAaxC"}
|
|
@@ -1,36 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview Sentry Initializer Component
|
|
4
|
-
* @description Initializes Sentry error tracking if configured
|
|
5
|
-
*
|
|
6
|
-
* Uses useLayoutEffect to initialize Sentry once on mount.
|
|
7
|
-
* Gracefully degrades if VITE_SENTRY_DSN or NEXT_PUBLIC_SENTRY_DSN is not set.
|
|
8
|
-
*
|
|
9
|
-
* @version 0.1.0
|
|
10
|
-
* @since 0.0.1
|
|
11
|
-
* @author AMBROISE PARK Consulting
|
|
12
|
-
*/
|
|
13
|
-
import { useLayoutEffect, useRef } from 'react';
|
|
14
|
-
import { initSentry } from '@donotdev/core';
|
|
15
|
-
/**
|
|
16
|
-
* SentryInitializer - Initializes Sentry error tracking
|
|
17
|
-
*
|
|
18
|
-
* Runs once on mount using useLayoutEffect (synchronous, before paint).
|
|
19
|
-
* Gracefully degrades if Sentry DSN is not configured.
|
|
20
|
-
*
|
|
21
|
-
* @version 0.1.0
|
|
22
|
-
* @since 0.0.1
|
|
23
|
-
* @author AMBROISE PARK Consulting
|
|
24
|
-
*/
|
|
25
|
-
export function SentryInitializer() {
|
|
26
|
-
const hasInitialized = useRef(false);
|
|
27
|
-
useLayoutEffect(() => {
|
|
28
|
-
if (hasInitialized.current)
|
|
29
|
-
return;
|
|
30
|
-
hasInitialized.current = true;
|
|
31
|
-
initSentry().catch(() => {
|
|
32
|
-
// Silently handle initialization errors - Sentry is optional
|
|
33
|
-
});
|
|
34
|
-
}, []);
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
1
|
+
"use client";import{useLayoutEffect as e,useRef as r}from"react";import{initSentry as n}from"@donotdev/core";function c(){let t=r(!1);return e(()=>{t.current||(t.current=!0,n().catch(()=>{}))},[]),null}export{c as SentryInitializer};
|