deep-chat-dev 9.0.11 → 9.0.14
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/custom-elements.json +3874 -3802
- package/dist/deepChat.d.ts +4 -2
- package/dist/deepChat.d.ts.map +1 -1
- package/dist/deepChat.js +5847 -9378
- package/dist/types/html.d.ts +12 -0
- package/dist/types/html.d.ts.map +1 -0
- package/dist/types/messages.d.ts +9 -0
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/types/response.d.ts +1 -0
- package/dist/types/response.d.ts.map +1 -1
- package/dist/utils/HTTP/customHandler.d.ts.map +1 -1
- package/dist/utils/HTTP/requestUtils.d.ts +2 -0
- package/dist/utils/HTTP/requestUtils.d.ts.map +1 -1
- package/dist/utils/element/styleUtils.d.ts +2 -1
- package/dist/utils/element/styleUtils.d.ts.map +1 -1
- package/dist/views/chat/messages/fileMessageUtils.d.ts.map +1 -1
- package/dist/views/chat/messages/html/htmlDeepChatElements.d.ts +10 -0
- package/dist/views/chat/messages/html/htmlDeepChatElements.d.ts.map +1 -0
- package/dist/views/chat/messages/html/htmlMessageUtils.d.ts +10 -0
- package/dist/views/chat/messages/html/htmlMessageUtils.d.ts.map +1 -0
- package/dist/views/chat/messages/html/htmlMessages.d.ts +7 -0
- package/dist/views/chat/messages/html/htmlMessages.d.ts.map +1 -0
- package/dist/views/chat/messages/messages.d.ts +14 -2
- package/dist/views/chat/messages/messages.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/deepChat.bundle.js +0 -1
@@ -0,0 +1,12 @@
|
|
1
|
+
import { StatefulStyles } from './styles';
|
2
|
+
export type EventToFunction = {
|
3
|
+
[K in keyof GlobalEventHandlersEventMap]?: (event: GlobalEventHandlersEventMap[K]) => void;
|
4
|
+
};
|
5
|
+
export interface HTMLClassUtility {
|
6
|
+
events?: EventToFunction;
|
7
|
+
styles?: StatefulStyles;
|
8
|
+
}
|
9
|
+
export type HTMLClassUtilities = {
|
10
|
+
[className: string]: HTMLClassUtility;
|
11
|
+
};
|
12
|
+
//# sourceMappingURL=html.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/types/html.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AAExC,MAAM,MAAM,eAAe,GAAG;KAC3B,CAAC,IAAI,MAAM,2BAA2B,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,2BAA2B,CAAC,CAAC,CAAC,KAAK,IAAI;CAC3F,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAC;CACvC,CAAC"}
|
package/dist/types/messages.d.ts
CHANGED
@@ -17,6 +17,7 @@ export interface MessageStyles {
|
|
17
17
|
image?: MessageRoleStyles;
|
18
18
|
audio?: MessageRoleStyles;
|
19
19
|
file?: MessageRoleStyles;
|
20
|
+
html?: MessageElementsStyles;
|
20
21
|
intro?: MessageElementsStyles;
|
21
22
|
loading?: MessageElementsStyles;
|
22
23
|
error?: MessageElementsStyles;
|
@@ -27,11 +28,19 @@ export type MessageContent = InterfacesUnion<{
|
|
27
28
|
} | {
|
28
29
|
role: string;
|
29
30
|
file: MessageFile;
|
31
|
+
} | {
|
32
|
+
role: string;
|
33
|
+
html: string;
|
30
34
|
}>;
|
31
35
|
export type OnNewMessage = (newMessage: {
|
32
36
|
message: MessageContent;
|
33
37
|
isInitial: boolean;
|
34
38
|
}) => void;
|
39
|
+
export type IntroMessage = InterfacesUnion<{
|
40
|
+
text: string;
|
41
|
+
} | {
|
42
|
+
html: string;
|
43
|
+
}>;
|
35
44
|
export interface ErrorMessageOverrides {
|
36
45
|
default?: string;
|
37
46
|
service?: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/types/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAErC,MAAM,WAAW,qBAAqB;IACpC,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAC7B,EAAE,CAAC,EAAE,qBAAqB,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAC9B,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,KAAK,CAAC,EAAE,qBAAqB,CAAC;CAC/B;AAED,MAAM,MAAM,cAAc,GAAG,eAAe,
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/types/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAErC,MAAM,WAAW,qBAAqB;IACpC,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,cAAc,CAAC,EAAE,WAAW,CAAC;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AM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAG5B,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC"}
|
package/dist/types/response.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/types/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAE3C,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/types/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAE3C,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"customHandler.d.ts","sourceRoot":"","sources":["../../../../src/utils/HTTP/customHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;
|
1
|
+
{"version":3,"file":"customHandler.d.ts","sourceRoot":"","sources":["../../../../src/utils/HTTP/customHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAKnD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE;QAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;KAAC,CAAC;CACpD;AAED,qBAAa,aAAa;WACJ,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ;WA0B7E,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ;WAyCtE,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ;IA8BzD,OAAO,CAAC,MAAM,CAAC,uBAAuB;CAGvC"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Messages } from '../../views/chat/messages/messages';
|
2
|
+
import { Response as ResponseT } from '../../types/response';
|
2
3
|
import { RequestDetails } from '../../types/interceptors';
|
3
4
|
import { Request } from '../../types/request';
|
4
5
|
import { DeepChat } from '../../deepChat';
|
@@ -11,6 +12,7 @@ export declare class RequestUtils {
|
|
11
12
|
static displayError(messages: Messages, err: object, defMessage?: string): void;
|
12
13
|
static processResponseByType(response: Response): Promise<any> | Response;
|
13
14
|
static processRequestInterceptor(deepChat: DeepChat, requestDetails: RequestDetails): InterceptorResult;
|
15
|
+
static validateResponseFormat(response: ResponseT): boolean;
|
14
16
|
}
|
15
17
|
export {};
|
16
18
|
//# sourceMappingURL=requestUtils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"requestUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/HTTP/requestUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAC,OAAO,EAAC,MAAM,qB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AAE,aAAa,EAAE,OAAO;WAQjE,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,SAAqC;WAW7F,qBAAqB,CAAC,QAAQ,EAAE,QAAQ;WAYlC,yBAAyB,CAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,GAAG,iBAAiB;WAOtG,sBAAsB,CAAC,QAAQ,EAAE,SAAS;CAUzD"}
|
@@ -3,6 +3,7 @@ export declare class StyleUtils {
|
|
3
3
|
static unsetStyle(element: HTMLElement, style: CustomStyle): void;
|
4
4
|
static unsetActivityCSSMouseStates(element: HTMLElement, statefulStyle: StatefulStyles): void;
|
5
5
|
static unsetAllCSSMouseStates(element: HTMLElement, statefulStyle: StatefulStyles): void;
|
6
|
-
static
|
6
|
+
static processStateful(styles: StatefulStyles, defHover: CustomStyle, defClick: CustomStyle): StatefulStyles;
|
7
|
+
static mergeStatefulStyles(stylesArr: StatefulStyles[]): StatefulStyles;
|
7
8
|
}
|
8
9
|
//# sourceMappingURL=styleUtils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"styleUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/element/styleUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAG/D,qBAAa,UAAU;WACP,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW;WAQnD,2BAA2B,CAAC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc;WAK/E,sBAAsB,CAAC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc;WAK1E,
|
1
|
+
{"version":3,"file":"styleUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/element/styleUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAG/D,qBAAa,UAAU;WACP,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW;WAQnD,2BAA2B,CAAC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc;WAK/E,sBAAsB,CAAC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc;WAK1E,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,GAAG,cAAc;WAOrG,mBAAmB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,cAAc;CAS/E"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fileMessageUtils.d.ts","sourceRoot":"","sources":["../../../../../src/views/chat/messages/fileMessageUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAoB,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAErD,qBAAa,gBAAgB;IAC3B,gBAAuB,iBAAiB,UAAU;WAGpC,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EACzF,MAAM,EAAE,MAAM,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,UAAQ;
|
1
|
+
{"version":3,"file":"fileMessageUtils.d.ts","sourceRoot":"","sources":["../../../../../src/views/chat/messages/fileMessageUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAoB,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAErD,qBAAa,gBAAgB;IAC3B,gBAAuB,iBAAiB,UAAU;WAGpC,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EACzF,MAAM,EAAE,MAAM,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,UAAQ;IASjE,OAAO,CAAC,MAAM,CAAC,UAAU;WAQX,cAAc,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,MAAM;IAKjE,OAAO,CAAC,MAAM,CAAC,oBAAoB;WAKrB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,mBAAmB,EAAE,WAAW;CAqBlF"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { HTMLClassUtilities } from '../../../../types/html';
|
2
|
+
import { Messages } from '../messages';
|
3
|
+
export declare class HTMLDeepChatElements {
|
4
|
+
static doesElementContainDeepChatClass(element: HTMLElement): string | undefined;
|
5
|
+
private static applyCustomSuggestionEvent;
|
6
|
+
private static applyEvents;
|
7
|
+
private static getProcessedStyles;
|
8
|
+
static applyDeepChatUtilities(messages: Messages, utilities: HTMLClassUtilities, element: HTMLElement): void;
|
9
|
+
}
|
10
|
+
//# sourceMappingURL=htmlDeepChatElements.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"htmlDeepChatElements.d.ts","sourceRoot":"","sources":["../../../../../../src/views/chat/messages/html/htmlDeepChatElements.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AA0BrC,qBAAa,oBAAoB;WACjB,+BAA+B,CAAC,OAAO,EAAE,WAAW;IAIlE,OAAO,CAAC,MAAM,CAAC,0BAA0B;IASzC,OAAO,CAAC,MAAM,CAAC,WAAW;IAU1B,OAAO,CAAC,MAAM,CAAC,kBAAkB;WAcnB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,WAAW;CAU7G"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { StatefulStyles } from '../../../../types/styles';
|
2
|
+
import { Messages } from '../messages';
|
3
|
+
export declare class HTMLMessageUtils {
|
4
|
+
static applyStylesToElement(element: HTMLElement, styles: StatefulStyles): void;
|
5
|
+
private static applyEventsToElement;
|
6
|
+
private static applyClassUtilitiesToElement;
|
7
|
+
private static applyCustomClassUtilities;
|
8
|
+
static apply(messages: Messages, outerElement: HTMLElement): void;
|
9
|
+
}
|
10
|
+
//# sourceMappingURL=htmlMessageUtils.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"htmlMessageUtils.d.ts","sourceRoot":"","sources":["../../../../../../src/views/chat/messages/html/htmlMessageUtils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAErC,qBAAa,gBAAgB;WACb,oBAAoB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc;IAM/E,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAOnC,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAS3C,OAAO,CAAC,MAAM,CAAC,yBAAyB;WAW1B,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW;CAIlE"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Messages } from '../messages';
|
2
|
+
export declare class HTMLMessages {
|
3
|
+
private static addElement;
|
4
|
+
private static createElements;
|
5
|
+
static addNewHTMLMessage(messages: Messages, html: string, isAI: boolean, update: boolean, isInitial?: boolean): import("../messages").MessageElements;
|
6
|
+
}
|
7
|
+
//# sourceMappingURL=htmlMessages.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"htmlMessages.d.ts","sourceRoot":"","sources":["../../../../../../src/views/chat/messages/html/htmlMessages.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAErC,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,UAAU;IAKzB,OAAO,CAAC,MAAM,CAAC,cAAc;WAOf,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,UAAQ;CAUpH"}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { MessageFile, MessageFileType } from '../../../types/messageFile';
|
2
2
|
import { ServiceIO } from '../../../services/serviceIO';
|
3
|
+
import { InterfacesUnion } from '../../../types/utilityTypes';
|
4
|
+
import { HTMLClassUtilities } from '../../../types/html';
|
3
5
|
import { DemoResponse } from '../../../types/demo';
|
4
6
|
import { Response } from '../../../types/response';
|
5
7
|
import { DeepChat } from '../../../deepChat';
|
@@ -9,6 +11,13 @@ export interface MessageElements {
|
|
9
11
|
innerContainer: HTMLElement;
|
10
12
|
bubbleElement: HTMLElement;
|
11
13
|
}
|
14
|
+
type AcceptedContent = InterfacesUnion<{
|
15
|
+
text: string;
|
16
|
+
} | {
|
17
|
+
file: MessageFile;
|
18
|
+
} | {
|
19
|
+
html: string;
|
20
|
+
}>;
|
12
21
|
export declare class Messages {
|
13
22
|
elementRef: HTMLElement;
|
14
23
|
readonly messageStyles?: MessageStyles;
|
@@ -26,8 +35,10 @@ export declare class Messages {
|
|
26
35
|
private _introPanel?;
|
27
36
|
private _introMessage?;
|
28
37
|
private _streamedText;
|
38
|
+
readonly _htmlClassUtilities: HTMLClassUtilities;
|
29
39
|
messages: MessageContent[];
|
30
40
|
customDemoResponse?: DemoResponse;
|
41
|
+
submitUserMessage?: (text: string) => void;
|
31
42
|
constructor(deepChat: DeepChat, serviceIO: ServiceIO, panel?: HTMLElement);
|
32
43
|
private static getDisplayLoadingMessage;
|
33
44
|
private prepareDemo;
|
@@ -37,12 +48,12 @@ export declare class Messages {
|
|
37
48
|
private populateInitialMessages;
|
38
49
|
applyCustomStyles(elements: MessageElements, isAI: boolean, media: boolean, otherStyles?: MessageRoleStyles | MessageElementsStyles): void;
|
39
50
|
private addInnerContainerElements;
|
40
|
-
static createMessageContent(isAI: boolean,
|
51
|
+
static createMessageContent(isAI: boolean, content: AcceptedContent): MessageContent;
|
41
52
|
private static createBaseElements;
|
42
53
|
private createMessageElements;
|
43
54
|
createNewMessageElement(text: string, isAI: boolean): MessageElements;
|
44
55
|
private createAndAppendNewMessageElement;
|
45
|
-
|
56
|
+
static editEmptyMessageElement(bubbleElement: HTMLElement): void;
|
46
57
|
private addNewTextMessage;
|
47
58
|
addNewMessage(data: Response, isAI: boolean, update: boolean, isInitial?: boolean): void;
|
48
59
|
sendClientUpdate(message: MessageContent, isInitial?: boolean): void;
|
@@ -66,4 +77,5 @@ export declare class Messages {
|
|
66
77
|
private clearMessages;
|
67
78
|
private refreshTextMessages;
|
68
79
|
}
|
80
|
+
export {};
|
69
81
|
//# sourceMappingURL=messages.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../src/views/chat/messages/messages.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAe,SAAS,EAAC,MAAM,6BAA6B,CAAC;AAKpE,OAAO,EAAO,YAAY,EAAC,MAAM,qBAAqB,CAAC;
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../src/views/chat/messages/messages.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAe,SAAS,EAAC,MAAM,6BAA6B,CAAC;AAKpE,OAAO,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAC,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAO,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAMvD,OAAO,EAAC,QAAQ,EAA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