@bikdotai/bik-component-library 0.0.533-beta.17 → 0.0.533-beta.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/cjs/assets/{bundle-c485438b.css → bundle-0deb4a74.css} +2 -325
- package/dist/cjs/assets/icons/emoji.svg.js +1 -1
- package/dist/cjs/assets/icons/halfRectangle.svg.js +1 -1
- package/dist/cjs/assets/icons/strikeThrough.svg.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/SingleDate.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/TwoDate.js +1 -1
- package/dist/cjs/components/SearchFilter/components/DatePickerButton.js +1 -1
- package/dist/cjs/components/SearchFilter/components/DateRangeOnlyButton.js +1 -1
- package/dist/cjs/components/TypographyStyle.d.ts +0 -24
- package/dist/cjs/components/TypographyStyle.js +14 -74
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.d.ts +0 -4
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.d.ts +0 -7
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.d.ts +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsMetric.d.ts +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsMetric.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsMultiChip.d.ts +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/CommonStyles.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +0 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.styled.d.ts +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.styled.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js +1 -1
- package/dist/cjs/components/bik-layout/BikSidebar.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -20
- package/dist/cjs/components/bik-layout/SidebarStyles.js +1 -1
- package/dist/cjs/components/card-selector/CardSelector.d.ts +0 -1
- package/dist/cjs/components/card-selector/CardSelector.js +1 -1
- package/dist/cjs/components/card-selector/CardSelectorGroup.js +1 -1
- package/dist/cjs/components/carousel-preview/CarouselPreview.d.ts +1 -4
- package/dist/cjs/components/carousel-preview/CarouselPreview.js +1 -1
- package/dist/cjs/components/carousel-preview/CarouselPreview.style.d.ts +2 -4
- package/dist/cjs/components/carousel-preview/CarouselPreview.style.js +27 -56
- package/dist/cjs/components/carousel-preview/CarouselPreviewCard.js +1 -1
- package/dist/cjs/components/checkBox/CheckBox.d.ts +0 -4
- package/dist/cjs/components/checkBox/CheckBox.js +1 -1
- package/dist/cjs/components/checkBox/CheckBox.styled.d.ts +0 -1
- package/dist/cjs/components/checkBox/CheckBox.styled.js +3 -4
- package/dist/cjs/components/checkList/CheckList.d.ts +0 -1
- package/dist/cjs/components/checkList/CheckList.js +1 -1
- package/dist/cjs/components/custom-date-time/DateSelector/DateSelector.js +1 -1
- package/dist/cjs/components/datePicker/DatePickerWrapper.d.ts +2 -1
- package/dist/cjs/components/datePicker/DatePickerWrapper.js +1 -1
- package/dist/cjs/components/datePicker/index.d.ts +0 -1
- package/dist/cjs/components/discount-modal/DiscountUtils.js +1 -1
- package/dist/cjs/components/dropdown/Dropdown.js +1 -1
- package/dist/cjs/components/dropdown/DropdownPopover/index.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.d.ts +0 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +1 -1
- package/dist/cjs/components/dropdown/type.d.ts +0 -3
- package/dist/cjs/components/dynamic-tabs/DynamicTabs.d.ts +0 -2
- package/dist/cjs/components/dynamic-tabs/DynamicTabs.js +1 -1
- package/dist/cjs/components/floater/floater.js +1 -1
- package/dist/cjs/components/icon-button/IconButton.js +1 -1
- package/dist/cjs/components/icon-button/model.d.ts +0 -5
- package/dist/cjs/components/input/Input.d.ts +0 -2
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/input/Input.styled.d.ts +0 -2
- package/dist/cjs/components/input/Input.styled.js +1 -1
- package/dist/cjs/components/input-with-vars/InputWithVariables.d.ts +1 -6
- package/dist/cjs/components/input-with-vars/InputWithVariables.js +2 -2
- package/dist/cjs/components/list-item/ListItem.d.ts +1 -1
- package/dist/cjs/components/list-item/themes.js +1 -1
- package/dist/cjs/components/plans/NewSubscriptionPlan.js +1 -1
- package/dist/cjs/components/plans/SubscriptionPlan.d.ts +0 -1
- package/dist/cjs/components/radioButton/RadioButton.d.ts +0 -3
- package/dist/cjs/components/radioButton/RadioButton.js +1 -1
- package/dist/cjs/components/radioList/RadioList.d.ts +0 -1
- package/dist/cjs/components/radioList/RadioList.js +1 -1
- package/dist/cjs/components/spinner/Spinner.d.ts +0 -6
- package/dist/cjs/components/spinner/Spinner.js +1 -18
- package/dist/cjs/components/states/StateComponent.d.ts +0 -2
- package/dist/cjs/components/states/StateComponent.js +1 -1
- package/dist/cjs/components/states/StateComponent.styled.d.ts +1 -4
- package/dist/cjs/components/states/StateComponent.styled.js +6 -6
- package/dist/cjs/components/states-modal/StateModalComponent.d.ts +0 -2
- package/dist/cjs/components/states-modal/StateModalComponent.js +1 -1
- package/dist/cjs/components/stepper/Stepper.d.ts +0 -2
- package/dist/cjs/components/stepper/Stepper.js +1 -1
- package/dist/cjs/components/stepper/Stepper.styled.d.ts +0 -1
- package/dist/cjs/components/stepper/Stepper.styled.js +7 -7
- package/dist/cjs/components/tabs/Tabs.js +1 -1
- package/dist/cjs/components/tabs/Tabs.model.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +1 -0
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +1 -12
- package/dist/cjs/components/template-context-mapper/context/templateModalContext.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/BackTrackComponent.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/Body.js +7 -11
- package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditMediaV2.style.js +1 -0
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +2 -2
- package/dist/cjs/components/template-context-mapper/modalElements/Footer.js +5 -5
- package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +3 -5
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +3 -3
- package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/useEditWhtasappTemplateMedia.js +1 -1
- package/dist/cjs/components/template-preview/EmailTemplatePreview.styled.js +14 -16
- package/dist/cjs/components/template-preview/SmsTemplatePreview.d.ts +0 -1
- package/dist/cjs/components/template-preview/SmsTemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.js +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.d.ts +0 -5
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.js +8 -14
- package/dist/cjs/components/template-preview/WhatsApp/ChatUiV2.js +2 -2
- package/dist/cjs/components/template-preview/WhatsApp/MediaCard.js +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +5 -6
- package/dist/cjs/components/template-preview/helpers/SmsTemplateHelper.d.ts +1 -1
- package/dist/cjs/components/template-preview/helpers/SmsTemplateHelper.js +1 -1
- package/dist/cjs/components/template-preview/models/SmsTemplate.d.ts +0 -1
- package/dist/cjs/components/tooltips/TooltipInternal.d.ts +1 -1
- package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
- package/dist/cjs/components/variable-picker-v3/SubHeaderItems.js +1 -1
- package/dist/cjs/components/variable-picker-v3/recommendVaribles.js +1 -1
- package/dist/cjs/components/variable-picker-v3/searchVariables.js +1 -1
- package/dist/cjs/components/variable-picker-v3/styles.js +2 -4
- package/dist/cjs/hooks/useOutside.d.ts +1 -1
- package/dist/cjs/hooks/useOutside.js +1 -1
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.js +1 -1
- package/dist/esm/assets/{bundle-c485438b.css → bundle-0deb4a74.css} +2 -325
- package/dist/esm/assets/icons/emoji.svg.js +1 -1
- package/dist/esm/assets/icons/halfRectangle.svg.js +1 -1
- package/dist/esm/assets/icons/strikeThrough.svg.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/SingleDate.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/TwoDate.js +1 -1
- package/dist/esm/components/SearchFilter/components/DatePickerButton.js +1 -1
- package/dist/esm/components/SearchFilter/components/DateRangeOnlyButton.js +1 -1
- package/dist/esm/components/TypographyStyle.d.ts +0 -24
- package/dist/esm/components/TypographyStyle.js +17 -77
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.d.ts +0 -4
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.d.ts +0 -7
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.d.ts +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsMetric.d.ts +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsMetric.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsMultiChip.d.ts +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/CommonStyles.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +0 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.styled.d.ts +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.styled.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js +1 -1
- package/dist/esm/components/bik-layout/BikSidebar.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -20
- package/dist/esm/components/bik-layout/SidebarStyles.js +1 -1
- package/dist/esm/components/card-selector/CardSelector.d.ts +0 -1
- package/dist/esm/components/card-selector/CardSelector.js +1 -1
- package/dist/esm/components/card-selector/CardSelectorGroup.js +1 -1
- package/dist/esm/components/carousel-preview/CarouselPreview.d.ts +1 -4
- package/dist/esm/components/carousel-preview/CarouselPreview.js +1 -1
- package/dist/esm/components/carousel-preview/CarouselPreview.style.d.ts +2 -4
- package/dist/esm/components/carousel-preview/CarouselPreview.style.js +27 -56
- package/dist/esm/components/carousel-preview/CarouselPreviewCard.js +1 -1
- package/dist/esm/components/checkBox/CheckBox.d.ts +0 -4
- package/dist/esm/components/checkBox/CheckBox.js +1 -1
- package/dist/esm/components/checkBox/CheckBox.styled.d.ts +0 -1
- package/dist/esm/components/checkBox/CheckBox.styled.js +5 -6
- package/dist/esm/components/checkList/CheckList.d.ts +0 -1
- package/dist/esm/components/checkList/CheckList.js +1 -1
- package/dist/esm/components/custom-date-time/DateSelector/DateSelector.js +1 -1
- package/dist/esm/components/datePicker/DatePickerWrapper.d.ts +2 -1
- package/dist/esm/components/datePicker/DatePickerWrapper.js +1 -1
- package/dist/esm/components/datePicker/index.d.ts +0 -1
- package/dist/esm/components/discount-modal/DiscountUtils.js +1 -1
- package/dist/esm/components/dropdown/Dropdown.js +1 -1
- package/dist/esm/components/dropdown/DropdownPopover/index.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.d.ts +0 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +1 -1
- package/dist/esm/components/dropdown/type.d.ts +0 -3
- package/dist/esm/components/dynamic-tabs/DynamicTabs.d.ts +0 -2
- package/dist/esm/components/dynamic-tabs/DynamicTabs.js +1 -1
- package/dist/esm/components/floater/floater.js +1 -1
- package/dist/esm/components/icon-button/IconButton.js +1 -1
- package/dist/esm/components/icon-button/model.d.ts +0 -5
- package/dist/esm/components/input/Input.d.ts +0 -2
- package/dist/esm/components/input/Input.js +1 -1
- package/dist/esm/components/input/Input.styled.d.ts +0 -2
- package/dist/esm/components/input/Input.styled.js +1 -1
- package/dist/esm/components/input-with-vars/InputWithVariables.d.ts +1 -6
- package/dist/esm/components/input-with-vars/InputWithVariables.js +2 -2
- package/dist/esm/components/list-item/ListItem.d.ts +1 -1
- package/dist/esm/components/list-item/themes.js +1 -1
- package/dist/esm/components/plans/NewSubscriptionPlan.js +1 -1
- package/dist/esm/components/plans/SubscriptionPlan.d.ts +0 -1
- package/dist/esm/components/radioButton/RadioButton.d.ts +0 -3
- package/dist/esm/components/radioButton/RadioButton.js +1 -1
- package/dist/esm/components/radioList/RadioList.d.ts +0 -1
- package/dist/esm/components/radioList/RadioList.js +1 -1
- package/dist/esm/components/spinner/Spinner.d.ts +0 -6
- package/dist/esm/components/spinner/Spinner.js +1 -18
- package/dist/esm/components/states/StateComponent.d.ts +0 -2
- package/dist/esm/components/states/StateComponent.js +1 -1
- package/dist/esm/components/states/StateComponent.styled.d.ts +1 -4
- package/dist/esm/components/states/StateComponent.styled.js +6 -6
- package/dist/esm/components/states-modal/StateModalComponent.d.ts +0 -2
- package/dist/esm/components/states-modal/StateModalComponent.js +1 -1
- package/dist/esm/components/stepper/Stepper.d.ts +0 -2
- package/dist/esm/components/stepper/Stepper.js +1 -1
- package/dist/esm/components/stepper/Stepper.styled.d.ts +0 -1
- package/dist/esm/components/stepper/Stepper.styled.js +6 -6
- package/dist/esm/components/tabs/Tabs.js +1 -1
- package/dist/esm/components/tabs/Tabs.model.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +1 -0
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +1 -12
- package/dist/esm/components/template-context-mapper/context/templateModalContext.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/BackTrackComponent.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/Body.js +7 -11
- package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditMediaV2.style.js +1 -0
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/Footer.js +5 -5
- package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +1 -3
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +2 -2
- package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/useEditWhtasappTemplateMedia.js +1 -1
- package/dist/esm/components/template-preview/EmailTemplatePreview.styled.js +0 -2
- package/dist/esm/components/template-preview/SmsTemplatePreview.d.ts +0 -1
- package/dist/esm/components/template-preview/SmsTemplatePreview.js +1 -1
- package/dist/esm/components/template-preview/TemplatePreview.js +1 -1
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.js +2 -2
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.d.ts +0 -5
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.js +17 -23
- package/dist/esm/components/template-preview/WhatsApp/ChatUiV2.js +5 -5
- package/dist/esm/components/template-preview/WhatsApp/MediaCard.js +1 -1
- package/dist/esm/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +5 -6
- package/dist/esm/components/template-preview/helpers/SmsTemplateHelper.d.ts +1 -1
- package/dist/esm/components/template-preview/helpers/SmsTemplateHelper.js +1 -1
- package/dist/esm/components/template-preview/models/SmsTemplate.d.ts +0 -1
- package/dist/esm/components/tooltips/TooltipInternal.d.ts +1 -1
- package/dist/esm/components/variable-picker-v3/Content.js +1 -1
- package/dist/esm/components/variable-picker-v3/SubHeaderItems.js +1 -1
- package/dist/esm/components/variable-picker-v3/recommendVaribles.js +1 -1
- package/dist/esm/components/variable-picker-v3/searchVariables.js +1 -1
- package/dist/esm/components/variable-picker-v3/styles.js +4 -6
- package/dist/esm/hooks/useOutside.d.ts +1 -1
- package/dist/esm/hooks/useOutside.js +1 -1
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.js +1 -1
- package/package.json +2 -4
- package/dist/cjs/assets/icons/chat-channel.svg.js +0 -1
- package/dist/cjs/assets/icons/email-channel.svg.js +0 -1
- package/dist/cjs/assets/icons/instagram-channel.svg.js +0 -1
- package/dist/cjs/assets/icons/similar.svg.js +0 -1
- package/dist/cjs/assets/icons/whatsapp-channel.svg.js +0 -1
- package/dist/cjs/components/action-button/ActionButton.styled.d.ts +0 -7
- package/dist/cjs/components/action-button/ActionButton.styled.js +0 -23
- package/dist/cjs/components/action-button/ActionButtons.d.ts +0 -10
- package/dist/cjs/components/action-button/ActionButtons.js +0 -1
- package/dist/cjs/components/action-button/index.d.ts +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChipChannelFooter.d.ts +0 -4
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChipChannelFooter.js +0 -1
- package/dist/cjs/components/carousel-preview/CustomCarouselArrows.d.ts +0 -7
- package/dist/cjs/components/carousel-preview/CustomCarouselArrows.js +0 -1
- package/dist/cjs/components/input-with-vars/customPortal.d.ts +0 -8
- package/dist/cjs/components/input-with-vars/customPortal.js +0 -1
- package/dist/cjs/components/progress-bar-v2/ProgressBarV2.d.ts +0 -21
- package/dist/cjs/components/progress-bar-v2/ProgressBarV2.js +0 -1
- package/dist/cjs/components/progress-bar-v2/index.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/utils/constants.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/utils/constants.js +0 -1
- package/dist/esm/assets/icons/chat-channel.svg.js +0 -1
- package/dist/esm/assets/icons/email-channel.svg.js +0 -1
- package/dist/esm/assets/icons/instagram-channel.svg.js +0 -1
- package/dist/esm/assets/icons/similar.svg.js +0 -1
- package/dist/esm/assets/icons/whatsapp-channel.svg.js +0 -1
- package/dist/esm/components/action-button/ActionButton.styled.d.ts +0 -7
- package/dist/esm/components/action-button/ActionButton.styled.js +0 -23
- package/dist/esm/components/action-button/ActionButtons.d.ts +0 -10
- package/dist/esm/components/action-button/ActionButtons.js +0 -1
- package/dist/esm/components/action-button/index.d.ts +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChipChannelFooter.d.ts +0 -4
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChipChannelFooter.js +0 -1
- package/dist/esm/components/carousel-preview/CustomCarouselArrows.d.ts +0 -7
- package/dist/esm/components/carousel-preview/CustomCarouselArrows.js +0 -1
- package/dist/esm/components/input-with-vars/customPortal.d.ts +0 -8
- package/dist/esm/components/input-with-vars/customPortal.js +0 -1
- package/dist/esm/components/progress-bar-v2/ProgressBarV2.d.ts +0 -21
- package/dist/esm/components/progress-bar-v2/ProgressBarV2.js +0 -1
- package/dist/esm/components/progress-bar-v2/index.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/utils/constants.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/utils/constants.js +0 -1
package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/arrow_back.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/arrow_back.svg.js"),r=require("../../../assets/icons/PlusIcon.js"),l=require("lodash"),a=require("react"),i=require("../../button/Button.js"),n=require("../../icon-button/IconButton.js"),o=require("../../product-picker-v2/modal.js"),s=require("../Badge/index.js"),d=require("../context/templateModalContext.js"),c=require("./EditWhatsAppTemplateV2.js"),u=require("./ProductBox.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var p=require("../../../constants/Theme.js");require("../../curtain/CurtainHelper.js"),require("../../variable-picker-v3/model.js"),require("../../template-preview/models/TemplateMeta.js");var m=require("../../template-preview/models/WhatsAppTemplate.js"),h=require("../../TypographyStyle.js");exports.default=g=>{let{template:v,whatsappSpecificPickerMeta:x,showVariableModal:j,variableListForImage:y,discountCode:f,setDiscountCode:b}=g;var C,O;const{selectedCarouselIndex:I,setTemplate:P,pickerConf:q,isProductCarouselType:w,pod:S,cardCount:k,carouselProducts:T,setCarouselProducts:B,isError:L,cardImages:E,disableEditVariable:M,onDeleteSelectedProducts:R,setSelectedCarouselIndex:A,setVariableCallback:D,setShowVariablePicker:F}=d.useTemplateModalContext(),[V,W]=a.useState(-1==I?"First Message (Step 1/2)":w?"Product Carousel (Step 2/2)":"Carousel Cards (Step 2/2)"),[N,_]=a.useState(!1),[$,z]=a.useState(!1);a.useEffect((()=>{W(-1==I?"First Message (Step 1/2)":w?"Product Carousel (Step 2/2)":"Carousel Cards (Step 2/2)")}),[I]);const G=e=>{null==B||B([{name:"variable",productName:e.actualValue}])};return e.jsxs("div",{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:24}},{children:[null!=I&&I>=0&&e.jsx(n.IconButton,{Icon:t.default,onClick:()=>{null==A||A(-1)}}),e.jsx(h.TitleMedium,Object.assign({style:{marginLeft:10}},{children:V}))]})),w&&(null!==(C=null==T?void 0:T.length)&&void 0!==C?C:0)>0&&null!=I&&I>=0&&e.jsxs("div",Object.assign({style:{display:"flex",rowGap:16,marginBottom:16,marginLeft:10,marginRight:10,flexDirection:"column"}},{children:[e.jsx(u.ProductBox,{editItem:()=>{1===(null==T?void 0:T.length)&&"variable"===T[0].name?(D((()=>G)),F(!0)):_(!N)},cardBody:1===(null==T?void 0:T.length)&&"variable"===T[0].name?`${T[0].productName}`:`${null==T?void 0:T.length} Products Selected`,hideIcon:1===(null==T?void 0:T.length)&&"variable"===T[0].name,deleteItem:()=>{var e;if(1===(null==T?void 0:T.length)&&"variable"===T[0].name)return void(null==B||B([]));const t=l.cloneDeep(Object.assign({},v));t&&(E&&E.length>0?null==E||E.forEach(((e,r)=>{var l;t.components[1].cards[r].components[0].example.header_handle=[null!==(l=E[r])&&void 0!==l?l:"https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})):null===(e=null==t?void 0:t.components[1].cards)||void 0===e||e.forEach(((e,r)=>{t.components[1].cards[r].components[0].example.header_handle=["https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})),null==P||P(t)),null==B||B([]),null==R||R()}}),T&&(null==T?void 0:T.length)>0&&"variable"!=T[0].name&&e.jsx(i.Button,{disabled:(null!==(O=null==T?void 0:T.length)&&void 0!==O?O:0)<=1,style:{alignSelf:"flex-end"},onClick:()=>{z(!0),_(!0)},buttonText:"Rearrange Products",buttonType:"tertiary"})]})),!M&&w&&0===(null==T?void 0:T.length)&&null!=I&&I>=0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{marginLeft:12}},{children:[e.jsx(h.TitleRegular,{children:"Product(s)"}),e.jsx(h.BodySecondary,{children:`Select ${null!=k?k:1} products`})]})),e.jsxs("div",Object.assign({style:{marginTop:16,marginBottom:16,marginLeft:L?16:12,marginRight:L?16:12,flexDirection:"column",display:"flex",alignItems:"center"}},{children:[e.jsx(i.Button,{matchParentWidth:!0,style:{flex:1,display:"flex",width:"100%",marginBottom:12,border:L?`2px dashed ${p.COLORS.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s)",buttonType:L?"tertiaryGray":"dashBold",LeadingIcon:()=>e.jsx("div",Object.assign({style:{display:"flex",width:18,height:18}},{children:e.jsx(r.default,{width:18,height:18,color:p.COLORS.content.secondary})})),onClick:e=>{_(!0)}}),S===m.POD.CHATBOT&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",flexDirection:"row",width:"100%"}},{children:[e.jsx("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginRight:8}}),e.jsx(h.BodyCaption,Object.assign({style:{color:"#616161",overflow:"unset"}},{children:"OR"})),e.jsx("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginLeft:8}})]})),e.jsx(i.Button,{matchParentWidth:!0,style:{flex:1,display:"flex",marginTop:12,width:"100%",border:L?`2px dashed ${p.COLORS.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s) Variable",buttonType:L?"tertiaryGray":"dashBold",LeadingIcon:()=>e.jsx("div",Object.assign({style:{display:"flex"}},{children:e.jsx(r.default,{width:18,height:18,color:p.COLORS.content.secondary})})),onClick:e=>{D((()=>G)),F(!0)}})]})]})),L&&e.jsx("div",Object.assign({style:{marginLeft:10,marginBottom:16}},{children:e.jsx(s.Badge,{padding:"8px",errorText:"Please add products"})}))]}),e.jsx(c.default,{whatsappSpecificPickerMeta:x,template:v,onTemplateChange:e=>{null==P||P(e)},showVariableModal:j,variableListForImage:y,discountCode:f,setDiscountCode:b}),N&&q&&e.jsx(o.ProductPickerModal,{zIndex:200,startupScreen:$?o.ScreenName.RearrangeProducts:o.ScreenName.Collections,rearrangeEnabled:!0,storeId:q.storeId,selectedItems:(e=>{if(e.length>0){const t={};for(const r of e){const e=null==r?void 0:r.collectionId,l=r.productId,a=r.variantId;e in t||(t[e]={products:{},name:"",image:"",isSmartCollection:!1}),l in t[e].products||(t[e].products[l]={variants:{},name:(null==r?void 0:r.productName)||"",image:(null==r?void 0:r.productImage)||""}),t[e].products[l].variants[a]={name:(null==r?void 0:r.name)||"",price:"",image:(null==r?void 0:r.image)||"",quantity:r.quantity||0,displayOrder:r.displayOrder}}return t}return{}})(null!=T?T:[]),collectionFetcher:q.fetchCollections,productFetcher:q.fetchProducts,onAdd:(e,t)=>{var r,a,i,n,o,s;z(!1);const d=[];delete e.isCustom;for(const t of Object.keys(e)){const l=e[t].products;if(void 0!==l&&Object.keys(l).length)for(const e of Object.keys(l)){const c=l[e].variants;if(void 0!==c&&Object.keys(c).length)for(const u of Object.keys(c)){const{name:p,image:m,quantity:h,displayOrder:g}=c[u],v={name:p,image:null!==(a=null!=m?m:null===(r=l[e])||void 0===r?void 0:r.image)&&void 0!==a?a:"",quantity:h,variantId:u,productId:e,displayOrder:g,collectionId:t,productName:null!==(n=null===(i=l[e])||void 0===i?void 0:i.name)&&void 0!==n?n:"",productImage:null!==(s=null===(o=l[e])||void 0===o?void 0:o.image)&&void 0!==s?s:""};d.push(v)}}}const c=d.sort(((e,t)=>e.displayOrder-t.displayOrder)),u=d.map((e=>e.image)),p=l.cloneDeep(Object.assign({},v));p&&(u.forEach(((e,t)=>{var r;p.components[1].cards[t].components[0].example.header_handle=e?[e]:[null!==(r=null==E?void 0:E[t])&&void 0!==r?r:""]})),null==P||P(p)),null==B||B(c),_(!1)},searchInCollectionFetcher:q.searchInCollection,searchFetcher:q.searchProducts,visible:N,onClose:()=>{_(!1)},exactLimit:null!=k?k:1})]})};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("lodash"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("lodash"),t=require("react"),o=require("styled-components"),i=require("../../input/Input.js"),l=require("../../template-preview/models/TemplateMeta.js"),a=require("../../template-preview/models/WhatsAppTemplate.js"),s=require("../context/templateModalContext.js"),d=require("../utils/getDataFromTemplateComponent.js"),u=require("../utils/validateIsUrl.js"),r=require("../utils/validateName.js"),p=require("./BackTrackComponent.js"),c=require("./DiscountCodeComponent.js"),v=require("./EditMediaModal.js"),m=require("./EditMediaV2.js"),b=require("./EditMediaV2.style.js"),g=require("./useEditWhtasappTemplateMedia.js"),f=require("./VariableConnector.js"),j=require("./VariableConnectorsPanel.js"),h=require("./VariableConnectorWhatsApp.js"),O=require("./VariableEditorHeader.js"),C=require("./WhatsAppTemplateCardButtonV2.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const T=x(o).default.div`
|
|
2
2
|
padding-top: 24px;
|
|
3
3
|
padding-left: 10px;
|
|
4
4
|
padding-right: 10px;
|
|
5
5
|
margin-bottom: 8px;
|
|
6
6
|
line-height: normal;
|
|
7
|
-
`;exports.default=t=>{let{template:x,onTemplateChange:y,whatsappSpecificPickerMeta:E,showVariableModal:V,variableListForImage:B,setDiscountCode:k,fileName:M,setFileName:q}=t;var I,D,R,L,U,P,w,A,N,S,_,F,H,Q,Y,K,W,$,G,X,z,J,Z,ee,ne,oe,te,ie,le,ae,se,de,ue,re,pe,ce,ve,me,be;const ge=x.isCarouselType,{originalVariableList:fe,pod:he,extras:je,selectedCarouselIndex:Oe,isProductCarouselType:Ce}=s.useTemplateModalContext(),{descriptionComponents:xe,urlBtns:Te,qrbBtns:ye,imageComponent:Ee,bodyVariables:Ve,headerVariables:Be}=d.getAllDataFromTemplateComponent(x),ke=o.useRef(null),[Me,qe]=o.useState(!1),[Ie,De]=o.useState(-1===Oe?{descriptionComponents:xe,urlBtns:Te,qrbBtns:ye,imageComponent:Ee,bodyVariables:Ve,headerVariables:Be}:{}),{uploadMediaLink:Re,uploadMediaFiles:Le}=E,Ue=g.useEditWhatsappTemplateMedia({uploadMediaLink:Re,uploadMediaFiles:Le,updateTemplateImageUrl:function(e,o){var t,i,l,a,s,d,u,r;let p;p=null!=Oe&&Oe>-1?{components:null===(i=null===(t=x.components[1])||void 0===t?void 0:t.cards)||void 0===i?void 0:i[Oe].components,mapping:null===(a=null===(l=null==x?void 0:x.mapping)||void 0===l?void 0:l.cards)||void 0===a?void 0:a[Oe]}:Object.assign({},x);const c=null===(s=null==p?void 0:p.components)||void 0===s?void 0:s.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==c&&c>-1&&(null==p?void 0:p.components[c])){const n=Object.assign(Object.assign({},p.components[c]),{format:o,example:{header_handle:[e]}}),t=[...p.components];t[c]=n,p=Object.assign(Object.assign({},p),{components:t})}p.mapping&&(p.mapping=Object.assign(Object.assign({},p.mapping),{header:void 0}));if(null!=Oe&&Oe>-1){const e=n.cloneDeep(x);e.components[1].cards[Oe].components=p.components,(null===(d=null==e?void 0:e.mapping)||void 0===d?void 0:d.cards)&&(null===(u=null==e?void 0:e.mapping)||void 0===u?void 0:u.cards.length)>0&&(e.mapping.cards[Oe]=null!==(r=p.mapping)&&void 0!==r?r:{}),null==y||y(Object.assign({},e)),we(!0)}else null==y||y(Object.assign({},p))},mediaComponent:ge?Ie.imageComponent:Ee,fileRef:ke}),[Pe,we]=o.useState(!1),[Ae,Ne]=o.useState(M),[Se,_e]=o.useState();function Fe(e,o,t){var i,l,a,s,d,u,r,p,c,v;const m=null!=Oe&&Oe>-1?{components:null===(i=Object.assign({},x).components[1].cards)||void 0===i?void 0:i[Oe].components,mapping:null===(l=Object.assign({},x).mapping.cards)||void 0===l?void 0:l[Oe]}:Object.assign({},x),b=n.cloneDeep(m),g="custom"===o&&"string"==typeof e,f=g?e:"string"!=typeof e?e.defaultValue?e.defaultValue:"https://d.bik.ai/":"https://d.bik.ai";if(null!=Oe&&Oe>-1&&Ce){const o=Object.assign({},x).components.map((e=>{var n;return"CAROUSEL"===e.type?Object.assign(Object.assign({},e),{cards:null===(n=e.cards)||void 0===n?void 0:n.map((e=>Object.assign(Object.assign({},e),{components:e.components.map((e=>{var n,o,i;if("BUTTONS"===e.type){const l=null===(n=e.buttons)||void 0===n?void 0:n.filter((e=>"URL"===e.type));let a=null!==(o=null==l?void 0:l[t])&&void 0!==o?o:{};a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[f]});const s=null===(i=e.buttons)||void 0===i?void 0:i.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e));return Object.assign(Object.assign({},e),{buttons:s})}return e}))})))}):e})),i=null===(s=null===(a=Object.assign({},x).mapping)||void 0===a?void 0:a.cards)||void 0===s?void 0:s.map((n=>{var o;return Object.assign(Object.assign({},n),{buttons:null===(o=null==n?void 0:n.buttons)||void 0===o?void 0:o.map((n=>g?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:""))})})),l=n.cloneDeep(x);return l.components=o,l.mapping.cards=i,void(null==y||y(Object.assign({},l)))}const h=null==b?void 0:b.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==h&&h>-1){const n=null===(d=null==b?void 0:b.components[h].buttons)||void 0===d?void 0:d.filter((e=>"URL"===e.type));if((null==n?void 0:n.length)>0){const i="custom"===o&&"string"==typeof e,l=i?e:"string"!=typeof e&&e.defaultValue?e.defaultValue:"https://d.bik.ai/";let a=n[t];a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[l]});const s=[...null!==(p=null===(r=null===(u=b.components)||void 0===u?void 0:u[h])||void 0===r?void 0:r.buttons)&&void 0!==p?p:[]].map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e)),d=Object.assign(Object.assign({},b.components[h]),{buttons:s}),v=null===(c=b.mapping)||void 0===c?void 0:c.buttons;v&&v.length>0&&(v[t]=i?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"");const m=Object.assign(Object.assign({},b.mapping),{buttons:v});b.mapping=m;const g=[...b.components];g[h]=d,b.components=g}}if("string"!=typeof e){"checkout.checkoutUrl"===(null===(v=e.placeHolder)||void 0===v?void 0:v.slice(2,-2))?qe(!0):(qe(!1),null==k||k(""))}if(null!=Oe&&Oe>-1){const e=n.cloneDeep(x);e.components[1].cards[Oe].components=b.components,e.mapping.cards[Oe]=b.mapping,null==y||y(Object.assign({},e))}else null==y||y(b)}function He(e,o,t){var i,l,a,s,d,u,r;const p=null!=Oe&&Oe>-1?{components:null===(i=Object.assign({},x).components[1].cards)||void 0===i?void 0:i[Oe].components,mapping:null===(l=Object.assign({},x).mapping.cards)||void 0===l?void 0:l[Oe]}:Object.assign({},x);if(null!=Oe&&Oe>-1&&Ce){const o=Object.assign({},x).components.map((n=>{var o;return"CAROUSEL"===n.type?Object.assign(Object.assign({},n),{cards:null===(o=n.cards)||void 0===o?void 0:o.map((n=>Object.assign(Object.assign({},n),{components:n.components.map((n=>{var o,i,l;if("BUTTONS"===n.type){const a=null===(o=null==n?void 0:n.buttons)||void 0===o?void 0:o.filter((e=>"QUICK_REPLY"===e.type));let s=null!==(i=null==a?void 0:a[t])&&void 0!==i?i:{};s=Object.assign(Object.assign({},s),{flowId:e.flowId,flowName:e.flowName});const d=null===(l=null==n?void 0:n.buttons)||void 0===l?void 0:l.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==s?void 0:s.text)?s:e));return Object.assign(Object.assign({},n),{buttons:d})}return n}))})))}):n})),i=n.cloneDeep(x);return i.components=o,void(null==y||y(Object.assign({},i)))}const c=null==p?void 0:p.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==c&&c>-1){const n=null===(s=null===(a=null==p?void 0:p.components[c])||void 0===a?void 0:a.buttons)||void 0===s?void 0:s.filter((e=>"QUICK_REPLY"===e.type));if(n){let o=n[t];o=Object.assign(Object.assign({},o),{flowId:e.flowId,flowName:e.flowName});const i=[...null!==(r=null===(u=null===(d=p.components)||void 0===d?void 0:d[c])||void 0===u?void 0:u.buttons)&&void 0!==r?r:[]].map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==o?void 0:o.text)?o:e)),l=Object.assign(Object.assign({},p.components[c]),{buttons:i}),a=[...p.components];a[c]=l,p.components=a}}if(null!=Oe&&Oe>-1){const e=n.cloneDeep(x);e.components[1].cards[Oe].components=p.components,null==y||y(Object.assign({},e))}else null==y||y(p)}o.useEffect((()=>{var e,n;if(null===(e=x.mapping.buttons)||void 0===e?void 0:e.find((e=>"checkout.checkoutUrl"===e.slice(2,-2))))qe(!0);else{qe(!1);const e=null===(n=null==je?void 0:je.discountCodeExtra)||void 0===n?void 0:n[1];null==e||e("")}}),[x]),o.useEffect((()=>{var e,n,o,t;if(null!=Oe&&Oe>-1){const i={components:null===(n=null===(e=x.components[1])||void 0===e?void 0:e.cards)||void 0===n?void 0:n[Oe].components,mapping:null===(t=null===(o=null==x?void 0:x.mapping)||void 0===o?void 0:o.cards)||void 0===t?void 0:t[Oe]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:u,bodyVariables:r,headerVariables:p}=d.getAllDataFromTemplateComponent(i);De({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:u,bodyVariables:r,headerVariables:p})}else if(null!=Oe&&-1===Oe){const{descriptionComponents:e,urlBtns:n,qrbBtns:o,imageComponent:t,bodyVariables:i,headerVariables:l}=d.getAllDataFromTemplateComponent(x);De({descriptionComponents:e,urlBtns:n,qrbBtns:o,imageComponent:t,bodyVariables:i,headerVariables:l})}}),[Oe]),o.useEffect((()=>{var e,n,o,t;if(null!=Oe&&Oe>-1&&Pe){const i={components:null===(n=null===(e=x.components[1])||void 0===e?void 0:e.cards)||void 0===n?void 0:n[Oe].components,mapping:null===(t=null===(o=null==x?void 0:x.mapping)||void 0===o?void 0:o.cards)||void 0===t?void 0:t[Oe]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:u,bodyVariables:r,headerVariables:p}=d.getAllDataFromTemplateComponent(i);De({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:u,bodyVariables:r,headerVariables:p}),we(!1)}}),[Pe]);const Qe=ge?Ie.imageComponent:Ee;return Ue.openEditMedia?e.jsx(h.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:e.jsx(v.default,{mediaComponentFormat:null!==(I=Qe.format)&&void 0!==I?I:l.HEADER_TYPES.IMAGE,uploadMedia:Ue.uploadMedia,variableListForImage:B||[],useEditWhatsappTemplateMediaResponse:Ue,setOpenEditMedia:Ue.setOpenEditMedia,openEditMedia:Ue.openEditMedia,editIconRef:Ue.editIconRef,fileRef:ke})})):e.jsxs(h.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460,minWidth:Ce?"420px":"auto"}},{children:[!!Ie.imageComponent&&!Ce&&e.jsxs(b.EditTemplateMediaContainer,{children:[e.jsx(m.default,{imageName:null!==(R=null===(D=null==Qe?void 0:Qe.example)||void 0===D?void 0:D.header_handle)&&void 0!==R?R:[],handleImageChange:Ue.handleImageChange,mediaType:null==Qe?void 0:Qe.format,error:Ue.error,isLoading:Ue.loading,setOpenEditMedia:Ue.setOpenEditMedia,selectedVariable:u.isVariable(null!==(P=null===(U=null===(L=null==Qe?void 0:Qe.example)||void 0===L?void 0:L.header_handle)||void 0===U?void 0:U[0])&&void 0!==P?P:"")?null===(A=null===(w=null==Qe?void 0:Qe.example)||void 0===w?void 0:w.header_handle)||void 0===A?void 0:A[0]:(null===(S=null===(N=null==x?void 0:x.mapping)||void 0===N?void 0:N.header)||void 0===S?void 0:S[0])?null===(F=null===(_=null==x?void 0:x.mapping)||void 0===_?void 0:_.header)||void 0===F?void 0:F[0]:Ue.selectedVariable}),(null==Ee?void 0:Ee.format)==l.HEADER_TYPES.DOCUMENT?e.jsx(T,{children:e.jsx(i.Input,{labelText:"PDF Name",placeholder:"Enter the name",value:Ae,errorMessage:Se||void 0,onBlur:()=>{if(!Ae)return null==q||q(""),void _e("PDF name is Required");const e=r.validateInputName(Ae);null==q||q(Ae),_e(e?"Please enter a valid PDF name":void 0)},onChangeText:e=>{_e(""),Ne(e)}})}):e.jsx(e.Fragment,{})]}),(null===(H=Ie.bodyVariables)||void 0===H?void 0:H.length)>0&&e.jsx(O.default,{containerStyle:{paddingTop:Ie.mediaComponent?24:8},headerText:"Edit variable values",subText:"Edit values for the variables used in template",toolTipInfo:"Variables are placeholder texts which can either be filled through data or custom texts. These can be edited through the dropdowns below"}),null===(Q=Ie.descriptionComponents)||void 0===Q?void 0:Q.map(((n,o)=>e.jsx(j.default,{originalVariableList:null!=Oe&&Oe>-1?fe.cards[Oe]:fe,type:n.type,descriptionComponent:n.component,showVariableModal:V},o))),(null===(W=null===(K=null!=Oe&&Oe>-1?null===(Y=fe.cards[Oe])||void 0===Y?void 0:Y.buttons:null==fe?void 0:fe.buttons)||void 0===K?void 0:K.filter((e=>"URL"===e.type)))||void 0===W?void 0:W.length)>0&&e.jsx(O.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(X=null===(G=null!=Oe&&Oe>-1?null===($=fe.cards[Oe])||void 0===$?void 0:$.buttons:null==fe?void 0:fe.buttons)||void 0===G?void 0:G.filter((e=>he===a.POD.CHATBOT||"URL"===e.type)))||void 0===X?void 0:X.map(((n,o)=>{if("URL"===n.type)return e.jsx(C.default,{variableListIndex:o,CTAoptions:null==E?void 0:E.CTAoptions,button:n,currentVariableList:null!=Oe&&Oe>-1?Object.assign({},fe.cards[Oe]):Object.assign({},fe),updateSelectedURLTemplateBtn:Fe},`${o}_${Oe}`)})),he===a.POD.CHATBOT&&(null===(J=null===(z=ye[0])||void 0===z?void 0:z.component)||void 0===J?void 0:J.buttons)&&(null===(ne=null===(ee=null===(Z=ye[0])||void 0===Z?void 0:Z.component)||void 0===ee?void 0:ee.buttons)||void 0===ne?void 0:ne.length)>0&&e.jsx(p.BackTrackComponent,{backTrackMessage:null===(oe=null==je?void 0:je.backTrackExtra)||void 0===oe?void 0:oe[0],setBackTrackMessage:null===(te=null==je?void 0:je.backTrackExtra)||void 0===te?void 0:te[1]}),(null===(ae=null===(le=null!=Oe&&Oe>-1?null===(ie=fe.cards[Oe])||void 0===ie?void 0:ie.buttons:null==fe?void 0:fe.buttons)||void 0===le?void 0:le.filter((e=>"QUICK_REPLY"===e.type)))||void 0===ae?void 0:ae.length)>0&&(he!==a.POD.CHATBOT?e.jsx(O.default,{headerText:"Edit buttons",subText:"Edit the chatflows triggered on clicking the buttons",toolTipInfo:"There is an option to trigger chatflows through the buttons which can keep the user engaged"}):e.jsx(p.BackTrackComponent,{backTrackMessage:null===(se=null==je?void 0:je.backTrackExtra)||void 0===se?void 0:se[0],setBackTrackMessage:null===(de=null==je?void 0:je.backTrackExtra)||void 0===de?void 0:de[1]})),null===(pe=null===(re=null!=Oe&&Oe>-1?null===(ue=fe.cards[Oe])||void 0===ue?void 0:ue.buttons:null==fe?void 0:fe.buttons)||void 0===re?void 0:re.filter((e=>"QUICK_REPLY"===e.type)))||void 0===pe?void 0:pe.map(((n,o)=>{if("QUICK_REPLY"===n.type&&he!==a.POD.CHATBOT)return e.jsx(C.default,{variableListIndex:o,QRBoptions:null==E?void 0:E.QRBoptions,button:n,currentVariableList:null!=Oe&&Oe>-1?Object.assign({},fe.cards[Oe]):Object.assign({},fe),updateSelectedQRBTemplateBtn:He},`${o}_${Oe}`)})),he===a.POD.CHATBOT&&Me&&e.jsx(c.DiscountCodeComponent,{discountCode:null===(ce=null==je?void 0:je.discountCodeExtra)||void 0===ce?void 0:ce[0],setDiscountCode:null===(ve=null==je?void 0:je.discountCodeExtra)||void 0===ve?void 0:ve[1]}),null===(be=null!=Oe&&Oe>-1?null===(me=fe.cards[Oe])||void 0===me?void 0:me.buttons:null==fe?void 0:fe.buttons)||void 0===be?void 0:be.map(((n,o)=>{var t,i,l;if("COPY_CODE"===n.type)return e.jsx(f.default,{index:o,variable:{variableName:null!==(t=n.text)&&void 0!==t?t:"Copy Code",updatedValue:null!==(i=n.buttonVariable)&&void 0!==i?i:"",type:"string",isEditableVariable:!0,index:null!==(l=n.index)&&void 0!==l?l:0},showVariableModal:!0,componentType:"BUTTONS",buttonType:n.type},o)}))]}))};
|
|
7
|
+
`;exports.default=o=>{let{template:x,onTemplateChange:y,whatsappSpecificPickerMeta:E,showVariableModal:V,variableListForImage:B,setDiscountCode:k,fileName:M,setFileName:q}=o;var I,D,R,L,U,P,w,A,N,S,_,F,H,Q,Y,K,W,$,G,X,z,J,Z,ee,ne,te,oe,ie,le,ae,se,de,ue;const re=x.isCarouselType,{originalVariableList:pe,pod:ce,extras:ve,selectedCarouselIndex:me,isProductCarouselType:be}=s.useTemplateModalContext(),{descriptionComponents:ge,urlBtns:fe,qrbBtns:je,imageComponent:he,bodyVariables:Oe,headerVariables:Ce}=d.getAllDataFromTemplateComponent(x),xe=t.useRef(null),[Te,ye]=t.useState(!1),[Ee,Ve]=t.useState(-1===me?{descriptionComponents:ge,urlBtns:fe,qrbBtns:je,imageComponent:he,bodyVariables:Oe,headerVariables:Ce}:{}),{uploadMediaLink:Be,uploadMediaFiles:ke}=E,Me=g.useEditWhatsappTemplateMedia({uploadMediaLink:Be,uploadMediaFiles:ke,updateTemplateImageUrl:function(e,t){var o,i,l,a,s,d,u,r;let p;p=null!=me&&me>-1?{components:null===(i=null===(o=x.components[1])||void 0===o?void 0:o.cards)||void 0===i?void 0:i[me].components,mapping:null===(a=null===(l=null==x?void 0:x.mapping)||void 0===l?void 0:l.cards)||void 0===a?void 0:a[me]}:Object.assign({},x);const c=null===(s=null==p?void 0:p.components)||void 0===s?void 0:s.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==c&&c>-1&&(null==p?void 0:p.components[c])){const n=Object.assign(Object.assign({},p.components[c]),{format:t,example:{header_handle:[e]}}),o=[...p.components];o[c]=n,p=Object.assign(Object.assign({},p),{components:o})}p.mapping&&(p.mapping=Object.assign(Object.assign({},p.mapping),{header:void 0}));if(null!=me&&me>-1){const e=n.cloneDeep(x);e.components[1].cards[me].components=p.components,(null===(d=null==e?void 0:e.mapping)||void 0===d?void 0:d.cards)&&(null===(u=null==e?void 0:e.mapping)||void 0===u?void 0:u.cards.length)>0&&(e.mapping.cards[me]=null!==(r=p.mapping)&&void 0!==r?r:{}),null==y||y(Object.assign({},e)),Ie(!0)}else null==y||y(Object.assign({},p))},mediaComponent:re?Ee.imageComponent:he,fileRef:xe}),[qe,Ie]=t.useState(!1),[De,Re]=t.useState(M),[Le,Ue]=t.useState();function Pe(e,t,o){var i,l,a,s,d,u,r,p,c,v;const m=null!=me&&me>-1?{components:null===(i=Object.assign({},x).components[1].cards)||void 0===i?void 0:i[me].components,mapping:null===(l=Object.assign({},x).mapping.cards)||void 0===l?void 0:l[me]}:Object.assign({},x),b=n.cloneDeep(m),g="custom"===t&&"string"==typeof e,f=g?e:"string"!=typeof e?e.defaultValue?e.defaultValue:"https://d.bik.ai/":"https://d.bik.ai";if(null!=me&&me>-1&&be){const t=Object.assign({},x).components.map((e=>{var n;return"CAROUSEL"===e.type?Object.assign(Object.assign({},e),{cards:null===(n=e.cards)||void 0===n?void 0:n.map((e=>Object.assign(Object.assign({},e),{components:e.components.map((e=>{var n,t,i;if("BUTTONS"===e.type){const l=null===(n=e.buttons)||void 0===n?void 0:n.filter((e=>"URL"===e.type));let a=null!==(t=null==l?void 0:l[o])&&void 0!==t?t:{};a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[f]});const s=null===(i=e.buttons)||void 0===i?void 0:i.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e));return Object.assign(Object.assign({},e),{buttons:s})}return e}))})))}):e})),i=null===(s=null===(a=Object.assign({},x).mapping)||void 0===a?void 0:a.cards)||void 0===s?void 0:s.map((n=>{var t;return Object.assign(Object.assign({},n),{buttons:null===(t=null==n?void 0:n.buttons)||void 0===t?void 0:t.map((n=>g?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:""))})})),l=n.cloneDeep(x);return l.components=t,l.mapping.cards=i,void(null==y||y(Object.assign({},l)))}const j=null==b?void 0:b.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==j&&j>-1){const n=null===(d=null==b?void 0:b.components[j].buttons)||void 0===d?void 0:d.filter((e=>"URL"===e.type));if((null==n?void 0:n.length)>0){const i="custom"===t&&"string"==typeof e,l=i?e:"string"!=typeof e&&e.defaultValue?e.defaultValue:"https://d.bik.ai/";let a=n[o];a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[l]});const s=[...null!==(p=null===(r=null===(u=b.components)||void 0===u?void 0:u[j])||void 0===r?void 0:r.buttons)&&void 0!==p?p:[]].map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e)),d=Object.assign(Object.assign({},b.components[j]),{buttons:s}),v=null===(c=b.mapping)||void 0===c?void 0:c.buttons;v&&v.length>0&&(v[o]=i?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"");const m=Object.assign(Object.assign({},b.mapping),{buttons:v});b.mapping=m;const g=[...b.components];g[j]=d,b.components=g}}if("string"!=typeof e){"checkout.checkoutUrl"===(null===(v=e.placeHolder)||void 0===v?void 0:v.slice(2,-2))?ye(!0):(ye(!1),null==k||k(""))}if(null!=me&&me>-1){const e=n.cloneDeep(x);e.components[1].cards[me].components=b.components,e.mapping.cards[me]=b.mapping,null==y||y(Object.assign({},e))}else null==y||y(b)}function we(e,t,o){var i,l,a,s,d,u;const r=null!=me&&me>-1?{components:null===(i=Object.assign({},x).components[1].cards)||void 0===i?void 0:i[me].components,mapping:null===(l=Object.assign({},x).mapping.cards)||void 0===l?void 0:l[me]}:Object.assign({},x);if(null!=me&&me>-1&&be){const t=Object.assign({},x).components.map((n=>{var t;return"CAROUSEL"===n.type?Object.assign(Object.assign({},n),{cards:null===(t=n.cards)||void 0===t?void 0:t.map((n=>Object.assign(Object.assign({},n),{components:n.components.map((n=>{var t,i,l;if("BUTTONS"===n.type){const a=null===(t=n.buttons)||void 0===t?void 0:t.filter((e=>"QUICK_REPLY"===e.type));let s=null!==(i=null==a?void 0:a[o])&&void 0!==i?i:{};s=Object.assign(Object.assign({},s),{flowId:e.flowId,flowName:e.flowName});const d=null===(l=n.buttons)||void 0===l?void 0:l.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==s?void 0:s.text)?s:e));return Object.assign(Object.assign({},n),{buttons:d})}return n}))})))}):n})),i=n.cloneDeep(x);return i.components=t,void(null==y||y(Object.assign({},i)))}const p=null==r?void 0:r.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==p&&p>-1){const n=null===(a=null==r?void 0:r.components[p].buttons)||void 0===a?void 0:a.filter((e=>"QUICK_REPLY"===e.type));if(n){let t=n[o];t=Object.assign(Object.assign({},t),{flowId:e.flowId,flowName:e.flowName});const i=[...null!==(u=null===(d=null===(s=r.components)||void 0===s?void 0:s[p])||void 0===d?void 0:d.buttons)&&void 0!==u?u:[]].map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),l=Object.assign(Object.assign({},r.components[p]),{buttons:i}),a=[...r.components];a[p]=l,r.components=a}}if(null!=me&&me>-1){const e=n.cloneDeep(x);e.components[1].cards[me].components=r.components,null==y||y(Object.assign({},e))}else null==y||y(r)}t.useEffect((()=>{var e,n;if(null===(e=x.mapping.buttons)||void 0===e?void 0:e.find((e=>"checkout.checkoutUrl"===e.slice(2,-2))))ye(!0);else{ye(!1);const e=null===(n=null==ve?void 0:ve.discountCodeExtra)||void 0===n?void 0:n[1];null==e||e("")}}),[x]),t.useEffect((()=>{var e,n,t,o;if(null!=me&&me>-1){const i={components:null===(n=null===(e=x.components[1])||void 0===e?void 0:e.cards)||void 0===n?void 0:n[me].components,mapping:null===(o=null===(t=null==x?void 0:x.mapping)||void 0===t?void 0:t.cards)||void 0===o?void 0:o[me]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:u,bodyVariables:r,headerVariables:p}=d.getAllDataFromTemplateComponent(i);Ve({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:u,bodyVariables:r,headerVariables:p})}else if(null!=me&&-1===me){const{descriptionComponents:e,urlBtns:n,qrbBtns:t,imageComponent:o,bodyVariables:i,headerVariables:l}=d.getAllDataFromTemplateComponent(x);Ve({descriptionComponents:e,urlBtns:n,qrbBtns:t,imageComponent:o,bodyVariables:i,headerVariables:l})}}),[me]),t.useEffect((()=>{var e,n,t,o;if(null!=me&&me>-1&&qe){const i={components:null===(n=null===(e=x.components[1])||void 0===e?void 0:e.cards)||void 0===n?void 0:n[me].components,mapping:null===(o=null===(t=null==x?void 0:x.mapping)||void 0===t?void 0:t.cards)||void 0===o?void 0:o[me]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:u,bodyVariables:r,headerVariables:p}=d.getAllDataFromTemplateComponent(i);Ve({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:u,bodyVariables:r,headerVariables:p}),Ie(!1)}}),[qe]);const Ae=re?Ee.imageComponent:he;return Me.openEditMedia?e.jsx(j.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:e.jsx(v.default,{mediaComponentFormat:null!==(I=Ae.format)&&void 0!==I?I:l.HEADER_TYPES.IMAGE,uploadMedia:Me.uploadMedia,variableListForImage:B||[],useEditWhatsappTemplateMediaResponse:Me,setOpenEditMedia:Me.setOpenEditMedia,openEditMedia:Me.openEditMedia,editIconRef:Me.editIconRef,fileRef:xe})})):e.jsxs(j.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:[!!Ee.imageComponent&&!be&&e.jsxs(b.EditTemplateMediaContainer,{children:[e.jsx(m.default,{imageName:null!==(R=null===(D=null==Ae?void 0:Ae.example)||void 0===D?void 0:D.header_handle)&&void 0!==R?R:[],handleImageChange:Me.handleImageChange,mediaType:null==Ae?void 0:Ae.format,error:Me.error,isLoading:Me.loading,setOpenEditMedia:Me.setOpenEditMedia,selectedVariable:u.isVariable(null!==(P=null===(U=null===(L=null==Ae?void 0:Ae.example)||void 0===L?void 0:L.header_handle)||void 0===U?void 0:U[0])&&void 0!==P?P:"")?null===(A=null===(w=null==Ae?void 0:Ae.example)||void 0===w?void 0:w.header_handle)||void 0===A?void 0:A[0]:(null===(S=null===(N=null==x?void 0:x.mapping)||void 0===N?void 0:N.header)||void 0===S?void 0:S[0])?null===(F=null===(_=null==x?void 0:x.mapping)||void 0===_?void 0:_.header)||void 0===F?void 0:F[0]:Me.selectedVariable}),(null==he?void 0:he.format)==l.HEADER_TYPES.DOCUMENT?e.jsx(T,{children:e.jsx(i.Input,{labelText:"PDF Name",placeholder:"Enter the name",value:De,errorMessage:Le||void 0,onBlur:()=>{if(!De)return null==q||q(""),void Ue("PDF name is Required");const e=r.validateInputName(De);null==q||q(De),Ue(e?"Please enter a valid PDF name":void 0)},onChangeText:e=>{Ue(""),Re(e)}})}):e.jsx(e.Fragment,{})]}),Ee.bodyVariables.length>0&&e.jsx(O.default,{containerStyle:{paddingTop:Ee.mediaComponent?24:8},headerText:"Edit variable values",subText:"Edit values for the variables used in template",toolTipInfo:"Variables are placeholder texts which can either be filled through data or custom texts. These can be edited through the dropdowns below"}),null===(H=Ee.descriptionComponents)||void 0===H?void 0:H.map(((n,t)=>e.jsx(h.default,{originalVariableList:null!=me&&me>-1?pe.cards[me]:pe,type:n.type,descriptionComponent:n.component,showVariableModal:V},t))),(null===(Y=null===(Q=null!=me&&me>-1?pe.cards[me].buttons:null==pe?void 0:pe.buttons)||void 0===Q?void 0:Q.filter((e=>"URL"===e.type)))||void 0===Y?void 0:Y.length)>0&&e.jsx(O.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(W=null===(K=null!=me&&me>-1?pe.cards[me].buttons:null==pe?void 0:pe.buttons)||void 0===K?void 0:K.filter((e=>ce===a.POD.CHATBOT||"URL"===e.type)))||void 0===W?void 0:W.map(((n,t)=>{if("URL"===n.type)return e.jsx(C.default,{variableListIndex:t,CTAoptions:null==E?void 0:E.CTAoptions,button:n,currentVariableList:null!=me&&me>-1?Object.assign({},pe.cards[me]):Object.assign({},pe),updateSelectedURLTemplateBtn:Pe},`${t}_${me}`)})),ce===a.POD.CHATBOT&&(null===(G=null===($=je[0])||void 0===$?void 0:$.component)||void 0===G?void 0:G.buttons)&&(null===(J=null===(z=null===(X=je[0])||void 0===X?void 0:X.component)||void 0===z?void 0:z.buttons)||void 0===J?void 0:J.length)>0&&e.jsx(p.BackTrackComponent,{backTrackMessage:null===(Z=null==ve?void 0:ve.backTrackExtra)||void 0===Z?void 0:Z[0],setBackTrackMessage:null===(ee=null==ve?void 0:ve.backTrackExtra)||void 0===ee?void 0:ee[1]}),(null===(te=null===(ne=null!=me&&me>-1?pe.cards[me].buttons:null==pe?void 0:pe.buttons)||void 0===ne?void 0:ne.filter((e=>"QUICK_REPLY"===e.type)))||void 0===te?void 0:te.length)>0&&(ce!==a.POD.CHATBOT?e.jsx(O.default,{headerText:"Edit buttons",subText:"Edit the chatflows triggered on clicking the buttons",toolTipInfo:"There is an option to trigger chatflows through the buttons which can keep the user engaged"}):e.jsx(p.BackTrackComponent,{backTrackMessage:null===(oe=null==ve?void 0:ve.backTrackExtra)||void 0===oe?void 0:oe[0],setBackTrackMessage:null===(ie=null==ve?void 0:ve.backTrackExtra)||void 0===ie?void 0:ie[1]})),null===(ae=null===(le=null!=me&&me>-1?pe.cards[me].buttons:null==pe?void 0:pe.buttons)||void 0===le?void 0:le.filter((e=>"QUICK_REPLY"===e.type)))||void 0===ae?void 0:ae.map(((n,t)=>{if("QUICK_REPLY"===n.type&&ce!==a.POD.CHATBOT)return e.jsx(C.default,{variableListIndex:t,QRBoptions:null==E?void 0:E.QRBoptions,button:n,currentVariableList:null!=me&&me>-1?Object.assign({},pe.cards[me]):Object.assign({},pe),updateSelectedQRBTemplateBtn:we},`${t}_${me}`)})),ce===a.POD.CHATBOT&&Te&&e.jsx(c.DiscountCodeComponent,{discountCode:null===(se=null==ve?void 0:ve.discountCodeExtra)||void 0===se?void 0:se[0],setDiscountCode:null===(de=null==ve?void 0:ve.discountCodeExtra)||void 0===de?void 0:de[1]}),null===(ue=null!=me&&me>-1?pe.cards[me].buttons:null==pe?void 0:pe.buttons)||void 0===ue?void 0:ue.map(((n,t)=>{var o,i,l;if("COPY_CODE"===n.type)return e.jsx(f.default,{index:t,variable:{variableName:null!==(o=n.text)&&void 0!==o?o:"Copy Code",updatedValue:null!==(i=n.buttonVariable)&&void 0!==i?i:"",type:"string",isEditableVariable:!0,index:null!==(l=n.index)&&void 0!==l?l:0},showVariableModal:!0,componentType:"BUTTONS",buttonType:n.type},t)}))]}))};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("styled-components"),
|
|
2
|
-
background: ${
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("styled-components"),s=require("../../button/Button.js"),o=require("../../TypographyStyle.js"),a=require("../../../constants/Theme.js"),l=require("../Badge/index.js"),n=require("../context/templateModalContext.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const u=i(r).default.div`
|
|
2
|
+
background: ${a.COLORS.surface.standard};
|
|
3
3
|
border-top-width: 1px;
|
|
4
|
-
border-top-color: ${
|
|
4
|
+
border-top-color: ${a.COLORS.stroke.primary};
|
|
5
5
|
box-shadow: 0px -4px 12px rgba(0, 0, 0, 0.12);
|
|
6
6
|
width: 100%;
|
|
7
7
|
padding: 16px 24px;
|
|
8
8
|
display: flex;
|
|
9
|
-
justify-content: ${e=>
|
|
9
|
+
justify-content: ${e=>e.isWhatsappCarousel?"space-between":"end"};
|
|
10
10
|
align-items: center;
|
|
11
11
|
gap: 12;
|
|
12
12
|
border-bottom-left-radius: 4px;
|
|
13
13
|
border-bottom-right-radius: 4px;
|
|
14
|
-
`;exports.default=r=>{let{isWhatsappCarousel:
|
|
14
|
+
`;exports.default=r=>{let{isWhatsappCarousel:i,onSelect:d}=r;const{isError:c,selectedCarouselIndex:p,setSelectedCarouselIndex:x,setErrorIndexes:b}=n.useTemplateModalContext(),[j,f]=t.useState(i?"Next":"Select template");return t.useEffect((()=>{i&&-1===p?f("Next"):i&&null!=p&&p>-1&&f("Save & Select Template")}),[p]),e.jsxs(u,Object.assign({isWhatsappCarousel:i},{children:[i&&null!=p&&p>=-1&&e.jsx(o.TitleRegular,Object.assign({color:a.COLORS.text.secondary},{children:`Step ${-1===p?1:2}/2`})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row"}},{children:[c&&e.jsx(l.Badge,{errorText:"Some inputs are missing or incorrect. Please check"}),e.jsx(s.Button,{id:"select-template-btn",buttonText:j,size:i?"small":"large",onClick:function(){i&&-1===p&&x?x(0):(null==b||b([]),d())}})]}))]}))};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("styled-components"),a=require("../../template-preview/TemplatePreview.js");require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../constants/Theme.js"),require("../../curtain/CurtainHelper.js"),require("../../variable-picker-v3/model.js"),require("../../template-preview/models/TemplateMeta.js");var r=require("../../template-preview/models/WhatsAppTemplate.js"),s=require("../context/templateModalContext.js"),l=require("../utils/getPreviewDimension.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=o(t),n=o(i);const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("styled-components"),a=require("../../template-preview/TemplatePreview.js");require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../constants/Theme.js"),require("../../curtain/CurtainHelper.js"),require("../../variable-picker-v3/model.js"),require("../../template-preview/models/TemplateMeta.js");var r=require("../../template-preview/models/WhatsAppTemplate.js"),s=require("../context/templateModalContext.js"),l=require("../utils/getPreviewDimension.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=o(t),n=o(i);const d=n.default.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
height: 100%;
|
|
4
4
|
border-radius: 31px;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
background-color: white;
|
|
7
7
|
margin: auto;
|
|
8
8
|
overflow-y: auto;
|
|
9
|
-
`,
|
|
9
|
+
`,c=n.default.div`
|
|
10
10
|
position: absolute;
|
|
11
11
|
flex: 1;
|
|
12
12
|
background-color: white;
|
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
height: calc(100% - 17px);
|
|
18
18
|
border-radius: 16px;
|
|
19
19
|
overflow-y: auto;
|
|
20
|
-
`,h=p.default.forwardRef(((t,i)=>{let{display_content:o,channel:p,template:n,showSampleValues:h}=t;const{pod:u,hideDeviceContainerInPreview:v}=s.useTemplateModalContext(),w={showSampleValues:h,template:n,channel:p,smsSpecificMeta:{smsDisplayContent:o},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:u!==r.POD.CHATBOT,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426,width:240}},size:"small",hideHeader:!0,emailSpecificMeta:{emailDisplayContent:o,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_mobile",containerStyle:{height:"100%",width:"100%"},templateContainerStyles:{height:"100%"}},isPreview:!0};return v?e.jsx(m,{children:e.jsx(a.TemplatePreview,Object.assign({},w))}):e.jsx(e.Fragment,{children:e.jsxs(
|
|
20
|
+
`,h=p.default.forwardRef(((t,i)=>{let{display_content:o,channel:p,template:n,showSampleValues:h}=t;const{pod:u,hideDeviceContainerInPreview:v}=s.useTemplateModalContext(),w={showSampleValues:h,template:n,channel:p,smsSpecificMeta:{smsDisplayContent:o},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:u!==r.POD.CHATBOT,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426,width:240}},size:"small",hideHeader:!0,emailSpecificMeta:{emailDisplayContent:o,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_mobile",containerStyle:{height:"100%",width:"100%"},templateContainerStyles:{height:"100%"}},isPreview:!0};return v?e.jsx(m,{children:e.jsx(a.TemplatePreview,Object.assign({},w))}):e.jsx(e.Fragment,{children:e.jsxs(d,Object.assign({channel:p},{children:[e.jsx("img",{alt:"",src:"https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FkNwEVoGlLpVjOsXoO1M8WgvWicP2%2F6f07b850-8b4b-4d58-96cc-8ba6df7b4e4a-Device___Frame.jpg?alt=media&token=253f1bfe-8481-4f54-bdef-3c0a73697d6a",style:{width:l.getPreviewWidth(p),height:443}}),e.jsx(c,Object.assign({ref:i},{children:e.jsx(a.TemplatePreview,Object.assign({},w))}))]}))})}));h.displayName="MobilePreview";const m=n.default.div`
|
|
21
21
|
display: flex;
|
|
22
22
|
align-items: center;
|
|
23
|
-
justify-content: center;
|
|
24
|
-
flex: 1;
|
|
25
23
|
`;exports.default=h;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/edit.svg.js"),l=require("date-fns"),a=require("lodash"),i=require("react"),n=require("styled-components"),s=require("../../custom-date-time/CustomDateTime.js"),o=require("../../dropdown/Dropdown.js"),u=require("../../input/Input.js"),d=require("../../product-picker-v2/collectionScreen.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/edit.svg.js"),l=require("date-fns"),a=require("lodash"),i=require("react"),n=require("styled-components"),s=require("../../custom-date-time/CustomDateTime.js"),o=require("../../dropdown/Dropdown.js"),u=require("../../input/Input.js"),d=require("../../product-picker-v2/collectionScreen.js"),c=require("../../template-preview/constants/regexPatterns.js"),r=require("../../template-preview/models/Channels.js"),p=require("../../template-preview/models/WhatsAppTemplate.js"),m=require("../../TypographyStyle.js"),v=require("../../../utils/StringUtils.js"),b=require("../../../constants/Theme.js"),g=require("../context/templateModalContext.js"),O=require("../custom-hooks/useAdditionalVariables.js"),j=require("../utils/getVariableNameEmail.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=x(n);const _=y.default.div`
|
|
2
2
|
/* surface/$color-background-warning-light */
|
|
3
3
|
|
|
4
|
-
background: ${e=>e.focused&&e.channel===
|
|
4
|
+
background: ${e=>e.focused&&e.channel===r.CHANNEL_TYPE.EMAIL?b.COLORS.background.warning.light:"transparent"};
|
|
5
5
|
border-radius: 4px;
|
|
6
6
|
padding: 8px 10px;
|
|
7
7
|
`,h=y.default.div`
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
background-color: rgba(0, 0, 0, 0.1);
|
|
14
14
|
z-index: 1000;
|
|
15
15
|
cursor: not-allowed;
|
|
16
|
-
`,f={value:"custom_link",label:"Custom URL"},T={value:"custom_text",label:"Custom text"},E={value:"static_expiry",label:"Static Expiry"};exports.Container=_,exports.default=n=>{let{onFocus:x,variable:y,index:N,showVariableModal:C,setShowDiscountCheckBox:P,componentType:A,CTAoptions:V,buttonType:S}=n;var L,k,D,B,H;const[w,Y]=i.useState(!1),[U,R]=i.useState(""),[q,M]=i.useState([]),[I,W]=i.useState(),[$,z]=i.useState(!1),{variableList:Z,setVariableList:F,setVariableCallback:G,setShowVariablePicker:K,device:J,channel:Q,isError:X,originalVariableList:ee,template:te,templateSelectionTriggered:le,setTemplate:ae,setDisplayContent:ie,setOriginalVariableList:ne,globalNormalizedPlaceholders:se,enabledCustomText:oe,pod:ue,selectedCarouselIndex:de,isProductCarouselType:re,disableEditVariable:ce,disableEditExpiry:pe,templateErrorIndexes:me}=g.useTemplateModalContext();function ve(e,t){var l,a,i;const n=e;R(""),W(n),Q===c.CHANNEL_TYPE.WHATSAPP?"custom_text"!==n.value&&"custom_link"!==n.value&&"static_expiry"!==n.value?(ge(null!==(l=n.value)&&void 0!==l?l:"","string"),null==Oe||Oe(null!==(a=y.index)&&void 0!==a?a:0,n.value,!0)):(null==Oe||Oe(null!==(i=y.index)&&void 0!==i?i:0,"",!0,n.value),ge("","url"===n.bikPlaceholderType?"link":"string")):"custom_text"!==n.value&&"custom_link"!==n.value?ge(n.value,"url"===n.bikPlaceholderType?"link":"string"):(R(""),ge("",n.value))}function be(e,t){var l;R(t);const a="custom_link"===(null==I?void 0:I.value)&&t?t.includes("https")?t:`https://${t}`:t;ge(a,"static_expiry"===e?"string":e),Q===c.CHANNEL_TYPE.WHATSAPP&&(null==Oe||Oe(null!==(l=y.index)&&void 0!==l?l:0,a,"custom_link"===e,e))}function ge(e,t){var l,i,n,s;const o="custom_link"===t?"link":"custom_text"===t?"string":t;if(Q!==c.CHANNEL_TYPE.WHATSAPP){const a=j.getVariableNameForEmailByIndex(N+1),i=null===document||void 0===document?void 0:document.getElementById("mobile"===J?"template_html_mobile":"template_html_desktop"),n=Q===c.CHANNEL_TYPE.EMAIL?null===(l=null==i?void 0:i.contentWindow)||void 0===l?void 0:l.document.getElementById(a):document.getElementById(a);n&&(n.textContent="custom_text"!==t&&"custom_link"!==t||e?e:y.variableName);const s=ee.map(((t,l)=>l===N?Object.assign(Object.assign({},t),{type:o,updatedValue:e}):t));null==ne||ne(s)}if(Q===c.CHANNEL_TYPE.WHATSAPP){if(null!=de&&de>-1&&re){const l=Object.assign({},ee).cards.map(((l,a)=>{var i,n;return"BODY"===A?Object.assign(Object.assign({},l),{body:null===(i=l.body)||void 0===i?void 0:i.map(((t,l)=>N===l?Object.assign(Object.assign({},t),{type:o,updatedValue:e}):t))}):"BUTTONS"===A?Object.assign(Object.assign({},l),{buttons:null===(n=l.buttons)||void 0===n?void 0:n.map(((l,a)=>a===N?Object.assign(Object.assign({},l),{buttonVariable:"custom_link"===t?"((customPlaceholderName))":e,example:"COPY_CODE"===l.type?e:[e]}):l))}):l}));return void(null==ne||ne((e=>Object.assign(Object.assign({},e),{cards:l}))))}const l=null!=de&&de>-1?ee.cards[de]:ee;let u=l.body,d=l.header,r=l.buttons;if("BODY"===A?u=null===(i=l.body)||void 0===i?void 0:i.map(((t,l)=>l===N?Object.assign(Object.assign({},t),{type:o,updatedValue:e}):t)):"HEADER"===A?d=null===(n=l.header)||void 0===n?void 0:n.map(((t,l)=>l===N?Object.assign(Object.assign({},t),{type:o,updatedValue:e}):t)):"BUTTONS"===A&&(r=null===(s=l.buttons)||void 0===s?void 0:s.map(((l,a)=>a===N?Object.assign(Object.assign({},l),{buttonVariable:"custom_link"===t?"((customPlaceholderName))":e,example:"COPY_CODE"===l.type?e:[e]}):l))),null!=de&&de>-1){const e=a.cloneDeep(ee.cards);e[de]={header:d,body:u,buttons:r},null==ne||ne((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==ne||ne((e=>Object.assign(Object.assign({},e),{header:d,body:u,buttons:r})))}}function Oe(e,t,l,i){var n,s,o,u,d,r,c;if(null!=de&&de>-1&&re){const s=Object.assign({},te).components.map((l=>{var a;return"CAROUSEL"===l.type?Object.assign(Object.assign({},l),{cards:null===(a=l.cards)||void 0===a?void 0:a.map((l=>Object.assign(Object.assign({},l),{components:l.components.map((l=>{var a,i,n,s,o,u;if("BODY"===l.type&&"BODY"===A){if(null===(i=null===(a=l.example)||void 0===a?void 0:a.body_text)||void 0===i?void 0:i[0]){const a=[...null!==(o=null===(s=null===(n=l.example)||void 0===n?void 0:n.body_text)||void 0===s?void 0:s[0])&&void 0!==o?o:[]];a[e]=t.replace("{{","").replace("}}","").replace("((","").replace("))","");const i=Object.assign(Object.assign({},l.example),{body_text:[a]});return Object.assign(Object.assign({},l),{example:i})}return l}if("BUTTONS"===l.type&&"BUTTONS"===A){const a=null===(u=l.buttons)||void 0===u?void 0:u.map(((l,a)=>a===e?Object.assign(Object.assign({},l),{example:[t]}):l));return a?Object.assign(Object.assign({},l),{buttons:a}):l}return l}))})))}):l})),o=a.cloneDeep(te);if(l){const l=null===(n=Object.assign({},te).mapping.cards)||void 0===n?void 0:n.map(((l,a)=>{var n,s,o;if("BODY"===A)return Object.assign(Object.assign({},l),{body:null===(n=l.body)||void 0===n?void 0:n.map(((l,a)=>e===a?"custom_text"===i?`((editableVariable${a+10}))`:t:l))});if("BUTTONS"===A&&(null==l?void 0:l.buttons)){let n=-1,u=-1;return null===(s=te.components[1].cards)||void 0===s||s[a].components.forEach((t=>{var l;"BUTTONS"===t.type&&(null===(l=t.buttons)||void 0===l||l.forEach(((t,l)=>{"URL"===t.type&&(n++,l===e&&"URL"==t.type&&(u=n))})))})),Object.assign(Object.assign({},l),{buttons:null===(o=l.buttons)||void 0===o?void 0:o.map(((e,l)=>l===u?"custom_link"===i?"((customPlaceholderName))":t:e))})}return l}));o.mapping.cards=l}return o.components=s,void(null==ae||ae(o))}const p=null!=de&&de>-1?{components:null===(s=Object.assign({},te).components[1].cards)||void 0===s?void 0:s[de].components,mapping:null===(o=Object.assign({},te).mapping.cards)||void 0===o?void 0:o[de]}:Object.assign({},te),m=null===(u=null==p?void 0:p.components)||void 0===u?void 0:u.map((l=>{var a,i,n,s,o,u,d,r,c;const p=Object.assign({},l);if("BODY"===l.type&&"BODY"===A){if(null===(i=null===(a=l.example)||void 0===a?void 0:a.body_text)||void 0===i?void 0:i[0]){const l=[...null!==(o=null===(s=null===(n=p.example)||void 0===n?void 0:n.body_text)||void 0===s?void 0:s[0])&&void 0!==o?o:[]];l[e]=t.replace("{{","").replace("}}","").replace("((","").replace("))","");const a=Object.assign(Object.assign({},p.example),{body_text:[l]});return Object.assign(Object.assign({},p),{example:a})}}else if("HEADER"===l.type&&"HEADER"===A){if(null===(u=l.example)||void 0===u?void 0:u.header_text){const l=[...null!==(r=null===(d=p.example)||void 0===d?void 0:d.header_text)&&void 0!==r?r:[]];l[e]=t.replace("{{","").replace("}}","").replace("((","").replace("))","");const a=Object.assign(Object.assign({},p.example),{header_text:l});return Object.assign(Object.assign({},p),{example:a})}}else{if("BUTTONS"===l.type&&"BUTTONS"===A){const a=null===(c=l.buttons)||void 0===c?void 0:c.map(((l,a)=>a===e?Object.assign(Object.assign({},l),{example:"COPY_CODE"===l.type?t:[t]}):l));return a?Object.assign(Object.assign({},p),{buttons:a}):p}if("limited_time_offer"===l.type&&"limited_time_offer"===A)return Object.assign(Object.assign({},p),{example:Object.assign(Object.assign({},p.example),{limited_time_offer:t})})}return l}));if(p.components=m,l)if("BODY"===A&&(null===(d=null==p?void 0:p.mapping)||void 0===d?void 0:d.body))p.mapping=Object.assign(Object.assign({},p.mapping),{body:p.mapping.body.map(((l,a)=>e===a?"custom_text"===i?`((editableVariable${a+10}))`:t:l))});else if("HEADER"===A&&(null===(r=null==p?void 0:p.mapping)||void 0===r?void 0:r.header))p.mapping=Object.assign(Object.assign({},p.mapping),{header:p.mapping.header.map(((l,a)=>e===a?"custom_text"===i?`((editableVariable${a+20}))`:t:l))});else if("BUTTONS"===A&&(null===(c=null==p?void 0:p.mapping)||void 0===c?void 0:c.buttons)){let l=-1,a=-1;m.forEach((t=>{var i;"BUTTONS"===t.type&&(null===(i=t.buttons)||void 0===i||i.forEach(((t,i)=>{"URL"===t.type&&(l++,i===e&&"URL"==t.type&&(a=l))})))})),p.mapping=Object.assign(Object.assign({},p.mapping),{buttons:p.mapping.buttons.map(((e,l)=>l===a?"custom_link"===i?"((customPlaceholderName))":t:e))})}if(null!=de&&de>-1&&te){const e=a.cloneDeep(te);e.components[1].cards[de].components=p.components,e.mapping.cards[de]=p.mapping,null==ae||ae(e)}else null==ae||ae(Object.assign({},p))}i.useEffect((()=>{w&&(null==x||x())}),[w]),i.useEffect((()=>{!function(){var e,t,l,a,i;const n="mobile"===J?"template_html_mobile":"template_html_desktop",s=document.getElementById(n),o=(null!==(a=null===(l=null===(t=null===(e=null==s?void 0:s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.body)||void 0===l?void 0:l.innerHTML)&&void 0!==a?a:"")+(null===(i=null==s?void 0:s.contentWindow)||void 0===i?void 0:i.document.head.innerHTML);Q===c.CHANNEL_TYPE.EMAIL&&(null==ie||ie(o))}()}),[le]),i.useEffect((()=>{!function(){var e,t;const l=[];let a=[];if(Q!==c.CHANNEL_TYPE.MESSAGE||oe){"link"===(null==y?void 0:y.type)?(l.push({label:"",options:[f,T]}),W(f)):"date_time"===(null==y?void 0:y.type)?(l.push({label:"",options:[f,T]}),W(E)):(l.push({label:"",options:[f,T,E]}),W(T));const e=null!=se?se:[];M([...l,...e.map((e=>{var t,l;return Object.assign(Object.assign({},e),{label:v.default.toCapitilize(null===(l=null===(t=e.label)||void 0===t?void 0:t.replace(/([A-Z])/g," $1"))||void 0===l?void 0:l.toLowerCase())})}))]),a=[...l,...e]}else{const e=null!=se?se:[];M([{label:"",options:[T,f]},...e]),a=[{label:"",options:[T,f]},...e]}if((Q===c.CHANNEL_TYPE.WHATSAPP||Q===c.CHANNEL_TYPE.EMAIL||Q===c.CHANNEL_TYPE.MESSAGE)&&y.updatedValue)if(r.placeHolderNamePattern.test(y.updatedValue)&&Q===c.CHANNEL_TYPE.WHATSAPP||y.updatedValue.startsWith("{{")&&Q!==c.CHANNEL_TYPE.WHATSAPP){const e=function(e,t,l){var a;let i={label:"",value:""};const n=l===c.CHANNEL_TYPE.WHATSAPP?e.updatedValue.replace("[[","").replace("]]",""):e.updatedValue.replace("{{","").replace("}}","");if(C){let t=e.updatedValue;if(ue===p.POD.CHATBOT&&"BUTTONS"===A){const l=null==V?void 0:V.filter((t=>t.placeHolder===e.updatedValue));l&&l.length>0&&(t=l[0].label)}i={label:t?t.replace("{{","").replace("}}","").trim().replace("."," "):"",value:null!==(a=e.updatedValue)&&void 0!==a?a:""}}else t.map((e=>{e.options.map((e=>{var t;(null===(t=e.value)||void 0===t?void 0:t.replace("{{","").replace("}}","").trim())===n.trim()&&(i=e)}))}));return i}(y,a,Q);e.value&&W(e)}else"date_time"===y.type?(W(E),R(y.updatedValue),Oe(null!==(e=y.index)&&void 0!==e?e:0,y.updatedValue)):(null===(t=y.updatedValue)||void 0===t?void 0:t.startsWith("https"))?(W(f),R(y.updatedValue.split("https://")[1])):(W(T),R(y.updatedValue))}()}),[de]),i.useEffect((()=>{J&&I&&U&&setTimeout((()=>{ge("custom_link"===(null==I?void 0:I.value)&&U?U.includes("https")?U:`https://${U}`:U,I.value)}),100)}),[J]),i.useEffect((()=>{!$&&I&&y.updatedValue&&setTimeout((()=>{ge("custom_link"===(null==I?void 0:I.value)&&y.updatedValue?y.updatedValue.includes("https")?y.updatedValue:`https://${y.updatedValue}`:y.updatedValue,I.value),z(!0)}),100)}),[I]);const je=e=>{null==P||P(!1),"{{custom.url}}"===e.actualValue?ve({label:e.displayName,selected:!0,value:"custom_link"}):"{{custom.text}}"==e.actualValue?ve({label:e.displayName,selected:!0,value:"custom_text"}):"{{static.expiry}}"==e.actualValue?ve({label:e.displayName,selected:!0,value:"static_expiry"}):ve({label:e.displayName.replace("{{","").replace("}}","").trim().replace("."," "),selected:!0,value:e.actualValue,bikPlaceholderType:"string"})};return e.jsxs(_,Object.assign({channel:Q,focused:w,onMouseEnter:()=>Y(!0),onMouseLeave:()=>Y(!1)},{children:[e.jsx("div",Object.assign({style:{marginBottom:8}},{children:e.jsxs(m.BodySecondary,Object.assign({style:{color:X&&!I?b.COLORS.content.negative:b.COLORS.content.primary}},{children:[null===(L=y.variableName)||void 0===L?void 0:L.replace("{{","").replace("}}","")," ","link"===(null==y?void 0:y.type)?"link":"variable"]}))})),e.jsx("div",Object.assign({style:{marginBottom:12}},{children:C?e.jsxs("div",Object.assign({style:{display:"flex",border:"#E0E0E0 1px solid",borderRadius:4,padding:10,justifyContent:(null==I?void 0:I.label)?"space-between":"flex-end"}},{children:[e.jsx(m.BodyPrimary,Object.assign({numberOfLines:1},{children:ue===p.POD.CHATBOT?["static_expiry","custom_text","custom_link"].includes(null!==(k=null==I?void 0:I.value)&&void 0!==k?k:"")?null==I?void 0:I.label:null==I?void 0:I.value:d.truncate(null!==(D=null==I?void 0:I.label)&&void 0!==D?D:"",20,!0)})),ce||"date_time"===(null==y?void 0:y.type)&&pe?e.jsx(e.Fragment,{}):e.jsx(t.default,{onClick:()=>{(()=>{if(S===p.BUTTON_TYPE.URL&&ue===p.POD.CHATBOT){const e=O.updateVariables({variableList:Z,categoryDisplayName:"Custom Variables",variableDisplayName:"Custom URL",variableValue:"{{custom.url}}"});F(e)}else if("limited_time_offer"===A){const e=O.updateVariables({variableList:Z,categoryDisplayName:"Static Variables",variableDisplayName:"Static Expiry",variableValue:"{{static.expiry}}"});F(e)}else if(S===p.BUTTON_TYPE.COPY_CODE){const e=O.updateVariables({variableList:Z,categoryDisplayName:"Custom Variables",variableDisplayName:"Custom Text",variableValue:"{{custom.text}}"});F(e)}})(),G((()=>je)),K(!0)},width:24,height:24,color:b.COLORS.content.primary})]})):e.jsx(o.Dropdown,{disabled:ce,options:q,isSearchable:!1,onSelect:ve,defaultOptions:I?[Object.assign(Object.assign({},I),{selected:!0})]:[]})})),("custom_text"===(null==I?void 0:I.value)||"custom_link"===(null==I?void 0:I.value))&&e.jsx(u.Input,{state:ce?"disabled":"none",labelText:"custom_text"===(null==I?void 0:I.value)?"Custom text value":"custom_link"===(null==I?void 0:I.value)?"Custom URL value":"",id:`variable-value-${null==I?void 0:I.value}-${N}`,value:U,errorMessage:X&&(null===(B=null==me?void 0:me.buttons)||void 0===B?void 0:B.includes(null!==(H=null==y?void 0:y.index)&&void 0!==H?H:-1))?U&&0!==U.trim().length?"custom_link"!==I.value||/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/.test(`https://${U.trim()}`)&&0!==U.trim().length?"custom_link"!==I.value&&U.length>30?"Length cannot be more than 30":"BUTTONS"===A&&"custom_link"!==I.value?"Enter valid alpha numeric code":"":"Enter valid URL":"Required field":"",maxCharLimit:"custom_link"===(null==I?void 0:I.value)?2e3:"BUTTONS"===A?15:30,noKeyDownChange:!0,prefixText:"custom_link"===(null==I?void 0:I.value)?"https://":"",placeholder:"link"===y.type||"custom_link"===I.value?"Enter custom URL here":"Enter custom text here",onChangeText:e=>{be(I.value,e)}}),"static_expiry"===(null==I?void 0:I.value)&&e.jsxs("div",Object.assign({style:{position:"relative"}},{children:[ce&&e.jsx(h,{onClick:e=>e.preventDefault()}),e.jsx(s.CustomDateTime,{placement:"auto",time:U?l.format(new Date(U),"hh:mm a"):l.format(new Date,"hh:mm a"),date:U?new Date(U):new Date,minDate:new Date,error:"",setError:()=>{},onChange:e=>{be("static_expiry",e.toISOString())}})]}))]}))};
|
|
16
|
+
`,f={value:"custom_link",label:"Custom URL"},T={value:"custom_text",label:"Custom text"},E={value:"static_expiry",label:"Static Expiry"};exports.Container=_,exports.default=n=>{let{onFocus:x,variable:y,index:N,showVariableModal:C,setShowDiscountCheckBox:P,componentType:A,CTAoptions:V,buttonType:S}=n;var k,L,D,B,H;const[w,Y]=i.useState(!1),[U,R]=i.useState(""),[q,M]=i.useState([]),[I,W]=i.useState(),[$,z]=i.useState(!1),{variableList:Z,setVariableList:F,setVariableCallback:G,setShowVariablePicker:K,device:J,channel:Q,isError:X,originalVariableList:ee,template:te,templateSelectionTriggered:le,setTemplate:ae,setDisplayContent:ie,setOriginalVariableList:ne,globalNormalizedPlaceholders:se,enabledCustomText:oe,pod:ue,selectedCarouselIndex:de,isProductCarouselType:ce,disableEditVariable:re,disableEditExpiry:pe,templateErrorIndexes:me}=g.useTemplateModalContext();function ve(e,t){var l,a,i;const n=e;R(""),W(n),Q===r.CHANNEL_TYPE.WHATSAPP?"custom_text"!==n.value&&"custom_link"!==n.value&&"static_expiry"!==n.value?(ge(null!==(l=n.value)&&void 0!==l?l:"","string"),null==Oe||Oe(null!==(a=y.index)&&void 0!==a?a:0,n.value,!0)):(null==Oe||Oe(null!==(i=y.index)&&void 0!==i?i:0,"",!0,n.value),ge("","url"===n.bikPlaceholderType?"link":"string")):"custom_text"!==n.value&&"custom_link"!==n.value?ge(n.value,"url"===n.bikPlaceholderType?"link":"string"):(R(""),ge("",n.value))}function be(e,t){var l;R(t);const a="custom_link"===(null==I?void 0:I.value)&&t?t.includes("https")?t:`https://${t}`:t;ge(a,"static_expiry"===e?"string":e),Q===r.CHANNEL_TYPE.WHATSAPP&&(null==Oe||Oe(null!==(l=y.index)&&void 0!==l?l:0,a,"custom_link"===e,e))}function ge(e,t){var l,i,n,s;const o="custom_link"===t?"link":"custom_text"===t?"string":t;if(Q!==r.CHANNEL_TYPE.WHATSAPP){const a=j.getVariableNameForEmailByIndex(N+1),i=null===document||void 0===document?void 0:document.getElementById("mobile"===J?"template_html_mobile":"template_html_desktop"),n=Q===r.CHANNEL_TYPE.EMAIL?null===(l=null==i?void 0:i.contentWindow)||void 0===l?void 0:l.document.getElementById(a):document.getElementById(a);n&&(n.textContent="custom_text"!==t&&"custom_link"!==t||e?e:y.variableName);const s=ee.map(((t,l)=>l===N?Object.assign(Object.assign({},t),{type:o,updatedValue:e}):t));null==ne||ne(s)}if(Q===r.CHANNEL_TYPE.WHATSAPP){if(null!=de&&de>-1&&ce){const l=Object.assign({},ee).cards.map(((l,a)=>{var i,n;return"BODY"===A?Object.assign(Object.assign({},l),{body:null===(i=l.body)||void 0===i?void 0:i.map(((t,l)=>N===l?Object.assign(Object.assign({},t),{type:o,updatedValue:e}):t))}):"BUTTONS"===A?Object.assign(Object.assign({},l),{buttons:null===(n=l.buttons)||void 0===n?void 0:n.map(((l,a)=>a===N?Object.assign(Object.assign({},l),{buttonVariable:"custom_link"===t?"((customPlaceholderName))":e,example:"COPY_CODE"===l.type?e:[e]}):l))}):l}));return void(null==ne||ne((e=>Object.assign(Object.assign({},e),{cards:l}))))}const l=null!=de&&de>-1?ee.cards[de]:ee;let u=l.body,d=l.header,c=l.buttons;if("BODY"===A?u=null===(i=l.body)||void 0===i?void 0:i.map(((t,l)=>l===N?Object.assign(Object.assign({},t),{type:o,updatedValue:e}):t)):"HEADER"===A?d=null===(n=l.header)||void 0===n?void 0:n.map(((t,l)=>l===N?Object.assign(Object.assign({},t),{type:o,updatedValue:e}):t)):"BUTTONS"===A&&(c=null===(s=l.buttons)||void 0===s?void 0:s.map(((l,a)=>a===N?Object.assign(Object.assign({},l),{buttonVariable:"custom_link"===t?"((customPlaceholderName))":e,example:"COPY_CODE"===l.type?e:[e]}):l))),null!=de&&de>-1){const e=a.cloneDeep(ee.cards);e[de]={header:d,body:u,buttons:c},null==ne||ne((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==ne||ne((e=>Object.assign(Object.assign({},e),{header:d,body:u,buttons:c})))}}function Oe(e,t,l,i){var n,s,o,u,d,c,r;if(null!=de&&de>-1&&ce){const s=Object.assign({},te).components.map((l=>{var a;return"CAROUSEL"===l.type?Object.assign(Object.assign({},l),{cards:null===(a=l.cards)||void 0===a?void 0:a.map((l=>Object.assign(Object.assign({},l),{components:l.components.map((l=>{var a,i,n,s,o,u;if("BODY"===l.type&&"BODY"===A){if(null===(i=null===(a=l.example)||void 0===a?void 0:a.body_text)||void 0===i?void 0:i[0]){const a=[...null!==(o=null===(s=null===(n=l.example)||void 0===n?void 0:n.body_text)||void 0===s?void 0:s[0])&&void 0!==o?o:[]];a[e]=t.replace("{{","").replace("}}","").replace("((","").replace("))","");const i=Object.assign(Object.assign({},l.example),{body_text:[a]});return Object.assign(Object.assign({},l),{example:i})}return l}if("BUTTONS"===l.type&&"BUTTONS"===A){const a=null===(u=l.buttons)||void 0===u?void 0:u.map(((l,a)=>a===e?Object.assign(Object.assign({},l),{example:[t]}):l));return a?Object.assign(Object.assign({},l),{buttons:a}):l}return l}))})))}):l})),o=a.cloneDeep(te);if(l){const l=null===(n=Object.assign({},te).mapping.cards)||void 0===n?void 0:n.map(((l,a)=>{var n,s,o;if("BODY"===A)return Object.assign(Object.assign({},l),{body:null===(n=l.body)||void 0===n?void 0:n.map(((l,a)=>e===a?"custom_text"===i?`((editableVariable${a+10}))`:t:l))});if("BUTTONS"===A&&(null==l?void 0:l.buttons)){let n=-1,u=-1;return null===(s=te.components[1].cards)||void 0===s||s[a].components.forEach((t=>{var l;"BUTTONS"===t.type&&(null===(l=t.buttons)||void 0===l||l.forEach(((t,l)=>{"URL"===t.type&&(n++,l===e&&"URL"==t.type&&(u=n))})))})),Object.assign(Object.assign({},l),{buttons:null===(o=l.buttons)||void 0===o?void 0:o.map(((e,l)=>l===u?"custom_link"===i?"((customPlaceholderName))":t:e))})}return l}));o.mapping.cards=l}return o.components=s,void(null==ae||ae(o))}const p=null!=de&&de>-1?{components:null===(s=Object.assign({},te).components[1].cards)||void 0===s?void 0:s[de].components,mapping:null===(o=Object.assign({},te).mapping.cards)||void 0===o?void 0:o[de]}:Object.assign({},te),m=null===(u=null==p?void 0:p.components)||void 0===u?void 0:u.map((l=>{var a,i,n,s,o,u,d,c,r;const p=Object.assign({},l);if("BODY"===l.type&&"BODY"===A){if(null===(i=null===(a=l.example)||void 0===a?void 0:a.body_text)||void 0===i?void 0:i[0]){const l=[...null!==(o=null===(s=null===(n=p.example)||void 0===n?void 0:n.body_text)||void 0===s?void 0:s[0])&&void 0!==o?o:[]];l[e]=t.replace("{{","").replace("}}","").replace("((","").replace("))","");const a=Object.assign(Object.assign({},p.example),{body_text:[l]});return Object.assign(Object.assign({},p),{example:a})}}else if("HEADER"===l.type&&"HEADER"===A){if(null===(u=l.example)||void 0===u?void 0:u.header_text){const l=[...null!==(c=null===(d=p.example)||void 0===d?void 0:d.header_text)&&void 0!==c?c:[]];l[e]=t.replace("{{","").replace("}}","").replace("((","").replace("))","");const a=Object.assign(Object.assign({},p.example),{header_text:l});return Object.assign(Object.assign({},p),{example:a})}}else{if("BUTTONS"===l.type&&"BUTTONS"===A){const a=null===(r=l.buttons)||void 0===r?void 0:r.map(((l,a)=>a===e?Object.assign(Object.assign({},l),{example:"COPY_CODE"===l.type?t:[t]}):l));return a?Object.assign(Object.assign({},p),{buttons:a}):p}if("limited_time_offer"===l.type&&"limited_time_offer"===A)return Object.assign(Object.assign({},p),{example:Object.assign(Object.assign({},p.example),{limited_time_offer:t})})}return l}));if(p.components=m,l)if("BODY"===A&&(null===(d=null==p?void 0:p.mapping)||void 0===d?void 0:d.body))p.mapping=Object.assign(Object.assign({},p.mapping),{body:p.mapping.body.map(((l,a)=>e===a?"custom_text"===i?`((editableVariable${a+10}))`:t:l))});else if("HEADER"===A&&(null===(c=null==p?void 0:p.mapping)||void 0===c?void 0:c.header))p.mapping=Object.assign(Object.assign({},p.mapping),{header:p.mapping.header.map(((l,a)=>e===a?"custom_text"===i?`((editableVariable${a+20}))`:t:l))});else if("BUTTONS"===A&&(null===(r=null==p?void 0:p.mapping)||void 0===r?void 0:r.buttons)){let l=-1,a=-1;m.forEach((t=>{var i;"BUTTONS"===t.type&&(null===(i=t.buttons)||void 0===i||i.forEach(((t,i)=>{"URL"===t.type&&(l++,i===e&&"URL"==t.type&&(a=l))})))})),p.mapping=Object.assign(Object.assign({},p.mapping),{buttons:p.mapping.buttons.map(((e,l)=>l===a?"custom_link"===i?"((customPlaceholderName))":t:e))})}if(null!=de&&de>-1&&te){const e=a.cloneDeep(te);e.components[1].cards[de].components=p.components,e.mapping.cards[de]=p.mapping,null==ae||ae(e)}else null==ae||ae(Object.assign({},p))}i.useEffect((()=>{w&&(null==x||x())}),[w]),i.useEffect((()=>{!function(){var e,t,l,a,i;const n="mobile"===J?"template_html_mobile":"template_html_desktop",s=document.getElementById(n),o=(null!==(a=null===(l=null===(t=null===(e=null==s?void 0:s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.body)||void 0===l?void 0:l.innerHTML)&&void 0!==a?a:"")+(null===(i=null==s?void 0:s.contentWindow)||void 0===i?void 0:i.document.head.innerHTML);Q===r.CHANNEL_TYPE.EMAIL&&(null==ie||ie(o))}()}),[le]),i.useEffect((()=>{!function(){var e,t;const l=[];let a=[];if(Q!==r.CHANNEL_TYPE.MESSAGE||oe){"link"===(null==y?void 0:y.type)?(l.push({label:"",options:[f,T]}),W(f)):"date_time"===(null==y?void 0:y.type)?(l.push({label:"",options:[f,T]}),W(E)):(l.push({label:"",options:[f,T,E]}),W(T));const e=null!=se?se:[];M([...l,...e.map((e=>{var t,l;return Object.assign(Object.assign({},e),{label:v.default.toCapitilize(null===(l=null===(t=e.label)||void 0===t?void 0:t.replace(/([A-Z])/g," $1"))||void 0===l?void 0:l.toLowerCase())})}))]),a=[...l,...e]}else{const e=null!=se?se:[];M([{label:"",options:[T,f]},...e]),a=[{label:"",options:[T,f]},...e]}if((Q===r.CHANNEL_TYPE.WHATSAPP||Q===r.CHANNEL_TYPE.EMAIL||Q===r.CHANNEL_TYPE.MESSAGE)&&y.updatedValue)if(c.placeHolderNamePattern.test(y.updatedValue)&&Q===r.CHANNEL_TYPE.WHATSAPP||y.updatedValue.startsWith("{{")&&Q!==r.CHANNEL_TYPE.WHATSAPP){const e=function(e,t,l){var a;let i={label:"",value:""};const n=l===r.CHANNEL_TYPE.WHATSAPP?e.updatedValue.replace("[[","").replace("]]",""):e.updatedValue.replace("{{","").replace("}}","");if(C){let t=e.updatedValue;if(ue===p.POD.CHATBOT&&"BUTTONS"===A){const l=null==V?void 0:V.filter((t=>t.placeHolder===e.updatedValue));l&&l.length>0&&(t=l[0].label)}i={label:t?t.replace("{{","").replace("}}","").trim().replace("."," "):"",value:null!==(a=e.updatedValue)&&void 0!==a?a:""}}else t.map((e=>{e.options.map((e=>{var t;(null===(t=e.value)||void 0===t?void 0:t.replace("{{","").replace("}}","").trim())===n.trim()&&(i=e)}))}));return i}(y,a,Q);e.value&&W(e)}else"date_time"===y.type?(W(E),R(y.updatedValue),Oe(null!==(e=y.index)&&void 0!==e?e:0,y.updatedValue)):(null===(t=y.updatedValue)||void 0===t?void 0:t.startsWith("https"))?(W(f),R(y.updatedValue.split("https://")[1])):(W(T),R(y.updatedValue))}()}),[de]),i.useEffect((()=>{J&&I&&U&&setTimeout((()=>{ge("custom_link"===(null==I?void 0:I.value)&&U?U.includes("https")?U:`https://${U}`:U,I.value)}),100)}),[J]),i.useEffect((()=>{!$&&I&&y.updatedValue&&setTimeout((()=>{ge("custom_link"===(null==I?void 0:I.value)&&y.updatedValue?y.updatedValue.includes("https")?y.updatedValue:`https://${y.updatedValue}`:y.updatedValue,I.value),z(!0)}),100)}),[I]);const je=e=>{null==P||P(!1),"{{custom.url}}"===e.actualValue?ve({label:e.displayName,selected:!0,value:"custom_link"}):"{{custom.text}}"==e.actualValue?ve({label:e.displayName,selected:!0,value:"custom_text"}):"{{static.expiry}}"==e.actualValue?ve({label:e.displayName,selected:!0,value:"static_expiry"}):ve({label:e.displayName.replace("{{","").replace("}}","").trim().replace("."," "),selected:!0,value:e.actualValue,bikPlaceholderType:"string"})};return e.jsxs(_,Object.assign({channel:Q,focused:w,onMouseEnter:()=>Y(!0),onMouseLeave:()=>Y(!1)},{children:[e.jsx("div",Object.assign({style:{marginBottom:8}},{children:e.jsxs(m.BodySecondary,Object.assign({style:{color:X&&!I?b.COLORS.content.negative:b.COLORS.content.primary}},{children:[null===(k=y.variableName)||void 0===k?void 0:k.replace("{{","").replace("}}","")," ","link"===(null==y?void 0:y.type)?"link":"variable"]}))})),e.jsx("div",Object.assign({style:{marginBottom:12}},{children:C?e.jsxs("div",Object.assign({style:{display:"flex",border:"#E0E0E0 1px solid",borderRadius:4,padding:10,justifyContent:(null==I?void 0:I.label)?"space-between":"flex-end"}},{children:[e.jsx(m.BodyPrimary,Object.assign({numberOfLines:1},{children:ue===p.POD.CHATBOT?["static_expiry","custom_text","custom_link"].includes(null!==(L=null==I?void 0:I.value)&&void 0!==L?L:"")?null==I?void 0:I.label:null==I?void 0:I.value:d.truncate(null!==(D=null==I?void 0:I.label)&&void 0!==D?D:"",20,!0)})),re||"date_time"===(null==y?void 0:y.type)&&pe?e.jsx(e.Fragment,{}):e.jsx(t.default,{onClick:()=>{console.log("click"),(()=>{if(S===p.BUTTON_TYPE.URL&&ue===p.POD.CHATBOT){const e=O.updateVariables({variableList:Z,categoryDisplayName:"Custom Variables",variableDisplayName:"Custom URL",variableValue:"{{custom.url}}"});F(e)}else if("limited_time_offer"===A){const e=O.updateVariables({variableList:Z,categoryDisplayName:"Static Variables",variableDisplayName:"Static Expiry",variableValue:"{{static.expiry}}"});F(e)}else if(S===p.BUTTON_TYPE.COPY_CODE){const e=O.updateVariables({variableList:Z,categoryDisplayName:"Custom Variables",variableDisplayName:"Custom Text",variableValue:"{{custom.text}}"});F(e)}})(),G((()=>je)),K(!0)},width:24,height:24,color:b.COLORS.content.primary})]})):e.jsx(o.Dropdown,{disabled:re,options:q,isSearchable:!1,onSelect:ve,defaultOptions:I?[Object.assign(Object.assign({},I),{selected:!0})]:[]})})),("custom_text"===(null==I?void 0:I.value)||"custom_link"===(null==I?void 0:I.value))&&e.jsx(u.Input,{state:re?"disabled":"none",labelText:"custom_text"===(null==I?void 0:I.value)?"Custom text value":"custom_link"===(null==I?void 0:I.value)?"Custom URL value":"",id:`variable-value-${null==I?void 0:I.value}-${N}`,value:U,errorMessage:X&&(null===(B=null==me?void 0:me.buttons)||void 0===B?void 0:B.includes(null!==(H=null==y?void 0:y.index)&&void 0!==H?H:-1))?U&&0!==U.trim().length?"custom_link"!==I.value||/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/.test(`https://${U.trim()}`)&&0!==U.trim().length?"custom_link"!==I.value&&U.length>30?"Length cannot be more than 30":"BUTTONS"===A&&"custom_link"!==I.value?"Enter valid alpha numeric code":"":"Enter valid URL":"Required field":"",maxCharLimit:"custom_link"===(null==I?void 0:I.value)?2e3:"BUTTONS"===A?15:30,noKeyDownChange:!0,prefixText:"custom_link"===(null==I?void 0:I.value)?"https://":"",placeholder:"link"===y.type||"custom_link"===I.value?"Enter custom URL here":"Enter custom text here",onChangeText:e=>{be(I.value,e)}}),"static_expiry"===(null==I?void 0:I.value)&&e.jsxs("div",Object.assign({style:{position:"relative"}},{children:[re&&e.jsx(h,{onClick:e=>e.preventDefault()}),e.jsx(s.CustomDateTime,{placement:"auto",time:U?l.format(new Date(U),"hh:mm a"):l.format(new Date,"hh:mm a"),date:U?new Date(U):new Date,minDate:new Date,error:"",setError:()=>{},onChange:e=>{be("static_expiry",e.toISOString())}})]}))]}))};
|
package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),s=require("../../dropdown/Dropdown.js"),a=require("../../input/Input.js"),n=require("../../template-preview/constants/regexPatterns.js"),i=require("../../template-preview/models/TemplateMeta.js"),o=require("../../template-preview/models/WhatsAppTemplate.js"),r=require("../../TypographyStyle.js"),u=require("../../../constants/Theme.js"),c=require("../context/templateModalContext.js"),d=require("../utils/validateIsUrl.js"),b=require("./VariableConnector.js");exports.default=p=>{let{variableListIndex:j,button:m,updateSelectedURLTemplateBtn:g,updateSelectedQRBTemplateBtn:O,currentVariableList:v,CTAoptions:x,QRBoptions:f}=p;var y,L,h,R;const[U,V]=l.useState(""),[T
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),s=require("../../dropdown/Dropdown.js"),a=require("../../input/Input.js"),n=require("../../template-preview/constants/regexPatterns.js"),i=require("../../template-preview/models/TemplateMeta.js"),o=require("../../template-preview/models/WhatsAppTemplate.js"),r=require("../../TypographyStyle.js"),u=require("../../../constants/Theme.js"),c=require("../context/templateModalContext.js"),d=require("../utils/validateIsUrl.js"),b=require("./VariableConnector.js");exports.default=p=>{let{variableListIndex:j,button:m,updateSelectedURLTemplateBtn:g,updateSelectedQRBTemplateBtn:O,currentVariableList:v,CTAoptions:x,QRBoptions:f}=p;var y,L,h,R;const[U,V]=l.useState(""),[C,T]=l.useState(),{isError:I,disableEditVariable:w,pod:q,selectedCarouselIndex:P,originalVariableList:E,setOriginalVariableList:N,isProductCarouselType:S}=c.useTemplateModalContext();function _(e){if(V(e),null!=P&&P>-1&&S){const l=t.cloneDeep(E);if("URL"===m.type){const t=l.cards.map((t=>{let l=t.buttons.filter((e=>"URL"===e.type))[j];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=t.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e));return Object.assign(Object.assign({},t),{buttons:s})}));null==N||N((e=>Object.assign(Object.assign({},e),{cards:t}))),null==g||g(`https://${e}`,"custom",j)}return}let l=v.buttons.filter((e=>"URL"===e.type))[j];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=v.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e)),a=Object.assign({},null!=P&&P>-1?E.cards[P]:E);if(a.buttons=s,null!=P&&P>-1){const e=[...E.cards];e[P]=a,null==N||N((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==N||N((e=>Object.assign(Object.assign({},e),{buttons:[...s]})));null==g||g(`https://${e}`,"custom",j)}return l.useEffect((()=>{var e;if(m.buttonVariable&&n.editableVarPattern.test(m.buttonVariable))T(i.CUSTOM_URL_NAME),V((null===(e=m.example)||void 0===e?void 0:e[0].split("https://")[1])||"");else{let e=-1;const t="URL"===m.type?x:f;e="URL"===m.type?t.findIndex((e=>e.placeHolder===m.buttonVariable)):t.findIndex((e=>e.label===m.flowName)),e>-1&&T(t[e])}}),[]),q!==o.POD.CHATBOT?e.jsxs(b.Container,{children:[e.jsx("div",Object.assign({style:{marginBottom:8}},{children:e.jsxs(r.BodySecondary,Object.assign({style:{color:u.COLORS.content.primary}},{children:[m.text," button"]}))})),e.jsx("div",Object.assign({style:{marginBottom:12}},{children:e.jsx(s.Dropdown,{disabled:w,options:"URL"===m.type?x:f,isSearchable:!0,onSelect:function(e,l){const s=e;T(s);const a=("URL"===m.type?x:f).find((e=>e.placeHolder===s.placeHolder));if(a)if("custom_link"!==a.value){if(null!=P&&P>-1&&S){const e=t.cloneDeep(E);if("URL"===m.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"URL"===e.type))[j];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder});const l=e.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==g||g({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",j),null==N||N((e=>Object.assign(Object.assign({},e),{cards:t})))}else if("QUICK_REPLY"===m.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"QUICK_REPLY"===e.type))[j];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value});const l=e.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==O||O({flowName:s.label,flowId:s.value},"placeholder",j),null==N||N((e=>Object.assign(Object.assign({},e),{cards:t})))}return}let e;if("URL"===m.type){let t=v.buttons.filter((e=>"URL"===e.type))[j];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder}),e=v.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==g||g({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",j)}else{let t=v.buttons.filter((e=>"QUICK_REPLY"===e.type))[j];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value}),e=v.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==O||O({flowName:s.label,flowId:s.value},"placeholder",j)}const l=Object.assign({},null!=P&&P>-1?E.cards[P]:E);if(l.buttons=e,null!=P&&P>-1){const e=[...E.cards];e[P]=l,null==N||N((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==N||N((t=>Object.assign(Object.assign({},t),{buttons:[...e]})))}else _("")},defaultOptions:C?[Object.assign(Object.assign({},C),{selected:!0})]:[]})})),"custom_link"===(null==C?void 0:C.value)&&e.jsx("div",Object.assign({style:{marginBottom:20}},{children:e.jsx(a.Input,{state:w?"disabled":"none",errorMessage:I?U?d.validateIsUrl(U)?"":"Enter valid URL":"Required field":"",value:U,prefixText:"https://",placeholder:"Enter custom URL here",onChangeText:_,maxCharLimit:2e3})}))]}):e.jsx(b.default,{index:j,variable:{variableName:null!==(y=m.text)&&void 0!==y?y:"",updatedValue:"((customPlaceholderName))"===m.buttonVariable?`${null===(L=m.example)||void 0===L?void 0:L[0]}`:null!==(h=m.buttonVariable)&&void 0!==h?h:"",type:"link",isEditableVariable:!0,index:null!==(R=m.index)&&void 0!==R?R:0},showVariableModal:!0,componentType:"BUTTONS",CTAoptions:x})};
|
package/dist/cjs/components/template-context-mapper/modalElements/useEditWhtasappTemplateMedia.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("lodash"),t=require("react"),i=require("../../helpers/FileUploaderHelper.js"),o=require("../../template-preview/models/TemplateMeta.js"),l=require("../context/templateModalContext.js"),a=require("../utils/validateIsUrl.js");exports.useEditWhatsappTemplateMedia=s=>{const{uploadMediaLink:r,updateTemplateImageUrl:d,mediaComponent:c,uploadMediaFiles:u,fileRef:p}=s,{template:m,selectedCarouselIndex:v,setTemplate:f}=l.useTemplateModalContext(),[E,g]=t.useState(void 0),[h,b]=t.useState(),[_,M]=t.useState(!1),[I,T]=t.useState(""),[y,A]=t.useState(!1),[S,j]=t.useState(),R=t.useRef(null);function U(n){var t;return e.__awaiter(this,void 0,void 0,(function*(){const e=new i.FileUploaderHelper;if(n instanceof Blob){const i=e.validate({file:n});if(i)T(i),A(!1),M(!1);else{const e=c.format===o.HEADER_TYPES.IMAGE,i=yield u({file:n,fileName:E,isImage:e});if(i.success){const[e]=n.type.split("/");d(null!==(t=i.url)&&void 0!==t?t:"","application"===e?o.HEADER_TYPES.DOCUMENT:o.HEADER_TYPES[e.toUpperCase()])}else T("An unknown technical error occurred");A(!1),M(!1)}}else T("An unknown technical error occurred"),A(!1)}))}function C(){var e;console.log("handleImageChange",p,null==p?void 0:p.current),(null===(e=null==p?void 0:p.current)||void 0===e?void 0:e.click)&&p.current.click()}return t.useEffect((()=>{g(void 0),j(void 0),b(void 0),M(!1),A(!1),T("")}),[v]),{uploadMedia:function(t){var l,s,u,E,g,h;return e.__awaiter(this,void 0,void 0,(function*(){if(T(""),b(""),console.log("uef uploadMedia",p,null==p?void 0:p.current),t)if(t.startsWith("https"))try{if(A(!0),console.log("uploadMediaLink",r),r){const e=yield r(t),{type:n,size:a,success:s}=e;if(s){const t=(new i.FileUploaderHelper).validate({linkData:{type:n,size:a}});if(t)return T(t),void A(!1);const[s]=n.split("/");d(null!==(l=e.url)&&void 0!==l?l:"",s.includes("application")?o.HEADER_TYPES.DOCUMENT:o.HEADER_TYPES[s.toUpperCase()])}else T("An unknown technical error occurred");A(!1)}else{const e=yield fetch(t),n=yield e.blob();yield U(n)}}catch(e){T("An unknown technical error occurred")}else if(a.isVariable(t)){let e;if(b(t),e=null!=v&&v>-1?{components:null===(u=null===(s=m.components[1])||void 0===s?void 0:s.cards)||void 0===u?void 0:u[v].components,mapping:null===(g=null===(E=null==m?void 0:m.mapping)||void 0===E?void 0:E.cards)||void 0===g?void 0:g[v]}:Object.assign({},m),e.components){const n=null===(h=null==e?void 0:e.components)||void 0===h?void 0:h.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==n&&n>-1&&(null==e?void 0:e.components[n])){const i=Object.assign(Object.assign({},e.components[n]),{format:c.format,example:{header_handle:[t]}}),o=[...e.components];o[n]=i,e.components=o}}if(e.mapping&&(e.mapping=Object.assign(Object.assign({},e.mapping),{header:[t]})),A(!1),null!=v&&v>-1){const t=n.cloneDeep(m);t.components[1].cards[v].components=e.components,t.mapping.cards[v]=e.mapping,null==f||f(Object.assign({},t))}else null==f||f(Object.assign({},e))}else A(!1),T("Invalid URL or variable");else C()}))},processImageUpload:U,handleImageUpload:function(e){var n;T(""),A(!0);const t=null===(n=e.target.files)||void 0===n?void 0:n[0];if(c.format===o.HEADER_TYPES.IMAGE){const e=new FileReader;j(""),g(""),e.onload=()=>{j(e.result),g(null==t?void 0:t.name)},t&&e.readAsDataURL(t)}else U(t)},handleImageChange:C,onCropComplete:function(n){return e.__awaiter(this,void 0,void 0,(function*(){A(!1),T("");const e=yield fetch(n),t=yield e.blob();yield U(t),j(void 0),M(!1)}))},editIconRef:R,fileName:E,setFileName:g,selectedVariable:h,setSelectedVariable:b,openEditMedia:_,setOpenEditMedia:M,selectedImage:S,setSelectedImage:j,loading:y,setLoading:A,error:I,setError:T}};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../constants/Theme.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(e);const d=o.default.div`
|
|
2
2
|
padding: 16px;
|
|
3
3
|
padding-bottom: 12px;
|
|
4
4
|
border-top-left-radius: 4px;
|
|
5
5
|
border-top-right-radius: 4px;
|
|
6
|
-
border: 1px solid ${
|
|
6
|
+
border: 1px solid ${r.COLORS.stroke.primary};
|
|
7
7
|
`,i=o.default.div`
|
|
8
8
|
width: 100%;
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: center;
|
|
12
|
-
border-left: 1px solid ${
|
|
13
|
-
border-right: 1px solid ${
|
|
14
|
-
border-top-color: ${
|
|
15
|
-
border-top-width: ${
|
|
12
|
+
border-left: 1px solid ${r.COLORS.stroke.primary};
|
|
13
|
+
border-right: 1px solid ${r.COLORS.stroke.primary};
|
|
14
|
+
border-top-color: ${r.COLORS.stroke.primary};
|
|
15
|
+
border-top-width: ${e=>e.hideHeader?"1px":"0px"};
|
|
16
16
|
overflow: scroll;
|
|
17
17
|
`,a=o.default.div`
|
|
18
18
|
width: 100%;
|
|
19
19
|
height: 100%;
|
|
20
|
-
background-color: ${
|
|
21
|
-
`,
|
|
20
|
+
background-color: ${r.BASE_COLORS.grayscale[100]};
|
|
21
|
+
`,n=o.default.div`
|
|
22
22
|
height: 100%;
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
@@ -26,20 +26,18 @@
|
|
|
26
26
|
justify-content: center;
|
|
27
27
|
flex-grow: 1;
|
|
28
28
|
min-height: 180px;
|
|
29
|
-
|
|
30
|
-
border-right: 1px solid ${e.COLORS.stroke.primary};
|
|
31
|
-
`,n=o.default.div`
|
|
29
|
+
`,s=o.default.div`
|
|
32
30
|
display: flex;
|
|
33
31
|
justify-content: center;
|
|
34
32
|
width: 100%;
|
|
35
|
-
background: ${
|
|
33
|
+
background: ${r.COLORS.surface.standard};
|
|
36
34
|
border-bottom-left-radius: 4px;
|
|
37
35
|
border-bottom-right-radius: 4px;
|
|
38
|
-
border: 1px solid ${
|
|
36
|
+
border: 1px solid ${r.COLORS.stroke.primary};
|
|
39
37
|
`,l=o.default.div`
|
|
40
38
|
border-radius: 4px;
|
|
41
|
-
background-color: ${
|
|
42
|
-
margin-top: ${
|
|
39
|
+
background-color: ${r.COLORS.surface.standard};
|
|
40
|
+
margin-top: ${e=>e.hideHeader?0:16};
|
|
43
41
|
display: flex;
|
|
44
42
|
flex-direction: column;
|
|
45
|
-
`;exports.CardLoadingContainer=a,exports.EmailContainer=l,exports.Header=d,exports.IframeContainer=
|
|
43
|
+
`;exports.CardLoadingContainer=a,exports.EmailContainer=l,exports.Header=d,exports.IframeContainer=n,exports.ImageContainer=i,exports.ViewButton=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../assets/icons/arrow_left.svg.js"),t=require("../../assets/icons/more_vertical.svg.js"),s=require("../../assets/icons/search.svg.js"),l=require("../../constants/Theme.js"),i=require("../template-context-mapper/context/templateModalContext.js"),n=require("../TypographyStyle.js"),a=require("./helpers/SmsTemplateHelper.js"),o=require("./SMS/SMSBubble.js"),d=require("./SmsTemplatePreview.styled.js");exports.default=c=>{let{template:u,variableStore:j,hideHeader:h,display_content:x,onlyTemplateContent:p,size:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../assets/icons/arrow_left.svg.js"),t=require("../../assets/icons/more_vertical.svg.js"),s=require("../../assets/icons/search.svg.js"),l=require("../../constants/Theme.js"),i=require("../template-context-mapper/context/templateModalContext.js"),n=require("../TypographyStyle.js"),a=require("./helpers/SmsTemplateHelper.js"),o=require("./SMS/SMSBubble.js"),d=require("./SmsTemplatePreview.styled.js");exports.default=c=>{let{template:u,variableStore:j,hideHeader:h,display_content:x,onlyTemplateContent:p,size:g}=c;var v;const S=null==u?void 0:u.content,{hideDeviceContainerInPreview:m}=i.useTemplateModalContext();return m?e.jsx(d.SMSBubbleContainer,Object.assign({size:g},{children:e.jsx(o.default,{size:null!=g?g:"large",content:null!=x?x:a.renderVariableUIForPreview(S,null!=j?j:[])})})):e.jsxs(e.Fragment,{children:[!h&&!p&&e.jsx(d.SMSCardHeader,{children:e.jsx(n.TitleRegular,Object.assign({style:{maxWidth:"100%"}},{children:u.name}))}),!p&&e.jsx(d.SMSHeader,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e.jsx(r.default,{width:16,height:16,color:l.COLORS.content.secondary}),e.jsx(n.Caption,{children:null===(v=null==u?void 0:u.headers)||void 0===v?void 0:v[0]})]})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e.jsx(s.default,{width:16,height:16,color:l.COLORS.content.secondary}),e.jsx(t.default,{width:16,height:16,color:l.COLORS.content.secondary})]}))]})}),e.jsx(d.SMSBubbleContainer,Object.assign({size:g},{children:e.jsx(o.default,{size:null!=g?g:"large",content:null!=x?x:a.renderVariableUIForPreview(S,null!=j?j:[])})}))]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("../template-context-mapper/context/templateModalContext.js"),t=require("../../utils/StringUtils.js"),a=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),n=require("./EmailTemplateThumbnailPreview.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("../template-context-mapper/context/templateModalContext.js"),t=require("../../utils/StringUtils.js"),a=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),n=require("./EmailTemplateThumbnailPreview.js"),s=require("./models/Channels.js"),r=require("./SmsTemplatePreview.js"),o=require("./WhatsAppTemplatePreview.js");const d={WhatsAppWrapper:{backgroundColor:a.COLORS.surface.standard,borderRadius:4,border:`1px solid ${a.COLORS.background.inactive}`,marginTop:16}};exports.TemplatePreview=p=>{let{template:u,channel:m,whatsAppSpecificMeta:c,templateCreationsInfo:v,hideHeader:h,size:C,onlyTemplateContent:j,emailSpecificMeta:S,smsSpecificMeta:x,showSampleValues:T,carouselCardIndex:b,isWhatsappCarousel:g,isPreview:y}=p;var w,O;const{setSelectedCarouselIndex:P}=l.useTemplateModalContext();return m===s.CHANNEL_TYPE.SMS?e.jsx("div",Object.assign({style:Object.assign({marginTop:v?16:0,border:v?`1px solid ${a.COLORS.stroke.primary}`:"none",borderRadius:4},null==x?void 0:x.templateContainerStyles)},{children:e.jsx(r.default,{template:u,hideHeader:h,onlyTemplateContent:j,size:null!=C?C:"large",variableStore:null==x?void 0:x.smsVariableStore,display_content:null==x?void 0:x.smsDisplayContent})})):m===s.CHANNEL_TYPE.EMAIL?e.jsx("div",Object.assign({style:Object.assign({marginTop:v?16:0},null==S?void 0:S.templateContainerStyles)},{children:e.jsx(n.default,{template:u,handleViewTemplate:()=>{var e;null===(e=null==S?void 0:S.handleViewTemplate)||void 0===e||e.call(S)},hideHeader:h,hideViewButton:null==S?void 0:S.hideViewButtonForEmail,containerStyle:null==S?void 0:S.containerStyle,emailDisplayContent:null==S?void 0:S.emailDisplayContent,emailHtmlContainerId:null==S?void 0:S.emailHtmlContainerId})})):m===s.CHANNEL_TYPE.WHATSAPP?e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},null==c?void 0:c.templateContainerStyles),v?d.WhatsAppWrapper:{}),onClick:()=>{P&&g&&P(null!=b?b:-1)}},{children:[v?e.jsx("div",Object.assign({style:{padding:16}},{children:e.jsx(i.TitleRegular,{children:t.default.convertToTitleCase(null!==(w=null==u?void 0:u.label)&&void 0!==w?w:"")})})):e.jsx(e.Fragment,{}),e.jsx(o.default,{showSampleValues:T,showHeader:null==c?void 0:c.showWhatsAppHeader,extras:null==c?void 0:c.whatsAppExtras,template:u,size:v?"small":null!=C?C:"large",containerStyle:Object.assign({borderWidth:v?0:1,borderTopWidth:1},null!==(O=null==c?void 0:c.containerStyle)&&void 0!==O?O:{}),zeroStateComponent:null==c?void 0:c.zeroStateComponent,usePlaceHolderName:null==c?void 0:c.usePlaceHolderName,carouselCardIndex:b,isWhatsappCarousel:g,isPreview:y})]})):e.jsx(e.Fragment,{})};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
height: 8px;
|
|
5
5
|
left: -8px;
|
|
6
6
|
top: -9px;
|
|
7
|
-
`;exports.default=a=>{const{bodyText:j,footerText:m,headerMediaType:y,headerText:
|
|
7
|
+
`;exports.default=a=>{const{bodyText:j,footerText:m,headerMediaType:y,headerText:S,headerAssetLink:g,headerAssetName:f,quickReplybtn:v,ctaBtn:q,actionTypes:E,textType:b,extras:w,showHeader:C,imagePreviewStyles:A,size:N,children:O,isPreview:F}=a,M=new l.WhatsAppFormatToHTML,P=i.useMemo((()=>({color:d.COLORS.content.primary,margin:12,fontSize:C?d.FONTS.caption.fontSize:d.FONTS.bodySecondary.fontSize,fontWeight:d.FONTS.bodySecondary.fontWeight,maxWidth:"100%",whiteSpace:"pre-wrap",marginBottom:0,marginTop:8,wordBreak:"break-word"})),[]);return e.jsxs(p.Container,Object.assign({isPreview:F},{children:[e.jsx(u,{children:e.jsx(t.default,{color:"white",height:8,width:8})}),y===c.HEADER_TYPES.TEXT?e.jsx(T.default,{bold:!0,text:S}):y!==c.HEADER_TYPES.NONE?e.jsx(x.MediaCard,{headerAssetLink:g,headerAssetName:f,mediaType:y,imagePreviewStyles:y===c.HEADER_TYPES.IMAGE?A:{}}):e.jsx(e.Fragment,{}),!!j&&e.jsx(e.Fragment,{children:O?e.jsx(e.Fragment,{children:O}):e.jsx(e.Fragment,{children:"html"===b?e.jsx("div",{className:"richTextEditor",style:P,dangerouslySetInnerHTML:{__html:M.convertToHTML(j)}}):e.jsx(n.BodySecondary,{children:j})})}),e.jsxs(p.FooterWrapper,{children:[e.jsx(o.Tooltip,Object.assign({body:null!=m?m:"",placement:"top"},{children:e.jsx(p.TimeStamp,Object.assign({style:{flex:1}},{children:m}))})),e.jsx(p.TimeStamp,{children:"16:48"})]}),E===c.ACTIONS_TYPES.QUICK_REPLY?e.jsx("div",{children:null==v?void 0:v.map(((t,r)=>e.jsx(h.ChatBtn,{text:t.text},r)))}):E===c.ACTIONS_TYPES.CTA_BTN?e.jsx("div",{children:null==q?void 0:q.map(((t,i)=>e.jsx(h.ChatBtn,{textTypography:C?n.Caption:n.BodySecondary,extraContent:w?t.extra:void 0,placeholder:t.placeholder,text:t.text,Icon:"phoneNumber"===t.type?r.default:s.default,size:N},i)))}):e.jsx(e.Fragment,{})]}))};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
|
2
2
|
isCarouselCard?: boolean | undefined;
|
|
3
3
|
showBorder?: boolean | undefined;
|
|
4
|
-
showDashedBorder?: boolean | undefined;
|
|
5
4
|
isWhatsappCarousel?: boolean | undefined;
|
|
6
5
|
hasError?: boolean | undefined;
|
|
7
6
|
isPreview?: boolean | undefined;
|
|
@@ -10,10 +9,6 @@ export declare const TimeStamp: import("styled-components").StyledComponent<"div
|
|
|
10
9
|
numberOfLines?: number | undefined;
|
|
11
10
|
color?: string | undefined;
|
|
12
11
|
}, never>;
|
|
13
|
-
export declare const FooterText: import("styled-components").StyledComponent<"div", any, {
|
|
14
|
-
numberOfLines?: number | undefined;
|
|
15
|
-
color?: string | undefined;
|
|
16
|
-
}, never>;
|
|
17
12
|
export declare const MediaContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
13
|
export declare const ChatBtnContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
19
14
|
export declare const FooterWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../TypographyStyle.js"),r=require("../../../constants/Theme.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(e);const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../TypographyStyle.js"),r=require("../../../constants/Theme.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(e);const a=i.default.div`
|
|
2
2
|
background: ${r.COLORS.surface.standard};
|
|
3
|
+
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.12);
|
|
3
4
|
border-top-left-radius: ${e=>e.isCarouselCard?"12px":"0px"};
|
|
4
5
|
border-top-right-radius: 12px;
|
|
5
6
|
border-bottom-right-radius: 12px;
|
|
@@ -7,27 +8,20 @@
|
|
|
7
8
|
position: relative;
|
|
8
9
|
padding: 8px 0px;
|
|
9
10
|
border: 2px solid
|
|
10
|
-
${e=>e.hasError?`${r.COLORS.content.negative}`:e.showBorder?`${r.COLORS.stroke.brand}`:`${r.COLORS.
|
|
11
|
-
border: ${e=>e.showDashedBorder&&`2px dashed ${r.COLORS.content.brand}`};
|
|
12
|
-
height: 100%;
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
11
|
+
${e=>e.hasError?`${r.COLORS.content.negative}`:e.showBorder?`${r.COLORS.stroke.brand}`:`${r.COLORS.text.white}`};
|
|
15
12
|
:hover {
|
|
16
13
|
border: 2px
|
|
17
14
|
${e=>e.isPreview?"unset":e.isWhatsappCarousel?e.hasError?"dashed":e.showBorder?"solid":"dashed":"solid"}
|
|
18
15
|
${r.COLORS.stroke.brand};
|
|
19
|
-
box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.25);
|
|
20
16
|
}
|
|
21
|
-
`,
|
|
17
|
+
`,d=i.default(t.Caption)`
|
|
22
18
|
color: ${r.COLORS.content.secondary};
|
|
23
19
|
max-width: 80px;
|
|
24
20
|
text-overflow: ellipsis;
|
|
25
21
|
white-space: nowrap;
|
|
26
22
|
overflow: hidden;
|
|
27
23
|
text-wrap: wrap;
|
|
28
|
-
`,s=i.default
|
|
29
|
-
max-width: 200px;
|
|
30
|
-
`,n=i.default.div`
|
|
24
|
+
`,s=i.default.div`
|
|
31
25
|
border-radius: 8px;
|
|
32
26
|
display: flex;
|
|
33
27
|
flex-direction: column;
|
|
@@ -36,14 +30,14 @@
|
|
|
36
30
|
min-height: 152px;
|
|
37
31
|
margin-bottom: 4px;
|
|
38
32
|
margin: 0px 8px;
|
|
39
|
-
`,
|
|
33
|
+
`,n=i.default.div`
|
|
40
34
|
padding: 12px;
|
|
41
35
|
display: flex;
|
|
42
36
|
flex-direction: row;
|
|
43
37
|
justify-content: center;
|
|
44
38
|
align-items: center;
|
|
45
39
|
border-top: 1px solid ${r.COLORS.stroke.primary};
|
|
46
|
-
`,
|
|
40
|
+
`,p=i.default.div`
|
|
47
41
|
display: flex;
|
|
48
42
|
flex-direction: row;
|
|
49
43
|
justify-content: space-between;
|
|
@@ -66,4 +60,4 @@
|
|
|
66
60
|
position: absolute;
|
|
67
61
|
top: 16px;
|
|
68
62
|
right: 16px;
|
|
69
|
-
`,exports.ChatBtnContainer=
|
|
63
|
+
`,exports.ChatBtnContainer=n,exports.Container=a,exports.FooterWrapper=p,exports.MediaContainer=s,exports.TimeStamp=d;
|