@telia-ace/widget-conversation-flamingo 1.1.120-rc.0 → 1.1.120-rc.10

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.
@@ -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 { default as 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
+ }
@@ -0,0 +1,10 @@
1
+ import { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ export declare class ToastController implements ReactiveController {
3
+ private _host;
4
+ private _message;
5
+ constructor(host: ReactiveControllerHost);
6
+ hostConnected(): void;
7
+ set message(value: string | null);
8
+ get message(): string | null;
9
+ hasMessage(): boolean;
10
+ }
@@ -0,0 +1,2 @@
1
+ import { Application } from '../../core/src/index.ts';
2
+ export declare const ConversationComponent: (app: Application) => Promise<void>;
@@ -0,0 +1,9 @@
1
+ import { LitElement, PropertyValueMap } from 'lit';
2
+ import { ConversationEntry } from './models/conversation-entry';
3
+ export declare class ConversationFeed extends LitElement {
4
+ static styles: import('lit').CSSResult[];
5
+ entries: ConversationEntry[];
6
+ loading: boolean;
7
+ updated(_changedProperties: PropertyValueMap<any>): void;
8
+ render(): import('lit-html').TemplateResult<1>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { ConversationProvider } from './models/conversation-provider';
2
+ import { default as Conversation } from './conversation';
3
+ import { Container } from '../../core/src/index.ts';
4
+ export type ProviderFactory = (component: Conversation) => ConversationProvider;
5
+ export declare class ConversationPlatform {
6
+ registeredProviders: Map<string, ProviderFactory>;
7
+ static getInstance(container: Container): Promise<ConversationPlatform>;
8
+ registerProvider(name: string, provider: ProviderFactory): void;
9
+ }
@@ -0,0 +1,3 @@
1
+ export declare const uuid: () => string;
2
+ export declare function findPlainTextLinks(text: string): string;
3
+ export declare function truncateLongLinks(text: string): string;
@@ -0,0 +1,65 @@
1
+ import { LitElement } from 'lit';
2
+ import { Ref } from 'lit-html/directives/ref.js';
3
+ import { ConversationPlatform } from './conversation-platform';
4
+ import { Observable, Subject } from 'rxjs';
5
+ import { StateMachine } from './state-machine';
6
+ import { ConversationEntry } from './models/conversation-entry';
7
+ declare const WidgetElement: (new (...args: any[]) => import('../../core/src/index.ts').WidgetComponentType) & typeof LitElement;
8
+ export declare class Conversation extends WidgetElement {
9
+ static styles: import('lit').CSSResultGroup[];
10
+ message: string;
11
+ disabledInput: boolean;
12
+ disabledSkipToLatest: boolean;
13
+ disabledSubmit: boolean;
14
+ chatOverlayActive: boolean;
15
+ textAreaLength: number;
16
+ private isMuted;
17
+ conversationContentRef: Ref<HTMLDivElement>;
18
+ conversationFeedRef: Ref<HTMLDivElement>;
19
+ formRef: Ref<HTMLFormElement>;
20
+ inputRef: Ref<HTMLTextAreaElement>;
21
+ scrollRef: Ref<HTMLDivElement>;
22
+ counterRef: Ref<HTMLDivElement>;
23
+ chatScrollHeight: number;
24
+ chatCurrentScrollPosition: number;
25
+ private toast;
26
+ private messageMaxLength;
27
+ private messageMaxLengthLabel;
28
+ private skipToLatestMessageLabel;
29
+ platform: ConversationPlatform | null;
30
+ entries: ConversationEntry[];
31
+ typing: boolean;
32
+ private userSubmitSubscription?;
33
+ private stateSubscription?;
34
+ private conversationState$;
35
+ stateMachine: StateMachine;
36
+ private provider$;
37
+ userTyping$: Subject<string>;
38
+ connectedCallback(): Promise<void>;
39
+ disconnectedCallback(): void;
40
+ _actionHandler(_e: CustomEvent<{
41
+ actionKey: string;
42
+ payload: Record<string, any> | string;
43
+ }>): void;
44
+ private isTypingState;
45
+ private isAtBottom;
46
+ private scrollToBottom;
47
+ private onSessionUpdated;
48
+ disableInput(): void;
49
+ enableInput(): void;
50
+ enableSkipToLatestMessage(): void;
51
+ disableSkipToLatestMessage(): void;
52
+ disableSubmit(): void;
53
+ enableSubmit(): void;
54
+ clearMessages(): void;
55
+ setToastMessage(message: string | null): void;
56
+ _onSendMessage(e: Event): Promise<void>;
57
+ _addHeaderOptions(): void;
58
+ _inputHandler(e: any): void;
59
+ _keyDownHandler(e: KeyboardEvent): void;
60
+ skipToLatestMessage(): void;
61
+ handover(providerKey: string, providerOptions: Record<string, any>): Observable<void>;
62
+ firstUpdated(): void;
63
+ render(): import('lit-html').TemplateResult<1>;
64
+ }
65
+ export default Conversation;
package/entry.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { LitElement, nothing } from 'lit';
2
+ import { ConversationEntry } from './models/conversation-entry';
3
+ import { ConversationEntryAction } from './types';
4
+ export declare class ConversationMessage extends LitElement {
5
+ static styles: import('lit').CSSResult[];
6
+ entry: ConversationEntry;
7
+ connectedCallback(): void;
8
+ _getTimestamp(raw: number): string;
9
+ _renderTimestamp(name: string, timestamp: number | null): typeof nothing | import('lit-html').TemplateResult<1>;
10
+ _renderDeliveryStatus(status: 'delivered' | 'pending' | 'failed'): import('lit-html').TemplateResult<1>;
11
+ _dispatchEntryAction(event: CustomEvent<ConversationEntryAction>): void;
12
+ render(): typeof nothing | import('lit-html').TemplateResult<1>;
13
+ }
package/group.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { LitElement } from 'lit';
2
+ import { ConversationMessageGroup } from './types';
3
+ export declare class Group extends LitElement {
4
+ static styles: import('lit').CSSResult[];
5
+ group: ConversationMessageGroup;
6
+ render(): import('lit-html').TemplateResult<1>;
7
+ }
package/index.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ export { ConversationComponent } from './conversation-component';
2
+ export { ConversationPlatform } from './conversation-platform';
3
+ export { ConversationProvider } from './models/conversation-provider';
4
+ export { User } from './models/user';
5
+ export { Agent } from './models/agent';
6
+ export { ConversationEntry } from './models/conversation-entry';
7
+ export { ConversationMessageType } from './types';
8
+ export { Conversation } from './conversation';
9
+ export { truncateLongLinks, findPlainTextLinks, } from './conversation-utilities';