@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.
Files changed (63) hide show
  1. package/dist/components/AiChipLabel.d.ts.map +1 -1
  2. package/dist/components/AiContextButton.d.ts +1 -1
  3. package/dist/components/AiContextButton.d.ts.map +1 -1
  4. package/dist/components/AiContextButton.js +3 -2
  5. package/dist/components/AiImageButton.d.ts.map +1 -1
  6. package/dist/components/AiImageButton.js +6 -3
  7. package/dist/components/AiInput.d.ts +1 -1
  8. package/dist/components/AiInput.d.ts.map +1 -1
  9. package/dist/components/AiInput.js +4 -4
  10. package/dist/components/AiModelSelect.d.ts.map +1 -1
  11. package/dist/components/AiPromptPanel.js +30 -6
  12. package/dist/components/AiSelect.d.ts +1 -1
  13. package/dist/components/AiSelect.d.ts.map +1 -1
  14. package/dist/components/AiSelect.js +1 -1
  15. package/dist/components/AiStatusButton.d.ts.map +1 -1
  16. package/dist/components/AiStatusButton.js +2 -2
  17. package/dist/components/AiTextarea.d.ts +2 -1
  18. package/dist/components/AiTextarea.d.ts.map +1 -1
  19. package/dist/components/AiTextarea.js +16 -6
  20. package/dist/components/ErrorToast.js +3 -3
  21. package/dist/components/LBConnectButton.d.ts.map +1 -1
  22. package/dist/components/LBConnectButton.js +1 -3
  23. package/dist/components/LBKeyPicker.js +9 -9
  24. package/dist/components/LBSigninModal.d.ts.map +1 -1
  25. package/dist/components/UsageToast.d.ts +3 -3
  26. package/dist/components/UsageToast.d.ts.map +1 -1
  27. package/dist/context/I18nContext.d.ts +1 -1
  28. package/dist/context/I18nContext.d.ts.map +1 -1
  29. package/dist/context/I18nContext.js +1 -1
  30. package/dist/context/LBAuthProvider.d.ts.map +1 -1
  31. package/dist/context/LBAuthProvider.js +12 -5
  32. package/dist/examples/AiImageGenerator.js +1 -1
  33. package/dist/hooks/useAiStatus.d.ts.map +1 -1
  34. package/dist/hooks/useAiStatus.js +43 -5
  35. package/dist/hooks/useLoadingTimer.d.ts.map +1 -1
  36. package/dist/hooks/useLoadingTimer.js +11 -7
  37. package/dist/styles.css +3 -3
  38. package/dist/utils/errorHandler.d.ts +2 -2
  39. package/dist/utils/errorHandler.d.ts.map +1 -1
  40. package/package.json +2 -2
  41. package/src/components/AiChipLabel.tsx +1 -4
  42. package/src/components/AiContextButton.tsx +15 -6
  43. package/src/components/AiImageButton.tsx +10 -4
  44. package/src/components/AiInput.tsx +9 -4
  45. package/src/components/AiModelSelect.tsx +3 -1
  46. package/src/components/AiPromptPanel.tsx +83 -49
  47. package/src/components/AiSelect.tsx +2 -2
  48. package/src/components/AiStatusButton.tsx +48 -27
  49. package/src/components/AiTextarea.tsx +25 -9
  50. package/src/components/ErrorToast.tsx +3 -3
  51. package/src/components/LBApiKeySelector.tsx +5 -5
  52. package/src/components/LBConnectButton.tsx +1 -3
  53. package/src/components/LBKeyPicker.tsx +10 -10
  54. package/src/components/LBSigninModal.tsx +12 -9
  55. package/src/components/UsageToast.tsx +4 -4
  56. package/src/context/I18nContext.tsx +6 -2
  57. package/src/context/LBAuthProvider.tsx +12 -5
  58. package/src/examples/AiImageGenerator.tsx +1 -1
  59. package/src/hooks/useAiStatus.ts +47 -5
  60. package/src/hooks/useLoadingTimer.ts +14 -8
  61. package/src/styles.css +3 -3
  62. package/src/utils/errorHandler.ts +3 -3
  63. 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 12px;
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: 12px;
366
- bottom: 12px;
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: unknown): value is NormalizedErrorLike {
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: unknown): ParsedError {
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: unknown,
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 ModelsResponse {
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: unknown): value is ModelCategory {
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: unknown): value is ModelInfo {
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 (