@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
@@ -0,0 +1,29 @@
1
+ import { SetStateAction } from "react";
2
+ export type ShadowBoundaryMode = "local" | "overlay";
3
+ export type ShadowBoundaryProps = {
4
+ /** Stylesheets to inject into the shadow root (as <link rel="stylesheet">). */
5
+ stylesheets: string[];
6
+ /** ID of the element inside the shadow root used as the portal target. */
7
+ rootElementId: string;
8
+ /** Variation of the shadow boundary behavior. */
9
+ variation?: "default" | "modal";
10
+ /**
11
+ * Where to create the shadow root:
12
+ * - "local": attach shadow to this component's host element (keeps layout positioning).
13
+ * - "overlay": attach shadow to a singleton element in top (or self) document (always on top).
14
+ */
15
+ mode?: ShadowBoundaryMode;
16
+ /**
17
+ * For mode="overlay": host id in the top (or self) document.
18
+ * Same id everywhere => singleton overlay host.
19
+ */
20
+ overlayRootId?: string;
21
+ setHost: React.Dispatch<SetStateAction<HTMLElement | null>>;
22
+ children: (api: {
23
+ /** Portal target element inside the shadow root. */
24
+ rootElement: HTMLDivElement;
25
+ /** Shadow root instance. */
26
+ shadowRoot: ShadowRoot;
27
+ }) => React.ReactNode;
28
+ };
29
+ export declare function ShadowBoundary({ stylesheets, children, rootElementId, mode, overlayRootId, setHost, }: ShadowBoundaryProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { type AiChatbotLabels, type HistoryStorageMode } from "@smart-cloud/ai-kit-core";
2
+ import React from "react";
3
+ export declare const DEFAULT_CHATBOT_LABELS: Required<AiChatbotLabels>;
4
+ export declare const AiChatbot: React.FC<import("@smart-cloud/ai-kit-core").AiWorkerProps & {
5
+ context?: import("@smart-cloud/ai-kit-core").ContextKind;
6
+ placeholder?: string;
7
+ maxImages?: number;
8
+ maxImageBytes?: number;
9
+ previewMode?: boolean;
10
+ historyStorage?: HistoryStorageMode;
11
+ emptyHistoryAfterDays?: number;
12
+ labels?: AiChatbotLabels;
13
+ openButtonIconLayout?: import("@smart-cloud/ai-kit-core").OpenButtonIconLayout;
14
+ openButtonPosition?: import("@smart-cloud/ai-kit-core").OpenButtonPosition;
15
+ } & Partial<import("@smart-cloud/ai-kit-core").AiWorkerProps>>;
@@ -0,0 +1,19 @@
1
+ export type StoredAttachment = {
2
+ id: string;
3
+ name: string;
4
+ type: string;
5
+ size: number;
6
+ blob: Blob;
7
+ createdAt: number;
8
+ };
9
+ export declare function persistAttachmentBlob(id: string, blob: Blob, meta: {
10
+ name: string;
11
+ type: string;
12
+ size: number;
13
+ }): Promise<string | null>;
14
+ export declare function loadAttachmentBlob(id: string): Promise<StoredAttachment | null>;
15
+ export declare function deleteAttachmentBlob(id: string): Promise<void>;
16
+ export declare function clearAllAttachments(): Promise<void>;
17
+ export declare function cleanupDanglingAttachments(validIds: Set<string>): Promise<void>;
18
+ export declare function getAllAttachments(): Promise<StoredAttachment[]>;
19
+ export declare function enforceStorageQuota(): Promise<void>;
@@ -0,0 +1 @@
1
+ export { AiChatbot, DEFAULT_CHATBOT_LABELS } from "./AiChatbot";
@@ -0,0 +1,28 @@
1
+ import { type AiModePreference } from "@smart-cloud/ai-kit-core";
2
+ import { FC } from "react";
3
+ export declare const AiFeature: FC<import("@smart-cloud/ai-kit-core").AiWorkerProps & {
4
+ mode: import("@smart-cloud/ai-kit-core").AiFeatureMode;
5
+ context?: import("@smart-cloud/ai-kit-core").ContextKind;
6
+ modeOverride?: AiModePreference;
7
+ autoRun?: boolean;
8
+ onDeviceTimeout?: number;
9
+ editable?: boolean;
10
+ acceptButtonTitle?: string;
11
+ showRegenerateOnBackendButton?: boolean;
12
+ optionsDisplay?: "collapse" | "horizontal" | "vertical";
13
+ default?: import("@smart-cloud/ai-kit-core").AiFeatureOptions & {
14
+ getText?: Promise<string> | (() => Promise<string>);
15
+ image?: Blob;
16
+ };
17
+ allowOverride?: {
18
+ text?: boolean;
19
+ instructions?: boolean;
20
+ tone?: boolean;
21
+ length?: boolean;
22
+ type?: boolean;
23
+ outputLanguage?: boolean;
24
+ outputFormat?: boolean;
25
+ };
26
+ onAccept?: (result: unknown) => void;
27
+ onOptionsChanged?: (options: import("@smart-cloud/ai-kit-core").AiFeatureOptions) => void;
28
+ } & Partial<import("@smart-cloud/ai-kit-core").AiWorkerProps>>;
@@ -0,0 +1,5 @@
1
+ export declare function AiFeatureBorder({ enabled, working, variation, children, }: React.PropsWithChildren<{
2
+ enabled?: boolean;
3
+ working?: boolean;
4
+ variation?: string;
5
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export type Correction = {
2
+ startIndex: number;
3
+ endIndex: number;
4
+ correction?: string;
5
+ replacement?: string;
6
+ explanation?: string;
7
+ type?: string;
8
+ };
9
+ export type ProofreadDiffProps = {
10
+ original: string;
11
+ corrections: Correction[];
12
+ };
13
+ export declare function ProofreadDiff({ original, corrections }: ProofreadDiffProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { AiFeature } from "./AiFeature";
2
+ export { markdownToHtml } from "./utils";
@@ -0,0 +1 @@
1
+ export declare const markdownToHtml: (markdown: string) => Promise<string>;
@@ -0,0 +1,18 @@
1
+ import { type ContextKind } from "@smart-cloud/ai-kit-core";
2
+ import { FC } from "react";
3
+ export declare const DocSearch: FC<import("@smart-cloud/ai-kit-core").AiWorkerProps & {
4
+ context?: ContextKind;
5
+ autoRun?: boolean;
6
+ title?: string;
7
+ getSearchText?: () => string;
8
+ searchButtonIcon?: string;
9
+ showSearchButtonTitle?: boolean;
10
+ showSearchButtonIcon?: boolean;
11
+ showSources?: boolean;
12
+ topK?: number;
13
+ snippetMaxChars?: number;
14
+ onClickDoc?: (doc: import("@smart-cloud/ai-kit-core").RetrievedDoc) => void;
15
+ enableUserFilters?: boolean;
16
+ availableCategories?: Record<string, string[]>;
17
+ availableTags?: string[];
18
+ } & Partial<import("@smart-cloud/ai-kit-core").AiWorkerProps>>;
@@ -0,0 +1 @@
1
+ export { DocSearch } from "./DocSearch";
@@ -0,0 +1 @@
1
+ export declare const arDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const deDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const enDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const esDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const frDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const heDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const hiDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const huDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const idDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const translations: Record<string, Record<string, string>>;
@@ -0,0 +1 @@
1
+ export declare const itDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const jaDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const koDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const nbDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const nlDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const plDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const ptDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const ruDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const svDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const thDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const trDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const uaDict: Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const zhDict: Record<string, string>;