@telia-ace/widget-conversation-flamingo 1.1.52-rc.1 → 1.1.52
Sign up to get free protection for your applications and to get access to all the features.
- package/chat-session.d.ts +31 -0
- package/{conversation-session.d.ts → conversation-feed.d.ts} +3 -6
- package/conversation-platform.d.ts +1 -6
- package/conversation.d.ts +19 -12
- package/index.d.ts +1 -1
- package/index.js +834 -1
- package/index.mjs +4681 -9
- package/models/conversation-entry.d.ts +1 -0
- package/models/conversation-provider.d.ts +8 -3
- package/package.json +2 -3
- package/session-service.d.ts +21 -0
- package/state-machine.d.ts +21 -0
- package/uuid.d.ts +1 -0
- package/conversation-036b72c8.js +0 -810
- package/conversation-83e12020.mjs +0 -3006
- package/index-b1ff7a55.js +0 -3
- package/index-eaede34b.mjs +0 -1199
- package/models/conversation-session-state.d.ts +0 -21
@@ -0,0 +1,31 @@
|
|
1
|
+
import { BehaviorSubject, Subject } from 'rxjs';
|
2
|
+
import { ConversationProvider } from './models/conversation-provider';
|
3
|
+
import { ConversationEntry } from './models/conversation-entry';
|
4
|
+
import Conversation from './conversation';
|
5
|
+
export type SerializedChatSession = {
|
6
|
+
id: string;
|
7
|
+
providerKey: string;
|
8
|
+
providerOptions: Record<string, any>;
|
9
|
+
data: Record<string, any>;
|
10
|
+
};
|
11
|
+
export declare class ChatSession {
|
12
|
+
id: string;
|
13
|
+
providerKey: string;
|
14
|
+
providerOptions: Record<string, any>;
|
15
|
+
private component;
|
16
|
+
provider$: BehaviorSubject<ConversationProvider | null>;
|
17
|
+
private entries$;
|
18
|
+
removeEntryAction$: Subject<ConversationEntry>;
|
19
|
+
private kill$;
|
20
|
+
private isTyping$;
|
21
|
+
data$: BehaviorSubject<Record<string, any>>;
|
22
|
+
complete$: import("rxjs").Observable<void>;
|
23
|
+
constructor(id: string, providerKey: string, providerOptions: Record<string, any>, data: Record<string, any>, component: Conversation);
|
24
|
+
start(): void;
|
25
|
+
entries(): import("rxjs").Observable<ConversationEntry[]>;
|
26
|
+
rehydrate(): void;
|
27
|
+
toStore(): SerializedChatSession;
|
28
|
+
private write;
|
29
|
+
private _addEntryRemoveHandler;
|
30
|
+
private _getProviderFactory;
|
31
|
+
}
|
@@ -1,12 +1,9 @@
|
|
1
|
-
import { ConversationEntry } from './models/conversation-entry';
|
2
1
|
import { LitElement, PropertyValueMap } from 'lit';
|
3
|
-
import {
|
4
|
-
export declare class
|
2
|
+
import { ConversationEntry } from './models/conversation-entry';
|
3
|
+
export declare class ConversationFeed extends LitElement {
|
5
4
|
static styles: import("lit").CSSResult[];
|
6
|
-
loading: boolean;
|
7
|
-
session: ConversationSessionState;
|
8
5
|
entries: ConversationEntry[];
|
9
|
-
|
6
|
+
loading: boolean;
|
10
7
|
updated(_changedProperties: PropertyValueMap<any>): void;
|
11
8
|
render(): import("lit-html").TemplateResult<1>;
|
12
9
|
}
|
@@ -1,14 +1,9 @@
|
|
1
|
-
import { ConversationSessionState } from './models/conversation-session-state';
|
2
1
|
import { ConversationProvider } from './models/conversation-provider';
|
3
2
|
import Conversation from './conversation';
|
4
3
|
import { Container } from '@telia-ace/widget-core-flamingo';
|
5
|
-
export type ProviderFactory = (
|
4
|
+
export type ProviderFactory = (component: Conversation) => ConversationProvider;
|
6
5
|
export declare class ConversationPlatform {
|
7
|
-
sessions: Map<string, ConversationSessionState>;
|
8
6
|
registeredProviders: Map<string, ProviderFactory>;
|
9
|
-
activeSessionId: string | null;
|
10
7
|
static getInstance(container: Container): Promise<ConversationPlatform>;
|
11
8
|
registerProvider(name: string, provider: ProviderFactory): void;
|
12
|
-
createSession(component: Conversation): ConversationSessionState;
|
13
|
-
private getProviderByConfiguration;
|
14
9
|
}
|
package/conversation.d.ts
CHANGED
@@ -1,33 +1,40 @@
|
|
1
1
|
import { LitElement } from 'lit';
|
2
2
|
import { Ref } from 'lit-html/directives/ref.js';
|
3
3
|
import { ConversationPlatform } from './conversation-platform';
|
4
|
-
import { ConversationSessionState } from './models/conversation-session-state';
|
5
4
|
import { Observable } from 'rxjs';
|
5
|
+
import { ConversationEntry } from './models/conversation-entry';
|
6
6
|
declare const WidgetElement: (new (...args: any[]) => import("@telia-ace/widget-core-flamingo").WidgetComponentType) & typeof LitElement;
|
7
7
|
export declare class Conversation extends WidgetElement {
|
8
8
|
static styles: import("lit").CSSResultGroup[];
|
9
|
+
message: string;
|
10
|
+
disabled: boolean;
|
11
|
+
conversationContentRef: Ref<HTMLDivElement>;
|
12
|
+
formRef: Ref<HTMLFormElement>;
|
13
|
+
chatScrollHeight: number;
|
9
14
|
private toast;
|
10
15
|
private messageMaxLength;
|
16
|
+
platform: ConversationPlatform | null;
|
17
|
+
entries: ConversationEntry[];
|
18
|
+
typing: boolean;
|
19
|
+
private userSubmitSubscription?;
|
20
|
+
private stateSubscription?;
|
21
|
+
private conversationState$;
|
22
|
+
private stateMachine;
|
23
|
+
private provider$;
|
11
24
|
connectedCallback(): Promise<void>;
|
12
|
-
|
13
|
-
_addHeaderOptions(): void;
|
14
|
-
_inputHandler(e: any): void;
|
25
|
+
disconnectedCallback(): void;
|
15
26
|
_actionHandler(_e: CustomEvent<{
|
16
27
|
actionKey: string;
|
17
28
|
payload: Record<string, any> | string;
|
18
29
|
}>): void;
|
19
|
-
message: string;
|
20
|
-
platform: ConversationPlatform | null;
|
21
|
-
session: ConversationSessionState | null;
|
22
|
-
disabled: boolean;
|
23
|
-
conversationContentRef: Ref<HTMLDivElement>;
|
24
|
-
formRef: Ref<HTMLFormElement>;
|
25
|
-
chatScrollHeight: number;
|
26
30
|
private onSessionUpdated;
|
27
31
|
disableInput(): void;
|
28
32
|
enableInput(): void;
|
29
33
|
setToastMessage(message: string | null): void;
|
30
|
-
|
34
|
+
_onSendMessage(e: Event): Promise<void>;
|
35
|
+
_addHeaderOptions(): void;
|
36
|
+
_inputHandler(e: any): void;
|
37
|
+
handover(providerKey: string, providerOptions: Record<string, any>): Observable<void>;
|
31
38
|
render(): import("lit-html").TemplateResult<1>;
|
32
39
|
}
|
33
40
|
export default Conversation;
|
package/index.d.ts
CHANGED
@@ -4,5 +4,5 @@ export { ConversationProvider } from './models/conversation-provider';
|
|
4
4
|
export { User } from './models/user';
|
5
5
|
export { Agent } from './models/agent';
|
6
6
|
export { ConversationEntry } from './models/conversation-entry';
|
7
|
-
export { ConversationSessionState } from './models/conversation-session-state';
|
8
7
|
export { ConversationMessageType } from './types';
|
8
|
+
export { Conversation } from './conversation';
|