@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.
- package/dist/components/auth/AuthHeader.js +1 -93
- package/dist/components/auth/AuthMenu.d.ts.map +1 -1
- package/dist/components/auth/AuthMenu.js +3 -286
- package/dist/components/auth/index.js +1 -9
- package/dist/components/common/FeatureCard.d.ts.map +1 -1
- package/dist/components/common/FeatureCard.js +1 -86
- package/dist/components/common/FeatureDisabled.js +1 -67
- package/dist/components/common/IconPlaceholder.d.ts +24 -0
- package/dist/components/common/IconPlaceholder.d.ts.map +1 -0
- package/dist/components/common/IconPlaceholder.js +1 -0
- package/dist/components/common/LazyLucideIcon.d.ts +39 -0
- package/dist/components/common/LazyLucideIcon.d.ts.map +1 -0
- package/dist/components/common/LazyLucideIcon.js +1 -0
- package/dist/components/common/ProgressBar.js +1 -84
- package/dist/components/common/RedirectOverlay.js +1 -243
- package/dist/components/common/Skeleton.js +1 -144
- package/dist/components/common/TechBento.d.ts.map +1 -1
- package/dist/components/common/TechBento.js +1 -53
- package/dist/components/common/icon.d.ts +1 -1
- package/dist/components/common/icon.d.ts.map +1 -1
- package/dist/components/common/icon.js +1 -84
- package/dist/components/common/iconByName.d.ts +33 -0
- package/dist/components/common/iconByName.d.ts.map +1 -0
- package/dist/components/common/iconByName.js +1 -0
- package/dist/components/common/index.js +1 -16
- package/dist/components/cookie-consent/ConsentBanner.d.ts +3 -1
- package/dist/components/cookie-consent/ConsentBanner.d.ts.map +1 -1
- package/dist/components/cookie-consent/ConsentBanner.js +1 -31
- package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
- package/dist/components/cookie-consent/CookieConsent.js +1 -183
- package/dist/components/cookie-consent/index.js +1 -11
- package/dist/components/cookie-consent/useCookieNoticeRequired.d.ts +7 -0
- package/dist/components/cookie-consent/useCookieNoticeRequired.d.ts.map +1 -0
- package/dist/components/cookie-consent/useCookieNoticeRequired.js +1 -0
- package/dist/components/index.js +1 -13
- package/dist/components/layout/GameContainer.d.ts.map +1 -1
- package/dist/components/layout/GameContainer.js +1 -72
- package/dist/components/layout/GameFlow.d.ts.map +1 -1
- package/dist/components/layout/GameFlow.js +1 -93
- package/dist/components/layout/PageConfig.d.ts.map +1 -1
- package/dist/components/layout/PageConfig.js +1 -47
- package/dist/components/layout/PageContainer.d.ts.map +1 -1
- package/dist/components/layout/PageContainer.js +1 -38
- package/dist/components/layout/components/Breadcrumbs.d.ts +2 -1
- package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/layout/components/Breadcrumbs.js +1 -89
- package/dist/components/layout/components/DropdownNavigation.d.ts.map +1 -1
- package/dist/components/layout/components/DropdownNavigation.js +1 -30
- package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts.map +1 -1
- package/dist/components/layout/components/FloatingLanguageSwitcher.js +1 -26
- package/dist/components/layout/components/Notifications.js +1 -182
- package/dist/components/layout/components/header/AppBranding.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppBranding.js +1 -54
- package/dist/components/layout/components/header/AppIcon.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppIcon.js +1 -59
- package/dist/components/layout/components/header/AppTitle.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppTitle.js +1 -40
- package/dist/components/layout/components/header/CacheSettings.js +1 -225
- package/dist/components/layout/components/header/GameTitle.d.ts.map +1 -1
- package/dist/components/layout/components/header/GameTitle.js +1 -66
- package/dist/components/layout/components/header/HeaderMenu.d.ts +17 -16
- package/dist/components/layout/components/header/HeaderMenu.d.ts.map +1 -1
- package/dist/components/layout/components/header/HeaderMenu.js +1 -47
- package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
- package/dist/components/layout/components/header/HeaderNavigation.js +1 -66
- package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
- package/dist/components/layout/components/header/SettingsMenu.js +1 -85
- package/dist/components/layout/components/header/ThemeToggle.d.ts.map +1 -1
- package/dist/components/layout/components/header/ThemeToggle.js +1 -93
- package/dist/components/layout/components/index.js +1 -25
- package/dist/components/layout/index.js +1 -14
- package/dist/crud/components/ChildRowsPicker.js +1 -68
- package/dist/crud/components/CrudCardLink.js +1 -14
- package/dist/crud/components/EntityCardList.js +1 -184
- package/dist/crud/components/EntityDisplayRenderer.js +1 -130
- package/dist/crud/components/EntityFormRenderer.js +1 -433
- package/dist/crud/components/EntityList.js +1 -521
- package/dist/crud/components/EntityRecommendations.js +1 -87
- package/dist/crud/components/EntityWorkflow.js +1 -55
- package/dist/crud/components/Form.d.ts.map +1 -1
- package/dist/crud/components/Form.js +1 -198
- package/dist/crud/components/cellEditFor.js +1 -74
- package/dist/crud/components/entityParent.js +1 -76
- package/dist/crud/components/index.js +1 -16
- package/dist/crud/components/useRecordBreadcrumb.d.ts.map +1 -1
- package/dist/crud/components/useRecordBreadcrumb.js +1 -43
- package/dist/crud/crudImports.js +1 -51
- package/dist/crud/index.js +1 -11
- package/dist/data/techLogos.js +1 -99
- package/dist/dndev-next.css +104 -17
- package/dist/dndev.css +104 -17
- package/dist/index.js +1 -5
- package/dist/internal/common/DnDevErrorBoundary.js +1 -55
- package/dist/internal/common/ErrorFallback.js +3 -214
- package/dist/internal/common/GlobalErrorFallback.js +1 -45
- package/dist/internal/common/RouteErrorFallback.js +3 -140
- package/dist/internal/devtools/DebugTools.js +1 -131
- package/dist/internal/devtools/components/AuthDebugButton.js +1 -72
- package/dist/internal/devtools/components/ConfigTab.js +1 -61
- package/dist/internal/devtools/components/CookieTab.js +1 -156
- package/dist/internal/devtools/components/DebugDialog.js +1 -48
- package/dist/internal/devtools/components/DesignTab.js +1 -469
- package/dist/internal/devtools/components/LayoutReset.js +1 -214
- package/dist/internal/devtools/components/MaskedValue.js +1 -39
- package/dist/internal/devtools/components/StoresTab.js +1 -90
- package/dist/internal/devtools/components/index.js +1 -16
- package/dist/internal/devtools/index.js +1 -13
- package/dist/internal/devtools/types.js +0 -2
- package/dist/internal/devtools/utils/envVarDiscovery.js +1 -106
- package/dist/internal/devtools/utils/index.js +1 -12
- package/dist/internal/devtools/utils/maskSensitive.js +1 -59
- package/dist/internal/devtools/utils/virtualModuleInspector.js +1 -309
- package/dist/internal/initializers/BaseStoresInitializer.js +1 -367
- package/dist/internal/initializers/NextJsStoresInitializer.js +1 -78
- package/dist/internal/initializers/ViteStoresInitializer.js +1 -20
- package/dist/internal/initializers/index.js +1 -11
- package/dist/internal/layout/DnDevLayout.js +1 -321
- package/dist/internal/layout/components/AutoMetaTags.d.ts +2 -0
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +1 -338
- package/dist/internal/layout/components/FaviconHead.js +1 -60
- package/dist/internal/layout/components/FontPreloadLinks.js +1 -31
- package/dist/internal/layout/components/HeadTags.js +1 -20
- package/dist/internal/layout/components/PWAUpdateNotification.js +1 -131
- package/dist/internal/layout/components/footer/FooterBranding.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/FooterBranding.js +1 -35
- package/dist/internal/layout/components/footer/FooterCopyright.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/FooterCopyright.js +1 -37
- package/dist/internal/layout/components/footer/FooterLegalLinks.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/FooterLegalLinks.js +1 -44
- package/dist/internal/layout/components/footer/useLegalLinks.d.ts +4 -2
- package/dist/internal/layout/components/footer/useLegalLinks.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/useLegalLinks.js +1 -21
- package/dist/internal/layout/components/i18nSeoMeta.js +1 -53
- package/dist/internal/layout/components/index.js +1 -13
- package/dist/internal/layout/config/defaults.js +1 -47
- package/dist/internal/layout/config/index.js +1 -11
- package/dist/internal/layout/config/presets/admin.js +1 -35
- package/dist/internal/layout/config/presets/blog.js +1 -31
- package/dist/internal/layout/config/presets/docs.js +1 -51
- package/dist/internal/layout/config/presets/game.js +1 -53
- package/dist/internal/layout/config/presets/index.js +1 -24
- package/dist/internal/layout/config/presets/landing.js +1 -42
- package/dist/internal/layout/config/presets/moolti.js +1 -52
- package/dist/internal/layout/config/presets/plain.js +1 -25
- package/dist/internal/layout/renderers/index.js +0 -10
- package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevFooter.js +1 -67
- package/dist/internal/layout/zones/DnDevHeader.js +1 -41
- package/dist/internal/layout/zones/DnDevMergedBar.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevMergedBar.js +1 -52
- package/dist/internal/layout/zones/DnDevSidebar.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevSidebar.js +1 -181
- package/dist/internal/layout/zones/index.js +1 -14
- package/dist/internal/providers/NavigationProvider.d.ts.map +1 -1
- package/dist/internal/providers/NavigationProvider.js +1 -71
- package/dist/internal/providers/SentryInitializer.d.ts.map +1 -1
- package/dist/internal/providers/SentryInitializer.js +1 -36
- package/dist/internal/providers/UIProviders.js +1 -79
- package/dist/internal/providers/index.js +1 -12
- package/dist/next.js +1 -11
- package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
- package/dist/providers/NextJsAppProviders.js +1 -107
- package/dist/providers/ViteAppProviders.d.ts.map +1 -1
- package/dist/providers/ViteAppProviders.js +1 -117
- package/dist/providers/index.js +1 -11
- package/dist/routing/404.js +1 -108
- package/dist/routing/AuthGuard.js +1 -178
- package/dist/routing/AuthGuardFallback.d.ts.map +1 -1
- package/dist/routing/AuthGuardFallback.js +1 -67
- package/dist/routing/AuthReturnTo.js +1 -68
- package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
- package/dist/routing/DnDevNavigationMenu.js +1 -138
- package/dist/routing/GoTo.d.ts.map +1 -1
- package/dist/routing/GoTo.js +1 -38
- package/dist/routing/GoToDialog.d.ts.map +1 -1
- package/dist/routing/GoToDialog.js +1 -97
- package/dist/routing/GoToInput.d.ts.map +1 -1
- package/dist/routing/GoToInput.js +1 -49
- package/dist/routing/GoToWrapper.d.ts.map +1 -1
- package/dist/routing/GoToWrapper.js +1 -59
- package/dist/routing/Link.d.ts +10 -2
- package/dist/routing/Link.d.ts.map +1 -1
- package/dist/routing/Link.js +1 -109
- package/dist/routing/NavigationItem.d.ts.map +1 -1
- package/dist/routing/NavigationItem.js +1 -44
- package/dist/routing/NotFoundDocument.d.ts +33 -0
- package/dist/routing/NotFoundDocument.d.ts.map +1 -0
- package/dist/routing/NotFoundDocument.js +1 -0
- package/dist/routing/SignedInRedirect.js +1 -47
- package/dist/routing/hooks/hooks.vite.js +1 -1
- package/dist/routing/hooks/index.js +1 -26
- package/dist/routing/hooks/types.js +0 -2
- package/dist/routing/hooks/useLocation.next.js +1 -35
- package/dist/routing/hooks/useLocation.vite.js +1 -13
- package/dist/routing/hooks/useMatch.next.js +1 -31
- package/dist/routing/hooks/useMatch.vite.js +1 -6
- package/dist/routing/hooks/useNavigate.next.js +1 -64
- package/dist/routing/hooks/useNavigate.vite.js +1 -61
- package/dist/routing/hooks/useParams.next.js +1 -9
- package/dist/routing/hooks/useParams.vite.js +1 -6
- package/dist/routing/hooks/useQueryParams.next.js +1 -66
- package/dist/routing/hooks/useQueryParams.vite.js +1 -66
- package/dist/routing/hooks/useRedirectGuard.next.js +1 -119
- package/dist/routing/hooks/useRedirectGuard.vite.js +1 -117
- package/dist/routing/hooks/useRouteParam.next.js +1 -38
- package/dist/routing/hooks/useRouteParam.vite.js +1 -38
- package/dist/routing/hooks/useRoutePath.next.js +1 -36
- package/dist/routing/hooks/useRoutePath.vite.js +1 -25
- package/dist/routing/hooks/useSearchParams.next.js +1 -22
- package/dist/routing/hooks/useSearchParams.vite.js +1 -22
- package/dist/routing/hooks/useUrlLanguage.next.js +1 -50
- package/dist/routing/hooks/useUrlLanguage.vite.js +1 -41
- package/dist/routing/index.d.ts +1 -0
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +1 -32
- package/dist/routing/link/InternalLink.next.d.ts +23 -0
- package/dist/routing/link/InternalLink.next.d.ts.map +1 -0
- package/dist/routing/link/InternalLink.next.js +1 -0
- package/dist/routing/link/InternalLink.vite.d.ts +22 -0
- package/dist/routing/link/InternalLink.vite.d.ts.map +1 -0
- package/dist/routing/link/InternalLink.vite.js +1 -0
- package/dist/routing/link/absolutePath.d.ts +17 -0
- package/dist/routing/link/absolutePath.d.ts.map +1 -0
- package/dist/routing/link/absolutePath.js +1 -0
- package/dist/routing/link/link.next.d.ts +12 -0
- package/dist/routing/link/link.next.d.ts.map +1 -0
- package/dist/routing/link/link.next.js +1 -0
- package/dist/routing/link/link.vite.d.ts +12 -0
- package/dist/routing/link/link.vite.d.ts.map +1 -0
- package/dist/routing/link/link.vite.js +1 -0
- package/dist/routing/link/types.d.ts +30 -0
- package/dist/routing/link/types.d.ts.map +1 -0
- package/dist/routing/link/types.js +0 -0
- package/dist/routing/parentRoute.js +1 -43
- package/dist/routing/useGoTo.d.ts.map +1 -1
- package/dist/routing/useGoTo.js +1 -59
- package/dist/routing/useNavigation.d.ts.map +1 -1
- package/dist/routing/useNavigation.js +1 -114
- package/dist/routing/useRouteDiscovery.d.ts +1 -0
- package/dist/routing/useRouteDiscovery.d.ts.map +1 -1
- package/dist/routing/useRouteDiscovery.js +1 -313
- package/dist/rsc.d.ts +28 -0
- package/dist/rsc.d.ts.map +1 -0
- package/dist/rsc.js +1 -0
- package/dist/styles/index.css +104 -17
- package/dist/styles/index.js +1 -10
- package/dist/styles/layoutConstants.js +1 -134
- package/dist/symbol-index.json +1 -1
- package/dist/utils/assetResolver.d.ts.map +1 -1
- package/dist/utils/assetResolver.js +1 -297
- package/dist/utils/index.js +1 -23
- package/dist/utils/sanitizeSvg.js +1 -51
- package/dist/utils/tList.js +1 -42
- package/dist/utils/useAISafe.d.ts.map +1 -1
- package/dist/utils/useAISafe.js +1 -53
- package/dist/utils/useAuthSafe.d.ts.map +1 -1
- package/dist/utils/useAuthSafe.js +1 -78
- package/dist/utils/useAuthVisibility.d.ts.map +1 -1
- package/dist/utils/useAuthVisibility.js +1 -63
- package/dist/utils/useBillingVisibility.d.ts.map +1 -1
- package/dist/utils/useBillingVisibility.js +1 -57
- package/dist/utils/useCrudSafe.d.ts.map +1 -1
- package/dist/utils/useCrudSafe.js +1 -75
- package/dist/utils/useDeleteAccountSafe.js +1 -52
- package/dist/utils/useFormStoreSafe.d.ts.map +1 -1
- package/dist/utils/useFormStoreSafe.js +1 -85
- package/dist/utils/useOAuthSafe.d.ts.map +1 -1
- package/dist/utils/useOAuthSafe.js +1 -38
- package/dist/utils/useSeo.js +1 -151
- package/dist/utils/useStripeBillingSafe.d.ts.map +1 -1
- package/dist/utils/useStripeBillingSafe.js +1 -81
- package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.js +1 -235
- package/dist/vite-routing/RootLayout.d.ts.map +1 -1
- package/dist/vite-routing/RootLayout.js +1 -205
- package/dist/vite-routing/index.js +1 -11
- package/dist/vite.js +1 -10
- package/guidelines/COMPONENTS.md +4 -4
- package/guidelines/PAGES.md +3 -0
- package/guidelines/ROUTING.md +15 -0
- package/guidelines/SEO.md +4 -1
- package/package.json +18 -8
- package/dist/ChildRowsPicker-63M4EQUQ.js +0 -1
- package/dist/ChildRowsPicker-ISP365ON.js +0 -1
- package/dist/ChildRowsPicker-PQFE6NCR.js +0 -1
- package/dist/ChildRowsPicker-XXFFSMWY.js +0 -1
- package/dist/CookieConsent-QOUAY6B4.js +0 -1
- package/dist/GoToDialog-KSBGOIWO.js +0 -1
- package/dist/GoToDialog-XBK5EZF4.js +0 -1
- package/dist/chunk-3CIZFGST.js +0 -1
- package/dist/chunk-LHMKU342.js +0 -1
- package/dist/chunk-MS7ZIW5Z.js +0 -1
- package/dist/chunk-O2XFH626.js +0 -1
- package/dist/chunk-P2DHZWPY.js +0 -1
- package/dist/components/common/lucideIconByName.d.ts +0 -9
- package/dist/components/common/lucideIconByName.d.ts.map +0 -1
- package/dist/components/common/lucideIconByName.js +0 -32
- package/dist/internal/layout/components/PerformanceHints.d.ts +0 -71
- package/dist/internal/layout/components/PerformanceHints.d.ts.map +0 -1
- package/dist/internal/layout/components/PerformanceHints.js +0 -71
|
@@ -1,214 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
// packages/ui/src/internal/devtools/components/LayoutReset.tsx
|
|
4
|
-
/**
|
|
5
|
-
* @fileoverview Layout Reset Component
|
|
6
|
-
* @description Comprehensive cache and store reset component for testing first-visit scenarios
|
|
7
|
-
*
|
|
8
|
-
* @version 0.1.0
|
|
9
|
-
* @since 0.0.1
|
|
10
|
-
* @author AMBROISE PARK Consulting
|
|
11
|
-
*/
|
|
12
|
-
import { Trash2 } from 'lucide-react';
|
|
13
|
-
import { memo, useState, useCallback } from 'react';
|
|
14
|
-
import { cn, Stack } from '@donotdev/components';
|
|
15
|
-
import { isClient } from '@donotdev/core';
|
|
16
|
-
export const LayoutReset = memo(() => {
|
|
17
|
-
const [isResetting, setIsResetting] = useState(false);
|
|
18
|
-
const resetLayout = useCallback(async () => {
|
|
19
|
-
if (isResetting)
|
|
20
|
-
return;
|
|
21
|
-
if (!isClient())
|
|
22
|
-
return; // SSR guard
|
|
23
|
-
if (process.env.NODE_ENV !== 'development')
|
|
24
|
-
return; // DevTools only
|
|
25
|
-
setIsResetting(true);
|
|
26
|
-
try {
|
|
27
|
-
// Clear all caches and stores (comprehensive reset)
|
|
28
|
-
console.log('🔄 Clearing all caches and stores...');
|
|
29
|
-
const clearedItems = [];
|
|
30
|
-
const errors = [];
|
|
31
|
-
// Clear localStorage (includes all Zustand persisted stores)
|
|
32
|
-
try {
|
|
33
|
-
localStorage.clear();
|
|
34
|
-
clearedItems.push('localStorage');
|
|
35
|
-
console.log('✅ Cleared localStorage');
|
|
36
|
-
}
|
|
37
|
-
catch (err) {
|
|
38
|
-
console.error('Failed to clear localStorage:', err);
|
|
39
|
-
errors.push('localStorage');
|
|
40
|
-
}
|
|
41
|
-
// Clear sessionStorage
|
|
42
|
-
try {
|
|
43
|
-
sessionStorage.clear();
|
|
44
|
-
clearedItems.push('sessionStorage');
|
|
45
|
-
console.log('✅ Cleared sessionStorage');
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
console.error('Failed to clear sessionStorage:', err);
|
|
49
|
-
errors.push('sessionStorage');
|
|
50
|
-
}
|
|
51
|
-
// Clear IndexedDB
|
|
52
|
-
if ('indexedDB' in window) {
|
|
53
|
-
try {
|
|
54
|
-
if ('databases' in indexedDB) {
|
|
55
|
-
const databases = await indexedDB.databases();
|
|
56
|
-
console.log(`📦 Found ${databases.length} IndexedDB databases`);
|
|
57
|
-
// Wait for all deletions to complete
|
|
58
|
-
await Promise.all(databases.map(async (db) => {
|
|
59
|
-
if (db.name) {
|
|
60
|
-
console.log(` Deleting database: ${db.name}`);
|
|
61
|
-
const deleteReq = indexedDB.deleteDatabase(db.name);
|
|
62
|
-
await new Promise((resolve, reject) => {
|
|
63
|
-
deleteReq.onsuccess = () => {
|
|
64
|
-
console.log(` ✅ Deleted: ${db.name}`);
|
|
65
|
-
resolve(undefined);
|
|
66
|
-
};
|
|
67
|
-
deleteReq.onerror = () => reject(deleteReq.error);
|
|
68
|
-
deleteReq.onblocked = () => {
|
|
69
|
-
console.warn(` ⚠️ Blocked: ${db.name}`);
|
|
70
|
-
// Resolve anyway - it will be deleted when unblocked
|
|
71
|
-
resolve(undefined);
|
|
72
|
-
};
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}));
|
|
76
|
-
clearedItems.push(`IndexedDB (${databases.length} databases)`);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
// Fallback for browsers without databases() API
|
|
80
|
-
clearedItems.push('IndexedDB');
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
catch (err) {
|
|
84
|
-
console.error('Failed to clear IndexedDB:', err);
|
|
85
|
-
errors.push('IndexedDB');
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// Clear application cache if available
|
|
89
|
-
if ('caches' in window) {
|
|
90
|
-
try {
|
|
91
|
-
const keys = await caches.keys();
|
|
92
|
-
console.log(`🗄️ Found ${keys.length} application caches`);
|
|
93
|
-
await Promise.all(keys.map(async (key) => {
|
|
94
|
-
try {
|
|
95
|
-
await caches.delete(key);
|
|
96
|
-
console.log(` ✅ Deleted cache: ${key}`);
|
|
97
|
-
}
|
|
98
|
-
catch (err) {
|
|
99
|
-
console.error(` Failed to delete cache ${key}:`, err);
|
|
100
|
-
}
|
|
101
|
-
}));
|
|
102
|
-
clearedItems.push(`Application Cache (${keys.length} caches)`);
|
|
103
|
-
}
|
|
104
|
-
catch (err) {
|
|
105
|
-
console.error('Failed to clear application cache:', err);
|
|
106
|
-
errors.push('Application Cache');
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
// Clear service workers if available
|
|
110
|
-
if ('serviceWorker' in navigator) {
|
|
111
|
-
try {
|
|
112
|
-
const registrations = await navigator.serviceWorker.getRegistrations();
|
|
113
|
-
console.log(`⚙️ Found ${registrations.length} service workers`);
|
|
114
|
-
await Promise.all(registrations.map(async (reg) => {
|
|
115
|
-
try {
|
|
116
|
-
await reg.unregister();
|
|
117
|
-
console.log(` ✅ Unregistered service worker`);
|
|
118
|
-
}
|
|
119
|
-
catch (err) {
|
|
120
|
-
console.error(' Failed to unregister service worker:', err);
|
|
121
|
-
}
|
|
122
|
-
}));
|
|
123
|
-
clearedItems.push(`Service Workers (${registrations.length})`);
|
|
124
|
-
}
|
|
125
|
-
catch (err) {
|
|
126
|
-
console.error('Failed to clear service workers:', err);
|
|
127
|
-
errors.push('Service Workers');
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
// Clear cookies
|
|
131
|
-
try {
|
|
132
|
-
const cookieCount = document.cookie.split(';').length;
|
|
133
|
-
document.cookie.split(';').forEach((cookie) => {
|
|
134
|
-
const eqPos = cookie.indexOf('=');
|
|
135
|
-
const name = eqPos > -1 ? cookie.slice(0, eqPos) : cookie;
|
|
136
|
-
document.cookie = `${name.trim()}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;
|
|
137
|
-
document.cookie = `${name.trim()}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${window.location.hostname}`;
|
|
138
|
-
document.cookie = `${name.trim()}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=.${window.location.hostname}`;
|
|
139
|
-
});
|
|
140
|
-
clearedItems.push(`Cookies (${cookieCount})`);
|
|
141
|
-
console.log('✅ Cleared cookies');
|
|
142
|
-
}
|
|
143
|
-
catch (err) {
|
|
144
|
-
console.error('Failed to clear cookies:', err);
|
|
145
|
-
errors.push('Cookies');
|
|
146
|
-
}
|
|
147
|
-
// Force garbage collection if available
|
|
148
|
-
try {
|
|
149
|
-
if ('gc' in window && typeof globalThis.gc === 'function') {
|
|
150
|
-
globalThis.gc();
|
|
151
|
-
clearedItems.push('Memory Cache');
|
|
152
|
-
console.log('✅ Forced garbage collection');
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
catch (err) {
|
|
156
|
-
console.error('Failed to clear memory cache:', err);
|
|
157
|
-
}
|
|
158
|
-
// Show comprehensive feedback
|
|
159
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
160
|
-
console.log('✅ Cache reset complete!');
|
|
161
|
-
console.log(`Cleared: ${clearedItems.join(', ')}`);
|
|
162
|
-
if (errors.length > 0) {
|
|
163
|
-
console.log(`⚠️ Errors: ${errors.join(', ')}`);
|
|
164
|
-
}
|
|
165
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
166
|
-
// Check if we actually cleared anything
|
|
167
|
-
const success = clearedItems.length > 0;
|
|
168
|
-
if (success) {
|
|
169
|
-
// Reload immediately - console already has all the details
|
|
170
|
-
if (isClient()) {
|
|
171
|
-
window.location.reload();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
// Nothing was cleared
|
|
176
|
-
console.warn('⚠️ Nothing to clear or all operations failed. Check console for details.');
|
|
177
|
-
setIsResetting(false);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
catch (error) {
|
|
181
|
-
console.error('❌ Failed to reset caches:', error);
|
|
182
|
-
setIsResetting(false);
|
|
183
|
-
}
|
|
184
|
-
}, [isResetting]);
|
|
185
|
-
return (_jsx(Stack, { as: "button", align: "center", justify: "center", onClick: resetLayout, "aria-disabled": isResetting, style: {
|
|
186
|
-
width: 'var(--touch-target)',
|
|
187
|
-
height: 'var(--touch-target)',
|
|
188
|
-
borderRadius: 'var(--radius-lg)',
|
|
189
|
-
transition: 'var(--transition-fast)',
|
|
190
|
-
cursor: isResetting ? 'not-allowed' : 'pointer',
|
|
191
|
-
...(isResetting
|
|
192
|
-
? {
|
|
193
|
-
backgroundColor: 'rgb(from var(--warning) r g b / 0.2)',
|
|
194
|
-
color: 'var(--warning)',
|
|
195
|
-
}
|
|
196
|
-
: {
|
|
197
|
-
color: 'var(--muted-foreground)',
|
|
198
|
-
}),
|
|
199
|
-
}, onMouseEnter: (e) => {
|
|
200
|
-
if (!isResetting) {
|
|
201
|
-
e.currentTarget.style.backgroundColor = 'var(--accent)';
|
|
202
|
-
e.currentTarget.style.color = 'var(--accent-foreground)';
|
|
203
|
-
e.currentTarget.style.boxShadow = 'var(--shadow-xl)';
|
|
204
|
-
}
|
|
205
|
-
}, onMouseLeave: (e) => {
|
|
206
|
-
if (!isResetting) {
|
|
207
|
-
e.currentTarget.style.backgroundColor = 'transparent';
|
|
208
|
-
e.currentTarget.style.color = 'var(--muted-foreground)';
|
|
209
|
-
e.currentTarget.style.boxShadow = 'none';
|
|
210
|
-
}
|
|
211
|
-
}, title: isResetting
|
|
212
|
-
? 'Clearing...'
|
|
213
|
-
: 'Clear all caches & stores (test first-visit)', "aria-label": "Clear all caches and stores", children: _jsx(Trash2, { style: { width: '1.5rem', height: '1.5rem' }, className: cn(isResetting && 'dndev-animate-pulse') }) }));
|
|
214
|
-
});
|
|
1
|
+
"use client";import{Trash2 as h}from"lucide-react";import{memo as u,useState as m,useCallback as p}from"react";import{cn as f,Stack as w}from"@donotdev/components";import{isClient as l}from"@donotdev/core";import{jsx as i}from"react/jsx-runtime";var $=u(()=>{let[a,c]=m(!1),d=p(async()=>{a||l()},[a]);return i(w,{as:"button",align:"center",justify:"center",onClick:d,"aria-disabled":a,style:{width:"var(--touch-target)",height:"var(--touch-target)",borderRadius:"var(--radius-lg)",transition:"var(--transition-fast)",cursor:a?"not-allowed":"pointer",...a?{backgroundColor:"rgb(from var(--warning) r g b / 0.2)",color:"var(--warning)"}:{color:"var(--muted-foreground)"}},onMouseEnter:e=>{a||(e.currentTarget.style.backgroundColor="var(--accent)",e.currentTarget.style.color="var(--accent-foreground)",e.currentTarget.style.boxShadow="var(--shadow-xl)")},onMouseLeave:e=>{a||(e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.color="var(--muted-foreground)",e.currentTarget.style.boxShadow="none")},title:a?"Clearing...":"Clear all caches & stores (test first-visit)","aria-label":"Clear all caches and stores",children:i(h,{style:{width:"1.5rem",height:"1.5rem"},className:f(a&&"dndev-animate-pulse")})})});export{$ as LayoutReset};
|
|
@@ -1,39 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
// packages/ui/src/internal/devtools/components/MaskedValue.tsx
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
* @fileoverview Masked Value Component
|
|
7
|
-
|
|
8
|
-
* @description Reusable component for displaying sensitive values with mask/unmask and copy functionality
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
* @version 0.1.0
|
|
13
|
-
|
|
14
|
-
* @since 0.0.1
|
|
15
|
-
|
|
16
|
-
* @author AMBROISE PARK Consulting
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
import { Eye, EyeOff } from 'lucide-react';
|
|
20
|
-
import { useState } from 'react';
|
|
21
|
-
import { Stack, Text, Button, BUTTON_VARIANT, CopyToClipboard, } from '@donotdev/components';
|
|
22
|
-
import { shouldMaskValue, maskSensitiveValue } from '../utils/maskSensitive';
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
* MaskedValue component - displays sensitive values with mask/unmask and copy
|
|
26
|
-
|
|
27
|
-
* Always copies the real value, but can mask the display
|
|
28
|
-
|
|
29
|
-
*/
|
|
30
|
-
export const MaskedValue = ({ keyName, value, className, textClassName = 'dndev-font-mono dndev-text-xs dndev-break-all', compact = false, }) => {
|
|
31
|
-
const [isUnmasked, setIsUnmasked] = useState(false);
|
|
32
|
-
const stringValue = String(value);
|
|
33
|
-
const isSensitive = shouldMaskValue(keyName, stringValue);
|
|
34
|
-
const displayValue = isSensitive && !isUnmasked ? maskSensitiveValue(stringValue) : stringValue;
|
|
35
|
-
if (compact) {
|
|
36
|
-
return (_jsxs(Stack, { direction: "row", align: "center", gap: "tight", className: className, children: [_jsxs(Text, { as: "span", className: textClassName, children: [displayValue, isSensitive && !isUnmasked && (_jsx(Text, { as: "span", className: "dndev-text-muted-foreground dndev-ml-sm", children: "(masked)" }))] }), isSensitive && (_jsx(Button, { onClick: () => setIsUnmasked(!isUnmasked), variant: BUTTON_VARIANT.GHOST, icon: isUnmasked ? EyeOff : Eye, title: isUnmasked ? 'Mask value' : 'Reveal value', className: "dndev-flex-shrink-0" })), _jsx(CopyToClipboard, { text: stringValue, tooltipText: "Copy value", copiedTooltipText: "Copied!", variant: "ghost", className: "dndev-flex-shrink-0" })] }));
|
|
37
|
-
}
|
|
38
|
-
return (_jsxs(Stack, { direction: "row", align: "center", gap: "tight", className: className, children: [_jsxs(Text, { as: "span", className: textClassName, children: [displayValue, isSensitive && !isUnmasked && (_jsx(Text, { as: "span", className: "dndev-text-muted-foreground dndev-ml-sm", children: "(masked)" }))] }), isSensitive && (_jsx(Button, { onClick: () => setIsUnmasked(!isUnmasked), variant: BUTTON_VARIANT.GHOST, icon: isUnmasked ? EyeOff : Eye, title: isUnmasked ? 'Mask value' : 'Reveal value', className: "dndev-flex-shrink-0" })), _jsx(CopyToClipboard, { text: stringValue, tooltipText: "Copy value", copiedTooltipText: "Copied!", variant: "ghost", className: "dndev-flex-shrink-0" })] }));
|
|
39
|
-
};
|
|
1
|
+
"use client";import{Eye as c,EyeOff as m}from"lucide-react";import{useState as g}from"react";import{Stack as p,Text as n,Button as v,BUTTON_VARIANT as u,CopyToClipboard as k}from"@donotdev/components";import{shouldMaskValue as N,maskSensitiveValue as h}from"../utils/maskSensitive.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";var M=({keyName:x,value:f,className:l,textClassName:i="dndev-font-mono dndev-text-xs dndev-break-all",compact:T=!1})=>{let[e,d]=g(!1),t=String(f),s=N(x,t),r=s&&!e?h(t):t;return T?o(p,{direction:"row",align:"center",gap:"tight",className:l,children:[o(n,{as:"span",className:i,children:[r,s&&!e&&a(n,{as:"span",className:"dndev-text-muted-foreground dndev-ml-sm",children:"(masked)"})]}),s&&a(v,{onClick:()=>d(!e),variant:u.GHOST,icon:e?m:c,title:e?"Mask value":"Reveal value",className:"dndev-flex-shrink-0"}),a(k,{text:t,tooltipText:"Copy value",copiedTooltipText:"Copied!",variant:"ghost",className:"dndev-flex-shrink-0"})]}):o(p,{direction:"row",align:"center",gap:"tight",className:l,children:[o(n,{as:"span",className:i,children:[r,s&&!e&&a(n,{as:"span",className:"dndev-text-muted-foreground dndev-ml-sm",children:"(masked)"})]}),s&&a(v,{onClick:()=>d(!e),variant:u.GHOST,icon:e?m:c,title:e?"Mask value":"Reveal value",className:"dndev-flex-shrink-0"}),a(k,{text:t,tooltipText:"Copy value",copiedTooltipText:"Copied!",variant:"ghost",className:"dndev-flex-shrink-0"})]})};export{M as MaskedValue};
|
|
@@ -1,90 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
// packages/ui/src/internal/devtools/components/StoresTab.tsx
|
|
4
|
-
/**
|
|
5
|
-
* @fileoverview Stores Tab Component
|
|
6
|
-
* @description Displays registered Zustand stores from globalThis._DNDEV_STORES_
|
|
7
|
-
*
|
|
8
|
-
* @version 0.1.0
|
|
9
|
-
* @since 0.0.1
|
|
10
|
-
* @author AMBROISE PARK Consulting
|
|
11
|
-
*/
|
|
12
|
-
import { RefreshCw } from 'lucide-react';
|
|
13
|
-
import { useState, useEffect, useCallback } from 'react';
|
|
14
|
-
import { Stack, Card, Accordion, ScrollArea, JsonViewer, Text, Badge, BADGE_VARIANT, Button, BUTTON_VARIANT, } from '@donotdev/components';
|
|
15
|
-
const STORE_NAMES = {
|
|
16
|
-
'theme-store': 'Theme',
|
|
17
|
-
'consent-store': 'Consent',
|
|
18
|
-
'navigation-store': 'Navigation',
|
|
19
|
-
'loading-store': 'Loading',
|
|
20
|
-
'overlay-store': 'Overlay',
|
|
21
|
-
'network-store': 'Network',
|
|
22
|
-
'abort-store': 'Abort',
|
|
23
|
-
'i18n-store': 'i18n',
|
|
24
|
-
'error-store': 'Error',
|
|
25
|
-
};
|
|
26
|
-
/** Zustand bound stores expose `getState`; registry values are untyped (`Record<string, any>` in core globals). */
|
|
27
|
-
function hasGetState(store) {
|
|
28
|
-
return ((typeof store === 'function' || typeof store === 'object') &&
|
|
29
|
-
store !== null &&
|
|
30
|
-
'getState' in store &&
|
|
31
|
-
typeof store.getState === 'function');
|
|
32
|
-
}
|
|
33
|
-
/** Reads the `_error` marker that `refreshStores` writes for unreadable stores. */
|
|
34
|
-
function readStoreError(state) {
|
|
35
|
-
if (typeof state !== 'object' || state === null || !('_error' in state)) {
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
return typeof state._error === 'string' ? state._error : undefined;
|
|
39
|
-
}
|
|
40
|
-
export const StoresTab = () => {
|
|
41
|
-
const [storeStates, setStoreStates] = useState({});
|
|
42
|
-
const [storeNames, setStoreNames] = useState([]);
|
|
43
|
-
const refreshStores = useCallback(() => {
|
|
44
|
-
const registry = globalThis._DNDEV_STORES_;
|
|
45
|
-
if (!registry) {
|
|
46
|
-
setStoreNames([]);
|
|
47
|
-
setStoreStates({});
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const names = Object.keys(registry);
|
|
51
|
-
setStoreNames(names);
|
|
52
|
-
const states = {};
|
|
53
|
-
names.forEach((name) => {
|
|
54
|
-
try {
|
|
55
|
-
const store = registry[name];
|
|
56
|
-
if (hasGetState(store)) {
|
|
57
|
-
states[name] = store.getState();
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
states[name] = { _error: 'No getState method' };
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
catch (e) {
|
|
64
|
-
states[name] = { _error: String(e) };
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
setStoreStates(states);
|
|
68
|
-
}, []);
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
// StoresTab is only rendered inside DevTools (dev-only), but guard defensively
|
|
71
|
-
if (process.env.NODE_ENV !== 'development')
|
|
72
|
-
return;
|
|
73
|
-
refreshStores();
|
|
74
|
-
const interval = setInterval(refreshStores, 1000);
|
|
75
|
-
return () => clearInterval(interval);
|
|
76
|
-
}, [refreshStores]);
|
|
77
|
-
const getDisplayName = (name) => STORE_NAMES[name] || name.replace(/-store$/, '').replace(/-/g, ' ');
|
|
78
|
-
if (storeNames.length === 0) {
|
|
79
|
-
return (_jsx(Stack, { style: { padding: 'var(--gap-md)' }, children: _jsx(Card, { title: "Stores", subtitle: "No stores registered", children: _jsx(Text, { className: "dndev-text-muted-foreground", children: "globalThis._DNDEV_STORES_ is empty or not initialized." }) }) }));
|
|
80
|
-
}
|
|
81
|
-
return (_jsx(Stack, { style: { padding: 'var(--gap-md)' }, children: _jsx(Card, { title: _jsxs(Stack, { direction: "row", align: "center", justify: "between", className: "dndev-w-full", children: [_jsx("span", { children: "Stores" }), _jsxs(Stack, { direction: "row", align: "center", gap: "tight", children: [_jsx(Badge, { variant: BADGE_VARIANT.SECONDARY, children: storeNames.length }), _jsx(Button, { variant: BUTTON_VARIANT.GHOST, icon: RefreshCw, onClick: refreshStores, title: "Refresh stores" })] })] }), children: _jsx(Accordion, { type: "single", collapsible: true, items: storeNames.map((name) => {
|
|
82
|
-
const state = storeStates[name];
|
|
83
|
-
const storeError = readStoreError(state);
|
|
84
|
-
return {
|
|
85
|
-
value: name,
|
|
86
|
-
trigger: (_jsxs(Stack, { direction: "row", align: "center", justify: "between", className: "dndev-w-full", children: [_jsx(Text, { className: "dndev-font-medium", children: getDisplayName(name) }), _jsx(Text, { className: "dndev-font-mono dndev-text-xs dndev-text-muted-foreground", children: name })] })),
|
|
87
|
-
content: storeError ? (_jsx(Text, { className: "dndev-text-destructive dndev-text-sm", children: storeError })) : (_jsx(ScrollArea, { className: "dndev-max-h-64", children: _jsx(JsonViewer, { data: state, defaultDepth: 2, showCopyButton: true }) })),
|
|
88
|
-
};
|
|
89
|
-
}) }) }) }));
|
|
90
|
-
};
|
|
1
|
+
"use client";import{RefreshCw as v}from"lucide-react";import{useState as S,useEffect as N,useCallback as w}from"react";import{Stack as s,Card as p,Accordion as y,ScrollArea as h,JsonViewer as k,Text as d,Badge as T,BADGE_VARIANT as E,Button as _,BUTTON_VARIANT as b}from"@donotdev/components";import{jsx as e,jsxs as g}from"react/jsx-runtime";var x={"theme-store":"Theme","consent-store":"Consent","navigation-store":"Navigation","loading-store":"Loading","overlay-store":"Overlay","network-store":"Network","abort-store":"Abort","i18n-store":"i18n","error-store":"Error"};function R(t){return(typeof t=="function"||typeof t=="object")&&t!==null&&"getState"in t&&typeof t.getState=="function"}function A(t){if(!(typeof t!="object"||t===null||!("_error"in t)))return typeof t._error=="string"?t._error:void 0}var B=()=>{let[t,u]=S({}),[l,f]=S([]),a=w(()=>{let r=globalThis._DNDEV_STORES_;if(!r){f([]),u({});return}let o=Object.keys(r);f(o);let n={};o.forEach(i=>{try{let c=r[i];R(c)?n[i]=c.getState():n[i]={_error:"No getState method"}}catch(c){n[i]={_error:String(c)}}}),u(n)},[]);N(()=>{},[a]);let m=r=>x[r]||r.replace(/-store$/,"").replace(/-/g," ");return l.length===0?e(s,{style:{padding:"var(--gap-md)"},children:e(p,{title:"Stores",subtitle:"No stores registered",children:e(d,{className:"dndev-text-muted-foreground",children:"globalThis._DNDEV_STORES_ is empty or not initialized."})})}):e(s,{style:{padding:"var(--gap-md)"},children:e(p,{title:g(s,{direction:"row",align:"center",justify:"between",className:"dndev-w-full",children:[e("span",{children:"Stores"}),g(s,{direction:"row",align:"center",gap:"tight",children:[e(T,{variant:E.SECONDARY,children:l.length}),e(_,{variant:b.GHOST,icon:v,onClick:a,title:"Refresh stores"})]})]}),children:e(y,{type:"single",collapsible:!0,items:l.map(r=>{let o=t[r],n=A(o);return{value:r,trigger:g(s,{direction:"row",align:"center",justify:"between",className:"dndev-w-full",children:[e(d,{className:"dndev-font-medium",children:m(r)}),e(d,{className:"dndev-font-mono dndev-text-xs dndev-text-muted-foreground",children:r})]}),content:n?e(d,{className:"dndev-text-destructive dndev-text-sm",children:n}):e(h,{className:"dndev-max-h-64",children:e(k,{data:o,defaultDepth:2,showCopyButton:!0})})}})})})})};export{B as StoresTab};
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview DevTools Components Barrel Exports
|
|
4
|
-
* @description Barrel exports for devtools component modules
|
|
5
|
-
*
|
|
6
|
-
* @version 0.1.0
|
|
7
|
-
* @since 0.0.1
|
|
8
|
-
* @author AMBROISE PARK Consulting
|
|
9
|
-
*/
|
|
10
|
-
export * from './ConfigTab';
|
|
11
|
-
export * from './CookieTab';
|
|
12
|
-
export * from './DebugDialog';
|
|
13
|
-
export * from './LayoutReset';
|
|
14
|
-
export * from './MaskedValue';
|
|
15
|
-
export * from './StoresTab';
|
|
16
|
-
export * from './DesignTab';
|
|
1
|
+
export*from"./ConfigTab.js";export*from"./CookieTab.js";export*from"./DebugDialog.js";export*from"./LayoutReset.js";export*from"./MaskedValue.js";export*from"./StoresTab.js";export*from"./DesignTab.js";
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview DevTools Package Barrel Exports
|
|
4
|
-
* @description Barrel exports for devtools components, types, and utilities
|
|
5
|
-
*
|
|
6
|
-
* @version 0.1.0
|
|
7
|
-
* @since 0.0.1
|
|
8
|
-
* @author AMBROISE PARK Consulting
|
|
9
|
-
*/
|
|
10
|
-
export { default as DebugTools } from './DebugTools';
|
|
11
|
-
export * from './types';
|
|
12
|
-
export * from './components';
|
|
13
|
-
export * from './utils';
|
|
1
|
+
import{default as e}from"./DebugTools.js";export*from"./types.js";export*from"./components/index.js";export*from"./utils/index.js";export{e as DebugTools};
|
|
@@ -1,106 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview Environment variable discovery utilities
|
|
4
|
-
* @description Generic utilities for discovering environment variables by pattern matching
|
|
5
|
-
*
|
|
6
|
-
* @version 0.1.0
|
|
7
|
-
* @since 0.0.1
|
|
8
|
-
* @author AMBROISE PARK Consulting
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Match environment variable key against pattern (case-insensitive)
|
|
12
|
-
* Supports wildcard patterns: *KEY*, *STRIPE*, etc.
|
|
13
|
-
*/
|
|
14
|
-
function matchesPattern(key, pattern) {
|
|
15
|
-
const normalizedKey = key.toUpperCase();
|
|
16
|
-
const normalizedPattern = pattern.toUpperCase();
|
|
17
|
-
if (normalizedPattern.includes('*') || normalizedPattern.includes('?')) {
|
|
18
|
-
// Escape regex metacharacters before converting wildcards
|
|
19
|
-
const escaped = normalizedPattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
20
|
-
const regexPattern = escaped.replace(/\\\*/g, '.*').replace(/\\\?/g, '.');
|
|
21
|
-
const regex = new RegExp(`^${regexPattern}$`);
|
|
22
|
-
return regex.test(normalizedKey);
|
|
23
|
-
}
|
|
24
|
-
return normalizedKey.includes(normalizedPattern);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Discover environment variables by pattern matching
|
|
28
|
-
*
|
|
29
|
-
* @param env - Environment variables object
|
|
30
|
-
* @param patterns - Array of patterns to match (e.g., ['*STRIPE*', '*KEY*'])
|
|
31
|
-
* @returns Object with matched env vars
|
|
32
|
-
*/
|
|
33
|
-
export function discoverEnvVarsByPattern(env, patterns) {
|
|
34
|
-
const result = {};
|
|
35
|
-
Object.entries(env).forEach(([key, value]) => {
|
|
36
|
-
const matches = patterns.some((pattern) => matchesPattern(key, pattern));
|
|
37
|
-
if (matches) {
|
|
38
|
-
result[key] = value;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Group environment variables by category based on common patterns
|
|
45
|
-
*
|
|
46
|
-
* @param env - Environment variables object
|
|
47
|
-
* @returns Grouped env vars by category
|
|
48
|
-
*/
|
|
49
|
-
export function groupEnvVarsByCategory(env) {
|
|
50
|
-
const result = {};
|
|
51
|
-
Object.entries(env).forEach(([key, value]) => {
|
|
52
|
-
if (matchesPattern(key, '*STRIPE*') ||
|
|
53
|
-
matchesPattern(key, '*PRICE*ID*') ||
|
|
54
|
-
matchesPattern(key, '*PRICE_ID*')) {
|
|
55
|
-
if (!result.stripe)
|
|
56
|
-
result.stripe = {};
|
|
57
|
-
result.stripe[key] = value;
|
|
58
|
-
}
|
|
59
|
-
else if (matchesPattern(key, '*FIREBASE*')) {
|
|
60
|
-
if (!result.firebase)
|
|
61
|
-
result.firebase = {};
|
|
62
|
-
result.firebase[key] = value;
|
|
63
|
-
}
|
|
64
|
-
else if (matchesPattern(key, '*SUPABASE*')) {
|
|
65
|
-
if (!result.supabase)
|
|
66
|
-
result.supabase = {};
|
|
67
|
-
result.supabase[key] = value;
|
|
68
|
-
}
|
|
69
|
-
else if (matchesPattern(key, '*OAUTH*') ||
|
|
70
|
-
matchesPattern(key, '*GOOGLE*CLIENT*') ||
|
|
71
|
-
matchesPattern(key, '*GITHUB*CLIENT*') ||
|
|
72
|
-
matchesPattern(key, '*AUTH*PARTNER*')) {
|
|
73
|
-
if (!result.oauth)
|
|
74
|
-
result.oauth = {};
|
|
75
|
-
result.oauth[key] = value;
|
|
76
|
-
}
|
|
77
|
-
else if (matchesPattern(key, '*EMULATOR*') ||
|
|
78
|
-
matchesPattern(key, '*USE*EMULATOR*')) {
|
|
79
|
-
if (!result.emulator)
|
|
80
|
-
result.emulator = {};
|
|
81
|
-
result.emulator[key] = value;
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
if (!result.other)
|
|
85
|
-
result.other = {};
|
|
86
|
-
result.other[key] = value;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
return result;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Find first environment variable matching pattern
|
|
93
|
-
*
|
|
94
|
-
* @param env - Environment variables object
|
|
95
|
-
* @param patterns - Array of patterns to try (returns first match)
|
|
96
|
-
* @returns First matching value or undefined
|
|
97
|
-
*/
|
|
98
|
-
export function findFirstEnvVarByPattern(env, patterns) {
|
|
99
|
-
for (const pattern of patterns) {
|
|
100
|
-
const matches = discoverEnvVarsByPattern(env, [pattern]);
|
|
101
|
-
const firstMatch = Object.values(matches)[0];
|
|
102
|
-
if (firstMatch)
|
|
103
|
-
return firstMatch;
|
|
104
|
-
}
|
|
105
|
-
return undefined;
|
|
106
|
-
}
|
|
1
|
+
function s(n,r){let t=n.toUpperCase(),e=r.toUpperCase();if(e.includes("*")||e.includes("?")){let o=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*/g,".*").replace(/\\\?/g,".");return new RegExp(`^${o}$`).test(t)}return t.includes(e)}function a(n,r){let t={};return Object.entries(n).forEach(([e,i])=>{r.some(c=>s(e,c))&&(t[e]=i)}),t}function g(n){let r={};return Object.entries(n).forEach(([t,e])=>{s(t,"*STRIPE*")||s(t,"*PRICE*ID*")||s(t,"*PRICE_ID*")?(r.stripe||(r.stripe={}),r.stripe[t]=e):s(t,"*FIREBASE*")?(r.firebase||(r.firebase={}),r.firebase[t]=e):s(t,"*SUPABASE*")?(r.supabase||(r.supabase={}),r.supabase[t]=e):s(t,"*OAUTH*")||s(t,"*GOOGLE*CLIENT*")||s(t,"*GITHUB*CLIENT*")||s(t,"*AUTH*PARTNER*")?(r.oauth||(r.oauth={}),r.oauth[t]=e):s(t,"*EMULATOR*")||s(t,"*USE*EMULATOR*")?(r.emulator||(r.emulator={}),r.emulator[t]=e):(r.other||(r.other={}),r.other[t]=e)}),r}function f(n,r){for(let t of r){let e=a(n,[t]),i=Object.values(e)[0];if(i)return i}}export{a as discoverEnvVarsByPattern,f as findFirstEnvVarByPattern,g as groupEnvVarsByCategory};
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview DevTools Utils Barrel Exports
|
|
4
|
-
* @description Barrel exports for devtools utility modules
|
|
5
|
-
*
|
|
6
|
-
* @version 0.1.0
|
|
7
|
-
* @since 0.0.1
|
|
8
|
-
* @author AMBROISE PARK Consulting
|
|
9
|
-
*/
|
|
10
|
-
export * from './envVarDiscovery';
|
|
11
|
-
export * from './virtualModuleInspector';
|
|
12
|
-
export * from './maskSensitive';
|
|
1
|
+
export*from"./envVarDiscovery.js";export*from"./virtualModuleInspector.js";export*from"./maskSensitive.js";
|
|
@@ -1,59 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview Sensitive Data Masking Utilities
|
|
4
|
-
* @description Utilities to mask sensitive values in devtools to prevent exposing real data
|
|
5
|
-
*
|
|
6
|
-
* @version 0.1.0
|
|
7
|
-
* @since 0.0.1
|
|
8
|
-
* @author AMBROISE PARK Consulting
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Check if a key name indicates sensitive data
|
|
12
|
-
*/
|
|
13
|
-
function isSensitiveKey(key) {
|
|
14
|
-
const upperKey = key.toUpperCase();
|
|
15
|
-
return (upperKey.includes('SECRET') ||
|
|
16
|
-
upperKey.includes('KEY') ||
|
|
17
|
-
upperKey.includes('TOKEN') ||
|
|
18
|
-
upperKey.includes('PASSWORD') ||
|
|
19
|
-
upperKey.includes('PRIVATE') ||
|
|
20
|
-
upperKey.includes('API_KEY') ||
|
|
21
|
-
upperKey.includes('CLIENT_SECRET') ||
|
|
22
|
-
upperKey.includes('ACCESS_TOKEN') ||
|
|
23
|
-
upperKey.includes('REFRESH_TOKEN') ||
|
|
24
|
-
upperKey.includes('DATABASE_URL') ||
|
|
25
|
-
upperKey.includes('CONNECTION_STRING'));
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Mask a sensitive value
|
|
29
|
-
* Shows first 4 chars and last 4 chars with *** in between
|
|
30
|
-
*/
|
|
31
|
-
export function maskSensitiveValue(value) {
|
|
32
|
-
if (!value || value.length <= 8) {
|
|
33
|
-
return '***';
|
|
34
|
-
}
|
|
35
|
-
const start = value.substring(0, 4);
|
|
36
|
-
const end = value.substring(value.length - 4);
|
|
37
|
-
return `${start}***${end}`;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Mask sensitive values in an object based on key names
|
|
41
|
-
*/
|
|
42
|
-
export function maskSensitiveData(data) {
|
|
43
|
-
const masked = {};
|
|
44
|
-
for (const [key, value] of Object.entries(data)) {
|
|
45
|
-
if (isSensitiveKey(key) && typeof value === 'string' && value.length > 0) {
|
|
46
|
-
masked[key] = maskSensitiveValue(value);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
masked[key] = String(value);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return masked;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Check if value should be masked (for display purposes)
|
|
56
|
-
*/
|
|
57
|
-
export function shouldMaskValue(key, value) {
|
|
58
|
-
return isSensitiveKey(key) && value.length > 0;
|
|
59
|
-
}
|
|
1
|
+
function i(e){let n=e.toUpperCase();return n.includes("SECRET")||n.includes("KEY")||n.includes("TOKEN")||n.includes("PASSWORD")||n.includes("PRIVATE")||n.includes("API_KEY")||n.includes("CLIENT_SECRET")||n.includes("ACCESS_TOKEN")||n.includes("REFRESH_TOKEN")||n.includes("DATABASE_URL")||n.includes("CONNECTION_STRING")}function r(e){if(!e||e.length<=8)return"***";let n=e.substring(0,4),t=e.substring(e.length-4);return`${n}***${t}`}function o(e){let n={};for(let[t,s]of Object.entries(e))i(t)&&typeof s=="string"&&s.length>0?n[t]=r(s):n[t]=String(s);return n}function c(e,n){return i(e)&&n.length>0}export{o as maskSensitiveData,r as maskSensitiveValue,c as shouldMaskValue};
|