@axos-web-dev/shared-components 1.0.100-dev.43-executive.3 → 1.0.100-dev.45
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/dist/ATMLocator/ATMLocator.js +1 -2
- package/dist/Auth/ErrorAlert.js +0 -1
- package/dist/Auth/SignInPassword.js +2 -2
- package/dist/Avatar/Avatar.module.js +7 -7
- package/dist/Blockquote/Blockquote.module.js +3 -3
- package/dist/BulletItem/BulletItem.js +1 -0
- package/dist/Button/Button.js +0 -1
- package/dist/Calculators/AnnualFeeCalculator/index.js +1 -1
- package/dist/Calculators/BuyDownCalculator/index.js +1 -1
- package/dist/Calculators/Calculator.js +2 -3
- package/dist/Calculators/MarineLoanMonthlyPaymentCalculator/index.js +1 -1
- package/dist/Calculators/MaxLoanCalculator/index.js +1 -1
- package/dist/Calculators/MonthlyPaymentCalculator/index.js +1 -1
- package/dist/Carousel/index.js +0 -1
- package/dist/Chatbot/ChatWindow.css.d.ts +1 -0
- package/dist/Chatbot/ChatWindow.css.js +13 -12
- package/dist/Chatbot/ChatWindow.js +87 -66
- package/dist/Chatbot/Chatbot.css.js +1 -0
- package/dist/Chatbot/Chatbot.d.ts +1 -1
- package/dist/Chatbot/Chatbot.js +46 -10
- package/dist/Chatbot/index.js +2 -1
- package/dist/Chevron/index.js +0 -1
- package/dist/Comparison/Comparison.js +0 -1
- package/dist/ExecutiveBio/ExecutiveBio.js +351 -355
- package/dist/FaqAccordion/index.js +0 -1
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +0 -1
- package/dist/Forms/ApplicationStart.js +4 -2
- package/dist/Forms/ApplyNow.js +1 -2
- package/dist/Forms/ClearingForm.js +4 -2
- package/dist/Forms/CommercialDeposits.js +4 -2
- package/dist/Forms/CommercialDepositsNoLendingOption.js +4 -2
- package/dist/Forms/CommercialLending.js +4 -2
- package/dist/Forms/CommercialPremiumFinance.js +4 -2
- package/dist/Forms/ContactCompany.js +4 -2
- package/dist/Forms/ContactCompanyTitle.js +4 -2
- package/dist/Forms/ContactUs.js +4 -2
- package/dist/Forms/ContactUsAAS.js +4 -2
- package/dist/Forms/ContactUsBusiness.js +4 -3
- package/dist/Forms/ContactUsBusinessNameEmail.js +4 -3
- package/dist/Forms/ContactUsLVF.js +4 -2
- package/dist/Forms/ContactUsNMLSId.js +4 -3
- package/dist/Forms/CpraRequest.d.ts +1 -1
- package/dist/Forms/CpraRequest.js +5 -2
- package/dist/Forms/CraPublicFile.js +4 -3
- package/dist/Forms/DealerServices.js +4 -2
- package/dist/Forms/EmailOnly.js +4 -3
- package/dist/Forms/EmailUs.js +7 -5
- package/dist/Forms/HoneyPot/index.js +2 -1
- package/dist/Forms/MortgageRate/MortgageRateForm.js +4 -3
- package/dist/Forms/MortgageRate/MortgageRateWatch.js +0 -1
- package/dist/Forms/MortgageWarehouseLending.js +4 -3
- package/dist/Forms/QuickPricer/QuickPricerForm.js +16 -12
- package/dist/Forms/ScheduleCall.js +4 -2
- package/dist/Forms/ScheduleCallPremier.js +4 -2
- package/dist/Forms/SuccesForm.js +2 -3
- package/dist/Forms/VendorQuestionnaire.js +6 -2
- package/dist/Forms/index.js +1 -0
- package/dist/Hyperlink/index.js +0 -1
- package/dist/ImageLink/ImageLink.js +1 -2
- package/dist/ImageLink/ImageLinkSet.js +0 -1
- package/dist/ImageLink/index.js +0 -1
- package/dist/Insight/Featured/CategorySelector.js +0 -1
- package/dist/Insight/Featured/Featured.js +0 -1
- package/dist/Insight/Featured/Header.js +0 -1
- package/dist/LoadingIndicator/index.js +1 -0
- package/dist/Modal/Modal.js +0 -1
- package/dist/Modal/contextApi/store.js +1 -1
- package/dist/NavigationMenu/AxosALTS/NavData.js +0 -1
- package/dist/NavigationMenu/AxosALTS/index.js +0 -1
- package/dist/NavigationMenu/AxosAdvisor/NavBar.module.js +52 -52
- package/dist/NavigationMenu/AxosAdvisorServices/NavBar.module.js +53 -53
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +16 -16
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +0 -1
- package/dist/NavigationMenu/AxosBank/NavBar.module.js +39 -39
- package/dist/NavigationMenu/AxosBank/NavData.js +0 -1
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +7 -6
- package/dist/NavigationMenu/AxosBank/index.js +0 -1
- package/dist/NavigationMenu/AxosClearing/NavBar.module.js +37 -37
- package/dist/NavigationMenu/AxosFiduciary/NavBar.module.js +41 -41
- package/dist/NavigationMenu/LaVictoire/NavData.js +0 -1
- package/dist/NavigationMenu/LaVictoire/index.js +0 -1
- package/dist/NavigationMenu/NavDataJson.js +0 -1
- package/dist/NavigationMenu/Navbar.js +0 -1
- package/dist/NavigationMenu/SignInNavButton.js +0 -1
- package/dist/SetContainer/SetContainer.js +1 -2
- package/dist/SocialMediaBar/iconsRepository.js +0 -1
- package/dist/Tab/Tab.js +1 -0
- package/dist/VideoTile/VideoTile.js +0 -1
- package/dist/VideoWrapper/index.js +0 -1
- package/dist/assets/Avatar/Avatar.css.css +59 -59
- package/dist/assets/Blockquote/Blockquote.css.css +72 -72
- package/dist/assets/Chatbot/ChatWindow.css +38 -26
- package/dist/assets/NavigationMenu/AxosAdvisor/NavBar.css.css +609 -609
- package/dist/assets/NavigationMenu/AxosAdvisorServices/NavBar.css.css +630 -630
- package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css.css +192 -192
- package/dist/assets/NavigationMenu/AxosBank/NavBar.css.css +445 -445
- package/dist/assets/NavigationMenu/AxosClearing/NavBar.css.css +484 -484
- package/dist/assets/NavigationMenu/AxosFiduciary/NavBar.css.css +427 -427
- package/dist/main.js +10 -2
- package/dist/utils/emailValidation.d.ts +1 -0
- package/dist/utils/emailValidation.js +31 -0
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.js +9 -1
- package/dist/utils/nmlsValidation.d.ts +1 -0
- package/dist/utils/nmlsValidation.js +34 -0
- package/dist/utils/useCachedValidators.d.ts +2 -0
- package/dist/utils/useCachedValidators.js +22 -0
- package/package.json +136 -136
|
@@ -11,11 +11,11 @@ import '../assets/VideoWrapper/VideoWrapper.css';import '../assets/TopicalNavSet
|
|
|
11
11
|
/* empty css */
|
|
12
12
|
import "../utils/allowedAxosDomains.js";
|
|
13
13
|
import { getVariant } from "../utils/getVariant.js";
|
|
14
|
+
import "react";
|
|
14
15
|
import clsx from "clsx";
|
|
15
16
|
/* empty css */
|
|
16
17
|
/* empty css */
|
|
17
18
|
import "../Button/Button.css.js";
|
|
18
|
-
import "react";
|
|
19
19
|
import "react-use";
|
|
20
20
|
import "../Accordion/Accordion.js";
|
|
21
21
|
import "../Accordion/Accordion.css.js";
|
|
@@ -73,7 +73,6 @@ import "../Chatbot/authenticate.js";
|
|
|
73
73
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
74
74
|
/* empty css */
|
|
75
75
|
import "../Chatbot/store/messages.js";
|
|
76
|
-
import "@ujet/websdk-headless";
|
|
77
76
|
/* empty css */
|
|
78
77
|
import "../Comparison/Comparison.css.js";
|
|
79
78
|
import "next/image.js";
|
package/dist/Auth/ErrorAlert.js
CHANGED
|
@@ -65,7 +65,6 @@ import "../Chatbot/authenticate.js";
|
|
|
65
65
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
66
66
|
/* empty css */
|
|
67
67
|
import "../Chatbot/store/messages.js";
|
|
68
|
-
import "@ujet/websdk-headless";
|
|
69
68
|
import { Hyperlink } from "../Hyperlink/index.js";
|
|
70
69
|
/* empty css */
|
|
71
70
|
import "../Comparison/Comparison.css.js";
|
|
@@ -3,12 +3,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
4
4
|
import { Input } from "../Input/Input.js";
|
|
5
5
|
import "../utils/allowedAxosDomains.js";
|
|
6
|
+
import { z } from "zod";
|
|
6
7
|
import { getVariant } from "../utils/getVariant.js";
|
|
8
|
+
import { useState } from "react";
|
|
7
9
|
import clsx from "clsx";
|
|
8
10
|
import { useAction } from "next-safe-action/hooks";
|
|
9
|
-
import { useState } from "react";
|
|
10
11
|
import { useForm } from "react-hook-form";
|
|
11
|
-
import { z } from "zod";
|
|
12
12
|
import { ErrorAlert } from "./ErrorAlert.js";
|
|
13
13
|
import { body_sign_in, form_input_wrapper, sign_in_button, sign_in_form } from "./SignIn.css.js";
|
|
14
14
|
const schema = z.object({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import '../assets/Avatar/Avatar.css.css';const avatar_sec = "
|
|
2
|
-
const container = "
|
|
3
|
-
const image = "
|
|
4
|
-
const text = "
|
|
5
|
-
const name = "
|
|
6
|
-
const title = "
|
|
7
|
-
const description = "
|
|
1
|
+
import '../assets/Avatar/Avatar.css.css';const avatar_sec = "_avatar_sec_q4a8z_1";
|
|
2
|
+
const container = "_container_q4a8z_9";
|
|
3
|
+
const image = "_image_q4a8z_27";
|
|
4
|
+
const text = "_text_q4a8z_45";
|
|
5
|
+
const name = "_name_q4a8z_57";
|
|
6
|
+
const title = "_title_q4a8z_73";
|
|
7
|
+
const description = "_description_q4a8z_87";
|
|
8
8
|
const css = {
|
|
9
9
|
avatar_sec,
|
|
10
10
|
container,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import '../assets/Blockquote/Blockquote.css.css';const quote_spacer = "
|
|
2
|
-
const author = "
|
|
3
|
-
const quote = "
|
|
1
|
+
import '../assets/Blockquote/Blockquote.css.css';const quote_spacer = "_quote_spacer_lqs2u_1";
|
|
2
|
+
const author = "_author_lqs2u_13";
|
|
3
|
+
const quote = "_quote_lqs2u_1";
|
|
4
4
|
const css = {
|
|
5
5
|
quote_spacer,
|
|
6
6
|
author,
|
|
@@ -10,6 +10,7 @@ import '../assets/icons/FollowIcon/FollowIcon.css';import '../assets/icons/Downl
|
|
|
10
10
|
/* empty css */
|
|
11
11
|
import "../utils/allowedAxosDomains.js";
|
|
12
12
|
import { getVariant } from "../utils/getVariant.js";
|
|
13
|
+
import "react";
|
|
13
14
|
import clsx from "clsx";
|
|
14
15
|
import { bulletIcon } from "./BulletItem.css.js";
|
|
15
16
|
const BulletItem = (props) => {
|
package/dist/Button/Button.js
CHANGED
|
@@ -76,7 +76,6 @@ import "../Chatbot/authenticate.js";
|
|
|
76
76
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
77
77
|
/* empty css */
|
|
78
78
|
import "../Chatbot/store/messages.js";
|
|
79
|
-
import "@ujet/websdk-headless";
|
|
80
79
|
/* empty css */
|
|
81
80
|
import "../Comparison/Comparison.css.js";
|
|
82
81
|
import "next/image.js";
|
|
@@ -5,8 +5,8 @@ import { Chevron } from "../../Chevron/index.js";
|
|
|
5
5
|
import { title } from "../../IconBillboard/IconBillboard.css.js";
|
|
6
6
|
import "../../utils/allowedAxosDomains.js";
|
|
7
7
|
import { getVariant } from "../../utils/getVariant.js";
|
|
8
|
-
import clsx from "clsx";
|
|
9
8
|
import { useRef, useState, useEffect } from "react";
|
|
9
|
+
import clsx from "clsx";
|
|
10
10
|
import { calculator } from "../calculator.css.js";
|
|
11
11
|
import { container, calc_container, calc_block, pb0_1023, slider_block_wrapper, w100, stat_row, balance_wrapper, fb50, stat, slider_wrapper, slider, pt0_1023, text_block } from "./AnnualFeeCalculator.css.js";
|
|
12
12
|
const AnnualFeeCalculator = ({
|
|
@@ -19,10 +19,10 @@ import "../../Input/DownPaymentInput.js";
|
|
|
19
19
|
import "../../Input/RadioButton.js";
|
|
20
20
|
import { PercentageInput } from "../../Input/PercentageInput.js";
|
|
21
21
|
import "../../utils/allowedAxosDomains.js";
|
|
22
|
+
import { z } from "zod";
|
|
22
23
|
import { getVariant } from "../../utils/getVariant.js";
|
|
23
24
|
import clsx from "clsx";
|
|
24
25
|
import { useForm, FormProvider } from "react-hook-form";
|
|
25
|
-
import { z } from "zod";
|
|
26
26
|
import { calc_container, calculator_section, section_header, theme_header, mt_8, buydown_calculator_form, row_form, calculate_row, form_wrapper, form_disclosure } from "./BuyDownCalculator.css.js";
|
|
27
27
|
const BuyDownCalculator = ({
|
|
28
28
|
header,
|
|
@@ -14,13 +14,13 @@ import '../assets/Forms/QuickPricer/UserInformation.css';import '../assets/Forms
|
|
|
14
14
|
/* empty css */
|
|
15
15
|
import "../utils/allowedAxosDomains.js";
|
|
16
16
|
import { getVariant } from "../utils/getVariant.js";
|
|
17
|
+
import { useRef, useEffect } from "react";
|
|
17
18
|
import clsx from "clsx";
|
|
18
19
|
/* empty css */
|
|
19
20
|
/* empty css */
|
|
20
21
|
import "../Accordion/Accordion.js";
|
|
21
22
|
import "../Accordion/Accordion.css.js";
|
|
22
23
|
import "../AlertBanner/AlertBanner.css.js";
|
|
23
|
-
import { useRef, useEffect } from "react";
|
|
24
24
|
import "../Article/Article.css.js";
|
|
25
25
|
import "../ArticlesSet/ArticlesSet.css.js";
|
|
26
26
|
import "../Chevron/Chevron.css.js";
|
|
@@ -52,11 +52,10 @@ import "../Carousel/index.js";
|
|
|
52
52
|
/* empty css */
|
|
53
53
|
import "../Chatbot/store/chat.js";
|
|
54
54
|
import "../Chatbot/authenticate.js";
|
|
55
|
-
import "react-use";
|
|
56
55
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
56
|
+
import "react-use";
|
|
57
57
|
/* empty css */
|
|
58
58
|
import "../Chatbot/store/messages.js";
|
|
59
|
-
import "@ujet/websdk-headless";
|
|
60
59
|
/* empty css */
|
|
61
60
|
import "../Comparison/Comparison.css.js";
|
|
62
61
|
import "next/image.js";
|
|
@@ -4,8 +4,8 @@ import { button } from "../../Button/Button.css.js";
|
|
|
4
4
|
import { title } from "../../IconBillboard/IconBillboard.css.js";
|
|
5
5
|
import "../../utils/allowedAxosDomains.js";
|
|
6
6
|
import { getVariant } from "../../utils/getVariant.js";
|
|
7
|
-
import clsx from "clsx";
|
|
8
7
|
import { useState } from "react";
|
|
8
|
+
import clsx from "clsx";
|
|
9
9
|
import { calc_text, description_text, calc_disclosure } from "../BalanceAPYCalculator/BalanceAPYCalculator.css.js";
|
|
10
10
|
import { calculator } from "../calculator.css.js";
|
|
11
11
|
import { calc_container, container, h2i, inputs_container, input_container, input_box, error_message, hide_select_arrow, calculation_header, payment_results } from "../MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js";
|
|
@@ -5,8 +5,8 @@ import { calc_container, container, h2i, inputs_container, input_container, inpu
|
|
|
5
5
|
import { title } from "../../IconBillboard/IconBillboard.css.js";
|
|
6
6
|
import "../../utils/allowedAxosDomains.js";
|
|
7
7
|
import { getVariant } from "../../utils/getVariant.js";
|
|
8
|
-
import clsx from "clsx";
|
|
9
8
|
import { useState } from "react";
|
|
9
|
+
import clsx from "clsx";
|
|
10
10
|
import { calculator } from "../calculator.css.js";
|
|
11
11
|
const MaxLoanCalculator = ({
|
|
12
12
|
variant,
|
|
@@ -4,8 +4,8 @@ import { button } from "../../Button/Button.css.js";
|
|
|
4
4
|
import { title } from "../../IconBillboard/IconBillboard.css.js";
|
|
5
5
|
import "../../utils/allowedAxosDomains.js";
|
|
6
6
|
import { getVariant } from "../../utils/getVariant.js";
|
|
7
|
-
import clsx from "clsx";
|
|
8
7
|
import { useState } from "react";
|
|
8
|
+
import clsx from "clsx";
|
|
9
9
|
import { calc_text, description_text, calc_disclosure } from "../BalanceAPYCalculator/BalanceAPYCalculator.css.js";
|
|
10
10
|
import { calculator } from "../calculator.css.js";
|
|
11
11
|
import { calc_container, container, h2i, inputs_container, input_container, input_box, error_message, calculation_header, payment_results } from "./MonthlyPaymentCalculator.css.js";
|
package/dist/Carousel/index.js
CHANGED
|
@@ -78,7 +78,6 @@ import "../Chatbot/authenticate.js";
|
|
|
78
78
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
79
79
|
/* empty css */
|
|
80
80
|
import "../Chatbot/store/messages.js";
|
|
81
|
-
import "@ujet/websdk-headless";
|
|
82
81
|
/* empty css */
|
|
83
82
|
import "../Comparison/Comparison.css.js";
|
|
84
83
|
import "next/image.js";
|
|
@@ -5,6 +5,7 @@ export declare const chat_title: string;
|
|
|
5
5
|
export declare const button_reset: string;
|
|
6
6
|
export declare const arrowFill: string;
|
|
7
7
|
export declare const inputStyle: string;
|
|
8
|
+
export declare const autoResize: string;
|
|
8
9
|
export declare const sendButtonStyle: string;
|
|
9
10
|
export declare const messagesContainerStyle: string;
|
|
10
11
|
export declare const notificationStyle: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "./Chatbot.css.ts.vanilla.css.js";
|
|
2
1
|
import '../assets/Chatbot/ChatWindow.css';/* empty css */
|
|
3
2
|
var windowStyle = "_13n1jqk0";
|
|
4
3
|
var windowOpenStyle = "_13n1jqk1";
|
|
@@ -7,19 +6,21 @@ var chat_title = "_13n1jqk3";
|
|
|
7
6
|
var button_reset = "_13n1jqk4";
|
|
8
7
|
var arrowFill = "_13n1jqk5";
|
|
9
8
|
var inputStyle = "_13n1jqk6";
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
9
|
+
var autoResize = "_13n1jqk7";
|
|
10
|
+
var sendButtonStyle = "_13n1jqk8";
|
|
11
|
+
var messagesContainerStyle = "_13n1jqk9";
|
|
12
|
+
var notificationStyle = "_13n1jqka";
|
|
13
|
+
var messageStyle = "_13n1jqkb";
|
|
14
|
+
var inline_button_wrapper = "_13n1jqkc";
|
|
15
|
+
var inline_button = "_13n1jqkd";
|
|
16
|
+
var endChatButtonStyle = "_13n1jqke";
|
|
17
|
+
var chatbotMenu = "_13n1jqkf";
|
|
18
|
+
var chatbotMenuItem = "_13n1jqkg";
|
|
19
|
+
var chatNetworkStatus = "_13n1jqkh";
|
|
20
|
+
var chatFinishDialog = "_13n1jqki";
|
|
21
21
|
export {
|
|
22
22
|
arrowFill,
|
|
23
|
+
autoResize,
|
|
23
24
|
button_reset,
|
|
24
25
|
chatFinishDialog,
|
|
25
26
|
chatNetworkStatus,
|
|
@@ -5,7 +5,7 @@ import React, { useRef, useEffect, Fragment as Fragment$1 } from "react";
|
|
|
5
5
|
import ReactMarkdown from "react-markdown";
|
|
6
6
|
import { useNetworkState, useMount } from "react-use";
|
|
7
7
|
import remarkGfm from "remark-gfm";
|
|
8
|
-
import { windowBarStyle, chat_title, chatbotMenuItem, chatbotMenu, chatFinishDialog, endChatButtonStyle, button_reset, arrowFill, chatNetworkStatus, notificationStyle, messageStyle, inline_button_wrapper, inline_button, messagesContainerStyle, inputStyle, sendButtonStyle, windowStyle, windowOpenStyle } from "./ChatWindow.css.js";
|
|
8
|
+
import { windowBarStyle, chat_title, chatbotMenuItem, chatbotMenu, chatFinishDialog, endChatButtonStyle, button_reset, arrowFill, chatNetworkStatus, notificationStyle, messageStyle, inline_button_wrapper, inline_button, messagesContainerStyle, inputStyle, autoResize, sendButtonStyle, windowStyle, windowOpenStyle } from "./ChatWindow.css.js";
|
|
9
9
|
import EllipsisLoader from "./EllipsisAnimation.js";
|
|
10
10
|
import { EllipsisIcon } from "./EllipsisIcon.js";
|
|
11
11
|
import { useOpenChat } from "./store/chat.js";
|
|
@@ -28,14 +28,16 @@ const ChatWindow = ({
|
|
|
28
28
|
const state = useNetworkState();
|
|
29
29
|
const [input, setInput] = React.useState("");
|
|
30
30
|
const messagesEndRef = useRef(null);
|
|
31
|
+
const inputRef = useRef(null);
|
|
31
32
|
const isOpen = useOpenChat((state2) => state2.isOpen);
|
|
32
33
|
useEffect(() => {
|
|
33
34
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
34
35
|
}, [messages]);
|
|
35
36
|
const handleSend = (e) => {
|
|
36
37
|
e.preventDefault();
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
const cleaned = cleanInput(input);
|
|
39
|
+
if (cleaned) {
|
|
40
|
+
onSend(cleaned);
|
|
39
41
|
setInput("");
|
|
40
42
|
}
|
|
41
43
|
};
|
|
@@ -49,6 +51,18 @@ const ChatWindow = ({
|
|
|
49
51
|
const escalationDeflected = messages?.filter(
|
|
50
52
|
(item) => item.type == "noti" && item.event == "escalationDeflected"
|
|
51
53
|
).length > 0;
|
|
54
|
+
const cleanInput = (text) => text.replace(/[\r\n]+/g, " ").trim();
|
|
55
|
+
const autoResizeTextarea = () => {
|
|
56
|
+
if (inputRef.current) {
|
|
57
|
+
inputRef.current.style.height = "auto";
|
|
58
|
+
inputRef.current.style.maxHeight = "80px";
|
|
59
|
+
inputRef.current.style.height = inputRef.current.scrollHeight + "px";
|
|
60
|
+
inputRef.current.style.overflowY = inputRef.current.scrollHeight > 80 ? "auto" : "hidden";
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
autoResizeTextarea();
|
|
65
|
+
}, [input]);
|
|
52
66
|
return /* @__PURE__ */ jsxs("div", { className: clsx(windowStyle, isOpen && windowOpenStyle), children: [
|
|
53
67
|
/* @__PURE__ */ jsxs("div", { className: windowBarStyle, children: [
|
|
54
68
|
/* @__PURE__ */ jsxs("div", { className: "flex middle", style: { paddingBlock: "6px" }, children: [
|
|
@@ -269,7 +283,7 @@ const ChatWindow = ({
|
|
|
269
283
|
),
|
|
270
284
|
/* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: endChat, children: "End Chat" }) })
|
|
271
285
|
] }),
|
|
272
|
-
["text", "markdown_template", "markdown"].includes(msg.type) && /* @__PURE__ */
|
|
286
|
+
["text", "markdown_template", "markdown"].includes(msg.type) && /* @__PURE__ */ jsx(
|
|
273
287
|
"div",
|
|
274
288
|
{
|
|
275
289
|
className: messageStyle,
|
|
@@ -280,62 +294,58 @@ const ChatWindow = ({
|
|
|
280
294
|
color: msg.$userType == "end_user" ? "#fff" : "#1F1F1F",
|
|
281
295
|
boxShadow: msg.$userType == "end_user" ? "0 1px 4px #b3e0ff55" : void 0
|
|
282
296
|
},
|
|
283
|
-
children:
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
{
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
{
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
{
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
"
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
),
|
|
337
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 10, color: "#888", marginTop: 2 } })
|
|
338
|
-
]
|
|
297
|
+
children: /* @__PURE__ */ jsxs(
|
|
298
|
+
"div",
|
|
299
|
+
{
|
|
300
|
+
style: {
|
|
301
|
+
fontSize: 13,
|
|
302
|
+
display: "flex",
|
|
303
|
+
flexDirection: "column",
|
|
304
|
+
gap: 4
|
|
305
|
+
},
|
|
306
|
+
children: [
|
|
307
|
+
msg.$userType == "virtual_agent" && /* @__PURE__ */ jsxs(
|
|
308
|
+
"div",
|
|
309
|
+
{
|
|
310
|
+
style: {
|
|
311
|
+
display: "flex",
|
|
312
|
+
alignItems: "center",
|
|
313
|
+
gap: "8px"
|
|
314
|
+
},
|
|
315
|
+
children: [
|
|
316
|
+
showAvatar && /* @__PURE__ */ jsx(
|
|
317
|
+
"img",
|
|
318
|
+
{
|
|
319
|
+
width: 24,
|
|
320
|
+
height: 24,
|
|
321
|
+
src: virtualAgent?.avatar_url,
|
|
322
|
+
alt: "agent avatar"
|
|
323
|
+
}
|
|
324
|
+
),
|
|
325
|
+
/* @__PURE__ */ jsx("strong", { children: virtualAgent?.name })
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
),
|
|
329
|
+
msg.$userType != "end_user" ? /* @__PURE__ */ jsx(
|
|
330
|
+
ReactMarkdown,
|
|
331
|
+
{
|
|
332
|
+
remarkPlugins: [[remarkGfm, { singleTilde: false }]],
|
|
333
|
+
components: {
|
|
334
|
+
p: ({ ...props }) => /* @__PURE__ */ jsx(
|
|
335
|
+
"p",
|
|
336
|
+
{
|
|
337
|
+
style: { margin: 0, fontSize: "inherit" },
|
|
338
|
+
title: new Date(msg.$timestamp).toLocaleString(),
|
|
339
|
+
...props
|
|
340
|
+
}
|
|
341
|
+
)
|
|
342
|
+
},
|
|
343
|
+
children: msg.content
|
|
344
|
+
}
|
|
345
|
+
) : /* @__PURE__ */ jsx("div", { title: new Date(msg.$timestamp).toLocaleString(), children: msg.content })
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
)
|
|
339
349
|
},
|
|
340
350
|
msg.$index
|
|
341
351
|
),
|
|
@@ -398,20 +408,31 @@ const ChatWindow = ({
|
|
|
398
408
|
onSubmit: handleSend,
|
|
399
409
|
style: {
|
|
400
410
|
borderTop: "1px solid #eee",
|
|
401
|
-
display: "flex"
|
|
402
|
-
gap: 8
|
|
411
|
+
display: "flex"
|
|
412
|
+
// gap: 8,
|
|
403
413
|
},
|
|
404
414
|
children: [
|
|
405
415
|
/* @__PURE__ */ jsx(
|
|
406
|
-
"
|
|
416
|
+
"textarea",
|
|
407
417
|
{
|
|
408
|
-
|
|
418
|
+
ref: inputRef,
|
|
409
419
|
value: input,
|
|
410
420
|
onChange: (e) => setInput(e.target.value),
|
|
421
|
+
onKeyDown: (e) => {
|
|
422
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
423
|
+
e.preventDefault();
|
|
424
|
+
const cleaned = cleanInput(input);
|
|
425
|
+
if (cleaned) {
|
|
426
|
+
onSend(cleaned);
|
|
427
|
+
setInput("");
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
},
|
|
411
431
|
placeholder: "Ask something...",
|
|
412
|
-
className: inputStyle,
|
|
432
|
+
className: clsx(inputStyle, autoResize),
|
|
413
433
|
autoFocus: true,
|
|
414
|
-
disabled: inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected
|
|
434
|
+
disabled: inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected,
|
|
435
|
+
rows: 1
|
|
415
436
|
}
|
|
416
437
|
),
|
|
417
438
|
/* @__PURE__ */ jsx(
|
|
@@ -2,7 +2,7 @@ export type ChatbotProps = {
|
|
|
2
2
|
project?: "axos" | "ufb";
|
|
3
3
|
debug?: boolean;
|
|
4
4
|
};
|
|
5
|
-
export declare const Chatbot: ({ project, projectEnv, menuOption, }: {
|
|
5
|
+
export declare const Chatbot: ({ project, projectEnv, menuOption, debug, }: {
|
|
6
6
|
project?: "axos" | "ufb";
|
|
7
7
|
projectEnv?: "dev" | "qa" | "uat" | "stg" | "prod";
|
|
8
8
|
menuOption?: "Support Virtual Agent" | string;
|
package/dist/Chatbot/Chatbot.js
CHANGED
|
@@ -6,13 +6,13 @@ import { chatbotUFB, chatbotAXB } from "./Chatbot.css.js";
|
|
|
6
6
|
import { ChatWindow } from "./ChatWindow.js";
|
|
7
7
|
import { useOpenChat } from "./store/chat.js";
|
|
8
8
|
import { useMessages } from "./store/messages.js";
|
|
9
|
-
import {
|
|
10
|
-
import { useRef, useState } from "react";
|
|
9
|
+
import { useRef, useState, useEffect } from "react";
|
|
11
10
|
import { useMount, useUnmount } from "react-use";
|
|
12
11
|
const Chatbot = ({
|
|
13
12
|
project = "axos",
|
|
14
13
|
projectEnv = "dev",
|
|
15
|
-
menuOption = "Support Virtual Agent"
|
|
14
|
+
menuOption = "Support Virtual Agent",
|
|
15
|
+
debug = false
|
|
16
16
|
}) => {
|
|
17
17
|
const { hasOpenedOnce, toggle, reset } = useOpenChat();
|
|
18
18
|
const { addMessage, addMessages, clearMessages, messages } = useMessages();
|
|
@@ -24,6 +24,8 @@ const Chatbot = ({
|
|
|
24
24
|
const agent_virtual = useRef(null);
|
|
25
25
|
const [status, setStatus] = useState("idle");
|
|
26
26
|
const [hasStarted, setHasStarted] = useState(false);
|
|
27
|
+
const [menusLoaded, setMenusLoaded] = useState(false);
|
|
28
|
+
const [pendingStart, setPendingStart] = useState(false);
|
|
27
29
|
const brandMap = /* @__PURE__ */ new Map([
|
|
28
30
|
["axos", 1],
|
|
29
31
|
["ufb", 3]
|
|
@@ -48,11 +50,13 @@ const Chatbot = ({
|
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
|
-
if (projectEnv !== "prod") {
|
|
52
|
-
Logger.addHandler(consoleLoggerHandler);
|
|
53
|
-
}
|
|
54
53
|
const onReadyHandler = async () => {
|
|
55
54
|
console.log("Chat client is ready");
|
|
55
|
+
if (clientRef.current) {
|
|
56
|
+
menuRef.current = await clientRef.current.getMenus();
|
|
57
|
+
setMenusLoaded(true);
|
|
58
|
+
console.log("menus:", menuRef.current);
|
|
59
|
+
}
|
|
56
60
|
};
|
|
57
61
|
const onAuthenticatedHandler = async () => {
|
|
58
62
|
console.log("Chat client is authenticated");
|
|
@@ -96,8 +100,6 @@ const Chatbot = ({
|
|
|
96
100
|
}
|
|
97
101
|
};
|
|
98
102
|
const registerEventHandlers = () => {
|
|
99
|
-
clientRef.current?.on("ready", onReadyHandler);
|
|
100
|
-
clientRef.current?.on("authenticated", onAuthenticatedHandler);
|
|
101
103
|
clientRef.current?.on("chat.ongoing", onChatOngoingHandler);
|
|
102
104
|
clientRef.current?.on("chat.message", onChatMessageHandler);
|
|
103
105
|
clientRef.current?.on("chat.typingStarted", onChatTypingStartedHandler);
|
|
@@ -124,6 +126,10 @@ const Chatbot = ({
|
|
|
124
126
|
clientRef.current?.off("chat.connected", onChatConnectedHandler);
|
|
125
127
|
};
|
|
126
128
|
const createClient = async () => {
|
|
129
|
+
const { Client, Logger, consoleLoggerHandler } = await import("@ujet/websdk-headless");
|
|
130
|
+
if (projectEnv !== "prod" || debug) {
|
|
131
|
+
Logger.addHandler(consoleLoggerHandler);
|
|
132
|
+
}
|
|
127
133
|
if (clientRef.current) return;
|
|
128
134
|
const client = new Client({
|
|
129
135
|
companyId: process.env.CCAI_COMPANY_ID || "",
|
|
@@ -132,10 +138,10 @@ const Chatbot = ({
|
|
|
132
138
|
// or your region
|
|
133
139
|
authenticate
|
|
134
140
|
});
|
|
141
|
+
client?.on("ready", onReadyHandler);
|
|
142
|
+
client?.on("authenticated", onAuthenticatedHandler);
|
|
135
143
|
isMountedRef.current = true;
|
|
136
144
|
clientRef.current = client;
|
|
137
|
-
menuRef.current = await client.getMenus();
|
|
138
|
-
console.log("menus:", menuRef.current);
|
|
139
145
|
registerEventHandlers();
|
|
140
146
|
return;
|
|
141
147
|
};
|
|
@@ -143,6 +149,17 @@ const Chatbot = ({
|
|
|
143
149
|
console.log("Starting chat");
|
|
144
150
|
const client = clientRef.current;
|
|
145
151
|
if (!client) return;
|
|
152
|
+
if (!menuRef.current || !menuRef.current.menus) {
|
|
153
|
+
let waited = 0;
|
|
154
|
+
while ((!menuRef.current || !menuRef.current.menus) && waited < 5e3) {
|
|
155
|
+
await new Promise((res) => setTimeout(res, 100));
|
|
156
|
+
waited += 100;
|
|
157
|
+
}
|
|
158
|
+
if (!menuRef.current || !menuRef.current.menus) {
|
|
159
|
+
console.error("Menu not loaded, cannot start chat");
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
146
163
|
try {
|
|
147
164
|
const ongoingChat = await client.loadOngoingChat();
|
|
148
165
|
if (ongoingChat) {
|
|
@@ -160,6 +177,7 @@ const Chatbot = ({
|
|
|
160
177
|
const newChat = await client.createChat(menuId, { custom_data });
|
|
161
178
|
if (newChat !== null) {
|
|
162
179
|
chatRef.current = newChat;
|
|
180
|
+
agent_virtual.current = newChat.agent;
|
|
163
181
|
console.log("Chat created id:", newChat.id);
|
|
164
182
|
}
|
|
165
183
|
} catch (err) {
|
|
@@ -169,6 +187,10 @@ const Chatbot = ({
|
|
|
169
187
|
const handleClick = async () => {
|
|
170
188
|
toggle();
|
|
171
189
|
if (hasStarted) return;
|
|
190
|
+
if (!menusLoaded) {
|
|
191
|
+
setPendingStart(true);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
172
194
|
if (!hasOpenedOnce) {
|
|
173
195
|
await startChat();
|
|
174
196
|
setHasStarted(true);
|
|
@@ -196,11 +218,25 @@ const Chatbot = ({
|
|
|
196
218
|
isMountedRef.current = true;
|
|
197
219
|
await createClient();
|
|
198
220
|
});
|
|
221
|
+
useEffect(() => {
|
|
222
|
+
if (menusLoaded && pendingStart && !hasStarted) {
|
|
223
|
+
startChat();
|
|
224
|
+
setHasStarted(true);
|
|
225
|
+
setPendingStart(false);
|
|
226
|
+
}
|
|
227
|
+
}, [menusLoaded, pendingStart, hasStarted]);
|
|
199
228
|
useUnmount(() => {
|
|
200
229
|
console.log("Chatbot unmounted");
|
|
201
230
|
deregisterEventHandlers();
|
|
202
231
|
isMountedRef.current = false;
|
|
203
232
|
hasLoadedBefore.current = true;
|
|
233
|
+
reset();
|
|
234
|
+
setHasStarted(false);
|
|
235
|
+
setStatus("idle");
|
|
236
|
+
clearMessages();
|
|
237
|
+
clientRef.current?.destroy();
|
|
238
|
+
clientRef.current?.destroyChat();
|
|
239
|
+
clientRef.current = null;
|
|
204
240
|
});
|
|
205
241
|
return /* @__PURE__ */ jsxs("div", { className: project === "ufb" ? chatbotUFB : chatbotAXB, children: [
|
|
206
242
|
/* @__PURE__ */ jsx(Bubble, { onClick: handleClick }),
|
package/dist/Chatbot/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { bubbleWrapper, svgFill } from "./Bubble.css.js";
|
|
|
4
4
|
import { Chatbot } from "./Chatbot.js";
|
|
5
5
|
import { chatbotAXB, chatbotUFB } from "./Chatbot.css.js";
|
|
6
6
|
import { ChatWindow } from "./ChatWindow.js";
|
|
7
|
-
import { arrowFill, button_reset, chatFinishDialog, chatNetworkStatus, chat_title, chatbotMenu, chatbotMenuItem, endChatButtonStyle, inline_button, inline_button_wrapper, inputStyle, messageStyle, messagesContainerStyle, notificationStyle, sendButtonStyle, windowBarStyle, windowOpenStyle, windowStyle } from "./ChatWindow.css.js";
|
|
7
|
+
import { arrowFill, autoResize, button_reset, chatFinishDialog, chatNetworkStatus, chat_title, chatbotMenu, chatbotMenuItem, endChatButtonStyle, inline_button, inline_button_wrapper, inputStyle, messageStyle, messagesContainerStyle, notificationStyle, sendButtonStyle, windowBarStyle, windowOpenStyle, windowStyle } from "./ChatWindow.css.js";
|
|
8
8
|
import { useOpenChat } from "./store/chat.js";
|
|
9
9
|
import { useMessages } from "./store/messages.js";
|
|
10
10
|
export {
|
|
@@ -12,6 +12,7 @@ export {
|
|
|
12
12
|
ChatWindow,
|
|
13
13
|
Chatbot,
|
|
14
14
|
arrowFill,
|
|
15
|
+
autoResize,
|
|
15
16
|
bubbleWrapper,
|
|
16
17
|
button_reset,
|
|
17
18
|
chatFinishDialog,
|
package/dist/Chevron/index.js
CHANGED
|
@@ -78,7 +78,6 @@ import "../Chatbot/authenticate.js";
|
|
|
78
78
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
79
79
|
/* empty css */
|
|
80
80
|
import "../Chatbot/store/messages.js";
|
|
81
|
-
import "@ujet/websdk-headless";
|
|
82
81
|
/* empty css */
|
|
83
82
|
import "../Comparison/Comparison.css.js";
|
|
84
83
|
import "next/image.js";
|
|
@@ -78,7 +78,6 @@ import "../Chatbot/authenticate.js";
|
|
|
78
78
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
79
79
|
/* empty css */
|
|
80
80
|
import "../Chatbot/store/messages.js";
|
|
81
|
-
import "@ujet/websdk-headless";
|
|
82
81
|
/* empty css */
|
|
83
82
|
import { comparison_layout, comparison_content, headerComparison, feature_header, feature_title, comparison_feature, comparison_list, comparison_buttons, comparison } from "./Comparison.css.js";
|
|
84
83
|
import "next/image.js";
|