@smart-cloud/ai-kit-ui 1.4.11 → 1.4.13

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 (45) hide show
  1. package/dist/ShadowBoundary.d.ts +29 -0
  2. package/dist/ai-chatbot/AiChatbot.d.ts +15 -0
  3. package/dist/ai-chatbot/attachmentStorage.d.ts +19 -0
  4. package/dist/ai-chatbot/index.d.ts +1 -0
  5. package/dist/ai-feature/AiFeature.d.ts +28 -0
  6. package/dist/ai-feature/AiFeatureBorder.d.ts +5 -0
  7. package/dist/ai-feature/ProofreadDiff.d.ts +13 -0
  8. package/dist/ai-feature/index.d.ts +2 -0
  9. package/dist/ai-feature/utils.d.ts +1 -0
  10. package/dist/doc-search/DocSearch.d.ts +18 -0
  11. package/dist/doc-search/index.d.ts +1 -0
  12. package/dist/i18n/ar.d.ts +1 -0
  13. package/dist/i18n/de.d.ts +1 -0
  14. package/dist/i18n/en.d.ts +1 -0
  15. package/dist/i18n/es.d.ts +1 -0
  16. package/dist/i18n/fr.d.ts +1 -0
  17. package/dist/i18n/he.d.ts +1 -0
  18. package/dist/i18n/hi.d.ts +1 -0
  19. package/dist/i18n/hu.d.ts +1 -0
  20. package/dist/i18n/id.d.ts +1 -0
  21. package/dist/i18n/index.d.ts +1 -0
  22. package/dist/i18n/it.d.ts +1 -0
  23. package/dist/i18n/ja.d.ts +1 -0
  24. package/dist/i18n/ko.d.ts +1 -0
  25. package/dist/i18n/nb.d.ts +1 -0
  26. package/dist/i18n/nl.d.ts +1 -0
  27. package/dist/i18n/pl.d.ts +1 -0
  28. package/dist/i18n/pt.d.ts +1 -0
  29. package/dist/i18n/ru.d.ts +1 -0
  30. package/dist/i18n/sv.d.ts +1 -0
  31. package/dist/i18n/th.d.ts +1 -0
  32. package/dist/i18n/tr.d.ts +1 -0
  33. package/dist/i18n/ua.d.ts +1 -0
  34. package/dist/i18n/zh.d.ts +1 -0
  35. package/dist/index.cjs +6 -6
  36. package/dist/index.d.ts +6 -112
  37. package/dist/index.js +6 -6
  38. package/dist/poweredBy.d.ts +4 -0
  39. package/dist/useAiRun.d.ts +38 -0
  40. package/dist/withAiKitShell.d.ts +7 -0
  41. package/package.json +28 -26
  42. package/src/doc-search/DocSearch.tsx +85 -39
  43. package/tsconfig.types.json +13 -0
  44. package/tsup.config.ts +1 -1
  45. package/dist/index.d.cts +0 -112
package/dist/index.d.ts CHANGED
@@ -1,112 +1,6 @@
1
- import * as _smart_cloud_ai_kit_core from '@smart-cloud/ai-kit-core';
2
- import { AiModePreference, HistoryStorageMode, AiChatbotLabels, AiKitStatusEvent, AiKitLanguageCode, AiWorkerProps } from '@smart-cloud/ai-kit-core';
3
- import * as React from 'react';
4
- import React__default, { FC, ComponentType } from 'react';
5
-
6
- declare const AiFeature: FC<_smart_cloud_ai_kit_core.AiWorkerProps & {
7
- mode: _smart_cloud_ai_kit_core.AiFeatureMode;
8
- context?: _smart_cloud_ai_kit_core.ContextKind;
9
- modeOverride?: AiModePreference;
10
- autoRun?: boolean;
11
- onDeviceTimeout?: number;
12
- editable?: boolean;
13
- acceptButtonTitle?: string;
14
- showRegenerateOnBackendButton?: boolean;
15
- optionsDisplay?: "collapse" | "horizontal" | "vertical";
16
- default?: _smart_cloud_ai_kit_core.AiFeatureOptions & {
17
- getText?: Promise<string> | (() => Promise<string>);
18
- image?: Blob;
19
- };
20
- allowOverride?: {
21
- text?: boolean;
22
- instructions?: boolean;
23
- tone?: boolean;
24
- length?: boolean;
25
- type?: boolean;
26
- outputLanguage?: boolean;
27
- outputFormat?: boolean;
28
- };
29
- onAccept?: (result: unknown) => void;
30
- onOptionsChanged?: (options: _smart_cloud_ai_kit_core.AiFeatureOptions) => void;
31
- } & Partial<_smart_cloud_ai_kit_core.AiWorkerProps>>;
32
-
33
- declare const markdownToHtml: (markdown: string) => Promise<string>;
34
-
35
- declare const DEFAULT_CHATBOT_LABELS: Required<AiChatbotLabels>;
36
- declare const AiChatbot: React__default.FC<_smart_cloud_ai_kit_core.AiWorkerProps & {
37
- context?: _smart_cloud_ai_kit_core.ContextKind;
38
- placeholder?: string;
39
- maxImages?: number;
40
- maxImageBytes?: number;
41
- previewMode?: boolean;
42
- historyStorage?: HistoryStorageMode;
43
- emptyHistoryAfterDays?: number;
44
- labels?: AiChatbotLabels;
45
- openButtonIconLayout?: _smart_cloud_ai_kit_core.OpenButtonIconLayout;
46
- openButtonPosition?: _smart_cloud_ai_kit_core.OpenButtonPosition;
47
- } & Partial<_smart_cloud_ai_kit_core.AiWorkerProps>>;
48
-
49
- declare const DocSearch: FC<_smart_cloud_ai_kit_core.AiWorkerProps & {
50
- context?: _smart_cloud_ai_kit_core.ContextKind;
51
- autoRun?: boolean;
52
- title?: string;
53
- getSearchText?: () => string;
54
- searchButtonIcon?: string;
55
- showSearchButtonTitle?: boolean;
56
- showSearchButtonIcon?: boolean;
57
- showSources?: boolean;
58
- topK?: number;
59
- snippetMaxChars?: number;
60
- onClickDoc?: (doc: _smart_cloud_ai_kit_core.RetrievedDoc) => void;
61
- enableUserFilters?: boolean;
62
- availableCategories?: Record<string, string[]>;
63
- availableTags?: string[];
64
- } & Partial<_smart_cloud_ai_kit_core.AiWorkerProps>>;
65
-
66
- type AiRunState<T> = {
67
- busy: boolean;
68
- error: string | null;
69
- statusEvent: AiKitStatusEvent | null;
70
- result: T | null;
71
- isCancelled: boolean;
72
- /** Last known execution source (best-effort). */
73
- lastSource: "on-device" | "backend" | null;
74
- };
75
- type AiFeatureFunction<T> = (args: {
76
- signal: AbortSignal;
77
- onStatus: (e: AiKitStatusEvent) => void;
78
- }) => Promise<T>;
79
- type UseAiRunResult<T> = AiRunState<T> & {
80
- run: (func: AiFeatureFunction<T>) => Promise<T | null>;
81
- cancel: () => void;
82
- reset: () => void;
83
- /** Current AbortSignal, if a run is in-flight. */
84
- signal: AbortSignal | null;
85
- };
86
- /**
87
- * Returns true if backend routing is configured in the current AiKit settings.
88
- *
89
- * This is intentionally conservative: it only checks *configuration*, not reachability.
90
- */
91
- declare function isBackendConfigured(): Promise<boolean>;
92
- declare function readDefaultOutputLanguage(): AiKitLanguageCode;
93
- /**
94
- * Removes a single surrounding Markdown code fence.
95
- *
96
- * Handles common model outputs like:
97
- * ```json
98
- * {"a":1}
99
- * ```
100
- */
101
- declare function stripCodeFence(text: string): string;
102
- declare function useAiRun<T>(): UseAiRunResult<T>;
103
-
104
- type AiKitShellInjectedProps = {
105
- language?: string;
106
- rootElement: HTMLElement;
107
- };
108
- declare function withAiKitShell<P extends object>(RootComponent: ComponentType<P & AiKitShellInjectedProps>, propOverrides?: Partial<AiWorkerProps>): React.FC<P & Partial<AiWorkerProps>>;
109
-
110
- declare const translations: Record<string, Record<string, string>>;
111
-
112
- export { AiChatbot, AiFeature, type AiFeatureFunction, type AiRunState, DEFAULT_CHATBOT_LABELS, DocSearch, type UseAiRunResult, isBackendConfigured, markdownToHtml, readDefaultOutputLanguage, stripCodeFence, translations, useAiRun, withAiKitShell };
1
+ export * from "./ai-feature";
2
+ export * from "./ai-chatbot";
3
+ export * from "./doc-search";
4
+ export * from "./useAiRun";
5
+ export { withAiKitShell } from "./withAiKitShell";
6
+ export { translations } from "./i18n";