@messenger-box/tailwind-ui-inbox 10.0.3-alpha.71 → 10.0.3-alpha.73
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/CHANGELOG.md +8 -0
- package/lib/components/AIAgent/AIAgent.d.ts +14 -0
- package/lib/components/AIAgent/AIAgent.d.ts.map +1 -0
- package/lib/components/AIAgent/AIAgent.js +1148 -0
- package/lib/components/AIAgent/AIAgent.js.map +1 -0
- package/lib/components/AIAgent/index.d.ts +2 -0
- package/lib/components/AIAgent/index.d.ts.map +1 -0
- package/lib/components/InboxMessage/InputComponent.d.ts +9 -0
- package/lib/components/InboxMessage/InputComponent.d.ts.map +1 -0
- package/lib/components/InboxMessage/InputComponent.js +210 -0
- package/lib/components/InboxMessage/InputComponent.js.map +1 -0
- package/lib/components/InboxMessage/MessageInput.d.ts.map +1 -1
- package/lib/components/InboxMessage/MessageInput.js +14 -10
- package/lib/components/InboxMessage/MessageInput.js.map +1 -1
- package/lib/components/InboxMessage/MessageInputComponent.d.ts +9 -0
- package/lib/components/InboxMessage/MessageInputComponent.d.ts.map +1 -0
- package/lib/components/InboxMessage/Messages.d.ts.map +1 -1
- package/lib/components/InboxMessage/Messages.js +4 -54
- package/lib/components/InboxMessage/Messages.js.map +1 -1
- package/lib/components/InboxMessage/MessagesBuilderUi.d.ts +17 -0
- package/lib/components/InboxMessage/MessagesBuilderUi.d.ts.map +1 -0
- package/lib/components/InboxMessage/UploadImageButton.d.ts +1 -0
- package/lib/components/InboxMessage/UploadImageButton.d.ts.map +1 -1
- package/lib/components/InboxMessage/UploadImageButton.js +3 -3
- package/lib/components/InboxMessage/UploadImageButton.js.map +1 -1
- package/lib/components/InboxMessage/index.d.ts +3 -0
- package/lib/components/InboxMessage/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/message-widgets/CommonMessage.d.ts.map +1 -1
- package/lib/components/InboxMessage/message-widgets/CommonMessage.js +11 -6
- package/lib/components/InboxMessage/message-widgets/CommonMessage.js.map +1 -1
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.d.ts +14 -0
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.d.ts.map +1 -0
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.js +1525 -0
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.js.map +1 -0
- package/lib/components/InboxMessage/message-widgets/PlainMessage.d.ts.map +1 -1
- package/lib/components/InboxMessage/message-widgets/PlainMessage.js +6 -3
- package/lib/components/InboxMessage/message-widgets/PlainMessage.js.map +1 -1
- package/lib/components/InboxMessage/message-widgets/SlackLikeMessageGroup.d.ts.map +1 -1
- package/lib/components/InboxMessage/message-widgets/SlackLikeMessageGroup.js +207 -12
- package/lib/components/InboxMessage/message-widgets/SlackLikeMessageGroup.js.map +1 -1
- package/lib/components/InboxMessage/message-widgets/index.d.ts +1 -0
- package/lib/components/InboxMessage/message-widgets/index.d.ts.map +1 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/compute.d.ts.map +1 -1
- package/lib/compute.js +79 -3
- package/lib/compute.js.map +1 -1
- package/lib/config/env-config.d.ts +6 -0
- package/lib/config/env-config.d.ts.map +1 -1
- package/lib/config/env-config.js +19 -1
- package/lib/config/env-config.js.map +1 -1
- package/lib/container/AiInbox.d.ts +15 -0
- package/lib/container/AiInbox.d.ts.map +1 -0
- package/lib/container/AiInboxWithLoader.d.ts +36 -0
- package/lib/container/AiInboxWithLoader.d.ts.map +1 -0
- package/lib/container/AiLandingInput.d.ts +4 -0
- package/lib/container/AiLandingInput.d.ts.map +1 -0
- package/lib/container/AiLandingInput.js +164 -0
- package/lib/container/AiLandingInput.js.map +1 -0
- package/lib/container/Inbox.d.ts.map +1 -1
- package/lib/container/Inbox.js +6 -4
- package/lib/container/Inbox.js.map +1 -1
- package/lib/container/InboxAiMessagesLoader.d.ts +36 -0
- package/lib/container/InboxAiMessagesLoader.d.ts.map +1 -0
- package/lib/container/InboxAiMessagesLoader.js +44 -0
- package/lib/container/InboxAiMessagesLoader.js.map +1 -0
- package/lib/container/InboxContainer.d.ts +12 -0
- package/lib/container/InboxContainer.d.ts.map +1 -0
- package/lib/container/InboxContainer.js +31 -0
- package/lib/container/InboxContainer.js.map +1 -0
- package/lib/container/InboxTemplate1.d.ts +15 -0
- package/lib/container/InboxTemplate1.d.ts.map +1 -0
- package/lib/container/InboxTemplate1WithLoader.d.ts +36 -0
- package/lib/container/InboxTemplate1WithLoader.d.ts.map +1 -0
- package/lib/container/InboxTemplate2.d.ts +15 -0
- package/lib/container/InboxTemplate2.d.ts.map +1 -0
- package/lib/container/InboxWithAiLoader.d.ts +15 -0
- package/lib/container/InboxWithAiLoader.d.ts.map +1 -0
- package/lib/container/InboxWithAiLoader.js +56 -0
- package/lib/container/InboxWithAiLoader.js.map +1 -0
- package/lib/container/ServiceInbox.js +1 -1
- package/lib/container/ServiceInbox.js.map +1 -1
- package/lib/container/ThreadMessages.js +1 -1
- package/lib/container/ThreadMessages.js.map +1 -1
- package/lib/container/ThreadMessagesInbox.js +1 -1
- package/lib/container/ThreadMessagesInbox.js.map +1 -1
- package/lib/container/Threads.js +1 -1
- package/lib/container/Threads.js.map +1 -1
- package/lib/container/index.d.ts +4 -1
- package/lib/container/index.d.ts.map +1 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/machines/aiAgentMachine.d.ts +3 -0
- package/lib/machines/aiAgentMachine.d.ts.map +1 -0
- package/lib/machines/aiAgentMachine.js +1040 -0
- package/lib/machines/aiAgentMachine.js.map +1 -0
- package/lib/machines/types.d.ts +77 -0
- package/lib/machines/types.d.ts.map +1 -0
- package/lib/routes.json +40 -0
- package/lib/templates/InboxWithAi.d.ts +15 -0
- package/lib/templates/InboxWithAi.d.ts.map +1 -0
- package/lib/templates/InboxWithAi.js +405 -0
- package/lib/templates/InboxWithAi.js.map +1 -0
- package/lib/templates/InboxWithAi.tsx +502 -0
- package/lib/templates/index.d.ts +2 -0
- package/lib/templates/index.d.ts.map +1 -0
- package/lib/templates/index.ts +1 -0
- package/package.json +7 -5
- package/src/components/AIAgent/AIAgent.tsx +1351 -0
- package/src/components/AIAgent/README.md +82 -0
- package/src/components/AIAgent/index.ts +1 -0
- package/src/components/InboxMessage/InputComponent.tsx +263 -0
- package/src/components/InboxMessage/MessageInput.tsx +73 -66
- package/src/components/InboxMessage/MessageInputComponent.tsx +245 -0
- package/src/components/InboxMessage/Messages.tsx +2 -56
- package/src/components/InboxMessage/MessagesBuilderUi.tsx +205 -0
- package/src/components/InboxMessage/UploadImageButton.tsx +3 -2
- package/src/components/InboxMessage/index.ts +3 -0
- package/src/components/InboxMessage/message-widgets/CommonMessage.tsx +39 -21
- package/src/components/InboxMessage/message-widgets/ModernMessageGroup.tsx +1968 -0
- package/src/components/InboxMessage/message-widgets/PlainMessage.tsx +6 -2
- package/src/components/InboxMessage/message-widgets/SlackLikeMessageGroup.tsx +306 -54
- package/src/components/InboxMessage/message-widgets/index.ts +1 -0
- package/src/components/index.ts +4 -0
- package/src/compute.ts +83 -2
- package/src/config/env-config.ts +6 -0
- package/src/container/AiInbox.tsx +1796 -0
- package/src/container/AiInboxWithLoader.tsx +356 -0
- package/src/container/AiLandingInput.tsx +168 -0
- package/src/container/Inbox.tsx +8 -5
- package/src/container/InboxAiMessagesLoader.tsx +58 -0
- package/src/container/InboxContainer.tsx +35 -0
- package/src/container/InboxTemplate1.tsx +1542 -0
- package/src/container/InboxTemplate1WithLoader.tsx +338 -0
- package/src/container/InboxTemplate2.tsx +1606 -0
- package/src/container/InboxWithAiLoader.tsx +76 -0
- package/src/container/index.ts +21 -1
- package/src/index.ts +12 -1
- package/src/machines/aiAgentMachine.ts +1248 -0
- package/src/machines/types.ts +59 -0
- package/src/templates/InboxWithAi.tsx +502 -0
- package/src/templates/index.ts +1 -0
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
ReactNode,
|
|
3
|
+
useCallback,
|
|
4
|
+
useEffect,
|
|
5
|
+
useMemo,
|
|
6
|
+
useReducer,
|
|
7
|
+
useRef,
|
|
8
|
+
createContext,
|
|
9
|
+
useContext,
|
|
10
|
+
useState,
|
|
11
|
+
} from 'react';
|
|
12
|
+
import { Outlet, useNavigate, useParams, useLocation } from '@remix-run/react';
|
|
13
|
+
|
|
14
|
+
// Context for sharing tab state between header and sidebar
|
|
15
|
+
const TabContext = createContext<{
|
|
16
|
+
activeTab: string;
|
|
17
|
+
setActiveTab: (tab: string) => void;
|
|
18
|
+
}>({
|
|
19
|
+
activeTab: 'design',
|
|
20
|
+
setActiveTab: () => {},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export interface InboxProps {
|
|
24
|
+
channelFilters?: Record<string, unknown>;
|
|
25
|
+
channelRole?: string;
|
|
26
|
+
supportServices?: boolean;
|
|
27
|
+
pathPrefix?: string;
|
|
28
|
+
data?: any;
|
|
29
|
+
orgName?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Static utility hooks and components
|
|
33
|
+
const useMediaQuery = (query: string) => {
|
|
34
|
+
const [matches, setMatches] = React.useState(false);
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (typeof window === 'undefined') return;
|
|
38
|
+
|
|
39
|
+
const mediaQuery = window.matchMedia(query);
|
|
40
|
+
const updateMatches = () => setMatches(mediaQuery.matches);
|
|
41
|
+
|
|
42
|
+
updateMatches();
|
|
43
|
+
mediaQuery.addEventListener('change', updateMatches);
|
|
44
|
+
return () => mediaQuery.removeEventListener('change', updateMatches);
|
|
45
|
+
}, [query]);
|
|
46
|
+
|
|
47
|
+
return matches;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// Hook to get window dimensions
|
|
51
|
+
const useWindowDimensions = () => {
|
|
52
|
+
const [windowDimensions, setWindowDimensions] = React.useState({
|
|
53
|
+
width: typeof window !== 'undefined' ? window.innerWidth : 1024,
|
|
54
|
+
height: typeof window !== 'undefined' ? window.innerHeight : 768,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (typeof window === 'undefined') return;
|
|
59
|
+
|
|
60
|
+
const handleResize = () => {
|
|
61
|
+
setWindowDimensions({
|
|
62
|
+
width: window.innerWidth,
|
|
63
|
+
height: window.innerHeight,
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
window.addEventListener('resize', handleResize);
|
|
68
|
+
handleResize(); // Set initial dimensions
|
|
69
|
+
|
|
70
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
71
|
+
}, []);
|
|
72
|
+
|
|
73
|
+
return windowDimensions;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const EmptyState = React.memo(() => (
|
|
77
|
+
<div className="h-full flex items-center justify-center bg-gray-100 p-4 sm:p-6 overflow-hidden">
|
|
78
|
+
<div className="text-center max-w-sm mx-auto">
|
|
79
|
+
<div className="text-3xl sm:text-4xl text-gray-400 mb-4">💬</div>
|
|
80
|
+
<h3 className="text-lg sm:text-xl font-semibold text-gray-600 mb-2">Welcome to Messenger</h3>
|
|
81
|
+
<p className="text-sm sm:text-base text-gray-500 leading-relaxed">
|
|
82
|
+
Select a conversation from the sidebar to start messaging
|
|
83
|
+
</p>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
));
|
|
87
|
+
|
|
88
|
+
const InboxWithAi = (props: InboxProps) => {
|
|
89
|
+
const [activeTab, setActiveTab] = React.useState('design');
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<TabContext.Provider value={{ activeTab, setActiveTab }}>
|
|
93
|
+
<InboxWithAiInternal {...props} />
|
|
94
|
+
</TabContext.Provider>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const InboxWithAiInternal = (props: InboxProps) => {
|
|
99
|
+
// const { channelFilters: channelFilterProp, channelRole, supportServices, data, orgName, pathPrefix = null } = props;
|
|
100
|
+
const { id: pathChannelId, postId: pathPostId } = useParams();
|
|
101
|
+
const location = useLocation();
|
|
102
|
+
const urlParams = location?.search ? new URLSearchParams(location.search) : null;
|
|
103
|
+
const { activeTab, setActiveTab } = useContext(TabContext);
|
|
104
|
+
|
|
105
|
+
// Extract channelId from query parameters (priority) or path parameters (fallback)
|
|
106
|
+
const channelId = urlParams?.get('id') || pathChannelId;
|
|
107
|
+
|
|
108
|
+
// Handle refresh sandbox
|
|
109
|
+
const handleRefreshSandbox = useCallback(() => {
|
|
110
|
+
console.log('Refreshing sandbox...');
|
|
111
|
+
}, []);
|
|
112
|
+
|
|
113
|
+
// Hooks - improved responsive breakpoints with better granularity
|
|
114
|
+
const { width: windowWidth, height: windowHeight } = useWindowDimensions();
|
|
115
|
+
const isMobileView = useMediaQuery('(max-width: 640px)');
|
|
116
|
+
const isSmallTabletView = useMediaQuery('(min-width: 641px) and (max-width: 900px)');
|
|
117
|
+
const isTabletView = useMediaQuery('(min-width: 901px) and (max-width: 1024px)');
|
|
118
|
+
const isDesktopView = useMediaQuery('(min-width: 1025px)');
|
|
119
|
+
const isLargeDesktopView = useMediaQuery('(min-width: 1440px)');
|
|
120
|
+
const isSmallScreen = useMediaQuery('(max-width: 900px)');
|
|
121
|
+
// const auth = useSelector(userSelector);
|
|
122
|
+
|
|
123
|
+
const detailSidebarOptions = useMemo(
|
|
124
|
+
() => ({
|
|
125
|
+
isMobileView,
|
|
126
|
+
isSmallTabletView,
|
|
127
|
+
isTabletView,
|
|
128
|
+
isDesktopView,
|
|
129
|
+
isLargeDesktopView,
|
|
130
|
+
isSmallScreen,
|
|
131
|
+
}),
|
|
132
|
+
[isMobileView, isSmallTabletView, isTabletView, isDesktopView, isLargeDesktopView, isSmallScreen],
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<>
|
|
137
|
+
{/* Main Container */}
|
|
138
|
+
<div className="flex flex-col h-screen overflow-hidden">
|
|
139
|
+
{/* Header with Design/Interact/Code tabs - now inside main container */}
|
|
140
|
+
{channelId && (
|
|
141
|
+
<div className="flex-shrink-0 bg-white ">
|
|
142
|
+
<div className="flex items-center justify-between px-4 py-3">
|
|
143
|
+
<div className="flex items-center">
|
|
144
|
+
{/* Show tabs only on larger screens */}
|
|
145
|
+
{!isSmallScreen && (
|
|
146
|
+
<div className="flex bg-gray-100 p-2" style={{ borderRadius: '10px' }}>
|
|
147
|
+
<button
|
|
148
|
+
onClick={() => setActiveTab('design')}
|
|
149
|
+
className={`flex items-center space-x-2 px-4 py-2 text-xs font-medium transition-all duration-200 ${
|
|
150
|
+
activeTab === 'design'
|
|
151
|
+
? 'bg-blue-500 text-white shadow-sm'
|
|
152
|
+
: 'text-gray-600 hover:text-gray-900'
|
|
153
|
+
}`}
|
|
154
|
+
style={{ borderRadius: '10px' }}
|
|
155
|
+
>
|
|
156
|
+
<svg
|
|
157
|
+
className="w-4 h-4"
|
|
158
|
+
fill="none"
|
|
159
|
+
stroke="currentColor"
|
|
160
|
+
viewBox="0 0 24 24"
|
|
161
|
+
>
|
|
162
|
+
<path
|
|
163
|
+
strokeLinecap="round"
|
|
164
|
+
strokeLinejoin="round"
|
|
165
|
+
strokeWidth={2}
|
|
166
|
+
d="M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"
|
|
167
|
+
/>
|
|
168
|
+
</svg>
|
|
169
|
+
<span>Design</span>
|
|
170
|
+
</button>
|
|
171
|
+
<button
|
|
172
|
+
onClick={() => setActiveTab('interact')}
|
|
173
|
+
className={`flex items-center space-x-2 px-4 py-2 text-xs font-medium transition-all duration-200 ${
|
|
174
|
+
activeTab === 'interact'
|
|
175
|
+
? 'bg-blue-500 text-white shadow-sm'
|
|
176
|
+
: 'text-gray-600 hover:text-gray-900'
|
|
177
|
+
}`}
|
|
178
|
+
style={{ borderRadius: '10px' }}
|
|
179
|
+
>
|
|
180
|
+
<svg
|
|
181
|
+
className="w-4 h-4"
|
|
182
|
+
fill="none"
|
|
183
|
+
stroke="currentColor"
|
|
184
|
+
viewBox="0 0 24 24"
|
|
185
|
+
>
|
|
186
|
+
<path
|
|
187
|
+
strokeLinecap="round"
|
|
188
|
+
strokeLinejoin="round"
|
|
189
|
+
strokeWidth={2}
|
|
190
|
+
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
191
|
+
/>
|
|
192
|
+
<path
|
|
193
|
+
strokeLinecap="round"
|
|
194
|
+
strokeLinejoin="round"
|
|
195
|
+
strokeWidth={2}
|
|
196
|
+
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
|
|
197
|
+
/>
|
|
198
|
+
</svg>
|
|
199
|
+
<span>Interact</span>
|
|
200
|
+
</button>
|
|
201
|
+
<button
|
|
202
|
+
onClick={() => setActiveTab('code')}
|
|
203
|
+
className={`flex items-center space-x-2 px-4 py-2 text-xs font-medium transition-all duration-200 ${
|
|
204
|
+
activeTab === 'code'
|
|
205
|
+
? 'bg-blue-500 text-white shadow-sm'
|
|
206
|
+
: 'text-gray-600 hover:text-gray-900'
|
|
207
|
+
}`}
|
|
208
|
+
style={{ borderRadius: '10px' }}
|
|
209
|
+
>
|
|
210
|
+
<svg
|
|
211
|
+
className="w-4 h-4"
|
|
212
|
+
fill="none"
|
|
213
|
+
stroke="currentColor"
|
|
214
|
+
viewBox="0 24 24"
|
|
215
|
+
>
|
|
216
|
+
<path
|
|
217
|
+
strokeLinecap="round"
|
|
218
|
+
strokeLinejoin="round"
|
|
219
|
+
strokeWidth={2}
|
|
220
|
+
d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"
|
|
221
|
+
/>
|
|
222
|
+
</svg>
|
|
223
|
+
<span>Code</span>
|
|
224
|
+
</button>
|
|
225
|
+
</div>
|
|
226
|
+
)}
|
|
227
|
+
</div>
|
|
228
|
+
|
|
229
|
+
{/* Refresh icon on the right - hidden on mobile */}
|
|
230
|
+
{isDesktopView && (
|
|
231
|
+
<button
|
|
232
|
+
onClick={handleRefreshSandbox}
|
|
233
|
+
className="p-2 text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded-lg transition-colors"
|
|
234
|
+
title="Refresh Sandbox"
|
|
235
|
+
>
|
|
236
|
+
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
237
|
+
<path
|
|
238
|
+
strokeLinecap="round"
|
|
239
|
+
strokeLinejoin="round"
|
|
240
|
+
strokeWidth={2}
|
|
241
|
+
d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
|
|
242
|
+
/>
|
|
243
|
+
</svg>
|
|
244
|
+
</button>
|
|
245
|
+
)}
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
)}
|
|
249
|
+
|
|
250
|
+
{/* Content Grid - ContentComponent and RightSidebar */}
|
|
251
|
+
<div
|
|
252
|
+
className="flex-1 grid overflow-hidden"
|
|
253
|
+
style={{
|
|
254
|
+
gridTemplateColumns: isDesktopView ? '35% 65%' : '1fr',
|
|
255
|
+
height: 'calc(100vh - 80px)', // Subtract header height
|
|
256
|
+
}}
|
|
257
|
+
>
|
|
258
|
+
{/* Main Content Area - 35% width on desktop */}
|
|
259
|
+
<div
|
|
260
|
+
className={`
|
|
261
|
+
${isMobileView && !channelId ? 'hidden' : 'flex'}
|
|
262
|
+
flex flex-col overflow-hidden transition-all duration-300 ease-in-out
|
|
263
|
+
`}
|
|
264
|
+
style={{ paddingTop: '15px' }}
|
|
265
|
+
>
|
|
266
|
+
{channelId ? <ContentComponent channelId={channelId} /> : <EmptyState />}
|
|
267
|
+
</div>
|
|
268
|
+
|
|
269
|
+
{/* Right Sidebar - 65% width on desktop only */}
|
|
270
|
+
{channelId && isDesktopView && (
|
|
271
|
+
<div
|
|
272
|
+
className="overflow-hidden border"
|
|
273
|
+
style={{ marginBottom: 10, marginRight: 10, borderRadius: 10 }}
|
|
274
|
+
>
|
|
275
|
+
<RightSidebarContent
|
|
276
|
+
detailSidebarOptions={detailSidebarOptions}
|
|
277
|
+
windowWidth={windowWidth}
|
|
278
|
+
windowHeight={windowHeight}
|
|
279
|
+
/>
|
|
280
|
+
</div>
|
|
281
|
+
)}
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
</>
|
|
285
|
+
);
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
const ContentComponent = React.memo((props: any) => {
|
|
289
|
+
const { channelId } = props;
|
|
290
|
+
|
|
291
|
+
return (
|
|
292
|
+
<div className="flex overflow-hidden h-full">
|
|
293
|
+
{/* Main Chat Content */}
|
|
294
|
+
<div className="flex-1 flex flex-col min-w-0 overflow-hidden border-t border-gray-300">
|
|
295
|
+
{/* Content based on postId */}
|
|
296
|
+
<div className="flex-1 flex flex-col min-h-0 overflow-hidden">
|
|
297
|
+
{channelId && (
|
|
298
|
+
<>
|
|
299
|
+
<MessagesComponent {...props} />
|
|
300
|
+
</>
|
|
301
|
+
)}
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
);
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
const RightSidebarWrapper = React.memo(({ detailSidebarOptions }: any) => {
|
|
309
|
+
const { activeTab } = useContext(TabContext);
|
|
310
|
+
return (
|
|
311
|
+
<div className="h-full flex flex-col overflow-hidden bg-white">
|
|
312
|
+
{/* Content Area */}
|
|
313
|
+
<div className="flex-1 overflow-hidden">
|
|
314
|
+
{activeTab === 'design' ? (
|
|
315
|
+
<div className="h-full flex items-center justify-center bg-gray-50">
|
|
316
|
+
<div className="text-center">
|
|
317
|
+
{/* Next.js Logo */}
|
|
318
|
+
<div className="mb-8">
|
|
319
|
+
<svg className="w-32 h-16 mx-auto text-black" viewBox="0 0 394 80" fill="currentColor">
|
|
320
|
+
<path d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.4zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.7h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z" />
|
|
321
|
+
<path d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.2 3.4 1 1.4 1.5 3 1.5 5h-5.8z" />
|
|
322
|
+
</svg>
|
|
323
|
+
</div>
|
|
324
|
+
|
|
325
|
+
<div className="space-y-4 text-gray-600">
|
|
326
|
+
<h3 className="text-lg font-semibold text-gray-900">Design View</h3>
|
|
327
|
+
<p className="font-mono text-sm bg-gray-100 px-3 py-1 rounded">
|
|
328
|
+
Design components and UI
|
|
329
|
+
</p>
|
|
330
|
+
<p>Customize and preview your design changes.</p>
|
|
331
|
+
</div>
|
|
332
|
+
|
|
333
|
+
<div className="mt-8 space-y-4">
|
|
334
|
+
<button className="bg-black text-white px-6 py-3 rounded-full hover:bg-gray-800 transition-colors flex items-center space-x-2 mx-auto">
|
|
335
|
+
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
|
|
336
|
+
<path d="M12 2L2 7v10c0 5.55 3.84 9.739 9 11 5.16-1.261 9-5.45 9-11V7l-10-5z" />
|
|
337
|
+
</svg>
|
|
338
|
+
<span>Design now</span>
|
|
339
|
+
</button>
|
|
340
|
+
<p className="text-sm text-gray-500 underline cursor-pointer hover:text-gray-700">
|
|
341
|
+
View design docs
|
|
342
|
+
</p>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
346
|
+
) : activeTab === 'interact' ? (
|
|
347
|
+
<div className="h-full flex items-center justify-center bg-blue-50">
|
|
348
|
+
<div className="text-center">
|
|
349
|
+
{/* Interact Icon */}
|
|
350
|
+
<div className="mb-8">
|
|
351
|
+
<svg
|
|
352
|
+
className="w-32 h-32 mx-auto text-blue-500"
|
|
353
|
+
fill="none"
|
|
354
|
+
stroke="currentColor"
|
|
355
|
+
viewBox="0 0 24 24"
|
|
356
|
+
>
|
|
357
|
+
<path
|
|
358
|
+
strokeLinecap="round"
|
|
359
|
+
strokeLinejoin="round"
|
|
360
|
+
strokeWidth={1}
|
|
361
|
+
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
362
|
+
/>
|
|
363
|
+
<path
|
|
364
|
+
strokeLinecap="round"
|
|
365
|
+
strokeLinejoin="round"
|
|
366
|
+
strokeWidth={1}
|
|
367
|
+
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
|
|
368
|
+
/>
|
|
369
|
+
</svg>
|
|
370
|
+
</div>
|
|
371
|
+
|
|
372
|
+
<div className="space-y-4 text-gray-600">
|
|
373
|
+
<h3 className="text-lg font-semibold text-gray-900">Interactive Mode</h3>
|
|
374
|
+
<p className="font-mono text-sm bg-blue-100 px-3 py-1 rounded">
|
|
375
|
+
Live interaction and testing
|
|
376
|
+
</p>
|
|
377
|
+
<p>Test and interact with your components in real-time.</p>
|
|
378
|
+
</div>
|
|
379
|
+
|
|
380
|
+
<div className="mt-8 space-y-4">
|
|
381
|
+
<button className="bg-blue-500 text-white px-6 py-3 rounded-full hover:bg-blue-600 transition-colors flex items-center space-x-2 mx-auto">
|
|
382
|
+
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
|
|
383
|
+
<path d="M8 5v14l11-7z" />
|
|
384
|
+
</svg>
|
|
385
|
+
<span>Start Interacting</span>
|
|
386
|
+
</button>
|
|
387
|
+
<p className="text-sm text-gray-500 underline cursor-pointer hover:text-gray-700">
|
|
388
|
+
Learn about interactions
|
|
389
|
+
</p>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
</div>
|
|
393
|
+
) : (
|
|
394
|
+
<div className="h-full bg-gray-900 text-gray-300 p-4 overflow-auto">
|
|
395
|
+
<div className="font-mono text-sm">
|
|
396
|
+
<div className="mb-4">
|
|
397
|
+
<div className="text-green-400">// app/page.tsx</div>
|
|
398
|
+
</div>
|
|
399
|
+
<div className="space-y-2">
|
|
400
|
+
<div>
|
|
401
|
+
<span className="text-purple-400">export</span>{' '}
|
|
402
|
+
<span className="text-purple-400">default</span>{' '}
|
|
403
|
+
<span className="text-blue-400">function</span>{' '}
|
|
404
|
+
<span className="text-yellow-400">Home</span>() {'{'}
|
|
405
|
+
</div>
|
|
406
|
+
<div className="ml-4">
|
|
407
|
+
<span className="text-purple-400">return</span> (
|
|
408
|
+
</div>
|
|
409
|
+
<div className="ml-8">
|
|
410
|
+
{'<'}
|
|
411
|
+
<span className="text-red-400">main</span>{' '}
|
|
412
|
+
<span className="text-green-400">className</span>=
|
|
413
|
+
<span className="text-yellow-400">
|
|
414
|
+
"flex min-h-screen flex-col items-center justify-between p-24"
|
|
415
|
+
</span>
|
|
416
|
+
{'>'}
|
|
417
|
+
</div>
|
|
418
|
+
<div className="ml-12">
|
|
419
|
+
{'<'}
|
|
420
|
+
<span className="text-red-400">div</span>{' '}
|
|
421
|
+
<span className="text-green-400">className</span>=
|
|
422
|
+
<span className="text-yellow-400">
|
|
423
|
+
"z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex"
|
|
424
|
+
</span>
|
|
425
|
+
{'>'}
|
|
426
|
+
</div>
|
|
427
|
+
<div className="ml-16">
|
|
428
|
+
{'<'}
|
|
429
|
+
<span className="text-red-400">p</span>{' '}
|
|
430
|
+
<span className="text-green-400">className</span>=
|
|
431
|
+
<span className="text-yellow-400">
|
|
432
|
+
"fixed left-0 top-0 flex w-full justify-center border-b border-gray-300
|
|
433
|
+
bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl
|
|
434
|
+
dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static
|
|
435
|
+
lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30"
|
|
436
|
+
</span>
|
|
437
|
+
{'>'}
|
|
438
|
+
</div>
|
|
439
|
+
<div className="ml-20 text-gray-400">Get started by editing </div>
|
|
440
|
+
<div className="ml-20">
|
|
441
|
+
{'<'}
|
|
442
|
+
<span className="text-red-400">code</span>{' '}
|
|
443
|
+
<span className="text-green-400">className</span>=
|
|
444
|
+
<span className="text-yellow-400">"font-mono font-bold"</span>
|
|
445
|
+
{'>'}app/page.tsx{'</'}
|
|
446
|
+
<span className="text-red-400">code</span>
|
|
447
|
+
{'>'}
|
|
448
|
+
</div>
|
|
449
|
+
<div className="ml-16">
|
|
450
|
+
{'</'}
|
|
451
|
+
<span className="text-red-400">p</span>
|
|
452
|
+
{'>'}
|
|
453
|
+
</div>
|
|
454
|
+
<div className="ml-12">
|
|
455
|
+
{'</'}
|
|
456
|
+
<span className="text-red-400">div</span>
|
|
457
|
+
{'>'}
|
|
458
|
+
</div>
|
|
459
|
+
<div className="ml-8">
|
|
460
|
+
{'</'}
|
|
461
|
+
<span className="text-red-400">main</span>
|
|
462
|
+
{'>'}
|
|
463
|
+
</div>
|
|
464
|
+
<div className="ml-4">);</div>
|
|
465
|
+
<div>{'}'}</div>
|
|
466
|
+
</div>
|
|
467
|
+
</div>
|
|
468
|
+
</div>
|
|
469
|
+
)}
|
|
470
|
+
</div>
|
|
471
|
+
</div>
|
|
472
|
+
);
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
const RightSidebarContent = React.memo(({ detailSidebarOptions, windowWidth, windowHeight }: any) => {
|
|
476
|
+
return (
|
|
477
|
+
<div
|
|
478
|
+
className="border-l border-gray-200 bg-white flex-shrink-0 overflow-hidden"
|
|
479
|
+
style={{
|
|
480
|
+
// width: `${windowWidth * 0.35}px`, // 35% of window width
|
|
481
|
+
height: `${windowHeight}px`,
|
|
482
|
+
maxHeight: '100vh',
|
|
483
|
+
}}
|
|
484
|
+
>
|
|
485
|
+
<RightSidebarWrapper detailSidebarOptions={detailSidebarOptions} />
|
|
486
|
+
</div>
|
|
487
|
+
);
|
|
488
|
+
});
|
|
489
|
+
|
|
490
|
+
const MessagesComponent = React.memo((props: any) => {
|
|
491
|
+
return <Outlet context="app" />;
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
// Display names for debugging
|
|
495
|
+
InboxWithAi.displayName = 'Inbox';
|
|
496
|
+
InboxWithAiInternal.displayName = 'InboxWithAiInternal';
|
|
497
|
+
ContentComponent.displayName = 'ContentComponent';
|
|
498
|
+
MessagesComponent.displayName = 'MessagesComponent';
|
|
499
|
+
RightSidebarWrapper.displayName = 'RightSidebarWrapper';
|
|
500
|
+
RightSidebarContent.displayName = 'RightSidebarContent';
|
|
501
|
+
|
|
502
|
+
export default React.memo(InboxWithAi);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as InboxWithAi } from './InboxWithAi';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@messenger-box/tailwind-ui-inbox",
|
|
3
|
-
"version": "10.0.3-alpha.
|
|
3
|
+
"version": "10.0.3-alpha.73",
|
|
4
4
|
"description": "Inbox UI components built with TailwindCSS",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"watch": "npm run build:lib:watch"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@messenger-box/core": "10.0.3-alpha.
|
|
25
|
-
"@messenger-box/platform-client": "10.0.3-alpha.
|
|
24
|
+
"@messenger-box/core": "10.0.3-alpha.72",
|
|
25
|
+
"@messenger-box/platform-client": "10.0.3-alpha.72",
|
|
26
26
|
"date-fns": "^4.1.0",
|
|
27
27
|
"date-fns-tz": "^3.2.0",
|
|
28
28
|
"emoji-mart": "^3.0.1",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"@tailwindcss/forms": "*",
|
|
37
37
|
"@tailwindcss/typography": "*",
|
|
38
38
|
"@workbench-stack/components": "*",
|
|
39
|
+
"@xstate/react": "*",
|
|
39
40
|
"lodash": "*",
|
|
40
41
|
"moment": "*",
|
|
41
42
|
"react": ">=16.14.0",
|
|
@@ -45,7 +46,8 @@
|
|
|
45
46
|
"redux": ">=4.0.1",
|
|
46
47
|
"redux-observable": "*",
|
|
47
48
|
"rxjs": "*",
|
|
48
|
-
"tailwindcss": "*"
|
|
49
|
+
"tailwindcss": "*",
|
|
50
|
+
"xstate": "*"
|
|
49
51
|
},
|
|
50
52
|
"publishConfig": {
|
|
51
53
|
"access": "public"
|
|
@@ -53,5 +55,5 @@
|
|
|
53
55
|
"typescript": {
|
|
54
56
|
"definition": "lib/index.d.ts"
|
|
55
57
|
},
|
|
56
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "984014e52eb95de9e208b81f92c92c86b9f949e3"
|
|
57
59
|
}
|