@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.
- package/README.md +3 -17
- package/package.json +18 -18
- package/src/components/errors/ErrorLayout.tsx +2 -2
- package/src/components/errors/ErrorsTracker/index.ts +1 -0
- package/src/components/errors/ErrorsTracker/utils/formatters.ts +23 -1
- package/src/hooks/useLogout.ts +9 -12
- package/src/layouts/AppLayout/AppLayout.tsx +20 -8
- package/src/layouts/AppLayout/BaseApp.tsx +5 -28
- package/src/layouts/AuthLayout/AuthLayout.tsx +51 -22
- package/src/layouts/AuthLayout/README.md +78 -0
- package/src/layouts/AuthLayout/components/shared/AuthDivider.tsx +2 -2
- package/src/layouts/AuthLayout/components/shared/AuthError.tsx +10 -2
- package/src/layouts/AuthLayout/components/shared/AuthFooter.tsx +2 -2
- package/src/layouts/AuthLayout/components/shared/AuthHeader.tsx +3 -2
- package/src/layouts/AuthLayout/components/shared/AuthOTPInput.tsx +4 -1
- package/src/layouts/AuthLayout/components/shared/TermsCheckbox.tsx +2 -2
- package/src/layouts/AuthLayout/components/shared/index.ts +0 -2
- package/src/layouts/AuthLayout/components/steps/IdentifierStep.tsx +25 -80
- package/src/layouts/AuthLayout/components/steps/OTPStep.tsx +8 -13
- package/src/layouts/AuthLayout/components/steps/SetupStep/SetupComplete.tsx +2 -2
- package/src/layouts/AuthLayout/components/steps/SetupStep/SetupLoading.tsx +2 -2
- package/src/layouts/AuthLayout/components/steps/SetupStep/SetupQRCode.tsx +2 -2
- package/src/layouts/AuthLayout/components/steps/TwoFactorStep.tsx +61 -42
- package/src/layouts/AuthLayout/context.tsx +0 -2
- package/src/layouts/AuthLayout/index.ts +9 -6
- package/src/layouts/AuthLayout/styles/auth.css +265 -120
- package/src/layouts/AuthLayout/types.ts +60 -7
- package/src/layouts/ProfileLayout/.claude/.sidecar/activity.jsonl +2 -0
- package/src/layouts/ProfileLayout/.claude/.sidecar/history/2026-03-15.md +35 -0
- package/src/layouts/ProfileLayout/.claude/.sidecar/review.md +35 -0
- package/src/layouts/ProfileLayout/.claude/.sidecar/scan.log +3 -0
- package/src/layouts/ProfileLayout/.claude/.sidecar/tasks/T-001.md +18 -0
- package/src/layouts/ProfileLayout/.claude/.sidecar/tasks/T-002.md +19 -0
- package/src/layouts/ProfileLayout/.claude/.sidecar/tasks/T-003.md +18 -0
- package/src/layouts/ProfileLayout/.claude/.sidecar/tasks/T-004.md +18 -0
- package/src/layouts/ProfileLayout/.claude/.sidecar/tasks/T-005.md +18 -0
- package/src/layouts/ProfileLayout/.claude/.sidecar/usage.json +5 -0
- package/src/layouts/ProfileLayout/ProfileLayout.tsx +52 -403
- package/src/layouts/ProfileLayout/components/ActionButton.tsx +38 -0
- package/src/layouts/ProfileLayout/components/DeleteAccountSection.tsx +109 -148
- package/src/layouts/ProfileLayout/components/EditableField.tsx +119 -0
- package/src/layouts/ProfileLayout/components/Section.tsx +22 -0
- package/src/layouts/ProfileLayout/components/index.ts +4 -1
- package/src/layouts/ProfileLayout/context.tsx +31 -0
- package/src/layouts/PublicLayout/components/PublicMobileDrawer.tsx +2 -2
- package/src/layouts/PublicLayout/components/PublicNavigation.tsx +2 -2
- package/src/layouts/_components/UserMenu.tsx +2 -2
- package/src/layouts/types/README.md +0 -20
- package/src/layouts/types/index.ts +2 -2
- package/src/layouts/types/layout.types.ts +2 -5
- package/src/layouts/types/providers.types.ts +0 -27
- package/src/snippets/AuthDialog/AuthDialog.tsx +2 -2
- package/src/snippets/Breadcrumbs.tsx +2 -2
- package/src/snippets/index.ts +0 -67
- package/src/layouts/AuthLayout/components/shared/ChannelToggle.tsx +0 -56
- package/src/snippets/McpChat/README.md +0 -441
- package/src/snippets/McpChat/components/AIChatWidget.tsx +0 -361
- package/src/snippets/McpChat/components/AskAIButton.tsx +0 -92
- package/src/snippets/McpChat/components/ChatMessages.tsx +0 -138
- package/src/snippets/McpChat/components/ChatPanel.tsx +0 -131
- package/src/snippets/McpChat/components/ChatSidebar.tsx +0 -156
- package/src/snippets/McpChat/components/ChatWidget.tsx +0 -115
- package/src/snippets/McpChat/components/MessageBubble.tsx +0 -142
- package/src/snippets/McpChat/components/MessageInput.tsx +0 -140
- package/src/snippets/McpChat/components/index.ts +0 -24
- package/src/snippets/McpChat/config.ts +0 -94
- package/src/snippets/McpChat/context/AIChatContext.tsx +0 -327
- package/src/snippets/McpChat/context/ChatContext.tsx +0 -361
- package/src/snippets/McpChat/context/index.ts +0 -7
- package/src/snippets/McpChat/hooks/index.ts +0 -6
- package/src/snippets/McpChat/hooks/useAIChat.ts +0 -503
- package/src/snippets/McpChat/hooks/useChatLayout.ts +0 -442
- package/src/snippets/McpChat/hooks/useMcpChat.ts +0 -90
- package/src/snippets/McpChat/index.ts +0 -79
- package/src/snippets/McpChat/types.ts +0 -189
- package/src/snippets/PWAInstall/@docs/README.md +0 -92
- package/src/snippets/PWAInstall/@docs/research/ios-android-install-flows.md +0 -576
- package/src/snippets/PWAInstall/README.md +0 -235
- package/src/snippets/PWAInstall/components/A2HSHint.tsx +0 -236
- package/src/snippets/PWAInstall/components/DesktopGuide.tsx +0 -234
- package/src/snippets/PWAInstall/components/IOSGuide.tsx +0 -29
- package/src/snippets/PWAInstall/components/IOSGuideDrawer.tsx +0 -103
- package/src/snippets/PWAInstall/components/IOSGuideModal.tsx +0 -103
- package/src/snippets/PWAInstall/components/PWAPageResumeManager.tsx +0 -33
- package/src/snippets/PWAInstall/context/InstallContext.tsx +0 -102
- package/src/snippets/PWAInstall/hooks/useInstallPrompt.ts +0 -168
- package/src/snippets/PWAInstall/hooks/useIsPWA.ts +0 -116
- package/src/snippets/PWAInstall/hooks/usePWAPageResume.ts +0 -163
- package/src/snippets/PWAInstall/index.ts +0 -80
- package/src/snippets/PWAInstall/types/components.ts +0 -95
- package/src/snippets/PWAInstall/types/config.ts +0 -29
- package/src/snippets/PWAInstall/types/index.ts +0 -26
- package/src/snippets/PWAInstall/types/install.ts +0 -38
- package/src/snippets/PWAInstall/types/platform.ts +0 -29
- package/src/snippets/PWAInstall/utils/localStorage.ts +0 -181
- package/src/snippets/PWAInstall/utils/logger.ts +0 -149
- 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)
|