@donotdev/ui 0.0.2 → 0.0.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.
Files changed (104) hide show
  1. package/dist/components/auth/AuthMenu.d.ts.map +1 -1
  2. package/dist/components/auth/AuthMenu.js +15 -28
  3. package/dist/components/common/FeatureCard.js +1 -1
  4. package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
  5. package/dist/components/cookie-consent/CookieConsent.js +2 -41
  6. package/dist/components/cookie-consent/index.d.ts +0 -1
  7. package/dist/components/cookie-consent/index.d.ts.map +1 -1
  8. package/dist/components/cookie-consent/index.js +1 -1
  9. package/dist/components/layout/components/DropdownNavigation.d.ts.map +1 -1
  10. package/dist/components/layout/components/header/ThemeToggle.d.ts +1 -1
  11. package/dist/components/layout/components/header/ThemeToggle.d.ts.map +1 -1
  12. package/dist/components/layout/components/header/ThemeToggle.js +5 -4
  13. package/dist/dndev.css +137 -120
  14. package/dist/index.js +4 -4
  15. package/dist/internal/devtools/DebugTools.d.ts.map +1 -1
  16. package/dist/internal/devtools/DebugTools.js +8 -4
  17. package/dist/internal/devtools/components/ConfigTab.d.ts.map +1 -1
  18. package/dist/internal/devtools/components/ConfigTab.js +31 -133
  19. package/dist/internal/devtools/components/DebugDialog.d.ts.map +1 -1
  20. package/dist/internal/devtools/components/DebugDialog.js +11 -520
  21. package/dist/internal/devtools/components/DesignTab.d.ts +2 -0
  22. package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -0
  23. package/dist/internal/devtools/components/DesignTab.js +220 -0
  24. package/dist/internal/devtools/components/StoresTab.d.ts.map +1 -1
  25. package/dist/internal/devtools/components/StoresTab.js +54 -102
  26. package/dist/internal/devtools/components/index.d.ts +1 -6
  27. package/dist/internal/devtools/components/index.d.ts.map +1 -1
  28. package/dist/internal/devtools/components/index.js +1 -6
  29. package/dist/internal/devtools/utils/index.d.ts +0 -1
  30. package/dist/internal/devtools/utils/index.d.ts.map +1 -1
  31. package/dist/internal/devtools/utils/index.js +0 -1
  32. package/dist/internal/initializers/BaseStoresInitializer.d.ts.map +1 -1
  33. package/dist/internal/initializers/BaseStoresInitializer.js +25 -58
  34. package/dist/internal/layout/DnDevLayout.js +3 -3
  35. package/dist/internal/layout/components/footer/FooterBranding.d.ts.map +1 -1
  36. package/dist/internal/layout/components/footer/FooterBranding.js +3 -1
  37. package/dist/routing/AuthGuard.d.ts +14 -10
  38. package/dist/routing/AuthGuard.d.ts.map +1 -1
  39. package/dist/routing/AuthGuard.js +25 -22
  40. package/dist/routing/Link.d.ts +2 -2
  41. package/dist/routing/Link.js +2 -2
  42. package/dist/routing/hooks/hooks.next.js +1 -1
  43. package/dist/routing/hooks/hooks.vite.js +1 -1
  44. package/dist/routing/hooks/useRedirectGuard.next.d.ts +2 -36
  45. package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
  46. package/dist/routing/hooks/useRedirectGuard.next.js +14 -55
  47. package/dist/routing/hooks/useRedirectGuard.vite.d.ts +2 -36
  48. package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
  49. package/dist/routing/hooks/useRedirectGuard.vite.js +14 -55
  50. package/dist/routing/index.d.ts +0 -1
  51. package/dist/routing/index.d.ts.map +1 -1
  52. package/dist/routing/index.js +1 -1
  53. package/dist/styles/index.css +137 -120
  54. package/dist/utils/assetResolver.d.ts +5 -5
  55. package/dist/utils/assetResolver.js +4 -4
  56. package/dist/utils/useAuthSafe.d.ts +25 -12
  57. package/dist/utils/useAuthSafe.d.ts.map +1 -1
  58. package/dist/utils/useAuthSafe.js +3 -1
  59. package/dist/utils/useAuthVisibility.d.ts +3 -3
  60. package/dist/utils/useAuthVisibility.d.ts.map +1 -1
  61. package/dist/utils/useAuthVisibility.js +25 -21
  62. package/dist/utils/useBillingVisibility.d.ts +2 -2
  63. package/dist/utils/useBillingVisibility.d.ts.map +1 -1
  64. package/dist/utils/useBillingVisibility.js +12 -13
  65. package/dist/utils/useCrudSafe.d.ts +1 -1
  66. package/dist/utils/useCrudSafe.d.ts.map +1 -1
  67. package/dist/utils/useCrudSafe.js +26 -13
  68. package/dist/utils/useOAuthSafe.d.ts +25 -12
  69. package/dist/utils/useOAuthSafe.d.ts.map +1 -1
  70. package/dist/utils/useStripeBillingSafe.d.ts +30 -18
  71. package/dist/utils/useStripeBillingSafe.d.ts.map +1 -1
  72. package/dist/utils/useStripeBillingSafe.js +5 -6
  73. package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
  74. package/dist/vite-routing/AppRoutes.js +5 -5
  75. package/dist/vite-routing/RootLayout.d.ts.map +1 -1
  76. package/dist/vite-routing/RootLayout.js +34 -7
  77. package/package.json +9 -9
  78. package/dist/internal/devtools/components/AuthTab.d.ts +0 -2
  79. package/dist/internal/devtools/components/AuthTab.d.ts.map +0 -1
  80. package/dist/internal/devtools/components/AuthTab.js +0 -98
  81. package/dist/internal/devtools/components/ColorRatioTab.d.ts +0 -2
  82. package/dist/internal/devtools/components/ColorRatioTab.d.ts.map +0 -1
  83. package/dist/internal/devtools/components/ColorRatioTab.js +0 -322
  84. package/dist/internal/devtools/components/DebugToggle.d.ts +0 -2
  85. package/dist/internal/devtools/components/DebugToggle.d.ts.map +0 -1
  86. package/dist/internal/devtools/components/DebugToggle.js +0 -57
  87. package/dist/internal/devtools/components/EnvironmentTab.d.ts +0 -2
  88. package/dist/internal/devtools/components/EnvironmentTab.d.ts.map +0 -1
  89. package/dist/internal/devtools/components/EnvironmentTab.js +0 -26
  90. package/dist/internal/devtools/components/I18nTab.d.ts +0 -2
  91. package/dist/internal/devtools/components/I18nTab.d.ts.map +0 -1
  92. package/dist/internal/devtools/components/I18nTab.js +0 -76
  93. package/dist/internal/devtools/components/OAuthGuideButton.d.ts +0 -10
  94. package/dist/internal/devtools/components/OAuthGuideButton.d.ts.map +0 -1
  95. package/dist/internal/devtools/components/OAuthGuideButton.js +0 -71
  96. package/dist/internal/devtools/components/StripeDebugTab.d.ts +0 -2
  97. package/dist/internal/devtools/components/StripeDebugTab.d.ts.map +0 -1
  98. package/dist/internal/devtools/components/StripeDebugTab.js +0 -175
  99. package/dist/internal/devtools/components/ThemesTab.d.ts +0 -2
  100. package/dist/internal/devtools/components/ThemesTab.d.ts.map +0 -1
  101. package/dist/internal/devtools/components/ThemesTab.js +0 -77
  102. package/dist/internal/devtools/utils/spacingAnalyzer.d.ts +0 -15
  103. package/dist/internal/devtools/utils/spacingAnalyzer.d.ts.map +0 -1
  104. package/dist/internal/devtools/utils/spacingAnalyzer.js +0 -88
@@ -1,537 +1,33 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  // packages/ui/src/internal/devtools/components/DebugDialog.tsx
4
4
  /**
5
5
  * @fileoverview Debug Dialog Component
6
- * @description Comprehensive debug panel with multiple tabs for discovery, stores, UI, environment, initialization flow, and errors
6
+ * @description Clean debug panel - Config, Design, Cookies, Stores
7
7
  *
8
- * @version 0.0.2
8
+ * @version 0.0.4
9
9
  * @since 0.0.1
10
10
  * @author AMBROISE PARK Consulting
11
11
  */
12
12
  import { PanelRight } from 'lucide-react';
13
- import { useState, useEffect } from 'react';
14
- import { cn, Button, BUTTON_VARIANT, Sheet, Tabs, Stack, ScrollArea, Accordion, Card, JsonViewer, CopyToClipboard, Text, Alert, ALERT_VARIANT, } from '@donotdev/components';
15
- import { BREAKPOINT_RANGES, getPlatformEnvVar } from '@donotdev/core';
16
- import { getDndevConfig } from '@donotdev/core';
17
- import { AuthTab } from './AuthTab';
18
- import { ColorRatioTab } from './ColorRatioTab';
13
+ import { useState } from 'react';
14
+ import { Button, BUTTON_VARIANT, Sheet, Tabs, Stack, ScrollArea, } from '@donotdev/components';
19
15
  import { ConfigTab } from './ConfigTab';
20
16
  import { CookieTab } from './CookieTab';
21
- import { EnvironmentTab } from './EnvironmentTab';
22
- import { I18nTab } from './I18nTab';
17
+ import { DesignTab } from './DesignTab';
23
18
  import { StoresTab } from './StoresTab';
24
- import { StripeDebugTab } from './StripeDebugTab';
25
- import { ThemesTab } from './ThemesTab';
26
- import { shouldMaskValue, maskSensitiveValue, maskSensitiveData, } from '../utils/maskSensitive';
27
- // Dynamic discovery functions
28
- const discoverEnvironment = () => {
29
- return {
30
- firebase: {
31
- apiKey: getPlatformEnvVar('FIREBASE_API_KEY') ? '✅ Set' : '❌ Missing',
32
- projectId: getPlatformEnvVar('FIREBASE_PROJECT_ID')
33
- ? '✅ Set'
34
- : '❌ Missing',
35
- storageBucket: getPlatformEnvVar('FIREBASE_STORAGE_BUCKET')
36
- ? '✅ Set'
37
- : '⚠️ Optional',
38
- appId: getPlatformEnvVar('FIREBASE_APP_ID') ? '✅ Set' : '⚠️ Optional',
39
- },
40
- oauth: {
41
- googleClientId: getPlatformEnvVar('GOOGLE_CLIENT_ID')
42
- ? '✅ Set'
43
- : '❌ Missing',
44
- githubClientId: getPlatformEnvVar('GITHUB_CLIENT_ID')
45
- ? '✅ Set'
46
- : '❌ Missing',
47
- authPartners: getPlatformEnvVar('AUTH_PARTNERS')
48
- ? '✅ Set'
49
- : '❌ Missing',
50
- },
51
- authPartners: {
52
- value: getPlatformEnvVar('AUTH_PARTNERS') || 'Not Set',
53
- enabled: getPlatformEnvVar('AUTH_PARTNERS')
54
- ? getPlatformEnvVar('AUTH_PARTNERS')
55
- .split(',')
56
- .map((p) => p.trim())
57
- : [],
58
- },
59
- demoMode: window.__FIREBASE_DEMO_MODE__
60
- ? '❌ Enabled (Auth disabled)'
61
- : '✅ Disabled (Auth enabled)',
62
- };
63
- };
64
- const discoverListeners = () => {
65
- const listeners = {};
66
- // Try to discover from storeEventManager or config
67
- const config = getDndevConfig();
68
- if (config) {
69
- if (config.eventManager) {
70
- Object.entries(config.eventManager.listeners || {}).forEach(([name, listener]) => {
71
- listeners[name] = {
72
- status: listener.active ? 'active' : 'inactive',
73
- events: listener.events || [],
74
- lastEvent: listener.lastEvent || null,
75
- error: listener.error || null,
76
- };
77
- });
78
- }
79
- }
80
- return listeners;
81
- };
82
- const discoverPerformance = () => {
83
- const metrics = {
84
- start: null,
85
- phases: {},
86
- total: null,
87
- };
88
- const config = getDndevConfig();
89
- if (config?.performance) {
90
- metrics.start = config.performance.startTime;
91
- metrics.phases = config.performance.phases || {};
92
- metrics.total = config.performance.total;
93
- }
94
- return metrics;
95
- };
96
- const discoverErrors = () => {
97
- const errors = {
98
- critical: [],
99
- warnings: [],
100
- suggestions: [],
101
- };
102
- const config = getDndevConfig();
103
- if (config?.errors) {
104
- errors.critical = config.errors.critical || [];
105
- errors.warnings = config.errors.warnings || [];
106
- errors.suggestions = config.errors.suggestions || [];
107
- }
108
- return errors;
109
- };
110
- const discoverInitializationFlow = () => {
111
- const flow = {
112
- coreStores: {
113
- status: 'initialized',
114
- stores: [],
115
- },
116
- providers: {
117
- status: 'active',
118
- hierarchy: [],
119
- },
120
- };
121
- // Check core stores
122
- if (typeof window !== 'undefined') {
123
- try {
124
- // Try to access core stores
125
- const config = getDndevConfig();
126
- const coreStores = [
127
- { name: 'ThemeStore', check: () => config?.themes },
128
- { name: 'LoadingStore', check: () => true }, // Always available
129
- { name: 'ErrorStore', check: () => true }, // Always available
130
- { name: 'OverlayStore', check: () => true }, // Always available
131
- { name: 'NetworkStore', check: () => true }, // Always available
132
- { name: 'NavigationStore', check: () => config?.routes },
133
- { name: 'AbortControllerStore', check: () => true }, // Always available
134
- ];
135
- coreStores.forEach((store) => {
136
- try {
137
- const isAvailable = store.check();
138
- flow.coreStores.stores.push({
139
- name: store.name,
140
- status: isAvailable ? 'ready' : 'missing',
141
- error: isAvailable ? undefined : 'Store not available',
142
- });
143
- }
144
- catch (error) {
145
- flow.coreStores.stores.push({
146
- name: store.name,
147
- status: 'error',
148
- error: error instanceof Error ? error.message : 'Unknown error',
149
- });
150
- }
151
- });
152
- }
153
- catch (error) {
154
- flow.coreStores.status = 'error';
155
- flow.coreStores.stores.push({
156
- name: 'CoreStores',
157
- status: 'error',
158
- error: error instanceof Error ? error.message : 'Unknown error',
159
- });
160
- }
161
- // Check provider hierarchy - INDIVIDUAL providers, not groups
162
- const providerHierarchy = [
163
- // Top-level providers
164
- { name: 'Suspense', status: 'active', lazy: false, group: 'React' },
165
- { name: 'HelmetProvider', status: 'active', lazy: false, group: 'SEO' },
166
- // Store initialization
167
- {
168
- name: 'ViteStoreInitializer',
169
- status: 'active',
170
- lazy: false,
171
- group: 'Stores',
172
- },
173
- // Navigation & Routing
174
- {
175
- name: 'NavigationProvider',
176
- status: 'active',
177
- lazy: false,
178
- group: 'Routing',
179
- },
180
- // Internationalization
181
- { name: 'I18nProvider', status: 'active', lazy: false, group: 'i18n' },
182
- // Core Providers (expanded) - Loading now handled by Zustand store
183
- // Query Providers (expanded)
184
- {
185
- name: 'QueryClientProvider',
186
- status: 'conditional',
187
- lazy: true,
188
- group: 'Data',
189
- },
190
- // UI Providers (expanded)
191
- { name: 'ErrorBoundary', status: 'active', lazy: false, group: 'UI' },
192
- { name: 'TooltipProvider', status: 'active', lazy: false, group: 'UI' },
193
- { name: 'ErrorProvider', status: 'active', lazy: false, group: 'UI' },
194
- { name: 'ToastProvider', status: 'active', lazy: false, group: 'UI' },
195
- // LoadingUIProvider removed - now handled by Zustand store
196
- { name: 'ModalProvider', status: 'active', lazy: false, group: 'UI' },
197
- { name: 'Toaster', status: 'active', lazy: false, group: 'UI' },
198
- // Layout & Content
199
- { name: 'Layout', status: 'active', lazy: false, group: 'Layout' },
200
- { name: 'FaviconHead', status: 'conditional', lazy: false, group: 'SEO' },
201
- {
202
- name: 'AutoMetaTags',
203
- status: 'conditional',
204
- lazy: false,
205
- group: 'SEO',
206
- },
207
- // Feature Providers (lazy)
208
- { name: 'AuthProvider', status: 'lazy', lazy: true, group: 'Features' },
209
- {
210
- name: 'BillingProvider',
211
- status: 'lazy',
212
- lazy: true,
213
- group: 'Features',
214
- },
215
- { name: 'OAuthProvider', status: 'lazy', lazy: true, group: 'Features' },
216
- // App Content
217
- { name: 'AppRoutes', status: 'active', lazy: false, group: 'App' },
218
- ];
219
- flow.providers.hierarchy = providerHierarchy;
220
- }
221
- return flow;
222
- };
223
- // Debug tab components
224
- const DiscoveryDebugTab = () => {
225
- const [data, setData] = useState(() => {
226
- const config = getDndevConfig();
227
- if (config?.env) {
228
- return {
229
- ...config,
230
- env: maskSensitiveData(config.env),
231
- };
232
- }
233
- return config;
234
- });
235
- useEffect(() => {
236
- const interval = setInterval(() => {
237
- const newData = getDndevConfig();
238
- if (newData) {
239
- setData({
240
- ...newData,
241
- env: newData.env ? maskSensitiveData(newData.env) : newData.env,
242
- });
243
- }
244
- }, 1000);
245
- return () => clearInterval(interval);
246
- }, []);
247
- const formatJSON = (data) => {
248
- try {
249
- return JSON.stringify(data, null, 2);
250
- }
251
- catch (error) {
252
- return 'Error formatting data';
253
- }
254
- };
255
- const copyToClipboard = async (text, label) => {
256
- try {
257
- await navigator.clipboard.writeText(text);
258
- console.log(`✅ Copied ${label} to clipboard`);
259
- }
260
- catch (error) {
261
- console.error(`❌ Failed to copy ${label}:`, error);
262
- }
263
- };
264
- if (!data) {
265
- return (_jsx("div", { style: { padding: 'var(--gap-lg) 0' }, children: "No discovery data found. Config is not available." }));
266
- }
267
- return (_jsxs("div", { className: "dndev-flex dndev-gap-lg", children: [_jsxs("div", { className: "dndev-flex dndev-items-center dndev-justify-between", children: [_jsx("h3", { children: "Discovery Data (Config)" }), _jsx("button", { onClick: () => copyToClipboard(formatJSON(data), 'Discovery Data'), style: {
268
- paddingLeft: 'var(--spacing-md)',
269
- paddingRight: 'var(--spacing-md)',
270
- paddingTop: 'var(--spacing-sm)',
271
- paddingBottom: 'var(--spacing-sm)',
272
- backgroundColor: 'rgb(219 234 254)',
273
- color: 'rgb(30 64 175)',
274
- borderRadius: 'var(--radius)',
275
- }, onMouseEnter: (e) => (e.currentTarget.style.backgroundColor = 'rgb(191 219 254)'), onMouseLeave: (e) => (e.currentTarget.style.backgroundColor = 'rgb(219 234 254)'), children: "\uD83D\uDCCB Copy to Clipboard" })] }), data.themes && (_jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsxs("h4", { style: { color: 'rgb(147 51 234)' }, children: ["Themes (", data.themes.discovered?.length || 0, " found)"] }), _jsx("div", { style: { borderRadius: 'var(--radius-lg)' }, children: _jsx("pre", { className: "dndev-overflow-y-auto", style: { maxHeight: '16rem' }, children: formatJSON(data.themes) }) })] })), data.routes && (_jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsxs("h4", { style: { color: 'rgb(37 99 235)' }, children: ["Routes (", data.routes.mapping?.length || 0, " found)"] }), _jsx("div", { style: { borderRadius: 'var(--radius-lg)' }, children: _jsx("pre", { className: "dndev-overflow-y-auto", style: { maxHeight: '16rem' }, children: formatJSON(data.routes) }) })] })), data.i18n && (_jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsxs("h4", { style: { color: 'rgb(22 163 74)' }, children: ["I18n (", Object.keys(data.i18n.content || {}).length, " namespaces)"] }), _jsx("div", { style: { borderRadius: 'var(--radius-lg)' }, children: _jsx("pre", { className: "dndev-overflow-y-auto", style: { maxHeight: '16rem' }, children: formatJSON(data.i18n) }) })] })), data.features && (_jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsxs("h4", { style: { color: 'rgb(234 88 12)' }, children: ["Features (", Object.keys(data.features).length, " found)"] }), _jsx("div", { style: { borderRadius: 'var(--radius-lg)' }, children: _jsx("pre", { className: "dndev-overflow-y-auto", style: { maxHeight: '16rem' }, children: formatJSON(data.features) }) })] })), data.assets && (_jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h4", { style: { color: 'rgb(220 38 38)' }, children: "Assets" }), _jsx("div", { style: { borderRadius: 'var(--radius-lg)' }, children: _jsx("pre", { className: "dndev-overflow-y-auto", style: { maxHeight: '16rem' }, children: formatJSON(data.assets) }) })] })), _jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h4", { style: { color: 'rgb(75 85 99)' }, children: "Complete Raw Data" }), _jsx("div", { style: { borderRadius: 'var(--radius-lg)' }, children: _jsx("pre", { className: "dndev-overflow-y-auto", style: { maxHeight: '24rem' }, children: formatJSON(data) }) })] })] }));
276
- };
277
- const UIDebugTab = () => {
278
- const [componentData, setComponentData] = useState({});
279
- useEffect(() => {
280
- const interval = setInterval(() => {
281
- // Gather UI-related debug data
282
- const uiData = {
283
- viewport: {
284
- width: window.innerWidth,
285
- height: window.innerHeight,
286
- devicePixelRatio: window.devicePixelRatio,
287
- },
288
- theme: {
289
- currentTheme: document.documentElement.getAttribute('data-theme'),
290
- colorScheme: window.getComputedStyle(document.documentElement)
291
- .colorScheme,
292
- darkMode: document.documentElement.classList.contains('dark'),
293
- },
294
- layout: {
295
- dataLayout: document.documentElement.getAttribute('data-layout'),
296
- layoutPreset: document.documentElement.getAttribute('data-layout-preset'),
297
- },
298
- breakpoints: {
299
- mobile: window.matchMedia(`(max-width: ${BREAKPOINT_RANGES.tablet.min - 1}px)`).matches,
300
- tablet: window.matchMedia(`(min-width: ${BREAKPOINT_RANGES.tablet.min}px) and (max-width: ${BREAKPOINT_RANGES.desktop.min - 1}px)`).matches,
301
- desktop: window.matchMedia(`(min-width: ${BREAKPOINT_RANGES.desktop.min}px) and (max-width: ${BREAKPOINT_RANGES.wide.min - 1}px)`).matches,
302
- wide: window.matchMedia(`(min-width: ${BREAKPOINT_RANGES.wide.min}px)`).matches,
303
- },
304
- debug: {
305
- debugEnabled: document.documentElement.style.getPropertyValue('--debug-enabled') === '1',
306
- debugBorders: !!document.querySelector('[data-debug="true"]'),
307
- },
308
- components: {
309
- debugTools: !!document.querySelector('[data-debug-tools="true"]'),
310
- modals: document.querySelectorAll('[role="dialog"]').length,
311
- tooltips: document.querySelectorAll('[role="tooltip"]').length,
312
- dropdowns: document.querySelectorAll('[role="menu"]').length,
313
- },
314
- };
315
- setComponentData(uiData);
316
- }, 1000);
317
- return () => clearInterval(interval);
318
- }, []);
319
- return (_jsxs("div", { className: "dndev-flex dndev-gap-lg", children: [_jsx("h3", { children: "UI Debug Information" }), _jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h4", { style: { color: 'rgb(37 99 235)' }, children: "Viewport" }), _jsxs("div", { className: "dndev-grid dndev-grid-cols-2 dndev-gap-md", children: [_jsxs("div", { children: [_jsx("div", { children: "Dimensions" }), _jsxs("div", { children: [componentData.viewport?.width, " \u00D7 ", componentData.viewport?.height] })] }), _jsxs("div", { children: [_jsx("div", { children: "Device Pixel Ratio" }), _jsx("div", { children: componentData.viewport?.devicePixelRatio })] })] })] }), _jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h4", { style: { color: 'rgb(147 51 234)' }, children: "Theme" }), _jsxs("div", { className: "dndev-grid dndev-grid-cols-3 dndev-gap-md", children: [_jsxs("div", { children: [_jsx("div", { children: "Current Theme" }), _jsx("div", { children: componentData.theme?.currentTheme || 'Not set' })] }), _jsxs("div", { children: [_jsx("div", { children: "Color Scheme" }), _jsx("div", { children: componentData.theme?.colorScheme || 'Not set' })] }), _jsxs("div", { children: [_jsx("div", { children: "Dark Mode" }), _jsx("div", { children: componentData.theme?.darkMode ? '✅ Yes' : '❌ No' })] })] })] }), _jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h4", { style: { color: 'rgb(22 163 74)' }, children: "Layout" }), _jsxs("div", { className: "dndev-grid dndev-grid-cols-2 dndev-gap-md", children: [_jsxs("div", { children: [_jsx("div", { children: "Data Layout" }), _jsx("div", { children: componentData.layout?.dataLayout || 'Not set' })] }), _jsxs("div", { children: [_jsx("div", { children: "Layout Preset" }), _jsx("div", { children: componentData.layout?.layoutPreset || 'Not set' })] })] })] }), _jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h4", { style: { color: 'rgb(234 88 12)' }, children: "Breakpoints" }), _jsx("div", { className: "dndev-grid dndev-grid-cols-4 dndev-gap-md", children: Object.entries(componentData.breakpoints || {}).map(([name, active]) => (_jsxs("div", { children: [_jsx("div", { className: "capitalize", children: name }), _jsx("div", { children: active ? '✅ Active' : '❌ Inactive' })] }, name))) })] }), _jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h4", { style: { color: 'rgb(220 38 38)' }, children: "Active Components" }), _jsx("div", { className: "dndev-grid dndev-grid-cols-4 dndev-gap-md", children: Object.entries(componentData.components || {}).map(([name, count]) => (_jsxs("div", { children: [_jsx("div", { className: "capitalize", children: name }), _jsx("div", { children: typeof count === 'boolean'
320
- ? count
321
- ? '✅ Yes'
322
- : '❌ No'
323
- : String(count) })] }, name))) })] }), _jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h4", { style: { color: 'rgb(75 85 99)' }, children: "Debug Status" }), _jsxs("div", { className: "dndev-grid dndev-grid-cols-2 dndev-gap-md", children: [_jsxs("div", { children: [_jsx("div", { children: "Debug Enabled" }), _jsx("div", { children: componentData.debug?.debugEnabled ? '✅ Yes' : '❌ No' })] }), _jsxs("div", { children: [_jsx("div", { children: "Debug Borders" }), _jsx("div", { children: componentData.debug?.debugBorders ? '✅ Yes' : '❌ No' })] })] })] })] }));
324
- };
325
- const EnvironmentDebugTab = () => {
326
- const [data, setData] = useState(discoverEnvironment());
327
- useEffect(() => {
328
- const interval = setInterval(() => {
329
- setData(discoverEnvironment());
330
- }, 1000);
331
- return () => clearInterval(interval);
332
- }, []);
333
- return (_jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h3", { children: "Environment Variables" }), _jsxs("div", { className: "dndev-grid dndev-grid-cols-1 dndev-gap-md", children: [_jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h4", { style: { color: 'rgb(37 99 235)' }, children: "Firebase Configuration" }), _jsx("div", { className: "dndev-flex dndev-gap-sm", children: Object.entries(data.firebase).map(([key, value]) => (_jsxs("div", { className: "dndev-flex dndev-items-center dndev-gap-sm", children: [_jsxs("span", { style: { width: '8rem' }, children: [key, ":"] }), _jsx("span", { style: {
334
- padding: 'calc(var(--gap-sm) / 2) var(--gap-sm)',
335
- borderRadius: 'var(--radius)',
336
- fontSize: 'var(--font-size-xs)',
337
- backgroundColor: value.includes('✅')
338
- ? 'rgb(220 252 231)'
339
- : value.includes('⚠️')
340
- ? 'rgb(254 249 195)'
341
- : 'rgb(254 226 226)',
342
- color: value.includes('✅')
343
- ? 'rgb(22 101 52)'
344
- : value.includes('⚠️')
345
- ? 'rgb(133 77 14)'
346
- : 'rgb(153 27 27)',
347
- }, children: value })] }, key))) })] }), _jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h4", { style: { color: 'rgb(22 163 74)' }, children: "OAuth Configuration" }), _jsx("div", { className: "dndev-flex dndev-gap-sm", children: Object.entries(data.oauth).map(([key, value]) => (_jsxs("div", { className: "dndev-flex dndev-items-center dndev-gap-sm", children: [_jsxs("span", { style: { width: '8rem' }, children: [key, ":"] }), _jsx("span", { style: {
348
- padding: 'calc(var(--gap-sm) / 2) var(--gap-sm)',
349
- borderRadius: 'var(--radius)',
350
- fontSize: 'var(--font-size-xs)',
351
- backgroundColor: value.includes('✅')
352
- ? 'rgb(220 252 231)'
353
- : 'rgb(254 226 226)',
354
- color: value.includes('✅')
355
- ? 'rgb(22 101 52)'
356
- : 'rgb(153 27 27)',
357
- }, children: value })] }, key))) })] })] }), _jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h4", { children: "Auth Partners Configuration" }), _jsxs("div", { className: "dndev-flex dndev-gap-sm", children: [_jsxs("div", { className: "dndev-flex dndev-items-center dndev-gap-sm", children: [_jsx("span", { style: { width: '8rem' }, children: "Value:" }), _jsx("span", { style: { fontFamily: 'monospace', paddingBlock: '0.25rem' }, children: data.authPartners.value !== 'Not Set' &&
358
- shouldMaskValue('AUTH_PARTNERS', data.authPartners.value)
359
- ? `${maskSensitiveValue(data.authPartners.value)} (masked)`
360
- : data.authPartners.value })] }), _jsxs("div", { className: "dndev-flex dndev-items-center dndev-gap-sm", children: [_jsx("span", { style: { width: '8rem' }, children: "Enabled:" }), _jsx("div", { className: "dndev-flex dndev-gap-sm", children: data.authPartners.enabled.length > 0 ? (data.authPartners.enabled.map((partner, index) => (_jsx("span", { style: {
361
- paddingLeft: 'var(--spacing-md)',
362
- paddingRight: 'var(--spacing-md)',
363
- paddingTop: 'var(--spacing-sm)',
364
- paddingBottom: 'var(--spacing-sm)',
365
- backgroundColor: 'rgb(from var(--success) r g b / 0.1)',
366
- color: 'var(--success)',
367
- }, children: partner }, index)))) : (_jsx("span", { style: {
368
- paddingLeft: 'var(--spacing-md)',
369
- paddingRight: 'var(--spacing-md)',
370
- paddingTop: 'var(--spacing-sm)',
371
- paddingBottom: 'var(--spacing-sm)',
372
- backgroundColor: 'rgb(from var(--destructive) r g b / 0.1)',
373
- color: 'var(--destructive)',
374
- }, children: "None" })) })] })] })] }), _jsxs("div", { className: "dndev-grid dndev-gap-sm", children: [_jsx("h4", { children: "Firebase Status" }), _jsxs("div", { className: "dndev-flex dndev-items-center dndev-gap-sm", children: [_jsx("span", { children: "Demo Mode:" }), _jsx("span", { style: {
375
- padding: 'calc(var(--gap-sm) / 2) var(--gap-sm)',
376
- borderRadius: 'var(--radius)',
377
- fontSize: 'var(--font-size-xs)',
378
- backgroundColor: data.demoMode.includes('❌')
379
- ? 'rgb(254 226 226)'
380
- : 'rgb(220 252 231)',
381
- color: data.demoMode.includes('❌')
382
- ? 'rgb(153 27 27)'
383
- : 'rgb(22 101 52)',
384
- }, children: data.demoMode })] })] })] }));
385
- };
386
- const ListenersDebugTab = () => {
387
- const [data, setData] = useState(discoverListeners());
388
- useEffect(() => {
389
- const interval = setInterval(() => {
390
- setData(discoverListeners());
391
- }, 1000);
392
- return () => clearInterval(interval);
393
- }, []);
394
- return (_jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h3", { children: "Event Listeners" }), _jsx("div", { className: "dndev-grid dndev-gap-sm", children: Object.entries(data).map(([name, listener]) => (_jsxs("div", { children: [_jsxs("div", { className: "dndev-flex dndev-items-center dndev-gap-sm", children: [_jsxs("span", { className: "font-mono", children: [name, ":"] }), _jsx("span", { style: {
395
- padding: 'calc(var(--gap-sm) / 2) var(--gap-sm)',
396
- borderRadius: 'var(--radius)',
397
- fontSize: 'var(--font-size-xs)',
398
- backgroundColor: listener.status === 'active'
399
- ? 'rgb(220 252 231)'
400
- : 'rgb(254 226 226)',
401
- color: listener.status === 'active'
402
- ? 'rgb(22 101 52)'
403
- : 'rgb(153 27 27)',
404
- }, children: listener.status === 'active' ? '✅ Active' : '❌ Inactive' })] }), _jsxs("div", { children: [_jsxs("div", { children: ["Events: ", listener.events.join(', ') || 'None'] }), _jsxs("div", { children: ["Last Event: ", listener.lastEvent || 'None'] }), listener.error && (_jsxs("div", { style: { color: 'rgb(220 38 38)' }, children: ["Error: ", listener.error] }))] })] }, name))) })] }));
405
- };
406
- const PerformanceDebugTab = () => {
407
- const [data, setData] = useState(discoverPerformance());
408
- useEffect(() => {
409
- const interval = setInterval(() => {
410
- setData(discoverPerformance());
411
- }, 1000);
412
- return () => clearInterval(interval);
413
- }, []);
414
- return (_jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h3", { children: "Performance Metrics" }), _jsxs("div", { className: "dndev-grid dndev-gap-sm", children: [_jsxs("div", { children: [_jsx("div", { children: "Initialization Timeline" }), _jsxs("div", { children: [_jsxs("div", { children: ["Start:", ' ', data.start
415
- ? new Date(data.start).toLocaleTimeString()
416
- : 'Unknown'] }), _jsxs("div", { children: ["Total: ", data.total ? `${data.total}ms` : 'Unknown'] })] })] }), _jsxs("div", { children: [_jsx("div", { children: "Phase Breakdown" }), _jsx("div", { className: "dndev-flex dndev-gap-sm", children: Object.entries(data.phases).map(([phase, timing]) => (_jsxs("div", { className: "dndev-flex dndev-justify-between", children: [_jsxs("span", { className: "font-mono", children: [phase, ":"] }), _jsx("span", { children: timing ? `${timing}ms` : 'Unknown' })] }, phase))) })] })] })] }));
417
- };
418
- const ErrorsDebugTab = () => {
419
- const [data, setData] = useState(discoverErrors());
420
- useEffect(() => {
421
- const interval = setInterval(() => {
422
- setData(discoverErrors());
423
- }, 1000);
424
- return () => clearInterval(interval);
425
- }, []);
426
- return (_jsxs("div", { className: "dndev-grid dndev-gap-md", children: [_jsx("h3", { children: "Errors & Issues" }), data.critical.length > 0 && (_jsxs("div", { className: "dndev-grid dndev-gap-sm", children: [_jsx("h4", { style: { color: 'rgb(220 38 38)' }, children: "Critical Issues" }), data.critical.map((error, index) => (_jsx("div", { style: {
427
- border: '1px solid var(--destructive)',
428
- color: 'var(--destructive)',
429
- padding: 'var(--spacing-sm)',
430
- }, children: error }, index)))] })), data.warnings.length > 0 && (_jsxs("div", { className: "dndev-grid dndev-gap-sm", children: [_jsx("h4", { style: { color: 'rgb(202 138 4)' }, children: "Warnings" }), data.warnings.map((warning, index) => (_jsx("div", { style: {
431
- border: '1px solid var(--warning)',
432
- color: 'var(--warning)',
433
- padding: 'var(--spacing-sm)',
434
- }, children: warning }, index)))] })), data.suggestions.length > 0 && (_jsxs("div", { className: "dndev-grid dndev-gap-sm", children: [_jsx("h4", { style: { color: 'rgb(37 99 235)' }, children: "Suggestions" }), data.suggestions.map((suggestion, index) => (_jsx("div", { style: {
435
- border: '1px solid var(--accent)',
436
- color: 'var(--accent)',
437
- padding: 'var(--spacing-sm)',
438
- }, children: suggestion }, index)))] })), data.critical.length === 0 &&
439
- data.warnings.length === 0 &&
440
- data.suggestions.length === 0 && (_jsx("div", { style: { padding: 'var(--gap-lg) 0' }, children: "No issues found. Everything looks good! \uD83C\uDF89" }))] }));
441
- };
442
- const InitializationFlowDebugTab = () => {
443
- const [data, setData] = useState(discoverInitializationFlow());
444
- useEffect(() => {
445
- const interval = setInterval(() => {
446
- setData(discoverInitializationFlow());
447
- }, 1000);
448
- return () => clearInterval(interval);
449
- }, []);
450
- const getStatusColor = (status) => {
451
- switch (status) {
452
- case 'ready':
453
- case 'active':
454
- case 'all_initialized':
455
- return { backgroundColor: 'rgb(220 252 231)', color: 'rgb(22 101 52)' };
456
- case 'missing':
457
- case 'error':
458
- case 'broken':
459
- case 'none_initialized':
460
- return { backgroundColor: 'rgb(254 226 226)', color: 'rgb(153 27 27)' };
461
- case 'pending':
462
- case 'partial':
463
- return { backgroundColor: 'rgb(254 249 195)', color: 'rgb(133 77 14)' };
464
- case 'conditional':
465
- return { backgroundColor: 'rgb(219 234 254)', color: 'rgb(30 64 175)' };
466
- default:
467
- return { backgroundColor: 'rgb(243 244 246)', color: 'rgb(31 41 55)' };
468
- }
469
- };
470
- return (_jsxs("div", { className: "dndev-flex dndev-gap-lg", children: [_jsx("h3", { children: "Initialization Flow & Status" }), _jsxs("div", { className: "dndev-flex dndev-gap-md", children: [_jsx("h4", { style: { color: 'rgb(37 99 235)' }, children: "Core Stores (Eager Loading)" }), _jsxs("div", { children: [_jsxs("div", { className: "dndev-flex dndev-items-center dndev-gap-sm", children: [_jsx("span", { children: "Status:" }), _jsx("span", { style: {
471
- padding: 'calc(var(--gap-sm) / 2) var(--gap-sm)',
472
- borderRadius: 'var(--radius)',
473
- fontSize: 'var(--font-size-xs)',
474
- ...getStatusColor(data.coreStores.status),
475
- }, children: data.coreStores.status })] }), _jsx("div", { className: "dndev-grid dndev-gap-sm", children: data.coreStores.stores.map((store, index) => (_jsxs("div", { className: "dndev-flex dndev-items-center dndev-justify-between", children: [_jsxs("span", { className: "font-mono", children: [store.name, ":"] }), _jsxs("div", { className: "dndev-flex dndev-items-center dndev-gap-sm", children: [_jsx("span", { style: {
476
- padding: 'calc(var(--gap-sm) / 2) var(--gap-sm)',
477
- borderRadius: 'var(--radius)',
478
- fontSize: 'var(--font-size-xs)',
479
- ...getStatusColor(store.status),
480
- }, children: store.status }), store.error && (_jsx("span", { style: { color: 'rgb(220 38 38)' }, title: store.error, children: "\u26A0\uFE0F" }))] })] }, index))) })] })] }), _jsxs("div", { className: "dndev-flex dndev-gap-md", children: [_jsx("h4", { style: { color: 'rgb(147 51 234)' }, children: "Provider Hierarchy (Individual Components)" }), _jsx("div", { className: "dndev-flex dndev-gap-md", children: Object.entries(data.providers.hierarchy.reduce((groups, provider) => {
481
- const group = provider.group || 'Other';
482
- if (!groups[group])
483
- groups[group] = [];
484
- groups[group].push(provider);
485
- return groups;
486
- }, {})).map(([groupName, providers]) => (_jsxs("div", { children: [_jsxs("div", { style: { color: 'rgb(126 34 206)' }, children: [groupName, " (", providers.length, ")"] }), _jsx("div", { className: "dndev-grid dndev-gap-sm", children: providers.map((provider, index) => (_jsxs("div", { className: "dndev-flex dndev-items-center dndev-justify-between", children: [_jsxs("div", { className: "dndev-flex dndev-items-center dndev-gap-sm", children: [_jsx("span", { className: "font-mono", children: provider.name }), provider.lazy && (_jsx("span", { style: { color: 'rgb(37 99 235)' }, children: "(lazy)" })), provider.status === 'conditional' && (_jsx("span", { style: { color: 'rgb(234 88 12)' }, children: "(conditional)" }))] }), _jsx("span", { style: {
487
- padding: 'calc(var(--gap-sm) / 2) var(--gap-sm)',
488
- borderRadius: 'var(--radius)',
489
- fontSize: 'var(--font-size-xs)',
490
- ...getStatusColor(provider.status),
491
- }, children: provider.status })] }, index))) })] }, groupName))) })] })] }));
492
- };
493
19
  export const DebugDialog = () => {
494
20
  const [open, setOpen] = useState(false);
495
- // Debug: Log when dialog component renders
496
- useEffect(() => { }, [open]);
497
- const formatJSON = (data) => {
498
- try {
499
- return JSON.stringify(data, null, 2);
500
- }
501
- catch (error) {
502
- return 'Error formatting data';
503
- }
504
- };
505
- 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: "Debug Panel", className: "dndev-h-[80vh] dndev-max-h-[80vh]", 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: [
21
+ 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: "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: [
506
22
  {
507
23
  value: 'config',
508
24
  label: 'Config',
509
25
  content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(ConfigTab, {}) })),
510
26
  },
511
27
  {
512
- value: 'themes',
513
- label: 'Themes',
514
- content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(ThemesTab, {}) })),
515
- },
516
- {
517
- value: 'i18n',
518
- label: 'i18n',
519
- content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(I18nTab, {}) })),
520
- },
521
- {
522
- value: 'environment',
523
- label: 'Environment',
524
- content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(EnvironmentTab, {}) })),
525
- },
526
- {
527
- value: 'auth',
528
- label: 'Auth',
529
- content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(AuthTab, {}) })),
530
- },
531
- {
532
- value: 'stripe',
533
- label: 'Stripe',
534
- content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(StripeDebugTab, {}) })),
28
+ value: 'design',
29
+ label: 'Design',
30
+ content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(DesignTab, {}) })),
535
31
  },
536
32
  {
537
33
  value: 'cookies',
@@ -543,12 +39,7 @@ export const DebugDialog = () => {
543
39
  label: 'Stores',
544
40
  content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(StoresTab, {}) })),
545
41
  },
546
- {
547
- value: 'color-ratio',
548
- label: 'Color Ratio',
549
- content: (_jsx(ScrollArea, { className: "dndev-h-full", style: { height: '100%' }, children: _jsx(ColorRatioTab, {}) })),
550
- },
551
- ], listClassName: "dndev-flex- dndev-flex dndev-flex-row dndev-gap-sm", listStyle: {
42
+ ], listClassName: "dndev-flex dndev-flex-row dndev-gap-sm", listStyle: {
552
43
  borderBottom: '1px solid var(--border)',
553
44
  backgroundColor: 'transparent',
554
45
  } }) }) }));
@@ -0,0 +1,2 @@
1
+ export declare const DesignTab: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=DesignTab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DesignTab.d.ts","sourceRoot":"","sources":["../../../../src/internal/devtools/components/DesignTab.tsx"],"names":[],"mappings":"AAgDA,eAAO,MAAM,SAAS,+CA8XrB,CAAC"}