@axos-web-dev/shared-components 1.0.100-sectionSpacerRemoved.4 → 1.0.100-sectionSpacerRemoved.5
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/Article/Article.d.ts +2 -1
- package/dist/Article/Article.js +13 -2
- package/dist/Chatbot/Bubble.js +1 -1
- package/dist/Chatbot/Chat.js +0 -7
- package/dist/Chatbot/ChatWindow.d.ts +2 -0
- package/dist/Chatbot/ChatWindow.js +19 -3
- package/dist/Chatbot/Chatbot.js +90 -9
- package/dist/Chatbot/ChatbotMessage.d.ts +1 -0
- package/dist/Chatbot/ChatbotMessage.js +5 -2
- package/dist/Chatbot/store/chat.d.ts +3 -0
- package/dist/Chatbot/store/chat.js +10 -2
- package/dist/Chatbot/store/messages.d.ts +1 -0
- package/dist/Chatbot/store/messages.js +5 -2
- package/dist/Forms/EmailOnly.js +7 -2
- package/dist/Forms/Forms.css.d.ts +1 -1
- package/dist/Forms/Forms.css.js +3 -3
- package/dist/IconBillboard/IconBillboard.css.d.ts +1 -0
- package/dist/IconBillboard/IconBillboard.css.js +11 -9
- package/dist/IconBillboard/IconBillboard.js +2 -2
- package/dist/IconBillboard/index.js +2 -1
- package/dist/ImageBillboard/ImageBillboardSet.js +2 -2
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +16 -16
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +6 -6
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +12 -12
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +19 -19
- package/dist/assets/Calculators/ApyCalculator/ApyCalculator.css +1 -1
- package/dist/assets/Calculators/MarginTradingCalculator/MarginTradingCalculator.css +2 -2
- package/dist/assets/Calculators/SummitApyCalculator/BalanceAPYCalculator.css +1 -1
- package/dist/assets/Carousel/Carousel.css +1 -1
- package/dist/assets/Chatbot/AnimatedGradientBorder.css +2 -1
- package/dist/assets/DownloadTile/DownloadTile.css +2 -2
- package/dist/assets/ExecutiveBio/ExecutiveBio.css +1 -1
- package/dist/assets/Forms/Forms.css +29 -25
- package/dist/assets/HelpArticle/HelpArticle.css +2 -2
- package/dist/assets/IconBillboard/IconBillboard.css +35 -28
- package/dist/assets/ImageBillboard/ImageBillboard.css +3 -3
- package/dist/assets/Inputs/Input.css +1 -1
- package/dist/assets/Insight/Featured/CategorySelector.css +1 -1
- package/dist/assets/Insight/Insight.css +4 -4
- package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css.css +192 -192
- package/dist/assets/Topic/Topic.css +1 -1
- package/dist/assets/Typography/Typography.css +1 -1
- package/dist/assets/VideoTile/VideoTile.css +1 -1
- package/dist/main.js +2 -1
- package/package.json +1 -1
|
@@ -10,5 +10,6 @@ export interface ArticleProps {
|
|
|
10
10
|
description: string | ReactNode;
|
|
11
11
|
targetUrl: string;
|
|
12
12
|
variant?: QuaternaryTypes;
|
|
13
|
+
useChevron?: boolean | false;
|
|
13
14
|
}
|
|
14
|
-
export declare const Article: ({ id, image, itemType, title, description, targetUrl, variant: fullVariant, }: ArticleProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const Article: ({ id, image, itemType, title, description, targetUrl, variant: fullVariant, useChevron, }: ArticleProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/Article/Article.js
CHANGED
|
@@ -6,6 +6,7 @@ import { Button } from "../Button/Button.js";
|
|
|
6
6
|
import "../Button/Button.css.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import "react-use";
|
|
9
|
+
import { Chevron } from "../Chevron/index.js";
|
|
9
10
|
const Article = ({
|
|
10
11
|
id,
|
|
11
12
|
image,
|
|
@@ -13,7 +14,8 @@ const Article = ({
|
|
|
13
14
|
title,
|
|
14
15
|
description,
|
|
15
16
|
targetUrl,
|
|
16
|
-
variant: fullVariant = "primary"
|
|
17
|
+
variant: fullVariant = "primary",
|
|
18
|
+
useChevron = false
|
|
17
19
|
}) => {
|
|
18
20
|
const variant = getVariant(fullVariant);
|
|
19
21
|
return /* @__PURE__ */ jsxs(
|
|
@@ -29,7 +31,16 @@ const Article = ({
|
|
|
29
31
|
/* @__PURE__ */ jsx("h3", { className: `${ant_card_title({ variant })} header_3`, children: title }),
|
|
30
32
|
/* @__PURE__ */ jsx("div", { className: `${ant_card_body({ variant })} push_up`, children: /* @__PURE__ */ jsx(Fragment, { children: description }) })
|
|
31
33
|
] }),
|
|
32
|
-
/* @__PURE__ */ jsx("div", { className: "text_center", children: /* @__PURE__ */ jsx(
|
|
34
|
+
/* @__PURE__ */ jsx("div", { className: "text_center", children: useChevron ? /* @__PURE__ */ jsx("div", { className: "push_up_24", children: /* @__PURE__ */ jsx(
|
|
35
|
+
Chevron,
|
|
36
|
+
{
|
|
37
|
+
"aria-label": "read and learn more about this featured item",
|
|
38
|
+
targetUrl,
|
|
39
|
+
variant,
|
|
40
|
+
className: "push_up_24",
|
|
41
|
+
children: itemType == "Insight" ? "Read More" : "Learn More"
|
|
42
|
+
}
|
|
43
|
+
) }) : /* @__PURE__ */ jsx(
|
|
33
44
|
Button,
|
|
34
45
|
{
|
|
35
46
|
"aria-label": "read and learn more about this featured item",
|
package/dist/Chatbot/Bubble.js
CHANGED
package/dist/Chatbot/Chat.js
CHANGED
|
@@ -33,7 +33,6 @@ function Chat() {
|
|
|
33
33
|
let chatConnectedHandler;
|
|
34
34
|
async function initChat() {
|
|
35
35
|
const { Client, consoleLoggerHandler, Logger } = await import("@ujet/websdk-headless");
|
|
36
|
-
console.log("this", isMounted);
|
|
37
36
|
Logger.addHandler(consoleLoggerHandler);
|
|
38
37
|
clientRef.current = new Client({
|
|
39
38
|
companyId,
|
|
@@ -71,14 +70,11 @@ function Chat() {
|
|
|
71
70
|
menus?.menus[5].id
|
|
72
71
|
);
|
|
73
72
|
}
|
|
74
|
-
console.log("this");
|
|
75
73
|
identityHandler = (identity) => {
|
|
76
74
|
if (!isMounted.current) return;
|
|
77
75
|
console.log("identity:", identity);
|
|
78
76
|
};
|
|
79
77
|
messageHandler = (msg) => {
|
|
80
|
-
console.log("new message:", msg);
|
|
81
|
-
console.log("addMessage:", msg);
|
|
82
78
|
addMessage(msg);
|
|
83
79
|
};
|
|
84
80
|
chatUpdatedHandler = (chat) => {
|
|
@@ -87,13 +83,11 @@ function Chat() {
|
|
|
87
83
|
chatConnectedHandler = async () => {
|
|
88
84
|
console.log("connected");
|
|
89
85
|
const messagesFetched = await clientRef.current?.fetchMessages();
|
|
90
|
-
console.log("[messages]:", messagesFetched);
|
|
91
86
|
addMessages(messagesFetched || []);
|
|
92
87
|
};
|
|
93
88
|
memberJoinedHandler = (identity) => {
|
|
94
89
|
console.log("member joined:", identity);
|
|
95
90
|
};
|
|
96
|
-
console.log(isMounted.current);
|
|
97
91
|
clientRef.current?.on("authenticated", () => {
|
|
98
92
|
console.log("authenticated");
|
|
99
93
|
});
|
|
@@ -144,7 +138,6 @@ function Chat() {
|
|
|
144
138
|
const form = e.target;
|
|
145
139
|
const input = form.elements[0];
|
|
146
140
|
const message = input.value;
|
|
147
|
-
console.log("Sending message:", message);
|
|
148
141
|
try {
|
|
149
142
|
await clientRef.current?.sendTextMessage(message);
|
|
150
143
|
input.value = "";
|
|
@@ -24,6 +24,8 @@ interface ChatWindowProps {
|
|
|
24
24
|
showName?: boolean;
|
|
25
25
|
onNewChat?: () => void;
|
|
26
26
|
onCloseAfterThankYou?: () => void;
|
|
27
|
+
isTyping?: boolean;
|
|
28
|
+
previewTyping?: (msg: string) => void;
|
|
27
29
|
}
|
|
28
30
|
export declare const ChatWindow: React.FC<ChatWindowProps>;
|
|
29
31
|
export {};
|
|
@@ -32,9 +32,17 @@ const ChatWindow = ({
|
|
|
32
32
|
showName = false,
|
|
33
33
|
onCloseAfterThankYou = () => {
|
|
34
34
|
console.log("Close after thank you");
|
|
35
|
+
},
|
|
36
|
+
previewTyping = (msg) => {
|
|
37
|
+
console.log("Preview typing: ", msg);
|
|
35
38
|
}
|
|
36
39
|
}) => {
|
|
37
|
-
const {
|
|
40
|
+
const {
|
|
41
|
+
showThankyouMessage,
|
|
42
|
+
displayThankyouMessage,
|
|
43
|
+
toggleThankyouMessage,
|
|
44
|
+
hasEscalated
|
|
45
|
+
} = useOpenChat();
|
|
38
46
|
const [mounted, setMounted] = React.useState(false);
|
|
39
47
|
const [menuOpen, setMenuOpen] = React.useState(false);
|
|
40
48
|
const [showEndChatDialog, setShowEndChatDialog] = React.useState(false);
|
|
@@ -128,7 +136,7 @@ const ChatWindow = ({
|
|
|
128
136
|
]
|
|
129
137
|
}
|
|
130
138
|
),
|
|
131
|
-
/* @__PURE__ */ jsx("h2", { className: chat_title, children: "Ask
|
|
139
|
+
/* @__PURE__ */ jsx("h2", { className: chat_title, children: "Ask Evo AI" })
|
|
132
140
|
]
|
|
133
141
|
}
|
|
134
142
|
),
|
|
@@ -136,6 +144,7 @@ const ChatWindow = ({
|
|
|
136
144
|
/* @__PURE__ */ jsx(
|
|
137
145
|
"button",
|
|
138
146
|
{
|
|
147
|
+
disabled: messages.length === 0,
|
|
139
148
|
onClick: () => {
|
|
140
149
|
setMenuOpen(!menuOpen);
|
|
141
150
|
},
|
|
@@ -417,7 +426,11 @@ const ChatWindow = ({
|
|
|
417
426
|
showAvatar,
|
|
418
427
|
showName,
|
|
419
428
|
virtualAgent,
|
|
420
|
-
onCancelEndChat
|
|
429
|
+
onCancelEndChat,
|
|
430
|
+
onEndChat: () => {
|
|
431
|
+
endChat();
|
|
432
|
+
onCloseAfterThankYou();
|
|
433
|
+
}
|
|
421
434
|
},
|
|
422
435
|
msg?.$index
|
|
423
436
|
)),
|
|
@@ -449,6 +462,9 @@ const ChatWindow = ({
|
|
|
449
462
|
value: input,
|
|
450
463
|
onChange: (e) => setInput(e.target.value),
|
|
451
464
|
onKeyDown: (e) => {
|
|
465
|
+
if (hasEscalated) {
|
|
466
|
+
previewTyping(e.target?.value);
|
|
467
|
+
}
|
|
452
468
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
453
469
|
e.preventDefault();
|
|
454
470
|
const cleaned = cleanInput(input);
|
package/dist/Chatbot/Chatbot.js
CHANGED
|
@@ -14,7 +14,14 @@ const Chatbot = ({
|
|
|
14
14
|
menuOption = "Support Virtual Agent",
|
|
15
15
|
debug = false
|
|
16
16
|
}) => {
|
|
17
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
hasOpenedOnce,
|
|
19
|
+
toggle,
|
|
20
|
+
reset,
|
|
21
|
+
startEscalation,
|
|
22
|
+
hasEscalated,
|
|
23
|
+
endEscalation
|
|
24
|
+
} = useOpenChat();
|
|
18
25
|
const { addMessage, addMessages, clearMessages, messages } = useMessages();
|
|
19
26
|
const clientRef = useRef(null);
|
|
20
27
|
const menuRef = useRef(null);
|
|
@@ -26,6 +33,20 @@ const Chatbot = ({
|
|
|
26
33
|
const [hasStarted, setHasStarted] = useState(false);
|
|
27
34
|
const [menusLoaded, setMenusLoaded] = useState(false);
|
|
28
35
|
const [pendingStart, setPendingStart] = useState(false);
|
|
36
|
+
const [isTyping, setIsTyping] = useState(false);
|
|
37
|
+
const [scalationStarted, setScalationStarted] = useState(false);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (messages.length === 0) return;
|
|
40
|
+
const hasScalation = messages.some(
|
|
41
|
+
(msg) => msg.$userType === "user" || ["escalationAccepted", "escalationStarted"].includes(
|
|
42
|
+
msg.event
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
setScalationStarted(hasScalation);
|
|
46
|
+
return () => {
|
|
47
|
+
setScalationStarted(false);
|
|
48
|
+
};
|
|
49
|
+
}, [messages]);
|
|
29
50
|
const brandMap = /* @__PURE__ */ new Map([
|
|
30
51
|
["axos", 1],
|
|
31
52
|
["ufb", 3]
|
|
@@ -33,8 +54,7 @@ const Chatbot = ({
|
|
|
33
54
|
const typingMessage = {
|
|
34
55
|
$sid: "typing-1",
|
|
35
56
|
type: "system",
|
|
36
|
-
|
|
37
|
-
text: "AI is typing...",
|
|
57
|
+
text: scalationStarted ? "Typing" : "AI is typing...",
|
|
38
58
|
sender: { id: "system", type: "system" },
|
|
39
59
|
$timestamp: /* @__PURE__ */ new Date(),
|
|
40
60
|
$userType: "system",
|
|
@@ -77,13 +97,39 @@ const Chatbot = ({
|
|
|
77
97
|
};
|
|
78
98
|
const onChatMessageHandler = async (message) => {
|
|
79
99
|
console.log("Received message:", message);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
100
|
+
if (["system", "virtual_agent", "user"].includes(message.$userType) && message.event === void 0) {
|
|
101
|
+
addMessage(message);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const eventName = message?.event;
|
|
105
|
+
switch (eventName) {
|
|
106
|
+
case "escalationAccepted":
|
|
107
|
+
setScalationStarted(true);
|
|
108
|
+
startEscalation?.();
|
|
109
|
+
addMessage(message);
|
|
110
|
+
return;
|
|
111
|
+
case "escalationStarted":
|
|
112
|
+
setScalationStarted(true);
|
|
113
|
+
startEscalation?.();
|
|
114
|
+
addMessage(message);
|
|
115
|
+
return;
|
|
116
|
+
default:
|
|
117
|
+
addMessage(message);
|
|
118
|
+
if (["end_user"].includes(message.$userType)) {
|
|
119
|
+
if (!hasEscalated) {
|
|
120
|
+
addMessage(typingMessage);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return;
|
|
83
124
|
}
|
|
84
125
|
};
|
|
85
126
|
const onChatTypingStartedHandler = async (identity) => {
|
|
86
127
|
console.log("Typing started by:", identity);
|
|
128
|
+
setIsTyping(true);
|
|
129
|
+
};
|
|
130
|
+
const onChatTypingEndedHandler = async (identity) => {
|
|
131
|
+
console.log("Typing ended by:", identity);
|
|
132
|
+
setIsTyping(false);
|
|
87
133
|
};
|
|
88
134
|
const onChatDisconnectedHandler = async () => {
|
|
89
135
|
console.log("Chat disconnected");
|
|
@@ -105,23 +151,38 @@ const Chatbot = ({
|
|
|
105
151
|
const onChatMemberLeftHandler = async (identity) => {
|
|
106
152
|
console.log("Chat member left:", identity);
|
|
107
153
|
};
|
|
154
|
+
const onChatMemberJoinedHandler = async (identity) => {
|
|
155
|
+
console.log("Chat member joined:", identity);
|
|
156
|
+
};
|
|
108
157
|
const onChatConnectedHandler = async () => {
|
|
109
158
|
setStatus("connected");
|
|
110
159
|
console.log("connected");
|
|
111
160
|
const messages2 = await clientRef.current?.fetchMessages();
|
|
112
161
|
if (messages2) {
|
|
113
162
|
addMessages(messages2);
|
|
163
|
+
const hasEscalation = messages2.some(
|
|
164
|
+
(msg) => msg.$userType === "user" || ["escalationAccepted", "escalationStarted"].includes(
|
|
165
|
+
msg.event
|
|
166
|
+
)
|
|
167
|
+
);
|
|
168
|
+
console.log(hasEscalation);
|
|
169
|
+
if (hasEscalation) {
|
|
170
|
+
setScalationStarted(true);
|
|
171
|
+
startEscalation?.();
|
|
172
|
+
}
|
|
114
173
|
}
|
|
115
174
|
};
|
|
116
175
|
const registerEventHandlers = () => {
|
|
117
176
|
clientRef.current?.on("chat.ongoing", onChatOngoingHandler);
|
|
118
177
|
clientRef.current?.on("chat.message", onChatMessageHandler);
|
|
119
178
|
clientRef.current?.on("chat.typingStarted", onChatTypingStartedHandler);
|
|
179
|
+
clientRef.current?.on("chat.typingEnded", onChatTypingEndedHandler);
|
|
120
180
|
clientRef.current?.on("chat.disconnected", onChatDisconnectedHandler);
|
|
121
181
|
clientRef.current?.on("chat.dismissed", onDismissedHandler);
|
|
122
182
|
clientRef.current?.on("chat.timeout", onTimeoutHandler);
|
|
123
183
|
clientRef.current?.on("chat.ended", onEndedHandler);
|
|
124
184
|
clientRef.current?.on("chat.destroyed", onDestroyedHandler);
|
|
185
|
+
clientRef.current?.on("chat.memberJoined", onChatMemberJoinedHandler);
|
|
125
186
|
clientRef.current?.on("chat.memberLeft", onChatMemberLeftHandler);
|
|
126
187
|
clientRef?.current?.on("chat.connected", onChatConnectedHandler);
|
|
127
188
|
};
|
|
@@ -131,12 +192,14 @@ const Chatbot = ({
|
|
|
131
192
|
clientRef.current?.off("chat.ongoing", onDismissedHandler);
|
|
132
193
|
clientRef.current?.off("chat.message", onChatMessageHandler);
|
|
133
194
|
clientRef.current?.off("chat.typingStarted", onChatTypingStartedHandler);
|
|
195
|
+
clientRef.current?.off("chat.typingEnded", onChatTypingEndedHandler);
|
|
134
196
|
clientRef.current?.off("chat.disconnected", onChatDisconnectedHandler);
|
|
135
197
|
clientRef.current?.off("chat.dismissed", onDismissedHandler);
|
|
136
198
|
clientRef.current?.off("chat.timeout", onTimeoutHandler);
|
|
137
199
|
clientRef.current?.off("chat.ended", onEndedHandler);
|
|
138
200
|
clientRef.current?.off("chat.destroyed", onDestroyedHandler);
|
|
139
201
|
clientRef.current?.off("chat.memberLeft", onChatMemberLeftHandler);
|
|
202
|
+
clientRef.current?.off("chat.memberJoined", onChatMemberJoinedHandler);
|
|
140
203
|
clientRef.current?.off("chat.connected", onChatConnectedHandler);
|
|
141
204
|
};
|
|
142
205
|
const createClient = async () => {
|
|
@@ -150,6 +213,9 @@ const Chatbot = ({
|
|
|
150
213
|
tenant: process.env.CCAI_TENANT_NAME || "",
|
|
151
214
|
host: process.env.CCAI_HOST || "",
|
|
152
215
|
// or your region
|
|
216
|
+
// companyId: import.meta.env.VITE_COMPANY_ID || "",
|
|
217
|
+
// tenant: import.meta.env.VITE_TENANT_NAME || "",
|
|
218
|
+
// host: import.meta.env.VITE_HOST || "", // or your region
|
|
153
219
|
authenticate
|
|
154
220
|
});
|
|
155
221
|
client?.on("ready", onReadyHandler);
|
|
@@ -210,9 +276,9 @@ const Chatbot = ({
|
|
|
210
276
|
setHasStarted(true);
|
|
211
277
|
}
|
|
212
278
|
};
|
|
213
|
-
const onSendMessage = (msg) => {
|
|
279
|
+
const onSendMessage = async (msg) => {
|
|
214
280
|
console.log("Sending message:", msg);
|
|
215
|
-
clientRef.current?.sendTextMessage(msg);
|
|
281
|
+
await clientRef.current?.sendTextMessage(msg);
|
|
216
282
|
};
|
|
217
283
|
const onEndChat = async () => {
|
|
218
284
|
console.log("Ending chat");
|
|
@@ -223,6 +289,7 @@ const Chatbot = ({
|
|
|
223
289
|
chatRef.current = null;
|
|
224
290
|
console.log("Chat ended");
|
|
225
291
|
setHasStarted(false);
|
|
292
|
+
endEscalation?.();
|
|
226
293
|
}
|
|
227
294
|
};
|
|
228
295
|
const onEndAndStartNewChat = async () => {
|
|
@@ -251,6 +318,7 @@ const Chatbot = ({
|
|
|
251
318
|
setHasStarted(false);
|
|
252
319
|
setStatus("idle");
|
|
253
320
|
clearMessages();
|
|
321
|
+
endEscalation?.();
|
|
254
322
|
clientRef.current?.destroy();
|
|
255
323
|
clientRef.current?.destroyChat();
|
|
256
324
|
clientRef.current = null;
|
|
@@ -262,6 +330,17 @@ const Chatbot = ({
|
|
|
262
330
|
reset();
|
|
263
331
|
setHasStarted(false);
|
|
264
332
|
};
|
|
333
|
+
const onPreviewTyping = async (msg) => {
|
|
334
|
+
console.log("Preview typing message:", msg);
|
|
335
|
+
try {
|
|
336
|
+
if (clientRef.current) {
|
|
337
|
+
chatRef.current?.startTyping();
|
|
338
|
+
await clientRef.current?.sendPreviewMessage(msg);
|
|
339
|
+
}
|
|
340
|
+
} catch (error) {
|
|
341
|
+
console.error("Error sending preview message:", error);
|
|
342
|
+
}
|
|
343
|
+
};
|
|
265
344
|
return /* @__PURE__ */ jsxs("div", { className: project === "ufb" ? chatbotUFB : chatbotAXB, children: [
|
|
266
345
|
/* @__PURE__ */ jsx(Bubble, { onClick: handleClick }),
|
|
267
346
|
/* @__PURE__ */ jsx(
|
|
@@ -274,7 +353,9 @@ const Chatbot = ({
|
|
|
274
353
|
endChat: onEndChat,
|
|
275
354
|
onClose,
|
|
276
355
|
onNewChat: onEndAndStartNewChat,
|
|
277
|
-
onCloseAfterThankYou
|
|
356
|
+
onCloseAfterThankYou,
|
|
357
|
+
previewTyping: onPreviewTyping,
|
|
358
|
+
isTyping
|
|
278
359
|
}
|
|
279
360
|
)
|
|
280
361
|
] });
|
|
@@ -10,6 +10,7 @@ import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import
|
|
|
10
10
|
/* empty css */
|
|
11
11
|
import clsx from "clsx";
|
|
12
12
|
import { shimmerText, notificationStyle, endChatButtonStyle, messageStyle, user_msg, agent_msg, inline_button_wrapper, inline_button } from "./ChatWindow.css.js";
|
|
13
|
+
import { useOpenChat } from "./store/chat.js";
|
|
13
14
|
function timeAgo(date) {
|
|
14
15
|
const seconds = Math.floor(((/* @__PURE__ */ new Date()).getTime() - date.getTime()) / 1e3);
|
|
15
16
|
if (seconds < 60) return "Just now";
|
|
@@ -24,8 +25,10 @@ const ChatbotMessage = ({
|
|
|
24
25
|
showName,
|
|
25
26
|
virtualAgent,
|
|
26
27
|
onCancelEndChat,
|
|
28
|
+
onEndChat,
|
|
27
29
|
onSend
|
|
28
30
|
}) => {
|
|
31
|
+
const { hasEscalated } = useOpenChat();
|
|
29
32
|
const [timeText, setTimeText] = useState(timeAgo(msg.$timestamp));
|
|
30
33
|
useEffect(() => {
|
|
31
34
|
const interval = setInterval(() => {
|
|
@@ -33,7 +36,7 @@ const ChatbotMessage = ({
|
|
|
33
36
|
}, 3e4);
|
|
34
37
|
return () => clearInterval(interval);
|
|
35
38
|
}, [msg.$timestamp]);
|
|
36
|
-
if (msg.$sid === "typing-1") {
|
|
39
|
+
if (msg.$sid === "typing-1" && !hasEscalated) {
|
|
37
40
|
return /* @__PURE__ */ jsx(
|
|
38
41
|
"div",
|
|
39
42
|
{
|
|
@@ -196,7 +199,7 @@ const ChatbotMessage = ({
|
|
|
196
199
|
]
|
|
197
200
|
}
|
|
198
201
|
),
|
|
199
|
-
/* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick:
|
|
202
|
+
/* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: onEndChat, children: "End Chat" }) })
|
|
200
203
|
] }),
|
|
201
204
|
msg.type == "text" && /* @__PURE__ */ jsx(
|
|
202
205
|
"div",
|
|
@@ -8,6 +8,9 @@ interface OpenChatState {
|
|
|
8
8
|
showThankyouMessage: boolean;
|
|
9
9
|
displayThankyouMessage: () => void;
|
|
10
10
|
toggleThankyouMessage?: () => void;
|
|
11
|
+
hasEscalated?: boolean;
|
|
12
|
+
startEscalation?: () => void;
|
|
13
|
+
endEscalation?: () => void;
|
|
11
14
|
}
|
|
12
15
|
export declare const useOpenChat: import('zustand').UseBoundStore<import('zustand').StoreApi<OpenChatState>>;
|
|
13
16
|
export {};
|
|
@@ -3,6 +3,7 @@ const useOpenChat = create((set, get) => ({
|
|
|
3
3
|
isOpen: false,
|
|
4
4
|
hasOpenedOnce: false,
|
|
5
5
|
showThankyouMessage: false,
|
|
6
|
+
hasEscalated: false,
|
|
6
7
|
toggle: () => set((state) => ({ isOpen: !state.isOpen, hasOpenedOnce: true })),
|
|
7
8
|
open: () => {
|
|
8
9
|
const alreadyOpened = get().hasOpenedOnce;
|
|
@@ -12,9 +13,16 @@ const useOpenChat = create((set, get) => ({
|
|
|
12
13
|
});
|
|
13
14
|
},
|
|
14
15
|
close: () => set({ isOpen: false }),
|
|
15
|
-
reset: () => set({
|
|
16
|
+
reset: () => set({
|
|
17
|
+
hasOpenedOnce: false,
|
|
18
|
+
isOpen: false,
|
|
19
|
+
showThankyouMessage: false,
|
|
20
|
+
hasEscalated: false
|
|
21
|
+
}),
|
|
16
22
|
displayThankyouMessage: () => set({ showThankyouMessage: true }),
|
|
17
|
-
toggleThankyouMessage: () => set((state) => ({ showThankyouMessage: !state.showThankyouMessage }))
|
|
23
|
+
toggleThankyouMessage: () => set((state) => ({ showThankyouMessage: !state.showThankyouMessage })),
|
|
24
|
+
startEscalation: () => set({ hasEscalated: true }),
|
|
25
|
+
endEscalation: () => set({ hasEscalated: false })
|
|
18
26
|
}));
|
|
19
27
|
export {
|
|
20
28
|
useOpenChat
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { create } from "zustand";
|
|
2
|
-
const useMessages = create((set) => ({
|
|
2
|
+
const useMessages = create((set, get) => ({
|
|
3
3
|
messages: [],
|
|
4
4
|
addMessage: (message) => set((state) => {
|
|
5
5
|
const cleaned = state.messages.filter((m) => m.$sid !== "typing-1");
|
|
@@ -11,7 +11,10 @@ const useMessages = create((set) => ({
|
|
|
11
11
|
)
|
|
12
12
|
})),
|
|
13
13
|
addMessages: (newMessages) => set((state) => ({ messages: [...state.messages, ...newMessages] })),
|
|
14
|
-
clearMessages: () => set({ messages: [] })
|
|
14
|
+
clearMessages: () => set({ messages: [] }),
|
|
15
|
+
isEscalated: get()?.messages?.some(
|
|
16
|
+
(msg) => ["escalationAccepted", "escalationStarted"].includes(msg.event)
|
|
17
|
+
)
|
|
15
18
|
}));
|
|
16
19
|
export {
|
|
17
20
|
useMessages
|
package/dist/Forms/EmailOnly.js
CHANGED
|
@@ -187,8 +187,13 @@ const EmailOnly = ({
|
|
|
187
187
|
"section",
|
|
188
188
|
{
|
|
189
189
|
id,
|
|
190
|
-
className: clsx(
|
|
191
|
-
|
|
190
|
+
className: clsx(
|
|
191
|
+
formContainer({ variant }),
|
|
192
|
+
email_only_padding,
|
|
193
|
+
"containment",
|
|
194
|
+
"rounded"
|
|
195
|
+
),
|
|
196
|
+
children: /* @__PURE__ */ jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ jsxs(FormProvider, { ...methods, children: [
|
|
192
197
|
icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", iconForm), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
|
|
193
198
|
/* @__PURE__ */ jsxs("div", { className: `${headerContainer} text_center`, children: [
|
|
194
199
|
/* @__PURE__ */ jsx(
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const email_only_padding: string;
|
|
2
1
|
export declare const email_only_h2: string;
|
|
3
2
|
export declare const formContainer: import('@vanilla-extract/recipes').RuntimeFn<{
|
|
4
3
|
variant: {
|
|
@@ -20,6 +19,7 @@ export declare const formContainer: import('@vanilla-extract/recipes').RuntimeFn
|
|
|
20
19
|
};
|
|
21
20
|
};
|
|
22
21
|
}>;
|
|
22
|
+
export declare const email_only_padding: string;
|
|
23
23
|
export declare const iconForm: string;
|
|
24
24
|
export declare const headerContainer: string;
|
|
25
25
|
export declare const axosHeader: string;
|
package/dist/Forms/Forms.css.js
CHANGED
|
@@ -9,9 +9,9 @@ import '../assets/Forms/Forms.css';import '../assets/Input/RadioButton.css';impo
|
|
|
9
9
|
/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
11
|
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
12
|
+
var email_only_h2 = "tfms6a0";
|
|
13
|
+
var formContainer = createRuntimeFn({ defaultClassName: "tfms6a1", variantClassNames: { variant: { primary: "tfms6a2", secondary: "tfms6a3", tertiary: "tfms6a4", quaternary: "tfms6a5" } }, defaultVariants: {}, compoundVariants: [] });
|
|
14
|
+
var email_only_padding = "tfms6a6";
|
|
15
15
|
var iconForm = "tfms6a7";
|
|
16
16
|
var headerContainer = "tfms6a8";
|
|
17
17
|
var axosHeader = "tfms6a9";
|
|
@@ -31,6 +31,7 @@ export declare const layout: import('@vanilla-extract/recipes').RuntimeFn<{
|
|
|
31
31
|
export declare const billboard_icon: string;
|
|
32
32
|
export declare const content: string;
|
|
33
33
|
export declare const headerIconBillboard: string;
|
|
34
|
+
export declare const insightTitle: string;
|
|
34
35
|
export declare const title: import('@vanilla-extract/recipes').RuntimeFn<{
|
|
35
36
|
variant: {
|
|
36
37
|
primary: {
|
|
@@ -10,15 +10,16 @@ var layout = createRuntimeFn({ defaultClassName: "_1r4ovbu5", variantClassNames:
|
|
|
10
10
|
var billboard_icon = "_1r4ovbu7";
|
|
11
11
|
var content = "_1r4ovbu8";
|
|
12
12
|
var headerIconBillboard = "_1r4ovbu9";
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
13
|
+
var insightTitle = "_1r4ovbua";
|
|
14
|
+
var title = createRuntimeFn({ defaultClassName: "_1r4ovbub", variantClassNames: { variant: { primary: "_1r4ovbuc", secondary: "_1r4ovbud", tertiary: "_1r4ovbue", quaternary: "_1r4ovbuf" } }, defaultVariants: {}, compoundVariants: [] });
|
|
15
|
+
var list = "_1r4ovbug";
|
|
16
|
+
var listItem = "_1r4ovbuh";
|
|
17
|
+
var buttons = "_1r4ovbui";
|
|
18
|
+
var section_text = "_1r4ovbuj";
|
|
19
|
+
var header_section = createRuntimeFn({ defaultClassName: "_1r4ovbuk", variantClassNames: { variant: { primary: "_1r4ovbul", secondary: "_1r4ovbum", tertiary: "_1r4ovbun", quaternary: "_1r4ovbuo" } }, defaultVariants: {}, compoundVariants: [] });
|
|
20
|
+
var section_container = "_1r4ovbup";
|
|
21
|
+
var section_body = createRuntimeFn({ defaultClassName: "_1r4ovbuq", variantClassNames: { variant: { primary: "_1r4ovbur", secondary: "_1r4ovbus", tertiary: "_1r4ovbut", quaternary: "_1r4ovbuu" } }, defaultVariants: {}, compoundVariants: [] });
|
|
22
|
+
var link_wrapper = "_1r4ovbuv";
|
|
22
23
|
export {
|
|
23
24
|
billboard_icon,
|
|
24
25
|
buttons,
|
|
@@ -26,6 +27,7 @@ export {
|
|
|
26
27
|
content,
|
|
27
28
|
headerIconBillboard,
|
|
28
29
|
header_section,
|
|
30
|
+
insightTitle,
|
|
29
31
|
layout,
|
|
30
32
|
link_wrapper,
|
|
31
33
|
list,
|
|
@@ -28,13 +28,13 @@ const IconBillboard = (props) => {
|
|
|
28
28
|
if (headingRef.current) {
|
|
29
29
|
const section = headingRef.current.closest(".page_body_contents > div");
|
|
30
30
|
if (section) {
|
|
31
|
-
const existingH2 = section.querySelector("h2.
|
|
31
|
+
const existingH2 = section.querySelector("h2.header_1");
|
|
32
32
|
if (existingH2) {
|
|
33
33
|
setHeadingLevel("h3");
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
}, []);
|
|
37
|
+
}, [headingRef]);
|
|
38
38
|
const { isClickable, handleClick, chevronText } = useFullClick(callToActionRow);
|
|
39
39
|
return /* @__PURE__ */ jsxs(
|
|
40
40
|
"div",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IconBillboard } from "./IconBillboard.js";
|
|
2
|
-
import { billboard_icon, buttons, containerIconBillboard, content, headerIconBillboard, header_section, layout, link_wrapper, list, listItem, section_body, section_container, section_text, title } from "./IconBillboard.css.js";
|
|
2
|
+
import { billboard_icon, buttons, containerIconBillboard, content, headerIconBillboard, header_section, insightTitle, layout, link_wrapper, list, listItem, section_body, section_container, section_text, title } from "./IconBillboard.css.js";
|
|
3
3
|
import { IconBillboardSet } from "./IconBillboardSet.js";
|
|
4
4
|
export {
|
|
5
5
|
IconBillboard,
|
|
@@ -10,6 +10,7 @@ export {
|
|
|
10
10
|
content,
|
|
11
11
|
headerIconBillboard,
|
|
12
12
|
header_section,
|
|
13
|
+
insightTitle,
|
|
13
14
|
layout,
|
|
14
15
|
link_wrapper,
|
|
15
16
|
list,
|
|
@@ -54,13 +54,13 @@ const ImageBillboard = ({
|
|
|
54
54
|
if (headingRef.current) {
|
|
55
55
|
const section = headingRef.current.closest("section");
|
|
56
56
|
if (section) {
|
|
57
|
-
const existingH2 = section.querySelector("h2.
|
|
57
|
+
const existingH2 = section.querySelector("h2.header_1");
|
|
58
58
|
if (existingH2) {
|
|
59
59
|
setHeadingLevel("h3");
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
}, []);
|
|
63
|
+
}, [headingRef]);
|
|
64
64
|
const imgAlignment = (alignment) => {
|
|
65
65
|
switch (alignment) {
|
|
66
66
|
case "Top Left":
|