@lastbrain/ai-ui-react 1.0.74 → 1.0.76
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/AiChipLabel.d.ts.map +1 -1
- package/dist/components/AiContextButton.d.ts +1 -1
- package/dist/components/AiContextButton.d.ts.map +1 -1
- package/dist/components/AiContextButton.js +3 -2
- package/dist/components/AiImageButton.d.ts.map +1 -1
- package/dist/components/AiImageButton.js +6 -3
- package/dist/components/AiInput.d.ts +1 -1
- package/dist/components/AiInput.d.ts.map +1 -1
- package/dist/components/AiInput.js +4 -4
- package/dist/components/AiModelSelect.d.ts.map +1 -1
- package/dist/components/AiPromptPanel.js +30 -6
- package/dist/components/AiSelect.d.ts +1 -1
- package/dist/components/AiSelect.d.ts.map +1 -1
- package/dist/components/AiSelect.js +1 -1
- package/dist/components/AiStatusButton.d.ts.map +1 -1
- package/dist/components/AiStatusButton.js +2 -2
- package/dist/components/AiTextarea.d.ts +2 -1
- package/dist/components/AiTextarea.d.ts.map +1 -1
- package/dist/components/AiTextarea.js +16 -6
- package/dist/components/ErrorToast.js +3 -3
- package/dist/components/LBConnectButton.d.ts.map +1 -1
- package/dist/components/LBConnectButton.js +1 -3
- package/dist/components/LBKeyPicker.js +9 -9
- package/dist/components/LBSigninModal.d.ts.map +1 -1
- package/dist/components/UsageToast.d.ts +3 -3
- package/dist/components/UsageToast.d.ts.map +1 -1
- package/dist/context/I18nContext.d.ts +1 -1
- package/dist/context/I18nContext.d.ts.map +1 -1
- package/dist/context/I18nContext.js +1 -1
- package/dist/context/LBAuthProvider.d.ts.map +1 -1
- package/dist/context/LBAuthProvider.js +12 -5
- package/dist/examples/AiImageGenerator.js +1 -1
- package/dist/hooks/useAiStatus.d.ts.map +1 -1
- package/dist/hooks/useAiStatus.js +43 -5
- package/dist/hooks/useLoadingTimer.d.ts.map +1 -1
- package/dist/hooks/useLoadingTimer.js +11 -7
- package/dist/styles.css +3 -3
- package/dist/utils/errorHandler.d.ts +2 -2
- package/dist/utils/errorHandler.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/AiChipLabel.tsx +1 -4
- package/src/components/AiContextButton.tsx +15 -6
- package/src/components/AiImageButton.tsx +10 -4
- package/src/components/AiInput.tsx +9 -4
- package/src/components/AiModelSelect.tsx +3 -1
- package/src/components/AiPromptPanel.tsx +83 -49
- package/src/components/AiSelect.tsx +2 -2
- package/src/components/AiStatusButton.tsx +48 -27
- package/src/components/AiTextarea.tsx +25 -9
- package/src/components/ErrorToast.tsx +3 -3
- package/src/components/LBApiKeySelector.tsx +5 -5
- package/src/components/LBConnectButton.tsx +1 -3
- package/src/components/LBKeyPicker.tsx +10 -10
- package/src/components/LBSigninModal.tsx +12 -9
- package/src/components/UsageToast.tsx +4 -4
- package/src/context/I18nContext.tsx +6 -2
- package/src/context/LBAuthProvider.tsx +12 -5
- package/src/examples/AiImageGenerator.tsx +1 -1
- package/src/hooks/useAiStatus.ts +47 -5
- package/src/hooks/useLoadingTimer.ts +14 -8
- package/src/styles.css +3 -3
- package/src/utils/errorHandler.ts +3 -3
- package/src/utils/modelManagement.ts +3 -3
package/src/styles.css
CHANGED
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
align-items: center;
|
|
196
196
|
gap: 10px;
|
|
197
197
|
min-height: var(--ai-control-h, var(--ai-size-md-h));
|
|
198
|
-
padding: 0
|
|
198
|
+
padding: 0 8px;
|
|
199
199
|
border-radius: var(--ai-radius-current, var(--ai-radius-full));
|
|
200
200
|
border: 1px solid var(--ai-border);
|
|
201
201
|
background:
|
|
@@ -362,8 +362,8 @@
|
|
|
362
362
|
.ai-shell--textarea .ai-control-action,
|
|
363
363
|
.ai-shell--textarea .ai-spark {
|
|
364
364
|
position: absolute;
|
|
365
|
-
right:
|
|
366
|
-
bottom:
|
|
365
|
+
right: 8px;
|
|
366
|
+
bottom: 8px;
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
/* Generic buttons */
|
|
@@ -13,7 +13,7 @@ type NormalizedErrorLike = {
|
|
|
13
13
|
message: string;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
function isNormalizedErrorLike(value:
|
|
16
|
+
function isNormalizedErrorLike(value: any): value is NormalizedErrorLike {
|
|
17
17
|
if (!value || typeof value !== "object") {
|
|
18
18
|
return false;
|
|
19
19
|
}
|
|
@@ -24,7 +24,7 @@ function isNormalizedErrorLike(value: unknown): value is NormalizedErrorLike {
|
|
|
24
24
|
/**
|
|
25
25
|
* Parse et uniformise la gestion des erreurs des composants AI
|
|
26
26
|
*/
|
|
27
|
-
export function parseAIError(error:
|
|
27
|
+
export function parseAIError(error: any): ParsedError {
|
|
28
28
|
// Si l'erreur est déjà un objet normalisé
|
|
29
29
|
if (isNormalizedErrorLike(error)) {
|
|
30
30
|
return {
|
|
@@ -173,7 +173,7 @@ export interface ErrorToastCallback {
|
|
|
173
173
|
* @param showInternalToast Callback interne optionnelle pour afficher un toast dans le composant
|
|
174
174
|
*/
|
|
175
175
|
export function handleAIError(
|
|
176
|
-
error:
|
|
176
|
+
error: any,
|
|
177
177
|
onToast?: ErrorToastCallback,
|
|
178
178
|
showInternalToast?: (error: { message: string; code?: string }) => void
|
|
179
179
|
): void {
|
|
@@ -15,7 +15,7 @@ interface ProvidersResponse {
|
|
|
15
15
|
providers?: Provider[];
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
interface
|
|
18
|
+
interface _ModelsResponse {
|
|
19
19
|
models?: ModelInfo[];
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -32,7 +32,7 @@ interface ModelInfo {
|
|
|
32
32
|
costPer1M?: number;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
function isModelCategory(value:
|
|
35
|
+
function isModelCategory(value: any): value is ModelCategory {
|
|
36
36
|
return (
|
|
37
37
|
value === "text" ||
|
|
38
38
|
value === "image" ||
|
|
@@ -41,7 +41,7 @@ function isModelCategory(value: unknown): value is ModelCategory {
|
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
function isModelInfo(value:
|
|
44
|
+
function isModelInfo(value: any): value is ModelInfo {
|
|
45
45
|
if (!value || typeof value !== "object") return false;
|
|
46
46
|
const v = value as Record<string, unknown>;
|
|
47
47
|
return (
|