@bikdotai/bik-widgets 1.0.0 → 1.0.2
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-package/index.css +95 -0
- package/dist-package/index.js +2 -0
- package/package.json +17 -4
- package/.eslintrc +0 -22
- package/.eslintrc.js +0 -19
- package/.github/workflows/main.yml +0 -293
- package/.prettierignore +0 -13
- package/.prettierrc +0 -10
- package/cypress/apiHelper/endpoints.ts +0 -21
- package/cypress/apiHelper/executor.ts +0 -42
- package/cypress/e2e/bottomDrawer.cy.ts +0 -49
- package/cypress/e2e/directReward.cy.ts +0 -67
- package/cypress/e2e/scratchTheCard.cy.ts +0 -68
- package/cypress/e2e/stw.cy.ts +0 -82
- package/cypress/e2e/waRedirection.cy.ts +0 -46
- package/cypress/fixtures/payloads.ts +0 -330
- package/cypress/support/commands.ts +0 -37
- package/cypress/support/e2e.ts +0 -20
- package/cypress.staging.config.ts +0 -23
- package/jsconfig.json +0 -6
- package/localtest.sh +0 -10
- package/log-server.js +0 -86
- package/postcss.config.js +0 -8
- package/src/Globals.d.ts +0 -2
- package/src/assets/lottie/santa.json +0 -11722
- package/src/assets/svg/CalendarClockIcon.tsx +0 -30
- package/src/assets/svg/CalendarIcon.tsx +0 -24
- package/src/assets/svg/CheckIcon.tsx +0 -17
- package/src/assets/svg/ChevronIcon.tsx +0 -21
- package/src/assets/svg/Close.tsx +0 -39
- package/src/assets/svg/Confetti.tsx +0 -140
- package/src/assets/svg/Copy.tsx +0 -26
- package/src/assets/svg/DropdownCheckIcon.tsx +0 -35
- package/src/assets/svg/ErrorIcon.tsx +0 -27
- package/src/assets/svg/RadioIcon.tsx +0 -25
- package/src/assets/svg/UncheckedCheckboxIcon.tsx +0 -28
- package/src/assets/svg/UncheckedRadioIcon.tsx +0 -26
- package/src/assets/svg/info.tsx +0 -30
- package/src/assets/svg/qrcode.svg +0 -14
- package/src/bootstrap.tsx +0 -8
- package/src/components/CtaCard/index.tsx +0 -37
- package/src/components/CtaCard/preview.module.css +0 -32
- package/src/components/CtaCard/style.module.css +0 -32
- package/src/components/EmailInput/emailInputBox.tsx +0 -95
- package/src/components/Fab/index.tsx +0 -224
- package/src/components/Fab/preview.module.css +0 -28
- package/src/components/Fab/style.module.css +0 -37
- package/src/components/Icons/Call.tsx +0 -26
- package/src/components/Icons/Cross.tsx +0 -24
- package/src/components/Icons/Gmail.tsx +0 -61
- package/src/components/Icons/Instagram.tsx +0 -60
- package/src/components/Icons/LiveChat.tsx +0 -43
- package/src/components/Icons/Messenger.tsx +0 -57
- package/src/components/Icons/Send.tsx +0 -22
- package/src/components/Icons/Whatsapp.tsx +0 -24
- package/src/components/Shimmer/index.tsx +0 -12
- package/src/components/Shimmer/style.module.css +0 -37
- package/src/components/SmsInput/smsInputBox.tsx +0 -135
- package/src/components/UserDetailsV2/userDetailsV2.desktop.module.css +0 -52
- package/src/components/UserDetailsV2/userDetailsV2.mobile.module.css +0 -52
- package/src/components/UserDetailsV2/userDetailsV2.module.css +0 -81
- package/src/components/UserDetailsV2/userDetailsV2.tsx +0 -527
- package/src/components/WhatsappInput/Spinner.tsx +0 -26
- package/src/components/WhatsappInput/whatsappInput.module.css +0 -106
- package/src/components/WhatsappInput/whatsappInputBox.tsx +0 -155
- package/src/components/WhatsappInput/whatsappInputPreviewDesktop.module.css +0 -71
- package/src/components/WhatsappInput/whatsappInputPreviewMobile.module.css +0 -65
- package/src/components/checkbox/checkbox.module.css +0 -19
- package/src/components/checkbox/checkbox.tsx +0 -88
- package/src/components/countryCodePicker/countriesDropdown.module.css +0 -77
- package/src/components/countryCodePicker/countriesDropdown.tsx +0 -81
- package/src/components/couponDetails/coupon.module.css +0 -208
- package/src/components/couponDetails/coupon.tsx +0 -210
- package/src/components/couponDetails/couponPreviewDesktop.module.css +0 -158
- package/src/components/couponDetails/couponPreviewMobile.module.css +0 -164
- package/src/components/index.ts +0 -3
- package/src/components/inputComponents/Checkbox.module.css +0 -197
- package/src/components/inputComponents/Checkbox.tsx +0 -85
- package/src/components/inputComponents/DatePicker.module.css +0 -565
- package/src/components/inputComponents/DatePicker.tsx +0 -278
- package/src/components/inputComponents/Dropdown.module.css +0 -796
- package/src/components/inputComponents/Dropdown.tsx +0 -630
- package/src/components/inputComponents/InputBox.module.css +0 -401
- package/src/components/inputComponents/InputBox.tsx +0 -209
- package/src/components/selectedCountry/selectedCountry.module.css +0 -76
- package/src/components/selectedCountry/selectedCountry.tsx +0 -76
- package/src/components/selectedCountry/selectedCountryPreviewDesktop.module.css +0 -56
- package/src/components/selectedCountry/selectedCountryPreviewMobile.module.css +0 -57
- package/src/components/userDetailsForm/RenderCustomFields.tsx +0 -333
- package/src/components/userDetailsForm/userDetailsForm.tsx +0 -675
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useExitIntent.ts +0 -452
- package/src/hooks/useIsMobile.tsx +0 -21
- package/src/hooks/useMessageEvent.ts +0 -8
- package/src/hooks/useTriggeredIntentDetails.ts +0 -43
- package/src/hooks/useUrlListerner.ts +0 -30
- package/src/hooks/useWebSocketLogger.ts +0 -59
- package/src/hooks/useWindowEvent.ts +0 -8
- package/src/icons/copyIcon.tsx +0 -26
- package/src/icons/crossIconDesktop.tsx +0 -20
- package/src/icons/crossIconMobile.tsx +0 -20
- package/src/index.html +0 -30
- package/src/index.ts +0 -32
- package/src/index.tsx +0 -1
- package/src/repo/widgetRepo.ts +0 -21
- package/src/types/customFields.ts +0 -73
- package/src/utilities/cookie.ts +0 -70
- package/src/utilities/customFieldTypeMapping.ts +0 -67
- package/src/utilities/customFieldValidation.ts +0 -201
- package/src/utilities/encryption.ts +0 -21
- package/src/utilities/exitIntentUtils.ts +0 -31
- package/src/utilities/global.css +0 -11
- package/src/utilities/languageUtilities.ts +0 -235
- package/src/utilities/localRunner.js +0 -26
- package/src/utilities/localRunner.ts +0 -27
- package/src/utilities/localStorage.ts +0 -40
- package/src/utilities/script.tsx +0 -15
- package/src/utilities/stringUtils.ts +0 -5
- package/src/utilities/styleUtils.ts +0 -134
- package/src/utilities/variables.ts +0 -11
- package/src/utilities/widgetUtils.js +0 -342
- package/src/utilities/widgetUtils.ts +0 -313
- package/src/widgets/BottomDrawer/config.ts +0 -41
- package/src/widgets/BottomDrawer/index.tsx +0 -116
- package/src/widgets/BottomDrawer/modal.tsx +0 -286
- package/src/widgets/BottomDrawer/preview.module.css +0 -122
- package/src/widgets/BottomDrawer/previewMobile.module.css +0 -124
- package/src/widgets/BottomDrawer/style.module.css +0 -279
- package/src/widgets/CaptivateBanner/captivateBanner.tsx +0 -200
- package/src/widgets/CaptivateBanner/config.ts +0 -72
- package/src/widgets/CaptivateBanner/index.tsx +0 -204
- package/src/widgets/CaptivateBanner/previewDesktop.module.css +0 -51
- package/src/widgets/CaptivateBanner/previewMobile.module.css +0 -51
- package/src/widgets/CaptivateBanner/style.module.css +0 -77
- package/src/widgets/CaptivateBanner/utils.ts +0 -104
- package/src/widgets/CentrallyAlignedPopup/config.ts +0 -42
- package/src/widgets/CentrallyAlignedPopup/index.tsx +0 -109
- package/src/widgets/CentrallyAlignedPopup/modal.tsx +0 -269
- package/src/widgets/CentrallyAlignedPopup/preview.module.css +0 -153
- package/src/widgets/CentrallyAlignedPopup/previewMobile.module.css +0 -153
- package/src/widgets/CentrallyAlignedPopup/style.module.css +0 -283
- package/src/widgets/DirectReward/components/couponDetails.tsx +0 -265
- package/src/widgets/DirectReward/components/userDetails.tsx +0 -117
- package/src/widgets/DirectReward/config.ts +0 -186
- package/src/widgets/DirectReward/directReward.tsx +0 -350
- package/src/widgets/DirectReward/index.tsx +0 -579
- package/src/widgets/DirectReward/previewStyles/thankYouPreviewDesktop.module.css +0 -276
- package/src/widgets/DirectReward/previewStyles/thankYouPreviewMobile.module.css +0 -303
- package/src/widgets/DirectReward/previewStyles/userDetailsPreviewDesktop.module.css +0 -511
- package/src/widgets/DirectReward/previewStyles/userDetailsPreviewMobile.module.css +0 -462
- package/src/widgets/DirectReward/style.module.css +0 -836
- package/src/widgets/ExitIntentHook.tsx +0 -28
- package/src/widgets/STW/api.ts +0 -70
- package/src/widgets/STW/components/svgFactory.tsx +0 -44
- package/src/widgets/STW/config.ts +0 -193
- package/src/widgets/STW/context.ts +0 -7
- package/src/widgets/STW/couponDetails.tsx +0 -121
- package/src/widgets/STW/index.tsx +0 -733
- package/src/widgets/STW/previewStyles/thankyouPreviewDesktop.module.css +0 -215
- package/src/widgets/STW/previewStyles/thankyouPreviewMobile.module.css +0 -205
- package/src/widgets/STW/previewStyles/userInputsPreviewDesktop.module.css +0 -732
- package/src/widgets/STW/previewStyles/userInputsPreviewMobile.module.css +0 -661
- package/src/widgets/STW/previewStyles/wheelPreviewDesktop.module.css +0 -498
- package/src/widgets/STW/previewStyles/wheelPreviewMobile.module.css +0 -497
- package/src/widgets/STW/stw1.tsx +0 -119
- package/src/widgets/STW/stw2Components/wheelDesign.tsx +0 -183
- package/src/widgets/STW/stw2Pages/couponDetails.tsx +0 -72
- package/src/widgets/STW/stw2Pages/stw2.tsx +0 -212
- package/src/widgets/STW/stw2Pages/style.module.css +0 -1226
- package/src/widgets/STW/stw2Pages/userDetails.tsx +0 -86
- package/src/widgets/STW/stw2Pages/wheel.tsx +0 -117
- package/src/widgets/STW/stw2PreviewStyles/thankyouPreviewDesktop.module.css +0 -835
- package/src/widgets/STW/stw2PreviewStyles/thankyouPreviewMobile.module.css +0 -787
- package/src/widgets/STW/stw2PreviewStyles/userInputsPreviewDesktop.module.css +0 -867
- package/src/widgets/STW/stw2PreviewStyles/userInputsPreviewMobile.module.css +0 -798
- package/src/widgets/STW/stw2PreviewStyles/wheelPreviewDesktop.module.css +0 -572
- package/src/widgets/STW/stw2PreviewStyles/wheelPreviewMobile.module.css +0 -559
- package/src/widgets/STW/style.module.css +0 -901
- package/src/widgets/STW/userDetails.tsx +0 -150
- package/src/widgets/STW/utility.ts +0 -664
- package/src/widgets/STW/wheel.tsx +0 -304
- package/src/widgets/ScratchCard/ScratchOff/scratchOff.tsx +0 -157
- package/src/widgets/ScratchCard/config.ts +0 -152
- package/src/widgets/ScratchCard/globalStyle.module.css +0 -931
- package/src/widgets/ScratchCard/index.tsx +0 -546
- package/src/widgets/ScratchCard/modal.tsx +0 -225
- package/src/widgets/ScratchCard/preview.module.css +0 -250
- package/src/widgets/ScratchCard/previewMobile.module.css +0 -247
- package/src/widgets/ScratchCard/previewStyles/userDetailsPreviewDesktop.module.css +0 -537
- package/src/widgets/ScratchCard/previewStyles/userDetailsPreviewMobile.module.css +0 -463
- package/src/widgets/ScratchCard/style.module.css +0 -220
- package/src/widgets/ShopifyForm/config.ts +0 -168
- package/src/widgets/ShopifyForm/index.tsx +0 -214
- package/src/widgets/ShopifyForm/previewDesktop.module.css +0 -117
- package/src/widgets/ShopifyForm/previewMobile.module.css +0 -131
- package/src/widgets/ShopifyForm/shopifyForm.tsx +0 -445
- package/src/widgets/ShopifyForm/style.module.css +0 -161
- package/src/widgets/SingleButtonRedirection/config.ts +0 -47
- package/src/widgets/SingleButtonRedirection/index.tsx +0 -121
- package/src/widgets/WebStories/config.ts +0 -105
- package/src/widgets/WebStories/index.css +0 -3
- package/src/widgets/WebStories/index.tsx +0 -282
- package/src/widgets/WebStories/style.module.css +0 -26
- package/src/widgets/index.tsx +0 -3
- package/src/widgets/utility.ts +0 -31
- package/tsconfig.json +0 -12
- package/webpack.config.js +0 -239
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { Fab } from 'components';
|
|
3
|
-
import includeMe from 'utilities/script';
|
|
4
|
-
import BottomDrawerModal from './modal';
|
|
5
|
-
import Send from 'components/Icons/Send';
|
|
6
|
-
import { IFab } from 'components/Fab';
|
|
7
|
-
import { IPageConfigProcessed, WidgetUtils } from '../../utilities/widgetUtils';
|
|
8
|
-
import { CookieUtils } from '../../utilities/cookie';
|
|
9
|
-
import { COOKIE_VALUES, EVENT_NAME } from 'utilities/variables';
|
|
10
|
-
import {
|
|
11
|
-
IRedirectWidgetCustomisation,
|
|
12
|
-
WidgetSchema,
|
|
13
|
-
ISO_CODES_VALUES,
|
|
14
|
-
} from '@bikdotai/bik-models/dm';
|
|
15
|
-
|
|
16
|
-
export interface IBottomDrawer extends WidgetSchema {
|
|
17
|
-
id?: string;
|
|
18
|
-
environment: string;
|
|
19
|
-
preview?: boolean;
|
|
20
|
-
isMobile?: boolean;
|
|
21
|
-
storeWidgetConfig: IPageConfigProcessed;
|
|
22
|
-
previewLanguage?: ISO_CODES_VALUES;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const BottomDrawer = (props: IBottomDrawer) => {
|
|
26
|
-
const [showModal, setShowModal] = useState(false);
|
|
27
|
-
const [showFab, setShowFab] = useState(false);
|
|
28
|
-
const [showWidget, setShowWidget] = useState(false);
|
|
29
|
-
const { widgetCustomisation } = props as {
|
|
30
|
-
widgetCustomisation: IRedirectWidgetCustomisation;
|
|
31
|
-
};
|
|
32
|
-
const widgetUtils = new WidgetUtils();
|
|
33
|
-
const cookieUtils = new CookieUtils();
|
|
34
|
-
|
|
35
|
-
cookieUtils.addItemInLocalStorage('storeId', props.info?.storeId);
|
|
36
|
-
|
|
37
|
-
cookieUtils.cookieClickHandler(
|
|
38
|
-
`bik-${props.id}-visitor`,
|
|
39
|
-
COOKIE_VALUES.BIK_VISITOR,
|
|
40
|
-
EVENT_NAME.WIDGET_VISITED,
|
|
41
|
-
1,
|
|
42
|
-
props.environment,
|
|
43
|
-
props.id,
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
const fabStyle: IFab = {
|
|
47
|
-
icon: <Send color={widgetCustomisation?.iconColor} />,
|
|
48
|
-
onClick() {
|
|
49
|
-
cookieUtils.cookieClickHandler(
|
|
50
|
-
`bik-${props.id}-clicked`,
|
|
51
|
-
'bikclick',
|
|
52
|
-
'WIDGET_CLICKED',
|
|
53
|
-
1,
|
|
54
|
-
props.environment,
|
|
55
|
-
props.id,
|
|
56
|
-
);
|
|
57
|
-
setShowFab(false);
|
|
58
|
-
setShowModal(true);
|
|
59
|
-
},
|
|
60
|
-
isMobile: props.isMobile,
|
|
61
|
-
preview: props.preview ?? false,
|
|
62
|
-
widgetCustomisation: {
|
|
63
|
-
iconColor: widgetCustomisation?.iconColor,
|
|
64
|
-
fabTransform: widgetCustomisation?.fabTransform,
|
|
65
|
-
fabPositioner: widgetCustomisation?.fabPositioner,
|
|
66
|
-
fabBackgroundColor: widgetCustomisation?.fabBackgroundColor,
|
|
67
|
-
fabLottie: widgetCustomisation?.fabLottie,
|
|
68
|
-
fabAnimationRun: widgetCustomisation?.fabAnimationRun,
|
|
69
|
-
fabImage: widgetCustomisation?.fabImage,
|
|
70
|
-
fabIconLink: widgetCustomisation?.fabIconLink,
|
|
71
|
-
fabWebSize: widgetCustomisation?.fabWebSize,
|
|
72
|
-
fabMobileSize: widgetCustomisation?.fabMobileSize,
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
if (!props.preview) {
|
|
78
|
-
const shouldShow = widgetUtils.showWidget(
|
|
79
|
-
{
|
|
80
|
-
currentUrl: window.location.href.replace(window.location.origin, ''),
|
|
81
|
-
customUrls: props.storeWidgetConfig,
|
|
82
|
-
currentWidgetId: props.id,
|
|
83
|
-
},
|
|
84
|
-
props.info.isAutomationTesting,
|
|
85
|
-
);
|
|
86
|
-
setShowFab(shouldShow);
|
|
87
|
-
setShowWidget(shouldShow);
|
|
88
|
-
} else {
|
|
89
|
-
setShowFab(true);
|
|
90
|
-
}
|
|
91
|
-
}, [window.location.href]);
|
|
92
|
-
|
|
93
|
-
return (
|
|
94
|
-
<>
|
|
95
|
-
{showWidget && (
|
|
96
|
-
<div id={`bik-widget-root-${props.id}`}>
|
|
97
|
-
{showFab && <Fab {...fabStyle} id={`bik-bd-${props.id}-cta-fab`} />}
|
|
98
|
-
<BottomDrawerModal
|
|
99
|
-
{...props}
|
|
100
|
-
showModal={showModal}
|
|
101
|
-
onClose={() => {
|
|
102
|
-
setShowFab(true);
|
|
103
|
-
setShowModal(false);
|
|
104
|
-
}}
|
|
105
|
-
/>
|
|
106
|
-
</div>
|
|
107
|
-
)}
|
|
108
|
-
</>
|
|
109
|
-
);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export default React.memo(BottomDrawer);
|
|
113
|
-
|
|
114
|
-
if (process.env.NODE_ENV !== 'development') {
|
|
115
|
-
includeMe(BottomDrawer);
|
|
116
|
-
}
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import CtaCard from 'components/CtaCard';
|
|
3
|
-
import Call from 'components/Icons/Call';
|
|
4
|
-
import Cross from 'components/Icons/Cross';
|
|
5
|
-
import Gmail from 'components/Icons/Gmail';
|
|
6
|
-
import Instagram from 'components/Icons/Instagram';
|
|
7
|
-
import Messenger from 'components/Icons/Messenger';
|
|
8
|
-
import Whatsapp from 'components/Icons/Whatsapp';
|
|
9
|
-
import ReactModal from 'react-modal';
|
|
10
|
-
import 'utilities/global.css';
|
|
11
|
-
import PreviewStyle from './preview.module.css';
|
|
12
|
-
import PreviewMobileStyle from './previewMobile.module.css';
|
|
13
|
-
import CAStyles from './style.module.css';
|
|
14
|
-
import SVGFactory, { SVGName } from 'widgets/STW/components/svgFactory';
|
|
15
|
-
import { decodeTextHelper } from '../utility';
|
|
16
|
-
import {
|
|
17
|
-
IRedirectWidgetCustomisation,
|
|
18
|
-
WidgetSchema,
|
|
19
|
-
LANGUAGE_VALUES,
|
|
20
|
-
LANGUAGE_ISO_CODES,
|
|
21
|
-
} from '@bikdotai/bik-models/dm';
|
|
22
|
-
import { LanguageUtils } from 'utilities/languageUtilities';
|
|
23
|
-
|
|
24
|
-
export interface IBottomDrawerModal extends WidgetSchema {
|
|
25
|
-
id?: string;
|
|
26
|
-
preview?: boolean;
|
|
27
|
-
isMobile?: boolean;
|
|
28
|
-
showModal: boolean;
|
|
29
|
-
environment: string;
|
|
30
|
-
onClose: () => void;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const BottomDrawerModal = (props: IBottomDrawerModal) => {
|
|
34
|
-
const languageUtils = new LanguageUtils();
|
|
35
|
-
const [widgetLanguage, setWidgetLanguage] = useState(LANGUAGE_VALUES.ENGLISH);
|
|
36
|
-
let currentStyle;
|
|
37
|
-
const { environment, widgetCustomisation } = props as unknown as {
|
|
38
|
-
environment: string;
|
|
39
|
-
widgetCustomisation: IRedirectWidgetCustomisation;
|
|
40
|
-
};
|
|
41
|
-
const redirectWidgetBackgroundColor =
|
|
42
|
-
widgetCustomisation?.redirectWidgetBackgroundColor ?? '#e0e0e0';
|
|
43
|
-
const bannerImage =
|
|
44
|
-
widgetCustomisation?.redirectWidgetBannerImage ??
|
|
45
|
-
'https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2Fbc3c06b3-e5cd-4d01-bd18-4a8e3639a665?alt=media&token=7e7b6987-c34c-4043-9b6e-3842b94d023d';
|
|
46
|
-
const title =
|
|
47
|
-
widgetCustomisation?.multiLingualConfigurations?.[widgetLanguage]
|
|
48
|
-
?.redirectWidgetTitleText ??
|
|
49
|
-
widgetCustomisation?.redirectWidgetTitleText ??
|
|
50
|
-
'Hi there';
|
|
51
|
-
let inlineOverlayStyle;
|
|
52
|
-
const { top, bottom, right, left } = widgetCustomisation?.fabPositioner ?? {
|
|
53
|
-
bottom: 30,
|
|
54
|
-
right: 30,
|
|
55
|
-
};
|
|
56
|
-
if (props?.preview) {
|
|
57
|
-
if (props?.isMobile) {
|
|
58
|
-
currentStyle = PreviewMobileStyle;
|
|
59
|
-
} else {
|
|
60
|
-
currentStyle = PreviewStyle;
|
|
61
|
-
inlineOverlayStyle = {
|
|
62
|
-
position: 'absolute',
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
} else {
|
|
66
|
-
currentStyle = CAStyles;
|
|
67
|
-
inlineOverlayStyle = {
|
|
68
|
-
zIndex: 2147483647,
|
|
69
|
-
pointerEvents: props?.preview ? 'none' : 'inherit',
|
|
70
|
-
top: 'inherit',
|
|
71
|
-
bottom: screen.width > 768 ? '30px' : '0px',
|
|
72
|
-
left: screen.width > 768 ? (left ? '30px' : 'inherit') : '0px',
|
|
73
|
-
right: screen.width > 768 ? (right ? '30px' : 'inherit') : '0px',
|
|
74
|
-
transform: screen.width > 768 ? 'inherit' : 'inherit',
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
const [show, setShow] = useState(false);
|
|
78
|
-
const {
|
|
79
|
-
whatsapp,
|
|
80
|
-
messenger,
|
|
81
|
-
phoneNumber,
|
|
82
|
-
instagram,
|
|
83
|
-
email,
|
|
84
|
-
emailSubject,
|
|
85
|
-
emailBody,
|
|
86
|
-
} = widgetCustomisation as IRedirectWidgetCustomisation;
|
|
87
|
-
let parent;
|
|
88
|
-
|
|
89
|
-
if (props.preview) {
|
|
90
|
-
parent = document.getElementById('preview-container');
|
|
91
|
-
} else {
|
|
92
|
-
parent = document.body;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
setShow(props.showModal);
|
|
97
|
-
}, [props.showModal]);
|
|
98
|
-
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
const isBikURL =
|
|
101
|
-
window.location.href?.includes('https://dashboard.bik.ai/') ||
|
|
102
|
-
window.location.href?.includes('https://staging.dashboard.bik.ai/');
|
|
103
|
-
const previewLanguage = props?.widgetCustomisation?.previewLanguage;
|
|
104
|
-
const storeLanguage =
|
|
105
|
-
(isBikURL ? previewLanguage : window?.Shopify?.locale) ??
|
|
106
|
-
previewLanguage ??
|
|
107
|
-
LANGUAGE_ISO_CODES.EN;
|
|
108
|
-
setWidgetLanguage(languageUtils.getStoreLanguage(storeLanguage));
|
|
109
|
-
}, [window.location.href, props?.widgetCustomisation?.previewLanguage]);
|
|
110
|
-
|
|
111
|
-
return (
|
|
112
|
-
<>
|
|
113
|
-
<ReactModal
|
|
114
|
-
isOpen={show}
|
|
115
|
-
ariaHideApp={false}
|
|
116
|
-
parentSelector={() => parent}
|
|
117
|
-
style={{
|
|
118
|
-
overlay: inlineOverlayStyle,
|
|
119
|
-
}}
|
|
120
|
-
className={currentStyle.content}
|
|
121
|
-
overlayClassName={currentStyle.overlay}
|
|
122
|
-
shouldCloseOnOverlayClick={true}
|
|
123
|
-
>
|
|
124
|
-
<div>
|
|
125
|
-
<button
|
|
126
|
-
className={currentStyle.crossBtn}
|
|
127
|
-
style={{ backgroundColor: redirectWidgetBackgroundColor }}
|
|
128
|
-
onClick={props.onClose}
|
|
129
|
-
>
|
|
130
|
-
<Cross
|
|
131
|
-
color={'#5C5C5C'}
|
|
132
|
-
height={props.preview ? 10 : 24}
|
|
133
|
-
width={props.preview ? 10 : 24}
|
|
134
|
-
/>
|
|
135
|
-
</button>
|
|
136
|
-
<div className={currentStyle.widgetContainer}>
|
|
137
|
-
<div className={currentStyle.widgetBody}>
|
|
138
|
-
<div className={currentStyle.widgetHeader}>
|
|
139
|
-
<img className={currentStyle.bannerImage} src={bannerImage} />
|
|
140
|
-
</div>
|
|
141
|
-
<div className={currentStyle.widgetContent}>
|
|
142
|
-
<div className={currentStyle.title}>{title}</div>
|
|
143
|
-
<div className={currentStyle.widgetRedirects}>
|
|
144
|
-
{whatsapp && (
|
|
145
|
-
<CtaCard
|
|
146
|
-
id={`bik-bd-${props.id}-cta-whatsapp`}
|
|
147
|
-
isMobile={props.isMobile}
|
|
148
|
-
Icon={() => (
|
|
149
|
-
<Whatsapp
|
|
150
|
-
height={
|
|
151
|
-
props.preview ? (props.isMobile ? 20 : 10) : 24
|
|
152
|
-
}
|
|
153
|
-
width={
|
|
154
|
-
props.preview ? (props.isMobile ? 20 : 10) : 24
|
|
155
|
-
}
|
|
156
|
-
/>
|
|
157
|
-
)}
|
|
158
|
-
text={'Open Whatsapp'}
|
|
159
|
-
onClick={() => {
|
|
160
|
-
const pathName = location.href.replace(
|
|
161
|
-
location.origin,
|
|
162
|
-
'',
|
|
163
|
-
);
|
|
164
|
-
window.open(
|
|
165
|
-
`${environment}/publicApiFunctions-redirectToChat/?contextType=bik-widgets&contextId=${props.id}&pathname=${pathName}&sourceUrl=${location.href}`,
|
|
166
|
-
);
|
|
167
|
-
}}
|
|
168
|
-
preview={props.preview}
|
|
169
|
-
/>
|
|
170
|
-
)}
|
|
171
|
-
{messenger && (
|
|
172
|
-
<CtaCard
|
|
173
|
-
id={`bik-bd-${props.id}-cta-messenger`}
|
|
174
|
-
isMobile={props.isMobile}
|
|
175
|
-
Icon={() => (
|
|
176
|
-
<Messenger
|
|
177
|
-
height={
|
|
178
|
-
props.preview ? (props.isMobile ? 20 : 10) : 24
|
|
179
|
-
}
|
|
180
|
-
width={
|
|
181
|
-
props.preview ? (props.isMobile ? 20 : 10) : 24
|
|
182
|
-
}
|
|
183
|
-
/>
|
|
184
|
-
)}
|
|
185
|
-
text={'Open Facebook Messenger'}
|
|
186
|
-
onClick={() => {
|
|
187
|
-
window.open(`https://m.me/${messenger}`);
|
|
188
|
-
}}
|
|
189
|
-
preview={props.preview}
|
|
190
|
-
/>
|
|
191
|
-
)}
|
|
192
|
-
{instagram && (
|
|
193
|
-
<CtaCard
|
|
194
|
-
id={`bik-bd-${props.id}-cta-instagram`}
|
|
195
|
-
isMobile={props.isMobile}
|
|
196
|
-
text={'Open Instagram'}
|
|
197
|
-
Icon={() => (
|
|
198
|
-
<Instagram
|
|
199
|
-
height={
|
|
200
|
-
props.preview ? (props.isMobile ? 20 : 10) : 24
|
|
201
|
-
}
|
|
202
|
-
width={
|
|
203
|
-
props.preview ? (props.isMobile ? 20 : 10) : 24
|
|
204
|
-
}
|
|
205
|
-
/>
|
|
206
|
-
)}
|
|
207
|
-
onClick={() => {
|
|
208
|
-
window.open(`https://www.instagram.com/${instagram}`);
|
|
209
|
-
}}
|
|
210
|
-
preview={props.preview}
|
|
211
|
-
/>
|
|
212
|
-
)}
|
|
213
|
-
{email && (
|
|
214
|
-
<CtaCard
|
|
215
|
-
id={`bik-bd-${props.id}-cta-email`}
|
|
216
|
-
isMobile={props.isMobile}
|
|
217
|
-
Icon={() => (
|
|
218
|
-
<Gmail
|
|
219
|
-
height={
|
|
220
|
-
props.preview ? (props.isMobile ? 20 : 10) : 24
|
|
221
|
-
}
|
|
222
|
-
width={
|
|
223
|
-
props.preview ? (props.isMobile ? 20 : 10) : 24
|
|
224
|
-
}
|
|
225
|
-
/>
|
|
226
|
-
)}
|
|
227
|
-
text={'Open Gmail'}
|
|
228
|
-
onClick={() => {
|
|
229
|
-
window.open(
|
|
230
|
-
`https://mail.google.com/mail/u/0/?fs=1&to=${email}&su=${encodeURIComponent(emailSubject)}&body=${encodeURIComponent(decodeTextHelper(emailBody))}&tf=cm`,
|
|
231
|
-
);
|
|
232
|
-
}}
|
|
233
|
-
preview={props.preview}
|
|
234
|
-
/>
|
|
235
|
-
)}
|
|
236
|
-
{phoneNumber && (
|
|
237
|
-
<CtaCard
|
|
238
|
-
id={`bik-bd-${props.id}-cta-phone`}
|
|
239
|
-
isMobile={props.isMobile}
|
|
240
|
-
Icon={() => (
|
|
241
|
-
<Call
|
|
242
|
-
height={
|
|
243
|
-
props.preview ? (props.isMobile ? 20 : 10) : 24
|
|
244
|
-
}
|
|
245
|
-
width={
|
|
246
|
-
props.preview ? (props.isMobile ? 20 : 10) : 24
|
|
247
|
-
}
|
|
248
|
-
/>
|
|
249
|
-
)}
|
|
250
|
-
text={`Call ${phoneNumber}`}
|
|
251
|
-
onClick={() => {
|
|
252
|
-
window.open(`tel:${phoneNumber}`);
|
|
253
|
-
}}
|
|
254
|
-
preview={props.preview}
|
|
255
|
-
/>
|
|
256
|
-
)}
|
|
257
|
-
<div
|
|
258
|
-
style={{
|
|
259
|
-
justifyContent: 'center',
|
|
260
|
-
alignItems: 'center',
|
|
261
|
-
display: 'flex',
|
|
262
|
-
}}
|
|
263
|
-
>
|
|
264
|
-
<button
|
|
265
|
-
onClick={() =>
|
|
266
|
-
window.open(
|
|
267
|
-
'https://bik.ai/?utm_campaign=Bottom_Drawer&utm_medium=Widgets&utm_source=Powered_by_bik',
|
|
268
|
-
)
|
|
269
|
-
}
|
|
270
|
-
className={currentStyle.poweredByBik}
|
|
271
|
-
>
|
|
272
|
-
{languageUtils.getPoweredByMessage(widgetLanguage)}
|
|
273
|
-
<SVGFactory name={SVGName.BIK} />
|
|
274
|
-
</button>
|
|
275
|
-
</div>
|
|
276
|
-
</div>
|
|
277
|
-
</div>
|
|
278
|
-
</div>
|
|
279
|
-
</div>
|
|
280
|
-
</div>
|
|
281
|
-
</ReactModal>
|
|
282
|
-
</>
|
|
283
|
-
);
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
export default BottomDrawerModal;
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700&display=swap');
|
|
2
|
-
|
|
3
|
-
.widgetContainer {
|
|
4
|
-
width: 100%;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.widgetBody {
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
position: relative;
|
|
10
|
-
border-radius: 8px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.widgetHeader {
|
|
14
|
-
position: absolute;
|
|
15
|
-
border-top-left-radius: 8px;
|
|
16
|
-
border-top-right-radius: 8px;
|
|
17
|
-
width: 100%;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.bannerImage {
|
|
21
|
-
height: 120px;
|
|
22
|
-
border-top-left-radius: 8px;
|
|
23
|
-
border-top-right-radius: 8px;
|
|
24
|
-
width: 100%;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.widgetContent {
|
|
28
|
-
box-sizing: border-box;
|
|
29
|
-
margin: 44px 10px 10px 10px;
|
|
30
|
-
background-color: rgb(255, 255, 255);
|
|
31
|
-
box-shadow: rgb(0 0 0 / 12%) 0px 2px 8px;
|
|
32
|
-
border-radius: 4px;
|
|
33
|
-
position: relative;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.widgetRedirects {
|
|
37
|
-
padding: 4px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.content {
|
|
41
|
-
background-color: white;
|
|
42
|
-
box-shadow: rgb(0 0 0 / 12%) 0px 2px 8px;
|
|
43
|
-
width: 130px;
|
|
44
|
-
border-radius: 8px;
|
|
45
|
-
border-width: 10px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.overlay {
|
|
49
|
-
position: fixed;
|
|
50
|
-
right: 30px;
|
|
51
|
-
bottom: 30px;
|
|
52
|
-
border-radius: 5px;
|
|
53
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
54
|
-
display: flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
justify-content: center;
|
|
57
|
-
z-index: 10;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.crossBtn {
|
|
61
|
-
width: 20px;
|
|
62
|
-
height: 20px;
|
|
63
|
-
pointer-events: none;
|
|
64
|
-
border-radius: 16px;
|
|
65
|
-
display: flex;
|
|
66
|
-
position: absolute;
|
|
67
|
-
justify-content: center;
|
|
68
|
-
align-items: center;
|
|
69
|
-
top: -35px;
|
|
70
|
-
right: 0px;
|
|
71
|
-
border: none;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.bannerImage {
|
|
75
|
-
border-left: 4px;
|
|
76
|
-
border-right: 4px;
|
|
77
|
-
border-top: 4px;
|
|
78
|
-
overflow: hidden;
|
|
79
|
-
width: 300px;
|
|
80
|
-
height: 60px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.title {
|
|
84
|
-
font-family: 'Inter';
|
|
85
|
-
font-style: normal;
|
|
86
|
-
font-weight: 600;
|
|
87
|
-
font-size: 5px;
|
|
88
|
-
line-height: 24px;
|
|
89
|
-
text-align: center;
|
|
90
|
-
font-feature-settings:
|
|
91
|
-
'tnum' on,
|
|
92
|
-
'lnum' on,
|
|
93
|
-
'case' on,
|
|
94
|
-
'ss04' on;
|
|
95
|
-
color: #212121;
|
|
96
|
-
flex: none;
|
|
97
|
-
order: 0;
|
|
98
|
-
flex-grow: 0;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.poweredByBik {
|
|
102
|
-
background: none;
|
|
103
|
-
pointer-events: none;
|
|
104
|
-
font-family: 'Inter';
|
|
105
|
-
font-style: normal;
|
|
106
|
-
font-weight: 400;
|
|
107
|
-
font-size: 5px;
|
|
108
|
-
line-height: 16px;
|
|
109
|
-
font-feature-settings:
|
|
110
|
-
'tnum' on,
|
|
111
|
-
'lnum' on,
|
|
112
|
-
'case' on,
|
|
113
|
-
'ss04' on;
|
|
114
|
-
color: #9e9e9e;
|
|
115
|
-
border: none;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.poweredByBik svg {
|
|
119
|
-
width: 15px;
|
|
120
|
-
height: 15px;
|
|
121
|
-
margin-left: 2px;
|
|
122
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700&display=swap');
|
|
2
|
-
|
|
3
|
-
.widgetContainer {
|
|
4
|
-
width: 100%;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.widgetBody {
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
position: relative;
|
|
10
|
-
border-radius: 8px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.widgetHeader {
|
|
14
|
-
position: absolute;
|
|
15
|
-
border-top-left-radius: 8px;
|
|
16
|
-
border-top-right-radius: 8px;
|
|
17
|
-
width: 100%;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.bannerImage {
|
|
21
|
-
height: 120px;
|
|
22
|
-
border-top-left-radius: 8px;
|
|
23
|
-
border-top-right-radius: 8px;
|
|
24
|
-
width: 100%;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.widgetContent {
|
|
28
|
-
box-sizing: border-box;
|
|
29
|
-
margin: 90px 10px 10px 10px;
|
|
30
|
-
background-color: rgb(255, 255, 255);
|
|
31
|
-
box-shadow: rgb(0 0 0 / 12%) 0px 2px 8px;
|
|
32
|
-
border-radius: 4px;
|
|
33
|
-
position: relative;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.widgetRedirects {
|
|
37
|
-
padding: 10px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.liveChat {
|
|
41
|
-
width: 100%;
|
|
42
|
-
bottom: 0px;
|
|
43
|
-
left: 0px;
|
|
44
|
-
max-width: none;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.content {
|
|
48
|
-
background-color: white;
|
|
49
|
-
box-shadow: rgb(0 0 0 / 12%) 0px 2px 8px;
|
|
50
|
-
width: 100%;
|
|
51
|
-
position: relative;
|
|
52
|
-
border-radius: 8px;
|
|
53
|
-
border-width: 10px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.overlay {
|
|
57
|
-
position: fixed;
|
|
58
|
-
right: 0px;
|
|
59
|
-
bottom: 0px;
|
|
60
|
-
width: 100%;
|
|
61
|
-
border-radius: 5px;
|
|
62
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
63
|
-
display: flex;
|
|
64
|
-
align-items: center;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
z-index: 10;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.crossBtn {
|
|
70
|
-
width: 20px;
|
|
71
|
-
height: 20px;
|
|
72
|
-
border-radius: 16px;
|
|
73
|
-
display: flex;
|
|
74
|
-
pointer-events: none;
|
|
75
|
-
padding: 4px;
|
|
76
|
-
position: absolute;
|
|
77
|
-
justify-content: center;
|
|
78
|
-
align-items: center;
|
|
79
|
-
top: -20%;
|
|
80
|
-
left: 50%;
|
|
81
|
-
border: none;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.title {
|
|
85
|
-
font-family: 'Inter';
|
|
86
|
-
font-style: normal;
|
|
87
|
-
font-weight: 600;
|
|
88
|
-
font-size: 8px;
|
|
89
|
-
padding: 10px;
|
|
90
|
-
line-height: 24px;
|
|
91
|
-
text-align: center;
|
|
92
|
-
font-feature-settings:
|
|
93
|
-
'tnum' on,
|
|
94
|
-
'lnum' on,
|
|
95
|
-
'case' on,
|
|
96
|
-
'ss04' on;
|
|
97
|
-
color: #212121;
|
|
98
|
-
flex: none;
|
|
99
|
-
order: 0;
|
|
100
|
-
flex-grow: 0;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.poweredByBik {
|
|
104
|
-
pointer-events: none;
|
|
105
|
-
background: none;
|
|
106
|
-
font-family: 'Inter';
|
|
107
|
-
font-style: normal;
|
|
108
|
-
font-weight: 400;
|
|
109
|
-
font-size: 8px;
|
|
110
|
-
line-height: 16px;
|
|
111
|
-
font-feature-settings:
|
|
112
|
-
'tnum' on,
|
|
113
|
-
'lnum' on,
|
|
114
|
-
'case' on,
|
|
115
|
-
'ss04' on;
|
|
116
|
-
color: #9e9e9e;
|
|
117
|
-
border: none;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.poweredByBik svg {
|
|
121
|
-
width: 15px;
|
|
122
|
-
height: 15px;
|
|
123
|
-
margin-left: 2px;
|
|
124
|
-
}
|