@nameless26/widget 0.1.0 → 0.1.2

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.
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ export type ThemeName = "dark" | "light" | "system";
3
+ interface ThemeTokens {
4
+ bg: string;
5
+ surface: string;
6
+ border: string;
7
+ text: string;
8
+ textMuted: string;
9
+ inputBg: string;
10
+ inputBorder: string;
11
+ inputBorderFocus: string;
12
+ error: string;
13
+ }
14
+ export declare function resolveTokens(theme: ThemeName): ThemeTokens;
15
+ export declare function tokensToVars(t: ThemeTokens): React.CSSProperties;
16
+ export {};
package/dist/types.d.ts CHANGED
@@ -6,6 +6,7 @@ export interface ChatMessage {
6
6
  export interface UseChatOptions {
7
7
  agentId: string;
8
8
  baseUrl?: string;
9
+ agentCoreUrl?: string;
9
10
  endUserId?: string;
10
11
  }
11
12
  export type SseEvent = {
@@ -23,6 +24,8 @@ export type SseEvent = {
23
24
  export interface NexusWidgetProps {
24
25
  agentId: string;
25
26
  baseUrl?: string;
27
+ theme?: "dark" | "light" | "system";
28
+ agentCoreUrl?: string;
26
29
  primaryColor?: string;
27
30
  position?: "bottom-right" | "bottom-left";
28
31
  welcomeMessage?: string;
package/dist/useChat.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ChatMessage, UseChatOptions } from './types';
2
- export declare function useChat({ agentId, baseUrl: BASE_URL, endUserId }: UseChatOptions): {
2
+ export declare function useChat({ agentId, baseUrl: BASE_URL, agentCoreUrl, endUserId }: UseChatOptions): {
3
3
  messages: ChatMessage[];
4
4
  isLoading: boolean;
5
5
  historyLoading: boolean;
package/package.json CHANGED
@@ -1,35 +1,41 @@
1
1
  {
2
2
  "name": "@nameless26/widget",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
+
5
6
  "main": "./dist/index.cjs",
6
7
  "module": "./dist/index.js",
7
8
  "types": "./dist/index.d.ts",
9
+
8
10
  "exports": {
9
11
  ".": {
12
+ "types": "./dist/index.d.ts",
10
13
  "import": "./dist/index.es.js",
11
- "require": "./dist/index.cjs.js",
12
- "types": "./dist/index.d.ts"
14
+ "require": "./dist/index.cjs.js"
13
15
  }
14
16
  },
17
+
15
18
  "files": [
16
19
  "dist"
17
20
  ],
21
+
18
22
  "scripts": {
19
23
  "dev": "vite build --watch",
20
24
  "build": "vite build && vite build --config vite.embed.config.ts",
21
25
  "prepublishOnly": "npm run build"
22
26
  },
27
+
23
28
  "peerDependencies": {
24
- "react": "^18.0.0",
25
- "react-dom": "^18.0.0"
29
+ "react": "^19.2.6",
30
+ "react-dom": "^19.2.6"
26
31
  },
32
+
27
33
  "devDependencies": {
28
- "@vitejs/plugin-react": "^4.0.0",
29
- "react": "^18.2.0",
30
- "react-dom": "^18.2.0",
34
+ "@vitejs/plugin-react": "^5.0.0",
35
+ "react": "^19.2.6",
36
+ "react-dom": "^19.2.6",
31
37
  "typescript": "^5.0.0",
32
- "vite": "^5.0.0",
38
+ "vite": "^7.0.0",
33
39
  "vite-plugin-dts": "^5.0.2"
34
40
  }
35
- }
41
+ }