@telia-ace/widget-conversation-flamingo 1.1.79-rc.0 → 1.1.79-rc.2
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +2 -2
- package/chat-session.d.ts +0 -31
- package/controllers/toast-controller.d.ts +0 -10
- package/conversation-component.d.ts +0 -2
- package/conversation-feed.d.ts +0 -9
- package/conversation-platform.d.ts +0 -9
- package/conversation-utilities.d.ts +0 -3
- package/conversation.d.ts +0 -61
- package/entry.d.ts +0 -13
- package/group.d.ts +0 -7
- package/message-types/lightbox.d.ts +0 -12
- package/message-types/message-type-html.d.ts +0 -8
- package/message-types/message-type-markdown.d.ts +0 -25
- package/models/agent.d.ts +0 -8
- package/models/conversation-entry.d.ts +0 -17
- package/models/conversation-provider.d.ts +0 -40
- package/models/system.d.ts +0 -8
- package/models/user.d.ts +0 -8
- package/session-service.d.ts +0 -21
- package/state-machine.d.ts +0 -21
- package/types.d.ts +0 -26
- package/typing.d.ts +0 -5
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@telia-ace/widget-conversation-flamingo",
|
3
|
-
"version": "1.1.79-rc.
|
3
|
+
"version": "1.1.79-rc.2",
|
4
4
|
"publishConfig": {
|
5
5
|
"registry": "https://registry.npmjs.org"
|
6
6
|
},
|
@@ -9,7 +9,7 @@
|
|
9
9
|
"@lit-labs/motion": "^1.0.4",
|
10
10
|
"@teliads/icons": "^8.4.0",
|
11
11
|
"@teliads/components": "^22.1.1",
|
12
|
-
"@telia-ace/widget-core-flamingo": "1.1.79-rc.
|
12
|
+
"@telia-ace/widget-core-flamingo": "1.1.79-rc.2",
|
13
13
|
"lit-html": "^3.0.2",
|
14
14
|
"rxjs": "^7.8.1",
|
15
15
|
"marked": "^12.0.2"
|
package/chat-session.d.ts
DELETED
@@ -1,31 +0,0 @@
|
|
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,10 +0,0 @@
|
|
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
|
-
}
|
package/conversation-feed.d.ts
DELETED
@@ -1,9 +0,0 @@
|
|
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
|
-
}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { ConversationProvider } from './models/conversation-provider';
|
2
|
-
import Conversation from './conversation';
|
3
|
-
import { Container } from '@telia-ace/widget-core-flamingo';
|
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
|
-
}
|
package/conversation.d.ts
DELETED
@@ -1,61 +0,0 @@
|
|
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 { ConversationEntry } from './models/conversation-entry';
|
6
|
-
declare const WidgetElement: (new (...args: any[]) => import("@telia-ace/widget-core-flamingo").WidgetComponentType) & typeof LitElement;
|
7
|
-
export declare class Conversation extends WidgetElement {
|
8
|
-
static styles: import("lit").CSSResultGroup[];
|
9
|
-
message: string;
|
10
|
-
disabledInput: boolean;
|
11
|
-
disabledSubmit: boolean;
|
12
|
-
chatOverlayActive: boolean;
|
13
|
-
textAreaLength: number;
|
14
|
-
private isMuted;
|
15
|
-
conversationContentRef: Ref<HTMLDivElement>;
|
16
|
-
conversationFeedRef: Ref<HTMLDivElement>;
|
17
|
-
formRef: Ref<HTMLFormElement>;
|
18
|
-
inputRef: Ref<HTMLTextAreaElement>;
|
19
|
-
scrollRef: Ref<HTMLDivElement>;
|
20
|
-
counterRef: Ref<HTMLDivElement>;
|
21
|
-
chatScrollHeight: number;
|
22
|
-
chatCurrentScrollPosition: number;
|
23
|
-
private toast;
|
24
|
-
private messageMaxLength;
|
25
|
-
private messageMaxLengthLabel;
|
26
|
-
private skipToLatestMessageLabel;
|
27
|
-
platform: ConversationPlatform | null;
|
28
|
-
entries: ConversationEntry[];
|
29
|
-
typing: boolean;
|
30
|
-
private userSubmitSubscription?;
|
31
|
-
private stateSubscription?;
|
32
|
-
private conversationState$;
|
33
|
-
private stateMachine;
|
34
|
-
private provider$;
|
35
|
-
userTyping$: Subject<string>;
|
36
|
-
connectedCallback(): Promise<void>;
|
37
|
-
disconnectedCallback(): void;
|
38
|
-
_actionHandler(_e: CustomEvent<{
|
39
|
-
actionKey: string;
|
40
|
-
payload: Record<string, any> | string;
|
41
|
-
}>): void;
|
42
|
-
private isTypingState;
|
43
|
-
private isAtBottom;
|
44
|
-
private scrollToBottom;
|
45
|
-
private onSessionUpdated;
|
46
|
-
disableInput(): void;
|
47
|
-
enableInput(): void;
|
48
|
-
disableSubmit(): void;
|
49
|
-
enableSubmit(): void;
|
50
|
-
clearMessages(): void;
|
51
|
-
setToastMessage(message: string | null): void;
|
52
|
-
_onSendMessage(e: Event): Promise<void>;
|
53
|
-
_addHeaderOptions(): void;
|
54
|
-
_inputHandler(e: any): void;
|
55
|
-
_keyDownHandler(e: KeyboardEvent): void;
|
56
|
-
skipToLatestMessage(): void;
|
57
|
-
handover(providerKey: string, providerOptions: Record<string, any>): Observable<void>;
|
58
|
-
firstUpdated(): void;
|
59
|
-
render(): import("lit-html").TemplateResult<1>;
|
60
|
-
}
|
61
|
-
export default Conversation;
|
package/entry.d.ts
DELETED
@@ -1,13 +0,0 @@
|
|
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): import("lit-html").TemplateResult<1> | typeof nothing;
|
10
|
-
_renderDeliveryStatus(status: 'delivered' | 'pending' | 'failed'): import("lit-html").TemplateResult<1>;
|
11
|
-
_dispatchEntryAction(event: CustomEvent<ConversationEntryAction>): void;
|
12
|
-
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
13
|
-
}
|
package/group.d.ts
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
import type { 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
|
-
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
export declare class Lightbox extends LitElement {
|
3
|
-
static styles: import("lit").CSSResult[];
|
4
|
-
imageUrl: string;
|
5
|
-
altText?: string;
|
6
|
-
firstUpdated(): void;
|
7
|
-
disconnectedCallback(): void;
|
8
|
-
private escapeListener;
|
9
|
-
private closeLightbox;
|
10
|
-
private handleKeyDown;
|
11
|
-
render(): import("lit-html").TemplateResult<1>;
|
12
|
-
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
export declare class MessageTypeMarkdown extends LitElement {
|
3
|
-
static styles: import("lit").CSSResult[];
|
4
|
-
message: {
|
5
|
-
content: string;
|
6
|
-
};
|
7
|
-
showLightbox: boolean;
|
8
|
-
imageUrl: string;
|
9
|
-
altText: string;
|
10
|
-
private scrollRef;
|
11
|
-
private contentRef;
|
12
|
-
private autoScroll;
|
13
|
-
private buffer;
|
14
|
-
private pointer;
|
15
|
-
private imageRegexp;
|
16
|
-
private handleAutoscroll;
|
17
|
-
private handleLightboxClose;
|
18
|
-
private handleLightboxOpen;
|
19
|
-
private includesImage;
|
20
|
-
private getLastChunk;
|
21
|
-
firstUpdated(): Promise<void>;
|
22
|
-
updated(): void;
|
23
|
-
private applyCodeStyles;
|
24
|
-
render(): import("lit-html").TemplateResult<1>;
|
25
|
-
}
|
package/models/agent.d.ts
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
import { ConversationEntry } from './conversation-entry';
|
2
|
-
export declare class Agent {
|
3
|
-
name: string;
|
4
|
-
private print$;
|
5
|
-
constructor(name: string);
|
6
|
-
print(text: string, type?: string, alias?: string): ConversationEntry;
|
7
|
-
subscribe(): import("rxjs").Observable<ConversationEntry>;
|
8
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { Subject } from 'rxjs';
|
2
|
-
import { ConversationEntryAction, ConversationMessage, ConversationMessageGroup, ConversationMessageSender, ConversationMessageType } from '../types';
|
3
|
-
export declare class ConversationEntry {
|
4
|
-
type: ConversationMessageType;
|
5
|
-
sender: ConversationMessageSender;
|
6
|
-
messages: ConversationMessageGroup[];
|
7
|
-
timestamp: number;
|
8
|
-
status: 'delivered' | 'failed' | 'pending';
|
9
|
-
didUpdate: Subject<ConversationEntry>;
|
10
|
-
actions$: Subject<ConversationEntryAction>;
|
11
|
-
remove$: Subject<void>;
|
12
|
-
id: string;
|
13
|
-
constructor(type: ConversationMessageType, sender: ConversationMessageSender, messages: ConversationMessageGroup[]);
|
14
|
-
update(content: ConversationMessage[]): void;
|
15
|
-
setStatus(status: ConversationEntry['status']): void;
|
16
|
-
remove(): void;
|
17
|
-
}
|
@@ -1,40 +0,0 @@
|
|
1
|
-
import { BehaviorSubject, Subject } from 'rxjs';
|
2
|
-
import { ConversationMessageType } from '../types';
|
3
|
-
import { ConversationEntry } from './conversation-entry';
|
4
|
-
import { Agent } from './agent';
|
5
|
-
import { User } from './user';
|
6
|
-
import { System } from './system';
|
7
|
-
import Conversation from '../conversation';
|
8
|
-
type UserSubmitEvent = {
|
9
|
-
text: string;
|
10
|
-
};
|
11
|
-
export declare class ConversationProvider {
|
12
|
-
name: string;
|
13
|
-
component: Conversation;
|
14
|
-
private print$;
|
15
|
-
private typingState$;
|
16
|
-
private complete$;
|
17
|
-
protected system: System;
|
18
|
-
rehydrate$: Subject<void>;
|
19
|
-
saveToCurrentSession$: Subject<any>;
|
20
|
-
showChatOverlay$: BehaviorSubject<boolean>;
|
21
|
-
constructor(name: string, component: Conversation);
|
22
|
-
connect(_conversationOptions?: Record<string, any>): void;
|
23
|
-
disconnected(): void;
|
24
|
-
onUserSubmit(action: UserSubmitEvent): void;
|
25
|
-
print(type: ConversationMessageType, text: string): ConversationEntry;
|
26
|
-
printEntry(entry: ConversationEntry): ConversationEntry;
|
27
|
-
createAgent(name: string): Agent;
|
28
|
-
createUser(name: string): User;
|
29
|
-
createSystem(): System;
|
30
|
-
setTypingState(isTyping: boolean): void;
|
31
|
-
setToastMessage(message: string | null): void;
|
32
|
-
isTyping(): import("rxjs").Observable<boolean>;
|
33
|
-
actions(): import("rxjs").Observable<ConversationEntry>;
|
34
|
-
playNotification(): void;
|
35
|
-
onComplete: () => import("rxjs").Observable<void>;
|
36
|
-
complete(): void;
|
37
|
-
save(data: any): void;
|
38
|
-
rehydrate(_data: Record<string, any>): Promise<void>;
|
39
|
-
}
|
40
|
-
export {};
|
package/models/system.d.ts
DELETED
package/models/user.d.ts
DELETED
package/session-service.d.ts
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
import { StorageService } from '@telia-ace/widget-core-flamingo';
|
2
|
-
import { Observable } from 'rxjs';
|
3
|
-
import Conversation from './conversation';
|
4
|
-
import { ChatSession } from './chat-session';
|
5
|
-
export declare class SessionService {
|
6
|
-
private component;
|
7
|
-
private currentSession$;
|
8
|
-
private sessions;
|
9
|
-
private storage;
|
10
|
-
constructor(component: Conversation);
|
11
|
-
loadFromStorage(): void;
|
12
|
-
startSession(): void;
|
13
|
-
setStorageService(storage: StorageService): void;
|
14
|
-
currentSession(): Observable<ChatSession | null>;
|
15
|
-
private _getStoredSessions;
|
16
|
-
private _setSession;
|
17
|
-
private _saveSession;
|
18
|
-
private save;
|
19
|
-
private _createNewSession;
|
20
|
-
private _getInitialProviderKey;
|
21
|
-
}
|
package/state-machine.d.ts
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
import { BehaviorSubject, Observable } from 'rxjs';
|
2
|
-
import { StorageService } from '@telia-ace/widget-core-flamingo';
|
3
|
-
import { Conversation } from './conversation';
|
4
|
-
import { ConversationEntry } from './models/conversation-entry';
|
5
|
-
import { ChatSession } from './chat-session';
|
6
|
-
export declare class StateMachine {
|
7
|
-
private state$;
|
8
|
-
private component;
|
9
|
-
private sessionService;
|
10
|
-
private entries$;
|
11
|
-
private session$;
|
12
|
-
private isTyping$;
|
13
|
-
constructor(state$: BehaviorSubject<'waiting' | 'init' | 'rehydrating' | 'connected'>, component: Conversation);
|
14
|
-
setStorage(storage: StorageService): void;
|
15
|
-
session: () => Observable<ChatSession | null>;
|
16
|
-
isTyping: () => Observable<boolean>;
|
17
|
-
entries: () => Observable<ConversationEntry[]>;
|
18
|
-
private initialize;
|
19
|
-
private rehydrate;
|
20
|
-
private connected;
|
21
|
-
}
|
package/types.d.ts
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
export type ConversationMessageGroup = {
|
2
|
-
items: ConversationMessage[];
|
3
|
-
};
|
4
|
-
export type ConversationMessage = [
|
5
|
-
string,
|
6
|
-
{
|
7
|
-
content: string;
|
8
|
-
},
|
9
|
-
{
|
10
|
-
[key: string]: string;
|
11
|
-
}?
|
12
|
-
];
|
13
|
-
export type ConversationMessageSender = {
|
14
|
-
name?: string;
|
15
|
-
avatar?: string | symbol;
|
16
|
-
id?: string;
|
17
|
-
};
|
18
|
-
export declare enum ConversationMessageType {
|
19
|
-
User = "user",
|
20
|
-
Agent = "agent",
|
21
|
-
System = "system"
|
22
|
-
}
|
23
|
-
export type ConversationEntryAction = {
|
24
|
-
key: string;
|
25
|
-
data: Record<string, any>;
|
26
|
-
};
|