@cuadra-ai/uikit 0.1.6 → 0.1.7
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/dist/components/WidgetContent.d.ts +60 -0
- package/dist/components/WidgetContent.d.ts.map +1 -0
- package/dist/index.cjs +18 -239
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +2259 -29648
- package/dist/index.mjs.map +1 -1
- package/dist/widget/cuadra-uikit.css +1 -1
- package/dist/widget/cuadra-uikit.umd.js +1 -1
- package/dist/widget/cuadra-uikit.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface CuadraUIKitConfig {
|
|
3
|
+
/** Cuadra API base URL (e.g., 'https://api.cuadra.ai') */
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
/** Proxy URL for backend-handled authentication (e.g., '/api/chat') */
|
|
6
|
+
proxyUrl?: string;
|
|
7
|
+
/** Bearer token for authentication (optional if backend handles auth) */
|
|
8
|
+
sessionToken?: string | null;
|
|
9
|
+
/** Tenant ID for multi-tenant support */
|
|
10
|
+
tenantId?: string;
|
|
11
|
+
/** Chat mode: single thread or multi-thread */
|
|
12
|
+
mode?: 'singleChat' | 'multiChat';
|
|
13
|
+
/** Model selection mode */
|
|
14
|
+
modelMode?: 'selector' | 'fixed';
|
|
15
|
+
/** Model ID (required if modelMode="fixed") */
|
|
16
|
+
modelId?: string;
|
|
17
|
+
/** Callback when model changes (selector mode) */
|
|
18
|
+
onModelChange?: (modelId: string) => void;
|
|
19
|
+
/** Create temporary chats that auto-delete */
|
|
20
|
+
ephemeral?: boolean;
|
|
21
|
+
/** System prompt for the assistant */
|
|
22
|
+
systemPrompt?: string;
|
|
23
|
+
/** Load existing thread (multiChat mode) */
|
|
24
|
+
initialThreadId?: string;
|
|
25
|
+
/** Language/locale for i18n (e.g., 'en', 'es', 'fr') */
|
|
26
|
+
language?: string;
|
|
27
|
+
/** Welcome screen title */
|
|
28
|
+
welcomeTitle?: string;
|
|
29
|
+
/** Welcome screen subtitle */
|
|
30
|
+
welcomeSubtitle?: string;
|
|
31
|
+
/** Extra top padding for thread viewport (e.g., '1rem', '2rem') */
|
|
32
|
+
extraTopPadding?: string;
|
|
33
|
+
/** Suggestions to show in welcome screen */
|
|
34
|
+
suggestions?: Array<{
|
|
35
|
+
/** Suggestion prompt text */
|
|
36
|
+
prompt: string;
|
|
37
|
+
}>;
|
|
38
|
+
/** Show theme toggle button */
|
|
39
|
+
showThemeToggle?: boolean;
|
|
40
|
+
/** Initial theme ('light' | 'dark' | 'system') */
|
|
41
|
+
theme?: 'light' | 'dark' | 'system';
|
|
42
|
+
/** Container element ID (defaults to 'cuadra-chat') */
|
|
43
|
+
containerId?: string;
|
|
44
|
+
/** CSS classes to add to container element */
|
|
45
|
+
containerClass?: string;
|
|
46
|
+
/** Called when an error occurs */
|
|
47
|
+
onError?: (error: Error) => void;
|
|
48
|
+
/** Called when chat is created */
|
|
49
|
+
onChatCreated?: (chatId: string) => void;
|
|
50
|
+
/** Called when thread ID updates */
|
|
51
|
+
onThreadIdUpdate?: (oldId: string, newId: string) => void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Main widget content component - shared between library and widget builds
|
|
55
|
+
* This component does NOT use createRoot - it's a regular React component
|
|
56
|
+
*/
|
|
57
|
+
export declare const WidgetContent: React.FC<{
|
|
58
|
+
config: CuadraUIKitConfig;
|
|
59
|
+
}>;
|
|
60
|
+
//# sourceMappingURL=WidgetContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetContent.d.ts","sourceRoot":"","sources":["../../src/components/WidgetContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAcjF,MAAM,WAAW,iBAAiB;IAEhC,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,QAAQ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