Skip to content

Commit

Permalink
Merge pull request #3 from sirsimonson/main
Browse files Browse the repository at this point in the history
Sync Fork in GitLab
  • Loading branch information
sirsimonson committed Dec 4, 2023
2 parents 555b5b6 + ed7344c commit 7d09279
Show file tree
Hide file tree
Showing 68 changed files with 1,944 additions and 1,420 deletions.
18 changes: 18 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

set -e # Exit on any error

echo "Running ESLint for linting..."
npm run lint

echo "Running ESLint for fixing issues..."
npm run lint-fix

echo "Formatting code..."
npm run format

echo "Checking formatting..."
npm run format:check

echo "Pre-commit checks passed."
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
build
dist
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 150,
"endOfLine": "lf"
}
69 changes: 34 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ yarn build

```html
<script type="module">
import Chatbot from "https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js";
import Chatbot from 'https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js';
Chatbot.init({
chatflowid: "<chatflowid>",
apiHost: "http://localhost:3000",
chatflowid: '<chatflowid>',
apiHost: 'http://localhost:3000',
});
</script>
```
Expand All @@ -42,10 +42,10 @@ yarn build

```html
<script type="module">
import Chatbot from "./web.js";
import Chatbot from './web.js';
Chatbot.initFull({
chatflowid: "<chatflowid>",
apiHost: "http://localhost:3000",
chatflowid: '<chatflowid>',
apiHost: 'http://localhost:3000',
});
</script>
<flowise-fullchatbot></flowise-fullchatbot>
Expand All @@ -56,17 +56,17 @@ To enable full screen, add `margin: 0` to <code>body</code> style, and confirm y
```html
<body style="margin: 0">
<script type="module">
import Chatbot from "./web.js";
import Chatbot from './web.js';
Chatbot.initFull({
chatflowid: "<chatflowid>",
apiHost: "http://localhost:3000",
chatflowid: '<chatflowid>',
apiHost: 'http://localhost:3000',
theme: {
chatWindow: {
// height: 700, don't set height
// width: 400, don't set width
}
}
});
},
},
});
</script>
</body>
```
Expand All @@ -77,49 +77,48 @@ You can also customize chatbot with different configuration

```html
<script type="module">
import Chatbot from "https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js";
import Chatbot from 'https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js';
Chatbot.init({
chatflowid: "91e9c803-5169-4db9-8207-3c0915d71c5f",
apiHost: "http://localhost:3000",
chatflowid: '91e9c803-5169-4db9-8207-3c0915d71c5f',
apiHost: 'http://localhost:3000',
chatflowConfig: {
// topK: 2
},
theme: {
button: {
backgroundColor: "#3B81F6",
backgroundColor: '#3B81F6',
right: 20,
bottom: 20,
size: "medium",
iconColor: "white",
customIconSrc:
"https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg",
size: 'medium',
iconColor: 'white',
customIconSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
},
chatWindow: {
welcomeMessage: "Hello! This is custom welcome message",
backgroundColor: "#ffffff",
title: 'Flowise Bot',
titleAvatarSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
welcomeMessage: 'Hello! This is custom welcome message',
backgroundColor: '#ffffff',
height: 700,
width: 400,
fontSize: 16,
poweredByTextColor: "#303235",
poweredByTextColor: '#303235',
botMessage: {
backgroundColor: "#f7f8ff",
textColor: "#303235",
backgroundColor: '#f7f8ff',
textColor: '#303235',
showAvatar: true,
avatarSrc:
"https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png",
avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png',
},
userMessage: {
backgroundColor: "#3B81F6",
textColor: "#ffffff",
backgroundColor: '#3B81F6',
textColor: '#ffffff',
showAvatar: true,
avatarSrc:
"https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png",
avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
},
textInput: {
placeholder: "Type your question",
backgroundColor: "#ffffff",
textColor: "#303235",
sendButtonColor: "#3B81F6",
placeholder: 'Type your question',
backgroundColor: '#ffffff',
textColor: '#303235',
sendButtonColor: '#3B81F6',
},
},
},
Expand Down
6 changes: 6 additions & 0 deletions dist/components/Bot.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export type MessageType = {
message: string;
type: messageType;
sourceDocuments?: any;
fileAnnotations?: any;
};
export type BotProps = {
chatflowid: string;
Expand All @@ -15,7 +16,12 @@ export type BotProps = {
textInput?: TextInputTheme;
poweredByTextColor?: string;
badgeBackgroundColor?: string;
bubbleBackgroundColor?: string;
bubbleTextColor?: string;
title?: string;
titleAvatarSrc?: string;
fontSize?: number;
isFullPage?: boolean;
};
export declare const Bot: (props: BotProps & {
class?: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/components/Bot.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/components/SendButton.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type SendButtonProps = {
disableIcon?: boolean;
} & JSX.ButtonHTMLAttributes<HTMLButtonElement>;
export declare const SendButton: (props: SendButtonProps) => JSX.Element;
export declare const DeleteButton: (props: SendButtonProps) => JSX.Element;
export declare const Spinner: (props: JSX.SvgSVGAttributes<SVGSVGElement>) => JSX.Element;
export {};
//# sourceMappingURL=SendButton.d.ts.map
2 changes: 1 addition & 1 deletion dist/components/SendButton.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/components/bubbles/BotBubble.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
type Props = {
message: string;
apiHost?: string;
fileAnnotations?: any;
showAvatar?: boolean;
avatarSrc?: string;
backgroundColor?: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/components/bubbles/BotBubble.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/components/icons/DeleteIcon.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { JSX } from 'solid-js/jsx-runtime';
export declare const DeleteIcon: (props: JSX.SvgSVGAttributes<SVGSVGElement>) => JSX.Element;
//# sourceMappingURL=DeleteIcon.d.ts.map
1 change: 1 addition & 0 deletions dist/components/icons/DeleteIcon.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ type ShortTextInputProps = {
ref: HTMLInputElement | undefined;
onInput: (value: string) => void;
fontSize?: number;
disabled?: boolean;
} & Omit<JSX.InputHTMLAttributes<HTMLInputElement>, 'onInput'>;
export declare const ShortTextInput: (props: ShortTextInputProps) => JSX.Element;
export {};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/components/inputs/textInput/components/TextInput.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type Props = {
sendButtonColor?: string;
defaultValue?: string;
fontSize?: number;
disabled?: boolean;
onSubmit: (value: string) => void;
};
export declare const TextInput: (props: Props) => import("solid-js").JSX.Element;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/features/bubble/components/Bubble.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/features/bubble/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export type BotMessageTheme = {
avatarSrc?: string;
};
export type ChatWindowTheme = {
title?: string;
titleAvatarSrc?: string;
welcomeMessage?: string;
backgroundColor?: string;
height?: number;
Expand Down
2 changes: 1 addition & 1 deletion dist/features/bubble/types.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/features/full/components/Full.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion dist/queries/sendMessageQuery.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ export type IncomingInput = {
history: MessageType[];
overrideConfig?: Record<string, unknown>;
socketIOClientId?: string;
chatId?: string;
fileName?: string;
};
export type MessageRequest = {
chatflowid: string;
chatflowid?: string;
apiHost?: string;
body?: IncomingInput;
};
Expand All @@ -18,4 +20,8 @@ export declare const isStreamAvailableQuery: ({ chatflowid, apiHost }: MessageRe
data?: any;
error?: Error | undefined;
}>;
export declare const sendFileDownloadQuery: ({ apiHost, body }: MessageRequest) => Promise<{
data?: any;
error?: Error | undefined;
}>;
//# sourceMappingURL=sendMessageQuery.d.ts.map
2 changes: 1 addition & 1 deletion dist/queries/sendMessageQuery.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/utils/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export declare const sendRequest: <ResponseData>(params: {
url: string;
method: string;
body?: Record<string, unknown> | FormData;
type?: string;
} | string) => Promise<{
data?: ResponseData | undefined;
error?: Error | undefined;
Expand Down
Loading

0 comments on commit 7d09279

Please sign in to comment.