@donotdev/ui 0.0.6 → 0.0.8

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 (55) hide show
  1. package/assets/fonts/fonts.css +4 -4
  2. package/dist/components/auth/AuthHeader.d.ts +5 -0
  3. package/dist/components/auth/AuthHeader.d.ts.map +1 -1
  4. package/dist/components/auth/AuthHeader.js +22 -8
  5. package/dist/components/auth/AuthMenu.d.ts +6 -2
  6. package/dist/components/auth/AuthMenu.d.ts.map +1 -1
  7. package/dist/components/auth/AuthMenu.js +2 -2
  8. package/dist/components/common/RedirectOverlay.d.ts +37 -0
  9. package/dist/components/common/RedirectOverlay.d.ts.map +1 -0
  10. package/dist/components/common/RedirectOverlay.js +243 -0
  11. package/dist/components/common/index.d.ts +1 -0
  12. package/dist/components/common/index.d.ts.map +1 -1
  13. package/dist/components/common/index.js +1 -0
  14. package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
  15. package/dist/components/layout/components/header/SettingsMenu.js +1 -1
  16. package/dist/crud/components/DisplayFieldRenderer.js +1 -1
  17. package/dist/dndev.css +517 -90
  18. package/dist/index.js +4 -4
  19. package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
  20. package/dist/internal/devtools/components/DesignTab.js +25 -3
  21. package/dist/internal/layout/components/PerformanceHints.d.ts +64 -0
  22. package/dist/internal/layout/components/PerformanceHints.d.ts.map +1 -0
  23. package/dist/internal/layout/components/PerformanceHints.js +88 -0
  24. package/dist/internal/layout/components/footer/FooterBranding.js +1 -1
  25. package/dist/internal/layout/config/presets/admin.d.ts +2 -2
  26. package/dist/internal/layout/config/presets/admin.d.ts.map +1 -1
  27. package/dist/internal/layout/config/presets/admin.js +8 -4
  28. package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
  29. package/dist/providers/NextJsAppProviders.js +5 -1
  30. package/dist/providers/ViteAppProviders.d.ts.map +1 -1
  31. package/dist/providers/ViteAppProviders.js +4 -1
  32. package/dist/routing/hooks/hooks.next.d.ts +1 -0
  33. package/dist/routing/hooks/hooks.next.d.ts.map +1 -1
  34. package/dist/routing/hooks/hooks.next.js +1 -1
  35. package/dist/routing/hooks/hooks.vite.d.ts +1 -0
  36. package/dist/routing/hooks/hooks.vite.d.ts.map +1 -1
  37. package/dist/routing/hooks/hooks.vite.js +1 -1
  38. package/dist/routing/hooks/useRouteParam.next.d.ts +18 -0
  39. package/dist/routing/hooks/useRouteParam.next.d.ts.map +1 -0
  40. package/dist/routing/hooks/useRouteParam.next.js +38 -0
  41. package/dist/routing/hooks/useRouteParam.vite.d.ts +18 -0
  42. package/dist/routing/hooks/useRouteParam.vite.d.ts.map +1 -0
  43. package/dist/routing/hooks/useRouteParam.vite.js +38 -0
  44. package/dist/routing/index.d.ts +1 -1
  45. package/dist/routing/index.d.ts.map +1 -1
  46. package/dist/routing/index.js +1 -1
  47. package/dist/routing/useGoTo.d.ts +3 -4
  48. package/dist/routing/useGoTo.d.ts.map +1 -1
  49. package/dist/routing/useGoTo.js +16 -23
  50. package/dist/styles/index.css +513 -86
  51. package/dist/utils/useCrudSafe.d.ts.map +1 -1
  52. package/dist/utils/useCrudSafe.js +2 -1
  53. package/dist/vite-routing/RootLayout.d.ts.map +1 -1
  54. package/dist/vite-routing/RootLayout.js +4 -1
  55. package/package.json +10 -11
@@ -3,19 +3,15 @@
3
3
  * @fileoverview useGoTo Hook - Navigation search logic
4
4
  * @description Clean hook for Cmd+K navigation with favorites, recents, and filtering
5
5
  *
6
- * @version 0.0.1
6
+ * @version 0.0.2
7
7
  * @since 0.0.1
8
8
  * @author AMBROISE PARK Consulting
9
9
  */
10
10
  import { useCallback, useMemo } from 'react';
11
- import { useLocalStorage } from '@donotdev/core';
11
+ import { useNavigationStore } from '@donotdev/core';
12
12
  // Platform-specific hooks via conditional exports
13
13
  import { useNavigate } from '@donotdev/ui/routing/hooks';
14
14
  import { useNavigationItems } from './useNavigation';
15
- const FAVORITES_KEY = 'nav_favorites';
16
- const RECENT_KEY = 'nav_recent';
17
- const MAX_RECENT = 8;
18
- const EMPTY_ARRAY = [];
19
15
  /**
20
16
  * Hook for navigation with favorites and recents
21
17
  * Command component handles search/filtering
@@ -23,15 +19,12 @@ const EMPTY_ARRAY = [];
23
19
  export const useGoTo = () => {
24
20
  const navigate = useNavigate();
25
21
  const navigationItems = useNavigationItems() ?? [];
26
- // LocalStorage state
27
- const { value: favorites, setValue: setFavorites } = useLocalStorage(FAVORITES_KEY, {
28
- defaultValue: EMPTY_ARRAY,
29
- syncAcrossTabs: true,
30
- });
31
- const { value: recent, setValue: setRecent } = useLocalStorage(RECENT_KEY, {
32
- defaultValue: EMPTY_ARRAY,
33
- syncAcrossTabs: false,
34
- });
22
+ // Navigation store (favorites and recent persisted per computer)
23
+ const favorites = useNavigationStore((state) => state.favorites);
24
+ const recent = useNavigationStore((state) => state.recent);
25
+ const toggleFavoriteStore = useNavigationStore((state) => state.toggleFavorite);
26
+ const isFavoriteStore = useNavigationStore((state) => state.isFavorite);
27
+ const addRecentStore = useNavigationStore((state) => state.addRecent);
35
28
  // Get favorite items
36
29
  const favoriteItems = useMemo(() => {
37
30
  if (!navigationItems.length)
@@ -45,16 +38,16 @@ export const useGoTo = () => {
45
38
  const items = navigationItems.filter((item) => recent.includes(item.path));
46
39
  return items.slice(0, 5);
47
40
  }, [recent, navigationItems]);
48
- // Toggle favorite
41
+ // Toggle favorite (delegates to navigation store)
49
42
  const toggleFavorite = useCallback((path) => {
50
- setFavorites((prev) => prev.includes(path) ? prev.filter((p) => p !== path) : [...prev, path]);
51
- }, [setFavorites]);
52
- // Check if item is favorite
53
- const isFavorite = useCallback((path) => favorites.includes(path), [favorites]);
54
- // Add to recent
43
+ toggleFavoriteStore(path);
44
+ }, [toggleFavoriteStore]);
45
+ // Check if item is favorite (delegates to navigation store)
46
+ const isFavorite = useCallback((path) => isFavoriteStore(path), [isFavoriteStore]);
47
+ // Add to recent (delegates to navigation store)
55
48
  const addRecent = useCallback((path) => {
56
- setRecent((prev) => [path, ...prev.filter((p) => p !== path)].slice(0, MAX_RECENT));
57
- }, [setRecent]);
49
+ addRecentStore(path);
50
+ }, [addRecentStore]);
58
51
  // Navigate to item
59
52
  const navigateToItem = useCallback((path) => {
60
53
  addRecent(path);