@messenger-box/tailwind-ui-inbox 10.0.3-alpha.0
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 +16 -0
- package/LICENSE +21 -0
- package/jest.config.js +9 -0
- package/lib/cdm-locales/en/translations.json +31 -0
- package/lib/cdm-locales/es/translations.json +31 -0
- package/lib/components/AIAgent/AIAgent.d.ts +32 -0
- package/lib/components/AIAgent/AIAgent.d.ts.map +1 -0
- package/lib/components/AIAgent/AIAgent.js +1135 -0
- package/lib/components/AIAgent/AIAgent.js.map +1 -0
- package/lib/components/AIAgent/InputComponent.d.ts +84 -0
- package/lib/components/AIAgent/InputComponent.d.ts.map +1 -0
- package/lib/components/AIAgent/InputComponent.js +417 -0
- package/lib/components/AIAgent/InputComponent.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/CommonMessage.d.ts +8 -0
- package/lib/components/InboxMessage/CommonMessage.d.ts.map +1 -0
- package/lib/components/InboxMessage/CommonMessage.js +35 -0
- package/lib/components/InboxMessage/CommonMessage.js.map +1 -0
- package/lib/components/InboxMessage/ConversationItem.d.ts +14 -0
- package/lib/components/InboxMessage/ConversationItem.d.ts.map +1 -0
- package/lib/components/InboxMessage/ConversationItem.js +200 -0
- package/lib/components/InboxMessage/ConversationItem.js.map +1 -0
- package/lib/components/InboxMessage/InputComponent.d.ts +20 -0
- package/lib/components/InboxMessage/InputComponent.d.ts.map +1 -0
- package/lib/components/InboxMessage/InputComponent.js +148 -0
- package/lib/components/InboxMessage/InputComponent.js.map +1 -0
- package/lib/components/InboxMessage/LeftSidebar.d.ts +20 -0
- package/lib/components/InboxMessage/LeftSidebar.d.ts.map +1 -0
- package/lib/components/InboxMessage/LeftSidebar.js +102 -0
- package/lib/components/InboxMessage/LeftSidebar.js.map +1 -0
- package/lib/components/InboxMessage/MessageInput.d.ts +9 -0
- package/lib/components/InboxMessage/MessageInput.d.ts.map +1 -0
- package/lib/components/InboxMessage/MessageInput.js +154 -0
- package/lib/components/InboxMessage/MessageInput.js.map +1 -0
- 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 +17 -0
- package/lib/components/InboxMessage/Messages.d.ts.map +1 -0
- package/lib/components/InboxMessage/Messages.js +99 -0
- package/lib/components/InboxMessage/Messages.js.map +1 -0
- package/lib/components/InboxMessage/MessagesBuilderUi.d.ts +17 -0
- package/lib/components/InboxMessage/MessagesBuilderUi.d.ts.map +1 -0
- package/lib/components/InboxMessage/Popover.d.ts +3 -0
- package/lib/components/InboxMessage/Popover.d.ts.map +1 -0
- package/lib/components/InboxMessage/Popover.js +31 -0
- package/lib/components/InboxMessage/Popover.js.map +1 -0
- package/lib/components/InboxMessage/RightSidebar.d.ts +9 -0
- package/lib/components/InboxMessage/RightSidebar.d.ts.map +1 -0
- package/lib/components/InboxMessage/RightSidebar.js +9 -0
- package/lib/components/InboxMessage/RightSidebar.js.map +1 -0
- package/lib/components/InboxMessage/RightSidebarAi.d.ts +37 -0
- package/lib/components/InboxMessage/RightSidebarAi.d.ts.map +1 -0
- package/lib/components/InboxMessage/RightSidebarAi.js +9 -0
- package/lib/components/InboxMessage/RightSidebarAi.js.map +1 -0
- package/lib/components/InboxMessage/ServiceConversationItem.d.ts +12 -0
- package/lib/components/InboxMessage/ServiceConversationItem.d.ts.map +1 -0
- package/lib/components/InboxMessage/ServiceConversationItem.js +185 -0
- package/lib/components/InboxMessage/ServiceConversationItem.js.map +1 -0
- package/lib/components/InboxMessage/ServiceInboxItem.d.ts +12 -0
- package/lib/components/InboxMessage/ServiceInboxItem.d.ts.map +1 -0
- package/lib/components/InboxMessage/ServiceInboxItem.js +182 -0
- package/lib/components/InboxMessage/ServiceInboxItem.js.map +1 -0
- package/lib/components/InboxMessage/StreamingMessageBubble.d.ts +18 -0
- package/lib/components/InboxMessage/StreamingMessageBubble.d.ts.map +1 -0
- package/lib/components/InboxMessage/SubscriptionHandler.d.ts +19 -0
- package/lib/components/InboxMessage/SubscriptionHandler.d.ts.map +1 -0
- package/lib/components/InboxMessage/SubscriptionHandler.js +41 -0
- package/lib/components/InboxMessage/SubscriptionHandler.js.map +1 -0
- package/lib/components/InboxMessage/TypingIndicator.d.ts +11 -0
- package/lib/components/InboxMessage/TypingIndicator.d.ts.map +1 -0
- package/lib/components/InboxMessage/UploadImageButton.d.ts +7 -0
- package/lib/components/InboxMessage/UploadImageButton.d.ts.map +1 -0
- package/lib/components/InboxMessage/UploadImageButton.js +30 -0
- package/lib/components/InboxMessage/UploadImageButton.js.map +1 -0
- package/lib/components/InboxMessage/UserModalContent.d.ts +3 -0
- package/lib/components/InboxMessage/UserModalContent.d.ts.map +1 -0
- package/lib/components/InboxMessage/UserModalContent.js +60 -0
- package/lib/components/InboxMessage/UserModalContent.js.map +1 -0
- package/lib/components/InboxMessage/index.d.ts +19 -0
- package/lib/components/InboxMessage/index.d.ts.map +1 -0
- package/lib/components/InboxMessage/message-widgets/CommonMessage.d.ts +11 -0
- package/lib/components/InboxMessage/message-widgets/CommonMessage.d.ts.map +1 -0
- package/lib/components/InboxMessage/message-widgets/CommonMessage.js +44 -0
- package/lib/components/InboxMessage/message-widgets/CommonMessage.js.map +1 -0
- package/lib/components/InboxMessage/message-widgets/ErrorFixCard.d.ts +10 -0
- package/lib/components/InboxMessage/message-widgets/ErrorFixCard.d.ts.map +1 -0
- package/lib/components/InboxMessage/message-widgets/ErrorFixCard.js +194 -0
- package/lib/components/InboxMessage/message-widgets/ErrorFixCard.js.map +1 -0
- package/lib/components/InboxMessage/message-widgets/MessageCard.d.ts +8 -0
- package/lib/components/InboxMessage/message-widgets/MessageCard.d.ts.map +1 -0
- package/lib/components/InboxMessage/message-widgets/MessageSliceRenderer.d.ts +12 -0
- package/lib/components/InboxMessage/message-widgets/MessageSliceRenderer.d.ts.map +1 -0
- package/lib/components/InboxMessage/message-widgets/MessageSliceRenderer.js +37 -0
- package/lib/components/InboxMessage/message-widgets/MessageSliceRenderer.js.map +1 -0
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.d.ts +42 -0
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.d.ts.map +1 -0
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.js +1339 -0
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.js.map +1 -0
- package/lib/components/InboxMessage/message-widgets/PlainMessage.d.ts +8 -0
- package/lib/components/InboxMessage/message-widgets/PlainMessage.d.ts.map +1 -0
- package/lib/components/InboxMessage/message-widgets/PlainMessage.js +14 -0
- package/lib/components/InboxMessage/message-widgets/PlainMessage.js.map +1 -0
- package/lib/components/InboxMessage/message-widgets/PropertyMessageWidget.d.ts +9 -0
- package/lib/components/InboxMessage/message-widgets/PropertyMessageWidget.d.ts.map +1 -0
- package/lib/components/InboxMessage/message-widgets/SlackLikeMessageGroup.d.ts +14 -0
- package/lib/components/InboxMessage/message-widgets/SlackLikeMessageGroup.d.ts.map +1 -0
- package/lib/components/InboxMessage/message-widgets/SlackLikeMessageGroup.js +333 -0
- package/lib/components/InboxMessage/message-widgets/SlackLikeMessageGroup.js.map +1 -0
- package/lib/components/InboxMessage/message-widgets/index.d.ts +4 -0
- package/lib/components/InboxMessage/message-widgets/index.d.ts.map +1 -0
- package/lib/components/ModelConfigPanel.d.ts +74 -0
- package/lib/components/ModelConfigPanel.d.ts.map +1 -0
- package/lib/components/ModelConfigPanel.js +1152 -0
- package/lib/components/ModelConfigPanel.js.map +1 -0
- package/lib/components/filler-components/RightSiderBar.d.ts +3 -0
- package/lib/components/filler-components/RightSiderBar.d.ts.map +1 -0
- package/lib/components/filler-components/RightSiderBar.js +532 -0
- package/lib/components/filler-components/RightSiderBar.js.map +1 -0
- package/lib/components/inbox/FilesList.d.ts +20 -0
- package/lib/components/inbox/FilesList.d.ts.map +1 -0
- package/lib/components/inbox/FilesList.js +68 -0
- package/lib/components/inbox/FilesList.js.map +1 -0
- package/lib/components/inbox/MessageItem.d.ts +17 -0
- package/lib/components/inbox/MessageItem.d.ts.map +1 -0
- package/lib/components/inbox/MessageItem.js +50 -0
- package/lib/components/inbox/MessageItem.js.map +1 -0
- package/lib/components/inbox/ThreadItem.d.ts +11 -0
- package/lib/components/inbox/ThreadItem.d.ts.map +1 -0
- package/lib/components/inbox/ThreadItem.js +147 -0
- package/lib/components/inbox/ThreadItem.js.map +1 -0
- package/lib/components/inbox/index.d.ts +4 -0
- package/lib/components/inbox/index.d.ts.map +1 -0
- package/lib/components/index.d.ts +10 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/live-code-editor/hybrid-live-editor.d.ts +20 -0
- package/lib/components/live-code-editor/hybrid-live-editor.d.ts.map +1 -0
- package/lib/components/live-code-editor/index.d.ts +4 -0
- package/lib/components/live-code-editor/index.d.ts.map +1 -0
- package/lib/components/live-code-editor/live-code-editor.d.ts +14 -0
- package/lib/components/live-code-editor/live-code-editor.d.ts.map +1 -0
- package/lib/components/messages-container-ui/MessagesContainerUI.d.ts +81 -0
- package/lib/components/messages-container-ui/MessagesContainerUI.d.ts.map +1 -0
- package/lib/components/messages-container-ui/MessagesContainerUI.js +77 -0
- package/lib/components/messages-container-ui/MessagesContainerUI.js.map +1 -0
- package/lib/components/messages-container-ui/PlanModeView.d.ts +82 -0
- package/lib/components/messages-container-ui/PlanModeView.d.ts.map +1 -0
- package/lib/components/messages-container-ui/PlanModeView.js +267 -0
- package/lib/components/messages-container-ui/PlanModeView.js.map +1 -0
- package/lib/components/messages-container-ui/index.d.ts +6 -0
- package/lib/components/messages-container-ui/index.d.ts.map +1 -0
- package/lib/components/messages-container-ui/types.d.ts +38 -0
- package/lib/components/messages-container-ui/types.d.ts.map +1 -0
- package/lib/components/slot-fill/chat-message-filler.d.ts +4 -0
- package/lib/components/slot-fill/chat-message-filler.d.ts.map +1 -0
- package/lib/components/slot-fill/chat-message-filler.js +5 -0
- package/lib/components/slot-fill/chat-message-filler.js.map +1 -0
- package/lib/components/slot-fill/chat-message-slot.d.ts +11 -0
- package/lib/components/slot-fill/chat-message-slot.d.ts.map +1 -0
- package/lib/components/slot-fill/chat-message-slot.js +6 -0
- package/lib/components/slot-fill/chat-message-slot.js.map +1 -0
- package/lib/components/slot-fill/index.d.ts +4 -0
- package/lib/components/slot-fill/index.d.ts.map +1 -0
- package/lib/components/slot-fill/right-sidebar-filler.d.ts +4 -0
- package/lib/components/slot-fill/right-sidebar-filler.d.ts.map +1 -0
- package/lib/components/slot-fill/right-sidebar-filler.js +13 -0
- package/lib/components/slot-fill/right-sidebar-filler.js.map +1 -0
- package/lib/components/ui/button.d.ts +9 -0
- package/lib/components/ui/button.d.ts.map +1 -0
- package/lib/compute.d.ts +8 -0
- package/lib/compute.d.ts.map +1 -0
- package/lib/compute.js +264 -0
- package/lib/compute.js.map +1 -0
- package/lib/config/env-config.d.ts +20 -0
- package/lib/config/env-config.d.ts.map +1 -0
- package/lib/config/env-config.js +55 -0
- package/lib/config/env-config.js.map +1 -0
- package/lib/config/index.d.ts +2 -0
- package/lib/config/index.d.ts.map +1 -0
- package/lib/constants/breakpoints.d.ts +8 -0
- package/lib/constants/breakpoints.d.ts.map +1 -0
- package/lib/constants/index.d.ts +3 -0
- package/lib/constants/index.d.ts.map +1 -0
- 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 +27 -0
- package/lib/container/AiLandingInput.d.ts.map +1 -0
- package/lib/container/AiLandingInput.js +149 -0
- package/lib/container/AiLandingInput.js.map +1 -0
- package/lib/container/Inbox.d.ts +15 -0
- package/lib/container/Inbox.d.ts.map +1 -0
- package/lib/container/Inbox.js +964 -0
- package/lib/container/Inbox.js.map +1 -0
- package/lib/container/InboxAiMessagesLoader.d.ts +45 -0
- package/lib/container/InboxAiMessagesLoader.d.ts.map +1 -0
- package/lib/container/InboxAiMessagesLoader.js +80 -0
- package/lib/container/InboxAiMessagesLoader.js.map +1 -0
- package/lib/container/InboxContainer.d.ts +41 -0
- package/lib/container/InboxContainer.d.ts.map +1 -0
- package/lib/container/InboxContainer.js +27 -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 +47 -0
- package/lib/container/InboxWithAiLoader.d.ts.map +1 -0
- package/lib/container/InboxWithAiLoader.js +118 -0
- package/lib/container/InboxWithAiLoader.js.map +1 -0
- package/lib/container/InboxWithLoader.d.ts +36 -0
- package/lib/container/InboxWithLoader.d.ts.map +1 -0
- package/lib/container/InboxWithLoader.js +277 -0
- package/lib/container/InboxWithLoader.js.map +1 -0
- package/lib/container/ServiceInbox.d.ts +9 -0
- package/lib/container/ServiceInbox.d.ts.map +1 -0
- package/lib/container/ServiceInbox.js +141 -0
- package/lib/container/ServiceInbox.js.map +1 -0
- package/lib/container/TestInboxWithAiLoader.d.ts +7 -0
- package/lib/container/TestInboxWithAiLoader.d.ts.map +1 -0
- package/lib/container/TestInboxWithAiLoader.js +135 -0
- package/lib/container/TestInboxWithAiLoader.js.map +1 -0
- package/lib/container/ThreadMessages.d.ts +13 -0
- package/lib/container/ThreadMessages.d.ts.map +1 -0
- package/lib/container/ThreadMessages.js +320 -0
- package/lib/container/ThreadMessages.js.map +1 -0
- package/lib/container/ThreadMessagesInbox.d.ts +14 -0
- package/lib/container/ThreadMessagesInbox.d.ts.map +1 -0
- package/lib/container/ThreadMessagesInbox.js +347 -0
- package/lib/container/ThreadMessagesInbox.js.map +1 -0
- package/lib/container/Threads.d.ts +8 -0
- package/lib/container/Threads.d.ts.map +1 -0
- package/lib/container/Threads.js +231 -0
- package/lib/container/Threads.js.map +1 -0
- package/lib/container/ThreadsInbox.d.ts +21 -0
- package/lib/container/ThreadsInbox.d.ts.map +1 -0
- package/lib/container/ThreadsInbox.js +243 -0
- package/lib/container/ThreadsInbox.js.map +1 -0
- package/lib/container/apply-footer-styles.d.ts +2 -0
- package/lib/container/apply-footer-styles.d.ts.map +1 -0
- package/lib/container/apply-footer-styles.js +16 -0
- package/lib/container/apply-footer-styles.js.map +1 -0
- package/lib/container/index.d.ts +13 -0
- package/lib/container/index.d.ts.map +1 -0
- package/lib/enums/index.d.ts +2 -0
- package/lib/enums/index.d.ts.map +1 -0
- package/lib/enums/messenger-slot-fill-name-enum.d.ts +11 -0
- package/lib/enums/messenger-slot-fill-name-enum.d.ts.map +1 -0
- package/lib/enums/messenger-slot-fill-name-enum.js +11 -0
- package/lib/enums/messenger-slot-fill-name-enum.js.map +1 -0
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/usePersistentModelConfig.d.ts +33 -0
- package/lib/hooks/usePersistentModelConfig.d.ts.map +1 -0
- package/lib/hooks/usePersistentModelConfig.js +123 -0
- package/lib/hooks/usePersistentModelConfig.js.map +1 -0
- package/lib/hooks/useStreamAssembler.d.ts +8 -0
- package/lib/hooks/useStreamAssembler.d.ts.map +1 -0
- package/lib/hooks/useTemplates.d.ts +14 -0
- package/lib/hooks/useTemplates.d.ts.map +1 -0
- package/lib/hooks/useTemplates.js +59 -0
- package/lib/hooks/useTemplates.js.map +1 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -0
- package/lib/interfaces/index.d.ts +2 -0
- package/lib/interfaces/index.d.ts.map +1 -0
- package/lib/interfaces/message-widgets.interface.d.ts +21 -0
- package/lib/interfaces/message-widgets.interface.d.ts.map +1 -0
- package/lib/machines/aiAgentMachine.d.ts +3 -0
- package/lib/machines/aiAgentMachine.d.ts.map +1 -0
- package/lib/machines/aiAgentMachine.js +1083 -0
- package/lib/machines/aiAgentMachine.js.map +1 -0
- package/lib/machines/aiAgentMachine.simple.d.ts +3 -0
- package/lib/machines/aiAgentMachine.simple.d.ts.map +1 -0
- package/lib/machines/aiAgentMachine.simple.js +108 -0
- package/lib/machines/aiAgentMachine.simple.js.map +1 -0
- package/lib/machines/index.d.ts +3 -0
- package/lib/machines/index.d.ts.map +1 -0
- package/lib/machines/types.d.ts +77 -0
- package/lib/machines/types.d.ts.map +1 -0
- package/lib/module.d.ts +7 -0
- package/lib/module.d.ts.map +1 -0
- package/lib/module.js +26 -0
- package/lib/module.js.map +1 -0
- package/lib/routes.json +251 -0
- package/lib/styles/responsive.css +76 -0
- package/lib/templates/InboxWithAi.d.ts +44 -0
- package/lib/templates/InboxWithAi.d.ts.map +1 -0
- package/lib/templates/InboxWithAi.js +651 -0
- package/lib/templates/InboxWithAi.js.map +1 -0
- package/lib/templates/InboxWithAi.tsx +844 -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/lib/types/templates.d.ts +35 -0
- package/lib/types/templates.d.ts.map +1 -0
- package/lib/utils/utils.d.ts +2 -0
- package/lib/utils/utils.d.ts.map +1 -0
- 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.types.d.ts +57 -0
- package/lib/xstate/rightSidebar.types.d.ts.map +1 -0
- package/package.json +69 -0
- package/rollup.config.mjs +47 -0
- package/src/cdm-locales/en/translations.json +31 -0
- package/src/cdm-locales/es/translations.json +31 -0
- package/src/components/AIAgent/AIAgent.tsx +1468 -0
- package/src/components/AIAgent/AIAgent.tsx.bk +1365 -0
- package/src/components/AIAgent/InputComponent.tsx +608 -0
- package/src/components/AIAgent/README.md +174 -0
- package/src/components/AIAgent/index.ts +1 -0
- package/src/components/InboxMessage/CommonMessage.tsx +40 -0
- package/src/components/InboxMessage/ConversationItem.tsx +255 -0
- package/src/components/InboxMessage/InputComponent.tsx +198 -0
- package/src/components/InboxMessage/LeftSidebar.tsx +140 -0
- package/src/components/InboxMessage/MessageInput.tsx +209 -0
- package/src/components/InboxMessage/MessageInputComponent.tsx +245 -0
- package/src/components/InboxMessage/Messages.tsx +137 -0
- package/src/components/InboxMessage/MessagesBuilderUi.tsx +205 -0
- package/src/components/InboxMessage/Popover.tsx +42 -0
- package/src/components/InboxMessage/RightSidebar.tsx +22 -0
- package/src/components/InboxMessage/RightSidebarAi.tsx +47 -0
- package/src/components/InboxMessage/ServiceConversationItem.tsx +234 -0
- package/src/components/InboxMessage/ServiceInboxItem.tsx +223 -0
- package/src/components/InboxMessage/StreamingMessageBubble.tsx +270 -0
- package/src/components/InboxMessage/SubscriptionHandler.tsx +55 -0
- package/src/components/InboxMessage/TypingIndicator.tsx +38 -0
- package/src/components/InboxMessage/UploadImageButton.tsx +46 -0
- package/src/components/InboxMessage/UserModalContent.tsx +60 -0
- package/src/components/InboxMessage/index.ts +18 -0
- package/src/components/InboxMessage/message-widgets/CommonMessage.tsx +69 -0
- package/src/components/InboxMessage/message-widgets/ErrorFixCard.tsx +239 -0
- package/src/components/InboxMessage/message-widgets/MessageCard.tsx +127 -0
- package/src/components/InboxMessage/message-widgets/MessageSliceRenderer.tsx +40 -0
- package/src/components/InboxMessage/message-widgets/ModernMessageGroup.tsx +1733 -0
- package/src/components/InboxMessage/message-widgets/PlainMessage.tsx +18 -0
- package/src/components/InboxMessage/message-widgets/PropertyMessageWidget.tsx +29 -0
- package/src/components/InboxMessage/message-widgets/SlackLikeMessageGroup.tsx +492 -0
- package/src/components/InboxMessage/message-widgets/index.ts +8 -0
- package/src/components/ModelConfigPanel.tsx +1357 -0
- package/src/components/filler-components/RightSiderBar.tsx +572 -0
- package/src/components/inbox/FilesList.tsx +89 -0
- package/src/components/inbox/MessageItem.tsx +50 -0
- package/src/components/inbox/ThreadItem.tsx +295 -0
- package/src/components/inbox/index.ts +3 -0
- package/src/components/index.ts +29 -0
- package/src/components/live-code-editor/hybrid-live-editor.tsx +105 -0
- package/src/components/live-code-editor/index.ts +3 -0
- package/src/components/live-code-editor/live-code-editor.tsx +257 -0
- package/src/components/messages-container-ui/MessagesContainerUI.tsx +151 -0
- package/src/components/messages-container-ui/PlanModeView.tsx +426 -0
- package/src/components/messages-container-ui/README.md +91 -0
- package/src/components/messages-container-ui/index.ts +5 -0
- package/src/components/messages-container-ui/types.ts +40 -0
- package/src/components/slot-fill/chat-message-filler.tsx +18 -0
- package/src/components/slot-fill/chat-message-slot.tsx +18 -0
- package/src/components/slot-fill/index.ts +3 -0
- package/src/components/slot-fill/right-sidebar-filler.tsx +48 -0
- package/src/components/ui/button.tsx +32 -0
- package/src/compute.ts +271 -0
- package/src/config/env-config.ts +24 -0
- package/src/config/index.ts +1 -0
- package/src/constants/breakpoints.ts +7 -0
- package/src/constants/index.ts +5 -0
- package/src/container/AiInbox.tsx +1879 -0
- package/src/container/AiInboxWithLoader.tsx +356 -0
- package/src/container/AiLandingInput.tsx +200 -0
- package/src/container/Inbox.tsx +1095 -0
- package/src/container/InboxAiMessagesLoader.tsx +129 -0
- package/src/container/InboxContainer.tsx +61 -0
- package/src/container/InboxTemplate1.tsx +1553 -0
- package/src/container/InboxTemplate1WithLoader.tsx +338 -0
- package/src/container/InboxTemplate2.tsx +1617 -0
- package/src/container/InboxWithAiLoader.tsx +177 -0
- package/src/container/InboxWithLoader.tsx +341 -0
- package/src/container/ServiceInbox.tsx +188 -0
- package/src/container/TestInboxWithAiLoader.tsx +147 -0
- package/src/container/ThreadMessages.tsx +378 -0
- package/src/container/ThreadMessagesInbox.tsx +457 -0
- package/src/container/Threads.tsx +270 -0
- package/src/container/ThreadsInbox.tsx +351 -0
- package/src/container/apply-footer-styles.ts +17 -0
- package/src/container/index.ts +31 -0
- package/src/enums/index.ts +1 -0
- package/src/enums/messenger-slot-fill-name-enum.ts +10 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/usePersistentModelConfig.ts +166 -0
- package/src/hooks/useStreamAssembler.ts +7 -0
- package/src/hooks/useTemplates.ts +75 -0
- package/src/index.ts +49 -0
- package/src/interfaces/index.ts +1 -0
- package/src/interfaces/message-widgets.interface.ts +21 -0
- package/src/machines/aiAgentMachine.simple.ts +89 -0
- package/src/machines/aiAgentMachine.ts +1296 -0
- package/src/machines/aiAgentMachine.ts.bk +1296 -0
- package/src/machines/index.ts +2 -0
- package/src/machines/types.ts +59 -0
- package/src/module.tsx +32 -0
- package/src/styles/responsive.css +76 -0
- package/src/templates/InboxWithAi.tsx +844 -0
- package/src/templates/index.ts +1 -0
- package/src/types/templates.ts +35 -0
- package/src/utils/utils.ts +3 -0
- package/src/xstate/index.ts +2 -0
- package/src/xstate/rightSidebar.machine.ts +304 -0
- package/src/xstate/rightSidebar.types.ts +58 -0
- package/tsconfig.json +14 -0
- package/webpack.config.js +92 -0
|
@@ -0,0 +1,844 @@
|
|
|
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
|
+
import { Slot } from '@common-stack/components-pro';
|
|
14
|
+
import { RightSidebarAi } from '../components/InboxMessage/RightSidebarAi';
|
|
15
|
+
import { usePersistentModelConfig } from '../hooks/usePersistentModelConfig';
|
|
16
|
+
import { ICreateChannelInput } from 'common';
|
|
17
|
+
import { MessengerSlotFillNameEnum } from '../enums';
|
|
18
|
+
|
|
19
|
+
// Context for sharing tab state between header and sidebar
|
|
20
|
+
const TabContext = createContext<{
|
|
21
|
+
activeTab: string;
|
|
22
|
+
setActiveTab: (tab: string) => void;
|
|
23
|
+
}>({
|
|
24
|
+
activeTab: 'preview',
|
|
25
|
+
setActiveTab: () => {},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export interface InboxProps {
|
|
29
|
+
channelFilters?: Record<string, unknown>;
|
|
30
|
+
channelRole?: string;
|
|
31
|
+
supportServices?: boolean;
|
|
32
|
+
pathPrefix?: string;
|
|
33
|
+
data?: any;
|
|
34
|
+
orgName?: string;
|
|
35
|
+
projectId?: string;
|
|
36
|
+
handleRecreateSandbox?: (messageId: string) => void | Promise<any>;
|
|
37
|
+
isShowOnlyInbox?: boolean;
|
|
38
|
+
inboxTitle?: string;
|
|
39
|
+
showModeSelector?: boolean;
|
|
40
|
+
showContextTab?: boolean;
|
|
41
|
+
showStopButton?: boolean;
|
|
42
|
+
onStop?: () => void;
|
|
43
|
+
ContextTabComponent?: React.ComponentType<{ context: any; selectedPost?: any }>;
|
|
44
|
+
templates?: any[];
|
|
45
|
+
selectedTemplate?: any;
|
|
46
|
+
suggestedTemplate?: any;
|
|
47
|
+
onSelectTemplate?: (template: any) => void;
|
|
48
|
+
templateSelectedLabel?: string | null;
|
|
49
|
+
templateModalItems?: any[];
|
|
50
|
+
showTemplateModal?: boolean;
|
|
51
|
+
onOpenTemplateModal?: () => void;
|
|
52
|
+
onCloseTemplateModal?: () => void;
|
|
53
|
+
onSelectTemplateById?: (id: string) => void;
|
|
54
|
+
onClearTemplate?: () => void;
|
|
55
|
+
onAcceptSuggestedTemplate?: () => void;
|
|
56
|
+
isAnalyzingQuery?: boolean;
|
|
57
|
+
onQueryChange?: (query: string) => void;
|
|
58
|
+
leftItemsOverrides?: any;
|
|
59
|
+
rightItemsOverrides?: any;
|
|
60
|
+
inputToolBarProps?: any;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Static utility hooks and components
|
|
64
|
+
const useMediaQuery = (query: string) => {
|
|
65
|
+
const [matches, setMatches] = React.useState(false);
|
|
66
|
+
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (typeof window === 'undefined') return;
|
|
69
|
+
|
|
70
|
+
const mediaQuery = window.matchMedia(query);
|
|
71
|
+
const updateMatches = () => setMatches(mediaQuery.matches);
|
|
72
|
+
|
|
73
|
+
updateMatches();
|
|
74
|
+
mediaQuery.addEventListener('change', updateMatches);
|
|
75
|
+
return () => mediaQuery.removeEventListener('change', updateMatches);
|
|
76
|
+
}, [query]);
|
|
77
|
+
|
|
78
|
+
return matches;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// Hook to get window dimensions
|
|
82
|
+
const useWindowDimensions = () => {
|
|
83
|
+
const [windowDimensions, setWindowDimensions] = React.useState({
|
|
84
|
+
width: typeof window !== 'undefined' ? window.innerWidth : 1024,
|
|
85
|
+
height: typeof window !== 'undefined' ? window.innerHeight : 768,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (typeof window === 'undefined') return;
|
|
90
|
+
|
|
91
|
+
const handleResize = () => {
|
|
92
|
+
setWindowDimensions({
|
|
93
|
+
width: window.innerWidth,
|
|
94
|
+
height: window.innerHeight,
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
window.addEventListener('resize', handleResize);
|
|
99
|
+
handleResize(); // Set initial dimensions
|
|
100
|
+
|
|
101
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
102
|
+
}, []);
|
|
103
|
+
|
|
104
|
+
return windowDimensions;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const EmptyState = React.memo(() => (
|
|
108
|
+
<div className="h-full flex items-center justify-center bg-gray-100 p-4 sm:p-6 overflow-hidden">
|
|
109
|
+
<div className="text-center max-w-sm mx-auto">
|
|
110
|
+
<div className="text-3xl sm:text-4xl text-gray-400 mb-4">💬</div>
|
|
111
|
+
<h3 className="text-lg sm:text-xl font-semibold text-gray-600 mb-2">Welcome to Messenger</h3>
|
|
112
|
+
<p className="text-sm sm:text-base text-gray-500 leading-relaxed">
|
|
113
|
+
Select a conversation from the sidebar to start messaging
|
|
114
|
+
</p>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
));
|
|
118
|
+
|
|
119
|
+
const DefaultContextTab = ({ context }: { context: any }) => {
|
|
120
|
+
const isString = typeof context === 'string';
|
|
121
|
+
const content = isString ? context : JSON.stringify(context ?? {}, null, 2);
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<div className="h-full w-full bg-gray-50 text-gray-800 overflow-auto">
|
|
125
|
+
<div className="p-4">
|
|
126
|
+
<h3 className="text-sm font-semibold text-gray-700 mb-2">Context</h3>
|
|
127
|
+
<pre className="text-sm whitespace-pre-wrap break-words font-mono bg-white border border-gray-200 rounded-md p-3 shadow-sm">
|
|
128
|
+
{content || 'No context available.'}
|
|
129
|
+
</pre>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const InboxWithAi = (props: InboxProps) => {
|
|
136
|
+
const [activeTab, setActiveTab] = React.useState('preview');
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
<TabContext.Provider value={{ activeTab, setActiveTab }}>
|
|
140
|
+
<InboxWithAiInternal {...props} />
|
|
141
|
+
</TabContext.Provider>
|
|
142
|
+
);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const InboxWithAiInternal = (props: InboxProps) => {
|
|
146
|
+
// const { channelFilters: channelFilterProp, channelRole, supportServices, data, orgName, pathPrefix = null } = props;
|
|
147
|
+
const { id: pathChannelId, postId: pathPostId } = useParams();
|
|
148
|
+
const location = useLocation();
|
|
149
|
+
const urlParams = location?.search ? new URLSearchParams(location.search) : null;
|
|
150
|
+
const { activeTab, setActiveTab } = useContext(TabContext);
|
|
151
|
+
const [messages, setMessages] = useState<any[]>([]);
|
|
152
|
+
const [selectedPost, setSelectedPost] = useState<any>(null);
|
|
153
|
+
const { modelConfig, getValidatedConfig, hasApiKey } = usePersistentModelConfig();
|
|
154
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
155
|
+
const [isCreatingSandbox, setIsCreatingSandbox] = useState(false);
|
|
156
|
+
const [errorData, setError] = useState<string | null>(null);
|
|
157
|
+
const [sendMessageInput, handleSendMessage] = useState<ICreateChannelInput | null>(null);
|
|
158
|
+
const [isMinimized, setIsMinimized] = useState(false);
|
|
159
|
+
const showContextTab = props.showContextTab ?? true;
|
|
160
|
+
const [isShowOnlyInbox, setIsShowOnlyInbox] = useState<boolean>(
|
|
161
|
+
Boolean(props?.isShowOnlyInbox || modelConfig?.mode === 'plan'),
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
const contextData = useMemo(() => {
|
|
165
|
+
const cfg = selectedPost?.propsConfiguration;
|
|
166
|
+
return cfg?.contents?.fragment?.context || cfg?.content?.fragment?.context || cfg?.fragment?.context || null;
|
|
167
|
+
}, [selectedPost]);
|
|
168
|
+
// Keep isShowOnlyInbox in sync with props and modelConfig.mode
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
setIsShowOnlyInbox(Boolean(props?.isShowOnlyInbox || modelConfig?.mode === 'plan'));
|
|
171
|
+
}, [props?.isShowOnlyInbox, modelConfig?.mode]);
|
|
172
|
+
|
|
173
|
+
// Extract channelId from query parameters (priority) or path parameters (fallback)
|
|
174
|
+
const channelId = urlParams?.get('id') || pathChannelId;
|
|
175
|
+
|
|
176
|
+
useEffect(() => {
|
|
177
|
+
// If context tab is disabled via props, fall back to preview
|
|
178
|
+
if (activeTab === 'context' && !showContextTab) {
|
|
179
|
+
setActiveTab('preview');
|
|
180
|
+
}
|
|
181
|
+
}, [activeTab, showContextTab, setActiveTab]);
|
|
182
|
+
|
|
183
|
+
const recreateSandboxForFragment = useCallback(
|
|
184
|
+
async (messageId: string) => {
|
|
185
|
+
if (!channelId || !messageId) {
|
|
186
|
+
console.error('No channel ID or message ID available for sandbox recreation');
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
try {
|
|
191
|
+
setIsCreatingSandbox(true);
|
|
192
|
+
setError(null);
|
|
193
|
+
|
|
194
|
+
props?.handleRecreateSandbox?.(messageId);
|
|
195
|
+
} catch (err) {
|
|
196
|
+
console.error('Error recreating sandbox:', err);
|
|
197
|
+
setError(err instanceof Error ? err.message : 'Failed to recreate sandbox');
|
|
198
|
+
setIsCreatingSandbox(false);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
[channelId, props?.handleRecreateSandbox],
|
|
202
|
+
);
|
|
203
|
+
|
|
204
|
+
const handleStop = useCallback(async () => {
|
|
205
|
+
try {
|
|
206
|
+
setIsCreatingSandbox(true);
|
|
207
|
+
setError(null);
|
|
208
|
+
|
|
209
|
+
props?.onStop?.();
|
|
210
|
+
} catch (err) {
|
|
211
|
+
console.error('Error stopping:', err);
|
|
212
|
+
setError(err instanceof Error ? err.message : 'Failed to recreate sandbox');
|
|
213
|
+
setIsCreatingSandbox(false);
|
|
214
|
+
}
|
|
215
|
+
}, [props?.onStop]);
|
|
216
|
+
|
|
217
|
+
// Handle refresh sandbox
|
|
218
|
+
const handleRefreshSandbox = useCallback(() => {
|
|
219
|
+
if (selectedPost) {
|
|
220
|
+
recreateSandboxForFragment(selectedPost.id);
|
|
221
|
+
}
|
|
222
|
+
}, [activeTab, selectedPost, recreateSandboxForFragment]);
|
|
223
|
+
|
|
224
|
+
// Handle preview sandbox
|
|
225
|
+
const handlePreviewSandbox = useCallback(() => {
|
|
226
|
+
if (selectedPost?.propsConfiguration?.contents?.fragment?.sandboxUrl) {
|
|
227
|
+
const sandboxUrl = selectedPost.propsConfiguration.contents.fragment.sandboxUrl;
|
|
228
|
+
console.log('Opening sandbox URL:', sandboxUrl);
|
|
229
|
+
window.open(sandboxUrl, '_blank', 'noopener,noreferrer');
|
|
230
|
+
} else {
|
|
231
|
+
console.warn('No sandbox URL available for selected post');
|
|
232
|
+
}
|
|
233
|
+
}, [selectedPost]);
|
|
234
|
+
|
|
235
|
+
// Hooks - improved responsive breakpoints with better granularity
|
|
236
|
+
const { width: windowWidth, height: windowHeight } = useWindowDimensions();
|
|
237
|
+
const isMobileView = useMediaQuery('(max-width: 640px)');
|
|
238
|
+
const isSmallTabletView = useMediaQuery('(min-width: 641px) and (max-width: 900px)');
|
|
239
|
+
const isTabletView = useMediaQuery('(min-width: 901px) and (max-width: 1024px)');
|
|
240
|
+
const isDesktopView = useMediaQuery('(min-width: 1025px)');
|
|
241
|
+
const isLargeDesktopView = useMediaQuery('(min-width: 1440px)');
|
|
242
|
+
const isSmallScreen = useMediaQuery('(max-width: 900px)');
|
|
243
|
+
|
|
244
|
+
const detailSidebarOptions = useMemo(
|
|
245
|
+
() => ({
|
|
246
|
+
isMobileView,
|
|
247
|
+
isSmallTabletView,
|
|
248
|
+
isTabletView,
|
|
249
|
+
isDesktopView,
|
|
250
|
+
isLargeDesktopView,
|
|
251
|
+
isSmallScreen,
|
|
252
|
+
}),
|
|
253
|
+
[isMobileView, isSmallTabletView, isTabletView, isDesktopView, isLargeDesktopView, isSmallScreen],
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<>
|
|
258
|
+
{/* Main Container */}
|
|
259
|
+
<div className="flex flex-col h-screen overflow-hidden">
|
|
260
|
+
{/* Header with Design/Interact/Code tabs - now inside main container */}
|
|
261
|
+
{isShowOnlyInbox && (
|
|
262
|
+
<div className="flex-shrink-0 bg-white justify-center items-center ">
|
|
263
|
+
<div className="flex items-center justify-between px-4 pt-3">
|
|
264
|
+
<div className="flex items-center">
|
|
265
|
+
<h1 className="text-2xl font-bold">{props?.inboxTitle || 'Chat'}</h1>
|
|
266
|
+
</div>
|
|
267
|
+
{/* Settings gear button — available in plan mode */}
|
|
268
|
+
<button
|
|
269
|
+
onClick={() => setActiveTab(activeTab === 'settings' ? 'preview' : 'settings')}
|
|
270
|
+
className={`p-2 rounded-lg transition-colors ${
|
|
271
|
+
activeTab === 'settings'
|
|
272
|
+
? 'bg-blue-500 text-white'
|
|
273
|
+
: 'text-gray-600 hover:text-gray-900 hover:bg-gray-50'
|
|
274
|
+
}`}
|
|
275
|
+
title="Chat Settings"
|
|
276
|
+
>
|
|
277
|
+
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
278
|
+
<path
|
|
279
|
+
strokeLinecap="round"
|
|
280
|
+
strokeLinejoin="round"
|
|
281
|
+
strokeWidth={2}
|
|
282
|
+
d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"
|
|
283
|
+
/>
|
|
284
|
+
<path
|
|
285
|
+
strokeLinecap="round"
|
|
286
|
+
strokeLinejoin="round"
|
|
287
|
+
strokeWidth={2}
|
|
288
|
+
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
289
|
+
/>
|
|
290
|
+
</svg>
|
|
291
|
+
</button>
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
)}
|
|
295
|
+
{channelId && !isShowOnlyInbox && (
|
|
296
|
+
<div className="flex-shrink-0 bg-white ">
|
|
297
|
+
<div className="flex items-center justify-between px-4 py-3">
|
|
298
|
+
<div className="flex items-center">
|
|
299
|
+
{/* Show tabs only on larger screens */}
|
|
300
|
+
{!isSmallScreen && (
|
|
301
|
+
<div className="flex bg-gray-100 p-2" style={{ borderRadius: '10px' }}>
|
|
302
|
+
<button
|
|
303
|
+
onClick={() => setActiveTab('preview')}
|
|
304
|
+
className={`flex items-center space-x-2 px-4 py-2 text-xs font-medium transition-all duration-200 ${
|
|
305
|
+
activeTab === 'preview'
|
|
306
|
+
? 'bg-blue-500 text-white shadow-sm'
|
|
307
|
+
: 'text-gray-600 hover:text-gray-900'
|
|
308
|
+
}`}
|
|
309
|
+
style={{ borderRadius: '10px' }}
|
|
310
|
+
>
|
|
311
|
+
<svg
|
|
312
|
+
className="w-4 h-4"
|
|
313
|
+
fill="none"
|
|
314
|
+
stroke="currentColor"
|
|
315
|
+
viewBox="0 0 24 24"
|
|
316
|
+
>
|
|
317
|
+
<path
|
|
318
|
+
strokeLinecap="round"
|
|
319
|
+
strokeLinejoin="round"
|
|
320
|
+
strokeWidth={2}
|
|
321
|
+
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
322
|
+
/>
|
|
323
|
+
<path
|
|
324
|
+
strokeLinecap="round"
|
|
325
|
+
strokeLinejoin="round"
|
|
326
|
+
strokeWidth={2}
|
|
327
|
+
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"
|
|
328
|
+
/>
|
|
329
|
+
</svg>
|
|
330
|
+
<span>Preview</span>
|
|
331
|
+
</button>
|
|
332
|
+
<button
|
|
333
|
+
onClick={() => setActiveTab('code')}
|
|
334
|
+
className={`flex items-center space-x-2 px-4 py-2 text-xs font-medium transition-all duration-200 ${
|
|
335
|
+
activeTab === 'code'
|
|
336
|
+
? 'bg-blue-500 text-white shadow-sm'
|
|
337
|
+
: 'text-gray-600 hover:text-gray-900'
|
|
338
|
+
}`}
|
|
339
|
+
style={{ borderRadius: '10px' }}
|
|
340
|
+
>
|
|
341
|
+
<svg
|
|
342
|
+
className="w-4 h-4"
|
|
343
|
+
fill="none"
|
|
344
|
+
stroke="currentColor"
|
|
345
|
+
viewBox="0 24 24"
|
|
346
|
+
>
|
|
347
|
+
<path
|
|
348
|
+
strokeLinecap="round"
|
|
349
|
+
strokeLinejoin="round"
|
|
350
|
+
strokeWidth={2}
|
|
351
|
+
d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"
|
|
352
|
+
/>
|
|
353
|
+
</svg>
|
|
354
|
+
<span>Code</span>
|
|
355
|
+
</button>
|
|
356
|
+
{showContextTab && (
|
|
357
|
+
<button
|
|
358
|
+
onClick={() => setActiveTab('context')}
|
|
359
|
+
className={`flex items-center space-x-2 px-4 py-2 text-xs font-medium transition-all duration-200 ${
|
|
360
|
+
activeTab === 'context'
|
|
361
|
+
? 'bg-blue-500 text-white shadow-sm'
|
|
362
|
+
: 'text-gray-600 hover:text-gray-900'
|
|
363
|
+
}`}
|
|
364
|
+
style={{ borderRadius: '10px' }}
|
|
365
|
+
>
|
|
366
|
+
<svg
|
|
367
|
+
className="w-4 h-4"
|
|
368
|
+
fill="none"
|
|
369
|
+
stroke="currentColor"
|
|
370
|
+
viewBox="0 0 24 24"
|
|
371
|
+
>
|
|
372
|
+
<path
|
|
373
|
+
strokeLinecap="round"
|
|
374
|
+
strokeLinejoin="round"
|
|
375
|
+
strokeWidth={2}
|
|
376
|
+
d="M12 8c-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3-1.343-3-3-3z"
|
|
377
|
+
/>
|
|
378
|
+
<path
|
|
379
|
+
strokeLinecap="round"
|
|
380
|
+
strokeLinejoin="round"
|
|
381
|
+
strokeWidth={2}
|
|
382
|
+
d="M21 12c0 4.97-4.03 9-9 9s-9-4.03-9-9 4.03-9 9-9 9 4.03 9 9z"
|
|
383
|
+
/>
|
|
384
|
+
</svg>
|
|
385
|
+
<span>Context</span>
|
|
386
|
+
</button>
|
|
387
|
+
)}
|
|
388
|
+
{/* Settings tab - always visible */}
|
|
389
|
+
<button
|
|
390
|
+
onClick={() => setActiveTab('settings')}
|
|
391
|
+
className={`flex items-center space-x-2 px-4 py-2 text-xs font-medium transition-all duration-200 ${
|
|
392
|
+
activeTab === 'settings'
|
|
393
|
+
? 'bg-blue-500 text-white shadow-sm'
|
|
394
|
+
: 'text-gray-600 hover:text-gray-900'
|
|
395
|
+
}`}
|
|
396
|
+
style={{ borderRadius: '10px' }}
|
|
397
|
+
>
|
|
398
|
+
<svg
|
|
399
|
+
className="w-4 h-4"
|
|
400
|
+
fill="none"
|
|
401
|
+
stroke="currentColor"
|
|
402
|
+
viewBox="0 0 24 24"
|
|
403
|
+
>
|
|
404
|
+
<path
|
|
405
|
+
strokeLinecap="round"
|
|
406
|
+
strokeLinejoin="round"
|
|
407
|
+
strokeWidth={2}
|
|
408
|
+
d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"
|
|
409
|
+
/>
|
|
410
|
+
<path
|
|
411
|
+
strokeLinecap="round"
|
|
412
|
+
strokeLinejoin="round"
|
|
413
|
+
strokeWidth={2}
|
|
414
|
+
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
415
|
+
/>
|
|
416
|
+
</svg>
|
|
417
|
+
<span>Settings</span>
|
|
418
|
+
</button>
|
|
419
|
+
</div>
|
|
420
|
+
)}
|
|
421
|
+
</div>
|
|
422
|
+
|
|
423
|
+
{/* Action buttons on the right - hidden on mobile */}
|
|
424
|
+
{isDesktopView && (
|
|
425
|
+
<div className="flex items-center gap-2">
|
|
426
|
+
{/* Minimize/Maximize button */}
|
|
427
|
+
<button
|
|
428
|
+
onClick={() => setIsMinimized(!isMinimized)}
|
|
429
|
+
className="p-2 text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded-lg transition-colors"
|
|
430
|
+
title={isMinimized ? 'Maximize Content' : 'Minimize Content'}
|
|
431
|
+
>
|
|
432
|
+
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
433
|
+
{isMinimized ? (
|
|
434
|
+
<path
|
|
435
|
+
strokeLinecap="round"
|
|
436
|
+
strokeLinejoin="round"
|
|
437
|
+
strokeWidth={2}
|
|
438
|
+
d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"
|
|
439
|
+
/>
|
|
440
|
+
) : (
|
|
441
|
+
<path
|
|
442
|
+
strokeLinecap="round"
|
|
443
|
+
strokeLinejoin="round"
|
|
444
|
+
strokeWidth={2}
|
|
445
|
+
d="M9 9V4.5M9 9H4.5M9 9L3.5 3.5M15 9V4.5M15 9h4.5M15 9l5.5-5.5M9 15v4.5M9 15H4.5M9 15l-5.5 5.5M15 15v4.5M15 15h4.5M15 15l5.5 5.5"
|
|
446
|
+
/>
|
|
447
|
+
)}
|
|
448
|
+
</svg>
|
|
449
|
+
</button>
|
|
450
|
+
|
|
451
|
+
{/* Preview button */}
|
|
452
|
+
<button
|
|
453
|
+
onClick={() => handlePreviewSandbox()}
|
|
454
|
+
className="p-2 text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded-lg transition-colors"
|
|
455
|
+
title="Open URL"
|
|
456
|
+
>
|
|
457
|
+
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
458
|
+
<path
|
|
459
|
+
strokeLinecap="round"
|
|
460
|
+
strokeLinejoin="round"
|
|
461
|
+
strokeWidth={2}
|
|
462
|
+
d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
|
|
463
|
+
/>
|
|
464
|
+
</svg>
|
|
465
|
+
</button>
|
|
466
|
+
|
|
467
|
+
{/* Refresh button */}
|
|
468
|
+
<button
|
|
469
|
+
onClick={() => handleRefreshSandbox()}
|
|
470
|
+
className="p-2 text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded-lg transition-colors"
|
|
471
|
+
title="Refresh Sandbox"
|
|
472
|
+
>
|
|
473
|
+
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
474
|
+
<path
|
|
475
|
+
strokeLinecap="round"
|
|
476
|
+
strokeLinejoin="round"
|
|
477
|
+
strokeWidth={2}
|
|
478
|
+
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"
|
|
479
|
+
/>
|
|
480
|
+
</svg>
|
|
481
|
+
</button>
|
|
482
|
+
</div>
|
|
483
|
+
)}
|
|
484
|
+
</div>
|
|
485
|
+
</div>
|
|
486
|
+
)}
|
|
487
|
+
|
|
488
|
+
{/* Content Grid - ContentComponent and RightSidebar */}
|
|
489
|
+
<div
|
|
490
|
+
className="flex-1 grid overflow-hidden"
|
|
491
|
+
style={{
|
|
492
|
+
gridTemplateColumns: isDesktopView
|
|
493
|
+
? isShowOnlyInbox && activeTab !== 'settings'
|
|
494
|
+
? '1fr'
|
|
495
|
+
: '35% 65%'
|
|
496
|
+
: '1fr',
|
|
497
|
+
gridTemplateRows: 'minmax(0, 1fr)',
|
|
498
|
+
height: 'calc(100vh - 80px)', // Subtract header height
|
|
499
|
+
}}
|
|
500
|
+
>
|
|
501
|
+
{/* Main Content Area - 35% width on desktop */}
|
|
502
|
+
<div
|
|
503
|
+
className={`
|
|
504
|
+
${isMobileView && !channelId ? 'hidden' : 'flex'}
|
|
505
|
+
${isMinimized && isDesktopView ? 'hidden' : 'flex'}
|
|
506
|
+
flex flex-col overflow-hidden transition-all duration-300 ease-in-out
|
|
507
|
+
`}
|
|
508
|
+
style={{ paddingTop: '15px' }}
|
|
509
|
+
>
|
|
510
|
+
{channelId ? (
|
|
511
|
+
<ContentComponent
|
|
512
|
+
channelId={channelId}
|
|
513
|
+
{...props}
|
|
514
|
+
messages={messages}
|
|
515
|
+
setMessages={setMessages}
|
|
516
|
+
selectedPost={selectedPost}
|
|
517
|
+
setSelectedPost={setSelectedPost}
|
|
518
|
+
setIsLoading={setIsLoading}
|
|
519
|
+
isLoading={isLoading}
|
|
520
|
+
sendMessageInput={sendMessageInput}
|
|
521
|
+
isShowOnlyInbox={isShowOnlyInbox}
|
|
522
|
+
showModeSelector={props?.showModeSelector}
|
|
523
|
+
showStopButton={props?.showStopButton}
|
|
524
|
+
onStop={handleStop}
|
|
525
|
+
templates={props?.templates}
|
|
526
|
+
selectedTemplate={props?.selectedTemplate}
|
|
527
|
+
onSelectTemplate={props?.onSelectTemplate}
|
|
528
|
+
leftItemsOverrides={props?.leftItemsOverrides}
|
|
529
|
+
rightItemsOverrides={props?.rightItemsOverrides}
|
|
530
|
+
projectId={props?.projectId}
|
|
531
|
+
inputToolBarProps={props?.inputToolBarProps}
|
|
532
|
+
/>
|
|
533
|
+
) : (
|
|
534
|
+
<EmptyState />
|
|
535
|
+
)}
|
|
536
|
+
</div>
|
|
537
|
+
|
|
538
|
+
{/* Right Sidebar - 65% width on desktop only, also shown for settings tab (no channelId required for settings) */}
|
|
539
|
+
{(activeTab === 'settings' || (channelId && !isShowOnlyInbox)) && isDesktopView && (
|
|
540
|
+
<div
|
|
541
|
+
className="overflow-hidden border flex-1 w-full min-h-0"
|
|
542
|
+
style={{
|
|
543
|
+
marginBottom: 10,
|
|
544
|
+
marginRight: 10,
|
|
545
|
+
borderRadius: 10,
|
|
546
|
+
width: isMinimized ? windowWidth - 140 : `100%`,
|
|
547
|
+
}}
|
|
548
|
+
>
|
|
549
|
+
<RightSidebarContent
|
|
550
|
+
detailSidebarOptions={detailSidebarOptions}
|
|
551
|
+
windowWidth={windowWidth}
|
|
552
|
+
windowHeight={windowHeight}
|
|
553
|
+
activeTab={activeTab}
|
|
554
|
+
channelId={channelId}
|
|
555
|
+
messages={messages}
|
|
556
|
+
selectedPost={selectedPost}
|
|
557
|
+
contextData={contextData}
|
|
558
|
+
showContextTab={showContextTab}
|
|
559
|
+
setIsLoading={setIsLoading}
|
|
560
|
+
setIsCreatingSandbox={setIsCreatingSandbox}
|
|
561
|
+
isCreatingSandbox={isCreatingSandbox}
|
|
562
|
+
isLoading={isLoading}
|
|
563
|
+
handleSendMessage={handleSendMessage}
|
|
564
|
+
handleRecreateSandbox={props?.handleRecreateSandbox || null}
|
|
565
|
+
isMinimized={isMinimized}
|
|
566
|
+
ContextTabComponent={props?.ContextTabComponent ?? DefaultContextTab}
|
|
567
|
+
showStopButton={props?.showStopButton}
|
|
568
|
+
onStop={handleStop}
|
|
569
|
+
{...props}
|
|
570
|
+
/>
|
|
571
|
+
</div>
|
|
572
|
+
)}
|
|
573
|
+
</div>
|
|
574
|
+
</div>
|
|
575
|
+
</>
|
|
576
|
+
);
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
const ContentComponent = React.memo((props: any) => {
|
|
580
|
+
const {
|
|
581
|
+
channelId,
|
|
582
|
+
messages,
|
|
583
|
+
setMessages,
|
|
584
|
+
selectedPost,
|
|
585
|
+
setSelectedPost,
|
|
586
|
+
setIsLoading,
|
|
587
|
+
isLoading,
|
|
588
|
+
sendMessageInput,
|
|
589
|
+
isShowOnlyInbox,
|
|
590
|
+
showModeSelector,
|
|
591
|
+
showStopButton,
|
|
592
|
+
onStop,
|
|
593
|
+
templates,
|
|
594
|
+
selectedTemplate,
|
|
595
|
+
onSelectTemplate,
|
|
596
|
+
leftItemsOverrides,
|
|
597
|
+
rightItemsOverrides,
|
|
598
|
+
projectId,
|
|
599
|
+
inputToolBarProps,
|
|
600
|
+
} = props;
|
|
601
|
+
|
|
602
|
+
return (
|
|
603
|
+
<div className="flex overflow-hidden h-full">
|
|
604
|
+
{/* Main Chat Content */}
|
|
605
|
+
<div className="flex-1 flex flex-col min-w-0 overflow-hidden border-t border-gray-300">
|
|
606
|
+
{/* Content based on postId */}
|
|
607
|
+
<div className="flex-1 flex flex-col min-h-0 overflow-hidden">
|
|
608
|
+
{channelId && (
|
|
609
|
+
<>
|
|
610
|
+
<MessagesComponent
|
|
611
|
+
{...props}
|
|
612
|
+
channelId={channelId}
|
|
613
|
+
messages={messages}
|
|
614
|
+
setMessages={setMessages}
|
|
615
|
+
selectedPost={selectedPost}
|
|
616
|
+
setSelectedPost={setSelectedPost}
|
|
617
|
+
setIsLoading={setIsLoading}
|
|
618
|
+
isLoading={isLoading}
|
|
619
|
+
sendMessageInput={sendMessageInput}
|
|
620
|
+
isShowOnlyInbox={isShowOnlyInbox}
|
|
621
|
+
showModeSelector={showModeSelector}
|
|
622
|
+
showStopButton={showStopButton}
|
|
623
|
+
onStop={onStop}
|
|
624
|
+
templates={templates}
|
|
625
|
+
selectedTemplate={selectedTemplate}
|
|
626
|
+
onSelectTemplate={onSelectTemplate}
|
|
627
|
+
leftItemsOverrides={leftItemsOverrides}
|
|
628
|
+
rightItemsOverrides={rightItemsOverrides}
|
|
629
|
+
projectId={projectId}
|
|
630
|
+
inputToolBarProps={inputToolBarProps}
|
|
631
|
+
/>
|
|
632
|
+
</>
|
|
633
|
+
)}
|
|
634
|
+
</div>
|
|
635
|
+
</div>
|
|
636
|
+
</div>
|
|
637
|
+
);
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
const RightSidebarWrapper = React.memo(({ detailSidebarOptions }: any) => {
|
|
641
|
+
const { activeTab } = useContext(TabContext);
|
|
642
|
+
return (
|
|
643
|
+
<div className="h-full flex flex-col overflow-hidden bg-white">
|
|
644
|
+
{/* Content Area */}
|
|
645
|
+
<div className="flex-1 overflow-hidden">
|
|
646
|
+
{activeTab === 'preview' ? (
|
|
647
|
+
<div className="h-full flex items-center justify-center bg-gray-50">
|
|
648
|
+
<div className="text-center">
|
|
649
|
+
{/* Preview Icon */}
|
|
650
|
+
<div className="mb-8">
|
|
651
|
+
<svg
|
|
652
|
+
className="w-32 h-32 mx-auto text-blue-500"
|
|
653
|
+
fill="none"
|
|
654
|
+
stroke="currentColor"
|
|
655
|
+
viewBox="0 0 24 24"
|
|
656
|
+
>
|
|
657
|
+
<path
|
|
658
|
+
strokeLinecap="round"
|
|
659
|
+
strokeLinejoin="round"
|
|
660
|
+
strokeWidth={1}
|
|
661
|
+
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
662
|
+
/>
|
|
663
|
+
<path
|
|
664
|
+
strokeLinecap="round"
|
|
665
|
+
strokeLinejoin="round"
|
|
666
|
+
strokeWidth={1}
|
|
667
|
+
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"
|
|
668
|
+
/>
|
|
669
|
+
</svg>
|
|
670
|
+
</div>
|
|
671
|
+
|
|
672
|
+
<div className="space-y-4 text-gray-600">
|
|
673
|
+
<h3 className="text-lg font-semibold text-gray-900">Preview Mode</h3>
|
|
674
|
+
<p className="font-mono text-sm bg-blue-100 px-3 py-1 rounded">
|
|
675
|
+
Live preview and testing
|
|
676
|
+
</p>
|
|
677
|
+
<p>Preview and test your components in real-time.</p>
|
|
678
|
+
</div>
|
|
679
|
+
|
|
680
|
+
<div className="mt-8 space-y-4">
|
|
681
|
+
<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">
|
|
682
|
+
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
|
|
683
|
+
<path d="M8 5v14l11-7z" />
|
|
684
|
+
</svg>
|
|
685
|
+
<span>Start Preview</span>
|
|
686
|
+
</button>
|
|
687
|
+
<p className="text-sm text-gray-500 underline cursor-pointer hover:text-gray-700">
|
|
688
|
+
Learn about preview mode
|
|
689
|
+
</p>
|
|
690
|
+
</div>
|
|
691
|
+
</div>
|
|
692
|
+
</div>
|
|
693
|
+
) : (
|
|
694
|
+
<div className="h-full bg-gray-900 text-gray-300 p-4 overflow-auto">
|
|
695
|
+
<div className="font-mono text-sm">
|
|
696
|
+
<div className="mb-4">
|
|
697
|
+
<div className="text-green-400">// app/page.tsx</div>
|
|
698
|
+
</div>
|
|
699
|
+
<div className="space-y-2">
|
|
700
|
+
<div>
|
|
701
|
+
<span className="text-purple-400">export</span>{' '}
|
|
702
|
+
<span className="text-purple-400">default</span>{' '}
|
|
703
|
+
<span className="text-blue-400">function</span>{' '}
|
|
704
|
+
<span className="text-yellow-400">Home</span>() {'{'}
|
|
705
|
+
</div>
|
|
706
|
+
<div className="ml-4">
|
|
707
|
+
<span className="text-purple-400">return</span> (
|
|
708
|
+
</div>
|
|
709
|
+
<div className="ml-8">
|
|
710
|
+
{'<'}
|
|
711
|
+
<span className="text-red-400">main</span>{' '}
|
|
712
|
+
<span className="text-green-400">className</span>=
|
|
713
|
+
<span className="text-yellow-400">
|
|
714
|
+
"flex min-h-screen flex-col items-center justify-between p-24"
|
|
715
|
+
</span>
|
|
716
|
+
{'>'}
|
|
717
|
+
</div>
|
|
718
|
+
<div className="ml-12">
|
|
719
|
+
{'<'}
|
|
720
|
+
<span className="text-red-400">div</span>{' '}
|
|
721
|
+
<span className="text-green-400">className</span>=
|
|
722
|
+
<span className="text-yellow-400">
|
|
723
|
+
"z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex"
|
|
724
|
+
</span>
|
|
725
|
+
{'>'}
|
|
726
|
+
</div>
|
|
727
|
+
<div className="ml-16">
|
|
728
|
+
{'<'}
|
|
729
|
+
<span className="text-red-400">p</span>{' '}
|
|
730
|
+
<span className="text-green-400">className</span>=
|
|
731
|
+
<span className="text-yellow-400">
|
|
732
|
+
"fixed left-0 top-0 flex w-full justify-center border-b border-gray-300
|
|
733
|
+
bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl
|
|
734
|
+
dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static
|
|
735
|
+
lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30"
|
|
736
|
+
</span>
|
|
737
|
+
{'>'}
|
|
738
|
+
</div>
|
|
739
|
+
<div className="ml-20 text-gray-400">Get started by editing </div>
|
|
740
|
+
<div className="ml-20">
|
|
741
|
+
{'<'}
|
|
742
|
+
<span className="text-red-400">code</span>{' '}
|
|
743
|
+
<span className="text-green-400">className</span>=
|
|
744
|
+
<span className="text-yellow-400">"font-mono font-bold"</span>
|
|
745
|
+
{'>'}app/page.tsx{'</'}
|
|
746
|
+
<span className="text-red-400">code</span>
|
|
747
|
+
{'>'}
|
|
748
|
+
</div>
|
|
749
|
+
<div className="ml-16">
|
|
750
|
+
{'</'}
|
|
751
|
+
<span className="text-red-400">p</span>
|
|
752
|
+
{'>'}
|
|
753
|
+
</div>
|
|
754
|
+
<div className="ml-12">
|
|
755
|
+
{'</'}
|
|
756
|
+
<span className="text-red-400">div</span>
|
|
757
|
+
{'>'}
|
|
758
|
+
</div>
|
|
759
|
+
<div className="ml-8">
|
|
760
|
+
{'</'}
|
|
761
|
+
<span className="text-red-400">main</span>
|
|
762
|
+
{'>'}
|
|
763
|
+
</div>
|
|
764
|
+
<div className="ml-4">);</div>
|
|
765
|
+
<div>{'}'}</div>
|
|
766
|
+
</div>
|
|
767
|
+
</div>
|
|
768
|
+
</div>
|
|
769
|
+
)}
|
|
770
|
+
</div>
|
|
771
|
+
</div>
|
|
772
|
+
);
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
const RightSidebarContent = React.memo(
|
|
776
|
+
({
|
|
777
|
+
detailSidebarOptions,
|
|
778
|
+
windowWidth,
|
|
779
|
+
windowHeight,
|
|
780
|
+
channelId,
|
|
781
|
+
setIsLoading,
|
|
782
|
+
isLoading,
|
|
783
|
+
handleSendMessage,
|
|
784
|
+
handleRecreateSandbox,
|
|
785
|
+
isMinimized,
|
|
786
|
+
isCreatingSandbox,
|
|
787
|
+
setIsCreatingSandbox,
|
|
788
|
+
...props
|
|
789
|
+
}: any) => {
|
|
790
|
+
const { activeTab } = useContext(TabContext);
|
|
791
|
+
|
|
792
|
+
return (
|
|
793
|
+
<div
|
|
794
|
+
className="border-l border-gray-200 bg-white flex-shrink-0 overflow-hidden flex-1 w-full h-full min-h-0"
|
|
795
|
+
style={{
|
|
796
|
+
width: isMinimized ? windowWidth : `100%`,
|
|
797
|
+
}}
|
|
798
|
+
>
|
|
799
|
+
{activeTab === 'settings' ? (
|
|
800
|
+
<div className="h-full overflow-auto">
|
|
801
|
+
<Slot
|
|
802
|
+
name={MessengerSlotFillNameEnum.CHAT_SETTINGS}
|
|
803
|
+
fillProps={{
|
|
804
|
+
active: true,
|
|
805
|
+
channelId,
|
|
806
|
+
activeTab,
|
|
807
|
+
}}
|
|
808
|
+
/>
|
|
809
|
+
</div>
|
|
810
|
+
) : (
|
|
811
|
+
<RightSidebarAi
|
|
812
|
+
detailSidebarOptions={detailSidebarOptions}
|
|
813
|
+
windowWidth={windowWidth}
|
|
814
|
+
windowHeight={windowHeight}
|
|
815
|
+
activeTab={activeTab}
|
|
816
|
+
channelId={channelId}
|
|
817
|
+
setIsLoading={setIsLoading}
|
|
818
|
+
isLoading={isLoading}
|
|
819
|
+
handleSendMessage={handleSendMessage}
|
|
820
|
+
isCreatingSandbox={isCreatingSandbox}
|
|
821
|
+
setIsCreatingSandbox={setIsCreatingSandbox}
|
|
822
|
+
isMinimized={isMinimized}
|
|
823
|
+
handleRecreateSandbox={handleRecreateSandbox}
|
|
824
|
+
{...props}
|
|
825
|
+
/>
|
|
826
|
+
)}
|
|
827
|
+
</div>
|
|
828
|
+
);
|
|
829
|
+
},
|
|
830
|
+
);
|
|
831
|
+
|
|
832
|
+
const MessagesComponent = React.memo((props: any) => {
|
|
833
|
+
return <Outlet context={{ ...props, app: 'app' }} />;
|
|
834
|
+
});
|
|
835
|
+
|
|
836
|
+
// Display names for debugging
|
|
837
|
+
InboxWithAi.displayName = 'Inbox';
|
|
838
|
+
InboxWithAiInternal.displayName = 'InboxWithAiInternal';
|
|
839
|
+
ContentComponent.displayName = 'ContentComponent';
|
|
840
|
+
MessagesComponent.displayName = 'MessagesComponent';
|
|
841
|
+
RightSidebarWrapper.displayName = 'RightSidebarWrapper';
|
|
842
|
+
RightSidebarContent.displayName = 'RightSidebarContent';
|
|
843
|
+
|
|
844
|
+
export default React.memo(InboxWithAi);
|