From 22a0848d58e3a758d85d93d9204a72a65854ea94 Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Thu, 22 Aug 2024 15:17:59 -0700 Subject: [PATCH] Migrate embed to submodule of main repo --- .gitignore | 25 + LICENSE | 21 + README.md | 112 + index.html | 17 + jsconfig.json | 10 + package.json | 51 + postcss.config.js | 10 + scripts/updateHljs.mjs | 35 + src/App.jsx | 71 + src/assets/anything-llm-dark.png | Bin 0 -> 8413 bytes src/assets/anything-llm-icon.svg | 5 + .../HistoricalMessage/Actions/index.jsx | 43 + .../ChatHistory/HistoricalMessage/index.jsx | 97 + .../ChatHistory/PromptReply/index.jsx | 111 + .../ChatContainer/ChatHistory/index.jsx | 163 + .../ChatContainer/PromptInput/index.jsx | 102 + .../ChatWindow/ChatContainer/index.jsx | 145 + src/components/ChatWindow/Header/index.jsx | 155 + src/components/ChatWindow/index.jsx | 99 + src/components/Head.jsx | 131 + src/components/OpenButton/index.jsx | 35 + src/components/ResetChat/index.jsx | 20 + src/components/SessionId/index.jsx | 12 + src/components/Sponsor/index.jsx | 17 + src/hooks/chat/useChatHistory.js | 27 + src/hooks/useOpen.js | 16 + src/hooks/useScriptAttributes.js | 104 + src/hooks/useSessionId.js | 29 + src/index.css | 32 + src/main.jsx | 31 + src/models/chatService.js | 109 + src/utils/chat/hljs.js | 88 + src/utils/chat/index.js | 96 + src/utils/chat/markdown.js | 49 + src/utils/constants.js | 15 + src/utils/date.js | 9 + tailwind.config.js | 103 + vite.config.js | 68 + yarn.lock | 3430 +++++++++++++++++ 39 files changed, 5693 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 index.html create mode 100644 jsconfig.json create mode 100644 package.json create mode 100644 postcss.config.js create mode 100644 scripts/updateHljs.mjs create mode 100644 src/App.jsx create mode 100644 src/assets/anything-llm-dark.png create mode 100644 src/assets/anything-llm-icon.svg create mode 100644 src/components/ChatWindow/ChatContainer/ChatHistory/HistoricalMessage/Actions/index.jsx create mode 100644 src/components/ChatWindow/ChatContainer/ChatHistory/HistoricalMessage/index.jsx create mode 100644 src/components/ChatWindow/ChatContainer/ChatHistory/PromptReply/index.jsx create mode 100644 src/components/ChatWindow/ChatContainer/ChatHistory/index.jsx create mode 100644 src/components/ChatWindow/ChatContainer/PromptInput/index.jsx create mode 100644 src/components/ChatWindow/ChatContainer/index.jsx create mode 100644 src/components/ChatWindow/Header/index.jsx create mode 100644 src/components/ChatWindow/index.jsx create mode 100644 src/components/Head.jsx create mode 100644 src/components/OpenButton/index.jsx create mode 100644 src/components/ResetChat/index.jsx create mode 100644 src/components/SessionId/index.jsx create mode 100644 src/components/Sponsor/index.jsx create mode 100644 src/hooks/chat/useChatHistory.js create mode 100644 src/hooks/useOpen.js create mode 100644 src/hooks/useScriptAttributes.js create mode 100644 src/hooks/useSessionId.js create mode 100644 src/index.css create mode 100644 src/main.jsx create mode 100644 src/models/chatService.js create mode 100644 src/utils/chat/hljs.js create mode 100644 src/utils/chat/index.js create mode 100644 src/utils/chat/markdown.js create mode 100644 src/utils/constants.js create mode 100644 src/utils/date.js create mode 100644 tailwind.config.js create mode 100644 vite.config.js create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d3751d --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +!yarn.lock +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..cc42d1d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) Mintplex Labs Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..36c0ba3 --- /dev/null +++ b/README.md @@ -0,0 +1,112 @@ +# AnythingLLM Embedded Chat Widget + +**This is a submodule of [AnythingLLM](https://github.com/Mintplex-Labs/anything-llm) - the all-in-one AI Application** + +**Please report any issues or feature requests to the [main repo](https://github.com/Mintplex-Labs/anything-llm)** + +> [!WARNING] +> The core AnythingLLM team publishes a pre-built version of the script that is bundled +> with the main application. You can find [it in the main repo here.](https://github.com/Mintplex-Labs/anything-llm/tree/master/frontend/public/embed) +> You should only be working in this repo if you are wanting to build your own custom embed widget for AnythingLLM + +This folder of AnythingLLM contains the source code for how the embedded version of AnythingLLM works to provide a public facing interface of your workspace. + +The AnythingLLM Embedded chat widget allows you to expose a workspace and its embedded knowledge base as a chat bubble via a ` +``` + +### `