@messenger-box/tailwind-ui-inbox 10.0.3-alpha.108 → 10.0.3-alpha.110
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.map +1 -1
- package/lib/components/AIAgent/AIAgent.js +39 -224
- package/lib/components/AIAgent/AIAgent.js.map +1 -1
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.d.ts +2 -0
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.d.ts.map +1 -1
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.js +32 -60
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.js.map +1 -1
- package/lib/components/slot-fill/chat-message-filler.js +1 -1
- package/lib/components/slot-fill/chat-message-filler.js.map +1 -1
- package/lib/compute.d.ts.map +1 -1
- package/lib/compute.js +18 -8
- package/lib/compute.js.map +1 -1
- package/lib/container/AiLandingInput.d.ts.map +1 -1
- package/lib/container/AiLandingInput.js +8 -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.map +1 -1
- package/lib/container/InboxAiMessagesLoader.js +5 -2
- package/lib/container/InboxAiMessagesLoader.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/index.js +1 -1
- package/lib/routes.json +22 -9
- package/lib/templates/InboxWithAi.d.ts.map +1 -1
- package/lib/templates/InboxWithAi.js +0 -1
- package/lib/templates/InboxWithAi.js.map +1 -1
- package/lib/templates/InboxWithAi.tsx +0 -1
- package/package.json +4 -4
- package/src/components/AIAgent/AIAgent.tsx +39 -229
- package/src/components/InboxMessage/message-widgets/ModernMessageGroup.tsx +44 -16
- package/src/compute.ts +20 -10
- package/src/container/AiLandingInput.tsx +12 -8
- package/src/container/InboxAiMessagesLoader.tsx +2 -1
- package/src/templates/InboxWithAi.tsx +0 -1
package/src/compute.ts
CHANGED
|
@@ -63,27 +63,37 @@ export const messengerPageStore: IRouteModule[] | { [key: string]: any } = [
|
|
|
63
63
|
name: 'AiMessenger',
|
|
64
64
|
path: '/ai-messenger',
|
|
65
65
|
},
|
|
66
|
-
|
|
67
66
|
{
|
|
68
67
|
exact: false,
|
|
69
68
|
icon: 'AiOutlineInbox',
|
|
70
|
-
key: 'ai-messenger-with-
|
|
69
|
+
key: 'ai-messenger-with-org-name',
|
|
70
|
+
component: () => import('./container/InboxWithAiLoader'),
|
|
71
|
+
tab: 'Ai Messenger',
|
|
72
|
+
position: IMenuPosition.Middle,
|
|
73
|
+
name: 'AiMessengerWithOrgName',
|
|
74
|
+
path: '//o/:orgName/ai-messenger',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
exact: false,
|
|
78
|
+
icon: 'AiOutlineInbox',
|
|
79
|
+
key: 'ai-messenger-app-with-channel-id',
|
|
71
80
|
component: () => import('./container/InboxAiMessagesLoader'),
|
|
72
81
|
tab: 'Ai Messenger',
|
|
73
82
|
position: IMenuPosition.Middle,
|
|
74
|
-
name: '
|
|
75
|
-
path: '/ai-messenger/app',
|
|
83
|
+
name: 'AiMessengerAppWithChannelId',
|
|
84
|
+
path: '/ai-messenger/app/:id',
|
|
76
85
|
},
|
|
77
86
|
{
|
|
78
87
|
exact: false,
|
|
79
88
|
icon: 'AiOutlineInbox',
|
|
80
|
-
key: 'ai-messenger-with-org-
|
|
81
|
-
component: () => import('./container/
|
|
89
|
+
key: 'ai-messenger-app-with-org-and-channel-id',
|
|
90
|
+
component: () => import('./container/InboxAiMessagesLoader'),
|
|
82
91
|
tab: 'Ai Messenger',
|
|
83
92
|
position: IMenuPosition.Middle,
|
|
84
|
-
name: '
|
|
85
|
-
path: '//o/:orgName/ai-messenger',
|
|
93
|
+
name: 'AiMessengerAppWithOrgAndChannelId',
|
|
94
|
+
path: '//o/:orgName/ai-messenger/app/:id',
|
|
86
95
|
},
|
|
96
|
+
|
|
87
97
|
// {
|
|
88
98
|
// exact: false,
|
|
89
99
|
// icon: 'AiOutlineInbox',
|
|
@@ -124,8 +134,8 @@ const selectedRoutes = [
|
|
|
124
134
|
'direct-message',
|
|
125
135
|
'ai-messenger',
|
|
126
136
|
'ai-messenger-with-org-name',
|
|
127
|
-
'ai-messenger-with-channel-id',
|
|
128
|
-
'ai-messenger-with-
|
|
137
|
+
'ai-messenger-app-with-channel-id',
|
|
138
|
+
'ai-messenger-app-with-org-and-channel-id',
|
|
129
139
|
'ai-messenger-with-preview',
|
|
130
140
|
];
|
|
131
141
|
|
|
@@ -74,7 +74,7 @@ const AiLandingInput: React.FC = () => {
|
|
|
74
74
|
console.log('Message sent without channel:', message, files);
|
|
75
75
|
setIsCreatingChannel(true);
|
|
76
76
|
const id = objectId();
|
|
77
|
-
const postId = objectId();
|
|
77
|
+
// const postId = objectId();
|
|
78
78
|
const channelId = objectId();
|
|
79
79
|
// Do not include extensionId inside modelConfig when sending additionalProperties
|
|
80
80
|
const { extensionId: _omitExtensionId, ...modelConfigWithoutExtensionId } =
|
|
@@ -90,16 +90,16 @@ const AiLandingInput: React.FC = () => {
|
|
|
90
90
|
projectId: id,
|
|
91
91
|
type: RoomType.Aiassistant,
|
|
92
92
|
postData: {
|
|
93
|
-
postId: postId,
|
|
93
|
+
// postId: postId,
|
|
94
94
|
type: PostTypeEnum.Aiassistant,
|
|
95
95
|
content: message,
|
|
96
96
|
props: {
|
|
97
|
-
generateAiCode: true,
|
|
97
|
+
// generateAiCode: true,
|
|
98
98
|
template: modelConfig?.template || 'vite-react',
|
|
99
99
|
projectId: id,
|
|
100
100
|
role: AiAgentMessageRole.User,
|
|
101
101
|
fragment: {},
|
|
102
|
-
sendNotificationWithProjectId: true,
|
|
102
|
+
// sendNotificationWithProjectId: true,
|
|
103
103
|
},
|
|
104
104
|
},
|
|
105
105
|
additionalProperties: {
|
|
@@ -121,12 +121,16 @@ const AiLandingInput: React.FC = () => {
|
|
|
121
121
|
setIsCreatingChannel(false);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
const
|
|
124
|
+
|
|
125
|
+
const basePath = orgName
|
|
126
126
|
? config.AI_MESSENGER_PATH.replace(':orgName', orgName)
|
|
127
127
|
: config.AI_MESSENGER_PATH;
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
|
|
129
|
+
const targetPath = basePath.includes(':id')
|
|
130
|
+
? basePath.replace(':id', channelId)
|
|
131
|
+
: `${basePath.replace(/\/+$/, '')}/${channelId}`;
|
|
132
|
+
|
|
133
|
+
navigate(targetPath, { replace: true });
|
|
130
134
|
setIsCreatingChannel(false);
|
|
131
135
|
},
|
|
132
136
|
onError: (error: any) => {
|
|
@@ -18,7 +18,8 @@ const InboxWithAiLoaderOutlet = (props: InboxWithAiLoaderOutletProps) => {
|
|
|
18
18
|
const location = useLocation();
|
|
19
19
|
const { messages, setMessages, selectedPost, setSelectedPost, setIsLoading, isLoading } = useOutletContext() as any;
|
|
20
20
|
const urlParams = location?.search ? new URLSearchParams(location.search) : null;
|
|
21
|
-
const
|
|
21
|
+
const { id: pathChannelId } = useParams();
|
|
22
|
+
const channelId = urlParams?.get('id') || pathChannelId;
|
|
22
23
|
const user: any = useSelector<Store.Auth, IUserState>(userSelector, shallowEqual);
|
|
23
24
|
|
|
24
25
|
return (
|