@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,91 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { useUpdateSandboxFileMutation, useFileUpdatedSubscription } from 'common/graphql';
|
|
3
|
+
|
|
4
|
+
export interface FileSyncHookProps {
|
|
5
|
+
projectId: string;
|
|
6
|
+
messageId?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface FileSyncResult {
|
|
10
|
+
updateFile: (filePath: string, content: string) => Promise<void>;
|
|
11
|
+
isUpdating: boolean;
|
|
12
|
+
error: string | null;
|
|
13
|
+
lastUpdate: {
|
|
14
|
+
filePath: string;
|
|
15
|
+
operation: string;
|
|
16
|
+
timestamp: string;
|
|
17
|
+
} | null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const useFileSync = ({ projectId, messageId }: FileSyncHookProps): FileSyncResult => {
|
|
21
|
+
const [isUpdating, setIsUpdating] = useState(false);
|
|
22
|
+
const [error, setError] = useState<string | null>(null);
|
|
23
|
+
const [lastUpdate, setLastUpdate] = useState<{
|
|
24
|
+
filePath: string;
|
|
25
|
+
operation: string;
|
|
26
|
+
timestamp: string;
|
|
27
|
+
} | null>(null);
|
|
28
|
+
|
|
29
|
+
// GraphQL mutations
|
|
30
|
+
const [updateSandboxFileMutation] = useUpdateSandboxFileMutation();
|
|
31
|
+
|
|
32
|
+
// Real-time file updates subscription
|
|
33
|
+
const { data: fileUpdateData } = useFileUpdatedSubscription({
|
|
34
|
+
variables: { projectId },
|
|
35
|
+
skip: !projectId,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Handle real-time file updates
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (fileUpdateData?.fileUpdated) {
|
|
41
|
+
const update = fileUpdateData.fileUpdated;
|
|
42
|
+
setLastUpdate({
|
|
43
|
+
filePath: update.filePath,
|
|
44
|
+
operation: update.operation,
|
|
45
|
+
timestamp: update.timestamp,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}, [fileUpdateData]);
|
|
49
|
+
|
|
50
|
+
const updateFile = useCallback(
|
|
51
|
+
async (filePath: string, content: string) => {
|
|
52
|
+
if (!messageId) {
|
|
53
|
+
throw new Error('Fragment ID is required for file operations');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
console.log('useFileSync.updateFile - Using fragmentId:', messageId);
|
|
57
|
+
|
|
58
|
+
try {
|
|
59
|
+
setIsUpdating(true);
|
|
60
|
+
setError(null);
|
|
61
|
+
|
|
62
|
+
const response = await updateSandboxFileMutation({
|
|
63
|
+
variables: {
|
|
64
|
+
projectId,
|
|
65
|
+
messageId,
|
|
66
|
+
filePath,
|
|
67
|
+
content,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
if (!response.data?.updateSandboxFile.success) {
|
|
72
|
+
throw new Error(response.data?.updateSandboxFile.message || 'Failed to update file');
|
|
73
|
+
}
|
|
74
|
+
} catch (err) {
|
|
75
|
+
const errorMessage = err instanceof Error ? err.message : 'Unknown error occurred';
|
|
76
|
+
setError(errorMessage);
|
|
77
|
+
throw err;
|
|
78
|
+
} finally {
|
|
79
|
+
setIsUpdating(false);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
[updateSandboxFileMutation, projectId, messageId],
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
updateFile,
|
|
87
|
+
isUpdating,
|
|
88
|
+
error,
|
|
89
|
+
lastUpdate,
|
|
90
|
+
};
|
|
91
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ProviderId = 'openai' | 'anthropic' | 'gemini';
|
|
4
|
+
|
|
5
|
+
export interface ModelConfig {
|
|
6
|
+
provider: ProviderId;
|
|
7
|
+
model: string;
|
|
8
|
+
apiKey: string;
|
|
9
|
+
template: 'react-vite' | 'nextjs' | 'vue' | 'vite-react';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const STORAGE_KEY = 'mbx:model-config';
|
|
13
|
+
|
|
14
|
+
function loadFromStorage(): ModelConfig | null {
|
|
15
|
+
try {
|
|
16
|
+
const raw = typeof window !== 'undefined' ? window.localStorage.getItem(STORAGE_KEY) : null;
|
|
17
|
+
if (!raw) return null;
|
|
18
|
+
const parsed = JSON.parse(raw);
|
|
19
|
+
return parsed as ModelConfig;
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function saveToStorage(config: ModelConfig) {
|
|
26
|
+
try {
|
|
27
|
+
if (typeof window !== 'undefined') {
|
|
28
|
+
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(config));
|
|
29
|
+
}
|
|
30
|
+
} catch {
|
|
31
|
+
// ignore
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const DEFAULTS: ModelConfig = {
|
|
36
|
+
provider: 'anthropic',
|
|
37
|
+
model: 'claude-3-5-sonnet-20241022',
|
|
38
|
+
apiKey: '',
|
|
39
|
+
template: 'react-vite',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export function usePersistentModelConfig() {
|
|
43
|
+
const [modelConfig, setModelConfig] = useState<ModelConfig>(() => loadFromStorage() || DEFAULTS);
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
saveToStorage(modelConfig);
|
|
47
|
+
}, [modelConfig]);
|
|
48
|
+
|
|
49
|
+
const updateModelConfig = useCallback((newConfig: ModelConfig) => {
|
|
50
|
+
setModelConfig(newConfig);
|
|
51
|
+
}, []);
|
|
52
|
+
|
|
53
|
+
const hasApiKey = useMemo(() => Boolean(modelConfig.apiKey && modelConfig.apiKey.trim().length > 0), [modelConfig]);
|
|
54
|
+
|
|
55
|
+
const getValidatedConfig = useCallback(() => {
|
|
56
|
+
if (!hasApiKey) return null;
|
|
57
|
+
return modelConfig;
|
|
58
|
+
}, [hasApiKey, modelConfig]);
|
|
59
|
+
|
|
60
|
+
return { modelConfig, updateModelConfig, getValidatedConfig, hasApiKey };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default usePersistentModelConfig;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { default } from './module';
|
|
2
|
+
export { ChatMessageFill } from './module';
|
|
3
|
+
export {
|
|
4
|
+
Inbox,
|
|
5
|
+
Threads,
|
|
6
|
+
ThreadMessages,
|
|
7
|
+
ServiceInbox,
|
|
8
|
+
InboxWithLoader,
|
|
9
|
+
InboxWithAiLoader,
|
|
10
|
+
InboxAiMessagesLoader,
|
|
11
|
+
InboxContainer,
|
|
12
|
+
AiLandingInput,
|
|
13
|
+
} from './container';
|
|
14
|
+
export {
|
|
15
|
+
MessageSliceRenderer,
|
|
16
|
+
Messages,
|
|
17
|
+
Popover,
|
|
18
|
+
MessageInput,
|
|
19
|
+
CommonMessage,
|
|
20
|
+
UploadImageButton,
|
|
21
|
+
MessageItem,
|
|
22
|
+
LeftSidebar,
|
|
23
|
+
FilesList,
|
|
24
|
+
ConversationItem,
|
|
25
|
+
UserModalContent,
|
|
26
|
+
ServiceInboxItem,
|
|
27
|
+
AIAgent,
|
|
28
|
+
ModelConfigPanel,
|
|
29
|
+
RightSidebarAi,
|
|
30
|
+
InputComponent,
|
|
31
|
+
RightSidebarFillDefault,
|
|
32
|
+
} from './components';
|
|
33
|
+
export { InboxWithAi } from './templates';
|
|
34
|
+
export type { CardMessageAttachmentsInterface, AlertMessageAttachmentsInterface } from './interfaces';
|
|
35
|
+
export * from './enums';
|
|
36
|
+
export * from './machines';
|
|
37
|
+
export * from './hooks';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CardMessageAttachmentsInterface, AlertMessageAttachmentsInterface } from './message-widgets.interface';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface AlertMessageAttachmentsInterface {
|
|
2
|
+
title: string;
|
|
3
|
+
isTitleHtml: boolean;
|
|
4
|
+
icon: string;
|
|
5
|
+
callToAction: {
|
|
6
|
+
title: string;
|
|
7
|
+
link: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface CardMessageAttachmentsInterface {
|
|
12
|
+
image: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
isTitleHtml?: string;
|
|
15
|
+
description: string;
|
|
16
|
+
isDescriptionHtml: boolean;
|
|
17
|
+
callToAction: {
|
|
18
|
+
title: string;
|
|
19
|
+
link: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createMachine, assign } from 'xstate';
|
|
2
|
+
import { AIAgentContext, AIAgentEvent, Message } from './types';
|
|
3
|
+
|
|
4
|
+
export const aiAgentMachine = createMachine(
|
|
5
|
+
{
|
|
6
|
+
id: 'aiAgentSimple',
|
|
7
|
+
types: {} as {
|
|
8
|
+
context: AIAgentContext;
|
|
9
|
+
events: AIAgentEvent;
|
|
10
|
+
},
|
|
11
|
+
initial: 'idle',
|
|
12
|
+
context: {
|
|
13
|
+
messages: [],
|
|
14
|
+
currentInput: '',
|
|
15
|
+
error: null,
|
|
16
|
+
isTyping: false,
|
|
17
|
+
regularMessages: [],
|
|
18
|
+
},
|
|
19
|
+
states: {
|
|
20
|
+
idle: {
|
|
21
|
+
on: {
|
|
22
|
+
SEND_MESSAGE: {
|
|
23
|
+
target: 'idle',
|
|
24
|
+
guard: 'hasValidMessage',
|
|
25
|
+
actions: 'addUserMessage',
|
|
26
|
+
},
|
|
27
|
+
INPUT_CHANGE: {
|
|
28
|
+
actions: 'updateInput',
|
|
29
|
+
},
|
|
30
|
+
CLEAR_ERROR: {
|
|
31
|
+
actions: 'clearError',
|
|
32
|
+
},
|
|
33
|
+
UPDATE_REGULAR_MESSAGES: {
|
|
34
|
+
actions: 'updateRegularMessages',
|
|
35
|
+
},
|
|
36
|
+
// Tolerate legacy events as no-ops
|
|
37
|
+
AUTO_RESPOND_TO_MESSAGE: {},
|
|
38
|
+
RETRY: {},
|
|
39
|
+
CONTINUE_PROCESSING: {},
|
|
40
|
+
UPDATE: {
|
|
41
|
+
actions: 'mergeUpdate',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
guards: {
|
|
49
|
+
hasValidMessage: ({ event }) => {
|
|
50
|
+
if (event.type === 'SEND_MESSAGE') {
|
|
51
|
+
return Boolean(event.message && event.message.trim().length > 0);
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
actions: {
|
|
57
|
+
addUserMessage: assign(({ context, event }) => {
|
|
58
|
+
if (event.type !== 'SEND_MESSAGE') return context;
|
|
59
|
+
const newMessage: Message = {
|
|
60
|
+
id: Date.now().toString(),
|
|
61
|
+
content: event.message,
|
|
62
|
+
sender: 'user',
|
|
63
|
+
timestamp: new Date(),
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
...context,
|
|
67
|
+
messages: [...context.messages, newMessage],
|
|
68
|
+
currentInput: '',
|
|
69
|
+
error: null,
|
|
70
|
+
};
|
|
71
|
+
}),
|
|
72
|
+
updateInput: assign(({ context, event }) => {
|
|
73
|
+
if (event.type !== 'INPUT_CHANGE') return context;
|
|
74
|
+
return { ...context, currentInput: event.value };
|
|
75
|
+
}),
|
|
76
|
+
updateRegularMessages: assign(({ context, event }) => {
|
|
77
|
+
if (event.type !== 'UPDATE_REGULAR_MESSAGES') return context;
|
|
78
|
+
return { ...context, regularMessages: event.messages || [] };
|
|
79
|
+
}),
|
|
80
|
+
clearError: assign(({ context }) => ({ ...context, error: null })),
|
|
81
|
+
mergeUpdate: assign(({ context, event }) => {
|
|
82
|
+
// Supports events like { type: 'UPDATE', value: { messages: [] } }
|
|
83
|
+
if (event.type !== 'UPDATE') return context as any;
|
|
84
|
+
const value = (event as any).value || {};
|
|
85
|
+
return { ...context, ...value } as any;
|
|
86
|
+
}),
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
);
|