@bikdotai/bik-component-library 0.0.533-beta.15 → 0.0.533-beta.16
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/template-context-mapper/modalElements/Body.js +8 -8
- package/dist/cjs/components/variable-picker-v3/recommendVaribles.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/esm/components/template-context-mapper/modalElements/Body.js +2 -2
- package/dist/esm/components/variable-picker-v3/recommendVaribles.js +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../curtain/CurtainHelper.js");var t=require("../../variable-picker-v3/model.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../curtain/CurtainHelper.js");var t=require("../../variable-picker-v3/model.js"),a=require("lodash"),i=require("react"),l=require("styled-components"),o=require("../../carousel-preview/CarouselPreview.js"),r=require("./EditWhatsAppCarouselTemplateV2.js"),s=require("../../template-preview/models/Channels.js"),n=require("../../TypographyStyle.js"),d=require("../../variable-picker-v3/VariablePicker.js"),p=require("../../../constants/Theme.js"),c=require("../context/templateModalContext.js"),u=require("../utils/constants.js"),h=require("../utils/getVariableNameEmail.js"),m=require("../utils/highlightFor.js"),v=require("./DesktopPreview.js"),C=require("./EditWhatsAppTemplateV2.js"),w=require("./MobilePreview.js"),P=require("./VariableConnectorsPanel.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=x(l);const g=b.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
// height: 100%;
|
|
4
4
|
`,E=b.default.div`
|
|
5
5
|
max-width: 450px;
|
|
6
|
-
max-width: ${e=>e.channel===
|
|
6
|
+
max-width: ${e=>e.channel===s.CHANNEL_TYPE.EMAIL?"400px":"450px"};
|
|
7
7
|
|
|
8
|
-
height: ${e=>e.channel===
|
|
8
|
+
height: ${e=>e.channel===s.CHANNEL_TYPE.WHATSAPP?"500px":"475px"};
|
|
9
9
|
overflow-y: auto;
|
|
10
10
|
padding-bottom: 24px;
|
|
11
|
-
border-left: ${
|
|
12
|
-
border-top: ${e=>e.isWhatsappCarousel?`${
|
|
11
|
+
border-left: ${p.COLORS.stroke.primary} 1px solid;
|
|
12
|
+
border-top: ${e=>e.isWhatsappCarousel?`${p.COLORS.stroke.primary} 1px solid`:void 0};
|
|
13
13
|
${e=>!e.showVariableMapping&&"width: 340px; height: 500px"};
|
|
14
14
|
`,f=b.default.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===s.CHANNEL_TYPE.WHATSAPP?`url(${u.BACKGROUND_PREVIEW_IMAGE});`:"none"};
|
|
20
|
+
display: ${e=>e.hideDeviceContainerInPreview&&e.channel===s.CHANNEL_TYPE.WHATSAPP?"flex":"initial"};
|
|
21
21
|
align-items: flex-start;
|
|
22
|
-
`;exports.default=l=>{const{showVariableMapping:u,showOnlyContent:x,whatsappSpecificPickerMeta:b,showVariableModal:j,discountCode:y,setDiscountCode:A,variableListForImage:T,showSampleValues:S,variableListFromProps:L}=l,k=
|
|
22
|
+
`;exports.default=l=>{const{showVariableMapping:u,showOnlyContent:x,whatsappSpecificPickerMeta:b,showVariableModal:j,discountCode:y,setDiscountCode:A,variableListForImage:T,showSampleValues:S,variableListFromProps:L}=l,k=i.useRef(),N=i.useRef(),{variableList:V,setVariableList:M,variableCallback:_,showVariablePicker:H,setShowVariablePicker:q,device:O,display_content:W,channel:I,template:D,setTemplate:B,isWhatsappCarousel:Y,isProductCarouselType:$,hideDeviceContainerInPreview:F}=c.useTemplateModalContext();const R=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e.jsxs(g,{children:[e.jsx(f,Object.assign({showOnlyContent:x,showVariableMapping:u,isWhatsappCarousel:Y,hideDeviceContainerInPreview:F,channel:I},{children:"mobile"===O?e.jsx(w.default,{ref:N,display_content:null!=W?W:"",channel:I,template:D,showSampleValues:S}):I===s.CHANNEL_TYPE.WHATSAPP&&Y?e.jsx(o.CarouselPreview,{ref:k,channel:I,template:D,showSampleValues:S,isPreview:!1,showArrows:!0}):I!==s.CHANNEL_TYPE.MESSAGE?e.jsx(v.default,{ref:k,channel:I,display_content:null!=W?W:"",showSampleValues:S}):e.jsx(e.Fragment,{})})),($||u)&&e.jsxs(E,Object.assign({channel:I,isWhatsappCarousel:Y,showVariableMapping:!0},{children:[e.jsx("div",Object.assign({style:{height:"100%",width:"whatsapp"===I?428:400,display:H?"block":"none"}},{children:e.jsx(d.VariablePicker,{hideHeaderCross:!0,showHeader:!0,showBackButton:!0,onBackButtonClick:()=>{M(a.cloneDeep(L)),q(!1)},onSelect:e=>{_(e),M(a.cloneDeep(L)),q(!1)},type:t.PickerType.EMBEDDED,data:null!=V?V:[]},Math.random())})),e.jsx("div",Object.assign({style:{padding:"16px 14px",width:"whatsapp"===I?428:400,display:H?"none":"block"}},{children:I!==s.CHANNEL_TYPE.WHATSAPP?e.jsx(P.default,{onFocus:I===s.CHANNEL_TYPE.EMAIL?function(e){var t,a,i;const l=null===document||void 0===document?void 0:document.getElementById("mobile"===O?"template_html_mobile":"template_html_desktop"),o=h.getVariableNameForEmailByIndex(e+1),r=I===s.CHANNEL_TYPE.EMAIL?null===(t=null==l?void 0:l.contentWindow)||void 0===t?void 0:t.document.getElementById(o):document.getElementById(o),n=R(r),d=null==r?void 0:r.offsetLeft;"desktop"===O?n&&k.current&&(null===(a=null==l?void 0:l.contentWindow)||void 0===a||a.scrollTo(null!=d?d:0,n),m.highlightFor(o,p.COLORS.background.warning.light,2,I,O)):n&&N.current&&(null===(i=null==l?void 0:l.contentWindow)||void 0===i||i.scrollTo(null!=d?d:0,n),m.highlightFor(o,p.COLORS.background.warning.light,2,I,O))}:void 0,showVariableModal:j,discountCode:y,setDiscountCode:A}):I===s.CHANNEL_TYPE.WHATSAPP&&Y?e.jsx(r.default,{whatsappSpecificPickerMeta:b,template:D,showVariableModal:j,variableListForImage:T,discountCode:y,setDiscountCode:A}):e.jsx(C.default,{whatsappSpecificPickerMeta:b,template:D,onTemplateChange:e=>{null==B||B(e)},showVariableModal:j,variableListForImage:T,discountCode:y,setDiscountCode:A})}))]})),I===s.CHANNEL_TYPE.WHATSAPP&&!u&&!$&&e.jsx(E,{children:e.jsx(n.BodySecondary,Object.assign({color:p.COLORS.content.secondary,style:{fontStyle:"italic"}},{children:"Click on ‘Select template’ below to use it"}))})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=e=>Object.keys(e).reduce(((s,a)=>(e[a]&&e[a].isAvailable&&(s[a]=e[a]),s)),{});exports.showOnlyRecommendedVariables=(s,a)=>s.map((s=>{if(s.isAvailable&&void 0===s.variables)return s;if(void 0===s.isAvailable&&void 0!==s.variables){const a=e(s.variables);return 0===Object.keys(a).length?{}:Object.assign(Object.assign({},s),{variables:a})}if(void 0===s.variables){return e(s)}{const i=e(s.variables);return a.length?i:Object.assign(Object.assign({},s),{variables:i})}})).filter((e=>Object.keys(e).length>0));
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=e=>Object.keys(e).reduce(((s,a)=>(e[a]&&e[a].isAvailable&&(s[a]=e[a]),s)),{});exports.showOnlyRecommendedVariables=(s,a)=>s.map((s=>{if(s.isAvailable&&void 0===s.variables)return s;if(void 0===s.isAvailable&&void 0!==s.variables){const a=e(s.variables);return 0===Object.keys(a).length?{}:Object.assign(Object.assign({},s),{variables:a})}if(void 0===s.variables){return e(s)}{const i=e(s.variables);return a.length?i:0===Object.keys(i).length?{}:Object.assign(Object.assign({},s),{variables:i})}})).filter((e=>Object.keys(e).length>0));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx 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`
|
|
@@ -19,4 +19,4 @@ import{jsxs as e,jsx as o,Fragment as t}from"react/jsx-runtime";import"../../cur
|
|
|
19
19
|
background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===p.WHATSAPP?`url(${u});`:"none"};
|
|
20
20
|
display: ${e=>e.hideDeviceContainerInPreview&&e.channel===p.WHATSAPP?"flex":"initial"};
|
|
21
21
|
align-items: flex-start;
|
|
22
|
-
`,k=n=>{const{showVariableMapping:u,showOnlyContent:k,whatsappSpecificPickerMeta:j,showVariableModal:A,discountCode:S,setDiscountCode:V,variableListForImage:M,showSampleValues:W,variableListFromProps:T}=n,E=l(),I=l(),{variableList:D,setVariableList:$,variableCallback:H,showVariablePicker:L,setShowVariablePicker:B,device:O,display_content:_,channel:F,template:G,setTemplate:N,isWhatsappCarousel:q,isProductCarouselType:z,hideDeviceContainerInPreview:J}=h();const K=e=>{let
|
|
22
|
+
`,k=n=>{const{showVariableMapping:u,showOnlyContent:k,whatsappSpecificPickerMeta:j,showVariableModal:A,discountCode:S,setDiscountCode:V,variableListForImage:M,showSampleValues:W,variableListFromProps:T}=n,E=l(),I=l(),{variableList:D,setVariableList:$,variableCallback:H,showVariablePicker:L,setShowVariablePicker:B,device:O,display_content:_,channel:F,template:G,setTemplate:N,isWhatsappCarousel:q,isProductCarouselType:z,hideDeviceContainerInPreview:J}=h();const K=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e(P,{children:[t(y,Object.assign({showOnlyContent:k,showVariableMapping:u,isWhatsappCarousel:q,hideDeviceContainerInPreview:J,channel:F},{children:"mobile"===O?t(g,{ref:I,display_content:null!=_?_:"",channel:F,template:G,showSampleValues:W}):F===p.WHATSAPP&&q?t(r,{ref:E,channel:F,template:G,showSampleValues:W,isPreview:!1,showArrows:!0}):F!==p.MESSAGE?t(f,{ref:E,channel:F,display_content:null!=_?_:"",showSampleValues:W}):t(o,{})})),(z||u)&&e(x,Object.assign({channel:F,isWhatsappCarousel:q,showVariableMapping:!0},{children:[t("div",Object.assign({style:{height:"100%",width:"whatsapp"===F?428:400,display:L?"block":"none"}},{children:t(c,{hideHeaderCross:!0,showHeader:!0,showBackButton:!0,onBackButtonClick:()=>{$(a(T)),B(!1)},onSelect:e=>{H(e),$(a(T)),B(!1)},type:i.EMBEDDED,data:null!=D?D:[]},Math.random())})),t("div",Object.assign({style:{padding:"16px 14px",width:"whatsapp"===F?428:400,display:L?"none":"block"}},{children:F!==p.WHATSAPP?t(C,{onFocus:F===p.EMAIL?function(e){var t,o,i;const a=null===document||void 0===document?void 0:document.getElementById("mobile"===O?"template_html_mobile":"template_html_desktop"),l=w(e+1),n=F===p.EMAIL?null===(t=null==a?void 0:a.contentWindow)||void 0===t?void 0:t.document.getElementById(l):document.getElementById(l),r=K(n),s=null==n?void 0:n.offsetLeft;"desktop"===O?r&&E.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,F,O)):r&&I.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,F,O))}:void 0,showVariableModal:A,discountCode:S,setDiscountCode:V}):F===p.WHATSAPP&&q?t(s,{whatsappSpecificPickerMeta:j,template:G,showVariableModal:A,variableListForImage:M,discountCode:S,setDiscountCode:V}):t(b,{whatsappSpecificPickerMeta:j,template:G,onTemplateChange:e=>{null==N||N(e)},showVariableModal:A,variableListForImage:M,discountCode:S,setDiscountCode:V})}))]})),F===p.WHATSAPP&&!u&&!z&&t(x,{children:t(d,Object.assign({color:m.content.secondary,style:{fontStyle:"italic"}},{children:"Click on ‘Select template’ below to use it"}))})]})};export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=(e,i)=>e.map((e=>{if(e.isAvailable&&void 0===e.variables)return e;if(void 0===e.isAvailable&&void 0!==e.variables){const i=a(e.variables);return 0===Object.keys(i).length?{}:Object.assign(Object.assign({},e),{variables:i})}if(void 0===e.variables){return a(e)}{const s=a(e.variables);return i.length?s:Object.assign(Object.assign({},e),{variables:s})}})).filter((e=>Object.keys(e).length>0)),a=e=>Object.keys(e).reduce(((a,i)=>(e[i]&&e[i].isAvailable&&(a[i]=e[i]),a)),{});export{e as showOnlyRecommendedVariables};
|
|
1
|
+
const e=(e,i)=>e.map((e=>{if(e.isAvailable&&void 0===e.variables)return e;if(void 0===e.isAvailable&&void 0!==e.variables){const i=a(e.variables);return 0===Object.keys(i).length?{}:Object.assign(Object.assign({},e),{variables:i})}if(void 0===e.variables){return a(e)}{const s=a(e.variables);return i.length?s:0===Object.keys(s).length?{}:Object.assign(Object.assign({},e),{variables:s})}})).filter((e=>Object.keys(e).length>0)),a=e=>Object.keys(e).reduce(((a,i)=>(e[i]&&e[i].isAvailable&&(a[i]=e[i]),a)),{});export{e as showOnlyRecommendedVariables};
|