@bikdotai/bik-component-library 0.0.433-beta.3 → 0.0.433-beta.4

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("../../utils/StringUtils.js"),a=require("../modals/styledModal.js"),s=require("../template-preview/models/Channels.js"),o=require("./context/templateModalContext.js"),i=require("./modalElements/Footer.js"),r=require("./modalElements/TemplateSelectModalContent.js"),n=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=d=>{let{selectedTemplate:u,closeDialog:c,showVariableMapping:p,channel:m,htmlContent:C,templateVariables:h,onTemplateSelect:b,globalPlaceholders:v,showOnlyContent:S,whatsappSpecificPickerMeta:g,zIndex:T,showVariableModal:x,variableList:E,discountCode:P,setDiscountCode:j,onBackPress:M,enabledCustomText:L,variableListForImage:f,showSampleValues:w,disableEditVariable:A,pod:y,extras:N,isProductCarouselType:V,pickerConf:I}=d;var k,q,H,_;t.useEffect((()=>{B(C)}),[C]);const D=m===s.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(q=null===(k=u.components)||void 0===k?void 0:k[1])||void 0===q?void 0:q.type),[O,F]=t.useState(m===s.CHANNEL_TYPE.EMAIL||D?"desktop":"mobile"),[Y,B]=t.useState(C),[W,z]=t.useState(!1),[U,$]=t.useState(u),[R,G]=t.useState(null!=h?h:[]),[J,K]=t.useState(!1),[Q,X]=t.useState(-1);const Z=t.useMemo((()=>n.convertPlaceholdersToBikDropdown(v)),[v]);return e.jsx(o.TemplateModalContext.Provider,Object.assign({value:{template:U,setTemplate:$,device:O,setDevice:F,display_content:Y,setDisplayContent:B,originalVariableList:R,setOriginalVariableList:G,isError:W,setIsError:z,channel:m,globalNormalizedPlaceholders:Z,templateSelectionTriggered:J,setTemplateSelectionTriggered:K,enabledCustomText:L,disableEditVariable:A,pod:y,extras:N,isWhatsappCarousel:D,selectedCarouselIndex:Q,setSelectedCarouselIndex:X,isProductCarouselType:V,pickerConf:I}},{children:S?e.jsx(r.default,{channel:s.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(a.StyledModal,Object.assign({zIndex:T,centralContainerStyles:{width:D?900:m===s.CHANNEL_TYPE.EMAIL&&p?1e3:800},open:!0,onClose:()=>{null==c||c()},headingTitle:null==U?void 0:U.label,headingSubtitle:m===s.CHANNEL_TYPE.WHATSAPP?`${l.default.capitaliseFirstLetterOfString(null!==(H=null==U?void 0:U.category)&&void 0!==H?H:"")} • ${null!==(_=null==U?void 0:U.templateCategory)&&void 0!==_?_:""}`:"",onBackPress:()=>{null==M||M()}},{children:[e.jsx(r.default,{showSampleValues:w,showVariableMapping:p,channel:m,whatsappSpecificPickerMeta:g,showVariableModal:x,variableList:E,discountCode:P,setDiscountCode:j,variableListForImage:f&&(null==f?void 0:f.length)>0?f:E}),b?e.jsx(i.default,{isWhatsappCarousel:null!=D&&D,onSelect:function(){const e=null==b?void 0:b(U,R,null!=Y?Y:"");e?z(!!e):K(!0)}}):e.jsx(e.Fragment,{})]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("../../utils/StringUtils.js"),a=require("../modals/styledModal.js"),s=require("../template-preview/models/Channels.js"),o=require("./context/templateModalContext.js"),i=require("./modalElements/Footer.js"),r=require("./modalElements/TemplateSelectModalContent.js"),n=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=d=>{let{selectedTemplate:u,closeDialog:c,showVariableMapping:p,channel:m,htmlContent:C,templateVariables:h,onTemplateSelect:b,globalPlaceholders:v,showOnlyContent:S,whatsappSpecificPickerMeta:T,zIndex:g,showVariableModal:P,variableList:x,discountCode:E,setDiscountCode:j,onBackPress:M,enabledCustomText:L,variableListForImage:f,showSampleValues:w,disableEditVariable:y,pod:A,extras:N,isProductCarouselType:V,pickerConf:I}=d;var k,q,H,_;t.useEffect((()=>{B(C)}),[C]);const D=m===s.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(q=null===(k=u.components)||void 0===k?void 0:k[1])||void 0===q?void 0:q.type),[O,F]=t.useState(m===s.CHANNEL_TYPE.EMAIL||D?"desktop":"mobile"),[Y,B]=t.useState(C),[W,z]=t.useState(!1),[U,$]=t.useState(u),[R,G]=t.useState(null!=h?h:[]),[J,K]=t.useState(!1),[Q,X]=t.useState(-1);const Z=t.useMemo((()=>n.convertPlaceholdersToBikDropdown(v)),[v]);return e.jsx(o.TemplateModalContext.Provider,Object.assign({value:{template:U,setTemplate:$,device:O,setDevice:F,display_content:Y,setDisplayContent:B,originalVariableList:R,setOriginalVariableList:G,isError:W,setIsError:z,channel:m,globalNormalizedPlaceholders:Z,templateSelectionTriggered:J,setTemplateSelectionTriggered:K,enabledCustomText:L,disableEditVariable:y,pod:A,extras:N,isWhatsappCarousel:D,selectedCarouselIndex:Q,setSelectedCarouselIndex:X,isProductCarouselType:u.isProductCarouselType,pickerConf:I}},{children:S?e.jsx(r.default,{channel:s.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(a.StyledModal,Object.assign({zIndex:g,centralContainerStyles:{width:D?900:m===s.CHANNEL_TYPE.EMAIL&&p?1e3:800},open:!0,onClose:()=>{null==c||c()},headingTitle:null==U?void 0:U.label,headingSubtitle:m===s.CHANNEL_TYPE.WHATSAPP?`${l.default.capitaliseFirstLetterOfString(null!==(H=null==U?void 0:U.category)&&void 0!==H?H:"")} • ${null!==(_=null==U?void 0:U.templateCategory)&&void 0!==_?_:""}`:"",onBackPress:()=>{null==M||M()}},{children:[e.jsx(r.default,{showSampleValues:w,showVariableMapping:p,channel:m,whatsappSpecificPickerMeta:T,showVariableModal:P,variableList:x,discountCode:E,setDiscountCode:j,variableListForImage:f&&(null==f?void 0:f.length)>0?f:x}),b?e.jsx(i.default,{isWhatsappCarousel:null!=D&&D,onSelect:function(){const e=null==b?void 0:b(U,R,null!=Y?Y:"");e?z(!!e):K(!0)}}):e.jsx(e.Fragment,{})]}))}))};
@@ -73,6 +73,7 @@ export type WhatsAppCarouselTemplate = {
73
73
  createdAt: number;
74
74
  updatedAt: number;
75
75
  isDraft?: boolean;
76
+ isProductCarouselType?: boolean;
76
77
  };
77
78
  export interface WhatsAppCarouselTemplateVariables {
78
79
  body: CUSTOM_VARIABLE[];
@@ -1 +1 @@
1
- import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import{useEffect as o,useState as a,useMemo as i}from"react";import s from"../../utils/StringUtils.js";import{StyledModal as r}from"../modals/styledModal.js";import{CHANNEL_TYPE as n}from"../template-preview/models/Channels.js";import{TemplateModalContext as d}from"./context/templateModalContext.js";import c from"./modalElements/Footer.js";import p from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as m}from"./utils/convertPlaceholdersToBikDropdown.js";const u=u=>{let{selectedTemplate:h,closeDialog:b,showVariableMapping:C,channel:g,htmlContent:v,templateVariables:S,onTemplateSelect:f,globalPlaceholders:T,showOnlyContent:P,whatsappSpecificPickerMeta:w,zIndex:x,showVariableModal:M,variableList:L,discountCode:V,setDiscountCode:j,onBackPress:y,enabledCustomText:E,variableListForImage:I,showSampleValues:k,disableEditVariable:A,pod:D,extras:O,isProductCarouselType:F,pickerConf:W}=u;var z,B,H,U;o((()=>{q(v)}),[v]);const $=g===n.WHATSAPP&&"CAROUSEL"===(null===(B=null===(z=h.components)||void 0===z?void 0:z[1])||void 0===B?void 0:B.type),[N,R]=a(g===n.EMAIL||$?"desktop":"mobile"),[_,q]=a(v),[G,J]=a(!1),[K,Q]=a(h),[X,Y]=a(null!=S?S:[]),[Z,ee]=a(!1),[le,te]=a(-1);const oe=i((()=>m(T)),[T]);return e(d.Provider,Object.assign({value:{template:K,setTemplate:Q,device:N,setDevice:R,display_content:_,setDisplayContent:q,originalVariableList:X,setOriginalVariableList:Y,isError:G,setIsError:J,channel:g,globalNormalizedPlaceholders:oe,templateSelectionTriggered:Z,setTemplateSelectionTriggered:ee,enabledCustomText:E,disableEditVariable:A,pod:D,extras:O,isWhatsappCarousel:$,selectedCarouselIndex:le,setSelectedCarouselIndex:te,isProductCarouselType:F,pickerConf:W}},{children:P?e(p,{channel:n.EMAIL,hideHeader:!0}):l(r,Object.assign({zIndex:x,centralContainerStyles:{width:$?900:g===n.EMAIL&&C?1e3:800},open:!0,onClose:()=>{null==b||b()},headingTitle:null==K?void 0:K.label,headingSubtitle:g===n.WHATSAPP?`${s.capitaliseFirstLetterOfString(null!==(H=null==K?void 0:K.category)&&void 0!==H?H:"")} • ${null!==(U=null==K?void 0:K.templateCategory)&&void 0!==U?U:""}`:"",onBackPress:()=>{null==y||y()}},{children:[e(p,{showSampleValues:k,showVariableMapping:C,channel:g,whatsappSpecificPickerMeta:w,showVariableModal:M,variableList:L,discountCode:V,setDiscountCode:j,variableListForImage:I&&(null==I?void 0:I.length)>0?I:L}),f?e(c,{isWhatsappCarousel:null!=$&&$,onSelect:function(){const e=null==f?void 0:f(K,X,null!=_?_:"");e?J(!!e):ee(!0)}}):e(t,{})]}))}))};export{u as TemplateContextMapper};
1
+ import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import{useEffect as o,useState as a,useMemo as i}from"react";import s from"../../utils/StringUtils.js";import{StyledModal as r}from"../modals/styledModal.js";import{CHANNEL_TYPE as n}from"../template-preview/models/Channels.js";import{TemplateModalContext as d}from"./context/templateModalContext.js";import c from"./modalElements/Footer.js";import p from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as m}from"./utils/convertPlaceholdersToBikDropdown.js";const u=u=>{let{selectedTemplate:h,closeDialog:C,showVariableMapping:b,channel:g,htmlContent:v,templateVariables:S,onTemplateSelect:T,globalPlaceholders:f,showOnlyContent:P,whatsappSpecificPickerMeta:w,zIndex:x,showVariableModal:M,variableList:y,discountCode:L,setDiscountCode:V,onBackPress:j,enabledCustomText:E,variableListForImage:I,showSampleValues:k,disableEditVariable:A,pod:D,extras:O,isProductCarouselType:F,pickerConf:W}=u;var z,B,H,U;o((()=>{q(v)}),[v]);const $=g===n.WHATSAPP&&"CAROUSEL"===(null===(B=null===(z=h.components)||void 0===z?void 0:z[1])||void 0===B?void 0:B.type),[N,R]=a(g===n.EMAIL||$?"desktop":"mobile"),[_,q]=a(v),[G,J]=a(!1),[K,Q]=a(h),[X,Y]=a(null!=S?S:[]),[Z,ee]=a(!1),[le,te]=a(-1);const oe=i((()=>m(f)),[f]);return e(d.Provider,Object.assign({value:{template:K,setTemplate:Q,device:N,setDevice:R,display_content:_,setDisplayContent:q,originalVariableList:X,setOriginalVariableList:Y,isError:G,setIsError:J,channel:g,globalNormalizedPlaceholders:oe,templateSelectionTriggered:Z,setTemplateSelectionTriggered:ee,enabledCustomText:E,disableEditVariable:A,pod:D,extras:O,isWhatsappCarousel:$,selectedCarouselIndex:le,setSelectedCarouselIndex:te,isProductCarouselType:h.isProductCarouselType,pickerConf:W}},{children:P?e(p,{channel:n.EMAIL,hideHeader:!0}):l(r,Object.assign({zIndex:x,centralContainerStyles:{width:$?900:g===n.EMAIL&&b?1e3:800},open:!0,onClose:()=>{null==C||C()},headingTitle:null==K?void 0:K.label,headingSubtitle:g===n.WHATSAPP?`${s.capitaliseFirstLetterOfString(null!==(H=null==K?void 0:K.category)&&void 0!==H?H:"")} • ${null!==(U=null==K?void 0:K.templateCategory)&&void 0!==U?U:""}`:"",onBackPress:()=>{null==j||j()}},{children:[e(p,{showSampleValues:k,showVariableMapping:b,channel:g,whatsappSpecificPickerMeta:w,showVariableModal:M,variableList:y,discountCode:L,setDiscountCode:V,variableListForImage:I&&(null==I?void 0:I.length)>0?I:y}),T?e(c,{isWhatsappCarousel:null!=$&&$,onSelect:function(){const e=null==T?void 0:T(K,X,null!=_?_:"");e?J(!!e):ee(!0)}}):e(t,{})]}))}))};export{u as TemplateContextMapper};
@@ -73,6 +73,7 @@ export type WhatsAppCarouselTemplate = {
73
73
  createdAt: number;
74
74
  updatedAt: number;
75
75
  isDraft?: boolean;
76
+ isProductCarouselType?: boolean;
76
77
  };
77
78
  export interface WhatsAppCarouselTemplateVariables {
78
79
  body: CUSTOM_VARIABLE[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.433-beta.3",
3
+ "version": "0.0.433-beta.4",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",