@bikdotai/bik-component-library 0.0.511-beta.tcm-1 → 0.0.511-beta.tcm-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/cjs/components/template-context-mapper/modalElements/Body.js +3 -3
- package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/esm/components/template-context-mapper/modalElements/Body.js +5 -5
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("styled-components"),i=require("../../carousel-preview/CarouselPreview.js"),o=require("./EditWhatsAppCarouselTemplateV2.js"),l=require("../../template-preview/models/Channels.js"),s=require("../../../constants/Theme.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("styled-components"),i=require("../../carousel-preview/CarouselPreview.js"),o=require("./EditWhatsAppCarouselTemplateV2.js"),l=require("../../template-preview/models/Channels.js"),s=require("../../../constants/Theme.js"),n=require("../context/templateModalContext.js"),r=require("../utils/getVariableNameEmail.js"),d=require("../utils/highlightFor.js"),u=require("./DesktopPreview.js"),p=require("./EditWhatsAppTemplateV2.js"),c=require("./MobilePreview.js"),h=require("./VariableConnectorsPanel.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=m(a);const f=v.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
// height: 100%;
|
|
4
4
|
`,b=v.default.div`
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
flex: 1;
|
|
16
16
|
height: ${e=>e.isWhatsappCarousel||e.hideDeviceContainerInPreview?"500px":"475px"};
|
|
17
17
|
overflow-y: auto;
|
|
18
|
-
background-image: ${e=>e.hideDeviceContainerInPreview?"url('https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f');":"none"};
|
|
19
|
-
`;exports.default=a=>{const{showVariableMapping:m,showOnlyContent:v,whatsappSpecificPickerMeta:g,showVariableModal:w,variableList:x,discountCode:P,setDiscountCode:
|
|
18
|
+
background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===l.CHANNEL_TYPE.WHATSAPP?"url('https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f');":"none"};
|
|
19
|
+
`;exports.default=a=>{const{showVariableMapping:m,showOnlyContent:v,whatsappSpecificPickerMeta:g,showVariableModal:w,variableList:x,discountCode:P,setDiscountCode:E,variableListForImage:j,showSampleValues:A,fileName:T,setFileName:L}=a,N=t.useRef(),y=t.useRef(),{device:S,display_content:_,channel:M,template:W,setTemplate:V,isWhatsappCarousel:q,isProductCarouselType:O,hideDeviceContainerInPreview:k}=n.useTemplateModalContext();const H=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e.jsxs(f,{children:[e.jsx(C,Object.assign({showOnlyContent:v,showVariableMapping:m,isWhatsappCarousel:q,hideDeviceContainerInPreview:k,channel:M},{children:"mobile"===S?e.jsx(c.default,{ref:y,display_content:null!=_?_:"",channel:M,template:W,showSampleValues:A}):M===l.CHANNEL_TYPE.WHATSAPP&&q?e.jsx(i.CarouselPreview,{ref:N,channel:M,template:W,showSampleValues:A,isPreview:!1}):M!==l.CHANNEL_TYPE.MESSAGE?e.jsx(u.default,{ref:N,channel:M,display_content:null!=_?_:"",showSampleValues:A}):e.jsx(e.Fragment,{})})),(O||m)&&e.jsx(b,Object.assign({channel:M,isWhatsappCarousel:q},{children:M!==l.CHANNEL_TYPE.WHATSAPP?e.jsx(h.default,{onFocus:M===l.CHANNEL_TYPE.EMAIL?function(e){var t,a,i;const o=null===document||void 0===document?void 0:document.getElementById("mobile"===S?"template_html_mobile":"template_html_desktop"),n=r.getVariableNameForEmailByIndex(e+1),u=M===l.CHANNEL_TYPE.EMAIL?null===(t=null==o?void 0:o.contentWindow)||void 0===t?void 0:t.document.getElementById(n):document.getElementById(n),p=H(u),c=null==u?void 0:u.offsetLeft;"desktop"===S?p&&N.current&&(null===(a=null==o?void 0:o.contentWindow)||void 0===a||a.scrollTo(null!=c?c:0,p),d.highlightFor(n,s.COLORS.background.warning.light,2,M,S)):p&&y.current&&(null===(i=null==o?void 0:o.contentWindow)||void 0===i||i.scrollTo(null!=c?c:0,p),d.highlightFor(n,s.COLORS.background.warning.light,2,M,S))}:void 0,showVariableModal:w,variableList:x,discountCode:P,setDiscountCode:E}):M===l.CHANNEL_TYPE.WHATSAPP&&q?e.jsx(o.default,{whatsappSpecificPickerMeta:g,template:W,showVariableModal:w,variableList:x,variableListForImage:j,discountCode:P,setDiscountCode:E}):e.jsx(p.default,{whatsappSpecificPickerMeta:g,template:W,onTemplateChange:e=>{null==V||V(e)},showVariableModal:w,variableList:x,variableListForImage:j,discountCode:P,setDiscountCode:E,fileName:T,setFileName:L})}))]})};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o,Fragment as t}from"react/jsx-runtime";import{useRef as
|
|
1
|
+
import{jsxs as e,jsx as o,Fragment as t}from"react/jsx-runtime";import{useRef as a}from"react";import i from"styled-components";import{CarouselPreview as l}from"../../carousel-preview/CarouselPreview.js";import n from"./EditWhatsAppCarouselTemplateV2.js";import{CHANNEL_TYPE as s}from"../../template-preview/models/Channels.js";import{COLORS as r}from"../../../constants/Theme.js";import{useTemplateModalContext as p}from"../context/templateModalContext.js";import{getVariableNameForEmailByIndex as d}from"../utils/getVariableNameEmail.js";import{highlightFor as m}from"../utils/highlightFor.js";import c from"./DesktopPreview.js";import h from"./EditWhatsAppTemplateV2.js";import u from"./MobilePreview.js";import f from"./VariableConnectorsPanel.js";const v=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
// height: 100%;
|
|
4
|
-
`,b=
|
|
4
|
+
`,b=i.div`
|
|
5
5
|
padding: 16px 14px;
|
|
6
6
|
max-width: 450px;
|
|
7
7
|
|
|
@@ -10,10 +10,10 @@ import{jsxs as e,jsx as o,Fragment as t}from"react/jsx-runtime";import{useRef as
|
|
|
10
10
|
padding-bottom: 24px;
|
|
11
11
|
border-left: ${r.stroke.primary} 1px solid;
|
|
12
12
|
border-top: ${e=>e.isWhatsappCarousel?`${r.stroke.primary} 1px solid`:void 0};
|
|
13
|
-
`,w=
|
|
13
|
+
`,w=i.div`
|
|
14
14
|
padding: ${e=>e.isWhatsappCarousel?void 0:e.showOnlyContent?"16px 14px":"16px 32px"};
|
|
15
15
|
flex: 1;
|
|
16
16
|
height: ${e=>e.isWhatsappCarousel||e.hideDeviceContainerInPreview?"500px":"475px"};
|
|
17
17
|
overflow-y: auto;
|
|
18
|
-
background-image: ${e=>e.hideDeviceContainerInPreview?"url('https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f');":"none"};
|
|
19
|
-
`,g=
|
|
18
|
+
background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===s.WHATSAPP?"url('https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f');":"none"};
|
|
19
|
+
`,g=i=>{const{showVariableMapping:g,showOnlyContent:C,whatsappSpecificPickerMeta:P,showVariableModal:x,variableList:y,discountCode:W,setDiscountCode:A,variableListForImage:j,showSampleValues:M,fileName:S,setFileName:T}=i,V=a(),k=a(),{device:I,display_content:E,channel:L,template:D,setTemplate:F,isWhatsappCarousel:$,isProductCarouselType:_,hideDeviceContainerInPreview:H}=p();const N=e=>{let o=0;for(;e;)o+=e.offsetTop,e=e.offsetParent;return o};return e(v,{children:[o(w,Object.assign({showOnlyContent:C,showVariableMapping:g,isWhatsappCarousel:$,hideDeviceContainerInPreview:H,channel:L},{children:"mobile"===I?o(u,{ref:k,display_content:null!=E?E:"",channel:L,template:D,showSampleValues:M}):L===s.WHATSAPP&&$?o(l,{ref:V,channel:L,template:D,showSampleValues:M,isPreview:!1}):L!==s.MESSAGE?o(c,{ref:V,channel:L,display_content:null!=E?E:"",showSampleValues:M}):o(t,{})})),(_||g)&&o(b,Object.assign({channel:L,isWhatsappCarousel:$},{children:L!==s.WHATSAPP?o(f,{onFocus:L===s.EMAIL?function(e){var o,t,a;const i=null===document||void 0===document?void 0:document.getElementById("mobile"===I?"template_html_mobile":"template_html_desktop"),l=d(e+1),n=L===s.EMAIL?null===(o=null==i?void 0:i.contentWindow)||void 0===o?void 0:o.document.getElementById(l):document.getElementById(l),p=N(n),c=null==n?void 0:n.offsetLeft;"desktop"===I?p&&V.current&&(null===(t=null==i?void 0:i.contentWindow)||void 0===t||t.scrollTo(null!=c?c:0,p),m(l,r.background.warning.light,2,L,I)):p&&k.current&&(null===(a=null==i?void 0:i.contentWindow)||void 0===a||a.scrollTo(null!=c?c:0,p),m(l,r.background.warning.light,2,L,I))}:void 0,showVariableModal:x,variableList:y,discountCode:W,setDiscountCode:A}):L===s.WHATSAPP&&$?o(n,{whatsappSpecificPickerMeta:P,template:D,showVariableModal:x,variableList:y,variableListForImage:j,discountCode:W,setDiscountCode:A}):o(h,{whatsappSpecificPickerMeta:P,template:D,onTemplateChange:e=>{null==F||F(e)},showVariableModal:x,variableList:y,variableListForImage:j,discountCode:W,setDiscountCode:A,fileName:S,setFileName:T})}))]})};export{g as default};
|