@telia-ace/widget-conversation-flamingo 1.1.12 → 1.1.14-rc.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/conversation-1bf28a6e.js +572 -0
- package/conversation-7da6b954.mjs +2619 -0
- package/conversation-component.d.ts +2 -0
- package/conversation-platform.d.ts +10 -49
- package/conversation-session.d.ts +11 -0
- package/conversation.d.ts +23 -0
- package/entry.d.ts +9 -0
- package/group.d.ts +7 -0
- package/{index-1ea0fde8.mjs → index-217978bc.mjs} +320 -319
- package/index-43151bb4.js +1 -0
- package/index-494250de.js +3 -0
- package/index-4ba82b09.mjs +777 -0
- package/index.d.ts +6 -10
- package/index.js +1 -1
- package/index.mjs +7 -9
- package/{components/conversation/ui/message-types → message-types}/message-type-html.d.ts +3 -2
- package/models/agent.d.ts +8 -0
- package/models/conversation-entry.d.ts +11 -0
- package/models/conversation-provider.d.ts +19 -0
- package/models/conversation-session-state.d.ts +13 -0
- package/models/user.d.ts +8 -0
- package/package.json +5 -6
- package/types.d.ts +9 -123
- package/agent.d.ts +0 -20
- package/components/conversation/conversation.d.ts +0 -19
- package/components/conversation/plugin.d.ts +0 -45
- package/components/conversation/ui/message-list.d.ts +0 -9
- package/components/conversation/ui/message-types/message-type-link-list.d.ts +0 -8
- package/components/conversation/ui/message-types/message-type-separator.d.ts +0 -7
- package/components/conversation/ui/message.d.ts +0 -8
- package/components/conversation/utils.d.ts +0 -1
- package/conversation-5265abc7.js +0 -446
- package/conversation-8c2255c2.mjs +0 -1865
- package/conversation-controller.d.ts +0 -118
- package/conversation-history.d.ts +0 -26
- package/conversation-provider.d.ts +0 -32
- package/index-5cf6726d.js +0 -156
- package/index-836222bd.mjs +0 -3923
- package/index-c51d4b6a.js +0 -1
- package/send-18482cae.mjs +0 -4
- package/send-eb8b9428.js +0 -1
- package/store.d.ts +0 -31
- package/user.d.ts +0 -9
- package/utils/custom-message.d.ts +0 -2
- package/utils/index.d.ts +0 -1
- package/utils/open-chat-widget.d.ts +0 -4
- package/utils/swap-provider.d.ts +0 -8
package/index.d.ts
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
|
2
|
-
export {
|
3
|
-
export {
|
4
|
-
export
|
5
|
-
export {
|
6
|
-
export
|
7
|
-
export { registerCustomMessageComponent } from './utils/custom-message';
|
8
|
-
export { ConversationPlatform, ConversationEndedBehavior };
|
9
|
-
export type { UnregisterControllerDelegate };
|
10
|
-
export type { Agent } from './agent';
|
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';
|
package/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-494250de.js");exports.Agent=o.Agent;exports.ConversationComponent=o.ConversationComponent;exports.ConversationEntry=o.ConversationEntry;exports.ConversationPlatform=o.ConversationPlatform;exports.ConversationProvider=o.ConversationProvider;exports.User=o.User;
|
package/index.mjs
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import { A as n, a as r, d as s, b as e, c as t, U as i } from "./index-4ba82b09.mjs";
|
2
2
|
export {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
i as ConversationPlatform,
|
10
|
-
v as registerCustomMessageComponent
|
3
|
+
n as Agent,
|
4
|
+
r as ConversationComponent,
|
5
|
+
s as ConversationEntry,
|
6
|
+
e as ConversationPlatform,
|
7
|
+
t as ConversationProvider,
|
8
|
+
i as User
|
11
9
|
};
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { LitElement } from 'lit';
|
2
|
-
import { ConversationMessageListItemType, ConverstationMessageItem } from '../../../../types';
|
3
2
|
export declare class MessageTypeHtml extends LitElement {
|
4
3
|
static styles: import("lit").CSSResult[];
|
5
|
-
message:
|
4
|
+
message: {
|
5
|
+
content: string;
|
6
|
+
};
|
6
7
|
render(): import("lit-html").TemplateResult<1>;
|
7
8
|
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Subject } from 'rxjs';
|
2
|
+
import { ConversationMessage, ConversationMessageGroup, ConversationMessageSender, ConversationMessageType } from '../types';
|
3
|
+
export declare class ConversationEntry {
|
4
|
+
type: ConversationMessageType;
|
5
|
+
sender: ConversationMessageSender;
|
6
|
+
messages: ConversationMessageGroup[];
|
7
|
+
timestamp: number;
|
8
|
+
didUpdate: Subject<ConversationEntry>;
|
9
|
+
constructor(type: ConversationMessageType, sender: ConversationMessageSender, messages: ConversationMessageGroup[]);
|
10
|
+
update(content: ConversationMessage[]): void;
|
11
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { ConversationMessageType } from '../types';
|
2
|
+
import { ConversationEntry } from './conversation-entry';
|
3
|
+
import { Agent } from './agent';
|
4
|
+
import { User } from './user';
|
5
|
+
type UserSubmitEvent = {
|
6
|
+
text: string;
|
7
|
+
};
|
8
|
+
export declare class ConversationProvider {
|
9
|
+
name: string;
|
10
|
+
private print$;
|
11
|
+
constructor(name: string);
|
12
|
+
onUserSubmit(action: UserSubmitEvent): void;
|
13
|
+
print(type: ConversationMessageType, text: string): ConversationEntry;
|
14
|
+
printEntry(entry: ConversationEntry): ConversationEntry;
|
15
|
+
createAgent(name: string): Agent;
|
16
|
+
createUser(name: string): User;
|
17
|
+
actions(): import("rxjs").Observable<ConversationEntry>;
|
18
|
+
}
|
19
|
+
export {};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { BehaviorSubject } from 'rxjs';
|
2
|
+
import { ConversationEntry } from './conversation-entry';
|
3
|
+
import { ConversationProvider } from './conversation-provider';
|
4
|
+
import Conversation from '../conversation';
|
5
|
+
export declare class ConversationSessionState {
|
6
|
+
id: string;
|
7
|
+
entries$: BehaviorSubject<ConversationEntry[]>;
|
8
|
+
private provider?;
|
9
|
+
constructor(id: string, component: Conversation);
|
10
|
+
private write;
|
11
|
+
entries(): import("rxjs").Observable<ConversationEntry[]>;
|
12
|
+
setProvider(provider: ConversationProvider): void;
|
13
|
+
}
|
package/models/user.d.ts
ADDED
package/package.json
CHANGED
@@ -1,19 +1,18 @@
|
|
1
1
|
{
|
2
2
|
"name": "@telia-ace/widget-conversation-flamingo",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.14-rc.0",
|
4
4
|
"publishConfig": {
|
5
5
|
"registry": "https://registry.npmjs.org"
|
6
6
|
},
|
7
7
|
"dependencies": {
|
8
|
-
"@telia-ace/widget-utilities": "^1.0.16",
|
9
8
|
"lit": "^3.0.2",
|
10
9
|
"@lit-labs/motion": "^1.0.4",
|
11
10
|
"@teliads/icons": "^8.4.0",
|
12
11
|
"@teliads/components": "^22.1.1",
|
13
|
-
"@telia-ace/widget-
|
14
|
-
"
|
15
|
-
"
|
16
|
-
"
|
12
|
+
"@telia-ace/widget-core-flamingo": "1.1.14-rc.0",
|
13
|
+
"uuid": "^9.0.1",
|
14
|
+
"lit-html": "^3.0.2",
|
15
|
+
"rxjs": "^7.8.1"
|
17
16
|
},
|
18
17
|
"main": "./index.js",
|
19
18
|
"module": "./index.mjs",
|
package/types.d.ts
CHANGED
@@ -1,130 +1,16 @@
|
|
1
|
-
export type
|
2
|
-
|
3
|
-
timestamp?: number;
|
4
|
-
title?: string;
|
5
|
-
body?: string;
|
6
|
-
actions?: {
|
7
|
-
[actionKey: string]: any;
|
8
|
-
};
|
9
|
-
form?: (builder: any) => void;
|
10
|
-
type?: string;
|
11
|
-
items?: ConversationMessageList[];
|
12
|
-
[key: string]: any;
|
13
|
-
};
|
14
|
-
export type NormalizedMessageSettings = {
|
15
|
-
content: ConversationMessageContent;
|
16
|
-
key: string;
|
17
|
-
timestamp: number | null;
|
18
|
-
};
|
19
|
-
export type ConversationMessageList = {
|
20
|
-
header?: string;
|
21
|
-
itemKey: string;
|
22
|
-
type?: ConversationMessageListType;
|
23
|
-
items: ConversationMessageListItem[];
|
24
|
-
};
|
25
|
-
export type ConversationMessageListItem = {
|
26
|
-
icon?: string;
|
27
|
-
type?: ConversationMessageListItemType;
|
28
|
-
actions?: {
|
29
|
-
[actionKey: string]: any;
|
30
|
-
};
|
31
|
-
form?: any;
|
32
|
-
body?: string;
|
33
|
-
key: string;
|
34
|
-
[key: string]: any;
|
35
|
-
};
|
36
|
-
export type ConversationMessageContent = {
|
37
|
-
title?: string;
|
38
|
-
body?: string;
|
39
|
-
actions?: {
|
40
|
-
[actionKey: string]: any;
|
41
|
-
};
|
42
|
-
items?: ConverstationMessageItem<any>[];
|
43
|
-
form?: any;
|
44
|
-
[key: string]: any;
|
45
|
-
};
|
46
|
-
export type ConverstationMessageItem<T, R = ItemPayload> = R extends [T, any] ? R : never;
|
47
|
-
export type ConversationMessageUpdateSettings = ConversationMessageContent & {
|
48
|
-
timestamp?: number;
|
1
|
+
export type ConversationMessageGroup = {
|
2
|
+
items: ConversationMessage[];
|
49
3
|
};
|
4
|
+
export type ConversationMessage = [string, {
|
5
|
+
content: string;
|
6
|
+
}];
|
50
7
|
export type ConversationMessageSender = {
|
51
8
|
name?: string;
|
52
9
|
avatar?: string | symbol;
|
53
10
|
id?: string;
|
54
11
|
};
|
55
|
-
export declare enum
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
export declare enum ConversationMessageListItemType {
|
60
|
-
LinkList = "link-list",
|
61
|
-
Separator = "separator",
|
62
|
-
ButtonList = "button-list",
|
63
|
-
ItemList = "item-list",
|
64
|
-
Text = "text",
|
65
|
-
HTML = "html",
|
66
|
-
VideoRequest = "video-request"
|
12
|
+
export declare enum ConversationMessageType {
|
13
|
+
User = "user",
|
14
|
+
Agent = "agent",
|
15
|
+
System = "system"
|
67
16
|
}
|
68
|
-
export type LinkListProperties = {
|
69
|
-
header?: string;
|
70
|
-
actions: {
|
71
|
-
[key: string]: string;
|
72
|
-
} | {
|
73
|
-
label: string;
|
74
|
-
actionKey: string;
|
75
|
-
data: any;
|
76
|
-
}[];
|
77
|
-
};
|
78
|
-
type LinkListItem = [
|
79
|
-
ConversationMessageListItemType.LinkList,
|
80
|
-
LinkListProperties
|
81
|
-
];
|
82
|
-
type TextItem = [ConversationMessageListItemType.Text, string];
|
83
|
-
type SeparatorItem = [ConversationMessageListItemType.Separator, undefined];
|
84
|
-
export type ButtonListProperties = {
|
85
|
-
header?: string;
|
86
|
-
actions: {
|
87
|
-
[key: string]: string;
|
88
|
-
} | {
|
89
|
-
label: string;
|
90
|
-
actionKey: string;
|
91
|
-
data: any;
|
92
|
-
}[];
|
93
|
-
};
|
94
|
-
type ButtonListItem = [
|
95
|
-
ConversationMessageListItemType.ButtonList,
|
96
|
-
ButtonListProperties
|
97
|
-
];
|
98
|
-
export type ItemListProperties = {
|
99
|
-
header?: string;
|
100
|
-
actions: {
|
101
|
-
[key: string]: string;
|
102
|
-
} | {
|
103
|
-
label: string;
|
104
|
-
actionKey: string;
|
105
|
-
data: any;
|
106
|
-
}[];
|
107
|
-
};
|
108
|
-
type ItemListItem = [
|
109
|
-
ConversationMessageListItemType.ItemList,
|
110
|
-
ItemListProperties
|
111
|
-
];
|
112
|
-
export type VideoRequestProperties = {
|
113
|
-
header?: string;
|
114
|
-
acceptLabel: string;
|
115
|
-
declineLabel: string;
|
116
|
-
};
|
117
|
-
type VideoRequestItem = [
|
118
|
-
ConversationMessageListItemType.VideoRequest,
|
119
|
-
VideoRequestProperties
|
120
|
-
];
|
121
|
-
export type HtmlProperties = {
|
122
|
-
body: string;
|
123
|
-
};
|
124
|
-
type HtmlItem = [ConversationMessageListItemType.HTML, HtmlProperties];
|
125
|
-
type ItemPayload = LinkListItem | TextItem | SeparatorItem | ButtonListItem | HtmlItem | VideoRequestItem | ItemListItem;
|
126
|
-
export type Symbol = {
|
127
|
-
type: 'Uri' | 'Svg' | 'FontAwesome' | 'Text' | string;
|
128
|
-
content: string;
|
129
|
-
};
|
130
|
-
export {};
|
package/agent.d.ts
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
import { ConversationEntry } from './conversation-controller';
|
2
|
-
import { ConversationProvider } from './conversation-provider';
|
3
|
-
import { ConversationMessageSettings, ConverstationMessageItem } from './types';
|
4
|
-
export type AgentSettings = {
|
5
|
-
id?: string;
|
6
|
-
name?: string;
|
7
|
-
avatar?: string | symbol;
|
8
|
-
};
|
9
|
-
export declare class Agent {
|
10
|
-
private provider;
|
11
|
-
id: string;
|
12
|
-
name?: string;
|
13
|
-
avatar?: string | symbol;
|
14
|
-
constructor(provider: ConversationProvider, settings: AgentSettings);
|
15
|
-
print: (settings: string | ConversationMessageSettings | ConverstationMessageItem<any> | ConverstationMessageItem<any>[], options?: {
|
16
|
-
key?: string;
|
17
|
-
}) => ConversationEntry | undefined;
|
18
|
-
typing: () => (() => void) | undefined;
|
19
|
-
update(settings: AgentSettings): void;
|
20
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { LitElement, PropertyValueMap } from 'lit';
|
2
|
-
import { Ref } from 'lit/directives/ref.js';
|
3
|
-
/** Message types */
|
4
|
-
declare const WidgetElement: (new (...args: any[]) => import("libs/runtime/src/mixins/widget-component.mixin").WidgetComponentInterface) & typeof LitElement;
|
5
|
-
export declare class ConversationComponent extends WidgetElement {
|
6
|
-
static styles: import("lit").CSSResultGroup[];
|
7
|
-
_onSendMessage(e: Event): Promise<void>;
|
8
|
-
_inputHandler(e: any): void;
|
9
|
-
_actionHandler(e: CustomEvent<{
|
10
|
-
actionKey: string;
|
11
|
-
payload: Record<string, any> | string;
|
12
|
-
}>): void;
|
13
|
-
message: string;
|
14
|
-
conversationContentRef: Ref<HTMLDivElement>;
|
15
|
-
chatScrollHeight: number;
|
16
|
-
updated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
17
|
-
render(): import("lit-html").TemplateResult<1>;
|
18
|
-
}
|
19
|
-
export default ConversationComponent;
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import { Container } from '@webprovisions/platform';
|
2
|
-
import { ConversationMessageContent, ConversationMessageSender } from '../../types';
|
3
|
-
import { ConversationMessage, ConversationMessageType } from '../../conversation-controller';
|
4
|
-
export type BundledConversationMessage = {
|
5
|
-
timestamp: number;
|
6
|
-
content: [BundledMessageContent];
|
7
|
-
sender: ConversationMessageSender;
|
8
|
-
type: ConversationMessageType;
|
9
|
-
};
|
10
|
-
type BundledMessageContent = {
|
11
|
-
key: string;
|
12
|
-
} & ConversationMessageContent;
|
13
|
-
export type ConversationContent = {
|
14
|
-
loading: boolean;
|
15
|
-
typingActors: ConversationMessageSender[];
|
16
|
-
messages: ConversationMessage[];
|
17
|
-
};
|
18
|
-
export type ConversationComponentProperties = {
|
19
|
-
providers: string[];
|
20
|
-
messages: BundledConversationMessage[];
|
21
|
-
overlay?: {
|
22
|
-
conversation: boolean;
|
23
|
-
secondary: boolean;
|
24
|
-
};
|
25
|
-
overlayConversationHeader?: string;
|
26
|
-
overlayConversationCloseLabel?: string;
|
27
|
-
loading: boolean;
|
28
|
-
inputPlaceholder: string;
|
29
|
-
inputDisabled: boolean;
|
30
|
-
inputHidden: boolean;
|
31
|
-
inputMultiline: boolean;
|
32
|
-
rehydrate?: boolean;
|
33
|
-
userLabel: string;
|
34
|
-
avatarSize: string;
|
35
|
-
typingActors: any[];
|
36
|
-
conversationControllerId?: string;
|
37
|
-
sendButtonLabel: string;
|
38
|
-
secondaryAction?: {
|
39
|
-
icon?: string;
|
40
|
-
action: string;
|
41
|
-
label: string;
|
42
|
-
};
|
43
|
-
};
|
44
|
-
export declare const ConversationComponent: (container: Container) => Promise<void>;
|
45
|
-
export default ConversationComponent;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
import { ConverstationMessageItem } from '../../../types';
|
3
|
-
export declare class MessageList extends LitElement {
|
4
|
-
static styles: import("lit").CSSResult;
|
5
|
-
items: ConverstationMessageItem<any>[];
|
6
|
-
private _isCustomComponent;
|
7
|
-
private _createCustomComponent;
|
8
|
-
render(): import("lit-html").TemplateResult<1>;
|
9
|
-
}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
import { ConversationMessageListItemType, ConverstationMessageItem } from '../../../../types';
|
3
|
-
export declare class MessageTypeLinkList extends LitElement {
|
4
|
-
static styles: import("lit").CSSResult[];
|
5
|
-
message: ConverstationMessageItem<ConversationMessageListItemType.LinkList>['1'];
|
6
|
-
_onItemClick(item: any): void;
|
7
|
-
render(): import("lit-html").TemplateResult<1>;
|
8
|
-
}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
import { ConversationMessageListItemType, ConverstationMessageItem } from '../../../../types';
|
3
|
-
export declare class MessageTypeSeparator extends LitElement {
|
4
|
-
static styles: import("lit").CSSResult[];
|
5
|
-
message: ConverstationMessageItem<ConversationMessageListItemType.Separator>['1'];
|
6
|
-
render(): import("lit-html").TemplateResult<1>;
|
7
|
-
}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { LitElement, nothing } from 'lit';
|
2
|
-
import { BundledConversationMessage } from '../plugin';
|
3
|
-
export declare class Message extends LitElement {
|
4
|
-
static styles: import("lit").CSSResult;
|
5
|
-
message: BundledConversationMessage;
|
6
|
-
_renderTimestamp(name: string, timestamp: number | null): import("lit-html").TemplateResult<1> | typeof nothing;
|
7
|
-
render(): "" | import("lit-html").TemplateResult<1> | typeof nothing;
|
8
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const scrollToBottomOfConversation: (elem: HTMLElement) => void;
|