peppermint-chatbot-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +214 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +176 -0
- package/dist/index.mjs.map +1 -0
- package/dist/react/index.d.mts +7 -0
- package/dist/react/index.d.ts +7 -0
- package/dist/react/index.js +201 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/index.mjs +164 -0
- package/dist/react/index.mjs.map +1 -0
- package/dist/types-BfQUN3Hf.d.mts +34 -0
- package/dist/types-BfQUN3Hf.d.ts +34 -0
- package/dist/vanilla/index.d.mts +11 -0
- package/dist/vanilla/index.d.ts +11 -0
- package/dist/vanilla/index.js +210 -0
- package/dist/vanilla/index.js.map +1 -0
- package/dist/vanilla/index.mjs +175 -0
- package/dist/vanilla/index.mjs.map +1 -0
- package/package.json +63 -0
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# peppermint-chatbot-sdk
|
|
2
|
+
|
|
3
|
+
Embeddable chatbot widget for **React**, **Vue**, **Svelte**, and **vanilla JS**. Built with TypeScript and styled-components (React).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add peppermint-chatbot-sdk
|
|
9
|
+
# peer deps for React
|
|
10
|
+
yarn add react react-dom styled-components
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## React
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { PeppermintChatbot } from "peppermint-chatbot-sdk/react";
|
|
17
|
+
|
|
18
|
+
<PeppermintChatbot
|
|
19
|
+
layout="page"
|
|
20
|
+
greetingMessage="Hi! How can I help?"
|
|
21
|
+
chatbotName="Assistant"
|
|
22
|
+
onSendMessage={(text) => console.log(text)}
|
|
23
|
+
/>;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Vanilla JS / Vue / Svelte
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { createChatbot } from "peppermint-chatbot-sdk/vanilla";
|
|
30
|
+
|
|
31
|
+
const { unmount } = createChatbot(document.getElementById("chat"), {
|
|
32
|
+
layout: "widget",
|
|
33
|
+
greetingMessage: "Hello!",
|
|
34
|
+
});
|
|
35
|
+
// later: unmount();
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Requires `react` and `react-dom` on the page (the widget mounts the React component).
|
|
39
|
+
|
|
40
|
+
## Props
|
|
41
|
+
|
|
42
|
+
- `layout`: `"widget"` | `"page"`
|
|
43
|
+
- `greetingMessage`, `chatbotName`, `chatbotProfileImage`, `userProfileImage`
|
|
44
|
+
- `backgroundColor`, `fontColor`, `chatbotBubbleColor`, `userBubbleColor`
|
|
45
|
+
- `initialMessages`, `onSendMessage`, `className`
|
|
46
|
+
|
|
47
|
+
## Development
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
yarn install
|
|
51
|
+
yarn build
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## License
|
|
55
|
+
|
|
56
|
+
MIT
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
PeppermintChatbot: () => PeppermintChatbot,
|
|
34
|
+
createChatbot: () => createChatbot,
|
|
35
|
+
default: () => Chatbot_default
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(src_exports);
|
|
38
|
+
|
|
39
|
+
// src/react/Chatbot.tsx
|
|
40
|
+
var import_react = require("react");
|
|
41
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
+
var Root = import_styled_components.default.div`
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
min-height: ${(p) => p.$layout === "page" ? "400px" : "320px"};
|
|
49
|
+
max-height: ${(p) => p.$layout === "page" ? "620px" : "520px"};
|
|
50
|
+
background: ${(p) => p.$backgroundColor ?? "#ffffff"};
|
|
51
|
+
color: ${(p) => p.$fontColor ?? "#1a1a1a"};
|
|
52
|
+
border-radius: 16px;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
`;
|
|
58
|
+
var Messages = import_styled_components.default.div`
|
|
59
|
+
flex: 1;
|
|
60
|
+
overflow-y: auto;
|
|
61
|
+
padding: 1rem;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
gap: 0.75rem;
|
|
65
|
+
`;
|
|
66
|
+
var MessageBubble = import_styled_components.default.div`
|
|
67
|
+
align-self: ${(p) => p.$role === "user" ? "flex-end" : "flex-start"};
|
|
68
|
+
max-width: 85%;
|
|
69
|
+
padding: 0.6rem 1rem;
|
|
70
|
+
border-radius: 12px;
|
|
71
|
+
line-height: 1.45;
|
|
72
|
+
word-break: break-word;
|
|
73
|
+
background: ${(p) => p.$role === "user" ? p.$userBubbleColor ?? "#2d2d2d" : p.$chatbotBubbleColor ?? "#f0f0f0"};
|
|
74
|
+
color: ${(p) => p.$role === "user" ? "#ffffff" : "#1a1a1a"};
|
|
75
|
+
`;
|
|
76
|
+
var Greeting = import_styled_components.default.p`
|
|
77
|
+
margin: 0;
|
|
78
|
+
color: inherit;
|
|
79
|
+
opacity: 0.85;
|
|
80
|
+
`;
|
|
81
|
+
var InputRow = import_styled_components.default.div`
|
|
82
|
+
display: flex;
|
|
83
|
+
gap: 0.5rem;
|
|
84
|
+
padding: 0.75rem 1rem;
|
|
85
|
+
border-top: 1px solid rgba(0, 0, 0, 0.08);
|
|
86
|
+
background: rgba(0, 0, 0, 0.02);
|
|
87
|
+
`;
|
|
88
|
+
var Input = import_styled_components.default.input`
|
|
89
|
+
flex: 1;
|
|
90
|
+
padding: 0.6rem 0.75rem;
|
|
91
|
+
border: 1px solid rgba(0, 0, 0, 0.12);
|
|
92
|
+
border-radius: 8px;
|
|
93
|
+
font-size: 14px;
|
|
94
|
+
outline: none;
|
|
95
|
+
&::placeholder {
|
|
96
|
+
color: #888;
|
|
97
|
+
}
|
|
98
|
+
&:focus {
|
|
99
|
+
border-color: rgba(0, 0, 0, 0.3);
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
102
|
+
var SendButton = import_styled_components.default.button`
|
|
103
|
+
padding: 0.6rem 1rem;
|
|
104
|
+
font-size: 14px;
|
|
105
|
+
font-weight: 600;
|
|
106
|
+
color: #fff;
|
|
107
|
+
background: #1a1a1a;
|
|
108
|
+
border: none;
|
|
109
|
+
border-radius: 8px;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
&:hover {
|
|
112
|
+
opacity: 0.9;
|
|
113
|
+
}
|
|
114
|
+
&:disabled {
|
|
115
|
+
opacity: 0.5;
|
|
116
|
+
cursor: not-allowed;
|
|
117
|
+
}
|
|
118
|
+
`;
|
|
119
|
+
function PeppermintChatbot({
|
|
120
|
+
layout = "page",
|
|
121
|
+
chatbotName,
|
|
122
|
+
greetingMessage = "Hi! How can I help you today?",
|
|
123
|
+
backgroundColor,
|
|
124
|
+
fontColor,
|
|
125
|
+
chatbotBubbleColor,
|
|
126
|
+
userBubbleColor,
|
|
127
|
+
initialMessages = [],
|
|
128
|
+
onSendMessage,
|
|
129
|
+
className
|
|
130
|
+
}) {
|
|
131
|
+
const [messages, setMessages] = (0, import_react.useState)(initialMessages);
|
|
132
|
+
const [input, setInput] = (0, import_react.useState)("");
|
|
133
|
+
const messagesEndRef = (0, import_react.useRef)(null);
|
|
134
|
+
(0, import_react.useEffect)(() => {
|
|
135
|
+
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
136
|
+
}, [messages]);
|
|
137
|
+
const handleSend = () => {
|
|
138
|
+
const text = input.trim();
|
|
139
|
+
if (!text) return;
|
|
140
|
+
const userMsg = {
|
|
141
|
+
id: `u-${Date.now()}`,
|
|
142
|
+
role: "user",
|
|
143
|
+
content: text
|
|
144
|
+
};
|
|
145
|
+
setMessages((prev) => [...prev, userMsg]);
|
|
146
|
+
setInput("");
|
|
147
|
+
onSendMessage?.(text);
|
|
148
|
+
};
|
|
149
|
+
const showGreeting = messages.length === 0 && greetingMessage;
|
|
150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
151
|
+
Root,
|
|
152
|
+
{
|
|
153
|
+
className,
|
|
154
|
+
$layout: layout,
|
|
155
|
+
$backgroundColor: backgroundColor,
|
|
156
|
+
$fontColor: fontColor,
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Messages, { children: [
|
|
159
|
+
showGreeting && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
160
|
+
MessageBubble,
|
|
161
|
+
{
|
|
162
|
+
$role: "assistant",
|
|
163
|
+
$chatbotBubbleColor: chatbotBubbleColor,
|
|
164
|
+
$userBubbleColor: userBubbleColor,
|
|
165
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Greeting, { children: greetingMessage })
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
messages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
169
|
+
MessageBubble,
|
|
170
|
+
{
|
|
171
|
+
$role: msg.role,
|
|
172
|
+
$chatbotBubbleColor: chatbotBubbleColor,
|
|
173
|
+
$userBubbleColor: userBubbleColor,
|
|
174
|
+
children: msg.content
|
|
175
|
+
},
|
|
176
|
+
msg.id
|
|
177
|
+
)),
|
|
178
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: messagesEndRef })
|
|
179
|
+
] }),
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(InputRow, { children: [
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
182
|
+
Input,
|
|
183
|
+
{
|
|
184
|
+
type: "text",
|
|
185
|
+
placeholder: "Type a message...",
|
|
186
|
+
value: input,
|
|
187
|
+
onChange: (e) => setInput(e.target.value),
|
|
188
|
+
onKeyDown: (e) => e.key === "Enter" && handleSend()
|
|
189
|
+
}
|
|
190
|
+
),
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SendButton, { type: "button", onClick: handleSend, disabled: !input.trim(), children: "Send" })
|
|
192
|
+
] })
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
var Chatbot_default = PeppermintChatbot;
|
|
198
|
+
|
|
199
|
+
// src/vanilla/index.ts
|
|
200
|
+
var import_react2 = __toESM(require("react"));
|
|
201
|
+
var import_client = require("react-dom/client");
|
|
202
|
+
function createChatbot(container, props = {}) {
|
|
203
|
+
const root = (0, import_client.createRoot)(container);
|
|
204
|
+
root.render(import_react2.default.createElement(PeppermintChatbot, props));
|
|
205
|
+
return {
|
|
206
|
+
unmount: () => root.unmount()
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
210
|
+
0 && (module.exports = {
|
|
211
|
+
PeppermintChatbot,
|
|
212
|
+
createChatbot
|
|
213
|
+
});
|
|
214
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/react/Chatbot.tsx","../src/vanilla/index.ts"],"sourcesContent":["export { PeppermintChatbot, default } from \"./react\";\nexport { createChatbot } from \"./vanilla\";\nexport type { PeppermintChatbotProps, ChatMessage } from \"./types\";\n","import React, { useState, useRef, useEffect } from \"react\";\nimport styled from \"styled-components\";\nimport type { PeppermintChatbotProps, ChatMessage } from \"../types\";\n\nconst Root = styled.div<{\n $backgroundColor?: string;\n $fontColor?: string;\n $layout: \"widget\" | \"page\";\n}>`\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: ${(p) => (p.$layout === \"page\" ? \"400px\" : \"320px\")};\n max-height: ${(p) => (p.$layout === \"page\" ? \"620px\" : \"520px\")};\n background: ${(p) => p.$backgroundColor ?? \"#ffffff\"};\n color: ${(p) => p.$fontColor ?? \"#1a1a1a\"};\n border-radius: 16px;\n overflow: hidden;\n font-family: system-ui, -apple-system, sans-serif;\n font-size: 14px;\n box-sizing: border-box;\n`;\n\nconst Messages = styled.div`\n flex: 1;\n overflow-y: auto;\n padding: 1rem;\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n`;\n\nconst MessageBubble = styled.div<{\n $role: \"user\" | \"assistant\";\n $userBubbleColor?: string;\n $chatbotBubbleColor?: string;\n}>`\n align-self: ${(p) => (p.$role === \"user\" ? \"flex-end\" : \"flex-start\")};\n max-width: 85%;\n padding: 0.6rem 1rem;\n border-radius: 12px;\n line-height: 1.45;\n word-break: break-word;\n background: ${(p) =>\n p.$role === \"user\"\n ? p.$userBubbleColor ?? \"#2d2d2d\"\n : p.$chatbotBubbleColor ?? \"#f0f0f0\"};\n color: ${(p) => (p.$role === \"user\" ? \"#ffffff\" : \"#1a1a1a\")};\n`;\n\nconst Greeting = styled.p`\n margin: 0;\n color: inherit;\n opacity: 0.85;\n`;\n\nconst InputRow = styled.div`\n display: flex;\n gap: 0.5rem;\n padding: 0.75rem 1rem;\n border-top: 1px solid rgba(0, 0, 0, 0.08);\n background: rgba(0, 0, 0, 0.02);\n`;\n\nconst Input = styled.input`\n flex: 1;\n padding: 0.6rem 0.75rem;\n border: 1px solid rgba(0, 0, 0, 0.12);\n border-radius: 8px;\n font-size: 14px;\n outline: none;\n &::placeholder {\n color: #888;\n }\n &:focus {\n border-color: rgba(0, 0, 0, 0.3);\n }\n`;\n\nconst SendButton = styled.button`\n padding: 0.6rem 1rem;\n font-size: 14px;\n font-weight: 600;\n color: #fff;\n background: #1a1a1a;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n &:hover {\n opacity: 0.9;\n }\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n`;\n\nexport function PeppermintChatbot({\n layout = \"page\",\n chatbotName,\n greetingMessage = \"Hi! How can I help you today?\",\n backgroundColor,\n fontColor,\n chatbotBubbleColor,\n userBubbleColor,\n initialMessages = [],\n onSendMessage,\n className,\n}: PeppermintChatbotProps) {\n const [messages, setMessages] = useState<ChatMessage[]>(initialMessages);\n const [input, setInput] = useState(\"\");\n const messagesEndRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n messagesEndRef.current?.scrollIntoView({ behavior: \"smooth\" });\n }, [messages]);\n\n const handleSend = () => {\n const text = input.trim();\n if (!text) return;\n const userMsg: ChatMessage = {\n id: `u-${Date.now()}`,\n role: \"user\",\n content: text,\n };\n setMessages((prev) => [...prev, userMsg]);\n setInput(\"\");\n onSendMessage?.(text);\n };\n\n const showGreeting = messages.length === 0 && greetingMessage;\n\n return (\n <Root\n className={className}\n $layout={layout}\n $backgroundColor={backgroundColor}\n $fontColor={fontColor}\n >\n <Messages>\n {showGreeting && (\n <MessageBubble\n $role=\"assistant\"\n $chatbotBubbleColor={chatbotBubbleColor}\n $userBubbleColor={userBubbleColor}\n >\n <Greeting>{greetingMessage}</Greeting>\n </MessageBubble>\n )}\n {messages.map((msg) => (\n <MessageBubble\n key={msg.id}\n $role={msg.role}\n $chatbotBubbleColor={chatbotBubbleColor}\n $userBubbleColor={userBubbleColor}\n >\n {msg.content}\n </MessageBubble>\n ))}\n <div ref={messagesEndRef} />\n </Messages>\n <InputRow>\n <Input\n type=\"text\"\n placeholder=\"Type a message...\"\n value={input}\n onChange={(e) => setInput(e.target.value)}\n onKeyDown={(e) => e.key === \"Enter\" && handleSend()}\n />\n <SendButton type=\"button\" onClick={handleSend} disabled={!input.trim()}>\n Send\n </SendButton>\n </InputRow>\n </Root>\n );\n}\n\nexport default PeppermintChatbot;\n","import React from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { PeppermintChatbot } from \"../react\";\nimport type { PeppermintChatbotProps } from \"../types\";\n\n/**\n * Mount the chatbot into a container (vanilla JS, Vue, Svelte).\n * Requires react and react-dom to be available (e.g. via script or bundler).\n */\nexport function createChatbot(\n container: HTMLElement,\n props: PeppermintChatbotProps = {}\n): { unmount: () => void } {\n const root = createRoot(container);\n root.render(React.createElement(PeppermintChatbot, props));\n return {\n unmount: () => root.unmount(),\n };\n}\n\nexport type { PeppermintChatbotProps } from \"../types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAmD;AACnD,+BAAmB;AA2Ib;AAxIN,IAAM,OAAO,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBASJ,CAAC,MAAO,EAAE,YAAY,SAAS,UAAU,OAAQ;AAAA,gBACjD,CAAC,MAAO,EAAE,YAAY,SAAS,UAAU,OAAQ;AAAA,gBACjD,CAAC,MAAM,EAAE,oBAAoB,SAAS;AAAA,WAC3C,CAAC,MAAM,EAAE,cAAc,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ3C,IAAM,WAAW,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASxB,IAAM,gBAAgB,yBAAAA,QAAO;AAAA,gBAKb,CAAC,MAAO,EAAE,UAAU,SAAS,aAAa,YAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAMvD,CAAC,MACb,EAAE,UAAU,SACR,EAAE,oBAAoB,YACtB,EAAE,uBAAuB,SAAS;AAAA,WAC/B,CAAC,MAAO,EAAE,UAAU,SAAS,YAAY,SAAU;AAAA;AAG9D,IAAM,WAAW,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAMxB,IAAM,WAAW,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQxB,IAAM,QAAQ,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAerB,IAAM,aAAa,yBAAAA,QAAO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B,cAAI;AAAA;AAAA,YALA,IAAI;AAAA,UAMX,CACD;AAAA,UACD,4CAAC,SAAI,KAAK,gBAAgB;AAAA,WAC5B;AAAA,QACA,6CAAC,YACC;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,aAAY;AAAA,cACZ,OAAO;AAAA,cACP,UAAU,CAAC,MAAM,SAAS,EAAE,OAAO,KAAK;AAAA,cACxC,WAAW,CAAC,MAAM,EAAE,QAAQ,WAAW,WAAW;AAAA;AAAA,UACpD;AAAA,UACA,4CAAC,cAAW,MAAK,UAAS,SAAS,YAAY,UAAU,CAAC,MAAM,KAAK,GAAG,kBAExE;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,kBAAQ;;;AClLf,IAAAC,gBAAkB;AAClB,oBAA2B;AAQpB,SAAS,cACd,WACA,QAAgC,CAAC,GACR;AACzB,QAAM,WAAO,0BAAW,SAAS;AACjC,OAAK,OAAO,cAAAC,QAAM,cAAc,mBAAmB,KAAK,CAAC;AACzD,SAAO;AAAA,IACL,SAAS,MAAM,KAAK,QAAQ;AAAA,EAC9B;AACF;","names":["styled","import_react","React"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// src/react/Chatbot.tsx
|
|
2
|
+
import { useState, useRef, useEffect } from "react";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var Root = styled.div`
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
min-height: ${(p) => p.$layout === "page" ? "400px" : "320px"};
|
|
11
|
+
max-height: ${(p) => p.$layout === "page" ? "620px" : "520px"};
|
|
12
|
+
background: ${(p) => p.$backgroundColor ?? "#ffffff"};
|
|
13
|
+
color: ${(p) => p.$fontColor ?? "#1a1a1a"};
|
|
14
|
+
border-radius: 16px;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
`;
|
|
20
|
+
var Messages = styled.div`
|
|
21
|
+
flex: 1;
|
|
22
|
+
overflow-y: auto;
|
|
23
|
+
padding: 1rem;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: 0.75rem;
|
|
27
|
+
`;
|
|
28
|
+
var MessageBubble = styled.div`
|
|
29
|
+
align-self: ${(p) => p.$role === "user" ? "flex-end" : "flex-start"};
|
|
30
|
+
max-width: 85%;
|
|
31
|
+
padding: 0.6rem 1rem;
|
|
32
|
+
border-radius: 12px;
|
|
33
|
+
line-height: 1.45;
|
|
34
|
+
word-break: break-word;
|
|
35
|
+
background: ${(p) => p.$role === "user" ? p.$userBubbleColor ?? "#2d2d2d" : p.$chatbotBubbleColor ?? "#f0f0f0"};
|
|
36
|
+
color: ${(p) => p.$role === "user" ? "#ffffff" : "#1a1a1a"};
|
|
37
|
+
`;
|
|
38
|
+
var Greeting = styled.p`
|
|
39
|
+
margin: 0;
|
|
40
|
+
color: inherit;
|
|
41
|
+
opacity: 0.85;
|
|
42
|
+
`;
|
|
43
|
+
var InputRow = styled.div`
|
|
44
|
+
display: flex;
|
|
45
|
+
gap: 0.5rem;
|
|
46
|
+
padding: 0.75rem 1rem;
|
|
47
|
+
border-top: 1px solid rgba(0, 0, 0, 0.08);
|
|
48
|
+
background: rgba(0, 0, 0, 0.02);
|
|
49
|
+
`;
|
|
50
|
+
var Input = styled.input`
|
|
51
|
+
flex: 1;
|
|
52
|
+
padding: 0.6rem 0.75rem;
|
|
53
|
+
border: 1px solid rgba(0, 0, 0, 0.12);
|
|
54
|
+
border-radius: 8px;
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
outline: none;
|
|
57
|
+
&::placeholder {
|
|
58
|
+
color: #888;
|
|
59
|
+
}
|
|
60
|
+
&:focus {
|
|
61
|
+
border-color: rgba(0, 0, 0, 0.3);
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
var SendButton = styled.button`
|
|
65
|
+
padding: 0.6rem 1rem;
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
font-weight: 600;
|
|
68
|
+
color: #fff;
|
|
69
|
+
background: #1a1a1a;
|
|
70
|
+
border: none;
|
|
71
|
+
border-radius: 8px;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
&:hover {
|
|
74
|
+
opacity: 0.9;
|
|
75
|
+
}
|
|
76
|
+
&:disabled {
|
|
77
|
+
opacity: 0.5;
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
function PeppermintChatbot({
|
|
82
|
+
layout = "page",
|
|
83
|
+
chatbotName,
|
|
84
|
+
greetingMessage = "Hi! How can I help you today?",
|
|
85
|
+
backgroundColor,
|
|
86
|
+
fontColor,
|
|
87
|
+
chatbotBubbleColor,
|
|
88
|
+
userBubbleColor,
|
|
89
|
+
initialMessages = [],
|
|
90
|
+
onSendMessage,
|
|
91
|
+
className
|
|
92
|
+
}) {
|
|
93
|
+
const [messages, setMessages] = useState(initialMessages);
|
|
94
|
+
const [input, setInput] = useState("");
|
|
95
|
+
const messagesEndRef = useRef(null);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
98
|
+
}, [messages]);
|
|
99
|
+
const handleSend = () => {
|
|
100
|
+
const text = input.trim();
|
|
101
|
+
if (!text) return;
|
|
102
|
+
const userMsg = {
|
|
103
|
+
id: `u-${Date.now()}`,
|
|
104
|
+
role: "user",
|
|
105
|
+
content: text
|
|
106
|
+
};
|
|
107
|
+
setMessages((prev) => [...prev, userMsg]);
|
|
108
|
+
setInput("");
|
|
109
|
+
onSendMessage?.(text);
|
|
110
|
+
};
|
|
111
|
+
const showGreeting = messages.length === 0 && greetingMessage;
|
|
112
|
+
return /* @__PURE__ */ jsxs(
|
|
113
|
+
Root,
|
|
114
|
+
{
|
|
115
|
+
className,
|
|
116
|
+
$layout: layout,
|
|
117
|
+
$backgroundColor: backgroundColor,
|
|
118
|
+
$fontColor: fontColor,
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ jsxs(Messages, { children: [
|
|
121
|
+
showGreeting && /* @__PURE__ */ jsx(
|
|
122
|
+
MessageBubble,
|
|
123
|
+
{
|
|
124
|
+
$role: "assistant",
|
|
125
|
+
$chatbotBubbleColor: chatbotBubbleColor,
|
|
126
|
+
$userBubbleColor: userBubbleColor,
|
|
127
|
+
children: /* @__PURE__ */ jsx(Greeting, { children: greetingMessage })
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
messages.map((msg) => /* @__PURE__ */ jsx(
|
|
131
|
+
MessageBubble,
|
|
132
|
+
{
|
|
133
|
+
$role: msg.role,
|
|
134
|
+
$chatbotBubbleColor: chatbotBubbleColor,
|
|
135
|
+
$userBubbleColor: userBubbleColor,
|
|
136
|
+
children: msg.content
|
|
137
|
+
},
|
|
138
|
+
msg.id
|
|
139
|
+
)),
|
|
140
|
+
/* @__PURE__ */ jsx("div", { ref: messagesEndRef })
|
|
141
|
+
] }),
|
|
142
|
+
/* @__PURE__ */ jsxs(InputRow, { children: [
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
Input,
|
|
145
|
+
{
|
|
146
|
+
type: "text",
|
|
147
|
+
placeholder: "Type a message...",
|
|
148
|
+
value: input,
|
|
149
|
+
onChange: (e) => setInput(e.target.value),
|
|
150
|
+
onKeyDown: (e) => e.key === "Enter" && handleSend()
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ jsx(SendButton, { type: "button", onClick: handleSend, disabled: !input.trim(), children: "Send" })
|
|
154
|
+
] })
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
var Chatbot_default = PeppermintChatbot;
|
|
160
|
+
|
|
161
|
+
// src/vanilla/index.ts
|
|
162
|
+
import React2 from "react";
|
|
163
|
+
import { createRoot } from "react-dom/client";
|
|
164
|
+
function createChatbot(container, props = {}) {
|
|
165
|
+
const root = createRoot(container);
|
|
166
|
+
root.render(React2.createElement(PeppermintChatbot, props));
|
|
167
|
+
return {
|
|
168
|
+
unmount: () => root.unmount()
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
export {
|
|
172
|
+
PeppermintChatbot,
|
|
173
|
+
createChatbot,
|
|
174
|
+
Chatbot_default as default
|
|
175
|
+
};
|
|
176
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/Chatbot.tsx","../src/vanilla/index.ts"],"sourcesContent":["import React, { useState, useRef, useEffect } from \"react\";\nimport styled from \"styled-components\";\nimport type { PeppermintChatbotProps, ChatMessage } from \"../types\";\n\nconst Root = styled.div<{\n $backgroundColor?: string;\n $fontColor?: string;\n $layout: \"widget\" | \"page\";\n}>`\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: ${(p) => (p.$layout === \"page\" ? \"400px\" : \"320px\")};\n max-height: ${(p) => (p.$layout === \"page\" ? \"620px\" : \"520px\")};\n background: ${(p) => p.$backgroundColor ?? \"#ffffff\"};\n color: ${(p) => p.$fontColor ?? \"#1a1a1a\"};\n border-radius: 16px;\n overflow: hidden;\n font-family: system-ui, -apple-system, sans-serif;\n font-size: 14px;\n box-sizing: border-box;\n`;\n\nconst Messages = styled.div`\n flex: 1;\n overflow-y: auto;\n padding: 1rem;\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n`;\n\nconst MessageBubble = styled.div<{\n $role: \"user\" | \"assistant\";\n $userBubbleColor?: string;\n $chatbotBubbleColor?: string;\n}>`\n align-self: ${(p) => (p.$role === \"user\" ? \"flex-end\" : \"flex-start\")};\n max-width: 85%;\n padding: 0.6rem 1rem;\n border-radius: 12px;\n line-height: 1.45;\n word-break: break-word;\n background: ${(p) =>\n p.$role === \"user\"\n ? p.$userBubbleColor ?? \"#2d2d2d\"\n : p.$chatbotBubbleColor ?? \"#f0f0f0\"};\n color: ${(p) => (p.$role === \"user\" ? \"#ffffff\" : \"#1a1a1a\")};\n`;\n\nconst Greeting = styled.p`\n margin: 0;\n color: inherit;\n opacity: 0.85;\n`;\n\nconst InputRow = styled.div`\n display: flex;\n gap: 0.5rem;\n padding: 0.75rem 1rem;\n border-top: 1px solid rgba(0, 0, 0, 0.08);\n background: rgba(0, 0, 0, 0.02);\n`;\n\nconst Input = styled.input`\n flex: 1;\n padding: 0.6rem 0.75rem;\n border: 1px solid rgba(0, 0, 0, 0.12);\n border-radius: 8px;\n font-size: 14px;\n outline: none;\n &::placeholder {\n color: #888;\n }\n &:focus {\n border-color: rgba(0, 0, 0, 0.3);\n }\n`;\n\nconst SendButton = styled.button`\n padding: 0.6rem 1rem;\n font-size: 14px;\n font-weight: 600;\n color: #fff;\n background: #1a1a1a;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n &:hover {\n opacity: 0.9;\n }\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n`;\n\nexport function PeppermintChatbot({\n layout = \"page\",\n chatbotName,\n greetingMessage = \"Hi! How can I help you today?\",\n backgroundColor,\n fontColor,\n chatbotBubbleColor,\n userBubbleColor,\n initialMessages = [],\n onSendMessage,\n className,\n}: PeppermintChatbotProps) {\n const [messages, setMessages] = useState<ChatMessage[]>(initialMessages);\n const [input, setInput] = useState(\"\");\n const messagesEndRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n messagesEndRef.current?.scrollIntoView({ behavior: \"smooth\" });\n }, [messages]);\n\n const handleSend = () => {\n const text = input.trim();\n if (!text) return;\n const userMsg: ChatMessage = {\n id: `u-${Date.now()}`,\n role: \"user\",\n content: text,\n };\n setMessages((prev) => [...prev, userMsg]);\n setInput(\"\");\n onSendMessage?.(text);\n };\n\n const showGreeting = messages.length === 0 && greetingMessage;\n\n return (\n <Root\n className={className}\n $layout={layout}\n $backgroundColor={backgroundColor}\n $fontColor={fontColor}\n >\n <Messages>\n {showGreeting && (\n <MessageBubble\n $role=\"assistant\"\n $chatbotBubbleColor={chatbotBubbleColor}\n $userBubbleColor={userBubbleColor}\n >\n <Greeting>{greetingMessage}</Greeting>\n </MessageBubble>\n )}\n {messages.map((msg) => (\n <MessageBubble\n key={msg.id}\n $role={msg.role}\n $chatbotBubbleColor={chatbotBubbleColor}\n $userBubbleColor={userBubbleColor}\n >\n {msg.content}\n </MessageBubble>\n ))}\n <div ref={messagesEndRef} />\n </Messages>\n <InputRow>\n <Input\n type=\"text\"\n placeholder=\"Type a message...\"\n value={input}\n onChange={(e) => setInput(e.target.value)}\n onKeyDown={(e) => e.key === \"Enter\" && handleSend()}\n />\n <SendButton type=\"button\" onClick={handleSend} disabled={!input.trim()}>\n Send\n </SendButton>\n </InputRow>\n </Root>\n );\n}\n\nexport default PeppermintChatbot;\n","import React from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { PeppermintChatbot } from \"../react\";\nimport type { PeppermintChatbotProps } from \"../types\";\n\n/**\n * Mount the chatbot into a container (vanilla JS, Vue, Svelte).\n * Requires react and react-dom to be available (e.g. via script or bundler).\n */\nexport function createChatbot(\n container: HTMLElement,\n props: PeppermintChatbotProps = {}\n): { unmount: () => void } {\n const root = createRoot(container);\n root.render(React.createElement(PeppermintChatbot, props));\n return {\n unmount: () => root.unmount(),\n };\n}\n\nexport type { PeppermintChatbotProps } from \"../types\";\n"],"mappings":";AAAA,SAAgB,UAAU,QAAQ,iBAAiB;AACnD,OAAO,YAAY;AA2Ib,SAOM,KAPN;AAxIN,IAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBASJ,CAAC,MAAO,EAAE,YAAY,SAAS,UAAU,OAAQ;AAAA,gBACjD,CAAC,MAAO,EAAE,YAAY,SAAS,UAAU,OAAQ;AAAA,gBACjD,CAAC,MAAM,EAAE,oBA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;AACjC,OAAK,OAAOC,OAAM,cAAc,mBAAmB,KAAK,CAAC;AACzD,SAAO;AAAA,IACL,SAAS,MAAM,KAAK,QAAQ;AAAA,EAC9B;AACF;","names":["React","React"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { P as PeppermintChatbotProps } from '../types-BfQUN3Hf.mjs';
|
|
3
|
+
export { C as ChatMessage } from '../types-BfQUN3Hf.mjs';
|
|
4
|
+
|
|
5
|
+
declare function PeppermintChatbot({ layout, chatbotName, greetingMessage, backgroundColor, fontColor, chatbotBubbleColor, userBubbleColor, initialMessages, onSendMessage, className, }: PeppermintChatbotProps): react_jsx_runtime.JSX.Element;
|
|
6
|
+
|
|
7
|
+
export { PeppermintChatbot, PeppermintChatbotProps, PeppermintChatbot as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { P as PeppermintChatbotProps } from '../types-BfQUN3Hf.js';
|
|
3
|
+
export { C as ChatMessage } from '../types-BfQUN3Hf.js';
|
|
4
|
+
|
|
5
|
+
declare function PeppermintChatbot({ layout, chatbotName, greetingMessage, backgroundColor, fontColor, chatbotBubbleColor, userBubbleColor, initialMessages, onSendMessage, className, }: PeppermintChatbotProps): react_jsx_runtime.JSX.Element;
|
|
6
|
+
|
|
7
|
+
export { PeppermintChatbot, PeppermintChatbotProps, PeppermintChatbot as default };
|