bi-sdk-react 0.0.16 → 0.0.18

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.
@@ -5,11 +5,14 @@ type PageContextType = {
5
5
  plugins: PluginType[];
6
6
  schema: PageSchema;
7
7
  selectedItem?: SchemaItemType | null;
8
+ atItems?: SchemaItemType[] | null;
8
9
  setSchema: React.Dispatch<React.SetStateAction<PageSchema>>;
9
10
  setSelectedItem: React.Dispatch<React.SetStateAction<SchemaItemType | null>>;
10
11
  updateSelectedItem: (selectedItem?: Partial<SchemaItemType> | null) => void;
11
12
  forceUpdate: () => void;
12
13
  datasetSelector?: DatasetSelectorFunction;
14
+ onAddAtItem?: (item: SchemaItemType) => void;
15
+ onRemoveAtItem?: (item: SchemaItemType, index: number) => void;
13
16
  fetch?: FetchType;
14
17
  };
15
18
  export declare const PageContext: import("react").Context<PageContextType>;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { FetchType } from "../typing";
2
+ import { FetchType, SchemaItemType } from "../typing";
3
3
  export type ChatInputProps = {
4
4
  value?: string;
5
5
  placeholder?: string;
@@ -12,6 +12,7 @@ export type ChatInputProps = {
12
12
  }[];
13
13
  agentId?: string | number | null;
14
14
  attachments?: any[];
15
+ atItems?: SchemaItemType[] | null;
15
16
  onInput?: (text: string) => void;
16
17
  onSubmit?: (data: {
17
18
  message: string;
@@ -28,6 +29,7 @@ export type ChatInputProps = {
28
29
  onUpdateAgentId?: (id: string | number | null) => void;
29
30
  onUpdateAttachments?: (list: any[]) => void;
30
31
  onUploading?: FetchType["upload"];
32
+ onRemoveAtItem?: (item: SchemaItemType, index: number) => void;
31
33
  style?: React.CSSProperties;
32
34
  };
33
35
  export declare const ChatInput: React.ForwardRefExoticComponent<ChatInputProps & React.RefAttributes<{
@@ -13,10 +13,16 @@ export type ChatRequestType = {
13
13
  page?: PageSchema | null;
14
14
  pageItems?: SchemaItemType[] | null;
15
15
  };
16
+ export type PageItemEffectType = {
17
+ targetId: string;
18
+ position: "before" | "after" | "replace" | "insert";
19
+ insertSlot?: string | null;
20
+ pageItem: PageSchema;
21
+ };
16
22
  export type ChatResponseAnswerEffectType = {
17
23
  datasets?: DataSetType[] | null;
18
24
  schema?: PageSchema;
19
- pageItems?: SchemaItemType[] | null;
25
+ pageItems?: PageItemEffectType[] | null;
20
26
  };
21
27
  export type ChatResponseAnswerPlanType = {
22
28
  name: string;
@@ -59,6 +65,7 @@ export type ChatMessageType = {
59
65
  id: string | number;
60
66
  name: string;
61
67
  }[];
68
+ atItems?: SchemaItemType[] | null;
62
69
  createdAt: string;
63
70
  sending?: boolean;
64
71
  };