goji-search 1.1.4 → 2.0.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.
Files changed (26) hide show
  1. package/dist/goji-search/assets/avatar1.jpeg +0 -0
  2. package/dist/goji-search/assets/avatar2.jpeg +0 -0
  3. package/dist/goji-search/assets/avatar3.jpeg +0 -0
  4. package/dist/goji-search/assets/chat-logo.png +0 -0
  5. package/dist/goji-search/components/elements/closing-card.d.ts +20 -0
  6. package/dist/goji-search/components/elements/inspiration-menu.d.ts +3 -1
  7. package/dist/goji-search/components/elements/language-selector.d.ts +10 -0
  8. package/dist/goji-search/components/elements/message-list.d.ts +3 -1
  9. package/dist/goji-search/components/elements/search-input.d.ts +3 -1
  10. package/dist/goji-search/components/goji-search-component.d.ts +21 -2
  11. package/dist/goji-search/hooks/useCompanyTheme.d.ts +21 -0
  12. package/dist/goji-search/lib/goji-client.d.ts +24 -4
  13. package/dist/index.js +11767 -4
  14. package/package.json +20 -17
  15. package/dist/goji-search/components/elements/action-buttons.js +0 -164
  16. package/dist/goji-search/components/elements/auto-expanding-textarea.js +0 -46
  17. package/dist/goji-search/components/elements/calendar-integration.js +0 -49
  18. package/dist/goji-search/components/elements/inspiration-menu.js +0 -87
  19. package/dist/goji-search/components/elements/message-list.js +0 -301
  20. package/dist/goji-search/components/elements/search-input.js +0 -136
  21. package/dist/goji-search/components/elements/suggested-questions.js +0 -57
  22. package/dist/goji-search/components/goji-search-component.js +0 -679
  23. package/dist/goji-search/components/goji-search.css +0 -1
  24. package/dist/goji-search/config/company.js +0 -100
  25. package/dist/goji-search/lib/calendar-config.js +0 -10
  26. package/dist/goji-search/lib/goji-client.js +0 -229
@@ -0,0 +1,20 @@
1
+ /**
2
+ * P0 Closing Card Component
3
+ *
4
+ * Displays a CTA card to book a demo/call when high sales intent is detected.
5
+ * - Shows expanded for 5 seconds, then shrinks to compact
6
+ * - Auto-dismisses after 30 seconds total
7
+ * - Uses real team member photos (matches GojiDemo-UI exactly)
8
+ * - Prevents follow-up questions while visible
9
+ * - Stops showing after booking completion
10
+ */
11
+ import type { CTACard } from "../../lib/goji-client";
12
+ interface ClosingCardProps {
13
+ ctaCard: CTACard;
14
+ sessionId?: string;
15
+ onBookCall?: () => void;
16
+ onDismiss?: () => void;
17
+ className?: string;
18
+ }
19
+ export declare function ClosingCard({ ctaCard, sessionId, onBookCall, onDismiss, className }: ClosingCardProps): import("react/jsx-runtime").JSX.Element | null;
20
+ export {};
@@ -1,8 +1,10 @@
1
+ import type { ReactNode } from "react";
1
2
  interface InspirationMenuProps {
2
3
  questions: string[];
3
4
  onQuestionClick: (question: string) => void;
4
5
  onClose: () => void;
5
6
  suggestedLabel?: string;
7
+ languageSelector?: ReactNode;
6
8
  }
7
- export declare function InspirationMenu({ questions, onQuestionClick, onClose, suggestedLabel }: InspirationMenuProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function InspirationMenu({ questions, onQuestionClick, onClose, suggestedLabel, languageSelector }: InspirationMenuProps): import("react/jsx-runtime").JSX.Element;
8
10
  export {};
@@ -0,0 +1,10 @@
1
+ import { type SupportedLanguage } from "../../config/company";
2
+ interface LanguageSelectorProps {
3
+ selectedLanguage: SupportedLanguage;
4
+ onLanguageChange: (lang: SupportedLanguage) => void;
5
+ showMenu: boolean;
6
+ onToggleMenu: () => void;
7
+ onCloseMenu: () => void;
8
+ }
9
+ export declare function LanguageSelector({ selectedLanguage, onLanguageChange, showMenu, onToggleMenu, onCloseMenu, }: LanguageSelectorProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -17,6 +17,8 @@ interface MessageListProps {
17
17
  isStreaming: boolean;
18
18
  aiAvatarSrc?: string;
19
19
  size?: "m" | "l" | "xl" | "s" | "xs";
20
+ brandName?: string;
21
+ userBackgroundColor?: string;
20
22
  }
21
- export declare function MessageList({ messages, isStreaming, aiAvatarSrc, size, }: MessageListProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function MessageList({ messages, isStreaming, aiAvatarSrc, size, brandName, userBackgroundColor, }: MessageListProps): import("react/jsx-runtime").JSX.Element;
22
24
  export {};
@@ -1,4 +1,5 @@
1
1
  import type React from "react";
2
+ import type { ReactNode } from "react";
2
3
  interface SearchInputProps {
3
4
  value: string;
4
5
  onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
@@ -12,6 +13,7 @@ interface SearchInputProps {
12
13
  onInspirationClick: (question: string) => void;
13
14
  sparkleRef: React.RefObject<HTMLDivElement>;
14
15
  suggestedLabel?: string;
16
+ languageSelector?: ReactNode;
15
17
  }
16
- export declare function SearchInput({ value, onChange, onFocus, onBlur, placeholder, size, setSize, inputRef, inspirationQuestions, onInspirationClick, sparkleRef, suggestedLabel, }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function SearchInput({ value, onChange, onFocus, onBlur, placeholder, size, setSize, inputRef, inspirationQuestions, onInspirationClick, sparkleRef, suggestedLabel, languageSelector, }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
17
19
  export {};
@@ -1,4 +1,3 @@
1
- import "./goji-search.css";
2
1
  export interface GojiSearchComponentProps {
3
2
  /**
4
3
  * Backend API URL for GojiSearch
@@ -6,5 +5,25 @@ export interface GojiSearchComponentProps {
6
5
  * @example "https://api.example.com"
7
6
  */
8
7
  apiUrl?: string;
8
+ /**
9
+ * Company identifier - REQUIRED for multi-tenant branding and data isolation
10
+ * @example "goji"
11
+ */
12
+ companyId: string;
13
+ /**
14
+ * API key for authentication - REQUIRED for multi-tenant security
15
+ * @example "goji_goji_prod_abc123xyz789"
16
+ */
17
+ apiKey: string;
18
+ /**
19
+ * Initial AI color theme in HEX format
20
+ * @default "#4654F7"
21
+ */
22
+ aiColor?: string;
23
+ /**
24
+ * Background color for user messages in HEX format
25
+ * @default "#4654F7"
26
+ */
27
+ userMessageBackgroundColor?: string;
9
28
  }
10
- export declare function GojiSearchComponent({ apiUrl }?: GojiSearchComponentProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare function GojiSearchComponent({ apiUrl, companyId, apiKey, aiColor, userMessageBackgroundColor }: GojiSearchComponentProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ interface CompanyTheme {
2
+ company_id: string;
3
+ name: string;
4
+ logo_url?: string;
5
+ theme: {
6
+ primaryColor: string;
7
+ secondaryColor?: string;
8
+ fontFamily?: string;
9
+ borderRadius?: string;
10
+ position?: string;
11
+ };
12
+ welcome_message: string;
13
+ placeholder_text: string;
14
+ initial_suggestions: string[];
15
+ }
16
+ export declare function useCompanyTheme(apiUrl: string, companyId: string, apiKey: string): {
17
+ theme: CompanyTheme | null;
18
+ loading: boolean;
19
+ error: string | null;
20
+ };
21
+ export {};
@@ -15,11 +15,20 @@ export interface ChatSource {
15
15
  page_type: string;
16
16
  score: number;
17
17
  }
18
+ export interface CTACard {
19
+ type: string;
20
+ reason?: string;
21
+ is_explicit?: boolean;
22
+ lead_score?: number;
23
+ show_avatars?: boolean;
24
+ auto_dismiss_seconds?: number;
25
+ }
18
26
  export interface ChatResponse {
19
27
  session_id: string;
20
28
  answer: string;
21
29
  sources: ChatSource[];
22
30
  suggested_questions?: string[];
31
+ cta_card?: CTACard;
23
32
  }
24
33
  export interface StreamDeltaMessage {
25
34
  type: "chat_delta";
@@ -31,16 +40,18 @@ export interface StreamDoneMessage {
31
40
  answer: string;
32
41
  sources: ChatSource[];
33
42
  suggested_questions?: string[];
43
+ cta_card?: CTACard;
34
44
  }
35
45
  export type StreamMessage = StreamDeltaMessage | StreamDoneMessage;
36
46
  export declare class GojiSearchClient {
37
47
  private baseUrl;
38
48
  private wsUrl;
49
+ private apiKey?;
39
50
  private ws;
40
51
  private currentHandler;
41
52
  private reconnectAttempts;
42
53
  private maxReconnectAttempts;
43
- constructor(baseUrl?: string);
54
+ constructor(baseUrl?: string, apiKey?: string);
44
55
  private ensureWebSocketConnection;
45
56
  closeWebSocket(): void;
46
57
  /**
@@ -75,6 +86,14 @@ export declare class GojiSearchClient {
75
86
  * Clear a chat session
76
87
  */
77
88
  clearSession(sessionId: string): Promise<void>;
89
+ /**
90
+ * Inform backend that the CTA card was dismissed by the user.
91
+ */
92
+ dismissCTA(sessionId: string): Promise<void>;
93
+ /**
94
+ * Inform backend that the user booked a demo via the CTA card.
95
+ */
96
+ completeBooking(sessionId: string): Promise<void>;
78
97
  /**
79
98
  * Health check
80
99
  */
@@ -102,17 +121,18 @@ export declare class GojiSearchClient {
102
121
  }>;
103
122
  }
104
123
  /**
105
- * Create a GojiSearch client instance with custom API URL
124
+ * Create a GojiSearch client instance with custom API URL and API key
106
125
  *
107
126
  * @param apiUrl - Backend API URL (default: http://localhost:8000)
127
+ * @param apiKey - API key for authentication (optional)
108
128
  * @returns GojiSearchClient instance
109
129
  *
110
130
  * @example
111
131
  * ```tsx
112
- * const client = createGojiClient("https://api.myapp.com")
132
+ * const client = createGojiClient("https://api.myapp.com", "goji_company_prod_xyz")
113
133
  * ```
114
134
  */
115
- export declare function createGojiClient(apiUrl?: string): GojiSearchClient;
135
+ export declare function createGojiClient(apiUrl?: string, apiKey?: string): GojiSearchClient;
116
136
  /**
117
137
  * Default client instance for convenience (points to localhost)
118
138
  * For production use, create your own instance with createGojiClient()