@donotdev/ui 0.3.0 → 0.3.2

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.
Files changed (301) hide show
  1. package/dist/components/auth/AuthHeader.js +1 -93
  2. package/dist/components/auth/AuthMenu.d.ts.map +1 -1
  3. package/dist/components/auth/AuthMenu.js +3 -286
  4. package/dist/components/auth/index.js +1 -9
  5. package/dist/components/common/FeatureCard.d.ts.map +1 -1
  6. package/dist/components/common/FeatureCard.js +1 -86
  7. package/dist/components/common/FeatureDisabled.js +1 -67
  8. package/dist/components/common/IconPlaceholder.d.ts +24 -0
  9. package/dist/components/common/IconPlaceholder.d.ts.map +1 -0
  10. package/dist/components/common/IconPlaceholder.js +1 -0
  11. package/dist/components/common/LazyLucideIcon.d.ts +39 -0
  12. package/dist/components/common/LazyLucideIcon.d.ts.map +1 -0
  13. package/dist/components/common/LazyLucideIcon.js +1 -0
  14. package/dist/components/common/ProgressBar.js +1 -84
  15. package/dist/components/common/RedirectOverlay.js +1 -243
  16. package/dist/components/common/Skeleton.js +1 -144
  17. package/dist/components/common/TechBento.d.ts.map +1 -1
  18. package/dist/components/common/TechBento.js +1 -53
  19. package/dist/components/common/icon.d.ts +1 -1
  20. package/dist/components/common/icon.d.ts.map +1 -1
  21. package/dist/components/common/icon.js +1 -84
  22. package/dist/components/common/iconByName.d.ts +33 -0
  23. package/dist/components/common/iconByName.d.ts.map +1 -0
  24. package/dist/components/common/iconByName.js +1 -0
  25. package/dist/components/common/index.js +1 -16
  26. package/dist/components/cookie-consent/ConsentBanner.d.ts +3 -1
  27. package/dist/components/cookie-consent/ConsentBanner.d.ts.map +1 -1
  28. package/dist/components/cookie-consent/ConsentBanner.js +1 -31
  29. package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
  30. package/dist/components/cookie-consent/CookieConsent.js +1 -183
  31. package/dist/components/cookie-consent/index.js +1 -11
  32. package/dist/components/cookie-consent/useCookieNoticeRequired.d.ts +7 -0
  33. package/dist/components/cookie-consent/useCookieNoticeRequired.d.ts.map +1 -0
  34. package/dist/components/cookie-consent/useCookieNoticeRequired.js +1 -0
  35. package/dist/components/index.js +1 -13
  36. package/dist/components/layout/GameContainer.d.ts.map +1 -1
  37. package/dist/components/layout/GameContainer.js +1 -72
  38. package/dist/components/layout/GameFlow.d.ts.map +1 -1
  39. package/dist/components/layout/GameFlow.js +1 -93
  40. package/dist/components/layout/PageConfig.d.ts.map +1 -1
  41. package/dist/components/layout/PageConfig.js +1 -47
  42. package/dist/components/layout/PageContainer.d.ts.map +1 -1
  43. package/dist/components/layout/PageContainer.js +1 -38
  44. package/dist/components/layout/components/Breadcrumbs.d.ts +2 -1
  45. package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
  46. package/dist/components/layout/components/Breadcrumbs.js +1 -89
  47. package/dist/components/layout/components/DropdownNavigation.d.ts.map +1 -1
  48. package/dist/components/layout/components/DropdownNavigation.js +1 -30
  49. package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts.map +1 -1
  50. package/dist/components/layout/components/FloatingLanguageSwitcher.js +1 -26
  51. package/dist/components/layout/components/Notifications.js +1 -182
  52. package/dist/components/layout/components/header/AppBranding.d.ts.map +1 -1
  53. package/dist/components/layout/components/header/AppBranding.js +1 -54
  54. package/dist/components/layout/components/header/AppIcon.d.ts.map +1 -1
  55. package/dist/components/layout/components/header/AppIcon.js +1 -59
  56. package/dist/components/layout/components/header/AppTitle.d.ts.map +1 -1
  57. package/dist/components/layout/components/header/AppTitle.js +1 -40
  58. package/dist/components/layout/components/header/CacheSettings.js +1 -225
  59. package/dist/components/layout/components/header/GameTitle.d.ts.map +1 -1
  60. package/dist/components/layout/components/header/GameTitle.js +1 -66
  61. package/dist/components/layout/components/header/HeaderMenu.d.ts +17 -16
  62. package/dist/components/layout/components/header/HeaderMenu.d.ts.map +1 -1
  63. package/dist/components/layout/components/header/HeaderMenu.js +1 -47
  64. package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
  65. package/dist/components/layout/components/header/HeaderNavigation.js +1 -66
  66. package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
  67. package/dist/components/layout/components/header/SettingsMenu.js +1 -85
  68. package/dist/components/layout/components/header/ThemeToggle.d.ts.map +1 -1
  69. package/dist/components/layout/components/header/ThemeToggle.js +1 -93
  70. package/dist/components/layout/components/index.js +1 -25
  71. package/dist/components/layout/index.js +1 -14
  72. package/dist/crud/components/ChildRowsPicker.js +1 -68
  73. package/dist/crud/components/CrudCardLink.js +1 -14
  74. package/dist/crud/components/EntityCardList.js +1 -184
  75. package/dist/crud/components/EntityDisplayRenderer.js +1 -130
  76. package/dist/crud/components/EntityFormRenderer.js +1 -433
  77. package/dist/crud/components/EntityList.js +1 -521
  78. package/dist/crud/components/EntityRecommendations.js +1 -87
  79. package/dist/crud/components/EntityWorkflow.js +1 -55
  80. package/dist/crud/components/Form.d.ts.map +1 -1
  81. package/dist/crud/components/Form.js +1 -198
  82. package/dist/crud/components/cellEditFor.js +1 -74
  83. package/dist/crud/components/entityParent.js +1 -76
  84. package/dist/crud/components/index.js +1 -16
  85. package/dist/crud/components/useRecordBreadcrumb.d.ts.map +1 -1
  86. package/dist/crud/components/useRecordBreadcrumb.js +1 -43
  87. package/dist/crud/crudImports.js +1 -51
  88. package/dist/crud/index.js +1 -11
  89. package/dist/data/techLogos.js +1 -99
  90. package/dist/dndev-next.css +104 -17
  91. package/dist/dndev.css +104 -17
  92. package/dist/index.js +1 -5
  93. package/dist/internal/common/DnDevErrorBoundary.js +1 -55
  94. package/dist/internal/common/ErrorFallback.js +3 -214
  95. package/dist/internal/common/GlobalErrorFallback.js +1 -45
  96. package/dist/internal/common/RouteErrorFallback.js +3 -140
  97. package/dist/internal/devtools/DebugTools.js +1 -131
  98. package/dist/internal/devtools/components/AuthDebugButton.js +1 -72
  99. package/dist/internal/devtools/components/ConfigTab.js +1 -61
  100. package/dist/internal/devtools/components/CookieTab.js +1 -156
  101. package/dist/internal/devtools/components/DebugDialog.js +1 -48
  102. package/dist/internal/devtools/components/DesignTab.js +1 -469
  103. package/dist/internal/devtools/components/LayoutReset.js +1 -214
  104. package/dist/internal/devtools/components/MaskedValue.js +1 -39
  105. package/dist/internal/devtools/components/StoresTab.js +1 -90
  106. package/dist/internal/devtools/components/index.js +1 -16
  107. package/dist/internal/devtools/index.js +1 -13
  108. package/dist/internal/devtools/types.js +0 -2
  109. package/dist/internal/devtools/utils/envVarDiscovery.js +1 -106
  110. package/dist/internal/devtools/utils/index.js +1 -12
  111. package/dist/internal/devtools/utils/maskSensitive.js +1 -59
  112. package/dist/internal/devtools/utils/virtualModuleInspector.js +1 -309
  113. package/dist/internal/initializers/BaseStoresInitializer.js +1 -367
  114. package/dist/internal/initializers/NextJsStoresInitializer.js +1 -78
  115. package/dist/internal/initializers/ViteStoresInitializer.js +1 -20
  116. package/dist/internal/initializers/index.js +1 -11
  117. package/dist/internal/layout/DnDevLayout.js +1 -321
  118. package/dist/internal/layout/components/AutoMetaTags.d.ts +2 -0
  119. package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
  120. package/dist/internal/layout/components/AutoMetaTags.js +1 -338
  121. package/dist/internal/layout/components/FaviconHead.js +1 -60
  122. package/dist/internal/layout/components/FontPreloadLinks.js +1 -31
  123. package/dist/internal/layout/components/HeadTags.js +1 -20
  124. package/dist/internal/layout/components/PWAUpdateNotification.js +1 -131
  125. package/dist/internal/layout/components/footer/FooterBranding.d.ts.map +1 -1
  126. package/dist/internal/layout/components/footer/FooterBranding.js +1 -35
  127. package/dist/internal/layout/components/footer/FooterCopyright.d.ts.map +1 -1
  128. package/dist/internal/layout/components/footer/FooterCopyright.js +1 -37
  129. package/dist/internal/layout/components/footer/FooterLegalLinks.d.ts.map +1 -1
  130. package/dist/internal/layout/components/footer/FooterLegalLinks.js +1 -44
  131. package/dist/internal/layout/components/footer/useLegalLinks.d.ts +4 -2
  132. package/dist/internal/layout/components/footer/useLegalLinks.d.ts.map +1 -1
  133. package/dist/internal/layout/components/footer/useLegalLinks.js +1 -21
  134. package/dist/internal/layout/components/i18nSeoMeta.js +1 -53
  135. package/dist/internal/layout/components/index.js +1 -13
  136. package/dist/internal/layout/config/defaults.js +1 -47
  137. package/dist/internal/layout/config/index.js +1 -11
  138. package/dist/internal/layout/config/presets/admin.js +1 -35
  139. package/dist/internal/layout/config/presets/blog.js +1 -31
  140. package/dist/internal/layout/config/presets/docs.js +1 -51
  141. package/dist/internal/layout/config/presets/game.js +1 -53
  142. package/dist/internal/layout/config/presets/index.js +1 -24
  143. package/dist/internal/layout/config/presets/landing.js +1 -42
  144. package/dist/internal/layout/config/presets/moolti.js +1 -52
  145. package/dist/internal/layout/config/presets/plain.js +1 -25
  146. package/dist/internal/layout/renderers/index.js +0 -10
  147. package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
  148. package/dist/internal/layout/zones/DnDevFooter.js +1 -67
  149. package/dist/internal/layout/zones/DnDevHeader.js +1 -41
  150. package/dist/internal/layout/zones/DnDevMergedBar.d.ts.map +1 -1
  151. package/dist/internal/layout/zones/DnDevMergedBar.js +1 -52
  152. package/dist/internal/layout/zones/DnDevSidebar.d.ts.map +1 -1
  153. package/dist/internal/layout/zones/DnDevSidebar.js +1 -181
  154. package/dist/internal/layout/zones/index.js +1 -14
  155. package/dist/internal/providers/NavigationProvider.d.ts.map +1 -1
  156. package/dist/internal/providers/NavigationProvider.js +1 -71
  157. package/dist/internal/providers/SentryInitializer.d.ts.map +1 -1
  158. package/dist/internal/providers/SentryInitializer.js +1 -36
  159. package/dist/internal/providers/UIProviders.js +1 -79
  160. package/dist/internal/providers/index.js +1 -12
  161. package/dist/next.js +1 -11
  162. package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
  163. package/dist/providers/NextJsAppProviders.js +1 -107
  164. package/dist/providers/ViteAppProviders.d.ts.map +1 -1
  165. package/dist/providers/ViteAppProviders.js +1 -117
  166. package/dist/providers/index.js +1 -11
  167. package/dist/routing/404.js +1 -108
  168. package/dist/routing/AuthGuard.js +1 -178
  169. package/dist/routing/AuthGuardFallback.d.ts.map +1 -1
  170. package/dist/routing/AuthGuardFallback.js +1 -67
  171. package/dist/routing/AuthReturnTo.js +1 -68
  172. package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
  173. package/dist/routing/DnDevNavigationMenu.js +1 -138
  174. package/dist/routing/GoTo.d.ts.map +1 -1
  175. package/dist/routing/GoTo.js +1 -38
  176. package/dist/routing/GoToDialog.d.ts.map +1 -1
  177. package/dist/routing/GoToDialog.js +1 -97
  178. package/dist/routing/GoToInput.d.ts.map +1 -1
  179. package/dist/routing/GoToInput.js +1 -49
  180. package/dist/routing/GoToWrapper.d.ts.map +1 -1
  181. package/dist/routing/GoToWrapper.js +1 -59
  182. package/dist/routing/Link.d.ts +10 -2
  183. package/dist/routing/Link.d.ts.map +1 -1
  184. package/dist/routing/Link.js +1 -109
  185. package/dist/routing/NavigationItem.d.ts.map +1 -1
  186. package/dist/routing/NavigationItem.js +1 -44
  187. package/dist/routing/NotFoundDocument.d.ts +33 -0
  188. package/dist/routing/NotFoundDocument.d.ts.map +1 -0
  189. package/dist/routing/NotFoundDocument.js +1 -0
  190. package/dist/routing/SignedInRedirect.js +1 -47
  191. package/dist/routing/hooks/hooks.vite.js +1 -1
  192. package/dist/routing/hooks/index.js +1 -26
  193. package/dist/routing/hooks/types.js +0 -2
  194. package/dist/routing/hooks/useLocation.next.js +1 -35
  195. package/dist/routing/hooks/useLocation.vite.js +1 -13
  196. package/dist/routing/hooks/useMatch.next.js +1 -31
  197. package/dist/routing/hooks/useMatch.vite.js +1 -6
  198. package/dist/routing/hooks/useNavigate.next.js +1 -64
  199. package/dist/routing/hooks/useNavigate.vite.js +1 -61
  200. package/dist/routing/hooks/useParams.next.js +1 -9
  201. package/dist/routing/hooks/useParams.vite.js +1 -6
  202. package/dist/routing/hooks/useQueryParams.next.js +1 -66
  203. package/dist/routing/hooks/useQueryParams.vite.js +1 -66
  204. package/dist/routing/hooks/useRedirectGuard.next.js +1 -119
  205. package/dist/routing/hooks/useRedirectGuard.vite.js +1 -117
  206. package/dist/routing/hooks/useRouteParam.next.js +1 -38
  207. package/dist/routing/hooks/useRouteParam.vite.js +1 -38
  208. package/dist/routing/hooks/useRoutePath.next.js +1 -36
  209. package/dist/routing/hooks/useRoutePath.vite.js +1 -25
  210. package/dist/routing/hooks/useSearchParams.next.js +1 -22
  211. package/dist/routing/hooks/useSearchParams.vite.js +1 -22
  212. package/dist/routing/hooks/useUrlLanguage.next.js +1 -50
  213. package/dist/routing/hooks/useUrlLanguage.vite.js +1 -41
  214. package/dist/routing/index.d.ts +1 -0
  215. package/dist/routing/index.d.ts.map +1 -1
  216. package/dist/routing/index.js +1 -32
  217. package/dist/routing/link/InternalLink.next.d.ts +23 -0
  218. package/dist/routing/link/InternalLink.next.d.ts.map +1 -0
  219. package/dist/routing/link/InternalLink.next.js +1 -0
  220. package/dist/routing/link/InternalLink.vite.d.ts +22 -0
  221. package/dist/routing/link/InternalLink.vite.d.ts.map +1 -0
  222. package/dist/routing/link/InternalLink.vite.js +1 -0
  223. package/dist/routing/link/absolutePath.d.ts +17 -0
  224. package/dist/routing/link/absolutePath.d.ts.map +1 -0
  225. package/dist/routing/link/absolutePath.js +1 -0
  226. package/dist/routing/link/link.next.d.ts +12 -0
  227. package/dist/routing/link/link.next.d.ts.map +1 -0
  228. package/dist/routing/link/link.next.js +1 -0
  229. package/dist/routing/link/link.vite.d.ts +12 -0
  230. package/dist/routing/link/link.vite.d.ts.map +1 -0
  231. package/dist/routing/link/link.vite.js +1 -0
  232. package/dist/routing/link/types.d.ts +30 -0
  233. package/dist/routing/link/types.d.ts.map +1 -0
  234. package/dist/routing/link/types.js +0 -0
  235. package/dist/routing/parentRoute.js +1 -43
  236. package/dist/routing/useGoTo.d.ts.map +1 -1
  237. package/dist/routing/useGoTo.js +1 -59
  238. package/dist/routing/useNavigation.d.ts.map +1 -1
  239. package/dist/routing/useNavigation.js +1 -114
  240. package/dist/routing/useRouteDiscovery.d.ts +1 -0
  241. package/dist/routing/useRouteDiscovery.d.ts.map +1 -1
  242. package/dist/routing/useRouteDiscovery.js +1 -313
  243. package/dist/rsc.d.ts +28 -0
  244. package/dist/rsc.d.ts.map +1 -0
  245. package/dist/rsc.js +1 -0
  246. package/dist/styles/index.css +104 -17
  247. package/dist/styles/index.js +1 -10
  248. package/dist/styles/layoutConstants.js +1 -134
  249. package/dist/symbol-index.json +1 -1
  250. package/dist/utils/assetResolver.d.ts.map +1 -1
  251. package/dist/utils/assetResolver.js +1 -297
  252. package/dist/utils/index.js +1 -23
  253. package/dist/utils/sanitizeSvg.js +1 -51
  254. package/dist/utils/tList.js +1 -42
  255. package/dist/utils/useAISafe.d.ts.map +1 -1
  256. package/dist/utils/useAISafe.js +1 -53
  257. package/dist/utils/useAuthSafe.d.ts.map +1 -1
  258. package/dist/utils/useAuthSafe.js +1 -78
  259. package/dist/utils/useAuthVisibility.d.ts.map +1 -1
  260. package/dist/utils/useAuthVisibility.js +1 -63
  261. package/dist/utils/useBillingVisibility.d.ts.map +1 -1
  262. package/dist/utils/useBillingVisibility.js +1 -57
  263. package/dist/utils/useCrudSafe.d.ts.map +1 -1
  264. package/dist/utils/useCrudSafe.js +1 -75
  265. package/dist/utils/useDeleteAccountSafe.js +1 -52
  266. package/dist/utils/useFormStoreSafe.d.ts.map +1 -1
  267. package/dist/utils/useFormStoreSafe.js +1 -85
  268. package/dist/utils/useOAuthSafe.d.ts.map +1 -1
  269. package/dist/utils/useOAuthSafe.js +1 -38
  270. package/dist/utils/useSeo.js +1 -151
  271. package/dist/utils/useStripeBillingSafe.d.ts.map +1 -1
  272. package/dist/utils/useStripeBillingSafe.js +1 -81
  273. package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
  274. package/dist/vite-routing/AppRoutes.js +1 -235
  275. package/dist/vite-routing/RootLayout.d.ts.map +1 -1
  276. package/dist/vite-routing/RootLayout.js +1 -205
  277. package/dist/vite-routing/index.js +1 -11
  278. package/dist/vite.js +1 -10
  279. package/guidelines/COMPONENTS.md +4 -4
  280. package/guidelines/PAGES.md +3 -0
  281. package/guidelines/ROUTING.md +15 -0
  282. package/guidelines/SEO.md +4 -1
  283. package/package.json +18 -8
  284. package/dist/ChildRowsPicker-63M4EQUQ.js +0 -1
  285. package/dist/ChildRowsPicker-ISP365ON.js +0 -1
  286. package/dist/ChildRowsPicker-PQFE6NCR.js +0 -1
  287. package/dist/ChildRowsPicker-XXFFSMWY.js +0 -1
  288. package/dist/CookieConsent-QOUAY6B4.js +0 -1
  289. package/dist/GoToDialog-KSBGOIWO.js +0 -1
  290. package/dist/GoToDialog-XBK5EZF4.js +0 -1
  291. package/dist/chunk-3CIZFGST.js +0 -1
  292. package/dist/chunk-LHMKU342.js +0 -1
  293. package/dist/chunk-MS7ZIW5Z.js +0 -1
  294. package/dist/chunk-O2XFH626.js +0 -1
  295. package/dist/chunk-P2DHZWPY.js +0 -1
  296. package/dist/components/common/lucideIconByName.d.ts +0 -9
  297. package/dist/components/common/lucideIconByName.d.ts.map +0 -1
  298. package/dist/components/common/lucideIconByName.js +0 -32
  299. package/dist/internal/layout/components/PerformanceHints.d.ts +0 -71
  300. package/dist/internal/layout/components/PerformanceHints.d.ts.map +0 -1
  301. package/dist/internal/layout/components/PerformanceHints.js +0 -71
@@ -1,61 +1 @@
1
- 'use client';
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
- 'use client';
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};