@bikdotai/bik-component-library 0.0.652--beta → 0.0.652--beta-0.1
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/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/cjs/components/carousel-preview/CarouselPreview.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/Body.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/esm/components/carousel-preview/CarouselPreview.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/Body.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),l=require("react-slick"),s=require("./CarouselPreview.style.js"),t=require("./CarouselPreviewCard.js"),o=require("../template-context-mapper/context/templateModalContext.js"),a=require("../template-preview/helpers/templateMiscHelper.js"),n=require("../template-preview/RCS/RCSPreview.styled.js"),i=require("./CustomCarouselArrows.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(r),c=d(l);const v=u.default.forwardRef((r=>{let{channel:l,template:i,isPreview:d,removeBottomBorder:u,borderRadius:c,showArrows:v,hideBorder:C,showSampleValues:w}=r;var m,h;const{sliderRef:x,selectedCarouselIndex:j,cardCount:f,setIsCarouselHovered:P,cardIndex:R}=o.useTemplateModalContext(),g=-1==R?a.determineCardIndex(l):R,I=null===(h=null===(m=null==i?void 0:i.components)||void 0===m?void 0:m[g])||void 0===h?void 0:h.cards,S=(null==I?void 0:I.length)?e.jsx(p,{cards:I,cardCount:null!=f?f:0,selectedCarouselIndex:null!=j?j:-1,sliderRef:x,isPreview:d,showArrows:v,channel:l,template:i,setIsCarouselHovered:P,showSampleValues:!!w}):null;return a.isRCSChannel(l)?e.jsx(n.RCSCarousalContainer,Object.assign({borderRadius:c},{children:S})):e.jsxs(s.Container,Object.assign({removeBottomBorder:u,borderRadius:c,hideBorder:C},{children:[e.jsx(t.default,{channel:l,currentTemplate:i,carouselCardIndex:-1,isPreview:d,width:"77%"}),S]}))})),p=r=>{let{cards:l,cardCount:o,selectedCarouselIndex:a,sliderRef:n,isPreview:d,showArrows:u,channel:v,template:p,setIsCarouselHovered:C,showSampleValues:w}=r;return e.jsx(s.CarouselSlickContainer,Object.assign({cardCount:o,selectedCarouselIndex:a,onMouseEnter:()=>null==C?void 0:C(!0),onMouseLeave:()=>null==C?void 0:C(!1)},{children:e.jsx(c.default,Object.assign({ref:n,swipeToSlide:!0,draggable:!0,swipe:!0,infinite:!1,focusOnSelect:!d,centerMode:!0,arrows:u,adaptiveHeight:!0,nextArrow:e.jsx(i.CustomCarouselRightArrow,{isPreview:null!=d&&d}),prevArrow:e.jsx(i.CustomCarouselLeftArrow,{isPreview:null!=d&&d})},{children:null==l?void 0:l.map(((r,l)=>{var s,o;const a={components:r.components,mapping:null===(o=null===(s=null==p?void 0:p.mapping)||void 0===s?void 0:s.cards)||void 0===o?void 0:o[l],content:null==p?void 0:p.content,templateType:null==p?void 0:p.templateType};return e.jsx(t.default,{channel:v,currentTemplate:a,carouselCardIndex:l,isPreview:d,width:"100%",showSampleValues:w},l)}))}))}))};exports.CarouselPreview=v;
|
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===p.CHANNEL_TYPE.WHATSAPP?`url(${h.BACKGROUND_PREVIEW_IMAGE});`:"none"};
|
|
20
20
|
display: ${e=>!e.hideDeviceContainerInPreview||e.channel!==p.CHANNEL_TYPE.WHATSAPP&&e.channel!==p.CHANNEL_TYPE.RCS?"initial":"flex"};
|
|
21
21
|
align-items: flex-start;
|
|
22
|
-
`;exports.default=l=>{const{showVariableMapping:h,showOnlyContent:f,whatsappSpecificPickerMeta:x,showVariableModal:T,discountCode:g,setDiscountCode:S,variableListForImage:L,showSampleValues:y,variableListFromProps:H,fileName:k,setFileName:V,skipDefaultVariableContent:_}=l,W=i.useRef(),q=i.useRef(),{variableList:M,setVariableList:D,variableCallback:O,showVariablePicker:Y,setShowVariablePicker:I,device:B,display_content:R,channel:F,template:$,setTemplate:G,isWhatsappCarousel:U,isProductCarouselType:K,hideDeviceContainerInPreview:z,onDefaultVariableSelect:J}=c.useTemplateModalContext();const Q=e=>{let a=0;for(;e;)a+=e.offsetTop,e=e.offsetParent;return a};return e.jsxs(A,{children:[e.jsx(N,Object.assign({showOnlyContent:f,showVariableMapping:h,isWhatsappCarousel:U,hideDeviceContainerInPreview:z,channel:F,skipDefaultVariableContent:_},{children:"mobile"===B?e.jsx(E.default,{ref:q,display_content:null!=R?R:"",channel:F,template:$,showSampleValues:y}):F!==p.CHANNEL_TYPE.WHATSAPP&&F!==p.CHANNEL_TYPE.RCS||!U?F===p.CHANNEL_TYPE.WEBPUSH?e.jsx(o.TemplatePreview,{showSampleValues:y,channel:F,hideHeader:!0,template:$}):F!==p.CHANNEL_TYPE.MESSAGE?e.jsx(v.default,{ref:W,channel:F,display_content:null!=R?R:"",showSampleValues:y}):e.jsx(e.Fragment,{}):e.jsx(r.CarouselPreview,{ref:W,channel:F,template:$,showSampleValues:y,isPreview:!
|
|
22
|
+
`;exports.default=l=>{const{showVariableMapping:h,showOnlyContent:f,whatsappSpecificPickerMeta:x,showVariableModal:T,discountCode:g,setDiscountCode:S,variableListForImage:L,showSampleValues:y,variableListFromProps:H,fileName:k,setFileName:V,skipDefaultVariableContent:_}=l,W=i.useRef(),q=i.useRef(),{variableList:M,setVariableList:D,variableCallback:O,showVariablePicker:Y,setShowVariablePicker:I,device:B,display_content:R,channel:F,template:$,setTemplate:G,isWhatsappCarousel:U,isProductCarouselType:K,hideDeviceContainerInPreview:z,onDefaultVariableSelect:J}=c.useTemplateModalContext();const Q=e=>{let a=0;for(;e;)a+=e.offsetTop,e=e.offsetParent;return a};return e.jsxs(A,{children:[e.jsx(N,Object.assign({showOnlyContent:f,showVariableMapping:h,isWhatsappCarousel:U,hideDeviceContainerInPreview:z,channel:F,skipDefaultVariableContent:_},{children:"mobile"===B?e.jsx(E.default,{ref:q,display_content:null!=R?R:"",channel:F,template:$,showSampleValues:y}):F!==p.CHANNEL_TYPE.WHATSAPP&&F!==p.CHANNEL_TYPE.RCS||!U?F===p.CHANNEL_TYPE.WEBPUSH?e.jsx(o.TemplatePreview,{showSampleValues:y,channel:F,hideHeader:!0,template:$}):F!==p.CHANNEL_TYPE.MESSAGE?e.jsx(v.default,{ref:W,channel:F,display_content:null!=R?R:"",showSampleValues:y}):e.jsx(e.Fragment,{}):e.jsx(r.CarouselPreview,{ref:W,channel:F,template:$,showSampleValues:y,isPreview:!1,showArrows:!0})})),(K||h)&&e.jsxs(j,Object.assign({channel:F,isWhatsappCarousel:U,showVariableMapping:!0},{children:[e.jsx("div",Object.assign({style:{height:"100%",width:"whatsapp"===F?428:400,display:Y?"block":"none"}},{children:e.jsx(u.VariablePicker,{hideHeaderCross:!0,showHeader:!0,showBackButton:!0,onBackButtonClick:()=>{D(t.cloneDeep(H)),I(!1)},onSelect:e=>{O(e),D(t.cloneDeep(H)),I(!1)},type:a.PickerType.EMBEDDED,data:null!=M?M:[],onDefaultVariableSelect:J,skipDefaultVariableContent:_},Math.random())})),e.jsx("div",Object.assign({style:{padding:"16px 14px",width:"whatsapp"===F||"webpush"==F||"rcs"==F?428:400,display:Y?"none":"block"}},{children:F!==p.CHANNEL_TYPE.WHATSAPP&&F!==(null===p.CHANNEL_TYPE||void 0===p.CHANNEL_TYPE?void 0:p.CHANNEL_TYPE.RCS)?F==p.CHANNEL_TYPE.WEBPUSH?e.jsx(P.default,{whatsappSpecificPickerMeta:x,template:$,onTemplateChange:e=>{null==G||G(e)},showVariableModal:T}):e.jsx(b.default,{onFocus:F===p.CHANNEL_TYPE.EMAIL?function(e){var a,t,i;const l=null===document||void 0===document?void 0:document.getElementById("mobile"===B?"template_html_mobile":"template_html_desktop"),r=m.getVariableNameForEmailByIndex(e+1),s=F===p.CHANNEL_TYPE.EMAIL?null===(a=null==l?void 0:l.contentWindow)||void 0===a?void 0:a.document.getElementById(r):document.getElementById(r),o=Q(s),d=null==s?void 0:s.offsetLeft;"desktop"===B?o&&W.current&&(null===(t=null==l?void 0:l.contentWindow)||void 0===t||t.scrollTo(null!=d?d:0,o),C.highlightFor(r,n.COLORS.background.warning.light,2,F,B)):o&&q.current&&(null===(i=null==l?void 0:l.contentWindow)||void 0===i||i.scrollTo(null!=d?d:0,o),C.highlightFor(r,n.COLORS.background.warning.light,2,F,B))}:void 0,showVariableModal:T,discountCode:g,setDiscountCode:S}):F!==p.CHANNEL_TYPE.WHATSAPP&&F!==p.CHANNEL_TYPE.RCS||!U?e.jsx(w.default,{whatsappSpecificPickerMeta:x,template:$,onTemplateChange:e=>{null==G||G(e)},showVariableModal:T,variableListForImage:L,discountCode:g,setDiscountCode:S,fileName:k,setFileName:V}):e.jsx(s.default,{whatsappSpecificPickerMeta:x,template:$,showVariableModal:T,variableListForImage:L,discountCode:g,setDiscountCode:S})}))]})),[p.CHANNEL_TYPE.WHATSAPP,p.CHANNEL_TYPE.SMS].includes(F)&&!h&&!K&&e.jsx(j,{children:e.jsx(d.BodySecondary,Object.assign({color:n.COLORS.content.secondary,style:{fontStyle:"italic"}},{children:"Click on ‘Select template’ below to use it"}))})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import o from"react";import
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import o from"react";import l from"react-slick";import{Container as t,CarouselSlickContainer as s}from"./CarouselPreview.style.js";import n from"./CarouselPreviewCard.js";import{useTemplateModalContext as i}from"../template-context-mapper/context/templateModalContext.js";import{determineCardIndex as a,isRCSChannel as d}from"../template-preview/helpers/templateMiscHelper.js";import{RCSCarousalContainer as u}from"../template-preview/RCS/RCSPreview.styled.js";import{CustomCarouselRightArrow as c,CustomCarouselLeftArrow as m}from"./CustomCarouselArrows.js";const p=o.forwardRef((o=>{let{channel:l,template:s,isPreview:c,removeBottomBorder:m,borderRadius:p,showArrows:w,hideBorder:h,showSampleValues:C}=o;var f,x;const{sliderRef:j,selectedCarouselIndex:g,cardCount:I,setIsCarouselHovered:P,cardIndex:R}=i(),b=-1==R?a(l):R,S=null===(x=null===(f=null==s?void 0:s.components)||void 0===f?void 0:f[b])||void 0===x?void 0:x.cards,A=(null==S?void 0:S.length)?e(v,{cards:S,cardCount:null!=I?I:0,selectedCarouselIndex:null!=g?g:-1,sliderRef:j,isPreview:c,showArrows:w,channel:l,template:s,setIsCarouselHovered:P,showSampleValues:!!C}):null;return d(l)?e(u,Object.assign({borderRadius:p},{children:A})):r(t,Object.assign({removeBottomBorder:m,borderRadius:p,hideBorder:h},{children:[e(n,{channel:l,currentTemplate:s,carouselCardIndex:-1,isPreview:c,width:"77%"}),A]}))})),v=r=>{let{cards:o,cardCount:t,selectedCarouselIndex:i,sliderRef:a,isPreview:d,showArrows:u,channel:p,template:v,setIsCarouselHovered:w,showSampleValues:h}=r;return e(s,Object.assign({cardCount:t,selectedCarouselIndex:i,onMouseEnter:()=>null==w?void 0:w(!0),onMouseLeave:()=>null==w?void 0:w(!1)},{children:e(l,Object.assign({ref:a,swipeToSlide:!0,draggable:!0,swipe:!0,infinite:!1,focusOnSelect:!d,centerMode:!0,arrows:u,adaptiveHeight:!0,nextArrow:e(c,{isPreview:null!=d&&d}),prevArrow:e(m,{isPreview:null!=d&&d})},{children:null==o?void 0:o.map(((r,o)=>{var l,t;const s={components:r.components,mapping:null===(t=null===(l=null==v?void 0:v.mapping)||void 0===l?void 0:l.cards)||void 0===t?void 0:t[o],content:null==v?void 0:v.content,templateType:null==v?void 0:v.templateType};return e(n,{channel:p,currentTemplate:s,carouselCardIndex:o,isPreview:d,width:"100%",showSampleValues:h},o)}))}))}))};export{p as CarouselPreview};
|
|
@@ -19,4 +19,4 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import"../../cur
|
|
|
19
19
|
background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===d.WHATSAPP?`url(${w});`:"none"};
|
|
20
20
|
display: ${e=>!e.hideDeviceContainerInPreview||e.channel!==d.WHATSAPP&&e.channel!==d.RCS?"initial":"flex"};
|
|
21
21
|
align-items: flex-start;
|
|
22
|
-
`,y=r=>{const{showVariableMapping:w,showOnlyContent:y,whatsappSpecificPickerMeta:V,showVariableModal:A,discountCode:W,setDiscountCode:M,variableListForImage:T,showSampleValues:D,variableListFromProps:E,fileName:I,setFileName:H,skipDefaultVariableContent:L}=r,$=l(),B=l(),{variableList:F,setVariableList:O,variableCallback:_,showVariablePicker:N,setShowVariablePicker:R,device:U,display_content:G,channel:q,template:z,setTemplate:J,isWhatsappCarousel:K,isProductCarouselType:Q,hideDeviceContainerInPreview:X,onDefaultVariableSelect:Y}=u();const Z=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e(k,{children:[t(x,Object.assign({showOnlyContent:y,showVariableMapping:w,isWhatsappCarousel:K,hideDeviceContainerInPreview:X,channel:q,skipDefaultVariableContent:L},{children:"mobile"===U?t(g,{ref:B,display_content:null!=G?G:"",channel:q,template:z,showSampleValues:D}):q!==d.WHATSAPP&&q!==d.RCS||!K?q===d.WEBPUSH?t(p,{showSampleValues:D,channel:q,hideHeader:!0,template:z}):q!==d.MESSAGE?t(b,{ref:$,channel:q,display_content:null!=G?G:"",showSampleValues:D}):t(a,{}):t(n,{ref:$,channel:q,template:z,showSampleValues:D,isPreview:!
|
|
22
|
+
`,y=r=>{const{showVariableMapping:w,showOnlyContent:y,whatsappSpecificPickerMeta:V,showVariableModal:A,discountCode:W,setDiscountCode:M,variableListForImage:T,showSampleValues:D,variableListFromProps:E,fileName:I,setFileName:H,skipDefaultVariableContent:L}=r,$=l(),B=l(),{variableList:F,setVariableList:O,variableCallback:_,showVariablePicker:N,setShowVariablePicker:R,device:U,display_content:G,channel:q,template:z,setTemplate:J,isWhatsappCarousel:K,isProductCarouselType:Q,hideDeviceContainerInPreview:X,onDefaultVariableSelect:Y}=u();const Z=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e(k,{children:[t(x,Object.assign({showOnlyContent:y,showVariableMapping:w,isWhatsappCarousel:K,hideDeviceContainerInPreview:X,channel:q,skipDefaultVariableContent:L},{children:"mobile"===U?t(g,{ref:B,display_content:null!=G?G:"",channel:q,template:z,showSampleValues:D}):q!==d.WHATSAPP&&q!==d.RCS||!K?q===d.WEBPUSH?t(p,{showSampleValues:D,channel:q,hideHeader:!0,template:z}):q!==d.MESSAGE?t(b,{ref:$,channel:q,display_content:null!=G?G:"",showSampleValues:D}):t(a,{}):t(n,{ref:$,channel:q,template:z,showSampleValues:D,isPreview:!1,showArrows:!0})})),(Q||w)&&e(j,Object.assign({channel:q,isWhatsappCarousel:K,showVariableMapping:!0},{children:[t("div",Object.assign({style:{height:"100%",width:"whatsapp"===q?428:400,display:N?"block":"none"}},{children:t(h,{hideHeaderCross:!0,showHeader:!0,showBackButton:!0,onBackButtonClick:()=>{O(o(E)),R(!1)},onSelect:e=>{_(e),O(o(E)),R(!1)},type:i.EMBEDDED,data:null!=F?F:[],onDefaultVariableSelect:Y,skipDefaultVariableContent:L},Math.random())})),t("div",Object.assign({style:{padding:"16px 14px",width:"whatsapp"===q||"webpush"==q||"rcs"==q?428:400,display:N?"none":"block"}},{children:q!==d.WHATSAPP&&q!==(null==d?void 0:d.RCS)?q==d.WEBPUSH?t(C,{whatsappSpecificPickerMeta:V,template:z,onTemplateChange:e=>{null==J||J(e)},showVariableModal:A}):t(S,{onFocus:q===d.EMAIL?function(e){var t,a,i;const o=null===document||void 0===document?void 0:document.getElementById("mobile"===U?"template_html_mobile":"template_html_desktop"),l=v(e+1),r=q===d.EMAIL?null===(t=null==o?void 0:o.contentWindow)||void 0===t?void 0:t.document.getElementById(l):document.getElementById(l),n=Z(r),s=null==r?void 0:r.offsetLeft;"desktop"===U?n&&$.current&&(null===(a=null==o?void 0:o.contentWindow)||void 0===a||a.scrollTo(null!=s?s:0,n),f(l,m.background.warning.light,2,q,U)):n&&B.current&&(null===(i=null==o?void 0:o.contentWindow)||void 0===i||i.scrollTo(null!=s?s:0,n),f(l,m.background.warning.light,2,q,U))}:void 0,showVariableModal:A,discountCode:W,setDiscountCode:M}):q!==d.WHATSAPP&&q!==d.RCS||!K?t(P,{whatsappSpecificPickerMeta:V,template:z,onTemplateChange:e=>{null==J||J(e)},showVariableModal:A,variableListForImage:T,discountCode:W,setDiscountCode:M,fileName:I,setFileName:H}):t(s,{whatsappSpecificPickerMeta:V,template:z,showVariableModal:A,variableListForImage:T,discountCode:W,setDiscountCode:M})}))]})),[d.WHATSAPP,d.SMS].includes(q)&&!w&&!Q&&t(j,{children:t(c,Object.assign({color:m.content.secondary,style:{fontStyle:"italic"}},{children:"Click on ‘Select template’ below to use it"}))})]})};export{y as default};
|