@hiver/connector-admin 1.2.3-beta.1 → 1.2.3-beta.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/auto-complete/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAKnD,UAAU,mBAAmB;IAC3B,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IACtG,sBAAsB,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,kBAAkB,6GAS5B,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/auto-complete/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAKnD,UAAU,mBAAmB;IAC3B,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IACtG,sBAAsB,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,kBAAkB,6GAS5B,mBAAmB,4CA4ErB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-library/components/visibility-modal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA6D,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-library/components/visibility-modal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA6D,MAAM,OAAO,CAAC;AA4CtF,OAAO,KAAK,EAAoB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,gBAAgB,CAkKhD,CAAC"}
|
package/index.es.js
CHANGED
|
@@ -41828,6 +41828,7 @@ const GY = k(TA)`
|
|
|
41828
41828
|
}
|
|
41829
41829
|
) }, E[r])),
|
|
41830
41830
|
renderInput: (C) => /* @__PURE__ */ b.jsx(hl, { ...C, variant: "standard", placeholder: s ? t : "" }),
|
|
41831
|
+
getOptionLabel: (C) => C[n],
|
|
41831
41832
|
ListboxProps: { style: { maxHeight: 250 } },
|
|
41832
41833
|
onChange: o
|
|
41833
41834
|
}
|
package/index.umd.js
CHANGED
|
@@ -2553,7 +2553,7 @@ Take a look at the reducer(s) handling this action type: ${u.type}.
|
|
|
2553
2553
|
color: ${pA.gray.gray3};
|
|
2554
2554
|
margin-top: 0.5px;
|
|
2555
2555
|
}
|
|
2556
|
-
`,WY=({options:A=[],type:e,placeholder:t,labelKey:n="label",valueKey:r="id",onChangeFunc:o,currentSelectedOptions:i=[],isSingleSelect:a=!1})=>{const s=!i.length;return y.jsx(XY,{children:a?y.jsx(Yg,{value:Object.keys(i[0]).length?i[0]:null,getOptionLabel:C=>C[n]??"",onChange:o,options:A,renderOption:(C,l)=>y.jsx(WA,{component:"li",...C,minHeight:"34px !important",children:l[n]}),renderInput:C=>y.jsx(A3,{...C,ref:C.inputProps.ref,placeholder:t})}):y.jsx(Yg,{value:i,slotProps:{popper:{modifiers:[{name:"flip",options:{rootBoundary:"document"}}]}},"data-testid":`${e}-dropdown`,disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:A,isOptionEqualToValue:(C,l)=>(l==null?void 0:l[r])===""?!0:C[r]===l[r],renderOption:(C,l,{selected:E})=>{const{key:c,...u}=C;return y.jsxs(WA,{component:"li",...u,minHeight:"36px",children:[y.jsx(Zg,{style:{marginRight:8},checked:E}),l[n]]},c)},renderTags:(C,l)=>C.map((E,c)=>y.jsx("div",{children:y.jsx(zY,{...l({index:c}),label:E[n],variant:"outlined",deleteIcon:y.jsx(xl.Close,{})})},E[r])),renderInput:C=>y.jsx(A3,{...C,variant:"standard",placeholder:s?t:""}),ListboxProps:{style:{maxHeight:250}},onChange:o})})},YY="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3803_129233)'%3e%3cpath%20d='M7.3335%204.66683H8.66683V6.00016H7.3335V4.66683ZM7.3335%207.3335H8.66683V11.3335H7.3335V7.3335ZM8.00016%201.3335C4.32016%201.3335%201.3335%204.32016%201.3335%208.00016C1.3335%2011.6802%204.32016%2014.6668%208.00016%2014.6668C11.6802%2014.6668%2014.6668%2011.6802%2014.6668%208.00016C14.6668%204.32016%2011.6802%201.3335%208.00016%201.3335ZM8.00016%2013.3335C5.06016%2013.3335%202.66683%2010.9402%202.66683%208.00016C2.66683%205.06016%205.06016%202.66683%208.00016%202.66683C10.9402%202.66683%2013.3335%205.06016%2013.3335%208.00016C13.3335%2010.9402%2010.9402%2013.3335%208.00016%2013.3335Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3803_129233'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",GY=A=>{const{selectedEmailInboxes:e,setSelectedEmailInboxes:t,selectedRoles:n,setSelectedRoles:r}=A,o=he(r4)??[],i=he(n4)??[];return[{type:a4,options:i,label:cz,isSingleSelect:!1},{type:dz,options:o,label:Qz,isSingleSelect:!0}].map(({type:s,options:C,label:l,isSingleSelect:E})=>{const c=s===a4,u=c?e:n;return y.jsxs(WA,{marginBottom:"20px",children:[y.jsx(Vz,{variant:"h4",children:l}),y.jsx(WY,{isSingleSelect:E,currentSelectedOptions:E?[u]:u,options:C,type:s,placeholder:c?Bz:uz,onChangeFunc:(Q,B)=>c?t(B):r(B??{}),valueKey:"id",labelKey:"name"}),E?y.jsxs(Zz,{width:"fit-content",children:[y.jsx("img",{src:YY}),y.jsx(qA,{variant:"caption",color:pA.gray.gray3,fontSize:"11px",children:wz})]}):null]},s)})},$2={CARD_VISIBILITY:{ID:0,LABEL:"Card visibility"},FIELD_VISIBILITY:{ID:1,LABEL:"Field visibility"}},ZY=({handleClose:A,id:e,emailSMs:t,setShowEnabledModal:n,roles:r,currentConnectorId:o,title:i,fields:a})=>{const{sendTrackingEvent:s}=m.useContext(Gt),C=pr(),l=he(bs),E=he(r4)??[],c=he(n4)??[],u=he(UX),[Q,B]=m.useState(()=>(c==null?void 0:c.filter(M=>t==null?void 0:t.includes(M.id)))??[]),[I,d]=m.useState(()=>(E==null?void 0:E.find(M=>r==null?void 0:r.includes(M.name)))??{}),[h,p]=m.useState(()=>{var M,V,X;return((X=(V=(M=l==null?void 0:l[o])==null?void 0:M.cardList)==null?void 0:V.find(q=>q.id===e))==null?void 0:X.fields)??[]}),[v,f]=m.useState($2.CARD_VISIBILITY.ID),b=m.useMemo(()=>!Array.isArray(t)||t.length!==Q.length?!1:t.every(M=>Q.some(({id:V})=>V===M)),[t,Q]),x=m.useMemo(()=>Array.isArray(r)?r.length?!!(r!=null&&r.every(M=>I.name===M)):!Object.keys(I).length:!1,[r,I]),w=m.useMemo(()=>{if(!Array.isArray(a))return!1;for(let M=0;M<a.length;M++){const V=a[M],X=h[M];if(V.key!==X.key||V.enabled!==X.enabled)return!1}return!0},[a,h]),T=Q.length!==0&&h.filter(M=>M.enabled).length===0,O=u===FA.LOADING||b&&x&&w||T,F=M=>{M.stopPropagation();const V=I!=null&&I.name?[I.name]:[],X=Q.map(Y=>Y.id),q=h.map((Y,_)=>({...Y,priority:_+1}));C(ns({cardId:e,data:{roles:V,inboxes:{email:X,chat:[]},fields:q},currentConnector:o})).unwrap().then(()=>{var R,tA,eA;const Y=(R=l==null?void 0:l[o])==null?void 0:R.name,_=(eA=(tA=l==null?void 0:l[o])==null?void 0:tA.cardList)==null?void 0:eA.some(oA=>{var gA;if(oA.id===e)return!1;const{email:$,chat:sA}=oA.inboxes,nA=!!((($==null?void 0:$.length)??0)+((sA==null?void 0:sA.length)??0)),BA=!!((gA=oA==null?void 0:oA.roles)!=null&&gA.length);return nA&&BA});s(gt.CARD_VISIBILITY_UPDATED,{new_status:X.length&&(I!=null&&I.name)?C4:l4,pre_status:t!=null&&t.length&&(E!=null&&E.length)?C4:l4,connector_name:Y,card_title:i}),!_&&(I!=null&&I.name)&&X.length?n(!0):Y&&hr({message:bz.replace(vz,Y),type:ys})}).catch(()=>{hr({message:yz,type:$o})}).finally(()=>A())},S=()=>{A(),s(gt.CARD_VISIBILITY_UPDATE_CLOSED)},U=(M,V)=>{f(V),V===$2.FIELD_VISIBILITY.ID&&s(gt.CONNECTOR_VISIBILITY_FIELD_TAB_CLICKED)};return y.jsx(Hz,{children:y.jsxs(Wz,{children:[y.jsx(jz,{variant:"h2",children:g4}),y.jsx(WA,{marginBottom:"24px",children:y.jsxs(RQ,{value:v,onChange:U,children:[y.jsx(E4,{label:$2.CARD_VISIBILITY.LABEL}),y.jsx(E4,{label:$2.FIELD_VISIBILITY.LABEL})]})}),y.jsx("div",{hidden:v!==$2.CARD_VISIBILITY.ID,children:y.jsx(GY,{selectedEmailInboxes:Q,setSelectedEmailInboxes:B,selectedRoles:I,setSelectedRoles:d})}),y.jsx("div",{hidden:v!==$2.FIELD_VISIBILITY.ID,children:y.jsx(HY,{fields:h,setFields:p})}),y.jsxs(Xz,{children:[y.jsx(Gz,{onClick:S,variant:"text",children:fz}),y.jsx(Wn,{title:T?Dz:null,children:y.jsx("div",{children:y.jsx(Yz,{onClick:F,disabled:O,children:u!==FA.LOADING?y.jsx(qA,{variant:"body2_medium",children:xz}):y.jsx(H0,{height:"22px",children:y.jsx(zz,{size:22})})})})})]})]})})},qY=k(WA)`
|
|
2556
|
+
`,WY=({options:A=[],type:e,placeholder:t,labelKey:n="label",valueKey:r="id",onChangeFunc:o,currentSelectedOptions:i=[],isSingleSelect:a=!1})=>{const s=!i.length;return y.jsx(XY,{children:a?y.jsx(Yg,{value:Object.keys(i[0]).length?i[0]:null,getOptionLabel:C=>C[n]??"",onChange:o,options:A,renderOption:(C,l)=>y.jsx(WA,{component:"li",...C,minHeight:"34px !important",children:l[n]}),renderInput:C=>y.jsx(A3,{...C,ref:C.inputProps.ref,placeholder:t})}):y.jsx(Yg,{value:i,slotProps:{popper:{modifiers:[{name:"flip",options:{rootBoundary:"document"}}]}},"data-testid":`${e}-dropdown`,disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:A,isOptionEqualToValue:(C,l)=>(l==null?void 0:l[r])===""?!0:C[r]===l[r],renderOption:(C,l,{selected:E})=>{const{key:c,...u}=C;return y.jsxs(WA,{component:"li",...u,minHeight:"36px",children:[y.jsx(Zg,{style:{marginRight:8},checked:E}),l[n]]},c)},renderTags:(C,l)=>C.map((E,c)=>y.jsx("div",{children:y.jsx(zY,{...l({index:c}),label:E[n],variant:"outlined",deleteIcon:y.jsx(xl.Close,{})})},E[r])),renderInput:C=>y.jsx(A3,{...C,variant:"standard",placeholder:s?t:""}),getOptionLabel:C=>C[n],ListboxProps:{style:{maxHeight:250}},onChange:o})})},YY="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3803_129233)'%3e%3cpath%20d='M7.3335%204.66683H8.66683V6.00016H7.3335V4.66683ZM7.3335%207.3335H8.66683V11.3335H7.3335V7.3335ZM8.00016%201.3335C4.32016%201.3335%201.3335%204.32016%201.3335%208.00016C1.3335%2011.6802%204.32016%2014.6668%208.00016%2014.6668C11.6802%2014.6668%2014.6668%2011.6802%2014.6668%208.00016C14.6668%204.32016%2011.6802%201.3335%208.00016%201.3335ZM8.00016%2013.3335C5.06016%2013.3335%202.66683%2010.9402%202.66683%208.00016C2.66683%205.06016%205.06016%202.66683%208.00016%202.66683C10.9402%202.66683%2013.3335%205.06016%2013.3335%208.00016C13.3335%2010.9402%2010.9402%2013.3335%208.00016%2013.3335Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3803_129233'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",GY=A=>{const{selectedEmailInboxes:e,setSelectedEmailInboxes:t,selectedRoles:n,setSelectedRoles:r}=A,o=he(r4)??[],i=he(n4)??[];return[{type:a4,options:i,label:cz,isSingleSelect:!1},{type:dz,options:o,label:Qz,isSingleSelect:!0}].map(({type:s,options:C,label:l,isSingleSelect:E})=>{const c=s===a4,u=c?e:n;return y.jsxs(WA,{marginBottom:"20px",children:[y.jsx(Vz,{variant:"h4",children:l}),y.jsx(WY,{isSingleSelect:E,currentSelectedOptions:E?[u]:u,options:C,type:s,placeholder:c?Bz:uz,onChangeFunc:(Q,B)=>c?t(B):r(B??{}),valueKey:"id",labelKey:"name"}),E?y.jsxs(Zz,{width:"fit-content",children:[y.jsx("img",{src:YY}),y.jsx(qA,{variant:"caption",color:pA.gray.gray3,fontSize:"11px",children:wz})]}):null]},s)})},$2={CARD_VISIBILITY:{ID:0,LABEL:"Card visibility"},FIELD_VISIBILITY:{ID:1,LABEL:"Field visibility"}},ZY=({handleClose:A,id:e,emailSMs:t,setShowEnabledModal:n,roles:r,currentConnectorId:o,title:i,fields:a})=>{const{sendTrackingEvent:s}=m.useContext(Gt),C=pr(),l=he(bs),E=he(r4)??[],c=he(n4)??[],u=he(UX),[Q,B]=m.useState(()=>(c==null?void 0:c.filter(M=>t==null?void 0:t.includes(M.id)))??[]),[I,d]=m.useState(()=>(E==null?void 0:E.find(M=>r==null?void 0:r.includes(M.name)))??{}),[h,p]=m.useState(()=>{var M,V,X;return((X=(V=(M=l==null?void 0:l[o])==null?void 0:M.cardList)==null?void 0:V.find(q=>q.id===e))==null?void 0:X.fields)??[]}),[v,f]=m.useState($2.CARD_VISIBILITY.ID),b=m.useMemo(()=>!Array.isArray(t)||t.length!==Q.length?!1:t.every(M=>Q.some(({id:V})=>V===M)),[t,Q]),x=m.useMemo(()=>Array.isArray(r)?r.length?!!(r!=null&&r.every(M=>I.name===M)):!Object.keys(I).length:!1,[r,I]),w=m.useMemo(()=>{if(!Array.isArray(a))return!1;for(let M=0;M<a.length;M++){const V=a[M],X=h[M];if(V.key!==X.key||V.enabled!==X.enabled)return!1}return!0},[a,h]),T=Q.length!==0&&h.filter(M=>M.enabled).length===0,O=u===FA.LOADING||b&&x&&w||T,F=M=>{M.stopPropagation();const V=I!=null&&I.name?[I.name]:[],X=Q.map(Y=>Y.id),q=h.map((Y,_)=>({...Y,priority:_+1}));C(ns({cardId:e,data:{roles:V,inboxes:{email:X,chat:[]},fields:q},currentConnector:o})).unwrap().then(()=>{var R,tA,eA;const Y=(R=l==null?void 0:l[o])==null?void 0:R.name,_=(eA=(tA=l==null?void 0:l[o])==null?void 0:tA.cardList)==null?void 0:eA.some(oA=>{var gA;if(oA.id===e)return!1;const{email:$,chat:sA}=oA.inboxes,nA=!!((($==null?void 0:$.length)??0)+((sA==null?void 0:sA.length)??0)),BA=!!((gA=oA==null?void 0:oA.roles)!=null&&gA.length);return nA&&BA});s(gt.CARD_VISIBILITY_UPDATED,{new_status:X.length&&(I!=null&&I.name)?C4:l4,pre_status:t!=null&&t.length&&(E!=null&&E.length)?C4:l4,connector_name:Y,card_title:i}),!_&&(I!=null&&I.name)&&X.length?n(!0):Y&&hr({message:bz.replace(vz,Y),type:ys})}).catch(()=>{hr({message:yz,type:$o})}).finally(()=>A())},S=()=>{A(),s(gt.CARD_VISIBILITY_UPDATE_CLOSED)},U=(M,V)=>{f(V),V===$2.FIELD_VISIBILITY.ID&&s(gt.CONNECTOR_VISIBILITY_FIELD_TAB_CLICKED)};return y.jsx(Hz,{children:y.jsxs(Wz,{children:[y.jsx(jz,{variant:"h2",children:g4}),y.jsx(WA,{marginBottom:"24px",children:y.jsxs(RQ,{value:v,onChange:U,children:[y.jsx(E4,{label:$2.CARD_VISIBILITY.LABEL}),y.jsx(E4,{label:$2.FIELD_VISIBILITY.LABEL})]})}),y.jsx("div",{hidden:v!==$2.CARD_VISIBILITY.ID,children:y.jsx(GY,{selectedEmailInboxes:Q,setSelectedEmailInboxes:B,selectedRoles:I,setSelectedRoles:d})}),y.jsx("div",{hidden:v!==$2.FIELD_VISIBILITY.ID,children:y.jsx(HY,{fields:h,setFields:p})}),y.jsxs(Xz,{children:[y.jsx(Gz,{onClick:S,variant:"text",children:fz}),y.jsx(Wn,{title:T?Dz:null,children:y.jsx("div",{children:y.jsx(Yz,{onClick:F,disabled:O,children:u!==FA.LOADING?y.jsx(qA,{variant:"body2_medium",children:xz}):y.jsx(H0,{height:"22px",children:y.jsx(zz,{size:22})})})})})]})]})})},qY=k(WA)`
|
|
2557
2557
|
height: 52px;
|
|
2558
2558
|
box-sizing: border-box;
|
|
2559
2559
|
width: 100%;
|