@axos-web-dev/shared-components 2.0.0-dev.3-evo-ui.2 → 2.0.0-dev.30-toasts
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 +7 -5
- package/dist/Accordion/Accordion.js +3 -3
- package/dist/AlertBanner/index.js +1 -1
- package/dist/Article/Article.js +1 -1
- package/dist/Auth/ErrorAlert.js +8 -6
- package/dist/Button/Button.js +26 -6
- package/dist/Calculators/AnnualFeeCalculator/index.js +2 -2
- package/dist/Calculators/ApyCalculator/ApyCalculator.css.d.ts +46 -5
- package/dist/Calculators/ApyCalculator/ApyCalculator.css.js +72 -19
- package/dist/Calculators/ApyCalculator/index.js +583 -293
- package/dist/Calculators/ApyCalculatorUserTest/ApyCalculatorUserTest.css.d.ts +95 -0
- package/dist/Calculators/ApyCalculatorUserTest/ApyCalculatorUserTest.css.js +101 -0
- package/dist/Calculators/ApyCalculatorUserTest/index.d.ts +12 -0
- package/dist/Calculators/ApyCalculatorUserTest/index.js +618 -0
- package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js +2 -1
- package/dist/Calculators/BuyDownCalculator/index.js +1 -1
- package/dist/Calculators/Calculator.js +19 -7
- package/dist/Calculators/MarginTradingCalculator/index.js +8 -6
- package/dist/Calculators/MarineLoanMonthlyPaymentCalculator/index.js +2 -2
- package/dist/Calculators/MaxLoanCalculator/index.js +2 -2
- package/dist/Calculators/MonthlyPaymentCalculator/index.js +2 -2
- package/dist/Calculators/MonthlyPaymentLVFCalculator/index.js +1 -1
- package/dist/Calculators/calculator.css.d.ts +21 -1
- package/dist/Calculators/calculator.css.js +3 -3
- package/dist/Calculators/index.d.ts +1 -0
- package/dist/Calculators/index.js +2 -0
- package/dist/Carousel/index.js +9 -7
- package/dist/Chatbot/AnimatedGradientBorder.css.d.ts +5 -0
- package/dist/Chatbot/AnimatedGradientBorder.css.js +13 -3
- package/dist/Chatbot/AudioManager.d.ts +19 -0
- package/dist/Chatbot/AudioManager.js +61 -0
- package/dist/Chatbot/Bubble.css.js +1 -0
- package/dist/Chatbot/Bubble.d.ts +1 -0
- package/dist/Chatbot/Bubble.js +3 -12
- package/dist/Chatbot/Chat.js +17 -7
- package/dist/Chatbot/ChatWindow.css.d.ts +8 -0
- package/dist/Chatbot/ChatWindow.css.js +49 -33
- package/dist/Chatbot/ChatWindow.js +459 -366
- package/dist/Chatbot/Chatbot.css.js +0 -1
- package/dist/Chatbot/Chatbot.css.ts.vanilla.css.js +1 -0
- package/dist/Chatbot/Chatbot.d.ts +13 -2
- package/dist/Chatbot/Chatbot.js +200 -84
- package/dist/Chatbot/ChatbotMessage.d.ts +1 -0
- package/dist/Chatbot/ChatbotMessage.js +189 -160
- package/dist/Chatbot/EllipsisAnimation.js +0 -6
- package/dist/Chatbot/ExpandChatToggle.d.ts +8 -0
- package/dist/Chatbot/ExpandChatToggle.js +74 -0
- package/dist/Chatbot/index.js +11 -2
- package/dist/Chatbot/store/chat.d.ts +8 -0
- package/dist/Chatbot/store/chat.js +14 -2
- package/dist/Chatbot/useHeadlessChat.js +1 -2
- package/dist/Chevron/index.js +10 -5
- package/dist/Comparison/Comparison.css.js +3 -2
- package/dist/Comparison/Comparison.js +7 -5
- package/dist/ContentBanner/index.js +1 -1
- package/dist/ExecutiveBio/ExecutiveBio.js +115 -106
- package/dist/ExecutiveBio/ExecutiveBioSet.js +1 -1
- package/dist/FaqAccordion/index.js +8 -6
- package/dist/FooterDisclosure/FooterDisclosure.js +1 -1
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +26 -6
- package/dist/Forms/ApplyNow.js +8 -6
- package/dist/Forms/BoatMooringLocation.d.ts +6 -1
- package/dist/Forms/BoatMooringLocation.js +145 -8
- package/dist/Forms/ContactUsBusiness.js +9 -7
- package/dist/Forms/ContactUsBusinessNameEmail.js +9 -7
- package/dist/Forms/ContactUsNMLSId.js +9 -7
- package/dist/Forms/ContactUsSchwabAAS.d.ts +11 -0
- package/dist/Forms/ContactUsSchwabAAS.js +263 -0
- package/dist/Forms/CpraRequest.js +8 -6
- package/dist/Forms/CraPublicFile.js +9 -7
- package/dist/Forms/EmailOnly.js +10 -8
- package/dist/Forms/FormEnums.js +2 -2
- package/dist/Forms/MortgageRate/MortgageRateForm.js +9 -7
- package/dist/Forms/MortgageRate/MortgageRateWatch.js +8 -6
- package/dist/Forms/MortgageWarehouseLending.d.ts +1 -1
- package/dist/Forms/MortgageWarehouseLending.js +16 -14
- package/dist/Forms/SuccesForm.js +9 -7
- package/dist/Forms/index.d.ts +1 -0
- package/dist/Forms/index.js +2 -0
- package/dist/HeroBanner/HeroBanner.css.d.ts +1 -0
- package/dist/HeroBanner/HeroBanner.css.js +19 -16
- package/dist/HeroBanner/HeroBanner.d.ts +1 -1
- package/dist/HeroBanner/HeroBanner.interface.d.ts +6 -1
- package/dist/HeroBanner/HeroBanner.js +54 -183
- package/dist/HeroBanner/HeroVideoPoster.d.ts +5 -0
- package/dist/HeroBanner/HeroVideoPoster.js +24 -0
- package/dist/HeroBanner/LargeBanner.css.d.ts +110 -0
- package/dist/HeroBanner/LargeBanner.css.js +22 -8
- package/dist/HeroBanner/LargeHeroBanner.d.ts +5 -0
- package/dist/HeroBanner/LargeHeroBanner.js +228 -0
- package/dist/HeroBanner/index.js +3 -2
- package/dist/Hyperlink/index.js +9 -7
- package/dist/IconBillboard/IconBillboard.css.js +2 -1
- package/dist/IconBillboard/IconBillboard.interface.d.ts +2 -0
- package/dist/IconBillboard/IconBillboardSet.js +1 -1
- package/dist/IconBillboard/sections/CallToActionSection.js +3 -1
- package/dist/ImageBillboard/ImageBillboard.interface.d.ts +2 -0
- package/dist/ImageBillboard/ImageBillboard.js +1 -1
- package/dist/ImageBillboard/ImageBillboardSet.d.ts +1 -1
- package/dist/ImageBillboard/ImageBillboardSet.js +28 -20
- package/dist/ImageLink/ImageLink.js +7 -5
- package/dist/ImageLink/ImageLinkSet.js +6 -4
- package/dist/ImageLink/index.js +8 -6
- package/dist/ImageToast/ImageToast.css.d.ts +5 -0
- package/dist/ImageToast/ImageToast.css.js +13 -0
- package/dist/ImageToast/index.d.ts +9 -0
- package/dist/ImageToast/index.js +188 -0
- package/dist/Input/Checkbox.js +2 -2
- package/dist/Input/DownPaymentInput.js +1 -1
- package/dist/Input/Dropdown.js +1 -1
- package/dist/Input/Input.js +1 -1
- package/dist/Input/InputTextArea.js +1 -1
- package/dist/Insight/Featured/CategorySelector.js +8 -6
- package/dist/Insight/Featured/Featured.js +10 -8
- package/dist/Insight/Featured/Header.js +8 -6
- package/dist/LandingPageHeader/LandingPageHeader.js +1 -1
- package/dist/Modal/Modal.js +8 -6
- package/dist/Modal/contextApi/store.d.ts +0 -3
- package/dist/Modal/contextApi/store.js +88 -2
- package/dist/NavigationMenu/AxosALTS/index.js +7 -5
- package/dist/NavigationMenu/AxosAdvisorServices/index.js +0 -1
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +7 -5
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +27 -27
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +13 -8
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +30 -25
- package/dist/NavigationMenu/AxosBank/NavBar.module.js +39 -39
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +78 -41
- package/dist/NavigationMenu/AxosBank/index.js +50 -32
- package/dist/NavigationMenu/AxosFiduciary/NavBar.module.js +40 -43
- package/dist/NavigationMenu/AxosFiduciary/index.js +0 -1
- package/dist/NavigationMenu/LaVictoire/index.js +8 -6
- package/dist/NavigationMenu/Navbar.js +9 -7
- package/dist/NavigationMenu/SignInNavButton.js +10 -8
- package/dist/PageNavItem/PageNavItem.js +1 -1
- package/dist/SetContainer/SetContainer.css.d.ts +1 -0
- package/dist/SetContainer/SetContainer.css.js +5 -3
- package/dist/SetContainer/SetContainer.js +15 -7
- package/dist/SetContainer/index.js +2 -1
- package/dist/SocialMediaBar/iconsRepository.js +8 -6
- package/dist/StepItem/StepItem.js +1 -1
- package/dist/StepItemSet/StepItemSet.js +1 -1
- package/dist/Table/Table.css.d.ts +14 -1
- package/dist/Table/Table.css.js +21 -19
- package/dist/Table/Table.d.ts +1 -1
- package/dist/Table/Table.js +5 -3
- package/dist/Topic/Topic.js +1 -1
- package/dist/TopicalNavItem/TopicalNavItem.css.d.ts +0 -1
- package/dist/TopicalNavItem/TopicalNavItem.css.js +2 -4
- package/dist/TopicalNavItem/TopicalNavItem.js +11 -33
- package/dist/TopicalNavItem/index.js +1 -2
- package/dist/VideoTile/VideoTile.js +7 -5
- package/dist/VideoWrapper/index.js +8 -6
- package/dist/assets/Calculators/ApyCalculator/ApyCalculator.css +350 -64
- package/dist/assets/Calculators/ApyCalculatorUserTest/ApyCalculatorUserTest.css +424 -0
- package/dist/assets/Calculators/AxosOneCalculator/BalanceAPYCalculator.css +2 -2
- package/dist/assets/Calculators/calculator.css +25 -15
- package/dist/assets/Chatbot/AnimatedGradientBorder.css +104 -24
- package/dist/assets/Chatbot/Bubble.css +25 -7
- package/dist/assets/Chatbot/ChatWindow.css +181 -88
- package/dist/assets/Comparison/Comparison.css +2 -2
- package/dist/assets/DownloadTile/DownloadTile.css +7 -0
- package/dist/assets/ExecutiveBio/ExecutiveBio.css +38 -14
- package/dist/assets/HeroBanner/HeroBanner.css +83 -65
- package/dist/assets/HeroBanner/LargeBanner.css +126 -59
- package/dist/assets/IconBillboard/IconBillboard.css +33 -0
- package/dist/assets/ImageBillboard/ImageBillboard.css +1 -1
- package/dist/assets/ImageToast/ImageToast.css +33 -0
- package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css +49 -49
- package/dist/assets/NavigationMenu/AxosBank/NavBar.css +88 -88
- package/dist/assets/NavigationMenu/AxosFiduciary/NavBar.css +82 -82
- package/dist/assets/SetContainer/SetContainer.css +25 -15
- package/dist/assets/Table/Table.css +85 -76
- package/dist/assets/TextBlock/TextBlock.css +7 -0
- package/dist/assets/TopicalNavItem/TopicalNavItem.css +25 -52
- package/dist/assets/TopicalNavSet/TopicalNavSet.css +29 -4
- package/dist/assets/VideoTile/VideoTile.css +6 -0
- package/dist/assets/globals.css +9 -9
- package/dist/assets/notification.mp3.js +4 -0
- package/dist/assets/themes/axos.css +8 -7
- package/dist/assets/themes/premier.css +9 -8
- package/dist/assets/themes/ufb.css +9 -8
- package/dist/assets/themes/victorie.css +9 -8
- package/dist/main.js +24 -8
- package/dist/themes/axos.css.d.ts +1 -0
- package/dist/themes/axos.css.js +1 -1
- package/dist/utils/allowedAxosDomains.js +2 -1
- package/dist/utils/appendQueryParams.d.ts +3 -1
- package/dist/utils/appendQueryParams.js +66 -66
- package/dist/utils/getPosition.d.ts +1 -0
- package/dist/utils/getPosition.js +17 -0
- package/dist/utils/index.js +3 -1
- package/dist/utils/tealiumOrganicFallback.d.ts +21 -0
- package/dist/utils/tealiumOrganicFallback.js +26 -0
- package/dist/utils/useVisibility.d.ts +1 -0
- package/dist/utils/useVisibility.js +18 -0
- package/dist/utils/variant.types.d.ts +1 -0
- package/dist/vite-env.d.js +1 -0
- package/package.json +3 -3
- package/dist/Chatbot/authenticate.d.ts +0 -3
- package/dist/Chatbot/authenticate.js +0 -16
- package/dist/assets/Chatbot/Chatbot.css +0 -3
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
for (const key of existingParams.keys()) {
|
|
14
|
-
addedKeys.add(decodeURIComponent(key));
|
|
15
|
-
}
|
|
1
|
+
const filterParams = (href, currentSearch) => {
|
|
2
|
+
if (typeof window === "undefined") return href;
|
|
3
|
+
try {
|
|
4
|
+
if (!href || href.startsWith("tel:") || href.startsWith("mailto:") || href === "#" || href === "") {
|
|
5
|
+
return href;
|
|
6
|
+
}
|
|
7
|
+
const search = currentSearch ?? window.location.search;
|
|
8
|
+
const searchParams = new URLSearchParams(search);
|
|
9
|
+
const base = window.location.href;
|
|
10
|
+
const url = new URL(href, base);
|
|
11
|
+
if (url.pathname === window.location.pathname && url.hash) {
|
|
12
|
+
const existingInHash = new URLSearchParams(url.search);
|
|
16
13
|
for (const [key, value] of searchParams.entries()) {
|
|
17
|
-
const decodedKey = decodeURIComponent(key);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (!addedKeys.has(lowerKey) && !decodedKey.includes("[]")) {
|
|
21
|
-
newParams.append(lowerKey, decodedValue);
|
|
22
|
-
addedKeys.add(lowerKey);
|
|
23
|
-
} else if (decodedKey.includes("[]")) {
|
|
24
|
-
const existingValues = existingParams.getAll(key).map(decodeURIComponent);
|
|
25
|
-
if (!existingValues.includes(decodedValue)) {
|
|
26
|
-
newParams.append(decodedKey, decodedValue);
|
|
27
|
-
}
|
|
14
|
+
const decodedKey = decodeURIComponent(key).toLowerCase();
|
|
15
|
+
if (!existingInHash.has(decodedKey) && !decodedKey.includes("[]")) {
|
|
16
|
+
existingInHash.set(decodedKey, decodeURIComponent(value));
|
|
28
17
|
}
|
|
29
18
|
}
|
|
30
|
-
|
|
31
|
-
newParams.forEach((value, key) => mergedParams.append(key, value));
|
|
32
|
-
return `${url.origin}${url.pathname}?${mergedParams.toString()}${url.hash}`;
|
|
33
|
-
} catch (e) {
|
|
34
|
-
console.error(e);
|
|
35
|
-
return href;
|
|
19
|
+
return `?${existingInHash.toString()}${url.hash}`;
|
|
36
20
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const href = anchor.getAttribute("href")?.trim();
|
|
43
|
-
if (!href || href.startsWith("tel:") || href.startsWith("mailto:") || href === "#" || href === "" || href.startsWith("#"))
|
|
44
|
-
return;
|
|
45
|
-
const base = window.location.origin + window.location.pathname + window.location.search;
|
|
46
|
-
const url = new URL(href, base);
|
|
47
|
-
if (url.origin !== currentOrigin || url.pathname !== currentPathname)
|
|
48
|
-
return;
|
|
49
|
-
e.preventDefault();
|
|
50
|
-
e.stopImmediatePropagation();
|
|
51
|
-
const merged = filterParams(href, window.location.search);
|
|
52
|
-
const mergedUrl = new URL(merged, window.location.origin);
|
|
53
|
-
const fullUrl = `${mergedUrl.pathname}${mergedUrl.search}${mergedUrl.hash}`;
|
|
54
|
-
window.history.replaceState({ ...window.history.state }, "", fullUrl);
|
|
55
|
-
window.dispatchEvent(
|
|
56
|
-
new PopStateEvent("popstate", { state: window.history.state })
|
|
57
|
-
);
|
|
58
|
-
if (mergedUrl.hash) {
|
|
59
|
-
const el = document.querySelector(mergedUrl.hash);
|
|
60
|
-
el?.scrollIntoView({ behavior: "smooth" });
|
|
21
|
+
const existingParams = new URLSearchParams(url.search);
|
|
22
|
+
const newParams = new URLSearchParams();
|
|
23
|
+
const addedKeys = /* @__PURE__ */ new Set();
|
|
24
|
+
for (const key of existingParams.keys()) {
|
|
25
|
+
addedKeys.add(decodeURIComponent(key));
|
|
61
26
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
27
|
+
for (const [key, value] of searchParams.entries()) {
|
|
28
|
+
const decodedKey = decodeURIComponent(key);
|
|
29
|
+
const decodedValue = decodeURIComponent(value);
|
|
30
|
+
const lowerKey = decodedKey.toLowerCase();
|
|
31
|
+
if (!addedKeys.has(lowerKey) && !decodedKey.includes("[]")) {
|
|
32
|
+
newParams.append(lowerKey, decodedValue);
|
|
33
|
+
addedKeys.add(lowerKey);
|
|
34
|
+
} else if (decodedKey.includes("[]")) {
|
|
35
|
+
const existingValues = existingParams.getAll(key).map(decodeURIComponent);
|
|
36
|
+
if (!existingValues.includes(decodedValue)) {
|
|
37
|
+
newParams.append(decodedKey, decodedValue);
|
|
38
|
+
}
|
|
70
39
|
}
|
|
71
|
-
}
|
|
40
|
+
}
|
|
41
|
+
const mergedParams = new URLSearchParams(existingParams);
|
|
42
|
+
newParams.forEach((value, key) => mergedParams.append(key, value));
|
|
43
|
+
return `${url.origin}${url.pathname}?${mergedParams.toString()}${url.hash}`;
|
|
44
|
+
} catch (e) {
|
|
45
|
+
console.error(e);
|
|
46
|
+
return href;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const handleAnchorClick = (e, resolved) => {
|
|
50
|
+
if (resolved.includes("#") && !resolved.startsWith("http")) {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
const hash = resolved.split("#")[1];
|
|
53
|
+
const fullUrl = new URL(resolved, window.location.href);
|
|
54
|
+
window.history.pushState(null, "", fullUrl.search + fullUrl.hash);
|
|
55
|
+
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
56
|
+
document.getElementById(hash)?.scrollIntoView({ behavior: "smooth" });
|
|
57
|
+
return true;
|
|
72
58
|
}
|
|
59
|
+
return false;
|
|
60
|
+
};
|
|
61
|
+
const appendQueryParams = (currentSearch) => {
|
|
62
|
+
const search = currentSearch ?? window.location.search;
|
|
63
|
+
if (!search.length) return;
|
|
64
|
+
const searchParams = new URLSearchParams(search);
|
|
65
|
+
document.querySelectorAll("a[href]:not(.ext-link)").forEach((anchor) => {
|
|
66
|
+
const href = anchor.getAttribute("href")?.trim();
|
|
67
|
+
if (href && !href.startsWith("tel:") && !href.startsWith("mailto:") && href !== "#" && href !== "" && !href.startsWith("#")) {
|
|
68
|
+
anchor.href = filterParams(href, searchParams.toString());
|
|
69
|
+
}
|
|
70
|
+
});
|
|
73
71
|
};
|
|
74
72
|
export {
|
|
75
|
-
appendQueryParams
|
|
73
|
+
appendQueryParams,
|
|
74
|
+
filterParams,
|
|
75
|
+
handleAnchorClick
|
|
76
76
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getPosition: (text: string | undefined) => "default" | "top left" | "top right" | "bottom left" | "bottom right";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const getPosition = (text) => {
|
|
2
|
+
switch (text) {
|
|
3
|
+
case "top left":
|
|
4
|
+
return "top left";
|
|
5
|
+
case "top right":
|
|
6
|
+
return "top right";
|
|
7
|
+
case "bottom left":
|
|
8
|
+
return "bottom left";
|
|
9
|
+
case "bottom right":
|
|
10
|
+
return "bottom right";
|
|
11
|
+
default:
|
|
12
|
+
return "default";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
getPosition
|
|
17
|
+
};
|
package/dist/utils/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { findMoreAxosDomains, getMoreDomains, isAllowedUrl } from "./allowedAxosDomains.js";
|
|
3
|
-
import { appendQueryParams } from "./appendQueryParams.js";
|
|
3
|
+
import { appendQueryParams, filterParams, handleAnchorClick } from "./appendQueryParams.js";
|
|
4
4
|
import { createCachedEmailValidator } from "./emailValidation.js";
|
|
5
5
|
import { associatedEmail } from "./EverestValidity.js";
|
|
6
6
|
import { getVariant, getVariantWithRegex } from "./getVariant.js";
|
|
@@ -14,10 +14,12 @@ export {
|
|
|
14
14
|
columnValues,
|
|
15
15
|
createCachedEmailValidator,
|
|
16
16
|
createCachedNMLSValidator,
|
|
17
|
+
filterParams,
|
|
17
18
|
findMoreAxosDomains,
|
|
18
19
|
getMoreDomains,
|
|
19
20
|
getVariant,
|
|
20
21
|
getVariantWithRegex,
|
|
22
|
+
handleAnchorClick,
|
|
21
23
|
isAbsoluteUrl,
|
|
22
24
|
isAllowedUrl,
|
|
23
25
|
isEmailLink,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface UtagData {
|
|
2
|
+
traffic_type?: string;
|
|
3
|
+
traffic_source?: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
utag?: {
|
|
9
|
+
data: UtagData;
|
|
10
|
+
};
|
|
11
|
+
utag_data?: UtagData;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export interface OrganicUtms {
|
|
15
|
+
utm_source: string;
|
|
16
|
+
utm_medium: string;
|
|
17
|
+
utm_campaign: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const getTealiumOrganicFallback: () => OrganicUtms | null;
|
|
20
|
+
export declare const hasNoUtms: (params: URLSearchParams) => boolean;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const getTealiumOrganicFallback = () => {
|
|
2
|
+
if (typeof window === "undefined") return null;
|
|
3
|
+
try {
|
|
4
|
+
const utagData = window.utag?.data ?? window.utag_data ?? {};
|
|
5
|
+
const trafficType = utagData.traffic_type ?? "";
|
|
6
|
+
const trafficSource = utagData.traffic_source ?? "";
|
|
7
|
+
if (trafficType !== "organic" || !trafficSource) return null;
|
|
8
|
+
let sourceName = trafficSource;
|
|
9
|
+
try {
|
|
10
|
+
sourceName = new URL(trafficSource).hostname.replace(/^www\./, "").split(".")[0];
|
|
11
|
+
} catch (_) {
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
utm_source: sourceName,
|
|
15
|
+
utm_medium: "organic",
|
|
16
|
+
utm_campaign: "organic-search"
|
|
17
|
+
};
|
|
18
|
+
} catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const hasNoUtms = (params) => !params.has("utm_source") && !params.has("utm_medium") && !params.has("utm_campaign") && !params.has("utm_content") && !params.has("utm_term");
|
|
23
|
+
export {
|
|
24
|
+
getTealiumOrganicFallback,
|
|
25
|
+
hasNoUtms
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function usePageVisibility(): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
function usePageVisibility() {
|
|
4
|
+
const [isVisible, setIsVisible] = useState(!document.hidden);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const handleVisibilityChange = () => {
|
|
7
|
+
setIsVisible(!document.hidden);
|
|
8
|
+
};
|
|
9
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
10
|
+
return () => {
|
|
11
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
12
|
+
};
|
|
13
|
+
}, []);
|
|
14
|
+
return isVisible;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
usePageVisibility
|
|
18
|
+
};
|
|
@@ -6,3 +6,4 @@ export type SideProps = "left" | "right";
|
|
|
6
6
|
export type StarIconTypes = "gold" | "gray";
|
|
7
7
|
export declare const columnValues: readonly [1, 2, 3, 4, undefined];
|
|
8
8
|
export type ColumnTypes = (typeof columnValues)[number];
|
|
9
|
+
export type AnchorPointTypes = "default" | "top left" | "top right" | "bottom left" | "bottom right";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axos-web-dev/shared-components",
|
|
3
3
|
"description": "Axos shared components library for web.",
|
|
4
|
-
"version": "2.0.0-dev.
|
|
4
|
+
"version": "2.0.0-dev.30-toasts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"module": "dist/main.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"check-lint": "eslint .",
|
|
35
35
|
"format": "prettier --write .",
|
|
36
36
|
"test-all": "npm run check-format && npm run check-lint && npm run check-types && npm run build",
|
|
37
|
-
"prepare": "
|
|
37
|
+
"prepare": "npm run build",
|
|
38
38
|
"storybook": "storybook dev -p 6006",
|
|
39
39
|
"build-storybook": "storybook build",
|
|
40
40
|
"npm:link": "npm run build && npm link"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@storybook/preview-api": "^8.4.7",
|
|
50
50
|
"@ts-stack/markdown": "^1.5.0",
|
|
51
51
|
"@types/iframe-resizer": "3.5.13",
|
|
52
|
-
"@ujet/websdk-headless": "^
|
|
52
|
+
"@ujet/websdk-headless": "^4.22.0",
|
|
53
53
|
"@vanilla-extract/css": "^1.16.1",
|
|
54
54
|
"@vanilla-extract/recipes": "^0.5.1 || ^0.5.5",
|
|
55
55
|
"antd": "^5.22.5",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const AUTH_URL = process.env.AUTH_CHAT_URL || "http://localhost:3000/api/auth/token";
|
|
2
|
-
const authenticate = async () => {
|
|
3
|
-
const res = await fetch(AUTH_URL, {
|
|
4
|
-
method: "GET",
|
|
5
|
-
headers: {
|
|
6
|
-
"Content-Type": "application/json"
|
|
7
|
-
}
|
|
8
|
-
});
|
|
9
|
-
const data = await res.json();
|
|
10
|
-
return {
|
|
11
|
-
token: data.token
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
authenticate
|
|
16
|
-
};
|