@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,61 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
// packages/ui/src/internal/devtools/components/ConfigTab.tsx
|
|
4
|
-
/**
|
|
5
|
-
* @fileoverview Config Tab Component
|
|
6
|
-
* @description Framework config and environment variables
|
|
7
|
-
*
|
|
8
|
-
* @version 0.1.0
|
|
9
|
-
* @since 0.0.1
|
|
10
|
-
* @author AMBROISE PARK Consulting
|
|
11
|
-
*/
|
|
12
|
-
import { Card, DescriptionList, Text, Badge, BADGE_VARIANT, Stack, } from '@donotdev/components';
|
|
13
|
-
import { getDndevConfig, getConfigSource } from '@donotdev/core';
|
|
14
|
-
import { MaskedValue } from './MaskedValue';
|
|
15
|
-
export const ConfigTab = () => {
|
|
16
|
-
const config = getDndevConfig();
|
|
17
|
-
const source = getConfigSource();
|
|
18
|
-
const envVars = config?.env || {};
|
|
19
|
-
if (!config) {
|
|
20
|
-
return (_jsx(Card, { title: "Config", subtitle: "Not available", children: _jsxs(Text, { className: "dndev-text-muted-foreground", children: ["Config not loaded. Source: ", source.source] }) }));
|
|
21
|
-
}
|
|
22
|
-
const frameworkItems = [
|
|
23
|
-
{
|
|
24
|
-
label: 'Platform',
|
|
25
|
-
value: _jsx(Badge, { variant: BADGE_VARIANT.SECONDARY, children: config.platform }),
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
label: 'Mode',
|
|
29
|
-
value: (_jsx(Badge, { variant: config.mode === 'development'
|
|
30
|
-
? BADGE_VARIANT.DEFAULT
|
|
31
|
-
: BADGE_VARIANT.SECONDARY, children: config.mode })),
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
label: 'Version',
|
|
35
|
-
value: (_jsx(Text, { className: "dndev-font-mono dndev-text-sm", children: config.version })),
|
|
36
|
-
},
|
|
37
|
-
];
|
|
38
|
-
const summaryItems = [
|
|
39
|
-
config.themes && {
|
|
40
|
-
label: 'Themes',
|
|
41
|
-
value: (_jsx(Text, { className: "dndev-font-mono dndev-text-sm", children: config.themes.discovered?.length || 0 })),
|
|
42
|
-
},
|
|
43
|
-
config.routes && {
|
|
44
|
-
label: 'Routes',
|
|
45
|
-
value: (_jsx(Text, { className: "dndev-font-mono dndev-text-sm", children: config.routes.mapping?.length || 0 })),
|
|
46
|
-
},
|
|
47
|
-
config.i18n && {
|
|
48
|
-
label: 'Languages',
|
|
49
|
-
value: (_jsx(Text, { className: "dndev-font-mono dndev-text-sm", children: config.i18n.languages?.join(', ') })),
|
|
50
|
-
},
|
|
51
|
-
config.features && {
|
|
52
|
-
label: 'Features',
|
|
53
|
-
value: (_jsx(Text, { className: "dndev-font-mono dndev-text-sm", children: config.features.available?.length || 0 })),
|
|
54
|
-
},
|
|
55
|
-
].filter((item) => Boolean(item));
|
|
56
|
-
const envItems = Object.entries(envVars).map(([key, value]) => ({
|
|
57
|
-
label: _jsx(Text, { className: "dndev-font-mono dndev-text-xs", children: key }),
|
|
58
|
-
value: _jsx(MaskedValue, { keyName: key, value: String(value) }),
|
|
59
|
-
}));
|
|
60
|
-
return (_jsxs(Stack, { style: { padding: 'var(--gap-md)' }, children: [_jsx(Card, { title: "Framework", subtitle: source.source, children: _jsx(DescriptionList, { items: frameworkItems }) }), summaryItems.length > 0 && (_jsx(Card, { title: "Discovery", children: _jsx(DescriptionList, { items: summaryItems }) })), envItems.length > 0 && (_jsx(Card, { title: "Environment", subtitle: `${envItems.length} variables`, children: _jsx(DescriptionList, { items: envItems }) }))] }));
|
|
61
|
-
};
|
|
1
|
+
"use client";import{Card as o,DescriptionList as l,Text as n,Badge as i,BADGE_VARIANT as m,Stack as f}from"@donotdev/components";import{getDndevConfig as p,getConfigSource as b}from"@donotdev/core";import{MaskedValue as x}from"./MaskedValue.js";import{jsx as e,jsxs as v}from"react/jsx-runtime";var h=()=>{let t=p(),d=b(),u=t?.env||{};if(!t)return e(o,{title:"Config",subtitle:"Not available",children:v(n,{className:"dndev-text-muted-foreground",children:["Config not loaded. Source: ",d.source]})});let c=[{label:"Platform",value:e(i,{variant:m.SECONDARY,children:t.platform})},{label:"Mode",value:e(i,{variant:t.mode==="development"?m.DEFAULT:m.SECONDARY,children:t.mode})},{label:"Version",value:e(n,{className:"dndev-font-mono dndev-text-sm",children:t.version})}],r=[t.themes&&{label:"Themes",value:e(n,{className:"dndev-font-mono dndev-text-sm",children:t.themes.discovered?.length||0})},t.routes&&{label:"Routes",value:e(n,{className:"dndev-font-mono dndev-text-sm",children:t.routes.mapping?.length||0})},t.i18n&&{label:"Languages",value:e(n,{className:"dndev-font-mono dndev-text-sm",children:t.i18n.languages?.join(", ")})},t.features&&{label:"Features",value:e(n,{className:"dndev-font-mono dndev-text-sm",children:t.features.available?.length||0})}].filter(a=>!!a),s=Object.entries(u).map(([a,g])=>({label:e(n,{className:"dndev-font-mono dndev-text-xs",children:a}),value:e(x,{keyName:a,value:String(g)})}));return v(f,{style:{padding:"var(--gap-md)"},children:[e(o,{title:"Framework",subtitle:d.source,children:e(l,{items:c})}),r.length>0&&e(o,{title:"Discovery",children:e(l,{items:r})}),s.length>0&&e(o,{title:"Environment",subtitle:`${s.length} variables`,children:e(l,{items:s})})]})};export{h as ConfigTab};
|
|
@@ -1,156 +1 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
// packages/ui/src/internal/devtools/components/CookieTab.tsx
|
|
4
|
-
/**
|
|
5
|
-
* @fileoverview Cookie Debug Tab
|
|
6
|
-
* @description Comprehensive cookie consent debugging tools
|
|
7
|
-
*
|
|
8
|
-
* @version 0.1.0
|
|
9
|
-
* @since 0.0.1
|
|
10
|
-
* @author AMBROISE PARK Consulting
|
|
11
|
-
*/
|
|
12
|
-
import { RefreshCw, Trash2 } from 'lucide-react';
|
|
13
|
-
import { useState, useEffect } from 'react';
|
|
14
|
-
import { Button, BUTTON_VARIANT, Card, CopyToClipboard, Badge, Label, toast, DescriptionList, Text, Stack, } from '@donotdev/components';
|
|
15
|
-
import { useConsent, useConsentReady } from '@donotdev/core';
|
|
16
|
-
import { CONSENT_CATEGORY } from '@donotdev/core';
|
|
17
|
-
import { getCookie, deleteCookie } from '@donotdev/core';
|
|
18
|
-
const CONSENT_COOKIE_NAME = 'dndev-cookie-consent';
|
|
19
|
-
const formatJSON = (data) => {
|
|
20
|
-
try {
|
|
21
|
-
return JSON.stringify(data, null, 2);
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
return 'Error formatting data';
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
export const CookieTab = () => {
|
|
28
|
-
const hasConsented = useConsent('hasConsented');
|
|
29
|
-
const categories = useConsent('categories');
|
|
30
|
-
const timestamp = useConsent('timestamp');
|
|
31
|
-
const version = useConsent('version');
|
|
32
|
-
const reset = useConsent('reset');
|
|
33
|
-
const showCookieBanner = useConsent('showCookieBanner');
|
|
34
|
-
const isReady = useConsentReady();
|
|
35
|
-
const [cookieValue, setCookieValue] = useState(null);
|
|
36
|
-
const [domInfo, setDomInfo] = useState({});
|
|
37
|
-
const [zIndexInfo, setZIndexInfo] = useState({});
|
|
38
|
-
const refreshData = () => {
|
|
39
|
-
const cookie = getCookie(CONSENT_COOKIE_NAME);
|
|
40
|
-
setCookieValue(cookie);
|
|
41
|
-
toast('success', 'Data refreshed');
|
|
42
|
-
const cookieBanner = document.querySelector('[class*="cookie"]');
|
|
43
|
-
const dialogs = document.querySelectorAll('[role="dialog"]');
|
|
44
|
-
const overlays = document.querySelectorAll('[class*="overlay"]');
|
|
45
|
-
const portals = document.querySelectorAll('[data-radix-portal]');
|
|
46
|
-
setDomInfo({
|
|
47
|
-
cookieBanner: {
|
|
48
|
-
exists: !!cookieBanner,
|
|
49
|
-
visible: cookieBanner
|
|
50
|
-
? window.getComputedStyle(cookieBanner).display !== 'none'
|
|
51
|
-
: false,
|
|
52
|
-
zIndex: cookieBanner
|
|
53
|
-
? window.getComputedStyle(cookieBanner).zIndex
|
|
54
|
-
: null,
|
|
55
|
-
position: cookieBanner
|
|
56
|
-
? window.getComputedStyle(cookieBanner).position
|
|
57
|
-
: null,
|
|
58
|
-
classes: cookieBanner ? cookieBanner.className : null,
|
|
59
|
-
},
|
|
60
|
-
dialogs: {
|
|
61
|
-
count: dialogs.length,
|
|
62
|
-
open: Array.from(dialogs).filter((d) => d.getAttribute('data-state') === 'open').length,
|
|
63
|
-
elements: Array.from(dialogs).map((d) => ({
|
|
64
|
-
state: d.getAttribute('data-state'),
|
|
65
|
-
zIndex: window.getComputedStyle(d).zIndex,
|
|
66
|
-
})),
|
|
67
|
-
},
|
|
68
|
-
overlays: {
|
|
69
|
-
count: overlays.length,
|
|
70
|
-
visible: Array.from(overlays).filter((o) => window.getComputedStyle(o).display !== 'none').length,
|
|
71
|
-
zIndices: Array.from(overlays).map((o) => window.getComputedStyle(o).zIndex),
|
|
72
|
-
},
|
|
73
|
-
portals: {
|
|
74
|
-
count: portals.length,
|
|
75
|
-
elements: Array.from(portals).map((p) => ({
|
|
76
|
-
zIndex: window.getComputedStyle(p).zIndex,
|
|
77
|
-
children: p.children.length,
|
|
78
|
-
})),
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
const root = document.documentElement;
|
|
82
|
-
setZIndexInfo({
|
|
83
|
-
cssVariables: {
|
|
84
|
-
'--z-overlay': getComputedStyle(root).getPropertyValue('--z-overlay'),
|
|
85
|
-
'--z-modal': getComputedStyle(root).getPropertyValue('--z-modal'),
|
|
86
|
-
'--z-tooltip': getComputedStyle(root).getPropertyValue('--z-tooltip'),
|
|
87
|
-
'--z-toast': getComputedStyle(root).getPropertyValue('--z-toast'),
|
|
88
|
-
},
|
|
89
|
-
computed: {
|
|
90
|
-
cookieBanner: cookieBanner
|
|
91
|
-
? window.getComputedStyle(cookieBanner).zIndex
|
|
92
|
-
: 'N/A',
|
|
93
|
-
highestDialog: dialogs.length > 0
|
|
94
|
-
? Math.max(...Array.from(dialogs).map((d) => parseInt(window.getComputedStyle(d).zIndex || '0', 10)))
|
|
95
|
-
: 0,
|
|
96
|
-
highestOverlay: overlays.length > 0
|
|
97
|
-
? Math.max(...Array.from(overlays).map((o) => parseInt(window.getComputedStyle(o).zIndex || '0', 10)))
|
|
98
|
-
: 0,
|
|
99
|
-
},
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
useEffect(() => {
|
|
103
|
-
refreshData();
|
|
104
|
-
}, []);
|
|
105
|
-
const handleResetConsent = () => {
|
|
106
|
-
reset();
|
|
107
|
-
setTimeout(() => {
|
|
108
|
-
window.location.reload();
|
|
109
|
-
}, 100);
|
|
110
|
-
};
|
|
111
|
-
const handleClearCookie = () => {
|
|
112
|
-
deleteCookie(CONSENT_COOKIE_NAME);
|
|
113
|
-
refreshData();
|
|
114
|
-
toast('success', 'Cookie cleared');
|
|
115
|
-
};
|
|
116
|
-
const consentStateItems = [
|
|
117
|
-
{
|
|
118
|
-
label: 'Has Consented',
|
|
119
|
-
value: (_jsx(Badge, { variant: hasConsented ? 'default' : 'destructive', children: hasConsented ? '✅ Yes' : '❌ No' })),
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
label: 'Store Ready',
|
|
123
|
-
value: (_jsx(Badge, { variant: isReady ? 'default' : 'destructive', children: isReady ? '✅ Ready' : '❌ Not Ready' })),
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
label: 'Timestamp',
|
|
127
|
-
value: (_jsx(Text, { as: "span", className: "dndev-font-mono dndev-text-sm", children: timestamp || 'Never' })),
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
label: 'Version',
|
|
131
|
-
value: (_jsx(Text, { as: "span", className: "dndev-font-mono dndev-text-sm", children: version || 'N/A' })),
|
|
132
|
-
},
|
|
133
|
-
];
|
|
134
|
-
const categoryItems = Object.entries(CONSENT_CATEGORY).map(([key, value]) => ({
|
|
135
|
-
label: (_jsx(Text, { as: "span", className: "dndev-font-mono", children: key })),
|
|
136
|
-
value: (_jsx(Badge, { variant: categories[value] ? 'default' : 'destructive', children: categories[value] ? '✅ Enabled' : '❌ Disabled' })),
|
|
137
|
-
}));
|
|
138
|
-
return (_jsx(Stack, { gap: "large", children: _jsx(Card, { title: "Cookie Consent Debug", footer: _jsxs(Stack, { direction: "row", gap: "tight", children: [_jsx(Button, { onClick: refreshData, icon: RefreshCw, variant: BUTTON_VARIANT.OUTLINE, title: "Refresh Data", children: "Refresh" }), _jsx(Button, { onClick: handleResetConsent, icon: Trash2, variant: BUTTON_VARIANT.OUTLINE, title: "Reset Consent & Reload", children: "Reset & Reload" })] }), children: _jsxs(Stack, { gap: "large", children: [_jsx(Card, { title: _jsxs(Stack, { direction: "row", align: "center", justify: "between", className: "dndev-w-full", children: [_jsx("span", { children: "Consent State" }), _jsx(CopyToClipboard, { text: formatJSON({
|
|
139
|
-
hasConsented,
|
|
140
|
-
categories,
|
|
141
|
-
timestamp,
|
|
142
|
-
version,
|
|
143
|
-
}), variant: BUTTON_VARIANT.GHOST, onCopy: () => toast('success', 'Consent state copied') })] }), children: _jsx(DescriptionList, { items: consentStateItems }) }), _jsx(Card, { title: _jsxs(Stack, { direction: "row", align: "center", justify: "between", className: "dndev-w-full", children: [_jsx("span", { children: "Categories" }), _jsx(CopyToClipboard, { text: formatJSON(categories), variant: BUTTON_VARIANT.GHOST, onCopy: () => toast('success', 'Categories copied') })] }), children: _jsx(DescriptionList, { items: categoryItems }) }), _jsx(Card, { title: _jsxs(Stack, { direction: "row", align: "center", justify: "between", className: "dndev-w-full", children: [_jsx("span", { children: "Cookie Value" }), _jsxs(Stack, { direction: "row", gap: "tight", children: [_jsx(CopyToClipboard, { text: cookieValue || 'null', variant: BUTTON_VARIANT.GHOST, onCopy: () => toast('success', 'Cookie value copied') }), _jsx(Button, { onClick: handleClearCookie, icon: Trash2, variant: BUTTON_VARIANT.GHOST, title: "Clear Cookie", children: "Clear" })] })] }), children: _jsx("pre", { className: "dndev-overflow-y-auto dndev-font-mono dndev-text-xs dndev-max-h-60", children: cookieValue || 'No cookie found' }) }), _jsx(Card, { title: _jsxs(Stack, { direction: "row", align: "center", justify: "between", className: "dndev-w-full", children: [_jsx("span", { children: "DOM Elements" }), _jsx(CopyToClipboard, { text: formatJSON(domInfo), variant: BUTTON_VARIANT.GHOST, onCopy: () => toast('success', 'DOM info copied') })] }), children: _jsxs(Stack, { children: [_jsxs("div", { children: [_jsx(Label, { className: "dndev-font-semibold", children: "Cookie Banner:" }), _jsxs(Stack, { gap: "tight", className: "dndev-ml-md", children: [_jsxs(Text, { children: ["Exists: ", domInfo.cookieBanner?.exists ? '✅' : '❌'] }), _jsxs(Text, { children: ["Visible: ", domInfo.cookieBanner?.visible ? '✅' : '❌'] }), _jsxs(Text, { children: ["z-index: ", domInfo.cookieBanner?.zIndex || 'N/A'] }), _jsxs(Text, { children: ["Position: ", domInfo.cookieBanner?.position || 'N/A'] })] })] }), _jsxs("div", { children: [_jsx(Label, { className: "dndev-font-semibold", children: "Dialogs:" }), _jsxs(Stack, { gap: "tight", className: "dndev-ml-md", children: [_jsxs(Text, { children: ["Count: ", domInfo.dialogs?.count || 0] }), _jsxs(Text, { children: ["Open: ", domInfo.dialogs?.open || 0] })] })] }), _jsxs("div", { children: [_jsx(Label, { className: "dndev-font-semibold", children: "Overlays:" }), _jsxs(Stack, { gap: "tight", className: "dndev-ml-md", children: [_jsxs(Text, { children: ["Count: ", domInfo.overlays?.count || 0] }), _jsxs(Text, { children: ["Visible: ", domInfo.overlays?.visible || 0] })] })] }), _jsxs("div", { children: [_jsx(Label, { className: "dndev-font-semibold", children: "Portals:" }), _jsx(Stack, { gap: "tight", className: "dndev-ml-md", children: _jsxs(Text, { children: ["Count: ", domInfo.portals?.count || 0] }) })] })] }) }), _jsx(Card, { title: _jsxs(Stack, { direction: "row", align: "center", justify: "between", className: "dndev-w-full", children: [_jsx("span", { children: "Z-Index Stacking" }), _jsx(CopyToClipboard, { text: formatJSON(zIndexInfo), variant: BUTTON_VARIANT.GHOST, onCopy: () => toast('success', 'Z-index info copied') })] }), children: _jsxs(Stack, { children: [_jsxs("div", { children: [_jsx(Label, { className: "dndev-font-semibold", children: "CSS Variables:" }), _jsx(Stack, { gap: "tight", className: "dndev-ml-md dndev-font-mono dndev-text-sm", children: Object.entries(zIndexInfo.cssVariables || {}).map(([key, value]) => (_jsxs(Text, { children: [key, ": ", String(value) || 'not set'] }, key))) })] }), _jsxs("div", { children: [_jsx(Label, { className: "dndev-font-semibold", children: "Computed Values:" }), _jsx(Stack, { gap: "tight", className: "dndev-ml-md dndev-font-mono dndev-text-sm", children: Object.entries(zIndexInfo.computed || {}).map(([key, value]) => (_jsxs(Text, { children: [key, ": ", String(value)] }, key))) })] })] }) }), _jsx(Card, { title: _jsxs(Stack, { direction: "row", align: "center", justify: "between", className: "dndev-w-full", children: [_jsx("span", { children: "Full Store State" }), _jsx(CopyToClipboard, { text: formatJSON({
|
|
144
|
-
hasConsented,
|
|
145
|
-
categories,
|
|
146
|
-
timestamp,
|
|
147
|
-
version,
|
|
148
|
-
isReady,
|
|
149
|
-
}), variant: BUTTON_VARIANT.GHOST, onCopy: () => toast('success', 'Store state copied') })] }), children: _jsx("pre", { className: "dndev-overflow-y-auto dndev-font-mono dndev-text-xs dndev-max-h-60", children: formatJSON({
|
|
150
|
-
hasConsented,
|
|
151
|
-
categories,
|
|
152
|
-
timestamp,
|
|
153
|
-
version,
|
|
154
|
-
isReady,
|
|
155
|
-
}) }) }), _jsx(Card, { title: "F12 DevTools Guide", children: _jsxs(Stack, { gap: "tight", children: [_jsxs("div", { children: [_jsx(Label, { className: "dndev-font-semibold", children: "1. Open DevTools:" }), _jsxs(Text, { as: "span", className: "dndev-ml-md dndev-text-sm", children: ["Press ", _jsx("kbd", { children: "F12" }), " or ", _jsx("kbd", { children: "Ctrl+Shift+I" }), " (Windows) /", ' ', _jsx("kbd", { children: "Cmd+Option+I" }), " (Mac)"] })] }), _jsxs("div", { children: [_jsx(Label, { className: "dndev-font-semibold", children: "2. Check Console:" }), _jsx(Text, { as: "span", className: "dndev-ml-md dndev-text-sm", children: "Look for cookie-related errors or logs. Copy any errors you see." })] }), _jsxs("div", { children: [_jsx(Label, { className: "dndev-font-semibold", children: "3. Inspect Cookie Banner:" }), _jsxs(Stack, { gap: "tight", className: "dndev-ml-md dndev-text-sm", children: [_jsx(Text, { as: "span", children: "\u2022 Right-click on page \u2192 \"Inspect\" \u2192 Find cookie banner element" }), _jsxs(Text, { as: "span", children: ["\u2022 Check if element exists:", ' ', _jsx("code", { className: "dndev-font-mono", children: "document.querySelector('[class*=\"cookie\"]')" })] }), _jsx(Text, { as: "span", children: "\u2022 Check z-index: Look in \"Computed\" tab for z-index value" }), _jsxs(Text, { as: "span", children: ["\u2022 Check visibility: Look for", ' ', _jsx("code", { className: "dndev-font-mono", children: "display: none" }), " or", ' ', _jsx("code", { className: "dndev-font-mono", children: "opacity: 0" })] })] })] }), _jsxs("div", { children: [_jsx(Label, { className: "dndev-font-semibold", children: "4. Check Application Tab:" }), _jsxs(Stack, { gap: "tight", className: "dndev-ml-md dndev-text-sm", children: [_jsx(Text, { as: "span", children: "\u2022 Go to \"Application\" \u2192 \"Cookies\" \u2192 Your domain" }), _jsxs(Text, { as: "span", children: ["\u2022 Look for", ' ', _jsx("code", { className: "dndev-font-mono", children: "dndev-cookie-consent" }), ' ', "cookie"] }), _jsx(Text, { as: "span", children: "\u2022 Check its value and expiration" })] })] }), _jsxs("div", { children: [_jsx(Label, { className: "dndev-font-semibold", children: "5. Check Elements Tab:" }), _jsxs(Stack, { gap: "tight", className: "dndev-ml-md dndev-text-sm", children: [_jsxs(Text, { as: "span", children: ["\u2022 Search for", ' ', _jsx("code", { className: "dndev-font-mono", children: "[data-radix-portal]" }), ' ', "to find portals"] }), _jsx(Text, { as: "span", children: "\u2022 Check if any overlay is covering the banner (z-index higher than banner)" }), _jsx(Text, { as: "span", children: "\u2022 Use \"Select element\" tool (top-left icon) to hover and see z-index" })] })] }), _jsxs("div", { children: [_jsx(Label, { className: "dndev-font-semibold", children: "6. Console Commands:" }), _jsxs(Stack, { gap: "tight", className: "dndev-ml-md dndev-text-sm dndev-font-mono", children: [_jsxs(Text, { as: "span", children: ["\u2022 Get cookie:", ' ', _jsx("code", { children: "document.cookie.split('; ').find(c => c.startsWith('dndev-cookie-consent'))" })] }), _jsxs(Text, { as: "span", children: ["\u2022 Find banner:", ' ', _jsx("code", { children: "document.querySelector('[class*=\"cookie\"]')" })] }), _jsxs(Text, { as: "span", children: ["\u2022 Check z-index:", ' ', _jsx("code", { children: "getComputedStyle(document.querySelector('[class*=\"cookie\"]')).zIndex" })] }), _jsxs(Text, { as: "span", children: ["\u2022 Find all dialogs:", ' ', _jsx("code", { children: "document.querySelectorAll('[role=\"dialog\"]')" })] })] })] })] }) })] }) }) }));
|
|
156
|
-
};
|
|
1
|
+
"use client";import{RefreshCw as H,Trash2 as A}from"lucide-react";import{useState as T,useEffect as F}from"react";import{Button as w,BUTTON_VARIANT as c,Card as r,CopyToClipboard as u,Badge as I,Label as d,toast as m,DescriptionList as B,Text as o,Stack as n}from"@donotdev/components";import{useConsent as g,useConsentReady as M}from"@donotdev/core";import{CONSENT_CATEGORY as Z}from"@donotdev/core";import{getCookie as U,deleteCookie as _}from"@donotdev/core";import{jsx as e,jsxs as t}from"react/jsx-runtime";var L="dndev-cookie-consent",f=p=>{try{return JSON.stringify(p,null,2)}catch{return"Error formatting data"}},ee=()=>{let p=g("hasConsented"),v=g("categories"),k=g("timestamp"),b=g("version"),R=g("reset"),Y=g("showCookieBanner"),y=M(),[z,D]=T(null),[i,V]=T({}),[h,E]=T({}),N=()=>{let l=U(L);D(l),m("success","Data refreshed");let a=document.querySelector('[class*="cookie"]'),C=document.querySelectorAll('[role="dialog"]'),x=document.querySelectorAll('[class*="overlay"]'),O=document.querySelectorAll("[data-radix-portal]");V({cookieBanner:{exists:!!a,visible:a?window.getComputedStyle(a).display!=="none":!1,zIndex:a?window.getComputedStyle(a).zIndex:null,position:a?window.getComputedStyle(a).position:null,classes:a?a.className:null},dialogs:{count:C.length,open:Array.from(C).filter(s=>s.getAttribute("data-state")==="open").length,elements:Array.from(C).map(s=>({state:s.getAttribute("data-state"),zIndex:window.getComputedStyle(s).zIndex}))},overlays:{count:x.length,visible:Array.from(x).filter(s=>window.getComputedStyle(s).display!=="none").length,zIndices:Array.from(x).map(s=>window.getComputedStyle(s).zIndex)},portals:{count:O.length,elements:Array.from(O).map(s=>({zIndex:window.getComputedStyle(s).zIndex,children:s.children.length}))}});let S=document.documentElement;E({cssVariables:{"--z-overlay":getComputedStyle(S).getPropertyValue("--z-overlay"),"--z-modal":getComputedStyle(S).getPropertyValue("--z-modal"),"--z-tooltip":getComputedStyle(S).getPropertyValue("--z-tooltip"),"--z-toast":getComputedStyle(S).getPropertyValue("--z-toast")},computed:{cookieBanner:a?window.getComputedStyle(a).zIndex:"N/A",highestDialog:C.length>0?Math.max(...Array.from(C).map(s=>parseInt(window.getComputedStyle(s).zIndex||"0",10))):0,highestOverlay:x.length>0?Math.max(...Array.from(x).map(s=>parseInt(window.getComputedStyle(s).zIndex||"0",10))):0}})};F(()=>{N()},[]);let G=()=>{R(),setTimeout(()=>{window.location.reload()},100)},P=()=>{_(L),N(),m("success","Cookie cleared")},j=[{label:"Has Consented",value:e(I,{variant:p?"default":"destructive",children:p?"\u2705 Yes":"\u274C No"})},{label:"Store Ready",value:e(I,{variant:y?"default":"destructive",children:y?"\u2705 Ready":"\u274C Not Ready"})},{label:"Timestamp",value:e(o,{as:"span",className:"dndev-font-mono dndev-text-sm",children:k||"Never"})},{label:"Version",value:e(o,{as:"span",className:"dndev-font-mono dndev-text-sm",children:b||"N/A"})}],q=Object.entries(Z).map(([l,a])=>({label:e(o,{as:"span",className:"dndev-font-mono",children:l}),value:e(I,{variant:v[a]?"default":"destructive",children:v[a]?"\u2705 Enabled":"\u274C Disabled"})}));return e(n,{gap:"large",children:e(r,{title:"Cookie Consent Debug",footer:t(n,{direction:"row",gap:"tight",children:[e(w,{onClick:N,icon:H,variant:c.OUTLINE,title:"Refresh Data",children:"Refresh"}),e(w,{onClick:G,icon:A,variant:c.OUTLINE,title:"Reset Consent & Reload",children:"Reset & Reload"})]}),children:t(n,{gap:"large",children:[e(r,{title:t(n,{direction:"row",align:"center",justify:"between",className:"dndev-w-full",children:[e("span",{children:"Consent State"}),e(u,{text:f({hasConsented:p,categories:v,timestamp:k,version:b}),variant:c.GHOST,onCopy:()=>m("success","Consent state copied")})]}),children:e(B,{items:j})}),e(r,{title:t(n,{direction:"row",align:"center",justify:"between",className:"dndev-w-full",children:[e("span",{children:"Categories"}),e(u,{text:f(v),variant:c.GHOST,onCopy:()=>m("success","Categories copied")})]}),children:e(B,{items:q})}),e(r,{title:t(n,{direction:"row",align:"center",justify:"between",className:"dndev-w-full",children:[e("span",{children:"Cookie Value"}),t(n,{direction:"row",gap:"tight",children:[e(u,{text:z||"null",variant:c.GHOST,onCopy:()=>m("success","Cookie value copied")}),e(w,{onClick:P,icon:A,variant:c.GHOST,title:"Clear Cookie",children:"Clear"})]})]}),children:e("pre",{className:"dndev-overflow-y-auto dndev-font-mono dndev-text-xs dndev-max-h-60",children:z||"No cookie found"})}),e(r,{title:t(n,{direction:"row",align:"center",justify:"between",className:"dndev-w-full",children:[e("span",{children:"DOM Elements"}),e(u,{text:f(i),variant:c.GHOST,onCopy:()=>m("success","DOM info copied")})]}),children:t(n,{children:[t("div",{children:[e(d,{className:"dndev-font-semibold",children:"Cookie Banner:"}),t(n,{gap:"tight",className:"dndev-ml-md",children:[t(o,{children:["Exists: ",i.cookieBanner?.exists?"\u2705":"\u274C"]}),t(o,{children:["Visible: ",i.cookieBanner?.visible?"\u2705":"\u274C"]}),t(o,{children:["z-index: ",i.cookieBanner?.zIndex||"N/A"]}),t(o,{children:["Position: ",i.cookieBanner?.position||"N/A"]})]})]}),t("div",{children:[e(d,{className:"dndev-font-semibold",children:"Dialogs:"}),t(n,{gap:"tight",className:"dndev-ml-md",children:[t(o,{children:["Count: ",i.dialogs?.count||0]}),t(o,{children:["Open: ",i.dialogs?.open||0]})]})]}),t("div",{children:[e(d,{className:"dndev-font-semibold",children:"Overlays:"}),t(n,{gap:"tight",className:"dndev-ml-md",children:[t(o,{children:["Count: ",i.overlays?.count||0]}),t(o,{children:["Visible: ",i.overlays?.visible||0]})]})]}),t("div",{children:[e(d,{className:"dndev-font-semibold",children:"Portals:"}),e(n,{gap:"tight",className:"dndev-ml-md",children:t(o,{children:["Count: ",i.portals?.count||0]})})]})]})}),e(r,{title:t(n,{direction:"row",align:"center",justify:"between",className:"dndev-w-full",children:[e("span",{children:"Z-Index Stacking"}),e(u,{text:f(h),variant:c.GHOST,onCopy:()=>m("success","Z-index info copied")})]}),children:t(n,{children:[t("div",{children:[e(d,{className:"dndev-font-semibold",children:"CSS Variables:"}),e(n,{gap:"tight",className:"dndev-ml-md dndev-font-mono dndev-text-sm",children:Object.entries(h.cssVariables||{}).map(([l,a])=>t(o,{children:[l,": ",String(a)||"not set"]},l))})]}),t("div",{children:[e(d,{className:"dndev-font-semibold",children:"Computed Values:"}),e(n,{gap:"tight",className:"dndev-ml-md dndev-font-mono dndev-text-sm",children:Object.entries(h.computed||{}).map(([l,a])=>t(o,{children:[l,": ",String(a)]},l))})]})]})}),e(r,{title:t(n,{direction:"row",align:"center",justify:"between",className:"dndev-w-full",children:[e("span",{children:"Full Store State"}),e(u,{text:f({hasConsented:p,categories:v,timestamp:k,version:b,isReady:y}),variant:c.GHOST,onCopy:()=>m("success","Store state copied")})]}),children:e("pre",{className:"dndev-overflow-y-auto dndev-font-mono dndev-text-xs dndev-max-h-60",children:f({hasConsented:p,categories:v,timestamp:k,version:b,isReady:y})})}),e(r,{title:"F12 DevTools Guide",children:t(n,{gap:"tight",children:[t("div",{children:[e(d,{className:"dndev-font-semibold",children:"1. Open DevTools:"}),t(o,{as:"span",className:"dndev-ml-md dndev-text-sm",children:["Press ",e("kbd",{children:"F12"})," or ",e("kbd",{children:"Ctrl+Shift+I"})," (Windows) /"," ",e("kbd",{children:"Cmd+Option+I"})," (Mac)"]})]}),t("div",{children:[e(d,{className:"dndev-font-semibold",children:"2. Check Console:"}),e(o,{as:"span",className:"dndev-ml-md dndev-text-sm",children:"Look for cookie-related errors or logs. Copy any errors you see."})]}),t("div",{children:[e(d,{className:"dndev-font-semibold",children:"3. Inspect Cookie Banner:"}),t(n,{gap:"tight",className:"dndev-ml-md dndev-text-sm",children:[e(o,{as:"span",children:'\u2022 Right-click on page \u2192 "Inspect" \u2192 Find cookie banner element'}),t(o,{as:"span",children:["\u2022 Check if element exists:"," ",e("code",{className:"dndev-font-mono",children:`document.querySelector('[class*="cookie"]')`})]}),e(o,{as:"span",children:'\u2022 Check z-index: Look in "Computed" tab for z-index value'}),t(o,{as:"span",children:["\u2022 Check visibility: Look for"," ",e("code",{className:"dndev-font-mono",children:"display: none"})," or"," ",e("code",{className:"dndev-font-mono",children:"opacity: 0"})]})]})]}),t("div",{children:[e(d,{className:"dndev-font-semibold",children:"4. Check Application Tab:"}),t(n,{gap:"tight",className:"dndev-ml-md dndev-text-sm",children:[e(o,{as:"span",children:'\u2022 Go to "Application" \u2192 "Cookies" \u2192 Your domain'}),t(o,{as:"span",children:["\u2022 Look for"," ",e("code",{className:"dndev-font-mono",children:"dndev-cookie-consent"})," ","cookie"]}),e(o,{as:"span",children:"\u2022 Check its value and expiration"})]})]}),t("div",{children:[e(d,{className:"dndev-font-semibold",children:"5. Check Elements Tab:"}),t(n,{gap:"tight",className:"dndev-ml-md dndev-text-sm",children:[t(o,{as:"span",children:["\u2022 Search for"," ",e("code",{className:"dndev-font-mono",children:"[data-radix-portal]"})," ","to find portals"]}),e(o,{as:"span",children:"\u2022 Check if any overlay is covering the banner (z-index higher than banner)"}),e(o,{as:"span",children:'\u2022 Use "Select element" tool (top-left icon) to hover and see z-index'})]})]}),t("div",{children:[e(d,{className:"dndev-font-semibold",children:"6. Console Commands:"}),t(n,{gap:"tight",className:"dndev-ml-md dndev-text-sm dndev-font-mono",children:[t(o,{as:"span",children:["\u2022 Get cookie:"," ",e("code",{children:"document.cookie.split('; ').find(c => c.startsWith('dndev-cookie-consent'))"})]}),t(o,{as:"span",children:["\u2022 Find banner:"," ",e("code",{children:`document.querySelector('[class*="cookie"]')`})]}),t(o,{as:"span",children:["\u2022 Check z-index:"," ",e("code",{children:`getComputedStyle(document.querySelector('[class*="cookie"]')).zIndex`})]}),t(o,{as:"span",children:["\u2022 Find all dialogs:"," ",e("code",{children:`document.querySelectorAll('[role="dialog"]')`})]})]})]})]})})]})})})};export{ee as CookieTab};
|
|
@@ -1,48 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
// packages/ui/src/internal/devtools/components/DebugDialog.tsx
|
|
4
|
-
/**
|
|
5
|
-
* @fileoverview Debug Dialog Component
|
|
6
|
-
* @description Clean debug panel - Config, Design, Cookies, Stores
|
|
7
|
-
*
|
|
8
|
-
* @version 0.1.0
|
|
9
|
-
* @since 0.0.1
|
|
10
|
-
* @author AMBROISE PARK Consulting
|
|
11
|
-
*/
|
|
12
|
-
import { PanelRight } from 'lucide-react';
|
|
13
|
-
import { useState } from 'react';
|
|
14
|
-
import { Button, BUTTON_VARIANT, Sheet, Tabs, Stack, ScrollArea, } from '@donotdev/components';
|
|
15
|
-
import { useTranslation } from '@donotdev/core';
|
|
16
|
-
import { ConfigTab } from './ConfigTab';
|
|
17
|
-
import { CookieTab } from './CookieTab';
|
|
18
|
-
import { DesignTab } from './DesignTab';
|
|
19
|
-
import { StoresTab } from './StoresTab';
|
|
20
|
-
export const DebugDialog = () => {
|
|
21
|
-
const { t } = useTranslation('dndev');
|
|
22
|
-
const [open, setOpen] = useState(false);
|
|
23
|
-
return (_jsx(Sheet, { open: open, onOpenChange: setOpen, trigger: _jsx(Button, { icon: PanelRight, iconEnd: true, variant: BUTTON_VARIANT.OUTLINE, className: "dndev-flex-1 dndev-justify-center dndev-items-center", title: "Open debug panel", "aria-label": "Debug panel", children: "\uD83D\uDC1B Debug Tools" }), side: "top", showOverlay: false, title: t('sheet.debugPanel', { defaultValue: 'Debug Panel' }), className: "dndev-h-[80vh] dndev-max-h-[80vh]", "data-dndev-devtools": "true", children: _jsx(Stack, { flex: "1", className: "dndev-h-full dndev-min-h-0", style: { padding: 0, overflow: 'hidden', height: '100%' }, children: _jsx(Tabs, { defaultValue: "config", className: "dndev-flex-1 dndev-min-h-0 dndev-flex dndev-flex-col dndev-h-full", items: [
|
|
24
|
-
{
|
|
25
|
-
value: 'config',
|
|
26
|
-
label: 'Config',
|
|
27
|
-
content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(ConfigTab, {}) })),
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
value: 'design',
|
|
31
|
-
label: 'Design',
|
|
32
|
-
content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(DesignTab, {}) })),
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
value: 'cookies',
|
|
36
|
-
label: 'Cookies',
|
|
37
|
-
content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(CookieTab, {}) })),
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
value: 'stores',
|
|
41
|
-
label: 'Stores',
|
|
42
|
-
content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(StoresTab, {}) })),
|
|
43
|
-
},
|
|
44
|
-
], listClassName: "dndev-flex dndev-flex-row dndev-gap-sm", listStyle: {
|
|
45
|
-
borderBottom: '1px solid var(--border)',
|
|
46
|
-
backgroundColor: 'transparent',
|
|
47
|
-
} }) }) }));
|
|
48
|
-
};
|
|
1
|
+
"use client";import{PanelRight as a}from"lucide-react";import{useState as d}from"react";import{Button as s,BUTTON_VARIANT as r,Sheet as i,Tabs as v,Stack as c,ScrollArea as l}from"@donotdev/components";import{useTranslation as f}from"@donotdev/core";import{ConfigTab as m}from"./ConfigTab.js";import{CookieTab as h}from"./CookieTab.js";import{DesignTab as u}from"./DesignTab.js";import{StoresTab as g}from"./StoresTab.js";import{jsx as e}from"react/jsx-runtime";var C=()=>{let{t}=f("dndev"),[n,o]=d(!1);return e(i,{open:n,onOpenChange:o,trigger:e(s,{icon:a,iconEnd:!0,variant:r.OUTLINE,className:"dndev-flex-1 dndev-justify-center dndev-items-center",title:"Open debug panel","aria-label":"Debug panel",children:"\u{1F41B} Debug Tools"}),side:"top",showOverlay:!1,title:t("sheet.debugPanel",{defaultValue:"Debug Panel"}),className:"dndev-h-[80vh] dndev-max-h-[80vh]","data-dndev-devtools":"true",children:e(c,{flex:"1",className:"dndev-h-full dndev-min-h-0",style:{padding:0,overflow:"hidden",height:"100%"},children:e(v,{defaultValue:"config",className:"dndev-flex-1 dndev-min-h-0 dndev-flex dndev-flex-col dndev-h-full",items:[{value:"config",label:"Config",content:e(l,{className:"dndev-h-full",style:{height:"100%"},children:e(m,{})})},{value:"design",label:"Design",content:e(l,{className:"dndev-h-full",style:{height:"100%"},children:e(u,{})})},{value:"cookies",label:"Cookies",content:e(l,{className:"dndev-h-full",style:{height:"100%"},children:e(h,{})})},{value:"stores",label:"Stores",content:e(l,{className:"dndev-h-full",style:{height:"100%"},children:e(g,{})})}],listClassName:"dndev-flex dndev-flex-row dndev-gap-sm",listStyle:{borderBottom:"1px solid var(--border)",backgroundColor:"transparent"}})})})};export{C as DebugDialog};
|