@bikdotai/bik-component-library 0.0.419-beta.12 → 0.0.419-beta.14
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/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +47 -1
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +47 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("../../helpers/BaseWhatsappContentLang.helper.js"),r=require("react"),l=require("../../constants/Theme.js"),o=require("../TypographyStyle.js"),i=require("./CustomEditor.styled.js"),u=require("./WhatsAppTextEditorHeader.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=c(r);const a="Character limit reached",d=new n.BaseWhatsappContentLangHelper,v={[u.EditorActionTypes.BOLD]:"*",[u.EditorActionTypes.ITALIC]:"_",[u.EditorActionTypes.STRIKETHROUGH]:"~"},p=s.default.forwardRef(((n,c)=>{var s,p,{onChange:h,text:f,RightComponent:g,error:x,limit:j,onError:m,rows:C,actions:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("../../helpers/BaseWhatsappContentLang.helper.js"),r=require("react"),l=require("../../constants/Theme.js"),o=require("../TypographyStyle.js"),i=require("./CustomEditor.styled.js"),u=require("./WhatsAppTextEditorHeader.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=c(r);const a="Character limit reached",d=new n.BaseWhatsappContentLangHelper,v={[u.EditorActionTypes.BOLD]:"*",[u.EditorActionTypes.ITALIC]:"_",[u.EditorActionTypes.STRIKETHROUGH]:"~"},p=s.default.forwardRef(((n,c)=>{var s,p,{onChange:h,text:f,RightComponent:g,error:x,limit:j,onError:m,rows:C,actions:T}=n,E=e.__rest(n,["onChange","text","RightComponent","error","limit","onError","rows","actions"]);const y=r.useRef(null);function O(e){const t=null==y?void 0:y.current;null!=t&&(t.selectionStart?(t.focus(),t.selectionEnd=e):t.focus())}function S(e){var t,n;let r=null!==(n=null===(t=y.current)||void 0===t?void 0:t.value)&&void 0!==n?n:"";if(y.current&&e){const t=y.current.selectionStart,n=y.current.selectionEnd,l=e;if(t===n)return L(l);{r=d.wrappWildcard(t,n,l,r);const e=d.getHTML(r);return y.current.value=r,{text:r,html:e}}}return{text:r,html:r}}function L(e){var t,n;let r=null!==(n=null===(t=y.current)||void 0===t?void 0:t.value)&&void 0!==n?n:"";if(y.current&&e){const t=y.current.selectionStart;if(t===y.current.selectionEnd)return R(e,t)}return{text:r,html:r}}function R(e,t){var n,r;let l=null!==(r=null===(n=y.current)||void 0===n?void 0:n.value)&&void 0!==r?r:"";l=l.slice(0,t)+e+l.slice(t);const o=d.getHTML(l);return y.current.value=l,{text:l,html:o}}return r.useImperativeHandle(c,(()=>({addTextOrWrap:S,addText:L,get(){var e,t;return null!==(t=null===(e=y.current)||void 0===e?void 0:e.value)&&void 0!==t?t:""},setCaretPosition:O}))),r.useEffect((()=>{if(console.log("defaultText",f),console.log("textSpaceRef",y),(null==y?void 0:y.current)&&f){y.current.value=f;const e=d.getHTML(f);null==h||h(f,e)}}),[f]),r.useEffect((()=>{var e,t;(null===(e=null==y?void 0:y.current)||void 0===e?void 0:e.value)&&j&&((null===(t=null==y?void 0:y.current)||void 0===t?void 0:t.value.length)>j?null==m||m(a):null==m||m(null!=x?x:""))}),[null===(s=null==y?void 0:y.current)||void 0===s?void 0:s.value.length]),t.jsxs(i.OuterContainer,{children:[t.jsxs(i.Container,Object.assign({isError:!!x},{children:[t.jsx(u.WhatsAppTextEditorHeader,{actions:T,ref:y,onActionSelect:function(e){if((null==v?void 0:v[e])&&y.current){const t=y.current.selectionStart;if(t===y.current.selectionEnd){R(null==v?void 0:v[e],t);const{text:n,html:r}=R(null==v?void 0:v[e],t);O(t+1),null==h||h(n,r)}else{const{text:t,html:n}=S(null==v?void 0:v[e]);null==h||h(t,n)}}},RightComponent:g,onEmojiClick:function(e){const{text:t,html:n}=L(e);null==h||h(t,n)}}),t.jsx(i.TextSpace,Object.assign({ref:y,onChange:function(e){const t=e.target.value,n=d.getHTML(t);null==h||h(t,n)}},E,{rows:C}))]})),x&&x!==a?t.jsx(o.BodyCaption,Object.assign({style:{color:l.COLORS.content.negative}},{children:x})):t.jsx(t.Fragment,{children:j&&(null==y?void 0:y.current)?t.jsxs(o.BodyCaption,Object.assign({style:{color:x===a||(null===(p=null==y?void 0:y.current)||void 0===p?void 0:p.value.length)>j?l.COLORS.content.negative:l.COLORS.content.secondary}},{children:[y.current.value.length,"/",j]})):t.jsx(t.Fragment,{})})]})}));p.displayName="WhatsAppTextEditor",exports.WhatsAppTextEditor=p;
|
package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js
CHANGED
|
@@ -1 +1,47 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/PlusIcon.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/PlusIcon.js"),i=require("react"),s=require("styled-components"),o=require("../../add-variableV2/AddVariableV2SideModal.js");require("../../../_virtual/_tslib.js"),require("../../add-variableV2/AddVariableV2.styled.js");var r=require("../../button/Button.js"),a=require("../../icon-button/IconButton.js");require("../../input/Input.js"),require("../../tooltips/Tooltip.js");var n=require("../../../constants/Theme.js");require("../../modals/modal.styled.js"),require("../../switch/Switch.js");var l=require("../../TypographyStyle.js"),d=require("../../product-picker-v2/modal.js"),c=require("../context/templateModalContext.js"),u=require("./EditWhatsAppTemplateV2.js"),p=require("../../../assets/icons/box.svg.js"),m=require("../../../assets/icons/delete.svg.js"),f=require("../../../assets/icons/edit.svg.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const h=t=>{const{cardBody:i,deleteItem:s,editItem:o}=t;return e.jsxs(x,Object.assign({width:"100%"},{children:[e.jsx("div",Object.assign({style:{width:36,height:36}},{children:e.jsx(p.default,{})})),e.jsx("div",Object.assign({className:"card-body"},{children:e.jsx(l.TitleRegular,{children:i})})),e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center"}},{children:[o&&e.jsx(a.IconButton,{style:{display:"flex"},Icon:f.default,onClick:e=>{o(),e.stopPropagation()}}),e.jsx(a.IconButton,{style:{display:"flex",color:"#919191"},Icon:m.default,onClick:e=>{s(),e.stopPropagation()}})]}))]}))},x=g(s).default.div`
|
|
2
|
+
width: ${e=>e.width};
|
|
3
|
+
padding: 12px;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
column-gap: 14px;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
background: #ffffff;
|
|
10
|
+
|
|
11
|
+
border: 1px solid #e0e0e0;
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
|
|
14
|
+
.card-body {
|
|
15
|
+
width: 256px;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
|
|
20
|
+
&__dynamic {
|
|
21
|
+
font-family: 'Inter';
|
|
22
|
+
font-style: normal;
|
|
23
|
+
font-weight: 400;
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
line-height: 24px;
|
|
26
|
+
color: #731dcf;
|
|
27
|
+
|
|
28
|
+
&__desc {
|
|
29
|
+
font-family: 'Inter';
|
|
30
|
+
font-style: normal;
|
|
31
|
+
font-weight: 400;
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
line-height: 16px;
|
|
34
|
+
color: #616161;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__simple {
|
|
39
|
+
font-family: 'Inter';
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: 400;
|
|
42
|
+
font-size: 16px;
|
|
43
|
+
line-height: 24px;
|
|
44
|
+
color: #000000;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`;exports.default=s=>{let{template:a,whatsappSpecificPickerMeta:p,showVariableModal:m,variableList:f,variableListForImage:g,discountCode:x,setDiscountCode:y}=s;const{selectedCarouselIndex:j,setTemplate:b,pickerConf:v,isProductCarouselTemplate:I}=c.useTemplateModalContext(),[C,w]=i.useState(-1==j?"First Message (Step 1/2)":"Carousel Cards (Step 2/2)"),[q,O]=i.useState(!1),[k,S]=i.useState(!1),[T,P]=i.useState([]);i.useEffect((()=>{w(-1==j?"First Message (Step 1/2)":"Carousel Cards (Step 2/2)")}),[j]);return e.jsxs("div",{children:[e.jsx(l.TitleMedium,Object.assign({style:{marginLeft:10,marginBottom:10}},{children:C})),I&&T.length>0&&null!=j&&j>=0&&e.jsxs("div",Object.assign({style:{display:"flex",rowGap:16,marginBottom:16,flexDirection:"column"}},{children:[e.jsx(h,{editItem:()=>O(!q),cardBody:`${T.length} Products Selected`,deleteItem:()=>{P([])}}),e.jsx(r.Button,{disabled:T.length<=1,style:{alignSelf:"flex-end",background:n.COLORS.surface.subdued},onClick:()=>{O(!0)},buttonText:"Rearrange Products",buttonType:"tertiary"})]})),I&&0===T.length&&null!=j&&j>=0&&e.jsxs("div",Object.assign({style:{marginTop:16,marginBottom:16,marginLeft:12,marginRight:12,flexDirection:"column",display:"flex",alignItems:"center"}},{children:[e.jsx(r.Button,{matchParentWidth:!0,style:{flex:1,display:"flex",width:"100%",marginBottom:12},size:"medium",buttonText:"Add Product(s)",buttonType:"dashBold",LeadingIcon:t.default,onClick:e=>{O(!0)}}),e.jsxs("div",Object.assign({style:{display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",flexDirection:"row",width:"100%"}},{children:[e.jsx("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginRight:8}}),e.jsx(l.BodyCaption,Object.assign({style:{color:"#616161",overflow:"unset"}},{children:"OR"})),e.jsx("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginLeft:8}})]})),e.jsx(r.Button,{matchParentWidth:!0,style:{flex:1,display:"flex",marginTop:12,width:"100%"},size:"medium",buttonText:"Add Product(s) Variable",buttonType:"dashBold",LeadingIcon:t.default,onClick:e=>{S(!0)}})]})),e.jsx(u.default,{whatsappSpecificPickerMeta:p,template:a,onTemplateChange:e=>{null==b||b(e)},showVariableModal:m,variableList:f,variableListForImage:g,discountCode:x,setDiscountCode:y}),q&&v&&e.jsx(d.ProductPickerModal,{zIndex:200,limit:1,storeId:v.storeId,selectedItems:(e=>{if(e.length>0){const t={};for(const i of e){const e=null==i?void 0:i.collectionId,s=i.productId,o=i.variantId;e in t||(t[e]={products:{},name:"",image:"",isSmartCollection:!1}),s in t[e].products||(t[e].products[s]={variants:{},name:(null==i?void 0:i.productName)||"",image:(null==i?void 0:i.productImage)||""}),t[e].products[s].variants[o]={name:(null==i?void 0:i.name)||"",price:"",image:(null==i?void 0:i.image)||"",quantity:i.quantity||0,displayOrder:i.displayOrder}}return t}return{}})(T),collectionFetcher:v.fetchCollections,productFetcher:v.fetchProducts,onAdd:(e,t)=>{const i=[];delete e.isCustom;for(const t of Object.keys(e)){const s=e[t].products;if(void 0!==s&&Object.keys(s).length)for(const e of Object.keys(s)){const o=s[e].variants;if(void 0!==o&&Object.keys(o).length)for(const r of Object.keys(o)){const{name:a,image:n,quantity:l,displayOrder:d}=o[r],c={name:a,image:n,quantity:l,variantId:r,productId:e,displayOrder:d,collectionId:t,productName:s[e].name,productImage:s[e].image};i.push(c)}}}const s=i.sort(((e,t)=>e.displayOrder-t.displayOrder));P(s),O(!1)},searchInCollectionFetcher:v.searchInCollection,searchFetcher:v.searchProducts,visible:q,onClose:()=>{O(!1)}}),k&&e.jsx(o.AddVariableV2SideModal,{zIndex:2e3,data:null!=f?f:[],showVariable:k,setShowVariable:S,placeholder:"Add a variable",customTrigger:e=>{}})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as t}from"../../_virtual/_tslib.js";import{jsxs as n,jsx as e,Fragment as r}from"react/jsx-runtime";import{BaseWhatsappContentLangHelper as l}from"../../helpers/BaseWhatsappContentLang.helper.js";import o,{useRef as i,useImperativeHandle as u,useEffect as c}from"react";import{COLORS as s}from"../../constants/Theme.js";import{BodyCaption as a}from"../TypographyStyle.js";import{OuterContainer as d,Container as v,TextSpace as m}from"./CustomEditor.styled.js";import{EditorActionTypes as h,WhatsAppTextEditorHeader as f}from"./WhatsAppTextEditorHeader.js";const p="Character limit reached",g=new l,x={[h.BOLD]:"*",[h.ITALIC]:"_",[h.STRIKETHROUGH]:"~"},T=o.forwardRef(((l,o)=>{var h,T,{onChange:j,text:C,RightComponent:E,error:y,limit:
|
|
1
|
+
import{__rest as t}from"../../_virtual/_tslib.js";import{jsxs as n,jsx as e,Fragment as r}from"react/jsx-runtime";import{BaseWhatsappContentLangHelper as l}from"../../helpers/BaseWhatsappContentLang.helper.js";import o,{useRef as i,useImperativeHandle as u,useEffect as c}from"react";import{COLORS as s}from"../../constants/Theme.js";import{BodyCaption as a}from"../TypographyStyle.js";import{OuterContainer as d,Container as v,TextSpace as m}from"./CustomEditor.styled.js";import{EditorActionTypes as h,WhatsAppTextEditorHeader as f}from"./WhatsAppTextEditorHeader.js";const p="Character limit reached",g=new l,x={[h.BOLD]:"*",[h.ITALIC]:"_",[h.STRIKETHROUGH]:"~"},T=o.forwardRef(((l,o)=>{var h,T,{onChange:j,text:C,RightComponent:E,error:y,limit:S,onError:H,rows:L,actions:O}=l,R=t(l,["onChange","text","RightComponent","error","limit","onError","rows","actions"]);const w=i(null);function b(t){const n=null==w?void 0:w.current;null!=n&&(n.selectionStart?(n.focus(),n.selectionEnd=t):n.focus())}function W(t){var n,e;let r=null!==(e=null===(n=w.current)||void 0===n?void 0:n.value)&&void 0!==e?e:"";if(w.current&&t){const n=w.current.selectionStart,e=w.current.selectionEnd,l=t;if(n===e)return A(l);{r=g.wrappWildcard(n,e,l,r);const t=g.getHTML(r);return w.current.value=r,{text:r,html:t}}}return{text:r,html:r}}function A(t){var n,e;let r=null!==(e=null===(n=w.current)||void 0===n?void 0:n.value)&&void 0!==e?e:"";if(w.current&&t){const n=w.current.selectionStart;if(n===w.current.selectionEnd)return M(t,n)}return{text:r,html:r}}function M(t,n){var e,r;let l=null!==(r=null===(e=w.current)||void 0===e?void 0:e.value)&&void 0!==r?r:"";l=l.slice(0,n)+t+l.slice(n);const o=g.getHTML(l);return w.current.value=l,{text:l,html:o}}return u(o,(()=>({addTextOrWrap:W,addText:A,get(){var t,n;return null!==(n=null===(t=w.current)||void 0===t?void 0:t.value)&&void 0!==n?n:""},setCaretPosition:b}))),c((()=>{if(console.log("defaultText",C),console.log("textSpaceRef",w),(null==w?void 0:w.current)&&C){w.current.value=C;const t=g.getHTML(C);null==j||j(C,t)}}),[C]),c((()=>{var t,n;(null===(t=null==w?void 0:w.current)||void 0===t?void 0:t.value)&&S&&((null===(n=null==w?void 0:w.current)||void 0===n?void 0:n.value.length)>S?null==H||H(p):null==H||H(null!=y?y:""))}),[null===(h=null==w?void 0:w.current)||void 0===h?void 0:h.value.length]),n(d,{children:[n(v,Object.assign({isError:!!y},{children:[e(f,{actions:O,ref:w,onActionSelect:function(t){if((null==x?void 0:x[t])&&w.current){const n=w.current.selectionStart;if(n===w.current.selectionEnd){M(null==x?void 0:x[t],n);const{text:e,html:r}=M(null==x?void 0:x[t],n);b(n+1),null==j||j(e,r)}else{const{text:n,html:e}=W(null==x?void 0:x[t]);null==j||j(n,e)}}},RightComponent:E,onEmojiClick:function(t){const{text:n,html:e}=A(t);null==j||j(n,e)}}),e(m,Object.assign({ref:w,onChange:function(t){const n=t.target.value,e=g.getHTML(n);null==j||j(n,e)}},R,{rows:L}))]})),y&&y!==p?e(a,Object.assign({style:{color:s.content.negative}},{children:y})):e(r,{children:S&&(null==w?void 0:w.current)?n(a,Object.assign({style:{color:y===p||(null===(T=null==w?void 0:w.current)||void 0===T?void 0:T.value.length)>S?s.content.negative:s.content.secondary}},{children:[w.current.value.length,"/",S]})):e(r,{})})]})}));T.displayName="WhatsAppTextEditor";export{T as WhatsAppTextEditor};
|
package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js
CHANGED
|
@@ -1 +1,47 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import o from"../../../assets/icons/PlusIcon.js";import{useState as i,useEffect as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import o from"../../../assets/icons/PlusIcon.js";import{useState as i,useEffect as s}from"react";import r from"styled-components";import{AddVariableV2SideModal as n}from"../../add-variableV2/AddVariableV2SideModal.js";import"../../../_virtual/_tslib.js";import"../../add-variableV2/AddVariableV2.styled.js";import{Button as l}from"../../button/Button.js";import{IconButton as a}from"../../icon-button/IconButton.js";import"../../input/Input.js";import"../../tooltips/Tooltip.js";import{COLORS as d}from"../../../constants/Theme.js";import"../../modals/modal.styled.js";import"../../switch/Switch.js";import{TitleMedium as c,BodyCaption as m,TitleRegular as p}from"../../TypographyStyle.js";import{ProductPickerModal as f}from"../../product-picker-v2/modal.js";import{useTemplateModalContext as u}from"../context/templateModalContext.js";import h from"./EditWhatsAppTemplateV2.js";import g from"../../../assets/icons/box.svg.js";import y from"../../../assets/icons/delete.svg.js";import b from"../../../assets/icons/edit.svg.js";const x=r=>{let{template:a,whatsappSpecificPickerMeta:p,showVariableModal:g,variableList:y,variableListForImage:b,discountCode:x,setDiscountCode:v}=r;const{selectedCarouselIndex:I,setTemplate:C,pickerConf:w,isProductCarouselTemplate:O}=u(),[k,T]=i(-1==I?"First Message (Step 1/2)":"Carousel Cards (Step 2/2)"),[P,S]=i(!1),[V,B]=i(!1),[L,F]=i([]);s((()=>{T(-1==I?"First Message (Step 1/2)":"Carousel Cards (Step 2/2)")}),[I]);return e("div",{children:[t(c,Object.assign({style:{marginLeft:10,marginBottom:10}},{children:k})),O&&L.length>0&&null!=I&&I>=0&&e("div",Object.assign({style:{display:"flex",rowGap:16,marginBottom:16,flexDirection:"column"}},{children:[t(j,{editItem:()=>S(!P),cardBody:`${L.length} Products Selected`,deleteItem:()=>{F([])}}),t(l,{disabled:L.length<=1,style:{alignSelf:"flex-end",background:d.surface.subdued},onClick:()=>{S(!0)},buttonText:"Rearrange Products",buttonType:"tertiary"})]})),O&&0===L.length&&null!=I&&I>=0&&e("div",Object.assign({style:{marginTop:16,marginBottom:16,marginLeft:12,marginRight:12,flexDirection:"column",display:"flex",alignItems:"center"}},{children:[t(l,{matchParentWidth:!0,style:{flex:1,display:"flex",width:"100%",marginBottom:12},size:"medium",buttonText:"Add Product(s)",buttonType:"dashBold",LeadingIcon:o,onClick:e=>{S(!0)}}),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(m,Object.assign({style:{color:"#616161",overflow:"unset"}},{children:"OR"})),t("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginLeft:8}})]})),t(l,{matchParentWidth:!0,style:{flex:1,display:"flex",marginTop:12,width:"100%"},size:"medium",buttonText:"Add Product(s) Variable",buttonType:"dashBold",LeadingIcon:o,onClick:e=>{B(!0)}})]})),t(h,{whatsappSpecificPickerMeta:p,template:a,onTemplateChange:e=>{null==C||C(e)},showVariableModal:g,variableList:y,variableListForImage:b,discountCode:x,setDiscountCode:v}),P&&w&&t(f,{zIndex:200,limit:1,storeId:w.storeId,selectedItems:(e=>{if(e.length>0){const t={};for(const o of e){const e=null==o?void 0:o.collectionId,i=o.productId,s=o.variantId;e in t||(t[e]={products:{},name:"",image:"",isSmartCollection:!1}),i in t[e].products||(t[e].products[i]={variants:{},name:(null==o?void 0:o.productName)||"",image:(null==o?void 0:o.productImage)||""}),t[e].products[i].variants[s]={name:(null==o?void 0:o.name)||"",price:"",image:(null==o?void 0:o.image)||"",quantity:o.quantity||0,displayOrder:o.displayOrder}}return t}return{}})(L),collectionFetcher:w.fetchCollections,productFetcher:w.fetchProducts,onAdd:(e,t)=>{const o=[];delete e.isCustom;for(const t of Object.keys(e)){const i=e[t].products;if(void 0!==i&&Object.keys(i).length)for(const e of Object.keys(i)){const s=i[e].variants;if(void 0!==s&&Object.keys(s).length)for(const r of Object.keys(s)){const{name:n,image:l,quantity:a,displayOrder:d}=s[r],c={name:n,image:l,quantity:a,variantId:r,productId:e,displayOrder:d,collectionId:t,productName:i[e].name,productImage:i[e].image};o.push(c)}}}const i=o.sort(((e,t)=>e.displayOrder-t.displayOrder));F(i),S(!1)},searchInCollectionFetcher:w.searchInCollection,searchFetcher:w.searchProducts,visible:P,onClose:()=>{S(!1)}}),V&&t(n,{zIndex:2e3,data:null!=y?y:[],showVariable:V,setShowVariable:B,placeholder:"Add a variable",customTrigger:e=>{}})]})},j=o=>{const{cardBody:i,deleteItem:s,editItem:r}=o;return e(v,Object.assign({width:"100%"},{children:[t("div",Object.assign({style:{width:36,height:36}},{children:t(g,{})})),t("div",Object.assign({className:"card-body"},{children:t(p,{children:i})})),e("div",Object.assign({style:{display:"flex",alignItems:"center"}},{children:[r&&t(a,{style:{display:"flex"},Icon:b,onClick:e=>{r(),e.stopPropagation()}}),t(a,{style:{display:"flex",color:"#919191"},Icon:y,onClick:e=>{s(),e.stopPropagation()}})]}))]}))},v=r.div`
|
|
2
|
+
width: ${e=>e.width};
|
|
3
|
+
padding: 12px;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
column-gap: 14px;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
background: #ffffff;
|
|
10
|
+
|
|
11
|
+
border: 1px solid #e0e0e0;
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
|
|
14
|
+
.card-body {
|
|
15
|
+
width: 256px;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
|
|
20
|
+
&__dynamic {
|
|
21
|
+
font-family: 'Inter';
|
|
22
|
+
font-style: normal;
|
|
23
|
+
font-weight: 400;
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
line-height: 24px;
|
|
26
|
+
color: #731dcf;
|
|
27
|
+
|
|
28
|
+
&__desc {
|
|
29
|
+
font-family: 'Inter';
|
|
30
|
+
font-style: normal;
|
|
31
|
+
font-weight: 400;
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
line-height: 16px;
|
|
34
|
+
color: #616161;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__simple {
|
|
39
|
+
font-family: 'Inter';
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: 400;
|
|
42
|
+
font-size: 16px;
|
|
43
|
+
line-height: 24px;
|
|
44
|
+
color: #000000;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`;export{x as default};
|