@messenger-box/tailwind-ui-inbox 10.0.3-alpha.100
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 +104 -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 +21 -0
- package/lib/components/AIAgent/AIAgent.d.ts.map +1 -0
- package/lib/components/AIAgent/AIAgent.js +904 -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/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 +12 -0
- package/lib/components/InboxMessage/InputComponent.d.ts.map +1 -0
- package/lib/components/InboxMessage/InputComponent.js +359 -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 +23 -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/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/UploadImageButton.d.ts +7 -0
- package/lib/components/InboxMessage/UploadImageButton.d.ts.map +1 -0
- package/lib/components/InboxMessage/UploadImageButton.js +34 -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 +17 -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 +11 -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 +18 -0
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.d.ts.map +1 -0
- package/lib/components/InboxMessage/message-widgets/ModernMessageGroup.js +1082 -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 +37 -0
- package/lib/components/ModelConfigPanel.d.ts.map +1 -0
- package/lib/components/ModelConfigPanel.js +317 -0
- package/lib/components/ModelConfigPanel.js.map +1 -0
- package/lib/components/filler-components/RightSiderBar.d.ts +24 -0
- package/lib/components/filler-components/RightSiderBar.d.ts.map +1 -0
- package/lib/components/filler-components/RightSiderBar.js +335 -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 +7 -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/hybrid-live-editor.js +68 -0
- package/lib/components/live-code-editor/hybrid-live-editor.js.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/live-code-editor/live-code-editor.js +207 -0
- package/lib/components/live-code-editor/live-code-editor.js.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 +137 -0
- package/lib/compute.js.map +1 -0
- package/lib/config/env-config.d.ts +13 -0
- package/lib/config/env-config.d.ts.map +1 -0
- package/lib/config/env-config.js +34 -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 +4 -0
- package/lib/container/AiLandingInput.d.ts.map +1 -0
- package/lib/container/AiLandingInput.js +101 -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 +955 -0
- package/lib/container/Inbox.js.map +1 -0
- package/lib/container/InboxAiMessagesLoader.d.ts +15 -0
- package/lib/container/InboxAiMessagesLoader.d.ts.map +1 -0
- package/lib/container/InboxAiMessagesLoader.js +30 -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/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 +144 -0
- package/lib/container/ServiceInbox.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 +314 -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 +341 -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 +244 -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 +5 -0
- package/lib/enums/messenger-slot-fill-name-enum.d.ts.map +1 -0
- package/lib/enums/messenger-slot-fill-name-enum.js +5 -0
- package/lib/enums/messenger-slot-fill-name-enum.js.map +1 -0
- package/lib/hooks/index.d.ts +3 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/use-file-sync.d.ts +16 -0
- package/lib/hooks/use-file-sync.d.ts.map +1 -0
- package/lib/hooks/use-file-sync.js +63 -0
- package/lib/hooks/use-file-sync.js.map +1 -0
- package/lib/hooks/usePersistentModelConfig.d.ts +15 -0
- package/lib/hooks/usePersistentModelConfig.d.ts.map +1 -0
- package/lib/hooks/usePersistentModelConfig.js +46 -0
- package/lib/hooks/usePersistentModelConfig.js.map +1 -0
- package/lib/index.d.ts +10 -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 +98 -0
- package/lib/styles/responsive.css +76 -0
- package/lib/templates/InboxWithAi.d.ts +15 -0
- package/lib/templates/InboxWithAi.d.ts.map +1 -0
- package/lib/templates/InboxWithAi.js +440 -0
- package/lib/templates/InboxWithAi.js.map +1 -0
- package/lib/templates/InboxWithAi.tsx +533 -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/utils/utils.d.ts +2 -0
- package/lib/utils/utils.d.ts.map +1 -0
- package/lib/utils/utils.js +3 -0
- package/lib/utils/utils.js.map +1 -0
- package/package.json +62 -0
- package/rollup.config.mjs +35 -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 +1103 -0
- package/src/components/AIAgent/AIAgent.tsx.bk +1365 -0
- package/src/components/AIAgent/README.md +82 -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 +462 -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 +37 -0
- package/src/components/InboxMessage/ServiceConversationItem.tsx +234 -0
- package/src/components/InboxMessage/ServiceInboxItem.tsx +223 -0
- package/src/components/InboxMessage/SubscriptionHandler.tsx +55 -0
- package/src/components/InboxMessage/UploadImageButton.tsx +46 -0
- package/src/components/InboxMessage/UserModalContent.tsx +60 -0
- package/src/components/InboxMessage/index.ts +16 -0
- package/src/components/InboxMessage/message-widgets/CommonMessage.tsx +69 -0
- package/src/components/InboxMessage/message-widgets/ErrorFixCard.tsx +240 -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 +1295 -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 +3 -0
- package/src/components/ModelConfigPanel.tsx +345 -0
- package/src/components/filler-components/RightSiderBar.tsx +408 -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 +22 -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/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 +39 -0
- package/src/components/ui/button.tsx +32 -0
- package/src/compute.ts +134 -0
- package/src/config/env-config.ts +17 -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 +1819 -0
- package/src/container/AiInboxWithLoader.tsx +356 -0
- package/src/container/AiLandingInput.tsx +221 -0
- package/src/container/Inbox.tsx +1092 -0
- package/src/container/InboxAiMessagesLoader.tsx +44 -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/InboxWithLoader.tsx +341 -0
- package/src/container/ServiceInbox.tsx +190 -0
- package/src/container/ThreadMessages.tsx +371 -0
- package/src/container/ThreadMessagesInbox.tsx +450 -0
- package/src/container/Threads.tsx +270 -0
- package/src/container/ThreadsInbox.tsx +354 -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 +4 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/use-file-sync.ts +91 -0
- package/src/hooks/usePersistentModelConfig.ts +63 -0
- package/src/index.ts +37 -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 +533 -0
- package/src/templates/index.ts +1 -0
- package/src/utils/utils.ts +3 -0
- package/tsconfig.json +14 -0
- package/webpack.config.js +92 -0
|
@@ -0,0 +1,533 @@
|
|
|
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 { RightSidebarAi } from '../components/InboxMessage/RightSidebarAi';
|
|
14
|
+
import { useRecreateSandboxMutation } from 'common/graphql';
|
|
15
|
+
import { usePersistentModelConfig } from '../hooks/usePersistentModelConfig';
|
|
16
|
+
import { useFileSync } from '../hooks/use-file-sync';
|
|
17
|
+
|
|
18
|
+
// Context for sharing tab state between header and sidebar
|
|
19
|
+
const TabContext = createContext<{
|
|
20
|
+
activeTab: string;
|
|
21
|
+
setActiveTab: (tab: string) => void;
|
|
22
|
+
}>({
|
|
23
|
+
activeTab: 'preview',
|
|
24
|
+
setActiveTab: () => {},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export interface InboxProps {
|
|
28
|
+
channelFilters?: Record<string, unknown>;
|
|
29
|
+
channelRole?: string;
|
|
30
|
+
supportServices?: boolean;
|
|
31
|
+
pathPrefix?: string;
|
|
32
|
+
data?: any;
|
|
33
|
+
orgName?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Static utility hooks and components
|
|
37
|
+
const useMediaQuery = (query: string) => {
|
|
38
|
+
const [matches, setMatches] = React.useState(false);
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (typeof window === 'undefined') return;
|
|
42
|
+
|
|
43
|
+
const mediaQuery = window.matchMedia(query);
|
|
44
|
+
const updateMatches = () => setMatches(mediaQuery.matches);
|
|
45
|
+
|
|
46
|
+
updateMatches();
|
|
47
|
+
mediaQuery.addEventListener('change', updateMatches);
|
|
48
|
+
return () => mediaQuery.removeEventListener('change', updateMatches);
|
|
49
|
+
}, [query]);
|
|
50
|
+
|
|
51
|
+
return matches;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Hook to get window dimensions
|
|
55
|
+
const useWindowDimensions = () => {
|
|
56
|
+
const [windowDimensions, setWindowDimensions] = React.useState({
|
|
57
|
+
width: typeof window !== 'undefined' ? window.innerWidth : 1024,
|
|
58
|
+
height: typeof window !== 'undefined' ? window.innerHeight : 768,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (typeof window === 'undefined') return;
|
|
63
|
+
|
|
64
|
+
const handleResize = () => {
|
|
65
|
+
setWindowDimensions({
|
|
66
|
+
width: window.innerWidth,
|
|
67
|
+
height: window.innerHeight,
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
window.addEventListener('resize', handleResize);
|
|
72
|
+
handleResize(); // Set initial dimensions
|
|
73
|
+
|
|
74
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
75
|
+
}, []);
|
|
76
|
+
|
|
77
|
+
return windowDimensions;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const EmptyState = React.memo(() => (
|
|
81
|
+
<div className="h-full flex items-center justify-center bg-gray-100 p-4 sm:p-6 overflow-hidden">
|
|
82
|
+
<div className="text-center max-w-sm mx-auto">
|
|
83
|
+
<div className="text-3xl sm:text-4xl text-gray-400 mb-4">💬</div>
|
|
84
|
+
<h3 className="text-lg sm:text-xl font-semibold text-gray-600 mb-2">Welcome to Messenger</h3>
|
|
85
|
+
<p className="text-sm sm:text-base text-gray-500 leading-relaxed">
|
|
86
|
+
Select a conversation from the sidebar to start messaging
|
|
87
|
+
</p>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
));
|
|
91
|
+
|
|
92
|
+
const InboxWithAi = (props: InboxProps) => {
|
|
93
|
+
const [activeTab, setActiveTab] = React.useState('preview');
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<TabContext.Provider value={{ activeTab, setActiveTab }}>
|
|
97
|
+
<InboxWithAiInternal {...props} />
|
|
98
|
+
</TabContext.Provider>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const InboxWithAiInternal = (props: InboxProps) => {
|
|
103
|
+
// const { channelFilters: channelFilterProp, channelRole, supportServices, data, orgName, pathPrefix = null } = props;
|
|
104
|
+
const { id: pathChannelId, postId: pathPostId } = useParams();
|
|
105
|
+
const location = useLocation();
|
|
106
|
+
const urlParams = location?.search ? new URLSearchParams(location.search) : null;
|
|
107
|
+
const { activeTab, setActiveTab } = useContext(TabContext);
|
|
108
|
+
const [messages, setMessages] = useState<any[]>([]);
|
|
109
|
+
const [selectedPost, setSelectedPost] = useState<any>(null);
|
|
110
|
+
const [recreateSandbox] = useRecreateSandboxMutation();
|
|
111
|
+
const { modelConfig, getValidatedConfig, hasApiKey } = usePersistentModelConfig();
|
|
112
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
113
|
+
const [errorData, setError] = useState<string | null>(null);
|
|
114
|
+
// Extract channelId from query parameters (priority) or path parameters (fallback)
|
|
115
|
+
const channelId = urlParams?.get('id') || pathChannelId;
|
|
116
|
+
|
|
117
|
+
const recreateSandboxForFragment = useCallback(
|
|
118
|
+
async (messageId: string) => {
|
|
119
|
+
if (!channelId) {
|
|
120
|
+
console.error('No project ID available for sandbox recreation');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
setIsLoading(true);
|
|
126
|
+
setError(null);
|
|
127
|
+
|
|
128
|
+
const response = await recreateSandbox({
|
|
129
|
+
variables: {
|
|
130
|
+
projectId: channelId,
|
|
131
|
+
messageId,
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
if (response.data?.recreateSandbox?.success) {
|
|
136
|
+
console.log('Sandbox recreation initiated successfully');
|
|
137
|
+
// The subscription will handle updating the UI with the new sandbox URL
|
|
138
|
+
} else {
|
|
139
|
+
const errorMsg = response.data?.recreateSandbox?.message || 'Failed to recreate sandbox';
|
|
140
|
+
throw new Error(errorMsg);
|
|
141
|
+
}
|
|
142
|
+
} catch (err) {
|
|
143
|
+
console.error('Error recreating sandbox:', err);
|
|
144
|
+
setError(err instanceof Error ? err.message : 'Failed to recreate sandbox');
|
|
145
|
+
setIsLoading(false);
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
[recreateSandbox, channelId],
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
// Handle refresh sandbox
|
|
152
|
+
const handleRefreshSandbox = useCallback(() => {
|
|
153
|
+
if (selectedPost) {
|
|
154
|
+
recreateSandboxForFragment(selectedPost.id);
|
|
155
|
+
}
|
|
156
|
+
}, [activeTab, selectedPost, recreateSandboxForFragment]);
|
|
157
|
+
|
|
158
|
+
// Hooks - improved responsive breakpoints with better granularity
|
|
159
|
+
const { width: windowWidth, height: windowHeight } = useWindowDimensions();
|
|
160
|
+
const isMobileView = useMediaQuery('(max-width: 640px)');
|
|
161
|
+
const isSmallTabletView = useMediaQuery('(min-width: 641px) and (max-width: 900px)');
|
|
162
|
+
const isTabletView = useMediaQuery('(min-width: 901px) and (max-width: 1024px)');
|
|
163
|
+
const isDesktopView = useMediaQuery('(min-width: 1025px)');
|
|
164
|
+
const isLargeDesktopView = useMediaQuery('(min-width: 1440px)');
|
|
165
|
+
const isSmallScreen = useMediaQuery('(max-width: 900px)');
|
|
166
|
+
// const auth = useSelector(userSelector);
|
|
167
|
+
|
|
168
|
+
const detailSidebarOptions = useMemo(
|
|
169
|
+
() => ({
|
|
170
|
+
isMobileView,
|
|
171
|
+
isSmallTabletView,
|
|
172
|
+
isTabletView,
|
|
173
|
+
isDesktopView,
|
|
174
|
+
isLargeDesktopView,
|
|
175
|
+
isSmallScreen,
|
|
176
|
+
}),
|
|
177
|
+
[isMobileView, isSmallTabletView, isTabletView, isDesktopView, isLargeDesktopView, isSmallScreen],
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
return (
|
|
181
|
+
<>
|
|
182
|
+
{/* Main Container */}
|
|
183
|
+
<div className="flex flex-col h-screen overflow-hidden">
|
|
184
|
+
{/* Header with Design/Interact/Code tabs - now inside main container */}
|
|
185
|
+
{channelId && (
|
|
186
|
+
<div className="flex-shrink-0 bg-white ">
|
|
187
|
+
<div className="flex items-center justify-between px-4 py-3">
|
|
188
|
+
<div className="flex items-center">
|
|
189
|
+
{/* Show tabs only on larger screens */}
|
|
190
|
+
{!isSmallScreen && (
|
|
191
|
+
<div className="flex bg-gray-100 p-2" style={{ borderRadius: '10px' }}>
|
|
192
|
+
<button
|
|
193
|
+
onClick={() => setActiveTab('preview')}
|
|
194
|
+
className={`flex items-center space-x-2 px-4 py-2 text-xs font-medium transition-all duration-200 ${
|
|
195
|
+
activeTab === 'preview'
|
|
196
|
+
? 'bg-blue-500 text-white shadow-sm'
|
|
197
|
+
: 'text-gray-600 hover:text-gray-900'
|
|
198
|
+
}`}
|
|
199
|
+
style={{ borderRadius: '10px' }}
|
|
200
|
+
>
|
|
201
|
+
<svg
|
|
202
|
+
className="w-4 h-4"
|
|
203
|
+
fill="none"
|
|
204
|
+
stroke="currentColor"
|
|
205
|
+
viewBox="0 0 24 24"
|
|
206
|
+
>
|
|
207
|
+
<path
|
|
208
|
+
strokeLinecap="round"
|
|
209
|
+
strokeLinejoin="round"
|
|
210
|
+
strokeWidth={2}
|
|
211
|
+
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
212
|
+
/>
|
|
213
|
+
<path
|
|
214
|
+
strokeLinecap="round"
|
|
215
|
+
strokeLinejoin="round"
|
|
216
|
+
strokeWidth={2}
|
|
217
|
+
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"
|
|
218
|
+
/>
|
|
219
|
+
</svg>
|
|
220
|
+
<span>Preview</span>
|
|
221
|
+
</button>
|
|
222
|
+
<button
|
|
223
|
+
onClick={() => setActiveTab('code')}
|
|
224
|
+
className={`flex items-center space-x-2 px-4 py-2 text-xs font-medium transition-all duration-200 ${
|
|
225
|
+
activeTab === 'code'
|
|
226
|
+
? 'bg-blue-500 text-white shadow-sm'
|
|
227
|
+
: 'text-gray-600 hover:text-gray-900'
|
|
228
|
+
}`}
|
|
229
|
+
style={{ borderRadius: '10px' }}
|
|
230
|
+
>
|
|
231
|
+
<svg
|
|
232
|
+
className="w-4 h-4"
|
|
233
|
+
fill="none"
|
|
234
|
+
stroke="currentColor"
|
|
235
|
+
viewBox="0 24 24"
|
|
236
|
+
>
|
|
237
|
+
<path
|
|
238
|
+
strokeLinecap="round"
|
|
239
|
+
strokeLinejoin="round"
|
|
240
|
+
strokeWidth={2}
|
|
241
|
+
d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"
|
|
242
|
+
/>
|
|
243
|
+
</svg>
|
|
244
|
+
<span>Code</span>
|
|
245
|
+
</button>
|
|
246
|
+
</div>
|
|
247
|
+
)}
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
{/* Refresh icon on the right - hidden on mobile */}
|
|
251
|
+
{isDesktopView && (
|
|
252
|
+
<button
|
|
253
|
+
onClick={() => handleRefreshSandbox()}
|
|
254
|
+
className="p-2 text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded-lg transition-colors"
|
|
255
|
+
title="Refresh Sandbox"
|
|
256
|
+
>
|
|
257
|
+
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
258
|
+
<path
|
|
259
|
+
strokeLinecap="round"
|
|
260
|
+
strokeLinejoin="round"
|
|
261
|
+
strokeWidth={2}
|
|
262
|
+
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"
|
|
263
|
+
/>
|
|
264
|
+
</svg>
|
|
265
|
+
</button>
|
|
266
|
+
)}
|
|
267
|
+
</div>
|
|
268
|
+
</div>
|
|
269
|
+
)}
|
|
270
|
+
|
|
271
|
+
{/* Content Grid - ContentComponent and RightSidebar */}
|
|
272
|
+
<div
|
|
273
|
+
className="flex-1 grid overflow-hidden"
|
|
274
|
+
style={{
|
|
275
|
+
gridTemplateColumns: isDesktopView ? '35% 65%' : '1fr',
|
|
276
|
+
height: 'calc(100vh - 80px)', // Subtract header height
|
|
277
|
+
}}
|
|
278
|
+
>
|
|
279
|
+
{/* Main Content Area - 35% width on desktop */}
|
|
280
|
+
<div
|
|
281
|
+
className={`
|
|
282
|
+
${isMobileView && !channelId ? 'hidden' : 'flex'}
|
|
283
|
+
flex flex-col overflow-hidden transition-all duration-300 ease-in-out
|
|
284
|
+
`}
|
|
285
|
+
style={{ paddingTop: '15px' }}
|
|
286
|
+
>
|
|
287
|
+
{channelId ? (
|
|
288
|
+
<ContentComponent
|
|
289
|
+
channelId={channelId}
|
|
290
|
+
{...props}
|
|
291
|
+
messages={messages}
|
|
292
|
+
setMessages={setMessages}
|
|
293
|
+
selectedPost={selectedPost}
|
|
294
|
+
setSelectedPost={setSelectedPost}
|
|
295
|
+
setIsLoading={setIsLoading}
|
|
296
|
+
isLoading={isLoading}
|
|
297
|
+
/>
|
|
298
|
+
) : (
|
|
299
|
+
<EmptyState />
|
|
300
|
+
)}
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
{/* Right Sidebar - 65% width on desktop only */}
|
|
304
|
+
{channelId && isDesktopView && (
|
|
305
|
+
<div
|
|
306
|
+
className="overflow-hidden border"
|
|
307
|
+
style={{ marginBottom: 10, marginRight: 10, borderRadius: 10 }}
|
|
308
|
+
>
|
|
309
|
+
<RightSidebarContent
|
|
310
|
+
detailSidebarOptions={detailSidebarOptions}
|
|
311
|
+
windowWidth={windowWidth}
|
|
312
|
+
windowHeight={windowHeight}
|
|
313
|
+
activeTab={activeTab}
|
|
314
|
+
channelId={channelId}
|
|
315
|
+
messages={messages}
|
|
316
|
+
selectedPost={selectedPost}
|
|
317
|
+
setIsLoading={setIsLoading}
|
|
318
|
+
isLoading={isLoading}
|
|
319
|
+
{...props}
|
|
320
|
+
/>
|
|
321
|
+
</div>
|
|
322
|
+
)}
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
</>
|
|
326
|
+
);
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
const ContentComponent = React.memo((props: any) => {
|
|
330
|
+
const { channelId, messages, setMessages, selectedPost, setSelectedPost, setIsLoading, isLoading } = props;
|
|
331
|
+
|
|
332
|
+
return (
|
|
333
|
+
<div className="flex overflow-hidden h-full">
|
|
334
|
+
{/* Main Chat Content */}
|
|
335
|
+
<div className="flex-1 flex flex-col min-w-0 overflow-hidden border-t border-gray-300">
|
|
336
|
+
{/* Content based on postId */}
|
|
337
|
+
<div className="flex-1 flex flex-col min-h-0 overflow-hidden">
|
|
338
|
+
{channelId && (
|
|
339
|
+
<>
|
|
340
|
+
<MessagesComponent
|
|
341
|
+
{...props}
|
|
342
|
+
channelId={channelId}
|
|
343
|
+
messages={messages}
|
|
344
|
+
setMessages={setMessages}
|
|
345
|
+
selectedPost={selectedPost}
|
|
346
|
+
setSelectedPost={setSelectedPost}
|
|
347
|
+
setIsLoading={setIsLoading}
|
|
348
|
+
isLoading={isLoading}
|
|
349
|
+
/>
|
|
350
|
+
</>
|
|
351
|
+
)}
|
|
352
|
+
</div>
|
|
353
|
+
</div>
|
|
354
|
+
</div>
|
|
355
|
+
);
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
const RightSidebarWrapper = React.memo(({ detailSidebarOptions }: any) => {
|
|
359
|
+
const { activeTab } = useContext(TabContext);
|
|
360
|
+
return (
|
|
361
|
+
<div className="h-full flex flex-col overflow-hidden bg-white">
|
|
362
|
+
{/* Content Area */}
|
|
363
|
+
<div className="flex-1 overflow-hidden">
|
|
364
|
+
{activeTab === 'preview' ? (
|
|
365
|
+
<div className="h-full flex items-center justify-center bg-gray-50">
|
|
366
|
+
<div className="text-center">
|
|
367
|
+
{/* Preview Icon */}
|
|
368
|
+
<div className="mb-8">
|
|
369
|
+
<svg
|
|
370
|
+
className="w-32 h-32 mx-auto text-blue-500"
|
|
371
|
+
fill="none"
|
|
372
|
+
stroke="currentColor"
|
|
373
|
+
viewBox="0 0 24 24"
|
|
374
|
+
>
|
|
375
|
+
<path
|
|
376
|
+
strokeLinecap="round"
|
|
377
|
+
strokeLinejoin="round"
|
|
378
|
+
strokeWidth={1}
|
|
379
|
+
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
380
|
+
/>
|
|
381
|
+
<path
|
|
382
|
+
strokeLinecap="round"
|
|
383
|
+
strokeLinejoin="round"
|
|
384
|
+
strokeWidth={1}
|
|
385
|
+
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"
|
|
386
|
+
/>
|
|
387
|
+
</svg>
|
|
388
|
+
</div>
|
|
389
|
+
|
|
390
|
+
<div className="space-y-4 text-gray-600">
|
|
391
|
+
<h3 className="text-lg font-semibold text-gray-900">Preview Mode</h3>
|
|
392
|
+
<p className="font-mono text-sm bg-blue-100 px-3 py-1 rounded">
|
|
393
|
+
Live preview and testing
|
|
394
|
+
</p>
|
|
395
|
+
<p>Preview and test your components in real-time.</p>
|
|
396
|
+
</div>
|
|
397
|
+
|
|
398
|
+
<div className="mt-8 space-y-4">
|
|
399
|
+
<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">
|
|
400
|
+
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
|
|
401
|
+
<path d="M8 5v14l11-7z" />
|
|
402
|
+
</svg>
|
|
403
|
+
<span>Start Preview</span>
|
|
404
|
+
</button>
|
|
405
|
+
<p className="text-sm text-gray-500 underline cursor-pointer hover:text-gray-700">
|
|
406
|
+
Learn about preview mode
|
|
407
|
+
</p>
|
|
408
|
+
</div>
|
|
409
|
+
</div>
|
|
410
|
+
</div>
|
|
411
|
+
) : (
|
|
412
|
+
<div className="h-full bg-gray-900 text-gray-300 p-4 overflow-auto">
|
|
413
|
+
<div className="font-mono text-sm">
|
|
414
|
+
<div className="mb-4">
|
|
415
|
+
<div className="text-green-400">// app/page.tsx</div>
|
|
416
|
+
</div>
|
|
417
|
+
<div className="space-y-2">
|
|
418
|
+
<div>
|
|
419
|
+
<span className="text-purple-400">export</span>{' '}
|
|
420
|
+
<span className="text-purple-400">default</span>{' '}
|
|
421
|
+
<span className="text-blue-400">function</span>{' '}
|
|
422
|
+
<span className="text-yellow-400">Home</span>() {'{'}
|
|
423
|
+
</div>
|
|
424
|
+
<div className="ml-4">
|
|
425
|
+
<span className="text-purple-400">return</span> (
|
|
426
|
+
</div>
|
|
427
|
+
<div className="ml-8">
|
|
428
|
+
{'<'}
|
|
429
|
+
<span className="text-red-400">main</span>{' '}
|
|
430
|
+
<span className="text-green-400">className</span>=
|
|
431
|
+
<span className="text-yellow-400">
|
|
432
|
+
"flex min-h-screen flex-col items-center justify-between p-24"
|
|
433
|
+
</span>
|
|
434
|
+
{'>'}
|
|
435
|
+
</div>
|
|
436
|
+
<div className="ml-12">
|
|
437
|
+
{'<'}
|
|
438
|
+
<span className="text-red-400">div</span>{' '}
|
|
439
|
+
<span className="text-green-400">className</span>=
|
|
440
|
+
<span className="text-yellow-400">
|
|
441
|
+
"z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex"
|
|
442
|
+
</span>
|
|
443
|
+
{'>'}
|
|
444
|
+
</div>
|
|
445
|
+
<div className="ml-16">
|
|
446
|
+
{'<'}
|
|
447
|
+
<span className="text-red-400">p</span>{' '}
|
|
448
|
+
<span className="text-green-400">className</span>=
|
|
449
|
+
<span className="text-yellow-400">
|
|
450
|
+
"fixed left-0 top-0 flex w-full justify-center border-b border-gray-300
|
|
451
|
+
bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl
|
|
452
|
+
dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static
|
|
453
|
+
lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30"
|
|
454
|
+
</span>
|
|
455
|
+
{'>'}
|
|
456
|
+
</div>
|
|
457
|
+
<div className="ml-20 text-gray-400">Get started by editing </div>
|
|
458
|
+
<div className="ml-20">
|
|
459
|
+
{'<'}
|
|
460
|
+
<span className="text-red-400">code</span>{' '}
|
|
461
|
+
<span className="text-green-400">className</span>=
|
|
462
|
+
<span className="text-yellow-400">"font-mono font-bold"</span>
|
|
463
|
+
{'>'}app/page.tsx{'</'}
|
|
464
|
+
<span className="text-red-400">code</span>
|
|
465
|
+
{'>'}
|
|
466
|
+
</div>
|
|
467
|
+
<div className="ml-16">
|
|
468
|
+
{'</'}
|
|
469
|
+
<span className="text-red-400">p</span>
|
|
470
|
+
{'>'}
|
|
471
|
+
</div>
|
|
472
|
+
<div className="ml-12">
|
|
473
|
+
{'</'}
|
|
474
|
+
<span className="text-red-400">div</span>
|
|
475
|
+
{'>'}
|
|
476
|
+
</div>
|
|
477
|
+
<div className="ml-8">
|
|
478
|
+
{'</'}
|
|
479
|
+
<span className="text-red-400">main</span>
|
|
480
|
+
{'>'}
|
|
481
|
+
</div>
|
|
482
|
+
<div className="ml-4">);</div>
|
|
483
|
+
<div>{'}'}</div>
|
|
484
|
+
</div>
|
|
485
|
+
</div>
|
|
486
|
+
</div>
|
|
487
|
+
)}
|
|
488
|
+
</div>
|
|
489
|
+
</div>
|
|
490
|
+
);
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
const RightSidebarContent = React.memo(
|
|
494
|
+
({ detailSidebarOptions, windowWidth, windowHeight, channelId, setIsLoading, isLoading, ...props }: any) => {
|
|
495
|
+
const { activeTab } = useContext(TabContext);
|
|
496
|
+
|
|
497
|
+
return (
|
|
498
|
+
<div
|
|
499
|
+
className="border-l border-gray-200 bg-white flex-shrink-0 overflow-hidden"
|
|
500
|
+
style={{
|
|
501
|
+
// width: `${windowWidth * 0.35}px`, // 35% of window width
|
|
502
|
+
height: `${windowHeight}px`,
|
|
503
|
+
maxHeight: '100vh',
|
|
504
|
+
}}
|
|
505
|
+
>
|
|
506
|
+
<RightSidebarAi
|
|
507
|
+
detailSidebarOptions={detailSidebarOptions}
|
|
508
|
+
windowWidth={windowWidth}
|
|
509
|
+
windowHeight={windowHeight}
|
|
510
|
+
activeTab={activeTab}
|
|
511
|
+
channelId={channelId}
|
|
512
|
+
setIsLoading={setIsLoading}
|
|
513
|
+
isLoading={isLoading}
|
|
514
|
+
{...props}
|
|
515
|
+
/>
|
|
516
|
+
</div>
|
|
517
|
+
);
|
|
518
|
+
},
|
|
519
|
+
);
|
|
520
|
+
|
|
521
|
+
const MessagesComponent = React.memo((props: any) => {
|
|
522
|
+
return <Outlet context={{ ...props, app: 'app' }} />;
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
// Display names for debugging
|
|
526
|
+
InboxWithAi.displayName = 'Inbox';
|
|
527
|
+
InboxWithAiInternal.displayName = 'InboxWithAiInternal';
|
|
528
|
+
ContentComponent.displayName = 'ContentComponent';
|
|
529
|
+
MessagesComponent.displayName = 'MessagesComponent';
|
|
530
|
+
RightSidebarWrapper.displayName = 'RightSidebarWrapper';
|
|
531
|
+
RightSidebarContent.displayName = 'RightSidebarContent';
|
|
532
|
+
|
|
533
|
+
export default React.memo(InboxWithAi);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as InboxWithAi } from './InboxWithAi';
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": "./src",
|
|
5
|
+
"outDir": "lib",
|
|
6
|
+
"declarationDir": "lib",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"types": ["@types/node", "@types/jest", "../../../typings"]
|
|
11
|
+
},
|
|
12
|
+
"exclude": ["../../../node_modules", "node_modules", "lib", "dist", "webpack.config.js", "rollup.config.mjs"],
|
|
13
|
+
"include": ["src", "./typings/*.d.ts", "type.d.ts"]
|
|
14
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
+
const nodeExternals = require('webpack-node-externals');
|
|
3
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
|
+
const webpack = require('webpack');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
const webpackOpts = {
|
|
8
|
+
mode: 'development',
|
|
9
|
+
entry: {
|
|
10
|
+
index: './src/index.ts',
|
|
11
|
+
},
|
|
12
|
+
target: 'node',
|
|
13
|
+
output: {
|
|
14
|
+
path: path.join(__dirname, 'lib'),
|
|
15
|
+
filename: '[name].js',
|
|
16
|
+
libraryTarget: 'commonjs2',
|
|
17
|
+
},
|
|
18
|
+
resolve: {
|
|
19
|
+
extensions: [
|
|
20
|
+
'.js',
|
|
21
|
+
'.jsx',
|
|
22
|
+
'.ts',
|
|
23
|
+
'.tsx',
|
|
24
|
+
'.graphql',
|
|
25
|
+
'.graphqls',
|
|
26
|
+
'.gql',
|
|
27
|
+
'.native.tsx',
|
|
28
|
+
'.native.ts',
|
|
29
|
+
'.json',
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
plugins: [
|
|
33
|
+
new webpack.LoaderOptionsPlugin({
|
|
34
|
+
options: {
|
|
35
|
+
test: /\.tsx?$/,
|
|
36
|
+
ts: {
|
|
37
|
+
compiler: 'typescript',
|
|
38
|
+
configFile: 'tsconfig.json',
|
|
39
|
+
},
|
|
40
|
+
tslint: {
|
|
41
|
+
emitErrors: true,
|
|
42
|
+
failOnHint: true,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
47
|
+
devtool: 'source-map',
|
|
48
|
+
module: {
|
|
49
|
+
rules: [
|
|
50
|
+
{
|
|
51
|
+
test: /\.(tsx)?$/,
|
|
52
|
+
use: 'ts-loader',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
test: /\.mjs$/,
|
|
56
|
+
include: /node_modules/,
|
|
57
|
+
type: 'javascript/auto',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
test: /\.(gql)$/,
|
|
61
|
+
exclude: /node_modules/,
|
|
62
|
+
use: ['graphql-tag/loader'],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
test: /\.graphql?/,
|
|
66
|
+
exclude: /node_modules/,
|
|
67
|
+
use: 'raw-loader',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
test: /\.(png|jpg|gif|webp)$/i,
|
|
71
|
+
use: {
|
|
72
|
+
loader: 'url-loader',
|
|
73
|
+
options: {
|
|
74
|
+
limit: 8192,
|
|
75
|
+
name: 'static/media/[name].[hash:8].[ext]',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
test: /\.svg$/,
|
|
81
|
+
use: ['@svgr/webpack'],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
test: /\.json$/,
|
|
85
|
+
loader: 'json-loader',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
externals: [nodeExternals({ modulesDir: '../../../node_modules' }), nodeExternals()],
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
module.exports = webpackOpts;
|