@telia-ace/widget-conversation-flamingo 1.1.12 → 1.1.14-rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/conversation-1bf28a6e.js +572 -0
  2. package/conversation-7da6b954.mjs +2619 -0
  3. package/conversation-component.d.ts +2 -0
  4. package/conversation-platform.d.ts +10 -49
  5. package/conversation-session.d.ts +11 -0
  6. package/conversation.d.ts +23 -0
  7. package/entry.d.ts +9 -0
  8. package/group.d.ts +7 -0
  9. package/{index-1ea0fde8.mjs → index-217978bc.mjs} +320 -319
  10. package/index-43151bb4.js +1 -0
  11. package/index-494250de.js +3 -0
  12. package/index-4ba82b09.mjs +777 -0
  13. package/index.d.ts +6 -10
  14. package/index.js +1 -1
  15. package/index.mjs +7 -9
  16. package/{components/conversation/ui/message-types → message-types}/message-type-html.d.ts +3 -2
  17. package/models/agent.d.ts +8 -0
  18. package/models/conversation-entry.d.ts +11 -0
  19. package/models/conversation-provider.d.ts +19 -0
  20. package/models/conversation-session-state.d.ts +13 -0
  21. package/models/user.d.ts +8 -0
  22. package/package.json +5 -6
  23. package/types.d.ts +9 -123
  24. package/agent.d.ts +0 -20
  25. package/components/conversation/conversation.d.ts +0 -19
  26. package/components/conversation/plugin.d.ts +0 -45
  27. package/components/conversation/ui/message-list.d.ts +0 -9
  28. package/components/conversation/ui/message-types/message-type-link-list.d.ts +0 -8
  29. package/components/conversation/ui/message-types/message-type-separator.d.ts +0 -7
  30. package/components/conversation/ui/message.d.ts +0 -8
  31. package/components/conversation/utils.d.ts +0 -1
  32. package/conversation-5265abc7.js +0 -446
  33. package/conversation-8c2255c2.mjs +0 -1865
  34. package/conversation-controller.d.ts +0 -118
  35. package/conversation-history.d.ts +0 -26
  36. package/conversation-provider.d.ts +0 -32
  37. package/index-5cf6726d.js +0 -156
  38. package/index-836222bd.mjs +0 -3923
  39. package/index-c51d4b6a.js +0 -1
  40. package/send-18482cae.mjs +0 -4
  41. package/send-eb8b9428.js +0 -1
  42. package/store.d.ts +0 -31
  43. package/user.d.ts +0 -9
  44. package/utils/custom-message.d.ts +0 -2
  45. package/utils/index.d.ts +0 -1
  46. package/utils/open-chat-widget.d.ts +0 -4
  47. package/utils/swap-provider.d.ts +0 -8
@@ -0,0 +1,2 @@
1
+ import { Application } from '@telia-ace/widget-core-flamingo';
2
+ export declare const ConversationComponent: (app: Application) => Promise<void>;
@@ -1,51 +1,12 @@
1
- import { ComponentNodeController, ComponentPlatform } from '@telia-ace/widget-core';
2
- import { Container, EventManager, EventSubscriptionCancellation } from '@webprovisions/platform';
3
- import { ConversationController } from './conversation-controller';
4
- import { ConversationProvider } from './conversation-provider';
5
- export type ConversationHandler = (conversation: ConversationProvider, component: ComponentNodeController) => void | (() => void);
6
- export type UnregisterControllerDelegate = () => void;
7
- export type ConversationProviderRegistration = {
8
- name: string;
9
- handler: ConversationHandler;
10
- };
11
- export declare enum ConversationEndedBehavior {
12
- Deactivate = "deactivate",
13
- Navigate = "navigate",
14
- None = "none"
15
- }
16
- export type SessionInfo = {
17
- id?: string;
18
- route?: any;
19
- conversationEndedBehavior?: ConversationEndedBehavior;
20
- };
1
+ import { ConversationSessionState } from './models/conversation-session-state';
2
+ import { ConversationProvider } from './models/conversation-provider';
3
+ import Conversation from './conversation';
4
+ export type ProviderFactory = () => ConversationProvider;
21
5
  export declare class ConversationPlatform {
22
- private container;
23
- private components;
24
- events: EventManager;
25
- controllers: {
26
- conversation: ConversationController;
27
- component: ComponentNodeController;
28
- }[];
29
- private providers;
30
- private disposeProviders;
31
- private subscriptions;
32
- private storageWriter;
33
- private buttonQuery;
34
- private sessionInfo;
35
- constructor(container: Container, components: ComponentPlatform);
36
- initialize(): void;
37
- addSubscription(sub: EventSubscriptionCancellation): void;
38
- static getInstance(container: Container, key?: string): Promise<ConversationPlatform>;
39
- setConversationEndedBehavior(behavior: ConversationEndedBehavior): Promise<void>;
40
- createController(id: string, options: {
41
- rehydrate: boolean;
42
- }): Promise<ConversationController>;
43
- registerProvider(name: string, handler: ConversationHandler): void;
44
- registerController(conversation: ConversationController, component: ComponentNodeController): boolean;
45
- private writeToComponents;
46
- private invokeHandler;
47
- getComponentRoute(): Promise<any>;
48
- dispose(): void;
49
- static handleContactMethodClick(event: any, container: Container, contactMethod: any, _callback?: () => any): Promise<void>;
50
- static handleContactMethodSubmit(container: Container, contactMethod: any): Promise<any>;
6
+ sessions: Map<string, ConversationSessionState>;
7
+ registeredProviders: Map<string, ProviderFactory>;
8
+ activeSessionId: string | null;
9
+ registerProvider(name: string, provider: ProviderFactory): void;
10
+ createSession(component: Conversation): ConversationSessionState;
11
+ private getProviderByConfiguration;
51
12
  }
@@ -0,0 +1,11 @@
1
+ import { ConversationEntry } from './models/conversation-entry';
2
+ import { LitElement } from 'lit';
3
+ import { ConversationSessionState } from './models/conversation-session-state';
4
+ export declare class ConversationSession extends LitElement {
5
+ static styles: import("lit").CSSResult[];
6
+ loading: boolean;
7
+ session: ConversationSessionState;
8
+ entries: ConversationEntry[];
9
+ connectedCallback(): void;
10
+ render(): import("lit-html").TemplateResult<1>;
11
+ }
@@ -0,0 +1,23 @@
1
+ import { LitElement, PropertyValueMap } from 'lit';
2
+ import { Ref } from 'lit-html/directives/ref.js';
3
+ import { ConversationPlatform } from './conversation-platform';
4
+ import { ConversationSessionState } from './models/conversation-session-state';
5
+ declare const WidgetElement: (new (...args: any[]) => import("@telia-ace/widget-core-flamingo").WidgetComponentType) & typeof LitElement;
6
+ export declare class Conversation extends WidgetElement {
7
+ static styles: import("lit").CSSResultGroup[];
8
+ connectedCallback(): Promise<void>;
9
+ _onSendMessage(e: Event): Promise<void>;
10
+ _inputHandler(e: any): void;
11
+ _actionHandler(_e: CustomEvent<{
12
+ actionKey: string;
13
+ payload: Record<string, any> | string;
14
+ }>): void;
15
+ message: string;
16
+ platform: ConversationPlatform | null;
17
+ session: ConversationSessionState | null;
18
+ conversationContentRef: Ref<HTMLDivElement>;
19
+ chatScrollHeight: number;
20
+ updated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
21
+ render(): import("lit-html").TemplateResult<1>;
22
+ }
23
+ export default Conversation;
package/entry.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { LitElement, nothing } from 'lit';
2
+ import { ConversationEntry } from './models/conversation-entry';
3
+ export declare class ConversationMessage extends LitElement {
4
+ static styles: import("lit").CSSResult[];
5
+ entry: ConversationEntry;
6
+ connectedCallback(): void;
7
+ _renderTimestamp(name: string, timestamp: number | null): import("lit-html").TemplateResult<1> | typeof nothing;
8
+ render(): import("lit-html").TemplateResult<1> | typeof nothing | "";
9
+ }
package/group.d.ts ADDED
@@ -0,0 +1,7 @@
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
+ }