Skip to content

Commit 3d3c8bb

Browse files
committed
chore: package name
1 parent 8a0df95 commit 3d3c8bb

File tree

9 files changed

+31
-31
lines changed

9 files changed

+31
-31
lines changed

examples/react-app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>SqliteCloud Chatbot - React Example</title>
6+
<title>SqliteAI Docs Chatbot - React Example</title>
77
</head>
88
<body>
99
<div id="root"></div>

examples/react-app/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { Chatbot } from "../../../dist/esm/index.esm.js";
2-
import "../../../dist/esm/chatbot.css";
1+
import { DocsChatbot } from "../../../dist/esm/index.esm.js";
2+
import "../../../dist/esm/docs-chatbot.css";
33

44
function App() {
55
return (
66
<div style={{ padding: "20px" }}>
7-
<Chatbot
7+
<DocsChatbot
88
searchUrl={import.meta.env.VITE_SEARCH_API_URL}
99
apiKey={import.meta.env.VITE_SEARCH_API_KEY}
1010
title="SQLite Cloud Docs"

examples/vanilla-js/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<body>
1616
<div id="my-chatbot"></div>
1717

18-
<script src="../../dist/umd/chatbot.min.js"></script>
18+
<script src="../../dist/umd/docs-chatbot.min.js"></script>
1919
<script src="./config.js"></script>
2020

2121
<script>
22-
SqliteAiChatbot.init({
22+
DocsChatbot.init({
2323
containerId: "my-chatbot",
2424
searchUrl: window.ChatbotConfig.searchUrl,
2525
apiKey: window.ChatbotConfig.apiKey,

lib/Chatbot.tsx renamed to lib/DocsChatbot.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import { AlertCircle, X } from "lucide-react";
3636
import { Button } from "@/components/ui/button";
3737

3838
/** Props for the Chatbot component */
39-
export type ChatbotProps = {
39+
export type DocsChatbotProps = {
4040
/** Edge function URL for the search functionality */
4141
searchUrl: string;
4242
/** Bearer token for edge function authentication */
@@ -58,12 +58,12 @@ export type ChatbotProps = {
5858
*
5959
* @returns JSX.Element - Rendered chatbot interface
6060
*/
61-
export const Chatbot = ({
61+
export const DocsChatbot = ({
6262
searchUrl,
6363
apiKey,
6464
title,
6565
emptyState,
66-
}: ChatbotProps) => {
66+
}: DocsChatbotProps) => {
6767
const [open, setOpen] = useState(false);
6868
const [inputValue, setInputValue] = useState("");
6969

lib/react.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
import "../src/index.css";
2-
export { Chatbot } from "./Chatbot";
2+
export { DocsChatbot } from "./DocsChatbot";

lib/web.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import React from "react";
2-
import { Chatbot, type ChatbotProps } from "./Chatbot";
2+
import { DocsChatbot, type DocsChatbotProps } from "./DocsChatbot";
33
import createShadowRoot from "./createShadowRoot";
44
import cssText from "../src/index.css?inline";
55
import { ShadowRootProvider } from "@/providers/ShadowRootProvider";
66

7-
type SqliteAiChatbotConfig = {
7+
type DocsChatbotConfig = {
88
containerId: string;
9-
} & ChatbotProps;
9+
} & DocsChatbotProps;
1010

11-
class SqliteAiChatbotWidget {
12-
init(config: SqliteAiChatbotConfig): void {
11+
class DocsChatbotWidget {
12+
init(config: DocsChatbotConfig): void {
1313
const { containerId, ...chatbotProps } = config;
1414

1515
const container = document.getElementById(containerId);
@@ -32,7 +32,7 @@ class SqliteAiChatbotWidget {
3232
React.createElement(
3333
ShadowRootProvider,
3434
{ value: portalContainer },
35-
React.createElement(Chatbot, chatbotProps)
35+
React.createElement(DocsChatbot, chatbotProps)
3636
)
3737
);
3838
} catch (error) {
@@ -41,20 +41,20 @@ class SqliteAiChatbotWidget {
4141
}
4242
}
4343

44-
const chatbotWidget = new SqliteAiChatbotWidget();
44+
const chatbotWidget = new DocsChatbotWidget();
4545

4646
declare global {
4747
interface Window {
48-
SqliteAiChatbot: SqliteAiChatbotWidget;
48+
DocsChatbot: DocsChatbotWidget;
4949
}
50-
var SqliteAiChatbot: SqliteAiChatbotWidget | undefined;
50+
var DocsChatbot: DocsChatbotWidget | undefined;
5151
}
5252

5353
if (typeof window !== "undefined") {
54-
window.SqliteAiChatbot = chatbotWidget;
54+
window.DocsChatbot = chatbotWidget;
5555
}
5656
if (typeof globalThis !== "undefined") {
57-
globalThis.SqliteAiChatbot = chatbotWidget;
57+
globalThis.DocsChatbot = chatbotWidget;
5858
}
5959

6060
export default chatbotWidget;

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
2-
"name": "@sqliteai/chatbot",
2+
"name": "@sqliteai/docs-chatbot",
33
"private": true,
4-
"version": "0.0.0",
4+
"version": "0.0.1",
55
"type": "module",
66
"main": "./dist/cjs/index.cjs.js",
77
"module": "./dist/esm/index.esm.js",
8-
"types": "./dist/esm/lib/Chatbot.d.ts",
8+
"types": "./dist/esm/lib/DocsChatbot.d.ts",
99
"exports": {
1010
".": {
11-
"types": "./dist/esm/lib/Chatbot.d.ts",
11+
"types": "./dist/esm/lib/DocsChatbot.d.ts",
1212
"import": "./dist/esm/index.esm.js",
1313
"require": "./dist/esm/index.cjs.js"
1414
},
15-
"./style.css": "./dist/esm/chatbot.css"
15+
"./style.css": "./dist/esm/docs-chatbot.css"
1616
},
1717
"files": [
1818
"dist"

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Chatbot } from "../lib/Chatbot";
1+
import { DocsChatbot } from "../lib/DocsChatbot";
22

33
function App() {
44
return (
55
<div className="min-h-screen items-center justify-center">
6-
<Chatbot
6+
<DocsChatbot
77
searchUrl={import.meta.env.VITE_SEARCH_API_URL as string}
88
apiKey={import.meta.env.VITE_SEARCH_API_KEY as string}
99
title="SQLite Cloud Docs"

vite.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default defineConfig(({ mode }) => {
1414
...(mode === "react"
1515
? [
1616
dts({
17-
include: ["lib/Chatbot.tsx"],
17+
include: ["lib/DocsChatbot.tsx"],
1818
outDirs: ["dist/esm"],
1919
tsconfigPath: "./tsconfig.app.json",
2020
//bundleTypes: true,
@@ -41,12 +41,12 @@ export default defineConfig(({ mode }) => {
4141
mode === "react"
4242
? path.resolve(__dirname, "lib/react.ts")
4343
: path.resolve(__dirname, "lib/web.ts"),
44-
name: "SqliteAiChatbot",
44+
name: "DocsChatbot",
4545
fileName: (format) => {
4646
if (mode === "react") {
4747
return format === "es" ? "index.esm.js" : "index.cjs.js";
4848
} else {
49-
return "chatbot.min.js";
49+
return "docs-chatbot.min.js";
5050
}
5151
},
5252
formats: mode === "react" ? ["es", "cjs"] : ["umd"],

0 commit comments

Comments
 (0)