open-ask-ai 0.2.2 → 0.2.4

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.
@@ -2,12 +2,15 @@ import * as React from 'react';
2
2
  interface DrawerProps {
3
3
  isOpen: boolean;
4
4
  onClose: () => void;
5
+ onNewSession?: () => void;
6
+ hasMessages?: boolean;
5
7
  position?: 'right' | 'left';
6
8
  width?: number | string;
7
9
  title?: string;
8
10
  closeAriaLabel?: string;
11
+ newSessionAriaLabel?: string;
9
12
  children?: React.ReactNode;
10
13
  theme?: 'light' | 'dark';
11
14
  }
12
- export declare function Drawer({ isOpen, onClose, position, width, title, closeAriaLabel, children, theme, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function Drawer({ isOpen, onClose, onNewSession, hasMessages, position, width, title, closeAriaLabel, newSessionAriaLabel, children, theme, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
13
16
  export {};
@@ -17,5 +17,5 @@ export declare class APIClient {
17
17
  /**
18
18
  * Ask a question and return the SSE stream response
19
19
  */
20
- askQuestion(sessionId: string, question: string, system?: string): Promise<Response>;
20
+ askQuestion(sessionId: string, question: string, system?: string, signal?: AbortSignal): Promise<Response>;
21
21
  }
@@ -11,7 +11,7 @@ interface UseChatReturn {
11
11
  sessionError: Error | null;
12
12
  isCreatingSession: boolean;
13
13
  sendMessage: (text: string) => Promise<void>;
14
- clearMessages: () => void;
14
+ resetChat: () => Promise<void>;
15
15
  }
16
16
  export declare function useChat({ apiClient, systemPrompt }: UseChatOptions): UseChatReturn;
17
17
  export {};
@@ -7,7 +7,7 @@ interface UseSessionReturn {
7
7
  isCreating: boolean;
8
8
  error: Error | null;
9
9
  initializeSession: () => Promise<string>;
10
- recreateSession: () => Promise<void>;
10
+ clearSession: () => Promise<void>;
11
11
  }
12
12
  export declare function useSession({ apiClient }: UseSessionOptions): UseSessionReturn;
13
13
  export {};
@@ -39,6 +39,7 @@ export interface WidgetTexts {
39
39
  triggerButtonAriaLabel?: string;
40
40
  drawerTitle?: string;
41
41
  drawerCloseAriaLabel?: string;
42
+ drawerNewSessionAriaLabel?: string;
42
43
  welcomeMessage?: string;
43
44
  exampleQuestionsTitle?: string;
44
45
  inputPlaceholder?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-ask-ai",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "AI-powered Q&A widget for documentation sites",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",
@@ -30,8 +30,10 @@
30
30
  "@radix-ui/react-dialog": "^1.1.3",
31
31
  "@radix-ui/react-scroll-area": "^1.2.2",
32
32
  "@radix-ui/react-slot": "^1.1.1",
33
+ "lowlight": "^3.3.0",
33
34
  "lucide-react": "^0.563.0",
34
35
  "react-markdown": "^10.1.0",
36
+ "rehype-highlight": "^7.0.2",
35
37
  "remark-gfm": "^4.0.1"
36
38
  },
37
39
  "devDependencies": {