@djangocfg/layouts 1.4.29 → 2.0.1

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 (119) hide show
  1. package/README.md +277 -18
  2. package/package.json +15 -24
  3. package/src/auth/context/AuthContext.tsx +8 -5
  4. package/src/auth/hooks/useAuthGuard.ts +1 -1
  5. package/src/auth/hooks/useAutoAuth.ts +8 -7
  6. package/src/components/ErrorBoundary.tsx +78 -0
  7. package/src/components/JsonLd.tsx +31 -0
  8. package/src/components/LucideIcon.tsx +91 -0
  9. package/src/components/PageProgress.tsx +127 -0
  10. package/src/components/Suspense.tsx +29 -0
  11. package/src/{layouts/AppLayout/components → components}/UpdateNotifier/UpdateNotifier.tsx +56 -49
  12. package/src/components/index.ts +10 -0
  13. package/src/index.ts +25 -7
  14. package/src/layouts/AdminLayout/AdminLayout.tsx +46 -0
  15. package/src/layouts/AdminLayout/index.ts +7 -0
  16. package/src/layouts/AppLayout/AppLayout.tsx +278 -326
  17. package/src/layouts/AppLayout/index.ts +2 -39
  18. package/src/layouts/{AppLayout/layouts/AuthLayout → AuthLayout}/AuthContext.tsx +3 -2
  19. package/src/layouts/{AppLayout/layouts/AuthLayout → AuthLayout}/AuthHelp.tsx +1 -0
  20. package/src/layouts/AuthLayout/AuthLayout.tsx +61 -0
  21. package/src/layouts/{AppLayout/layouts/AuthLayout → AuthLayout}/IdentifierForm.tsx +47 -34
  22. package/src/layouts/{AppLayout/layouts/AuthLayout → AuthLayout}/OTPForm.tsx +2 -3
  23. package/src/layouts/AuthLayout/index.ts +24 -0
  24. package/src/layouts/{AppLayout/layouts/AuthLayout → AuthLayout}/types.ts +1 -0
  25. package/src/layouts/PrivateLayout/PrivateLayout.tsx +144 -0
  26. package/src/layouts/PrivateLayout/components/PrivateContent.tsx +32 -0
  27. package/src/layouts/PrivateLayout/components/PrivateHeader.tsx +57 -0
  28. package/src/layouts/PrivateLayout/components/PrivateSidebar.tsx +141 -0
  29. package/src/layouts/PrivateLayout/components/index.ts +8 -0
  30. package/src/layouts/PrivateLayout/index.ts +7 -0
  31. package/src/layouts/ProfileLayout/ProfileLayout.tsx +15 -7
  32. package/src/layouts/PublicLayout/PublicLayout.tsx +121 -0
  33. package/src/layouts/PublicLayout/components/PublicFooter.tsx +190 -0
  34. package/src/layouts/PublicLayout/components/PublicMobileDrawer.tsx +117 -0
  35. package/src/layouts/PublicLayout/components/PublicNavigation.tsx +101 -0
  36. package/src/layouts/PublicLayout/components/index.ts +8 -0
  37. package/src/layouts/PublicLayout/index.ts +7 -0
  38. package/src/layouts/_components/UserMenu.tsx +160 -0
  39. package/src/layouts/_components/index.ts +7 -0
  40. package/src/layouts/index.ts +15 -8
  41. package/src/snippets/Analytics/AnalyticsProvider.tsx +8 -4
  42. package/src/snippets/Analytics/useAnalytics.ts +11 -21
  43. package/src/snippets/Chat/ChatWidget.tsx +4 -4
  44. package/src/snippets/ContactForm/ContactFormProvider.tsx +32 -19
  45. package/src/snippets/ContactForm/ContactPage.tsx +2 -4
  46. package/src/snippets/ContactForm/types.ts +3 -2
  47. package/src/snippets/index.ts +0 -1
  48. package/src/layouts/AppLayout/README.md +0 -204
  49. package/src/layouts/AppLayout/SUMMARY.md +0 -240
  50. package/src/layouts/AppLayout/USAGE.md +0 -312
  51. package/src/layouts/AppLayout/components/ErrorBoundary.tsx +0 -112
  52. package/src/layouts/AppLayout/components/PageProgress.tsx +0 -123
  53. package/src/layouts/AppLayout/components/Seo.tsx +0 -171
  54. package/src/layouts/AppLayout/components/UserMenu.tsx +0 -385
  55. package/src/layouts/AppLayout/components/index.ts +0 -11
  56. package/src/layouts/AppLayout/context/AppContext.tsx +0 -151
  57. package/src/layouts/AppLayout/context/index.ts +0 -5
  58. package/src/layouts/AppLayout/hooks/index.ts +0 -8
  59. package/src/layouts/AppLayout/hooks/useLayoutMode.ts +0 -26
  60. package/src/layouts/AppLayout/hooks/useNavigation.ts +0 -51
  61. package/src/layouts/AppLayout/layouts/AdminLayout/AdminLayout.tsx +0 -224
  62. package/src/layouts/AppLayout/layouts/AdminLayout/README.md +0 -409
  63. package/src/layouts/AppLayout/layouts/AdminLayout/components/PagePreloader.example.tsx +0 -98
  64. package/src/layouts/AppLayout/layouts/AdminLayout/components/PagePreloader.tsx +0 -149
  65. package/src/layouts/AppLayout/layouts/AdminLayout/components/ParentSync.tsx +0 -146
  66. package/src/layouts/AppLayout/layouts/AdminLayout/components/index.ts +0 -3
  67. package/src/layouts/AppLayout/layouts/AdminLayout/context/CfgAppContext.tsx +0 -48
  68. package/src/layouts/AppLayout/layouts/AdminLayout/context/index.ts +0 -2
  69. package/src/layouts/AppLayout/layouts/AdminLayout/hooks/index.ts +0 -6
  70. package/src/layouts/AppLayout/layouts/AdminLayout/hooks/useApp.ts +0 -279
  71. package/src/layouts/AppLayout/layouts/AdminLayout/index.ts +0 -24
  72. package/src/layouts/AppLayout/layouts/AdminLayout/lottie/energizing.json +0 -1
  73. package/src/layouts/AppLayout/layouts/AdminLayout/types/index.ts +0 -45
  74. package/src/layouts/AppLayout/layouts/AuthLayout/AuthLayout.tsx +0 -41
  75. package/src/layouts/AppLayout/layouts/AuthLayout/index.ts +0 -15
  76. package/src/layouts/AppLayout/layouts/PrivateLayout/PrivateLayout.tsx +0 -82
  77. package/src/layouts/AppLayout/layouts/PrivateLayout/components/DashboardContent.tsx +0 -62
  78. package/src/layouts/AppLayout/layouts/PrivateLayout/components/DashboardHeader.tsx +0 -89
  79. package/src/layouts/AppLayout/layouts/PrivateLayout/components/DashboardSidebar.tsx +0 -181
  80. package/src/layouts/AppLayout/layouts/PrivateLayout/components/index.ts +0 -9
  81. package/src/layouts/AppLayout/layouts/PrivateLayout/index.ts +0 -5
  82. package/src/layouts/AppLayout/layouts/PublicLayout/PublicLayout.tsx +0 -44
  83. package/src/layouts/AppLayout/layouts/PublicLayout/components/Footer.tsx +0 -242
  84. package/src/layouts/AppLayout/layouts/PublicLayout/components/MobileDrawer.tsx +0 -150
  85. package/src/layouts/AppLayout/layouts/PublicLayout/components/Navigation.tsx +0 -169
  86. package/src/layouts/AppLayout/layouts/PublicLayout/index.ts +0 -5
  87. package/src/layouts/AppLayout/layouts/index.ts +0 -7
  88. package/src/layouts/AppLayout/providers/CoreProviders.tsx +0 -80
  89. package/src/layouts/AppLayout/providers/index.ts +0 -5
  90. package/src/layouts/AppLayout/types/config.ts +0 -79
  91. package/src/layouts/AppLayout/types/index.ts +0 -11
  92. package/src/layouts/AppLayout/types/layout.ts +0 -54
  93. package/src/layouts/AppLayout/types/navigation.ts +0 -43
  94. package/src/layouts/AppLayout/types/page.ts +0 -80
  95. package/src/layouts/AppLayout/types/routes.ts +0 -43
  96. package/src/layouts/AppLayout/utils/index.ts +0 -5
  97. package/src/layouts/AppLayout/utils/routeDetection.ts +0 -31
  98. package/src/layouts/ErrorLayout/ErrorLayout.tsx +0 -173
  99. package/src/layouts/ErrorLayout/errorConfig.tsx +0 -152
  100. package/src/layouts/ErrorLayout/index.ts +0 -8
  101. package/src/layouts/SimpleLayout/SimpleLayout.tsx +0 -72
  102. package/src/layouts/SimpleLayout/index.ts +0 -3
  103. package/src/snippets/VideoPlayer/README.md +0 -238
  104. package/src/snippets/VideoPlayer/VideoControls.tsx +0 -137
  105. package/src/snippets/VideoPlayer/VideoPlayer.tsx +0 -248
  106. package/src/snippets/VideoPlayer/index.ts +0 -8
  107. package/src/snippets/VideoPlayer/types.ts +0 -61
  108. package/src/types/index.ts +0 -2
  109. package/src/types/pageConfig.ts +0 -100
  110. /package/src/{validation → components/ErrorsTracker}/README.md +0 -0
  111. /package/src/{validation → components/ErrorsTracker}/components/ErrorButtons.tsx +0 -0
  112. /package/src/{validation → components/ErrorsTracker}/components/ErrorToast.tsx +0 -0
  113. /package/src/{validation → components/ErrorsTracker}/hooks.ts +0 -0
  114. /package/src/{validation → components/ErrorsTracker}/index.ts +0 -0
  115. /package/src/{validation → components/ErrorsTracker}/providers/ErrorTrackingProvider.tsx +0 -0
  116. /package/src/{validation → components/ErrorsTracker}/types.ts +0 -0
  117. /package/src/{validation → components/ErrorsTracker}/utils/curl-generator.ts +0 -0
  118. /package/src/{validation → components/ErrorsTracker}/utils/formatters.ts +0 -0
  119. /package/src/{layouts/AppLayout/components → components}/UpdateNotifier/index.ts +0 -0
@@ -1,61 +0,0 @@
1
- /**
2
- * VideoPlayer Types - Professional Vidstack Implementation
3
- */
4
-
5
- export interface VideoSource {
6
- /** Video URL - supports YouTube, Vimeo, MP4, HLS, etc. */
7
- url: string;
8
- /** Video title */
9
- title?: string;
10
- /** Video description */
11
- description?: string;
12
- /** Custom poster/thumbnail URL */
13
- poster?: string;
14
- /** Video duration in seconds */
15
- duration?: number;
16
- }
17
-
18
- export interface VideoPlayerProps {
19
- /** Video source configuration */
20
- source: VideoSource;
21
- /** Aspect ratio (default: 16/9) */
22
- aspectRatio?: number;
23
- /** Auto-play video */
24
- autoplay?: boolean;
25
- /** Mute video by default */
26
- muted?: boolean;
27
- /** Play video inline on mobile */
28
- playsInline?: boolean;
29
- /** Show custom controls */
30
- controls?: boolean;
31
- /** Custom CSS class */
32
- className?: string;
33
- /** Show video info */
34
- showInfo?: boolean;
35
- /** Player theme */
36
- theme?: 'default' | 'minimal' | 'modern';
37
- /** Event callbacks */
38
- onPlay?: () => void;
39
- onPause?: () => void;
40
- onEnded?: () => void;
41
- onError?: (error: string) => void;
42
- }
43
-
44
- export interface VideoPlayerRef {
45
- /** Play video */
46
- play: () => void;
47
- /** Pause video */
48
- pause: () => void;
49
- /** Toggle play/pause */
50
- togglePlay: () => void;
51
- /** Seek to time */
52
- seekTo: (time: number) => void;
53
- /** Set volume (0-1) */
54
- setVolume: (volume: number) => void;
55
- /** Toggle mute */
56
- toggleMute: () => void;
57
- /** Enter fullscreen */
58
- enterFullscreen: () => void;
59
- /** Exit fullscreen */
60
- exitFullscreen: () => void;
61
- }
@@ -1,2 +0,0 @@
1
- export type { PageConfig } from "./pageConfig";
2
- export { determinePageConfig } from "./pageConfig";
@@ -1,100 +0,0 @@
1
- import { FC, ReactNode } from 'react';
2
-
3
- // Configuration for the AppBar
4
- export interface AppBarConfig {
5
- label?: string;
6
- showSidebarToggle?: boolean;
7
- onSidebarToggle?: () => void;
8
- hideAuthButtons?: boolean;
9
- hideNavigation?: boolean;
10
- actions?: ReactNode;
11
- showPageScrollProgress?: boolean;
12
- }
13
-
14
- // OpenGraph configuration
15
- export interface OpenGraphConfig {
16
- title?: string;
17
- description?: string;
18
- type?: string;
19
- images?: Array<{
20
- url: string;
21
- width?: number;
22
- height?: number;
23
- alt?: string;
24
- }>;
25
- siteName?: string;
26
- locale?: string;
27
- }
28
-
29
- // Twitter configuration
30
- export interface TwitterConfig {
31
- card?: 'summary' | 'summary_large_image' | 'app' | 'player';
32
- title?: string;
33
- description?: string;
34
- images?: string[];
35
- creator?: string;
36
- site?: string;
37
- }
38
-
39
- // Configuration for a Page using the App3 layout
40
- export interface PageConfig {
41
- projectName?: string;
42
- title?: string;
43
- description?: string;
44
- keywords?: string;
45
- jsonLd?: Record<string, any>;
46
- appBar?: AppBarConfig;
47
- protected?: boolean;
48
- themeMode?: 'light' | 'dark';
49
- ogImage?: {
50
- title?: string;
51
- subtitle?: string;
52
- };
53
- openGraph?: OpenGraphConfig;
54
- twitter?: TwitterConfig;
55
- }
56
-
57
- // --- Helper Function ---
58
- /**
59
- * Determine final page config by merging static and dynamic configs
60
- */
61
- export const determinePageConfig = (
62
- Component: any,
63
- pageProps: Record<string, any>,
64
- defaultTitle?: string,
65
- defaultDescription?: string,
66
- ): PageConfig => {
67
- const defaultPageConfig: PageConfig = {
68
- title: defaultTitle,
69
- description: defaultDescription,
70
- protected: false,
71
- };
72
-
73
- const configFromProps = pageProps.pageConfig as PageConfig | undefined;
74
- const configFromStatic = Component.pageConfig as PageConfig | undefined;
75
-
76
- let finalConfig: PageConfig = { ...defaultPageConfig };
77
-
78
- // Merge static config first
79
- if (configFromStatic) {
80
- finalConfig = {
81
- ...finalConfig,
82
- ...configFromStatic,
83
- };
84
- }
85
-
86
- // Merge dynamic config from props (overrides static)
87
- if (configFromProps) {
88
- finalConfig = {
89
- ...finalConfig,
90
- ...configFromProps,
91
- appBar: {
92
- ...finalConfig.appBar,
93
- ...configFromProps.appBar,
94
- },
95
- };
96
- }
97
-
98
- return finalConfig;
99
- };
100
- // --- End Helper Function ---