hanbiro-react16-sdk 1.0.0
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/README.md +1 -0
- package/dist/components/ChatAIDraft/CustomAIIcon.d.ts +8 -0
- package/dist/components/ChatAIDraft/List.d.ts +10 -0
- package/dist/components/ChatAIDraft/SettingPopper.d.ts +23 -0
- package/dist/components/ChatAIDraft/TypingText.d.ts +7 -0
- package/dist/components/ChatAIDraft/constants.d.ts +10 -0
- package/dist/components/ChatAIDraft/helper.d.ts +9 -0
- package/dist/components/ChatAIDraft/index.d.ts +37 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +4 -0
- package/dist/components.d.ts +1 -0
- package/dist/index-DuSzMCvF.mjs +2131 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/types/index.d.ts +4 -0
- package/package.json +75 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# hanbiro-react16-sdk
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LabelValue } from '../../types';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface SettingPopperProps {
|
|
4
|
+
lang: LabelValue | null;
|
|
5
|
+
setLang: (lang: LabelValue | null) => void;
|
|
6
|
+
originalEmail: string;
|
|
7
|
+
setOriginalEmail: (email: string) => void;
|
|
8
|
+
getEditorContent?: () => string;
|
|
9
|
+
}
|
|
10
|
+
interface SettingPopperState {
|
|
11
|
+
open: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare class SettingPopper extends React.Component<SettingPopperProps, SettingPopperState> {
|
|
14
|
+
private containerRef;
|
|
15
|
+
constructor(props: SettingPopperProps);
|
|
16
|
+
componentDidMount(): void;
|
|
17
|
+
componentWillUnmount(): void;
|
|
18
|
+
handleClickOutside: (event: MouseEvent) => void;
|
|
19
|
+
togglePopper: () => void;
|
|
20
|
+
handleLangChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
21
|
+
render(): React.JSX.Element;
|
|
22
|
+
}
|
|
23
|
+
export default SettingPopper;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface LabelValue {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const TONE_OPTIONS: LabelValue[];
|
|
6
|
+
export declare const LENGTH_OPTIONS: LabelValue[];
|
|
7
|
+
export interface Lang extends LabelValue {
|
|
8
|
+
extra?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const LANG_OPTIONS: Lang[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Options {
|
|
2
|
+
setContent: (nVal: string) => void;
|
|
3
|
+
setIsLoading: (nVal: boolean) => void;
|
|
4
|
+
setConversationId: (nVal: string) => void;
|
|
5
|
+
signer: any;
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function callAI(params: any, { setContent, setIsLoading, setConversationId, signer, baseUrl }: Options): Promise<string>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { LabelValue } from '../../types';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface AIPaneProps {
|
|
4
|
+
getEditorContent?: () => string;
|
|
5
|
+
onApply: (params: {
|
|
6
|
+
html: string;
|
|
7
|
+
}) => void;
|
|
8
|
+
signer?: any;
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface AIMessage {
|
|
12
|
+
id: string;
|
|
13
|
+
question: string;
|
|
14
|
+
subject: string;
|
|
15
|
+
body: string;
|
|
16
|
+
created_at: number;
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface AIPaneState {
|
|
20
|
+
message: string;
|
|
21
|
+
messages: AIMessage[];
|
|
22
|
+
isSending: boolean;
|
|
23
|
+
lang: LabelValue | null;
|
|
24
|
+
conversationId: string;
|
|
25
|
+
originalEmail: string;
|
|
26
|
+
}
|
|
27
|
+
declare class ChatAIDraft extends React.Component<AIPaneProps, AIPaneState> {
|
|
28
|
+
constructor(props: AIPaneProps);
|
|
29
|
+
setAiContext: (nVal: string) => void;
|
|
30
|
+
handleMessageChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
31
|
+
handleSubmit: () => Promise<void>;
|
|
32
|
+
handleKeyDown: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
33
|
+
setLang: (lang: LabelValue | null) => void;
|
|
34
|
+
setOriginalEmail: (email: string) => void;
|
|
35
|
+
render(): React.JSX.Element;
|
|
36
|
+
}
|
|
37
|
+
export default ChatAIDraft;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/index'
|