@messenger-box/tailwind-ui-inbox 10.0.3-alpha.122 → 10.0.3-alpha.123
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 +4 -0
- package/lib/components/AIAgent/AIAgent.d.ts +2 -0
- package/lib/components/AIAgent/AIAgent.d.ts.map +1 -1
- package/lib/components/AIAgent/AIAgent.js +42 -26
- package/lib/components/AIAgent/AIAgent.js.map +1 -1
- package/lib/components/InboxMessage/InputComponent.d.ts +4 -1
- package/lib/components/InboxMessage/InputComponent.d.ts.map +1 -1
- package/lib/components/InboxMessage/InputComponent.js +20 -304
- package/lib/components/InboxMessage/InputComponent.js.map +1 -1
- package/lib/components/InboxMessage/UploadImageButton.js +2 -6
- package/lib/components/InboxMessage/UploadImageButton.js.map +1 -1
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.d.ts +1 -0
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.d.ts.map +1 -1
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.js +15 -5
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.js.map +1 -1
- package/lib/components/ModelConfigPanel.d.ts +10 -0
- package/lib/components/ModelConfigPanel.d.ts.map +1 -1
- package/lib/components/ModelConfigPanel.js +551 -2
- package/lib/components/ModelConfigPanel.js.map +1 -1
- package/lib/components/filler-components/RightSiderBar.d.ts +1 -0
- package/lib/components/filler-components/RightSiderBar.d.ts.map +1 -1
- package/lib/components/filler-components/RightSiderBar.js +174 -140
- package/lib/components/filler-components/RightSiderBar.js.map +1 -1
- package/lib/components/slot-fill/right-sidebar-filler.d.ts.map +1 -1
- package/lib/components/slot-fill/right-sidebar-filler.js.map +1 -1
- package/lib/config/env-config.d.ts +2 -0
- package/lib/config/env-config.d.ts.map +1 -1
- package/lib/config/env-config.js +7 -1
- package/lib/config/env-config.js.map +1 -1
- package/lib/container/AiLandingInput.d.ts.map +1 -1
- package/lib/container/AiLandingInput.js +11 -9
- package/lib/container/AiLandingInput.js.map +1 -1
- package/lib/container/Inbox.js +1 -1
- package/lib/container/Inbox.js.map +1 -1
- package/lib/container/InboxAiMessagesLoader.d.ts +1 -0
- package/lib/container/InboxAiMessagesLoader.d.ts.map +1 -1
- package/lib/container/InboxAiMessagesLoader.js +4 -1
- package/lib/container/InboxAiMessagesLoader.js.map +1 -1
- package/lib/container/InboxContainer.d.ts +1 -0
- package/lib/container/InboxContainer.d.ts.map +1 -1
- package/lib/container/InboxContainer.js +1 -6
- package/lib/container/InboxContainer.js.map +1 -1
- package/lib/container/InboxWithAiLoader.d.ts +1 -0
- package/lib/container/InboxWithAiLoader.d.ts.map +1 -1
- package/lib/container/InboxWithAiLoader.js +2 -1
- package/lib/container/InboxWithAiLoader.js.map +1 -1
- 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/module.js +1 -1
- package/lib/module.js.map +1 -1
- package/lib/templates/InboxWithAi.d.ts +1 -0
- package/lib/templates/InboxWithAi.d.ts.map +1 -1
- package/lib/templates/InboxWithAi.js +9 -6
- package/lib/templates/InboxWithAi.js.map +1 -1
- package/lib/templates/InboxWithAi.tsx +7 -3
- package/lib/xstate/index.d.ts +3 -0
- package/lib/xstate/index.d.ts.map +1 -0
- package/lib/xstate/rightSidebar.machine.d.ts +4 -0
- package/lib/xstate/rightSidebar.machine.d.ts.map +1 -0
- package/lib/xstate/rightSidebar.machine.js +174 -0
- package/lib/xstate/rightSidebar.machine.js.map +1 -0
- package/lib/xstate/rightSidebar.types.d.ts +52 -0
- package/lib/xstate/rightSidebar.types.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/components/AIAgent/AIAgent.tsx +35 -21
- package/src/components/InboxMessage/InputComponent.tsx +23 -375
- package/src/components/InboxMessage/UploadImageButton.tsx +4 -4
- package/src/components/InboxMessage/message-widgets/ModernMessageGroup.tsx +17 -0
- package/src/components/ModelConfigPanel.tsx +666 -0
- package/src/components/filler-components/RightSiderBar.tsx +189 -150
- package/src/components/slot-fill/right-sidebar-filler.tsx +1 -0
- package/src/config/env-config.ts +3 -1
- package/src/container/AiLandingInput.tsx +11 -111
- package/src/container/InboxAiMessagesLoader.tsx +13 -2
- package/src/container/InboxContainer.tsx +2 -8
- package/src/container/InboxWithAiLoader.tsx +2 -0
- package/src/templates/InboxWithAi.tsx +7 -3
- package/src/xstate/index.ts +2 -0
- package/src/xstate/rightSidebar.machine.ts +139 -0
- package/src/xstate/rightSidebar.types.ts +55 -0
|
@@ -33,6 +33,7 @@ export interface InboxProps {
|
|
|
33
33
|
data?: any;
|
|
34
34
|
orgName?: string;
|
|
35
35
|
handleRecreateSandbox?: (messageId: string) => void | Promise<any>;
|
|
36
|
+
isShowOnlyInbox?: boolean;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
// Static utility hooks and components
|
|
@@ -198,7 +199,7 @@ const InboxWithAiInternal = (props: InboxProps) => {
|
|
|
198
199
|
{/* Main Container */}
|
|
199
200
|
<div className="flex flex-col h-screen overflow-hidden">
|
|
200
201
|
{/* Header with Design/Interact/Code tabs - now inside main container */}
|
|
201
|
-
{channelId && (
|
|
202
|
+
{channelId && !props?.isShowOnlyInbox && (
|
|
202
203
|
<div className="flex-shrink-0 bg-white ">
|
|
203
204
|
<div className="flex items-center justify-between px-4 py-3">
|
|
204
205
|
<div className="flex items-center">
|
|
@@ -332,7 +333,7 @@ const InboxWithAiInternal = (props: InboxProps) => {
|
|
|
332
333
|
<div
|
|
333
334
|
className="flex-1 grid overflow-hidden"
|
|
334
335
|
style={{
|
|
335
|
-
gridTemplateColumns: isDesktopView ? '35% 65%' : '1fr',
|
|
336
|
+
gridTemplateColumns: isDesktopView ? (props?.isShowOnlyInbox ? '1fr' : '35% 65%') : '1fr',
|
|
336
337
|
height: 'calc(100vh - 80px)', // Subtract header height
|
|
337
338
|
}}
|
|
338
339
|
>
|
|
@@ -356,6 +357,7 @@ const InboxWithAiInternal = (props: InboxProps) => {
|
|
|
356
357
|
setIsLoading={setIsLoading}
|
|
357
358
|
isLoading={isLoading}
|
|
358
359
|
sendMessageInput={sendMessageInput}
|
|
360
|
+
isShowOnlyInbox={props?.isShowOnlyInbox}
|
|
359
361
|
/>
|
|
360
362
|
) : (
|
|
361
363
|
<EmptyState />
|
|
@@ -363,7 +365,7 @@ const InboxWithAiInternal = (props: InboxProps) => {
|
|
|
363
365
|
</div>
|
|
364
366
|
|
|
365
367
|
{/* Right Sidebar - 65% width on desktop only */}
|
|
366
|
-
{channelId && isDesktopView && (
|
|
368
|
+
{channelId && isDesktopView && !props?.isShowOnlyInbox && (
|
|
367
369
|
<div
|
|
368
370
|
className="overflow-hidden border flex-1 w-full"
|
|
369
371
|
style={{
|
|
@@ -406,6 +408,7 @@ const ContentComponent = React.memo((props: any) => {
|
|
|
406
408
|
setIsLoading,
|
|
407
409
|
isLoading,
|
|
408
410
|
sendMessageInput,
|
|
411
|
+
isShowOnlyInbox,
|
|
409
412
|
} = props;
|
|
410
413
|
|
|
411
414
|
return (
|
|
@@ -426,6 +429,7 @@ const ContentComponent = React.memo((props: any) => {
|
|
|
426
429
|
setIsLoading={setIsLoading}
|
|
427
430
|
isLoading={isLoading}
|
|
428
431
|
sendMessageInput={sendMessageInput}
|
|
432
|
+
isShowOnlyInbox={isShowOnlyInbox}
|
|
429
433
|
/>
|
|
430
434
|
</>
|
|
431
435
|
)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xstate/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RightSidebarContext, MachineEvent } from './rightSidebar.types';
|
|
2
|
+
export declare const rightSidebarMachine: import("xstate").StateMachine<RightSidebarContext, MachineEvent, Record<string, import("xstate").AnyActorRef>, import("xstate").ProvidedActor, import("xstate").ParameterizedObject, import("xstate").ParameterizedObject, string, import("xstate").StateValue, string, Partial<RightSidebarContext>, {}, import("xstate").EventObject, import("xstate").MetaObject, any>;
|
|
3
|
+
export type RightSidebarMachine = typeof rightSidebarMachine;
|
|
4
|
+
//# sourceMappingURL=rightSidebar.machine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightSidebar.machine.d.ts","sourceRoot":"","sources":["../../src/xstate/rightSidebar.machine.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE9E,eAAO,MAAM,mBAAmB,2WAqI9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import {createMachine,assign,fromPromise}from'xstate';const rightSidebarMachine = createMachine({
|
|
2
|
+
id: 'rightSidebar',
|
|
3
|
+
types: {},
|
|
4
|
+
context: ({
|
|
5
|
+
input
|
|
6
|
+
}) => ({
|
|
7
|
+
channelId: input?.channelId ?? '',
|
|
8
|
+
isMinimized: input?.isMinimized ?? false,
|
|
9
|
+
windowWidth: input?.windowWidth ?? 0,
|
|
10
|
+
windowHeight: input?.windowHeight ?? 0,
|
|
11
|
+
isLoading: input?.isLoading ?? false,
|
|
12
|
+
activeFragment: input?.activeFragment ?? null,
|
|
13
|
+
currentFiles: input?.currentFiles ?? {},
|
|
14
|
+
canvasLayers: input?.canvasLayers ?? [],
|
|
15
|
+
previewStatus: input?.previewStatus ?? null
|
|
16
|
+
}),
|
|
17
|
+
initial: 'idle',
|
|
18
|
+
states: {
|
|
19
|
+
idle: {
|
|
20
|
+
on: {
|
|
21
|
+
UPDATE: {
|
|
22
|
+
actions: assign(({
|
|
23
|
+
context,
|
|
24
|
+
event
|
|
25
|
+
}) => ({
|
|
26
|
+
...context,
|
|
27
|
+
...(event.value || {})
|
|
28
|
+
}))
|
|
29
|
+
},
|
|
30
|
+
SET_FRAGMENT: {
|
|
31
|
+
target: 'probing',
|
|
32
|
+
actions: assign(({
|
|
33
|
+
context,
|
|
34
|
+
event
|
|
35
|
+
}) => ({
|
|
36
|
+
...context,
|
|
37
|
+
activeFragment: event.fragment,
|
|
38
|
+
currentFiles: event.fragment?.files || context.currentFiles,
|
|
39
|
+
canvasLayers: event.fragment?.canvasLayers || context.canvasLayers,
|
|
40
|
+
previewStatus: event.fragment?.sandboxUrl ? {
|
|
41
|
+
status: 'checking'
|
|
42
|
+
} : null
|
|
43
|
+
}))
|
|
44
|
+
},
|
|
45
|
+
PROBE: 'probing',
|
|
46
|
+
SET_LOADING: {
|
|
47
|
+
actions: assign(({
|
|
48
|
+
context,
|
|
49
|
+
event
|
|
50
|
+
}) => ({
|
|
51
|
+
...context,
|
|
52
|
+
isLoading: event.isLoading
|
|
53
|
+
}))
|
|
54
|
+
},
|
|
55
|
+
RECREATE_SANDBOX: 'recreating'
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
probing: {
|
|
59
|
+
invoke: {
|
|
60
|
+
id: 'probeUrl',
|
|
61
|
+
src: 'probeUrl',
|
|
62
|
+
input: ({
|
|
63
|
+
context,
|
|
64
|
+
event
|
|
65
|
+
}) => ({
|
|
66
|
+
url: event.url ?? context.activeFragment?.sandboxUrl,
|
|
67
|
+
fragmentId: event.fragmentId ?? context.activeFragment?.id
|
|
68
|
+
}),
|
|
69
|
+
onDone: {
|
|
70
|
+
target: 'idle',
|
|
71
|
+
actions: assign(({
|
|
72
|
+
context
|
|
73
|
+
}) => ({
|
|
74
|
+
...context,
|
|
75
|
+
previewStatus: null,
|
|
76
|
+
isLoading: false
|
|
77
|
+
}))
|
|
78
|
+
},
|
|
79
|
+
onError: {
|
|
80
|
+
target: 'idle',
|
|
81
|
+
actions: assign(({
|
|
82
|
+
context,
|
|
83
|
+
event
|
|
84
|
+
}) => ({
|
|
85
|
+
...context,
|
|
86
|
+
previewStatus: {
|
|
87
|
+
status: 'error',
|
|
88
|
+
message: event.error instanceof Error ? event.error.message : 'Network error'
|
|
89
|
+
},
|
|
90
|
+
isLoading: false
|
|
91
|
+
}))
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
recreating: {
|
|
96
|
+
invoke: {
|
|
97
|
+
id: 'recreateSandbox',
|
|
98
|
+
src: 'recreateSandbox',
|
|
99
|
+
input: ({
|
|
100
|
+
event
|
|
101
|
+
}) => ({
|
|
102
|
+
id: event.id
|
|
103
|
+
}),
|
|
104
|
+
onDone: {
|
|
105
|
+
target: 'idle',
|
|
106
|
+
actions: assign(({
|
|
107
|
+
context
|
|
108
|
+
}) => ({
|
|
109
|
+
...context,
|
|
110
|
+
isLoading: false
|
|
111
|
+
}))
|
|
112
|
+
},
|
|
113
|
+
onError: {
|
|
114
|
+
target: 'idle',
|
|
115
|
+
actions: assign(({
|
|
116
|
+
context,
|
|
117
|
+
event
|
|
118
|
+
}) => ({
|
|
119
|
+
...context,
|
|
120
|
+
isLoading: false,
|
|
121
|
+
previewStatus: {
|
|
122
|
+
status: 'error',
|
|
123
|
+
message: event.error instanceof Error ? event.error.message : 'Recreate failed'
|
|
124
|
+
}
|
|
125
|
+
}))
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}).provide({
|
|
131
|
+
actors: {
|
|
132
|
+
probeUrl: fromPromise(async ({
|
|
133
|
+
input
|
|
134
|
+
}) => {
|
|
135
|
+
const {
|
|
136
|
+
url
|
|
137
|
+
} = input;
|
|
138
|
+
if (!url) return {
|
|
139
|
+
ok: false
|
|
140
|
+
};
|
|
141
|
+
const controller = new AbortController();
|
|
142
|
+
const timeoutId = setTimeout(() => controller.abort(), 10000);
|
|
143
|
+
try {
|
|
144
|
+
const res = await fetch(url, {
|
|
145
|
+
method: 'GET',
|
|
146
|
+
mode: 'cors',
|
|
147
|
+
redirect: 'follow',
|
|
148
|
+
signal: controller.signal
|
|
149
|
+
});
|
|
150
|
+
clearTimeout(timeoutId);
|
|
151
|
+
if (!res.ok) {
|
|
152
|
+
throw new Error(`${res.status} ${res.statusText}`);
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
ok: true
|
|
156
|
+
};
|
|
157
|
+
} finally {
|
|
158
|
+
clearTimeout(timeoutId);
|
|
159
|
+
}
|
|
160
|
+
}),
|
|
161
|
+
recreateSandbox: fromPromise(async ({
|
|
162
|
+
input
|
|
163
|
+
}) => {
|
|
164
|
+
// Placeholder actor: implement by injecting via provide in component if needed
|
|
165
|
+
const {
|
|
166
|
+
id
|
|
167
|
+
} = input;
|
|
168
|
+
console.log('recreateSandbox actor invoked for id:', id);
|
|
169
|
+
return {
|
|
170
|
+
success: true
|
|
171
|
+
};
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
});export{rightSidebarMachine};//# sourceMappingURL=rightSidebar.machine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightSidebar.machine.js","sources":["../../src/xstate/rightSidebar.machine.ts"],"sourcesContent":[null],"names":[],"mappings":"sDAGO,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAC7C,EAAA,EAAA,EAAE,cAAE;AACJ,EAAA,KAAA,EAAK,EAAE;SAKP,EAAO,CAAA;AACH,IAAA;AACA,GAAA,MAAA;AACA,IAAA,SAAA,EAAA,KAAW,EAAE,SAAO,IAAA,EAAA;AACpB,IAAA,WAAA,EAAA,KAAc,EAAA,WAAO,IAAA;AACrB,IAAA,WAAA,EAAS,KAAE,EAAK,WAAW,IAAI,CAAA;AAC/B,IAAA,YAAA,EAAA,KAAc,EAAE,YAAO,IAAA,CAAA;AACvB,IAAA,SAAA,EAAA,KAAY,EAAE,SAAO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SAAA;;AAEH,UAAA,MAAA,EAAC,MAAC;iBACH,EAAA,MAAA,CAAA,CAAA;AACA,YAAA,OAAA;AACI,YAAA;iBACH;AACD,YAAA,GAAA,OAAA;YACJ,SAAC,EAAA,KAAA;yBAAU,EAAA;oBACP,EAAA,OAAa;cAChB,OAAA,EAAA,KAAA,CAAA,KAAA,YAAA,KAAA,GAAA,KAAA,CAAA,KAAA,CAAA,OAAA,GAAA;AACL;WACA,CAAA;;AAEI;AACA;AACA;AACJ,CAAA,CAAA,CAAA,OAAE,CAAA;AACL,EAAA,MAAA,EAAA;AACJ,IAAE,QAAA,EAAA,WAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ActorRefFrom } from 'xstate';
|
|
2
|
+
export type PreviewStatus = {
|
|
3
|
+
code?: number;
|
|
4
|
+
message?: string;
|
|
5
|
+
status?: 'checking' | 'error';
|
|
6
|
+
} | null;
|
|
7
|
+
export type ActiveFragment = {
|
|
8
|
+
id?: string;
|
|
9
|
+
sandboxUrl?: string;
|
|
10
|
+
sandboxId?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
files?: Record<string, string>;
|
|
13
|
+
projectId?: string;
|
|
14
|
+
modelConfig?: unknown;
|
|
15
|
+
canvasLayers?: unknown[];
|
|
16
|
+
summary?: unknown;
|
|
17
|
+
isError?: boolean;
|
|
18
|
+
} | null;
|
|
19
|
+
export type RightSidebarContext = {
|
|
20
|
+
channelId: string;
|
|
21
|
+
isMinimized: boolean;
|
|
22
|
+
windowWidth: number;
|
|
23
|
+
windowHeight: number;
|
|
24
|
+
isLoading: boolean;
|
|
25
|
+
activeFragment: ActiveFragment;
|
|
26
|
+
currentFiles: Record<string, string>;
|
|
27
|
+
canvasLayers: unknown[];
|
|
28
|
+
previewStatus: PreviewStatus;
|
|
29
|
+
};
|
|
30
|
+
export type UpdateEvent = {
|
|
31
|
+
type: 'UPDATE';
|
|
32
|
+
value: Partial<RightSidebarContext>;
|
|
33
|
+
};
|
|
34
|
+
export type SetFragmentEvent = {
|
|
35
|
+
type: 'SET_FRAGMENT';
|
|
36
|
+
fragment: NonNullable<ActiveFragment>;
|
|
37
|
+
};
|
|
38
|
+
export type ProbeEvent = {
|
|
39
|
+
type: 'PROBE';
|
|
40
|
+
url?: string;
|
|
41
|
+
fragmentId?: string;
|
|
42
|
+
};
|
|
43
|
+
export type RecreateSandboxEvent = {
|
|
44
|
+
type: 'RECREATE_SANDBOX';
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
export type MachineEvent = UpdateEvent | SetFragmentEvent | ProbeEvent | RecreateSandboxEvent | {
|
|
48
|
+
type: 'SET_LOADING';
|
|
49
|
+
isLoading: boolean;
|
|
50
|
+
};
|
|
51
|
+
export type SubmitOrganizationActor = ActorRefFrom<any>;
|
|
52
|
+
//# sourceMappingURL=rightSidebar.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightSidebar.types.d.ts","sourceRoot":"","sources":["../../src/xstate/rightSidebar.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;CACjC,GAAG,IAAI,CAAC;AAET,MAAM,MAAM,cAAc,GAAG;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAA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C"}
|
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.123",
|
|
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.123",
|
|
25
|
+
"@messenger-box/platform-client": "10.0.3-alpha.123",
|
|
26
26
|
"@monaco-editor/react": "^4.7.0",
|
|
27
27
|
"date-fns": "^4.1.0",
|
|
28
28
|
"date-fns-tz": "^3.2.0",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"typescript": {
|
|
59
59
|
"definition": "lib/index.d.ts"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "a109255facf3a0dd71e7768bb43483b441483a46"
|
|
62
62
|
}
|
|
@@ -39,6 +39,7 @@ interface AIAgentProps {
|
|
|
39
39
|
channelName?: string;
|
|
40
40
|
isDesktopView?: boolean;
|
|
41
41
|
isSmallScreen?: boolean;
|
|
42
|
+
showDateSeparators?: boolean;
|
|
42
43
|
messages?: any[];
|
|
43
44
|
setMessages?: (messages: any[]) => void;
|
|
44
45
|
selectedPost?: any;
|
|
@@ -46,6 +47,7 @@ interface AIAgentProps {
|
|
|
46
47
|
setIsLoading?: (isLoading: boolean) => void;
|
|
47
48
|
isLoading?: boolean;
|
|
48
49
|
sendMessageInput?: ICreateChannelInput;
|
|
50
|
+
isShowOnlyInbox?: boolean;
|
|
49
51
|
[key: string]: any; // Allow other props to be passed through to Inbox
|
|
50
52
|
}
|
|
51
53
|
|
|
@@ -57,6 +59,7 @@ export const AIAgent: React.FC<AIAgentProps> = ({
|
|
|
57
59
|
currentUser,
|
|
58
60
|
isDesktopView = false,
|
|
59
61
|
isSmallScreen = false,
|
|
62
|
+
showDateSeparators = false,
|
|
60
63
|
setMessages,
|
|
61
64
|
setSelectedPost,
|
|
62
65
|
messages,
|
|
@@ -64,6 +67,7 @@ export const AIAgent: React.FC<AIAgentProps> = ({
|
|
|
64
67
|
setIsLoading,
|
|
65
68
|
isLoading,
|
|
66
69
|
sendMessageInput,
|
|
70
|
+
isShowOnlyInbox = false,
|
|
67
71
|
}) => {
|
|
68
72
|
const [state, send] = useMachine(aiAgentMachine);
|
|
69
73
|
// const apolloClient = useApolloClient();
|
|
@@ -134,7 +138,6 @@ export const AIAgent: React.FC<AIAgentProps> = ({
|
|
|
134
138
|
fetchMore: fetchMoreMessages,
|
|
135
139
|
subscribeToMore,
|
|
136
140
|
} = messagesQuery;
|
|
137
|
-
console.log('messagesData', JSON.stringify(messagesData, null, 2));
|
|
138
141
|
|
|
139
142
|
useEffect(() => {
|
|
140
143
|
if (actualChannelId) {
|
|
@@ -161,8 +164,12 @@ export const AIAgent: React.FC<AIAgentProps> = ({
|
|
|
161
164
|
successThinkingTimeoutRef.current = null;
|
|
162
165
|
}
|
|
163
166
|
}
|
|
167
|
+
// if(isShowOnlyInbox){
|
|
168
|
+
// setIsLoading(false);
|
|
169
|
+
// }
|
|
164
170
|
}
|
|
165
|
-
|
|
171
|
+
console.log('isShowOnlyInbox', isShowOnlyInbox, ' isLoading', isLoading);
|
|
172
|
+
}, [chatMessageAddedData?.chatMessageAdded, isShowOnlyInbox, setIsLoading]);
|
|
166
173
|
|
|
167
174
|
useEffect(() => {
|
|
168
175
|
if (messagesData?.messages?.data?.length == 1) {
|
|
@@ -479,29 +486,34 @@ export const AIAgent: React.FC<AIAgentProps> = ({
|
|
|
479
486
|
let currentDate = '';
|
|
480
487
|
const res: any[] = [];
|
|
481
488
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
489
|
+
if (showDateSeparators) {
|
|
490
|
+
allMessages?.forEach((msg: any) => {
|
|
491
|
+
const date = new Date(msg.createdAt);
|
|
492
|
+
let msgDate: string;
|
|
493
|
+
if (isToday(date)) msgDate = t('tailwind_ui_inbox.today');
|
|
494
|
+
else if (isYesterday(date)) msgDate = t('tailwind_ui_inbox.yesterday');
|
|
495
|
+
else msgDate = format(date, 'eee, do MMMM');
|
|
496
|
+
|
|
497
|
+
if (msgDate !== currentDate) {
|
|
498
|
+
res.push({ type: 'date', content: msgDate });
|
|
499
|
+
currentDate = msgDate;
|
|
500
|
+
}
|
|
501
|
+
res.push(msg);
|
|
502
|
+
});
|
|
495
503
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
504
|
+
if (allMessages && allMessages.length > 0) {
|
|
505
|
+
const todayLabel = t('tailwind_ui_inbox.today');
|
|
506
|
+
if (currentDate !== todayLabel) {
|
|
507
|
+
res.push({ type: 'date', content: todayLabel });
|
|
508
|
+
}
|
|
500
509
|
}
|
|
510
|
+
} else {
|
|
511
|
+
// No date separaters, keep messages as-is
|
|
512
|
+
allMessages?.forEach((msg: any) => res.push(msg));
|
|
501
513
|
}
|
|
502
514
|
|
|
503
515
|
return res;
|
|
504
|
-
}, [allMessages, t]);
|
|
516
|
+
}, [allMessages, t, showDateSeparators]);
|
|
505
517
|
|
|
506
518
|
// Group messages by date sections for Slack-like rendering
|
|
507
519
|
const messagesByDate = useMemo(() => {
|
|
@@ -857,7 +869,7 @@ export const AIAgent: React.FC<AIAgentProps> = ({
|
|
|
857
869
|
|
|
858
870
|
{completeConversationMessages?.map((section, sectionIndex) => (
|
|
859
871
|
<div key={`section-${sectionIndex}`} className="w-full px-4">
|
|
860
|
-
{section.date && (
|
|
872
|
+
{showDateSeparators && section.date && (
|
|
861
873
|
<div className="flex items-center justify-center my-3">
|
|
862
874
|
<div className="flex-grow border-t border-gray-200"></div>
|
|
863
875
|
<div className="mx-4 px-3 py-1 bg-white border border-gray-200 rounded-full text-xs font-medium text-gray-600">
|
|
@@ -941,6 +953,7 @@ export const AIAgent: React.FC<AIAgentProps> = ({
|
|
|
941
953
|
onMessageClick={(msg) => setSelectedPost(msg)}
|
|
942
954
|
isDesktopView={isDesktopView}
|
|
943
955
|
isSmallScreen={isSmallScreen}
|
|
956
|
+
showTimestamp={false}
|
|
944
957
|
sandboxErrors={sandboxErrors}
|
|
945
958
|
currentFiles={currentFiles}
|
|
946
959
|
onFixError={fixError}
|
|
@@ -1034,6 +1047,7 @@ export const AIAgent: React.FC<AIAgentProps> = ({
|
|
|
1034
1047
|
placeholder={placeholder}
|
|
1035
1048
|
modelConfig={modelConfig}
|
|
1036
1049
|
onModelConfigChange={updateModelConfig}
|
|
1050
|
+
textareaStyles={isShowOnlyInbox ? { height: '80px', minHeight: '80px', maxHeight: '80px' } : {}}
|
|
1037
1051
|
/>
|
|
1038
1052
|
</div>
|
|
1039
1053
|
)}
|