@appcorp/app-corp-vista 0.3.30 → 0.3.32
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 +7 -0
- package/molecules/vista-chat-side-bar-v2/vista-chat-side-bar-v2.d.ts +3 -0
- package/molecules/vista-chat-side-bar-v2/vista-chat-side-bar-v2.js +15 -15
- package/organisms/vista-chat-v2/vista-chat-messages-v2.js +5 -2
- package/organisms/vista-chat-v2/vista-chat-v2.js +7 -4
- package/package.json +1 -1
- package/type/vista-chat-type.d.ts +5 -0
package/data/vista-chat-props.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.vistaChatV2Props = exports.vistaChatV1Props = exports.messages = exports.chats = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
4
8
|
var vista_button_type_1 = require("../type/vista-button-type");
|
|
5
9
|
var vista_chat_type_1 = require("../type/vista-chat-type");
|
|
6
10
|
exports.chats = [
|
|
@@ -200,4 +204,7 @@ exports.vistaChatV2Props = {
|
|
|
200
204
|
showBanner: true,
|
|
201
205
|
showControls: true,
|
|
202
206
|
showLoadMore: true,
|
|
207
|
+
chatIsLoading: true,
|
|
208
|
+
sideBarHeading: 'hello',
|
|
209
|
+
sideBarNode: react_1.default.createElement("p", null, "Hello World"),
|
|
203
210
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.VistaChatSideBarV2 = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var vista_chat_heading_v1_1 = require("../vista-chat-heading-v1/vista-chat-heading-v1");
|
|
9
|
+
var VistaChatSideBarV2 = function (_a) {
|
|
10
|
+
var sideBarHeading = _a.sideBarHeading, sideBarNode = _a.sideBarNode;
|
|
11
|
+
return (react_1.default.createElement("div", { className: "col-span-3 flex flex-col border-r border-gray-200 shadow-md" },
|
|
12
|
+
react_1.default.createElement(vista_chat_heading_v1_1.VistaChatHeadingV1, { heading: sideBarHeading || '' }),
|
|
13
|
+
sideBarNode && (react_1.default.createElement("div", { className: "divide flex-1 divide-y divide-gray-600 overflow-y-auto" }, sideBarNode))));
|
|
14
|
+
};
|
|
15
|
+
exports.VistaChatSideBarV2 = VistaChatSideBarV2;
|
|
@@ -11,11 +11,14 @@ var vista_chat_bubble_v1_1 = require("../../molecules/vista-chat-bubble-v1/vista
|
|
|
11
11
|
var vista_button_v1_1 = require("../../molecules/vista-button-v1/vista-button-v1");
|
|
12
12
|
var vista_button_type_1 = require("../../type/vista-button-type");
|
|
13
13
|
var VistaChatMessagesV2 = function (_a) {
|
|
14
|
-
var
|
|
14
|
+
var chatIsLoading = _a.chatIsLoading, handleLoadMore = _a.handleLoadMore, messages = _a.messages, psychic = _a.psychic, showLoadMore = _a.showLoadMore, user = _a.user;
|
|
15
15
|
var lastDate = '';
|
|
16
16
|
return (react_1.default.createElement("div", { className: "overflow-y-scroll" },
|
|
17
17
|
showLoadMore && (react_1.default.createElement("div", { className: "flex flex-row justify-center" },
|
|
18
|
-
react_1.default.createElement(vista_button_v1_1.VistaButtonV1, { variant:
|
|
18
|
+
react_1.default.createElement(vista_button_v1_1.VistaButtonV1, { variant: chatIsLoading
|
|
19
|
+
? vista_button_type_1.VISTA_BUTTON_VARIANT.ICON
|
|
20
|
+
: vista_button_type_1.VISTA_BUTTON_VARIANT.SECONDARY, label: chatIsLoading ? '' : 'Load Previous Chats...', handleOnClick: handleLoadMore, className: "inline-flex max-w-48 transition-all duration-1000 !bg-white", icon: react_1.default.createElement("div", { role: "status", className: "h-6 w-6 border-4 border-primary border-t-transparent rounded-full animate-spin" },
|
|
21
|
+
react_1.default.createElement("span", { className: "sr-only" }, "Loading...")) }))),
|
|
19
22
|
messages.map(function (_a, ind) {
|
|
20
23
|
var _b, _c;
|
|
21
24
|
var createdAt = _a.createdAt, id = _a.id, isUser = _a.isUser, message = _a.message, messageStatus = _a.messageStatus;
|
|
@@ -12,19 +12,22 @@ var vista_button_v1_1 = require("../../molecules/vista-button-v1/vista-button-v1
|
|
|
12
12
|
var vista_button_type_1 = require("../../type/vista-button-type");
|
|
13
13
|
var vista_banner_v1_1 = require("../../atoms/vista-banner-v1/vista-banner-v1");
|
|
14
14
|
var vista_chat_messages_v2_1 = require("./vista-chat-messages-v2");
|
|
15
|
+
var vista_chat_side_bar_v2_1 = require("../../molecules/vista-chat-side-bar-v2/vista-chat-side-bar-v2");
|
|
15
16
|
var VistaChatV2 = function (_a) {
|
|
16
|
-
var actionItems = _a.actionItems, bannerDescription = _a.bannerDescription, bannerHeading = _a.bannerHeading, buttonDenominations = _a.buttonDenominations, chatId = _a.chatId, chatValue = _a.chatValue,
|
|
17
|
+
var actionItems = _a.actionItems, bannerDescription = _a.bannerDescription, bannerHeading = _a.bannerHeading, buttonDenominations = _a.buttonDenominations, chatId = _a.chatId, _b = _a.chatIsLoading, chatIsLoading = _b === void 0 ? false : _b, chatValue = _a.chatValue, _c = _a.containerClassName, containerClassName = _c === void 0 ? '' : _c, _d = _a.estimatedBalance, estimatedBalance = _d === void 0 ? '' : _d, handleChatOnChange = _a.handleChatOnChange, handleLoadMore = _a.handleLoadMore, handleOnBlur = _a.handleOnBlur, handleOnFocus = _a.handleOnFocus, handlePayment = _a.handlePayment, isBalanceLow = _a.isBalanceLow, messages = _a.messages, name = _a.name, paymentLoading = _a.paymentLoading, psychic = _a.psychic, _e = _a.showBanner, showBanner = _e === void 0 ? false : _e, _f = _a.showControls, showControls = _f === void 0 ? true : _f, showLoadMore = _a.showLoadMore, sideBarHeading = _a.sideBarHeading, sideBarNode = _a.sideBarNode, timer = _a.timer, typing = _a.typing, user = _a.user;
|
|
17
18
|
var handleOnKeyDown = function (e) {
|
|
18
19
|
if (e.key === 'Enter') {
|
|
19
20
|
actionItems[0].handleOnClick();
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
|
-
return (react_1.default.createElement("div", { className: "relative h-screen overflow-hidden max-w-7xl mx-auto ".concat(containerClassName) },
|
|
23
|
-
react_1.default.createElement("
|
|
23
|
+
return (react_1.default.createElement("div", { className: "relative h-screen overflow-hidden max-w-7xl mx-auto grid grid-cols-6 ".concat(containerClassName) },
|
|
24
|
+
react_1.default.createElement("div", { className: "col-span-1 h-full" },
|
|
25
|
+
react_1.default.createElement(vista_chat_side_bar_v2_1.VistaChatSideBarV2, { sideBarHeading: sideBarHeading, sideBarNode: sideBarNode })),
|
|
26
|
+
react_1.default.createElement("section", { className: "flex flex-col h-full col-span-5" },
|
|
24
27
|
react_1.default.createElement(vista_chat_heading_v1_1.VistaChatHeadingV1, { estimatedBalance: estimatedBalance, heading: name, timer: timer }),
|
|
25
28
|
showBanner && (react_1.default.createElement(vista_banner_v1_1.VistaBannerV1, { description: bannerDescription, heading: bannerHeading })),
|
|
26
29
|
react_1.default.createElement("div", { className: "overflow-y-auto h-full flex flex-col justify-end p-4" },
|
|
27
|
-
react_1.default.createElement(vista_chat_messages_v2_1.VistaChatMessagesV2, { messages: messages, psychic: psychic, showLoadMore: showLoadMore, user: user, handleLoadMore: handleLoadMore })),
|
|
30
|
+
react_1.default.createElement(vista_chat_messages_v2_1.VistaChatMessagesV2, { messages: messages, psychic: psychic, showLoadMore: showLoadMore, user: user, handleLoadMore: handleLoadMore, chatIsLoading: chatIsLoading })),
|
|
28
31
|
isBalanceLow && (react_1.default.createElement("div", { className: "grid grid-cols-5 m-4 p-4 border-2 border-primary border-dashed rounded-md justify-between items-center bg-cyan-200" },
|
|
29
32
|
react_1.default.createElement("div", { className: "col-span-2" },
|
|
30
33
|
react_1.default.createElement("p", { className: "text-md font-semibold" }, "You are running out of your Kismaa credits, click one of the buttons to top up your account.")),
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { VISTA_BUTTON_VARIANT } from './vista-button-type';
|
|
2
3
|
export declare enum VISTA_CHAT_BUBBLE_TYPES {
|
|
3
4
|
PSYCHIC = "PSYCHIC",
|
|
@@ -45,6 +46,7 @@ export interface VistaChatV2Props {
|
|
|
45
46
|
bannerHeading: string;
|
|
46
47
|
buttonDenominations: ButtonDenomination[];
|
|
47
48
|
chatId: string;
|
|
49
|
+
chatIsLoading?: boolean;
|
|
48
50
|
chatValue: string;
|
|
49
51
|
containerClassName?: string;
|
|
50
52
|
estimatedBalance?: string;
|
|
@@ -61,11 +63,14 @@ export interface VistaChatV2Props {
|
|
|
61
63
|
showBanner?: boolean;
|
|
62
64
|
showControls?: boolean;
|
|
63
65
|
showLoadMore: boolean;
|
|
66
|
+
sideBarHeading?: string;
|
|
67
|
+
sideBarNode?: ReactNode;
|
|
64
68
|
timer: string;
|
|
65
69
|
typing?: string;
|
|
66
70
|
user: VistaChatV2User;
|
|
67
71
|
}
|
|
68
72
|
export interface VistaChatMessageV2 {
|
|
73
|
+
chatIsLoading: boolean;
|
|
69
74
|
handleLoadMore: () => void;
|
|
70
75
|
messages: VistaChatV2Message[];
|
|
71
76
|
psychic: VistaChatV2Psychic;
|