@djangocfg/layouts 2.1.226 → 2.1.228

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 (97) hide show
  1. package/README.md +3 -17
  2. package/package.json +18 -18
  3. package/src/components/errors/ErrorLayout.tsx +2 -2
  4. package/src/components/errors/ErrorsTracker/index.ts +1 -0
  5. package/src/components/errors/ErrorsTracker/utils/formatters.ts +23 -1
  6. package/src/hooks/useLogout.ts +9 -12
  7. package/src/layouts/AppLayout/AppLayout.tsx +20 -8
  8. package/src/layouts/AppLayout/BaseApp.tsx +5 -28
  9. package/src/layouts/AuthLayout/AuthLayout.tsx +51 -22
  10. package/src/layouts/AuthLayout/README.md +78 -0
  11. package/src/layouts/AuthLayout/components/shared/AuthDivider.tsx +2 -2
  12. package/src/layouts/AuthLayout/components/shared/AuthError.tsx +10 -2
  13. package/src/layouts/AuthLayout/components/shared/AuthFooter.tsx +2 -2
  14. package/src/layouts/AuthLayout/components/shared/AuthHeader.tsx +3 -2
  15. package/src/layouts/AuthLayout/components/shared/AuthOTPInput.tsx +4 -1
  16. package/src/layouts/AuthLayout/components/shared/TermsCheckbox.tsx +2 -2
  17. package/src/layouts/AuthLayout/components/shared/index.ts +0 -2
  18. package/src/layouts/AuthLayout/components/steps/IdentifierStep.tsx +25 -80
  19. package/src/layouts/AuthLayout/components/steps/OTPStep.tsx +8 -13
  20. package/src/layouts/AuthLayout/components/steps/SetupStep/SetupComplete.tsx +2 -2
  21. package/src/layouts/AuthLayout/components/steps/SetupStep/SetupLoading.tsx +2 -2
  22. package/src/layouts/AuthLayout/components/steps/SetupStep/SetupQRCode.tsx +2 -2
  23. package/src/layouts/AuthLayout/components/steps/TwoFactorStep.tsx +61 -42
  24. package/src/layouts/AuthLayout/context.tsx +0 -2
  25. package/src/layouts/AuthLayout/index.ts +9 -6
  26. package/src/layouts/AuthLayout/styles/auth.css +265 -120
  27. package/src/layouts/AuthLayout/types.ts +60 -7
  28. package/src/layouts/ProfileLayout/.claude/.sidecar/activity.jsonl +2 -0
  29. package/src/layouts/ProfileLayout/.claude/.sidecar/history/2026-03-15.md +35 -0
  30. package/src/layouts/ProfileLayout/.claude/.sidecar/review.md +35 -0
  31. package/src/layouts/ProfileLayout/.claude/.sidecar/scan.log +3 -0
  32. package/src/layouts/ProfileLayout/.claude/.sidecar/tasks/T-001.md +18 -0
  33. package/src/layouts/ProfileLayout/.claude/.sidecar/tasks/T-002.md +19 -0
  34. package/src/layouts/ProfileLayout/.claude/.sidecar/tasks/T-003.md +18 -0
  35. package/src/layouts/ProfileLayout/.claude/.sidecar/tasks/T-004.md +18 -0
  36. package/src/layouts/ProfileLayout/.claude/.sidecar/tasks/T-005.md +18 -0
  37. package/src/layouts/ProfileLayout/.claude/.sidecar/usage.json +5 -0
  38. package/src/layouts/ProfileLayout/ProfileLayout.tsx +52 -403
  39. package/src/layouts/ProfileLayout/components/ActionButton.tsx +38 -0
  40. package/src/layouts/ProfileLayout/components/DeleteAccountSection.tsx +109 -148
  41. package/src/layouts/ProfileLayout/components/EditableField.tsx +119 -0
  42. package/src/layouts/ProfileLayout/components/Section.tsx +22 -0
  43. package/src/layouts/ProfileLayout/components/index.ts +4 -1
  44. package/src/layouts/ProfileLayout/context.tsx +31 -0
  45. package/src/layouts/PublicLayout/components/PublicMobileDrawer.tsx +2 -2
  46. package/src/layouts/PublicLayout/components/PublicNavigation.tsx +2 -2
  47. package/src/layouts/_components/UserMenu.tsx +2 -2
  48. package/src/layouts/types/README.md +0 -20
  49. package/src/layouts/types/index.ts +2 -2
  50. package/src/layouts/types/layout.types.ts +2 -5
  51. package/src/layouts/types/providers.types.ts +0 -27
  52. package/src/snippets/AuthDialog/AuthDialog.tsx +2 -2
  53. package/src/snippets/Breadcrumbs.tsx +2 -2
  54. package/src/snippets/index.ts +0 -67
  55. package/src/layouts/AuthLayout/components/shared/ChannelToggle.tsx +0 -56
  56. package/src/snippets/McpChat/README.md +0 -441
  57. package/src/snippets/McpChat/components/AIChatWidget.tsx +0 -361
  58. package/src/snippets/McpChat/components/AskAIButton.tsx +0 -92
  59. package/src/snippets/McpChat/components/ChatMessages.tsx +0 -138
  60. package/src/snippets/McpChat/components/ChatPanel.tsx +0 -131
  61. package/src/snippets/McpChat/components/ChatSidebar.tsx +0 -156
  62. package/src/snippets/McpChat/components/ChatWidget.tsx +0 -115
  63. package/src/snippets/McpChat/components/MessageBubble.tsx +0 -142
  64. package/src/snippets/McpChat/components/MessageInput.tsx +0 -140
  65. package/src/snippets/McpChat/components/index.ts +0 -24
  66. package/src/snippets/McpChat/config.ts +0 -94
  67. package/src/snippets/McpChat/context/AIChatContext.tsx +0 -327
  68. package/src/snippets/McpChat/context/ChatContext.tsx +0 -361
  69. package/src/snippets/McpChat/context/index.ts +0 -7
  70. package/src/snippets/McpChat/hooks/index.ts +0 -6
  71. package/src/snippets/McpChat/hooks/useAIChat.ts +0 -503
  72. package/src/snippets/McpChat/hooks/useChatLayout.ts +0 -442
  73. package/src/snippets/McpChat/hooks/useMcpChat.ts +0 -90
  74. package/src/snippets/McpChat/index.ts +0 -79
  75. package/src/snippets/McpChat/types.ts +0 -189
  76. package/src/snippets/PWAInstall/@docs/README.md +0 -92
  77. package/src/snippets/PWAInstall/@docs/research/ios-android-install-flows.md +0 -576
  78. package/src/snippets/PWAInstall/README.md +0 -235
  79. package/src/snippets/PWAInstall/components/A2HSHint.tsx +0 -236
  80. package/src/snippets/PWAInstall/components/DesktopGuide.tsx +0 -234
  81. package/src/snippets/PWAInstall/components/IOSGuide.tsx +0 -29
  82. package/src/snippets/PWAInstall/components/IOSGuideDrawer.tsx +0 -103
  83. package/src/snippets/PWAInstall/components/IOSGuideModal.tsx +0 -103
  84. package/src/snippets/PWAInstall/components/PWAPageResumeManager.tsx +0 -33
  85. package/src/snippets/PWAInstall/context/InstallContext.tsx +0 -102
  86. package/src/snippets/PWAInstall/hooks/useInstallPrompt.ts +0 -168
  87. package/src/snippets/PWAInstall/hooks/useIsPWA.ts +0 -116
  88. package/src/snippets/PWAInstall/hooks/usePWAPageResume.ts +0 -163
  89. package/src/snippets/PWAInstall/index.ts +0 -80
  90. package/src/snippets/PWAInstall/types/components.ts +0 -95
  91. package/src/snippets/PWAInstall/types/config.ts +0 -29
  92. package/src/snippets/PWAInstall/types/index.ts +0 -26
  93. package/src/snippets/PWAInstall/types/install.ts +0 -38
  94. package/src/snippets/PWAInstall/types/platform.ts +0 -29
  95. package/src/snippets/PWAInstall/utils/localStorage.ts +0 -181
  96. package/src/snippets/PWAInstall/utils/logger.ts +0 -149
  97. package/src/snippets/PWAInstall/utils/platform.ts +0 -151
@@ -1,189 +0,0 @@
1
- /**
2
- * Types for @djangocfg/mcp-chat
3
- */
4
-
5
- // Re-export config constants for backwards compatibility
6
- export { DEFAULT_CHAT_API_ENDPOINT, mcpEndpoints, getMcpEndpoints } from './config';
7
-
8
- /**
9
- * AI Chat message role
10
- */
11
- export type AIMessageRole = 'user' | 'assistant' | 'system';
12
-
13
- /**
14
- * AI Chat message
15
- */
16
- export interface AIChatMessage {
17
- id: string;
18
- role: AIMessageRole;
19
- content: string;
20
- timestamp: Date;
21
- /** Related documentation links */
22
- sources?: AIChatSource[];
23
- /** Is message still being generated */
24
- isStreaming?: boolean;
25
- }
26
-
27
- /**
28
- * AI Documentation source reference
29
- */
30
- export interface AIChatSource {
31
- title: string;
32
- path: string;
33
- url?: string;
34
- section?: string;
35
- score?: number;
36
- }
37
-
38
- /**
39
- * Chat API response
40
- */
41
- export interface ChatApiResponse {
42
- success: boolean;
43
- results?: Array<{
44
- chunk: {
45
- id: string;
46
- path: string;
47
- title: string;
48
- section?: string;
49
- content: string;
50
- url?: string;
51
- };
52
- score: number;
53
- }>;
54
- answer?: string;
55
- error?: string;
56
- }
57
-
58
- /**
59
- * Chat display mode
60
- * - closed: Only FAB button visible
61
- * - floating: Floating panel (default)
62
- * - sidebar: Full-height sidebar on the right (desktop only)
63
- */
64
- export type ChatDisplayMode = 'closed' | 'floating' | 'sidebar';
65
-
66
- /**
67
- * Chat widget configuration
68
- */
69
- export interface ChatWidgetConfig {
70
- /** API endpoint for chat (default: /api/chat) */
71
- apiEndpoint?: string;
72
- /** Widget title */
73
- title?: string;
74
- /** Placeholder text for input */
75
- placeholder?: string;
76
- /** Initial greeting message */
77
- greeting?: string;
78
- /** Position on screen */
79
- position?: 'bottom-right' | 'bottom-left';
80
- /** Theme variant */
81
- variant?: 'default' | 'minimal';
82
- /** Auto-detect environment (dev/prod) for API endpoint. If false (default), always uses production */
83
- autoDetectEnvironment?: boolean;
84
- }
85
-
86
- // =============================================================================
87
- // AI Chat Types
88
- // =============================================================================
89
-
90
- /**
91
- * AI Chat API response
92
- */
93
- export interface AIChatApiResponse {
94
- success: boolean;
95
- content?: string;
96
- sources?: Array<{
97
- id?: string;
98
- title: string;
99
- path: string;
100
- url?: string;
101
- section?: string;
102
- score?: number;
103
- }>;
104
- threadId?: string;
105
- usage?: {
106
- promptTokens: number;
107
- completionTokens: number;
108
- totalTokens: number;
109
- };
110
- error?: string;
111
- }
112
-
113
- /**
114
- * useAIChat hook options
115
- */
116
- export interface UseAIChatOptions {
117
- /** API endpoint (default: /api/ai/chat) */
118
- apiEndpoint?: string;
119
- /** Initial messages */
120
- initialMessages?: AIChatMessage[];
121
- /** Callback on error */
122
- onError?: (error: Error) => void;
123
- /** Enable streaming responses (default: true) */
124
- enableStreaming?: boolean;
125
- /** Thread ID for conversation (generated if not provided) */
126
- threadId?: string;
127
- /** User ID for conversation (generated if not provided) */
128
- userId?: string;
129
- }
130
-
131
- /**
132
- * useAIChat hook return type
133
- */
134
- export interface UseAIChatReturn {
135
- messages: AIChatMessage[];
136
- isLoading: boolean;
137
- error: Error | null;
138
- threadId: string;
139
- userId: string;
140
- sendMessage: (content: string) => Promise<void>;
141
- clearMessages: () => void;
142
- stopStreaming: () => void;
143
- }
144
-
145
- // =============================================================================
146
- // MCP Chat Events (Global Chat Trigger)
147
- // =============================================================================
148
-
149
- /**
150
- * Context type for chat messages triggered from different parts of the app
151
- */
152
- export type McpChatContextType =
153
- | 'error' // Error explanation
154
- | 'question' // General question
155
- | 'explain' // Explain something
156
- | 'advice' // Get advice
157
- | 'help' // Help request
158
- | 'custom'; // Custom context
159
-
160
- /**
161
- * Event detail for mcp:chat:send custom event
162
- */
163
- export interface McpChatEventDetail {
164
- /** Message to send to chat */
165
- message: string;
166
- /** Optional context about the message */
167
- context?: {
168
- /** Type of context */
169
- type?: McpChatContextType;
170
- /** Additional data (error object, selected element, etc.) */
171
- data?: Record<string, any>;
172
- /** Source component/page that triggered the event */
173
- source?: string;
174
- };
175
- /** Auto-send message after opening chat (default: true) */
176
- autoSend?: boolean;
177
- /** Open chat in specific mode (default: 'floating') */
178
- displayMode?: ChatDisplayMode;
179
- }
180
-
181
- /**
182
- * useMcpChat hook return type
183
- */
184
- export interface UseMcpChatReturn {
185
- /** Send message to chat from anywhere in the app */
186
- sendToChat: (detail: McpChatEventDetail) => void;
187
- /** Check if chat is available */
188
- isChatAvailable: () => boolean;
189
- }
@@ -1,92 +0,0 @@
1
- # PWAInstall Documentation
2
-
3
- Comprehensive documentation for the PWAInstall snippet.
4
-
5
- ## Overview
6
-
7
- PWAInstall handles **Progressive Web App installation** on user devices (Add to Home Screen functionality).
8
-
9
- **Responsibility**: Device installation only (not push notifications)
10
-
11
- ## Documentation Structure
12
-
13
- ### `/research/`
14
- Research and best practices:
15
- - **[ios-android-install-flows.md](./research/ios-android-install-flows.md)** - iOS vs Android PWA installation patterns, limitations, and best practices (2024-2025)
16
-
17
- ### `/architecture/`
18
- Architecture and design:
19
- - Coming soon: Architecture decisions, component design, state management
20
-
21
- ### `/legacy/`
22
- Historical documentation:
23
- - Old architecture analysis (before snippet split)
24
- - Refactoring history
25
-
26
- ## Quick Navigation
27
-
28
- ### For Users
29
- Start here if you want to use PWAInstall:
30
- - [Main README](../README.md) - Quick start and API reference
31
- - [Migration Guide](../../MIGRATION.md) - Migrating from old PWA snippet
32
-
33
- ### For Contributors
34
- Start here if you want to understand or modify PWAInstall:
35
- - [iOS/Android Install Flows](./research/ios-android-install-flows.md) - Platform-specific behavior
36
- - [Architecture](./architecture/) - How it's built
37
-
38
- ### For Researchers
39
- Start here if you want to understand PWA installation patterns:
40
- - [Research](./research/) - Industry research and best practices
41
-
42
- ## Key Concepts
43
-
44
- ### Platform Asymmetry
45
-
46
- | Aspect | Android Chrome | iOS Safari |
47
- |--------|----------------|------------|
48
- | Install API | `beforeinstallprompt` | ❌ No API |
49
- | User effort | 1 tap | 3-4 taps |
50
- | Detection | Event-based | Heuristic |
51
- | Guidance | Optional | **Required** |
52
-
53
- **PWAInstall handles this asymmetry transparently.**
54
-
55
- ### Components
56
-
57
- ```
58
- A2HSHint (Unified hint)
59
- ├── Android → Native install prompt
60
- └── iOS → Visual guide (IOSGuide)
61
- ├── Mobile → IOSGuideDrawer
62
- └── Desktop → IOSGuideModal
63
- ```
64
-
65
- ### State Management
66
-
67
- ```
68
- useInstall() hook
69
- ├── Platform detection (isIOS, isAndroid, isSafari)
70
- ├── Installation state (isInstalled, canPrompt)
71
- └── Install action (install())
72
- ```
73
-
74
- ## Related Documentation
75
-
76
- - **[PushNotifications Docs](../../PushNotifications/@docs/)** - Web push notifications (separate concern)
77
- - **[Refactoring Summary](../../REFACTORING_SUMMARY.md)** - Why snippets were split
78
- - **[Migration Guide](../../MIGRATION.md)** - How to migrate from old PWA snippet
79
-
80
- ## Contributing
81
-
82
- When adding documentation:
83
- 1. **Research** → `/research/` - Industry patterns, browser behavior
84
- 2. **Architecture** → `/architecture/` - Design decisions, component structure
85
- 3. **Historical** → `/legacy/` - Old docs (keep for reference)
86
-
87
- ## Questions?
88
-
89
- - Implementation questions → See [Main README](../README.md)
90
- - Architecture questions → See [/architecture/](./architecture/)
91
- - Platform behavior → See [/research/](./research/)
92
- - Migration questions → See [Migration Guide](../../MIGRATION.md)