@appcorp/app-corp-vista 0.1.28 → 0.1.30
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
CHANGED
|
@@ -115,6 +115,7 @@ exports.vistaChatV1Props = {
|
|
|
115
115
|
exports.vistaChatV2Props = {
|
|
116
116
|
chatId: 'id',
|
|
117
117
|
chatValue: '',
|
|
118
|
+
containerClassName: '',
|
|
118
119
|
handleChatOnChange: function () { return void 0; },
|
|
119
120
|
sideBarHeading: 'Psychic Tools',
|
|
120
121
|
sideBarNode: react_1.default.createElement("p", null, "Hello World"),
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.VistaTextInputV1 = void 0;
|
|
8
8
|
var react_1 = __importDefault(require("react"));
|
|
9
9
|
var VistaTextInputV1 = function (_a) {
|
|
10
|
-
var _b = _a.autoFocus, autoFocus = _b === void 0 ? false : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, error = _a.error, handleOnChange = _a.handleOnChange, id = _a.id, info = _a.info, label = _a.label, optional = _a.optional, placeholder = _a.placeholder, _e = _a.
|
|
10
|
+
var _b = _a.autoFocus, autoFocus = _b === void 0 ? false : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, error = _a.error, handleOnChange = _a.handleOnChange, handleOnKeyDown = _a.handleOnKeyDown, id = _a.id, info = _a.info, label = _a.label, max = _a.max, min = _a.min, optional = _a.optional, placeholder = _a.placeholder, prefix = _a.prefix, _e = _a.readOnly, readOnly = _e === void 0 ? false : _e, _f = _a.required, required = _f === void 0 ? false : _f, suffix = _a.suffix, _g = _a.type, type = _g === void 0 ? 'text' : _g, value = _a.value;
|
|
11
11
|
return (react_1.default.createElement("div", null,
|
|
12
12
|
react_1.default.createElement("div", { className: "flex justify-between" },
|
|
13
13
|
label && (react_1.default.createElement("div", { className: "mb-2" },
|
|
@@ -21,7 +21,7 @@ var VistaTextInputV1 = function (_a) {
|
|
|
21
21
|
react_1.default.createElement("span", { className: "text-gray-500 sm:text-sm" }, prefix))),
|
|
22
22
|
react_1.default.createElement("input", { autoComplete: id, className: "block w-full rounded-md border-0 bg-white/5 dark:bg-white/5 py-1.5 text-gray-900 dark:text-white shadow-sm ring-1 ring-inset ring-gray-200 focus:ring-2 focus:ring-inset focus:ring-primary disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-300 disabled:ring-gray-200 sm:text-sm/6 dark:disabled:bg-gray-800 dark:disabled:text-gray-400 dark:disabled:ring-gray-700 placeholder:text-gray-500 ".concat(prefix && 'pl-7', " ").concat(className), disabled: disabled, id: id, name: id, onChange: function (e) {
|
|
23
23
|
return handleOnChange(id, e.target.value);
|
|
24
|
-
}, autoFocus: autoFocus, placeholder: placeholder, readOnly: readOnly, required: required, type: type, value: value
|
|
24
|
+
}, autoFocus: autoFocus, max: max, min: min, onKeyDown: handleOnKeyDown, placeholder: placeholder, readOnly: readOnly, required: required, type: type, value: value }),
|
|
25
25
|
suffix && (react_1.default.createElement("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3" },
|
|
26
26
|
react_1.default.createElement("span", { id: "price-currency", className: "text-gray-500 sm:text-sm" }, suffix)))),
|
|
27
27
|
info && !error && (react_1.default.createElement("p", { id: "".concat(id, "-info"), className: "mt-2 text-sm text-primary" }, info)),
|
|
@@ -15,20 +15,24 @@ var vista_chat_bubble_v1_1 = require("../../molecules/vista-chat-bubble-v1/vista
|
|
|
15
15
|
var VistaChatV2 = function (_a) {
|
|
16
16
|
var actionItems = _a.actionItems, chatId = _a.chatId, chatValue = _a.chatValue, _b = _a.containerClassName, containerClassName = _b === void 0 ? '' : _b, handleChatOnChange = _a.handleChatOnChange, messages = _a.messages, name = _a.name, psychic = _a.psychic, sideBarHeading = _a.sideBarHeading, sideBarNode = _a.sideBarNode, timer = _a.timer, user = _a.user;
|
|
17
17
|
var renderChatMessages = function () {
|
|
18
|
-
return (react_1.default.createElement(
|
|
18
|
+
return (react_1.default.createElement("div", { className: 'overflow-y-scroll' }, messages.map((function (_a) {
|
|
19
19
|
var createdAt = _a.createdAt, id = _a.id, isUser = _a.isUser, message = _a.message;
|
|
20
20
|
return (react_1.default.createElement(vista_chat_bubble_v1_1.VistaChatBubbleV1, { createdAt: createdAt, isUser: isUser, key: id, message: message, psychic: psychic, user: user }));
|
|
21
21
|
}))));
|
|
22
22
|
};
|
|
23
|
+
var handleOnKeyDown = function (e) {
|
|
24
|
+
if (e.key === 'Enter') {
|
|
25
|
+
actionItems[0].handleOnClick();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
23
28
|
return (react_1.default.createElement("div", { className: "relative h-screen grid grid-cols-12 grid-rows-1 overflow-hidden ".concat(containerClassName) },
|
|
24
29
|
react_1.default.createElement(vista_chat_side_bar_v2_1.VistaChatSideBarV2, { sideBarHeading: sideBarHeading, sideBarNode: sideBarNode }),
|
|
25
30
|
react_1.default.createElement("section", { className: "col-span-9 flex flex-col" },
|
|
26
31
|
react_1.default.createElement(vista_chat_heading_v1_1.VistaChatHeadingV1, { heading: name, timer: timer }),
|
|
27
|
-
react_1.default.createElement("div", { className: "overflow-
|
|
28
|
-
react_1.default.createElement("div", { className: "h-full flex flex-col justify-end overflow-y-auto p-4" }, renderChatMessages())),
|
|
32
|
+
react_1.default.createElement("div", { className: "overflow-y-auto h-full flex flex-col justify-end p-4" }, renderChatMessages()),
|
|
29
33
|
react_1.default.createElement("div", { className: "flex flex-row items-center gap-4 border-t border-gray-200 p-4" },
|
|
30
34
|
react_1.default.createElement("div", { className: 'w-full' },
|
|
31
|
-
react_1.default.createElement(vista_text_input_v1_1.VistaTextInputV1, { handleOnChange: handleChatOnChange, id: chatId, placeholder: 'Enter message...', value: chatValue })),
|
|
35
|
+
react_1.default.createElement(vista_text_input_v1_1.VistaTextInputV1, { handleOnChange: handleChatOnChange, id: chatId, placeholder: 'Enter message...', value: chatValue, handleOnKeyDown: handleOnKeyDown })),
|
|
32
36
|
actionItems
|
|
33
37
|
.filter(function (_a) {
|
|
34
38
|
var enabled = _a.enabled;
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ReactNode, HTMLInputTypeAttribute } from "react";
|
|
1
|
+
import { ReactNode, HTMLInputTypeAttribute, KeyboardEvent } from "react";
|
|
2
2
|
export interface VistaTextInputV1Props {
|
|
3
3
|
autoFocus?: boolean;
|
|
4
4
|
className?: string;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
error?: string;
|
|
7
7
|
handleOnChange: (k: string, v: string) => void;
|
|
8
|
+
handleOnKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
8
9
|
id: string;
|
|
9
10
|
info?: string;
|
|
10
11
|
label?: string;
|