@bikdotai/bik-component-library 0.0.570-beta-29 → 0.0.571
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/icons/halfRectangle.svg.js +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/carousel-preview/CarouselPreview.d.ts +5 -2
- package/dist/cjs/components/carousel-preview/CarouselPreviewCard.js +1 -1
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +9 -9
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +13 -11
- package/dist/cjs/components/template-context-mapper/index.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/modalElements/Body.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/modalElements/Body.js +9 -9
- package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.d.ts +5 -2
- package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +1 -2
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.d.ts +1 -2
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +4 -4
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +4 -6
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
- package/dist/cjs/components/template-context-mapper/utils/getDataFromTemplateComponent.d.ts +0 -11
- package/dist/cjs/components/template-context-mapper/utils/getDataFromTemplateComponent.js +1 -1
- package/dist/cjs/components/template-preview/TemplatePreview.d.ts +6 -8
- package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.js +2 -2
- package/dist/cjs/components/template-preview/WhatsApp/ChatUiV2.js +2 -2
- package/dist/cjs/components/template-preview/constants/TemplateConstants.d.ts +0 -2
- package/dist/cjs/components/template-preview/constants/TemplateConstants.js +1 -1
- package/dist/cjs/components/template-preview/index.d.ts +0 -2
- package/dist/cjs/components/template-preview/utils/TemplateHelperUtils.d.ts +0 -2
- package/dist/cjs/components/template-preview/utils/TemplateHelperUtils.js +1 -1
- package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
- package/dist/cjs/components/variable-picker-v3/model.d.ts +0 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/assets/icons/halfRectangle.svg.js +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/carousel-preview/CarouselPreview.d.ts +5 -2
- package/dist/esm/components/carousel-preview/CarouselPreviewCard.js +1 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +9 -9
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +13 -11
- package/dist/esm/components/template-context-mapper/index.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/modalElements/Body.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/modalElements/Body.js +8 -8
- package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.d.ts +5 -2
- package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +2 -2
- package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +1 -2
- package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +1 -2
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +3 -3
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +4 -6
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
- package/dist/esm/components/template-context-mapper/utils/getDataFromTemplateComponent.d.ts +0 -11
- package/dist/esm/components/template-context-mapper/utils/getDataFromTemplateComponent.js +1 -1
- package/dist/esm/components/template-preview/TemplatePreview.d.ts +6 -8
- 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/ChatUiV2.js +2 -2
- package/dist/esm/components/template-preview/constants/TemplateConstants.d.ts +0 -2
- package/dist/esm/components/template-preview/constants/TemplateConstants.js +1 -1
- package/dist/esm/components/template-preview/index.d.ts +0 -2
- package/dist/esm/components/template-preview/utils/TemplateHelperUtils.d.ts +0 -2
- package/dist/esm/components/template-preview/utils/TemplateHelperUtils.js +1 -1
- package/dist/esm/components/variable-picker-v3/Content.js +1 -1
- package/dist/esm/components/variable-picker-v3/model.d.ts +0 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/template-context-mapper/Mocks/constants.d.ts +0 -4364
- package/dist/cjs/components/template-context-mapper/helpers/WebpushTemplateHelper.d.ts +0 -54
- package/dist/cjs/components/template-context-mapper/helpers/WebpushTemplateHelper.js +0 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditWebpushTemplate.d.ts +0 -10
- package/dist/cjs/components/template-context-mapper/modalElements/EditWebpushTemplate.js +0 -1
- package/dist/cjs/components/template-preview/models/WebpushTemplate.d.ts +0 -72
- package/dist/cjs/components/template-preview/models/WebpushTemplate.js +0 -1
- package/dist/cjs/components/template-preview/models/types.d.ts +0 -9
- package/dist/cjs/components/template-preview/webpush/WebpushPreview.d.ts +0 -8
- package/dist/cjs/components/template-preview/webpush/WebpushPreview.js +0 -1
- package/dist/cjs/components/template-preview/webpush/WebpushPreview.styled.d.ts +0 -1
- package/dist/cjs/components/template-preview/webpush/WebpushPreview.styled.js +0 -70
- package/dist/cjs/utils/variableUtils.d.ts +0 -1
- package/dist/cjs/utils/variableUtils.js +0 -1
- package/dist/esm/components/template-context-mapper/Mocks/constants.d.ts +0 -4364
- package/dist/esm/components/template-context-mapper/helpers/WebpushTemplateHelper.d.ts +0 -54
- package/dist/esm/components/template-context-mapper/helpers/WebpushTemplateHelper.js +0 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditWebpushTemplate.d.ts +0 -10
- package/dist/esm/components/template-context-mapper/modalElements/EditWebpushTemplate.js +0 -1
- package/dist/esm/components/template-preview/models/WebpushTemplate.d.ts +0 -72
- package/dist/esm/components/template-preview/models/WebpushTemplate.js +0 -1
- package/dist/esm/components/template-preview/models/types.d.ts +0 -9
- package/dist/esm/components/template-preview/webpush/WebpushPreview.d.ts +0 -8
- package/dist/esm/components/template-preview/webpush/WebpushPreview.js +0 -1
- package/dist/esm/components/template-preview/webpush/WebpushPreview.styled.d.ts +0 -1
- package/dist/esm/components/template-preview/webpush/WebpushPreview.styled.js +0 -70
- package/dist/esm/utils/variableUtils.d.ts +0 -1
- package/dist/esm/utils/variableUtils.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@emotion/styled/base";import{jsx as o,Fragment as e,jsxs as r}from"react/jsx-runtime";import"@amplitude/analytics-browser";import"../../../../amplitude/model.js";import i from"../../../../utils/StringUtils.js";import{COLORS as s}from"../../../../constants/Theme.js";import"../../../../constants/zindex.js";import{useState as g,useEffect as p}from"react";import"../../../checkBox/CheckBox.styled.js";import{TitleMedium as I}from"../../../TypographyStyle.js";import"../../../list-item/ListItem.js";import"../../../pagination/Pagination.js";import"../../../radioButton/RadioButton.styled.js";import"react-dom";import"react-toastify";import"../../../button/Button.js";import"../../../toaster/Toaster.styled.js";import"../../../tooltips/Tooltip.js";import"../../../spinner/Spinner.js";import"../../../stepper/Stepper.styled.js";import"../../../tag/Tag.js";import"../../../icon-button/IconButton.js";import"../../../template-preview/TemplatePreview.js";import"../../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../../curtain/CurtainHelper.js";import"../../../variable-picker-v3/model.js";import"../../../template-preview/models/TemplateMeta.js";import"../../../template-preview/models/WhatsAppTemplate.js";import"../../../template-preview/models/Channels.js";import"lodash";import"../../../modals/styledModal.js";import"../../../template-context-mapper/context/templateModalContext.js";import"../../../template-context-mapper/modalElements/Footer.js";import"../../../template-context-mapper/modalElements/Body.js";import"../../../template-context-mapper/modalElements/Header.js";import"../../../../_virtual/_tslib.js";import"../../../zeroState/ZeroState.js";import"../../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../../../input/Input.js";import"react-bootstrap";import"../../../floating-action-button/FloatingActionButton.styles.js";import"../../../image-compress/ImageCompress.js";import"../../../progress-bar/ProgressBarComponent.js";import"../../../progress-bar-v2/ProgressBarV2.js";import"../../../QueryBuilder/QueryBuilder.js";import"../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";import"../../../QueryBuilder/constants/connectorPosition.js";import"../../../QueryBuilder/constants/connector.js";import"../../../QueryBuilder/types/QueryBuilder.type.js";import"../../../dropdown/Dropdown.js";import"../../../QueryBuilder/components/InputLoader.js";import"../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js";import"react-chips";import"../../../input/ChipInput.styled.js";import"../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js";import"../../../QueryBuilder/components/Connectors/Components/IgPicker.js";import"../../../QueryBuilder/components/Connectors/Components/InTheLast.js";import"../../../QueryBuilder/components/Connectors/Components/InTwoLast.js";import"react-calendar";import"../../../../utils/DateUtils.js";import"../../../datePicker/DatePickerWrapper.styled.js";import"../../../QueryBuilder/components/Connectors/Connector.styled.js";import"../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js";import"../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js";import"../../../QueryBuilder/redux/queryBuilder.reducer.js";import"../../../QueryBuilder/redux/queryBuilderCache.reducer.js";import"../../../QueryBuilder/types/QueryBuilderOperator.type.js";import"../../../dropdown/DropdownPopover/index.js";import"../../../dropdown/ChipDropdown.js";import"../../../dropdown/MenuItem/MenuItem.js";import"../../../shimmer/ShimmerComponent/ShimmerStyled.js";import"../../../analytics-card/AnalyticsCard.styled.js";import"../../CommonStyles.js";import"../../../datePicker/DatePicker.styled.js";import"../../AnalyticsMetric.js";import"../LineChart/LineChart.js";import"../linearChipGroupedChart/LinearChipGroupedChart.styled.js";import{PieChart as C}from"./PieChart.js";import"../HorizontalBarGraph/HorizontalGraph.js";import"../StackedBarChart/StackedBarChart.js";import"../StackedBarChart/StackedBarDistributionChart.js";import"../StackedBarChart/StackedBarDistributionChart.model.js";import"../VerticalBarGraph/VerticalGraph.js";import"../VerticalBarGraph/FunnelVerticalBarGraph.js";import"../heatmap/HeatMap.js";import"../heatmap/HeatMapVertical.js";import"../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";import"../../../avatar/Avatar.js";import"../../../avatar/AvatarHelper.js";import"../../../alerts/Alert.styled.js";import"../../../alerts/AlertHelper.js";import"../../../thumbnail/Thumbnail.js";import"../../../curtain/Curtain.styled.js";import"../../../switch/Switch.js";import"../../../plans/SubscriptionPlanStyled.js";import"../../../plans/SubscriptionPlanSelector.js";import"../../../plans/SubscriptionPlansCollected.js";import"../../../tabs/Tabs.js";import"../../../TablePagination/TablePagination.styled.js";import"../../../TablePagination/TablePaginationCard.js";import"../../../states/StateComponent.js";import"../../../WhatsAppTextEditor/WhatsAppTextEditor.js";import"../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js";import"../../../card-selection-modal/CardSelectionModal.styled.js";import"react-image-crop";import"../../../buttonGroup/ButtonGroupStyle.js";import"../../../accordion/Accordion.style.js";import"../../../accordion/AccordionArrow.js";import"../../../file-uploader/FileUploaderStyle.js";import"../../../colourInput/ColourInput.styled.js";import"../../../bik-layout/CommonStyles.js";import"../../../navigation-hyperlink/NavigationHyperlink.js";import"../../../bik-layout/SidebarStyles.js";import"date-fns";import"react-popper";import"../../../dropdown/Common.styled.js";import"../../../custom-date-time/CustomDateTime.styled.js";import"../../../../node_modules/lodash.debounce/index.js";import"../../../product-picker/ProductPicker.styled.js";import"../../../discount-modal/type.js";import"../../../product-picker-v2/modal.js";import"../../../modals/modal.styled.js";import"../../../variable-picker-v3/NoResult.js";import"../../../variable-picker-v3/styles.js";import"../../../discount-modal/DiscountModal.styled.js";import"../../../discount-modal/DynamicCoupon/DynamicCoupon.js";import"../../../country-code-picker/CountryCodePicker.styled.js";import"../../../carousel/carousel.js";import"../../../carousel-secondary/CarouselSecondary.style.js";import"../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js";import"../../../radioList/RadioList.styled.js";import"../../../checkList/CheckList.styled.js";import"../../../postPicker/postPicker.js";import"../../../dropdown-button/DropdownButton.style.js";import"../../../side-modal/SideModal.style.js";import"../../../add-variableV2/AddVariableV2.styled.js";import"../../../SearchFilter/types/SearchFilter.type.js";import"../../../SearchFilter/components/DatePickerButton.js";import"../../../SearchFilter/components/DateRangeOnlyButton.js";import"../../../input-with-vars/InputWithVariables.js";import"../../../star-rating/StarRating.js";import"../../../dashboard-review-popup/components/FiveStar.styled.js";import"../../../dashboard-review-popup/components/Form.styled.js";import"../../../dashboard-review-popup/components/ZeroState.js";import"../../../dashboard-review-popup/DashboardReviewPopUp.styled.js";import"../../../testimonial-card/TestimonialCard.style.js";import"../../../slider/slider.js";import"react-slick";import"../../../carousel-preview/CarouselPreview.style.js";import"../../../card-selector/CardSelector.styled.js";import"../../../action-button/ActionButton.styled.js";import{Chart as c,ArcElement as a,Legend as l}from"chart.js";import{Doughnut as d}from"react-chartjs-2";c.register(a,l);const A={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:t=>{if(!t.label)return" 0%";const o=t.dataset.data.reduce(((t,o)=>t+o),0),e=parseFloat((t.raw/o*100).toFixed(1));return` ${t.label}: ${e}%`}}}}},m=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],n=t("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(t=>s.surface.standard),";border:1px solid ",(t=>s.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQzhCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4LCBGcmFnbWVudCBhcyBfRnJhZ21lbnQsIGpzeHMgYXMgX2pzeHMgfSBmcm9tIFwicmVhY3QvanN4LXJ1bnRpbWVcIjtcclxuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgeyBTdHJpbmdVdGlscyB9IGZyb20gXCIuLi8uLi8uLi8uLi9pbmRleFwiO1xyXG5pbXBvcnQgeyBBcmNFbGVtZW50LCBDaGFydCBhcyBDaGFydEpTLCBMZWdlbmQgfSBmcm9tICdjaGFydC5qcyc7XHJcbmltcG9ydCB7IHVzZUVmZmVjdCwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IERvdWdobnV0IH0gZnJvbSAncmVhY3QtY2hhcnRqcy0yJztcclxuaW1wb3J0IHsgVGl0bGVNZWRpdW0gfSBmcm9tIFwiLi4vLi4vLi4vVHlwb2dyYXBoeVN0eWxlXCI7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi8uLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuaW1wb3J0IHsgUGllQ2hhcnQgfSBmcm9tICcuL1BpZUNoYXJ0JztcclxuQ2hhcnRKUy5yZWdpc3RlcihBcmNFbGVtZW50LCBMZWdlbmQpO1xyXG5jb25zdCBvcHRpb25zID0ge1xyXG4gICAgcGx1Z2luczoge1xyXG4gICAgICAgIGxlZ2VuZDoge1xyXG4gICAgICAgICAgICBkaXNwbGF5OiBmYWxzZSxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHRvb2x0aXA6IHtcclxuICAgICAgICAgICAgZW5hYmxlZDogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2tzOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgICR7dG9vbHRpcEl0ZW0ubGFiZWx9OiAke3BlcmNlbnRhZ2V9JWA7XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG59O1xyXG5jb25zdCBHUkFQSF9DT0xPUlMgPSBbXHJcbiAgICAnIzVFMDdCQicsXHJcbiAgICAnIzlFNzdFRCcsXHJcbiAgICAnI0QyQUVGRicsXHJcbiAgICAnI0NERTFGRicsXHJcbiAgICAnIzkyQUZGQScsXHJcbiAgICAnIzM5MzVFMScsXHJcbl07XHJcbmNvbnN0IENhcnRTdHlsZWQgPSBzdHlsZWQuZGl2IGBcblx0YmFja2dyb3VuZDogJHsocHJvcHMpID0+IENPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAxcHggc29saWQgJHsocHJvcHMpID0+IENPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGJvcmRlci1yYWRpdXM6IDRweDtcbmA7XHJcbmV4cG9ydCBjb25zdCBDYXJkID0gKHByb3BzKSA9PiB7XHJcbiAgICByZXR1cm4gX2pzeChDYXJ0U3R5bGVkLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHsgcGFkZGluZzogMjQgfSB9LCB7IGNoaWxkcmVuOiBwcm9wcy5jaGlsZHJlbiB9KSk7XHJcbn07XHJcbmV4cG9ydCBjb25zdCBQaWVDaGFydEFuYWx5dGljcyA9ICh7IHRpdGxlLCBzbGljZXMsIHNpemUsIH0pID0+IHtcclxuICAgIGNvbnN0IFtzbGljZXNXaXRoQ29sb3IsIHNldFNsaWNlc1dpdGhDb2xvcl0gPSB1c2VTdGF0ZShbXSk7XHJcbiAgICBjb25zdCBbZGF0YSwgc2V0RGF0YV0gPSB1c2VTdGF0ZSgpO1xyXG4gICAgdXNlRWZmZWN0KCgpID0+IHtcclxuICAgICAgICBjb25zdCB0b3RhbFN1bSA9IHNsaWNlcy5yZWR1Y2UoKHN1bSwgc2xpY2UpID0+IHN1bSArIHNsaWNlLmNvdW50LCAwKTtcclxuICAgICAgICBsZXQgdXBkYXRlZFNsaWNlc1dpdGhDb2xvciA9IFtdO1xyXG4gICAgICAgIHVwZGF0ZWRTbGljZXNXaXRoQ29sb3IgPSBPYmplY3Qua2V5cyhzbGljZXMpLm1hcCgoa2V5LCBpbmRleCkgPT4gKE9iamVjdC5hc3NpZ24oeyBjb2xvcjogR1JBUEhfQ09MT1JTW2luZGV4ICUgR1JBUEhfQ09MT1JTLmxlbmd0aF0gfSwgc2xpY2VzW2tleV0pKSk7XHJcbiAgICAgICAgc2V0U2xpY2VzV2l0aENvbG9yKFsuLi51cGRhdGVkU2xpY2VzV2l0aENvbG9yXSk7XHJcbiAgICAgICAgaWYgKHRvdGFsU3VtID09PSAwKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGRhdGFTZXQgPSB7XHJcbiAgICAgICAgICAgICAgICBkYXRhc2V0czogW1xyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgfSwgW3NsaWNlc10pO1xyXG4gICAgaWYgKCFkYXRhKSB7XHJcbiAgICAgICAgcmV0dXJuIF9qc3goX0ZyYWdtZW50LCB7fSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gKF9qc3hzKF9GcmFnbWVudCwgeyBjaGlsZHJlbjogW3RpdGxlICYmIChfanN4KFRpdGxlTWVkaXVtLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICBtYXJnaW5Cb3R0b206IDE2LFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiB0aXRsZSB9KSkpLCBfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAncm93JyB9LCB7IGNoaWxkcmVuOiBbX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnIH0sIHsgY2hpbGRyZW46IF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHNpemUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBzaXplLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KERvdWdobnV0LCB7IGRhdGE6IGRhdGEsIG9wdGlvbnM6IE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSwgb3B0aW9ucyksIHsgbWFpbnRhaW5Bc3BlY3RSYXRpbzogc2l6ZSA/IGZhbHNlIDogdHJ1ZSB9KSB9KSB9KSkgfSkpLCBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicsIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */")),b=t=>o(n,Object.assign({style:{padding:24}},{children:t.children})),u=t=>{let{title:s,slices:c,size:a}=t;const[l,n]=g([]),[b,u]=g();return p((()=>{const t=c.reduce(((t,o)=>t+o.count),0);let o=[];if(o=Object.keys(c).map(((t,o)=>Object.assign({color:m[o%m.length]},c[t]))),n([...o]),0===t){u({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const t={labels:c.map((t=>i.capitalize(t.name))),datasets:[{data:c.map((t=>t.count)),backgroundColor:c.map(((t,o)=>{var e;return null!==(e=t.color)&&void 0!==e?e:m[o%m.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};u(t)}}),[c]),b?r(e,{children:[s&&o(I,Object.assign({style:{marginBottom:16}},{children:s})),r("div",Object.assign({className:"row"},{children:[o("div",Object.assign({className:"col-6"},{children:o("div",Object.assign({style:{width:a,height:a}},{children:o(d,{data:b,options:Object.assign(Object.assign({},A),{maintainAspectRatio:!a})})}))})),o("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:o(C,{slices:l})}))]}))]}):o(e,{})};export{b as Card,u as PieChartAnalytics};
|
|
1
|
+
import t from"@emotion/styled/base";import{jsx as o,Fragment as e,jsxs as r}from"react/jsx-runtime";import"@amplitude/analytics-browser";import"../../../../amplitude/model.js";import i from"../../../../utils/StringUtils.js";import{COLORS as s}from"../../../../constants/Theme.js";import"../../../../constants/zindex.js";import{useState as g,useEffect as p}from"react";import"../../../checkBox/CheckBox.styled.js";import{TitleMedium as I}from"../../../TypographyStyle.js";import"../../../list-item/ListItem.js";import"../../../pagination/Pagination.js";import"../../../radioButton/RadioButton.styled.js";import"react-dom";import"react-toastify";import"../../../button/Button.js";import"../../../toaster/Toaster.styled.js";import"../../../tooltips/Tooltip.js";import"../../../spinner/Spinner.js";import"../../../stepper/Stepper.styled.js";import"../../../tag/Tag.js";import"../../../icon-button/IconButton.js";import"../../../template-preview/TemplatePreview.js";import"../../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../../curtain/CurtainHelper.js";import"../../../variable-picker-v3/model.js";import"../../../template-preview/models/TemplateMeta.js";import"../../../template-preview/models/WhatsAppTemplate.js";import"lodash";import"../../../modals/styledModal.js";import"../../../template-preview/models/Channels.js";import"../../../template-context-mapper/context/templateModalContext.js";import"../../../template-context-mapper/modalElements/Footer.js";import"../../../template-context-mapper/modalElements/Body.js";import"../../../template-context-mapper/modalElements/Header.js";import"../../../zeroState/ZeroState.js";import"../../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../../../input/Input.js";import"react-bootstrap";import"../../../floating-action-button/FloatingActionButton.styles.js";import"../../../image-compress/ImageCompress.js";import"../../../progress-bar/ProgressBarComponent.js";import"../../../progress-bar-v2/ProgressBarV2.js";import"../../../QueryBuilder/QueryBuilder.js";import"../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";import"../../../QueryBuilder/constants/connectorPosition.js";import"../../../QueryBuilder/constants/connector.js";import"../../../QueryBuilder/types/QueryBuilder.type.js";import"../../../dropdown/Dropdown.js";import"../../../QueryBuilder/components/InputLoader.js";import"../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js";import"react-chips";import"../../../input/ChipInput.styled.js";import"../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js";import"../../../QueryBuilder/components/Connectors/Components/IgPicker.js";import"../../../QueryBuilder/components/Connectors/Components/InTheLast.js";import"../../../QueryBuilder/components/Connectors/Components/InTwoLast.js";import"react-calendar";import"../../../../utils/DateUtils.js";import"../../../datePicker/DatePickerWrapper.styled.js";import"../../../QueryBuilder/components/Connectors/Connector.styled.js";import"../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js";import"../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js";import"../../../QueryBuilder/redux/queryBuilder.reducer.js";import"../../../QueryBuilder/redux/queryBuilderCache.reducer.js";import"../../../QueryBuilder/types/QueryBuilderOperator.type.js";import"../../../dropdown/DropdownPopover/index.js";import"../../../dropdown/ChipDropdown.js";import"../../../dropdown/MenuItem/MenuItem.js";import"../../../shimmer/ShimmerComponent/ShimmerStyled.js";import"../../../analytics-card/AnalyticsCard.styled.js";import"../../CommonStyles.js";import"../../../datePicker/DatePicker.styled.js";import"../../AnalyticsMetric.js";import"../LineChart/LineChart.js";import"../linearChipGroupedChart/LinearChipGroupedChart.styled.js";import{PieChart as C}from"./PieChart.js";import"../HorizontalBarGraph/HorizontalGraph.js";import"../StackedBarChart/StackedBarChart.js";import"../StackedBarChart/StackedBarDistributionChart.js";import"../StackedBarChart/StackedBarDistributionChart.model.js";import"../VerticalBarGraph/VerticalGraph.js";import"../VerticalBarGraph/FunnelVerticalBarGraph.js";import"../heatmap/HeatMap.js";import"../heatmap/HeatMapVertical.js";import"../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";import"../../../avatar/Avatar.js";import"../../../avatar/AvatarHelper.js";import"../../../alerts/Alert.styled.js";import"../../../alerts/AlertHelper.js";import"../../../thumbnail/Thumbnail.js";import"../../../curtain/Curtain.styled.js";import"../../../switch/Switch.js";import"../../../plans/SubscriptionPlanStyled.js";import"../../../plans/SubscriptionPlanSelector.js";import"../../../plans/SubscriptionPlansCollected.js";import"../../../tabs/Tabs.js";import"../../../TablePagination/TablePagination.styled.js";import"../../../TablePagination/TablePaginationCard.js";import"../../../states/StateComponent.js";import"../../../../_virtual/_tslib.js";import"../../../WhatsAppTextEditor/WhatsAppTextEditor.js";import"../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js";import"../../../card-selection-modal/CardSelectionModal.styled.js";import"react-image-crop";import"../../../buttonGroup/ButtonGroupStyle.js";import"../../../accordion/Accordion.style.js";import"../../../accordion/AccordionArrow.js";import"../../../file-uploader/FileUploaderStyle.js";import"../../../colourInput/ColourInput.styled.js";import"../../../bik-layout/CommonStyles.js";import"../../../navigation-hyperlink/NavigationHyperlink.js";import"../../../bik-layout/SidebarStyles.js";import"date-fns";import"react-popper";import"../../../dropdown/Common.styled.js";import"../../../custom-date-time/CustomDateTime.styled.js";import"../../../../node_modules/lodash.debounce/index.js";import"../../../product-picker/ProductPicker.styled.js";import"../../../discount-modal/type.js";import"../../../product-picker-v2/modal.js";import"../../../modals/modal.styled.js";import"../../../variable-picker-v3/NoResult.js";import"../../../variable-picker-v3/styles.js";import"../../../discount-modal/DiscountModal.styled.js";import"../../../discount-modal/DynamicCoupon/DynamicCoupon.js";import"../../../country-code-picker/CountryCodePicker.styled.js";import"../../../carousel/carousel.js";import"../../../carousel-secondary/CarouselSecondary.style.js";import"../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js";import"../../../radioList/RadioList.styled.js";import"../../../checkList/CheckList.styled.js";import"../../../postPicker/postPicker.js";import"../../../dropdown-button/DropdownButton.style.js";import"../../../side-modal/SideModal.style.js";import"../../../add-variableV2/AddVariableV2.styled.js";import"../../../SearchFilter/types/SearchFilter.type.js";import"../../../SearchFilter/components/DatePickerButton.js";import"../../../SearchFilter/components/DateRangeOnlyButton.js";import"../../../input-with-vars/InputWithVariables.js";import"../../../star-rating/StarRating.js";import"../../../dashboard-review-popup/components/FiveStar.styled.js";import"../../../dashboard-review-popup/components/Form.styled.js";import"../../../dashboard-review-popup/components/ZeroState.js";import"../../../dashboard-review-popup/DashboardReviewPopUp.styled.js";import"../../../testimonial-card/TestimonialCard.style.js";import"../../../slider/slider.js";import"react-slick";import"../../../carousel-preview/CarouselPreview.style.js";import"../../../card-selector/CardSelector.styled.js";import"../../../action-button/ActionButton.styled.js";import{Chart as c,ArcElement as a,Legend as l}from"chart.js";import{Doughnut as d}from"react-chartjs-2";c.register(a,l);const A={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:t=>{if(!t.label)return" 0%";const o=t.dataset.data.reduce(((t,o)=>t+o),0),e=parseFloat((t.raw/o*100).toFixed(1));return` ${t.label}: ${e}%`}}}}},m=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],n=t("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(t=>s.surface.standard),";border:1px solid ",(t=>s.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQzhCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4LCBGcmFnbWVudCBhcyBfRnJhZ21lbnQsIGpzeHMgYXMgX2pzeHMgfSBmcm9tIFwicmVhY3QvanN4LXJ1bnRpbWVcIjtcclxuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgeyBTdHJpbmdVdGlscyB9IGZyb20gXCIuLi8uLi8uLi8uLi9pbmRleFwiO1xyXG5pbXBvcnQgeyBBcmNFbGVtZW50LCBDaGFydCBhcyBDaGFydEpTLCBMZWdlbmQgfSBmcm9tICdjaGFydC5qcyc7XHJcbmltcG9ydCB7IHVzZUVmZmVjdCwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IERvdWdobnV0IH0gZnJvbSAncmVhY3QtY2hhcnRqcy0yJztcclxuaW1wb3J0IHsgVGl0bGVNZWRpdW0gfSBmcm9tIFwiLi4vLi4vLi4vVHlwb2dyYXBoeVN0eWxlXCI7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi8uLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuaW1wb3J0IHsgUGllQ2hhcnQgfSBmcm9tICcuL1BpZUNoYXJ0JztcclxuQ2hhcnRKUy5yZWdpc3RlcihBcmNFbGVtZW50LCBMZWdlbmQpO1xyXG5jb25zdCBvcHRpb25zID0ge1xyXG4gICAgcGx1Z2luczoge1xyXG4gICAgICAgIGxlZ2VuZDoge1xyXG4gICAgICAgICAgICBkaXNwbGF5OiBmYWxzZSxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHRvb2x0aXA6IHtcclxuICAgICAgICAgICAgZW5hYmxlZDogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2tzOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgICR7dG9vbHRpcEl0ZW0ubGFiZWx9OiAke3BlcmNlbnRhZ2V9JWA7XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG59O1xyXG5jb25zdCBHUkFQSF9DT0xPUlMgPSBbXHJcbiAgICAnIzVFMDdCQicsXHJcbiAgICAnIzlFNzdFRCcsXHJcbiAgICAnI0QyQUVGRicsXHJcbiAgICAnI0NERTFGRicsXHJcbiAgICAnIzkyQUZGQScsXHJcbiAgICAnIzM5MzVFMScsXHJcbl07XHJcbmNvbnN0IENhcnRTdHlsZWQgPSBzdHlsZWQuZGl2IGBcblx0YmFja2dyb3VuZDogJHsocHJvcHMpID0+IENPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAxcHggc29saWQgJHsocHJvcHMpID0+IENPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGJvcmRlci1yYWRpdXM6IDRweDtcbmA7XHJcbmV4cG9ydCBjb25zdCBDYXJkID0gKHByb3BzKSA9PiB7XHJcbiAgICByZXR1cm4gX2pzeChDYXJ0U3R5bGVkLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHsgcGFkZGluZzogMjQgfSB9LCB7IGNoaWxkcmVuOiBwcm9wcy5jaGlsZHJlbiB9KSk7XHJcbn07XHJcbmV4cG9ydCBjb25zdCBQaWVDaGFydEFuYWx5dGljcyA9ICh7IHRpdGxlLCBzbGljZXMsIHNpemUsIH0pID0+IHtcclxuICAgIGNvbnN0IFtzbGljZXNXaXRoQ29sb3IsIHNldFNsaWNlc1dpdGhDb2xvcl0gPSB1c2VTdGF0ZShbXSk7XHJcbiAgICBjb25zdCBbZGF0YSwgc2V0RGF0YV0gPSB1c2VTdGF0ZSgpO1xyXG4gICAgdXNlRWZmZWN0KCgpID0+IHtcclxuICAgICAgICBjb25zdCB0b3RhbFN1bSA9IHNsaWNlcy5yZWR1Y2UoKHN1bSwgc2xpY2UpID0+IHN1bSArIHNsaWNlLmNvdW50LCAwKTtcclxuICAgICAgICBsZXQgdXBkYXRlZFNsaWNlc1dpdGhDb2xvciA9IFtdO1xyXG4gICAgICAgIHVwZGF0ZWRTbGljZXNXaXRoQ29sb3IgPSBPYmplY3Qua2V5cyhzbGljZXMpLm1hcCgoa2V5LCBpbmRleCkgPT4gKE9iamVjdC5hc3NpZ24oeyBjb2xvcjogR1JBUEhfQ09MT1JTW2luZGV4ICUgR1JBUEhfQ09MT1JTLmxlbmd0aF0gfSwgc2xpY2VzW2tleV0pKSk7XHJcbiAgICAgICAgc2V0U2xpY2VzV2l0aENvbG9yKFsuLi51cGRhdGVkU2xpY2VzV2l0aENvbG9yXSk7XHJcbiAgICAgICAgaWYgKHRvdGFsU3VtID09PSAwKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGRhdGFTZXQgPSB7XHJcbiAgICAgICAgICAgICAgICBkYXRhc2V0czogW1xyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgfSwgW3NsaWNlc10pO1xyXG4gICAgaWYgKCFkYXRhKSB7XHJcbiAgICAgICAgcmV0dXJuIF9qc3goX0ZyYWdtZW50LCB7fSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gKF9qc3hzKF9GcmFnbWVudCwgeyBjaGlsZHJlbjogW3RpdGxlICYmIChfanN4KFRpdGxlTWVkaXVtLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICBtYXJnaW5Cb3R0b206IDE2LFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiB0aXRsZSB9KSkpLCBfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAncm93JyB9LCB7IGNoaWxkcmVuOiBbX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnIH0sIHsgY2hpbGRyZW46IF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHNpemUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBzaXplLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KERvdWdobnV0LCB7IGRhdGE6IGRhdGEsIG9wdGlvbnM6IE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSwgb3B0aW9ucyksIHsgbWFpbnRhaW5Bc3BlY3RSYXRpbzogc2l6ZSA/IGZhbHNlIDogdHJ1ZSB9KSB9KSB9KSkgfSkpLCBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicsIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */")),b=t=>o(n,Object.assign({style:{padding:24}},{children:t.children})),u=t=>{let{title:s,slices:c,size:a}=t;const[l,n]=g([]),[b,u]=g();return p((()=>{const t=c.reduce(((t,o)=>t+o.count),0);let o=[];if(o=Object.keys(c).map(((t,o)=>Object.assign({color:m[o%m.length]},c[t]))),n([...o]),0===t){u({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const t={labels:c.map((t=>i.capitalize(t.name))),datasets:[{data:c.map((t=>t.count)),backgroundColor:c.map(((t,o)=>{var e;return null!==(e=t.color)&&void 0!==e?e:m[o%m.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};u(t)}}),[c]),b?r(e,{children:[s&&o(I,Object.assign({style:{marginBottom:16}},{children:s})),r("div",Object.assign({className:"row"},{children:[o("div",Object.assign({className:"col-6"},{children:o("div",Object.assign({style:{width:a,height:a}},{children:o(d,{data:b,options:Object.assign(Object.assign({},A),{maintainAspectRatio:!a})})}))})),o("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:o(C,{slices:l})}))]}))]}):o(e,{})};export{b as Card,u as PieChartAnalytics};
|
|
@@ -2,10 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import 'slick-carousel/slick/slick-theme.css';
|
|
3
3
|
import 'slick-carousel/slick/slick.css';
|
|
4
4
|
import { CHANNEL_TYPE } from "../template-preview/models/Channels";
|
|
5
|
-
import {
|
|
5
|
+
import { EmailTemplateType } from "../template-preview/models/EmailTemplate";
|
|
6
|
+
import { SMSTemplateType } from "../template-preview/models/SmsTemplate";
|
|
7
|
+
import { WhatsAppCarouselTemplate } from "../template-preview/models/WhatsappCarouselTemplate";
|
|
8
|
+
import { WhatsAppTemplate } from "../template-preview/models/WhatsAppTemplate";
|
|
6
9
|
export declare const CarouselPreview: React.ForwardRefExoticComponent<{
|
|
7
10
|
channel: CHANNEL_TYPE;
|
|
8
|
-
template:
|
|
11
|
+
template: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | null;
|
|
9
12
|
showSampleValues?: boolean | undefined;
|
|
10
13
|
isPreview?: boolean | undefined;
|
|
11
14
|
removeBottomBorder?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import t from"react";import{useTemplateModalContext as a}from"../template-context-mapper/context/templateModalContext.js";import{TemplatePreview as p}from"../template-preview/TemplatePreview.js";import"../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../constants/Theme.js";import"../curtain/CurtainHelper.js";import"../variable-picker-v3/model.js";import"../template-preview/models/TemplateMeta.js";import"../template-preview/models/WhatsAppTemplate.js";
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import t from"react";import{useTemplateModalContext as a}from"../template-context-mapper/context/templateModalContext.js";import{TemplatePreview as p}from"../template-preview/TemplatePreview.js";import"../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../constants/Theme.js";import"../curtain/CurtainHelper.js";import"../variable-picker-v3/model.js";import"../template-preview/models/TemplateMeta.js";import"../template-preview/models/WhatsAppTemplate.js";const r=t.forwardRef((t=>{let{channel:r,currentTemplate:i,showSampleValues:l,carouselCardIndex:o,isPreview:s,width:m}=t;var n,d,h;const{cardWidth:c,template:v}=a(),u=(null!==(h=null===(d=null===(n=null==v?void 0:v.components)||void 0===n?void 0:n[1].cards)||void 0===d?void 0:d.length)&&void 0!==h?h:0)-1===o?12:0;return e("div",Object.assign({style:{width:m||c,height:(null!=o?o:-1)>-1?"100%":"auto"}},{children:e(p,{showSampleValues:l,template:i,channel:r,size:"small",hideHeader:!0,carouselCardIndex:o,isWhatsappCarousel:!0,isPreview:s,whatsAppSpecificMeta:{templateContainerStyles:{marginRight:u,height:"100%"}}})}))}));export{r as default};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { VariableListInterfaceV2 } from "../add-variableV2/AddVariableV2";
|
|
2
3
|
import { CarouselProduct } from "./modalElements/EditWhatsAppCarouselTemplateV2";
|
|
3
|
-
import { WhatsAppCarouselTemplateVariables } from "../template-preview/models/WhatsappCarouselTemplate";
|
|
4
|
+
import { WhatsAppCarouselTemplate, WhatsAppCarouselTemplateVariables } from "../template-preview/models/WhatsappCarouselTemplate";
|
|
4
5
|
import { CHANNEL_TYPE } from '../template-preview/models/Channels';
|
|
6
|
+
import { EmailTemplateType } from '../template-preview/models/EmailTemplate';
|
|
7
|
+
import { SMSTemplateType } from '../template-preview/models/SmsTemplate';
|
|
5
8
|
import { CUSTOM_VARIABLE, GlobalPlaceholderType } from '../template-preview/models/TemplateMeta';
|
|
6
|
-
import {
|
|
7
|
-
import { WebpushTemplateVariables } from '../template-preview/models/WebpushTemplate';
|
|
8
|
-
import { ExtrasWhatsapp, POD, WhatsAppPickerMeta, WhatsAppTemplateVariables } from '../template-preview/models/WhatsAppTemplate';
|
|
9
|
+
import { ExtrasWhatsapp, POD, WhatsAppPickerMeta, WhatsAppTemplate, WhatsAppTemplateVariables } from '../template-preview/models/WhatsAppTemplate';
|
|
9
10
|
import { VariableV3 } from '../variable-picker-v3/model';
|
|
10
11
|
export interface TemplateContextMapperProps {
|
|
11
|
-
selectedTemplate:
|
|
12
|
+
selectedTemplate: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate;
|
|
12
13
|
closeDialog?: () => void;
|
|
13
14
|
showVariableMapping: boolean;
|
|
14
15
|
channel: CHANNEL_TYPE;
|
|
15
16
|
globalPlaceholders: GlobalPlaceholderType;
|
|
16
17
|
/** List of variables being used in this template */
|
|
17
|
-
templateVariables: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables
|
|
18
|
+
templateVariables: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables;
|
|
18
19
|
/** Only for initial-UI-purpose for the modal */
|
|
19
20
|
htmlContent: string;
|
|
20
21
|
showOnlyContent?: boolean;
|
|
21
|
-
onTemplateSelect?(template:
|
|
22
|
+
onTemplateSelect?(template: EmailTemplateType | SMSTemplateType | WhatsAppTemplate | WhatsAppCarouselTemplate, variables: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables, display_content?: string, carouselProducts?: CarouselProduct[]): {
|
|
22
23
|
error: string;
|
|
23
24
|
errorIndexes?: number[];
|
|
24
25
|
templateErrorIndexes?: {
|
|
@@ -55,6 +56,5 @@ export interface TemplateContextMapperProps {
|
|
|
55
56
|
hideDeviceContainerInPreview?: boolean;
|
|
56
57
|
maxCharLimit?: number;
|
|
57
58
|
onDefaultVariableSelect?: (variable: VariableV3) => void;
|
|
58
|
-
skipDefaultVariableContent?: boolean;
|
|
59
59
|
}
|
|
60
|
-
export declare const TemplateContextMapper:
|
|
60
|
+
export declare const TemplateContextMapper: React.FC<TemplateContextMapperProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as l,Fragment as o}from"react/jsx-runtime";import{cloneDeep as t}from"lodash";import{useEffect as r,useState as i,useRef as a,useMemo as s}from"react";import n from"../../utils/StringUtils.js";import{COLORS as d}from"../../constants/Theme.js";import{StyledModal as u}from"../modals/styledModal.js";import{CHANNEL_TYPE as c}from"../template-preview/models/Channels.js";import{POD as p}from"../template-preview/models/WhatsAppTemplate.js";import{TemplateModalContext as m}from"./context/templateModalContext.js";import v from"./modalElements/Footer.js";import h from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as b}from"./utils/convertPlaceholdersToBikDropdown.js";const C=C=>{let{selectedTemplate:
|
|
1
|
+
import{jsx as e,jsxs as l,Fragment as o}from"react/jsx-runtime";import{cloneDeep as t}from"lodash";import{useEffect as r,useState as i,useRef as a,useMemo as s}from"react";import n from"../../utils/StringUtils.js";import{COLORS as d}from"../../constants/Theme.js";import{StyledModal as u}from"../modals/styledModal.js";import{CHANNEL_TYPE as c}from"../template-preview/models/Channels.js";import{POD as p}from"../template-preview/models/WhatsAppTemplate.js";import{TemplateModalContext as m}from"./context/templateModalContext.js";import v from"./modalElements/Footer.js";import h from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as b}from"./utils/convertPlaceholdersToBikDropdown.js";const C=C=>{let{selectedTemplate:g,closeDialog:f,showVariableMapping:x,channel:P,htmlContent:E,templateVariables:S,onTemplateSelect:I,globalPlaceholders:T,showOnlyContent:y,whatsappSpecificPickerMeta:w,zIndex:V,showVariableModal:L,variableList:k,discountCode:j,setDiscountCode:D,onBackPress:M,enabledCustomText:A,variableListForImage:B,showSampleValues:F,disableEditVariable:H,pod:O,extras:W,pickerConf:N,selectedCarouselProducts:z,disableEditExpiry:R,cardWidth:$,onDeleteSelectedProducts:U,fileName:_,setFileName:q,hideDeviceContainerInPreview:G,maxCharLimit:J,onDefaultVariableSelect:K}=C;var Q,X,Y,Z,ee,le,oe,te;r((()=>{ce(E)}),[E]);const re=P===c.WHATSAPP&&"CAROUSEL"===(null===(X=null===(Q=null==g?void 0:g.components)||void 0===Q?void 0:Q[1])||void 0===X?void 0:X.type),ie=null==g?void 0:g.isProductCarouselType,[ae,se]=i(P===c.EMAIL||re?"desktop":"mobile"),[ne,de]=i(!1),[ue,ce]=i(E),[pe,me]=i(!1),[ve,he]=i([]),[be,Ce]=i({}),[ge,fe]=i(g),[xe,Pe]=i([]),[Ee,Se]=i(null),[Ie,Te]=i(!1),[ye,we]=i(null!=S?S:[]),[Ve,Le]=i(!1),[ke,je]=i(re?(null===(Z=null===(Y=null==ge?void 0:ge.mapping)||void 0===Y?void 0:Y.body)||void 0===Z?void 0:Z.length)?-1:0:-1),[De,Me]=i([]),[Ae,Be]=i(void 0),Fe=a(null),[He,Oe]=i(!1),[We,Ne]=i(!1),[ze,Re]=i(!1),[$e,Ue]=i({});r((()=>{z?Me(z):ie&&Me([])}),[z]),r((()=>{var e;if(!Ie&&ie&&(!z||0===Me.length)){const l=null===(e=null==ge?void 0:ge.components)||void 0===e?void 0:e[1].cards,o=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,t,r;"HEADER"===e.type&&o.push(null!==(r=null===(t=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===t?void 0:t[0])&&void 0!==r?r:"")}))})),Pe(o),Te(!0)}}),[Ie]);const _e=s((()=>b(T)),[T]);return r((()=>{Be(t(k))}),[k]),e(m.Provider,Object.assign({value:{hideFooterButton:ze,setHideFooterButton:Re,hideCrossButton:We,setHideCrossButton:Ne,variableList:Ae,setVariableList:Be,variableCallback:Ee,setVariableCallback:Se,showVariablePicker:ne,setShowVariablePicker:de,template:ge,setTemplate:fe,device:ae,setDevice:se,display_content:ue,setDisplayContent:ce,originalVariableList:ye,setOriginalVariableList:we,isError:pe,setIsError:me,channel:P,globalNormalizedPlaceholders:_e,templateSelectionTriggered:Ve,setTemplateSelectionTriggered:Le,enabledCustomText:A,disableEditVariable:H,pod:O,extras:W,isWhatsappCarousel:re,selectedCarouselIndex:ke,setSelectedCarouselIndex:je,isProductCarouselType:ie,templateErrorIndexes:be,cardCount:re?null===(le=null===(ee=g.components)||void 0===ee?void 0:ee[1].cards)||void 0===le?void 0:le.length:void 0,errorIndexes:ve,setErrorIndexes:he,pickerConf:N,carouselProducts:De,setCarouselProducts:Me,disableEditExpiry:R,cardWidth:$,cardImages:xe,onDeleteSelectedProducts:U,hideDeviceContainerInPreview:G,sliderRef:Fe,isCarouselHovered:He,setIsCarouselHovered:Oe,maxCharLimit:J,ctaOptionsErrors:$e,setCtaOptionsErrors:Ue,onDefaultVariableSelect:K}},{children:y?e(h,{variableListFromProps:k,channel:c.EMAIL,hideHeader:!0}):l(u,Object.assign({hideCrossButton:We,zIndex:V,centralContainerStyles:{width:re?900:P===c.EMAIL&&x?1e3:800},open:!0,onClose:()=>{null==f||f()},headingTitle:null==ge?void 0:ge.label,headingSubtitle:P===c.WHATSAPP?`${n.capitaliseFirstLetterOfString(null!==(oe=null==ge?void 0:ge.category)&&void 0!==oe?oe:"")} • ${null!==(te=null==ge?void 0:ge.templateCategory)&&void 0!==te?te:""}`:"",onBackPress:()=>{null==M||M()},modalHeaderStyles:{borderBottom:`1px solid ${d.stroke.primary}`}},{children:[e(h,{variableListFromProps:k,showSampleValues:F,showVariableMapping:x,channel:P,whatsappSpecificPickerMeta:w,showVariableModal:L,discountCode:j,setDiscountCode:D,variableListForImage:B&&(null==B?void 0:B.length)>0?B:Ae,fileName:_,setFileName:e=>{null==q||q(e)}}),I?e(v,{isWhatsappCarousel:null!=re&&re,onSelect:function(){var e;if((null==De?void 0:De.length)<1&&ie)return void me(!0);if(Object.keys($e).length>0&&O!==p.CHATBOT)return void me(!0);const l=null==I?void 0:I(ge,ye,null!=ue?ue:"",De);Ce(null!==(e=null==l?void 0:l.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==l?void 0:l.errorIndexes)||(null==l?void 0:l.error)?((null==l?void 0:l.errorIndexes)&&he(l.errorIndexes),(null==l?void 0:l.error)&&me(!!(null==l?void 0:l.error))):Le(!0)}}):e(o,{})]}))}))};export{C as TemplateContextMapper};
|
|
@@ -4,9 +4,11 @@ import Slider from 'react-slick';
|
|
|
4
4
|
import { VariableListInterfaceV2 } from "../../add-variableV2";
|
|
5
5
|
import { CarouselProduct } from "../modalElements/EditWhatsAppCarouselTemplateV2";
|
|
6
6
|
import { CHANNEL_TYPE } from "../../template-preview/models/Channels";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { EmailTemplateType } from "../../template-preview/models/EmailTemplate";
|
|
8
|
+
import { SMSTemplateType } from "../../template-preview/models/SmsTemplate";
|
|
9
|
+
import { CUSTOM_VARIABLE, globalNormalizedPlaceholdersType } from "../../template-preview/models/TemplateMeta";
|
|
10
|
+
import { WhatsAppCarouselTemplate, WhatsAppCarouselTemplateVariables } from "../../template-preview/models/WhatsappCarouselTemplate";
|
|
11
|
+
import { ExtrasWhatsapp, WhatsAppTemplate, WhatsAppTemplateVariables } from "../../template-preview/models/WhatsAppTemplate";
|
|
10
12
|
export type DEVICE_TYPES = 'desktop' | 'mobile';
|
|
11
13
|
export declare const TemplateModalContext: React.Context<{
|
|
12
14
|
hideFooterButton: boolean;
|
|
@@ -23,12 +25,12 @@ export declare const TemplateModalContext: React.Context<{
|
|
|
23
25
|
setDevice?: React.Dispatch<React.SetStateAction<DEVICE_TYPES>> | undefined;
|
|
24
26
|
display_content: string | null;
|
|
25
27
|
setDisplayContent?: React.Dispatch<React.SetStateAction<string | null>> | undefined;
|
|
26
|
-
originalVariableList:
|
|
27
|
-
setOriginalVariableList?: React.Dispatch<React.SetStateAction<
|
|
28
|
+
originalVariableList: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables;
|
|
29
|
+
setOriginalVariableList?: React.Dispatch<React.SetStateAction<WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables | CUSTOM_VARIABLE[]>> | undefined;
|
|
28
30
|
channel: CHANNEL_TYPE;
|
|
29
31
|
setChannel?: React.Dispatch<React.SetStateAction<CHANNEL_TYPE>> | undefined;
|
|
30
|
-
template:
|
|
31
|
-
setTemplate?: React.Dispatch<React.SetStateAction<
|
|
32
|
+
template: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | null;
|
|
33
|
+
setTemplate?: React.Dispatch<React.SetStateAction<WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | null>> | undefined;
|
|
32
34
|
isError: boolean;
|
|
33
35
|
setIsError?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
|
|
34
36
|
globalNormalizedPlaceholders?: globalNormalizedPlaceholdersType[] | undefined;
|
|
@@ -90,12 +92,12 @@ export declare const useTemplateModalContext: () => {
|
|
|
90
92
|
setDevice?: React.Dispatch<React.SetStateAction<DEVICE_TYPES>> | undefined;
|
|
91
93
|
display_content: string | null;
|
|
92
94
|
setDisplayContent?: React.Dispatch<React.SetStateAction<string | null>> | undefined;
|
|
93
|
-
originalVariableList:
|
|
94
|
-
setOriginalVariableList?: React.Dispatch<React.SetStateAction<
|
|
95
|
+
originalVariableList: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables;
|
|
96
|
+
setOriginalVariableList?: React.Dispatch<React.SetStateAction<WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables | CUSTOM_VARIABLE[]>> | undefined;
|
|
95
97
|
channel: CHANNEL_TYPE;
|
|
96
98
|
setChannel?: React.Dispatch<React.SetStateAction<CHANNEL_TYPE>> | undefined;
|
|
97
|
-
template:
|
|
98
|
-
setTemplate?: React.Dispatch<React.SetStateAction<
|
|
99
|
+
template: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | null;
|
|
100
|
+
setTemplate?: React.Dispatch<React.SetStateAction<WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | null>> | undefined;
|
|
99
101
|
isError: boolean;
|
|
100
102
|
setIsError?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
|
|
101
103
|
globalNormalizedPlaceholders?: globalNormalizedPlaceholdersType[] | undefined;
|
|
@@ -12,7 +12,6 @@ export interface BodyProps {
|
|
|
12
12
|
fileName?: string;
|
|
13
13
|
setFileName?: (name: string) => void;
|
|
14
14
|
variableListFromProps?: VariableListInterfaceV2[];
|
|
15
|
-
skipDefaultVariableContent?: boolean;
|
|
16
15
|
}
|
|
17
16
|
declare const Body: (props: BodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
17
|
export default Body;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import"../../curtain/CurtainHelper.js";import{PickerType as i}from"../../variable-picker-v3/model.js";import{cloneDeep as a}from"lodash";import{useRef as l}from"react";import n from"styled-components";import{CarouselPreview as r}from"../../carousel-preview/CarouselPreview.js";import s from"./EditWhatsAppCarouselTemplateV2.js";import{CHANNEL_TYPE as p}from"../../template-preview/models/Channels.js";import{BodySecondary as d}from"../../TypographyStyle.js";import{VariablePicker as c}from"../../variable-picker-v3/VariablePicker.js";import{COLORS as m}from"../../../constants/Theme.js";import{useTemplateModalContext as h}from"../context/templateModalContext.js";import{BACKGROUND_PREVIEW_IMAGE as u}from"../utils/constants.js";import{getVariableNameForEmailByIndex as w}from"../utils/getVariableNameEmail.js";import{highlightFor as v}from"../utils/highlightFor.js";import f from"./DesktopPreview.js";import b from"./EditWhatsAppTemplateV2.js";import g from"./MobilePreview.js";import C from"./VariableConnectorsPanel.js";const P=n.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
// height: 100%;
|
|
4
|
-
`,
|
|
4
|
+
`,x=n.div`
|
|
5
5
|
max-width: 450px;
|
|
6
|
-
max-width: ${e=>e.channel===
|
|
6
|
+
max-width: ${e=>e.channel===p.EMAIL?"400px":"450px"};
|
|
7
7
|
|
|
8
|
-
height: ${e=>e.channel===
|
|
8
|
+
height: ${e=>e.channel===p.WHATSAPP?"500px":"475px"};
|
|
9
9
|
overflow-y: auto;
|
|
10
10
|
padding-bottom: 24px;
|
|
11
11
|
border-left: ${m.stroke.primary} 1px solid;
|
|
12
12
|
border-top: ${e=>e.isWhatsappCarousel?`${m.stroke.primary} 1px solid`:void 0};
|
|
13
13
|
${e=>!e.showVariableMapping&&"width: 340px; height: 500px"};
|
|
14
|
-
`,
|
|
14
|
+
`,y=n.div`
|
|
15
15
|
padding: ${e=>e.isWhatsappCarousel?void 0:e.showOnlyContent?"16px 14px":"16px 32px"};
|
|
16
16
|
flex: 1;
|
|
17
17
|
height: ${e=>e.isWhatsappCarousel||e.hideDeviceContainerInPreview?"500px":"475px"};
|
|
18
18
|
overflow-y: auto;
|
|
19
|
-
background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===
|
|
20
|
-
display: ${e=>e.hideDeviceContainerInPreview&&e.channel===
|
|
19
|
+
background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===p.WHATSAPP?`url(${u});`:"none"};
|
|
20
|
+
display: ${e=>e.hideDeviceContainerInPreview&&e.channel===p.WHATSAPP?"flex":"initial"};
|
|
21
21
|
align-items: flex-start;
|
|
22
|
-
`,
|
|
22
|
+
`,S=n=>{const{showVariableMapping:u,showOnlyContent:S,whatsappSpecificPickerMeta:k,showVariableModal:j,discountCode:V,setDiscountCode:A,variableListForImage:M,showSampleValues:W,variableListFromProps:T,fileName:D,setFileName:E}=n,I=l(),$=l(),{variableList:H,setVariableList:L,variableCallback:B,showVariablePicker:F,setShowVariablePicker:O,device:_,display_content:N,channel:G,template:q,setTemplate:z,isWhatsappCarousel:J,isProductCarouselType:K,hideDeviceContainerInPreview:Q,onDefaultVariableSelect:R}=h();const U=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e(P,{children:[t(y,Object.assign({showOnlyContent:S,showVariableMapping:u,isWhatsappCarousel:J,hideDeviceContainerInPreview:Q,channel:G},{children:"mobile"===_?t(g,{ref:$,display_content:null!=N?N:"",channel:G,template:q,showSampleValues:W}):G===p.WHATSAPP&&J?t(r,{ref:I,channel:G,template:q,showSampleValues:W,isPreview:!1,showArrows:!0}):G!==p.MESSAGE?t(f,{ref:I,channel:G,display_content:null!=N?N:"",showSampleValues:W}):t(o,{})})),(K||u)&&e(x,Object.assign({channel:G,isWhatsappCarousel:J,showVariableMapping:!0},{children:[t("div",Object.assign({style:{height:"100%",width:"whatsapp"===G?428:400,display:F?"block":"none"}},{children:t(c,{hideHeaderCross:!0,showHeader:!0,showBackButton:!0,onBackButtonClick:()=>{L(a(T)),O(!1)},onSelect:e=>{B(e),L(a(T)),O(!1)},type:i.EMBEDDED,data:null!=H?H:[],onDefaultVariableSelect:R},Math.random())})),t("div",Object.assign({style:{padding:"16px 14px",width:"whatsapp"===G?428:400,display:F?"none":"block"}},{children:G!==p.WHATSAPP?t(C,{onFocus:G===p.EMAIL?function(e){var t,o,i;const a=null===document||void 0===document?void 0:document.getElementById("mobile"===_?"template_html_mobile":"template_html_desktop"),l=w(e+1),n=G===p.EMAIL?null===(t=null==a?void 0:a.contentWindow)||void 0===t?void 0:t.document.getElementById(l):document.getElementById(l),r=U(n),s=null==n?void 0:n.offsetLeft;"desktop"===_?r&&I.current&&(null===(o=null==a?void 0:a.contentWindow)||void 0===o||o.scrollTo(null!=s?s:0,r),v(l,m.background.warning.light,2,G,_)):r&&$.current&&(null===(i=null==a?void 0:a.contentWindow)||void 0===i||i.scrollTo(null!=s?s:0,r),v(l,m.background.warning.light,2,G,_))}:void 0,showVariableModal:j,discountCode:V,setDiscountCode:A}):G===p.WHATSAPP&&J?t(s,{whatsappSpecificPickerMeta:k,template:q,showVariableModal:j,variableListForImage:M,discountCode:V,setDiscountCode:A}):t(b,{whatsappSpecificPickerMeta:k,template:q,onTemplateChange:e=>{null==z||z(e)},showVariableModal:j,variableListForImage:M,discountCode:V,setDiscountCode:A,fileName:D,setFileName:E})}))]})),[p.WHATSAPP,p.SMS].includes(G)&&!u&&!K&&t(x,{children:t(d,Object.assign({color:m.content.secondary,style:{fontStyle:"italic"}},{children:"Click on ‘Select template’ below to use it"}))})]})};export{S as default};
|
|
@@ -11,7 +11,6 @@ interface EditMediaModalProps {
|
|
|
11
11
|
editIconRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
12
12
|
fileRef: React.MutableRefObject<HTMLInputElement | null>;
|
|
13
13
|
useEditWhatsappTemplateMediaResponse: UseEditWhatsappTemplateMediaResponse;
|
|
14
|
-
skipAddVariable?: boolean;
|
|
15
14
|
}
|
|
16
15
|
declare const EditMediaModal: React.FC<EditMediaModalProps>;
|
|
17
16
|
export default EditMediaModal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import o from"../../../assets/icons/arrow_back.svg.js";import a from"../../../assets/icons/info.svg.js";import"../../curtain/CurtainHelper.js";import{PickerType as r}from"../../variable-picker-v3/model.js";import{useState as s,useEffect as
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import o from"../../../assets/icons/arrow_back.svg.js";import a from"../../../assets/icons/info.svg.js";import"../../curtain/CurtainHelper.js";import{PickerType as r}from"../../variable-picker-v3/model.js";import{useState as s,useEffect as n}from"react";import{Button as l}from"../../button/Button.js";import{BikImageCropper as p}from"../../image-cropper/BikImageCropper.js";import"../../image-compress/ImageCompress.js";import"../../states/StateComponent.js";import"../../../_virtual/_tslib.js";import"../../../constants/zindex.js";import"../../modals/styledModal.js";import{PureSpinner as d}from"../../spinner/Spinner.js";import{InputWithVariables as m}from"../../input-with-vars/InputWithVariables.js";import"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import{DEFAULT_THEME as c,COLORS as g}from"../../../constants/Theme.js";import{HEADER_TYPES as h}from"../../template-preview/models/TemplateMeta.js";import{POD as u}from"../../template-preview/models/WhatsAppTemplate.js";import{TitleRegular as f,TitleMedium as v,BodySecondary as b,BodyCaption as j}from"../../TypographyStyle.js";import{validateURL as y}from"../../../utils/validator.js";import x from"../../../assets/icons/file.svg.js";import C from"../../../assets/icons/filePdf.svg.js";import I from"../../../assets/icons/image.svg.js";import M from"../../../assets/icons/upload.svg.js";import{useTemplateModalContext as w}from"../context/templateModalContext.js";import{isVariable as k}from"../utils/validateIsUrl.js";const E=E=>{let{setOpenEditMedia:O,mediaComponentFormat:A,variableListForImage:T,openEditMedia:V,uploadMedia:B,fileRef:D,useEditWhatsappTemplateMediaResponse:P}=E;const{pod:U,setHideCrossButton:L,setHideFooterButton:G}=w(),[W,R]=s(""),[S,H]=s(void 0),[$,F]=s(!1),[_,z]=s("");let N;if(n((()=>(G(!0),()=>{G(!1)})),[]),n((()=>{const e=document.querySelector('[class*="ModalWrapper"]');e&&H(e)}),[P.loading]),N=A===h.IMAGE?"image/png, image/jpeg":A===h.VIDEO?"video/mp4":"application/pdf",!V)return e(t,{});const q=()=>A===h.IMAGE?"Image":A===h.VIDEO?"Video":"Document";return i(t,{children:[i("div",Object.assign({style:{display:"flex",gap:"10px",alignItems:"center",marginBottom:"16px"}},{children:[e(o,{onClick:e=>{e.stopPropagation(),O(!1),R("")},style:{cursor:"pointer"},width:16,height:16}),e(f,{children:"Update Media"})]})),i("div",Object.assign({style:{position:"relative",padding:16,borderRadius:4,border:$?`1px dashed ${c.colorsV2.stroke.negative.vibrant}`:`1px dashed ${c.colorsV2.stroke.primary}`,backgroundColor:c.colorsV2.surface.subdued,width:"100%",height:"100%",alignItems:"center",display:P.loading?"flex":"initial"}},{children:[i("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16}},{children:[P.loading?e(d,{width:"40px",height:"40px",color:g.content.brand}):e("div",Object.assign({style:{height:64,width:64,borderRadius:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:c.colorsV2.background.base}},{children:A===h.IMAGE?e(I,{width:40,height:40}):A===h.VIDEO?e(x,{width:40,height:40}):e(C,{width:40,height:40})})),e(v,{children:P.loading?"Upload in progress...":A===h.IMAGE?"Upload an image":A===h.VIDEO?"Upload a video":"Upload a document"}),e(b,Object.assign({color:g.content.secondary},{children:P.loading?`Your ${A.toLowerCase()} is getting loaded. This may take a couple of minutes.`:A===h.IMAGE?"JPEG/ PNG format • Max 5MB":A===h.VIDEO?"MP4 format video • Max 16MB":"PDF format document • Max 100MB"}))]})),!P.loading&&i(t,{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"6px"}},{children:e(m,{labelText:`${q()} URL`,onPickerToggle:e=>{L(!!e)},pickerType:r.EMBEDDED,portalElement:null!=S?S:document.body,noMaxCharCheck:!0,allowMix:!1,onChange:e=>{z(e.actualValue),F(!1)},showVarHeader:!0,varHeaderText:"Select variable",errorMessage:W,prevVariable:{actualValue:"",variableType:"string"},variablesList:T,placeHolder:"Enter URL/Add variable",showAddButton:U!==u.CAMPAIGN||A===h.IMAGE})})),i("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px",marginBottom:"12px"}},{children:[e("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}}),e(j,{children:"Or upload media from device"}),e("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}})]})),e("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e(l,{matchParentWidth:!0,buttonText:"Upload",buttonType:"dashBold",LeadingIcon:M,onClick:()=>{B(),F(!1)},size:"medium"})}))]}),$&&i("div",Object.assign({style:{position:"absolute",display:"flex",alignItems:"center",bottom:-24,left:0,gap:4}},{children:[e(a,{width:16,height:16,color:g.content.negative}),e(j,Object.assign({style:{color:g.content.negative}},{children:`Select ${q()}`}))]}))]})),!P.loading&&e("div",Object.assign({style:{display:"flex",justifyContent:"flex-end",marginTop:8}},{children:e(l,{buttonText:`Add ${q()}`,onClick:()=>{_?y(_)||k(_)?(B(_),O(!1),R(""),F(!1)):R("Enter valid URL"):F(!0)}})})),e("input",{ref:D,style:{display:"none"},type:"file",onChange:P.handleImageUpload,accept:N}),!!P.selectedImage&&e(p,{aspectRatio:15/8,src:P.selectedImage,onCropComplete:P.onCropComplete,onCancel:()=>{P.setLoading(!1),P.setSelectedImage(""),D.current&&(D.current.value="")}})]})};export{E as default};
|
package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import o from"../../../assets/icons/arrow_back.svg.js";import i from"../../../assets/icons/chevronLeft.svg.js";import n from"../../../assets/icons/chevronRight.svg.js";import r from"../../../assets/icons/PlusIcon.js";import{cloneDeep as a}from"lodash";import{useState as d,useEffect as s}from"react";import{Button as c}from"../../button/Button.js";import{IconButton as u}from"../../icon-button/IconButton.js";import{ProductPickerModal as p,ScreenName as m}from"../../product-picker-v2/modal.js";import{Badge as v}from"../Badge/index.js";import{useTemplateModalContext as h}from"../context/templateModalContext.js";import g from"./EditWhatsAppTemplateV2.js";import{ProductBox as f}from"./ProductBox.js";import"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import{COLORS as y}from"../../../constants/Theme.js";import"../../curtain/CurtainHelper.js";import"../../variable-picker-v3/model.js";import"../../template-preview/models/TemplateMeta.js";import{POD as b}from"../../template-preview/models/WhatsAppTemplate.js";import
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import o from"../../../assets/icons/arrow_back.svg.js";import i from"../../../assets/icons/chevronLeft.svg.js";import n from"../../../assets/icons/chevronRight.svg.js";import r from"../../../assets/icons/PlusIcon.js";import{cloneDeep as a}from"lodash";import{useState as d,useEffect as s}from"react";import{Button as c}from"../../button/Button.js";import{IconButton as u}from"../../icon-button/IconButton.js";import{ProductPickerModal as p,ScreenName as m}from"../../product-picker-v2/modal.js";import{Badge as v}from"../Badge/index.js";import{useTemplateModalContext as h}from"../context/templateModalContext.js";import g from"./EditWhatsAppTemplateV2.js";import{ProductBox as f}from"./ProductBox.js";import"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import{COLORS as y}from"../../../constants/Theme.js";import"../../curtain/CurtainHelper.js";import"../../variable-picker-v3/model.js";import"../../template-preview/models/TemplateMeta.js";import{POD as b}from"../../template-preview/models/WhatsAppTemplate.js";import{TitleMedium as j,TitleRegular as x,BodySecondary as C,BodyCaption as I}from"../../TypographyStyle.js";const w=w=>{let{template:k,whatsappSpecificPickerMeta:O,showVariableModal:P,variableListForImage:T,discountCode:S,setDiscountCode:L}=w;var E,B,A,V,D,F,M,R;const{selectedCarouselIndex:W,setTemplate:$,pickerConf:q,isProductCarouselType:N,pod:_,cardCount:z,carouselProducts:G,setCarouselProducts:H,isError:J,cardImages:K,disableEditVariable:Q,onDeleteSelectedProducts:U,setSelectedCarouselIndex:X,setVariableCallback:Y,setShowVariablePicker:Z,sliderRef:ee}=h(),[te,le]=d(-1==W?"First Message (Step 1/2)":N?"Product Carousel "+((null===(B=null===(E=null==k?void 0:k.mapping)||void 0===E?void 0:E.body)||void 0===B?void 0:B.length)?"(Step 2/2)":""):"Carousel Cards "+((null===(V=null===(A=null==k?void 0:k.mapping)||void 0===A?void 0:A.body)||void 0===V?void 0:V.length)?"(Step 2/2)":"")),[oe,ie]=d(!1),[ne,re]=d(!1),ae=W===(null!=z?z:-1)-1,de=(null!=W?W:-1)<1;s((()=>{var e,t,l,o;le(-1==W?"First Message (Step 1/2)":N?"Product Carousel "+((null===(t=null===(e=null==k?void 0:k.mapping)||void 0===e?void 0:e.body)||void 0===t?void 0:t.length)?"(Step 2/2)":""):"Carousel Cards "+((null===(o=null===(l=null==k?void 0:k.mapping)||void 0===l?void 0:l.body)||void 0===o?void 0:o.length)?"(Step 2/2)":""))}),[W]);const se=e=>{null==H||H([{name:"variable",productName:e.actualValue}])};return e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"row",alignItems:"center"}},{children:[null!=W&&W>=0&&!!(null===(F=null===(D=null==k?void 0:k.mapping)||void 0===D?void 0:D.body)||void 0===F?void 0:F.length)&&t(u,{Icon:o,onClick:()=>{null==X||X(-1)}}),t(j,Object.assign({style:{marginLeft:10}},{children:te}))]})),N&&(null!==(M=null==G?void 0:G.length)&&void 0!==M?M:0)>0&&null!=W&&W>=0&&e("div",Object.assign({style:{display:"flex",rowGap:8,marginBottom:16,marginLeft:10,marginRight:10,flexDirection:"column"}},{children:[t(f,{editItem:()=>{1===(null==G?void 0:G.length)&&"variable"===G[0].name?(Y((()=>se)),Z(!0)):ie(!oe)},cardBody:1===(null==G?void 0:G.length)&&"variable"===G[0].name?`${G[0].productName}`:`${null==G?void 0:G.length} Products Selected`,hideIcon:1===(null==G?void 0:G.length)&&"variable"===G[0].name,deleteItem:()=>{var e;if(1===(null==G?void 0:G.length)&&"variable"===G[0].name)return void(null==H||H([]));const t=a(Object.assign({},k));t&&(K&&K.length>0?null==K||K.forEach(((e,l)=>{var o;t.components[1].cards[l].components[0].example.header_handle=[null!==(o=K[l])&&void 0!==o?o:"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,l)=>{t.components[1].cards[l].components[0].example.header_handle=["https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})),null==$||$(t)),null==H||H([]),null==U||U()}}),G&&(null==G?void 0:G.length)>0&&"variable"!=G[0].name&&t(c,{disabled:(null!==(R=null==G?void 0:G.length)&&void 0!==R?R:0)<=1,style:{alignSelf:"flex-end"},onClick:()=>{re(!0),ie(!0)},buttonText:"Rearrange Products",buttonType:"tertiary"})]})),!Q&&N&&0===(null==G?void 0:G.length)&&null!=W&&W>=0&&e(l,{children:[e("div",Object.assign({style:{marginLeft:12}},{children:[t(x,{children:"Product(s)"}),t(C,{children:`Select ${null!=z?z:1} products`})]})),e("div",Object.assign({style:{marginTop:16,marginBottom:16,marginLeft:J?16:12,marginRight:J?16:12,flexDirection:"column",display:"flex",alignItems:"center"}},{children:[t(c,{matchParentWidth:!0,style:{flex:1,display:"flex",width:"100%",marginBottom:12,border:J?`2px dashed ${y.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s)",buttonType:J?"tertiaryGray":"dashBold",LeadingIcon:()=>t("div",Object.assign({style:{display:"flex",width:18,height:18}},{children:t(r,{width:18,height:18,color:y.content.secondary})})),onClick:e=>{ie(!0)}}),_===b.CHATBOT&&e(l,{children:[e("div",Object.assign({style:{display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",flexDirection:"row",width:"100%"}},{children:[t("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginRight:8}}),t(I,Object.assign({style:{color:"#616161",overflow:"unset"}},{children:"OR"})),t("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginLeft:8}})]})),t(c,{matchParentWidth:!0,style:{flex:1,display:"flex",marginTop:12,width:"100%",border:J?`2px dashed ${y.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s) Variable",buttonType:J?"tertiaryGray":"dashBold",LeadingIcon:()=>t("div",Object.assign({style:{display:"flex"}},{children:t(r,{width:18,height:18,color:y.content.secondary})})),onClick:e=>{Y((()=>se)),Z(!0)}})]})]})),J&&t("div",Object.assign({style:{marginLeft:10,marginBottom:16}},{children:t(v,{padding:"8px",errorText:"Please add products"})}))]}),!N&&(null!=W?W:-1)>-1&&e("div",Object.assign({style:{display:"flex",background:y.surface.hovered,alignItems:"center"}},{children:[t(u,{Icon:i,disabled:de,width:8,height:14,svgStyle:de?{}:{color:y.content.secondary},onClick:()=>{var e;null===(e=null==ee?void 0:ee.current)||void 0===e||e.slickPrev(),(null!=W?W:-1)<1||null==X||X((e=>e-1))}}),t(x,Object.assign({style:{flex:1,display:"flex",justifyContent:"center"},color:y.content.secondary},{children:`Card ${(null!=W?W:0)+1}/${z}`})),t(u,{Icon:n,width:8,height:14,disabled:ae,svgStyle:ae?{}:{color:y.content.secondary},onClick:()=>{var e;null===(e=null==ee?void 0:ee.current)||void 0===e||e.slickNext(),(null!=W?W:-1)>=(null!=z?z:-1)-1||null==X||X((e=>e+1))}})]})),t(g,{whatsappSpecificPickerMeta:O,template:k,onTemplateChange:e=>{null==$||$(e)},showVariableModal:P,variableListForImage:T,discountCode:S,setDiscountCode:L}),oe&&q&&t(p,{zIndex:200,startupScreen:ne?m.RearrangeProducts:m.Collections,rearrangeEnabled:!0,storeId:q.storeId,selectedItems:(e=>{if(e.length>0){const t={};for(const l of e){const e=null==l?void 0:l.collectionId,o=l.productId,i=l.variantId;e in t||(t[e]={products:{},name:"",image:"",isSmartCollection:!1}),o in t[e].products||(t[e].products[o]={variants:{},name:(null==l?void 0:l.productName)||"",image:(null==l?void 0:l.productImage)||""}),t[e].products[o].variants[i]={name:(null==l?void 0:l.name)||"",price:"",image:(null==l?void 0:l.image)||"",quantity:l.quantity||0,displayOrder:l.displayOrder}}return t}return{}})(null!=G?G:[]),collectionFetcher:q.fetchCollections,productFetcher:q.fetchProducts,onAdd:(e,t)=>{var l,o,i,n,r,d;re(!1);const s=[];delete e.isCustom;for(const t of Object.keys(e)){const a=e[t].products;if(void 0!==a&&Object.keys(a).length)for(const e of Object.keys(a)){const c=a[e].variants;if(void 0!==c&&Object.keys(c).length)for(const u of Object.keys(c)){const{name:p,image:m,quantity:v,displayOrder:h}=c[u],g={name:p,image:null!==(o=null!=m?m:null===(l=a[e])||void 0===l?void 0:l.image)&&void 0!==o?o:"",quantity:v,variantId:u,productId:e,displayOrder:h,collectionId:t,productName:null!==(n=null===(i=a[e])||void 0===i?void 0:i.name)&&void 0!==n?n:"",productImage:null!==(d=null===(r=a[e])||void 0===r?void 0:r.image)&&void 0!==d?d:""};s.push(g)}}}const c=s.sort(((e,t)=>e.displayOrder-t.displayOrder)),u=s.map((e=>e.image)),p=a(Object.assign({},k));p&&(u.forEach(((e,t)=>{var l;p.components[1].cards[t].components[0].example.header_handle=e?[e]:[null!==(l=null==K?void 0:K[t])&&void 0!==l?l:""]})),null==$||$(p)),null==H||H(c),ie(!1)},searchInCollectionFetcher:q.searchInCollection,searchFetcher:q.searchProducts,visible:oe,onClose:()=>{ie(!1)},exactLimit:null!=z?z:1})]}))};export{w as default};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CHANNEL_TYPE } from "../../template-preview/models/Channels";
|
|
3
|
-
import {
|
|
3
|
+
import { EmailTemplateType } from "../../template-preview/models/EmailTemplate";
|
|
4
|
+
import { SMSTemplateType } from "../../template-preview/models/SmsTemplate";
|
|
5
|
+
import { WhatsAppCarouselTemplate } from "../../template-preview/models/WhatsappCarouselTemplate";
|
|
6
|
+
import { WhatsAppTemplate } from "../../template-preview/models/WhatsAppTemplate";
|
|
4
7
|
declare const MobilePreview: React.ForwardRefExoticComponent<{
|
|
5
8
|
display_content: string;
|
|
6
9
|
channel: CHANNEL_TYPE;
|
|
7
|
-
template:
|
|
10
|
+
template: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | null;
|
|
8
11
|
showSampleValues?: boolean | undefined;
|
|
9
12
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
13
|
export default MobilePreview;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import a from"react";import o from"styled-components";import{TemplatePreview as r}from"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../../constants/Theme.js";import"../../curtain/CurtainHelper.js";import"../../variable-picker-v3/model.js";import"../../template-preview/models/TemplateMeta.js";import{POD as p}from"../../template-preview/models/WhatsAppTemplate.js";import
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import a from"react";import o from"styled-components";import{TemplatePreview as r}from"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../../constants/Theme.js";import"../../curtain/CurtainHelper.js";import"../../variable-picker-v3/model.js";import"../../template-preview/models/TemplateMeta.js";import{POD as p}from"../../template-preview/models/WhatsAppTemplate.js";import{useTemplateModalContext as s}from"../context/templateModalContext.js";import{getPreviewWidth as l}from"../utils/getPreviewDimension.js";const n=o.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
height: 100%;
|
|
4
4
|
border-radius: 31px;
|
|
@@ -17,7 +17,7 @@ import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import a from"re
|
|
|
17
17
|
height: calc(100% - 17px);
|
|
18
18
|
border-radius: 16px;
|
|
19
19
|
overflow-y: auto;
|
|
20
|
-
`,c=a.forwardRef(((a,o)=>{let{display_content:c,channel:d,template:
|
|
20
|
+
`,c=a.forwardRef(((a,o)=>{let{display_content:c,channel:d,template:f,showSampleValues:w}=a;const{pod:b,hideDeviceContainerInPreview:v}=s(),g={showSampleValues:w,template:f,channel:d,smsSpecificMeta:{smsDisplayContent:c},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:b!==p.CHATBOT,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426,width:240}},size:"small",hideHeader:!0,emailSpecificMeta:{emailDisplayContent:c,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_mobile",containerStyle:{height:"100%",width:"100%"},templateContainerStyles:{height:"100%"}},isPreview:!0,hidePointerEvents:!0};return v?e(h,{children:e(r,Object.assign({},g))}):e(t,{children:i(n,Object.assign({channel:d},{children:[e("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(d),height:443}}),e(m,Object.assign({ref:o},{children:e(r,Object.assign({},g))}))]}))})}));c.displayName="MobilePreview";const h=o.div`
|
|
21
21
|
display: flex;
|
|
22
22
|
align-items: center;
|
|
23
23
|
justify-content: center;
|
package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export interface TemplateSelectModalContentProps {
|
|
|
15
15
|
fileName?: string;
|
|
16
16
|
setFileName?: (name: string) => void;
|
|
17
17
|
variableListFromProps?: VariableListInterfaceV2[];
|
|
18
|
-
skipDefaultVariableContent?: boolean;
|
|
19
18
|
}
|
|
20
|
-
declare const TemplateSelectModalContent: ({ channel, showVariableMapping, variableListFromProps, showOnlyContent, whatsappSpecificPickerMeta, showVariableModal, discountCode, setDiscountCode, variableListForImage, showSampleValues, fileName, setFileName,
|
|
19
|
+
declare const TemplateSelectModalContent: ({ channel, showVariableMapping, variableListFromProps, showOnlyContent, whatsappSpecificPickerMeta, showVariableModal, discountCode, setDiscountCode, variableListForImage, showSampleValues, fileName, setFileName, }: TemplateSelectModalContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
20
|
export default TemplateSelectModalContent;
|
package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{CHANNEL_TYPE as
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{CHANNEL_TYPE as o}from"../../template-preview/models/Channels.js";import i from"./Body.js";import t from"./Header.js";const s=s=>{let{channel:r,showVariableMapping:l,variableListFromProps:n,showOnlyContent:m,whatsappSpecificPickerMeta:p,showVariableModal:d,discountCode:c,setDiscountCode:h,variableListForImage:w,showSampleValues:b,fileName:f,setFileName:u}=s;return e("div",Object.assign({style:{paddingBottom:0}},{children:a("div",{children:[r===o.EMAIL&&e(t,{showOnlyContent:m}),e(i,{variableListFromProps:n,whatsappSpecificPickerMeta:p,showVariableMapping:!!l,showOnlyContent:m,showVariableModal:d,discountCode:c,setDiscountCode:h,variableListForImage:w,showSampleValues:b,fileName:f,setFileName:u})]})}))};export{s as default};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CHANNEL_TYPE } from "../../template-preview/models/Channels";
|
|
3
3
|
import { ButtonPlaceHolderOptions, CUSTOM_VARIABLE } from "../../template-preview/models/TemplateMeta";
|
|
4
|
-
import { WEB_PUSH_COMPONENT_TYPE } from "../../template-preview/models/WebpushTemplate";
|
|
5
4
|
import { BUTTON_TYPE } from "../../template-preview/models/WhatsAppTemplate";
|
|
6
5
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
|
7
6
|
focused?: boolean | undefined;
|
|
@@ -15,7 +14,7 @@ export interface VariableConnectorProps {
|
|
|
15
14
|
showVariableModal?: boolean;
|
|
16
15
|
setShowDiscountCheckBox?: any;
|
|
17
16
|
buttonType?: BUTTON_TYPE;
|
|
18
|
-
componentType?: 'HEADER' | 'BODY' | 'BUTTONS' | 'FOOTER' | 'limited_time_offer'
|
|
17
|
+
componentType?: 'HEADER' | 'BODY' | 'BUTTONS' | 'FOOTER' | 'limited_time_offer';
|
|
19
18
|
CTAoptions?: ButtonPlaceHolderOptions[];
|
|
20
19
|
}
|
|
21
20
|
declare const VariableConnector: React.FC<VariableConnectorProps>;
|