@appcorp/app-corp-vista 0.3.9 → 0.3.12
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/data/vista-chat-props.js +4 -4
- package/molecules/vista-chat-bubble-v1/vista-chat-bubble-v1.js +3 -2
- package/organisms/vista-chat-v2/vista-chat-v2.js +2 -2
- package/package.json +1 -1
- package/type/vista-chat-bubble-type.d.ts +2 -1
- package/type/vista-chat-type.d.ts +6 -5
- package/type/vista-chat-type.js +6 -6
package/data/vista-chat-props.js
CHANGED
|
@@ -135,28 +135,28 @@ exports.vistaChatV2Props = {
|
|
|
135
135
|
message: 'Hello from User',
|
|
136
136
|
id: 'item-1',
|
|
137
137
|
createdAt: '2025-01-11T10:09:49.891',
|
|
138
|
-
|
|
138
|
+
messageStatus: vista_chat_type_1.VISTA_CHAT_MESSAGE_STATUS.DELIVERED,
|
|
139
139
|
isUser: true,
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
message: 'Hello from Psychic',
|
|
143
143
|
id: 'item-2',
|
|
144
144
|
createdAt: '2025-01-11T10:15:49.891',
|
|
145
|
-
|
|
145
|
+
messageStatus: vista_chat_type_1.VISTA_CHAT_MESSAGE_STATUS.DELIVERED,
|
|
146
146
|
isUser: false,
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
149
|
message: 'Hello from User',
|
|
150
150
|
id: 'item-3',
|
|
151
151
|
createdAt: '2025-01-11T10:19:49.891',
|
|
152
|
-
|
|
152
|
+
messageStatus: vista_chat_type_1.VISTA_CHAT_MESSAGE_STATUS.DELIVERED,
|
|
153
153
|
isUser: true,
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
message: 'Hello from User',
|
|
157
157
|
id: 'item-4',
|
|
158
158
|
createdAt: '2025-01-12T10:29:49.891',
|
|
159
|
-
|
|
159
|
+
messageStatus: vista_chat_type_1.VISTA_CHAT_MESSAGE_STATUS.READ,
|
|
160
160
|
isUser: true,
|
|
161
161
|
},
|
|
162
162
|
],
|
|
@@ -39,7 +39,7 @@ var vista_avatar_v1_1 = require("../vista-avatar-v1/vista-avatar-v1");
|
|
|
39
39
|
var format_timestamp_1 = require("../../utils/format-timestamp");
|
|
40
40
|
var chat_triangle_1 = require("../../atoms/chat-triangle/chat-triangle");
|
|
41
41
|
var VistaChatBubbleV1 = function (_a) {
|
|
42
|
-
var createdAt = _a.createdAt, isLast = _a.isLast, isUser = _a.isUser, message = _a.message, psychic = _a.psychic, user = _a.user;
|
|
42
|
+
var createdAt = _a.createdAt, isLast = _a.isLast, isUser = _a.isUser, message = _a.message, messageStatus = _a.messageStatus, psychic = _a.psychic, user = _a.user;
|
|
43
43
|
var lastChatBubble = (0, react_1.useRef)(null);
|
|
44
44
|
var getBubbleStyles = function () { return ({
|
|
45
45
|
borderTopLeftRadius: isUser ? '8px' : '0px',
|
|
@@ -64,7 +64,8 @@ var VistaChatBubbleV1 = function (_a) {
|
|
|
64
64
|
react_1.default.createElement(chat_triangle_1.ChatTriangle, { fill: isUser ? '#9153D0' : '#E5E7EB' })),
|
|
65
65
|
react_1.default.createElement("p", { className: "px-4 pt-2" }, message),
|
|
66
66
|
react_1.default.createElement("div", { className: "flex items-center px-4 py-2 text-xs justify-between ".concat(isUser ? 'text-right' : 'text-left') },
|
|
67
|
-
react_1.default.createElement("span", { className: "mr-2" }, (0, format_timestamp_1.formatTimestamp)(createdAt))))
|
|
67
|
+
react_1.default.createElement("span", { className: "mr-2" }, (0, format_timestamp_1.formatTimestamp)(createdAt)))),
|
|
68
|
+
react_1.default.createElement("p", { className: "text-xs font-semibold text-end" }, messageStatus)),
|
|
68
69
|
react_1.default.createElement("div", { className: "order-1 min-w-10" },
|
|
69
70
|
react_1.default.createElement(vista_avatar_v1_1.VistaAvatarV1, { alt: isUser ? user.avatarAlt : psychic.avatarAlt, src: isUser ? user.avatarUrl : psychic.avatarUrl }))));
|
|
70
71
|
};
|
|
@@ -20,7 +20,7 @@ var VistaChatV2 = function (_a) {
|
|
|
20
20
|
var lastDate = '';
|
|
21
21
|
return (react_1.default.createElement("div", { className: "overflow-y-scroll" }, messages.map(function (_a, ind) {
|
|
22
22
|
var _b, _c;
|
|
23
|
-
var createdAt = _a.createdAt, id = _a.id, isUser = _a.isUser, message = _a.message;
|
|
23
|
+
var createdAt = _a.createdAt, id = _a.id, isUser = _a.isUser, message = _a.message, messageStatus = _a.messageStatus;
|
|
24
24
|
var shouldShowDivider = ((_b = lastDate.split('T')) === null || _b === void 0 ? void 0 : _b[0]) === ((_c = createdAt.split('T')) === null || _c === void 0 ? void 0 : _c[0])
|
|
25
25
|
? false
|
|
26
26
|
: true;
|
|
@@ -28,7 +28,7 @@ var VistaChatV2 = function (_a) {
|
|
|
28
28
|
return (react_1.default.createElement("div", { key: id },
|
|
29
29
|
shouldShowDivider && (react_1.default.createElement("div", { className: "pt-8" },
|
|
30
30
|
react_1.default.createElement(vista_vertical_divider_v1_1.VistaVerticalDividerV1, { label: (0, util_functions_1.formatDate)(createdAt, util_functions_1.DATE_FORMATS.DAY_DD_MM_YY_COMPACT) }))),
|
|
31
|
-
react_1.default.createElement(vista_chat_bubble_v1_1.VistaChatBubbleV1, { createdAt: createdAt, isUser: isUser, message: message, psychic: psychic, user: user,
|
|
31
|
+
react_1.default.createElement(vista_chat_bubble_v1_1.VistaChatBubbleV1, { createdAt: createdAt, isLast: ind === messages.length - 1, isUser: isUser, message: message, psychic: psychic, user: user, messageStatus: messageStatus })));
|
|
32
32
|
})));
|
|
33
33
|
};
|
|
34
34
|
var handleOnKeyDown = function (e) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { VistaChatV2Psychic, VistaChatV2User } from './vista-chat-type';
|
|
1
|
+
import { VISTA_CHAT_MESSAGE_STATUS, VistaChatV2Psychic, VistaChatV2User } from './vista-chat-type';
|
|
2
2
|
export interface VistaChatBubbleV1Props {
|
|
3
3
|
createdAt: string;
|
|
4
4
|
isLast: boolean;
|
|
5
5
|
isUser: boolean;
|
|
6
6
|
message: string;
|
|
7
|
+
messageStatus: VISTA_CHAT_MESSAGE_STATUS;
|
|
7
8
|
psychic: VistaChatV2Psychic;
|
|
8
9
|
user: VistaChatV2User;
|
|
9
10
|
}
|
|
@@ -4,9 +4,9 @@ export declare enum VISTA_CHAT_BUBBLE_TYPES {
|
|
|
4
4
|
PSYCHIC = "PSYCHIC",
|
|
5
5
|
USER = "USER"
|
|
6
6
|
}
|
|
7
|
-
export declare enum
|
|
7
|
+
export declare enum VISTA_CHAT_MESSAGE_STATUS {
|
|
8
8
|
DELIVERED = "DELIVERED",
|
|
9
|
-
|
|
9
|
+
READ = "READ"
|
|
10
10
|
}
|
|
11
11
|
export interface VistaChatV1Props {
|
|
12
12
|
currentUser: VISTA_CHAT_BUBBLE_TYPES;
|
|
@@ -30,10 +30,11 @@ export interface VistaChatV2Psychic {
|
|
|
30
30
|
avatarAlt: string;
|
|
31
31
|
}
|
|
32
32
|
export interface VistaChatV2Message {
|
|
33
|
-
|
|
34
|
-
id: string;
|
|
35
|
-
isUser: boolean;
|
|
33
|
+
messageStatus: VISTA_CHAT_MESSAGE_STATUS;
|
|
36
34
|
message: string;
|
|
35
|
+
isUser: boolean;
|
|
36
|
+
id: string;
|
|
37
|
+
createdAt: string;
|
|
37
38
|
}
|
|
38
39
|
export interface ButtonDenomination {
|
|
39
40
|
loading: string;
|
package/type/vista-chat-type.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.VISTA_CHAT_MESSAGE_STATUS = exports.VISTA_CHAT_BUBBLE_TYPES = void 0;
|
|
5
5
|
var VISTA_CHAT_BUBBLE_TYPES;
|
|
6
6
|
(function (VISTA_CHAT_BUBBLE_TYPES) {
|
|
7
7
|
VISTA_CHAT_BUBBLE_TYPES["PSYCHIC"] = "PSYCHIC";
|
|
8
8
|
VISTA_CHAT_BUBBLE_TYPES["USER"] = "USER";
|
|
9
9
|
})(VISTA_CHAT_BUBBLE_TYPES || (exports.VISTA_CHAT_BUBBLE_TYPES = VISTA_CHAT_BUBBLE_TYPES = {}));
|
|
10
|
-
var
|
|
11
|
-
(function (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})(
|
|
10
|
+
var VISTA_CHAT_MESSAGE_STATUS;
|
|
11
|
+
(function (VISTA_CHAT_MESSAGE_STATUS) {
|
|
12
|
+
VISTA_CHAT_MESSAGE_STATUS["DELIVERED"] = "DELIVERED";
|
|
13
|
+
VISTA_CHAT_MESSAGE_STATUS["READ"] = "READ";
|
|
14
|
+
})(VISTA_CHAT_MESSAGE_STATUS || (exports.VISTA_CHAT_MESSAGE_STATUS = VISTA_CHAT_MESSAGE_STATUS = {}));
|