@hiver/connector-admin 1.4.0-beta.7 → 1.4.0-beta.9

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/index.es.js CHANGED
@@ -41770,7 +41770,7 @@ const EG = k(bA)`
41770
41770
  }, uG = (A) => {
41771
41771
  if (!A) return;
41772
41772
  const e = C0(), t = l0();
41773
- (Object.keys(e).length === 0 || t !== A) && localStorage.setItem(Yi, JSON.stringify(QG(A)));
41773
+ (Object.keys(e).length === 0 || t != A) && localStorage.setItem(Yi, JSON.stringify(QG(A)));
41774
41774
  }, dG = (A, e) => {
41775
41775
  var i, g, s, C, l, E;
41776
41776
  if (!A || !e) return;
@@ -42182,7 +42182,7 @@ const LG = k(bA)`
42182
42182
  roles: o,
42183
42183
  emailSMs: n,
42184
42184
  fields: i,
42185
- handleClose: () => E(!1),
42185
+ handleClose: () => p(!1),
42186
42186
  id: A.id,
42187
42187
  title: A.title,
42188
42188
  currentConnectorId: e,
package/index.umd.js CHANGED
@@ -2516,7 +2516,7 @@ Take a look at the reducer(s) handling this action type: ${u.type}.
2516
2516
  background-color: #97a3b7;
2517
2517
  }
2518
2518
  }
2519
- `,nG="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cellipse%20cx='7.48148'%20cy='4.94'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='7.48148'%20cy='10.7'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='7.48148'%20cy='16.46'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='4.94'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='10.7'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='16.46'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3c/svg%3e",rG=({field:A,toggleSelected:e,hideNewChip:t})=>{const{availableFeatures:n}=m.useContext(zt),{key:r,label:o,enabled:i,isFieldNew:a}=A,{attributes:s,listeners:C,setNodeRef:l,transform:E,transition:c}=$Y({id:r}),u=m.useRef(null),[Q,B]=m.useState(!1),I=Ii(n)&&a&&!t,d={transform:Ui.Transform.toString(E),transition:c};return m.useEffect(()=>{const h=u.current;h&&B(h.scrollWidth>h.clientWidth||h.scrollHeight>h.clientHeight)},[o]),v.jsxs(eG,{ref:l,style:d,...s,children:[v.jsx("img",{className:"field-drag-handle",...C,src:nG}),v.jsx(na,{checked:i,onChange:()=>e(r),sx:{marginLeft:"-6px"}}),v.jsx(Nn,{title:o,disableHoverListener:!Q,children:v.jsxs(bA,{direction:"row",gap:"5px",alignItems:"center",children:[v.jsx(kA,{ref:u,variant:"body2",maxWidth:"325px",noWrap:!0,children:o}),I?v.jsx(Fi,{label:HE}):null]})})]})},oG=A=>({[A]:{isExtensionNew:[],sidePanel:[],cards:{},fieldVisibility:{cards:{}}}}),t0=()=>{try{return JSON.parse(localStorage.getItem(li)||"{}")}catch{return{}}},n0=()=>{const A=t0();return Object.keys(A)[0]},$4=A=>{var e;return(e=t0())==null?void 0:e[A]},iG=A=>{if(!A)return;const e=t0(),t=n0();(Object.keys(e).length===0||t!==A)&&localStorage.setItem(li,JSON.stringify(oG(A)))},gG=(A,e)=>{var i,a,s,C,l,E;if(!A||!e)return;const t=n0()??"";if(!t)return;const n=t0(),r=n[t],o={...n,[t]:{...r,fieldVisibility:{cards:{...(i=r==null?void 0:r.fieldVisibility)==null?void 0:i.cards,[A]:[...((s=(a=r==null?void 0:r.fieldVisibility)==null?void 0:a.cards)==null?void 0:s[A])||[],...(E=(l=(C=r==null?void 0:r.fieldVisibility)==null?void 0:C.cards)==null?void 0:l[A])!=null&&E.includes(e)?[]:[e]]}}}};localStorage.setItem(li,JSON.stringify(o))},a3=(A,e)=>{var r,o;const t=n0();if(!t||!A||!e)return!1;const n=$4(t);return!!((o=(r=n==null?void 0:n.fieldVisibility)==null?void 0:r.cards[A])!=null&&o.includes(e))},aG=(A,e)=>{var i,a,s;if(!A||!e)return;const t=n0()??"";if(!t)return;const n=t0(),r=n[t],o={...n,[t]:{...r,cards:{...r==null?void 0:r.cards,[A]:[...((i=r==null?void 0:r.cards)==null?void 0:i[A])||[],...(s=(a=r==null?void 0:r.cards)==null?void 0:a[A])!=null&&s.includes(e)?[]:[e]]}}};localStorage.setItem(li,JSON.stringify(o))},sG=(A,e)=>{var r;const t=n0();if(!t||!A||!e)return!1;const n=$4(t);return!!((r=n==null?void 0:n.cards[A])!=null&&r.includes(e))},CG=A=>{var o;if(!A)return;const e=t0(),t=n0();if(!t)return;const n=e[t],r={[t]:{...n,sidePanel:[...(n==null?void 0:n.sidePanel)||[],...(o=n==null?void 0:n.sidePanel)!=null&&o.includes(A)?[]:[A]]}};localStorage.setItem(li,JSON.stringify(r))},lG=({fields:A,setFields:e,cardId:t})=>{const n=TW(DW(n3)),r=Bi(),o=s=>{const{active:C,over:l}=s;(C==null?void 0:C.id)!==(l==null?void 0:l.id)&&e(E=>{const c=E.findIndex(Q=>Q.key===(C==null?void 0:C.id)),u=E.findIndex(Q=>Q.key===(l==null?void 0:l.id));return g3(E,c,u)})},i=a3(t,r),a=s=>{e(C=>C.map(l=>l.key===s?{...l,enabled:!l.enabled}:l))};return v.jsx(tG,{children:v.jsx(FY,{sensors:n,collisionDetection:MW,onDragEnd:o,children:v.jsx(YY,{items:A.map(s=>s.key),strategy:zY,children:A.map(s=>v.jsx(rG,{field:s,toggleSelected:a,hideNewChip:i},s.key))})})})},A6=A=>v.jsx(fS,{...A}),EG=k(XA)`
2519
+ `,nG="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cellipse%20cx='7.48148'%20cy='4.94'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='7.48148'%20cy='10.7'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='7.48148'%20cy='16.46'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='4.94'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='10.7'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='16.46'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3c/svg%3e",rG=({field:A,toggleSelected:e,hideNewChip:t})=>{const{availableFeatures:n}=m.useContext(zt),{key:r,label:o,enabled:i,isFieldNew:a}=A,{attributes:s,listeners:C,setNodeRef:l,transform:E,transition:c}=$Y({id:r}),u=m.useRef(null),[Q,B]=m.useState(!1),I=Ii(n)&&a&&!t,d={transform:Ui.Transform.toString(E),transition:c};return m.useEffect(()=>{const h=u.current;h&&B(h.scrollWidth>h.clientWidth||h.scrollHeight>h.clientHeight)},[o]),v.jsxs(eG,{ref:l,style:d,...s,children:[v.jsx("img",{className:"field-drag-handle",...C,src:nG}),v.jsx(na,{checked:i,onChange:()=>e(r),sx:{marginLeft:"-6px"}}),v.jsx(Nn,{title:o,disableHoverListener:!Q,children:v.jsxs(bA,{direction:"row",gap:"5px",alignItems:"center",children:[v.jsx(kA,{ref:u,variant:"body2",maxWidth:"325px",noWrap:!0,children:o}),I?v.jsx(Fi,{label:HE}):null]})})]})},oG=A=>({[A]:{isExtensionNew:[],sidePanel:[],cards:{},fieldVisibility:{cards:{}}}}),t0=()=>{try{return JSON.parse(localStorage.getItem(li)||"{}")}catch{return{}}},n0=()=>{const A=t0();return Object.keys(A)[0]},$4=A=>{var e;return(e=t0())==null?void 0:e[A]},iG=A=>{if(!A)return;const e=t0(),t=n0();(Object.keys(e).length===0||t!=A)&&localStorage.setItem(li,JSON.stringify(oG(A)))},gG=(A,e)=>{var i,a,s,C,l,E;if(!A||!e)return;const t=n0()??"";if(!t)return;const n=t0(),r=n[t],o={...n,[t]:{...r,fieldVisibility:{cards:{...(i=r==null?void 0:r.fieldVisibility)==null?void 0:i.cards,[A]:[...((s=(a=r==null?void 0:r.fieldVisibility)==null?void 0:a.cards)==null?void 0:s[A])||[],...(E=(l=(C=r==null?void 0:r.fieldVisibility)==null?void 0:C.cards)==null?void 0:l[A])!=null&&E.includes(e)?[]:[e]]}}}};localStorage.setItem(li,JSON.stringify(o))},a3=(A,e)=>{var r,o;const t=n0();if(!t||!A||!e)return!1;const n=$4(t);return!!((o=(r=n==null?void 0:n.fieldVisibility)==null?void 0:r.cards[A])!=null&&o.includes(e))},aG=(A,e)=>{var i,a,s;if(!A||!e)return;const t=n0()??"";if(!t)return;const n=t0(),r=n[t],o={...n,[t]:{...r,cards:{...r==null?void 0:r.cards,[A]:[...((i=r==null?void 0:r.cards)==null?void 0:i[A])||[],...(s=(a=r==null?void 0:r.cards)==null?void 0:a[A])!=null&&s.includes(e)?[]:[e]]}}};localStorage.setItem(li,JSON.stringify(o))},sG=(A,e)=>{var r;const t=n0();if(!t||!A||!e)return!1;const n=$4(t);return!!((r=n==null?void 0:n.cards[A])!=null&&r.includes(e))},CG=A=>{var o;if(!A)return;const e=t0(),t=n0();if(!t)return;const n=e[t],r={[t]:{...n,sidePanel:[...(n==null?void 0:n.sidePanel)||[],...(o=n==null?void 0:n.sidePanel)!=null&&o.includes(A)?[]:[A]]}};localStorage.setItem(li,JSON.stringify(r))},lG=({fields:A,setFields:e,cardId:t})=>{const n=TW(DW(n3)),r=Bi(),o=s=>{const{active:C,over:l}=s;(C==null?void 0:C.id)!==(l==null?void 0:l.id)&&e(E=>{const c=E.findIndex(Q=>Q.key===(C==null?void 0:C.id)),u=E.findIndex(Q=>Q.key===(l==null?void 0:l.id));return g3(E,c,u)})},i=a3(t,r),a=s=>{e(C=>C.map(l=>l.key===s?{...l,enabled:!l.enabled}:l))};return v.jsx(tG,{children:v.jsx(FY,{sensors:n,collisionDetection:MW,onDragEnd:o,children:v.jsx(YY,{items:A.map(s=>s.key),strategy:zY,children:A.map(s=>v.jsx(rG,{field:s,toggleSelected:a,hideNewChip:i},s.key))})})})},A6=A=>v.jsx(fS,{...A}),EG=k(XA)`
2520
2520
  .request-new-connector-img {
2521
2521
  width: 500px;
2522
2522
  height: 500px;
@@ -2616,7 +2616,7 @@ Take a look at the reducer(s) handling this action type: ${u.type}.
2616
2616
  opacity: 0.5;
2617
2617
  background-color: transparent;
2618
2618
  }
2619
- `,bG=({infoCard:A,currentConnectorId:e,setShowEnabledModal:t})=>{var x,w;const n=((x=A.inboxes)==null?void 0:x.email)||[],r=((w=A.inboxes)==null?void 0:w.chat)||[],o=A.roles??[],i=A.fields??[],{isCardNew:a}=A,s=n.length+r.length,C=s>0&&o.length>0,[l,E]=m.useState(!1),{availableFeatures:c,userPermissions:u,sendTrackingEvent:Q}=m.useContext(zt),B=dk(u),I=Bi(),[d,h]=m.useState(!1),p=T=>{E(T),!T&&d&&gG(A.id,I)},b=()=>{E(!0),Q(gt.CONFIGURE_VISIBILITY_CLICKED)},f=Ii(c)&&a&&!sG(A.id,I),y=Ii(c)&&i.some(T=>T.isFieldNew)&&!a3(A.id,I);return v.jsxs(v.Fragment,{children:[v.jsxs(pG,{children:[v.jsxs(bA,{gap:"18px",direction:"row",children:[A.title,v.jsxs(bA,{gap:"5px",direction:"row",children:[v.jsx(Fi,{hidden:!f,label:HE}),v.jsx(Fi,{hidden:!y,label:e6})]})]}),v.jsxs(hG,{children:[v.jsx(kA,{className:"hover__text",variant:"caption",children:C?`Visible across ${s} Shared mailbox${s>1?"es":""}`:VX}),v.jsx(lW,{children:v.jsx(mG,{})}),v.jsx(Nn,{title:B?a4:XX,placement:"bottom",children:v.jsx(vG,{className:"visibilityIcon",onClick:b,disabled:!B,children:C?v.jsx(EW,{}):v.jsx(IW,{})})})]})]}),v.jsx(XE,{shown:l,setShown:p,customPaperProps:{overflow:"inherit"},children:v.jsx(fG,{roles:o,emailSMs:n,fields:i,handleClose:()=>E(!1),id:A.id,title:A.title,currentConnectorId:e,setShowEnabledModal:t,setVisitedFieldVisTab:h})})]})},yG=({infoCards:A,currentConnectorId:e,setShowEnabledModal:t})=>v.jsx("div",{children:A.map(n=>v.jsx(bG,{setShowEnabledModal:t,currentConnectorId:e,infoCard:n},n.id))}),wG=k(kA)`
2619
+ `,bG=({infoCard:A,currentConnectorId:e,setShowEnabledModal:t})=>{var x,w;const n=((x=A.inboxes)==null?void 0:x.email)||[],r=((w=A.inboxes)==null?void 0:w.chat)||[],o=A.roles??[],i=A.fields??[],{isCardNew:a}=A,s=n.length+r.length,C=s>0&&o.length>0,[l,E]=m.useState(!1),{availableFeatures:c,userPermissions:u,sendTrackingEvent:Q}=m.useContext(zt),B=dk(u),I=Bi(),[d,h]=m.useState(!1),p=T=>{E(T),!T&&d&&gG(A.id,I)},b=()=>{E(!0),Q(gt.CONFIGURE_VISIBILITY_CLICKED)},f=Ii(c)&&a&&!sG(A.id,I),y=Ii(c)&&i.some(T=>T.isFieldNew)&&!a3(A.id,I);return v.jsxs(v.Fragment,{children:[v.jsxs(pG,{children:[v.jsxs(bA,{gap:"18px",direction:"row",children:[A.title,v.jsxs(bA,{gap:"5px",direction:"row",children:[v.jsx(Fi,{hidden:!f,label:HE}),v.jsx(Fi,{hidden:!y,label:e6})]})]}),v.jsxs(hG,{children:[v.jsx(kA,{className:"hover__text",variant:"caption",children:C?`Visible across ${s} Shared mailbox${s>1?"es":""}`:VX}),v.jsx(lW,{children:v.jsx(mG,{})}),v.jsx(Nn,{title:B?a4:XX,placement:"bottom",children:v.jsx(vG,{className:"visibilityIcon",onClick:b,disabled:!B,children:C?v.jsx(EW,{}):v.jsx(IW,{})})})]})]}),v.jsx(XE,{shown:l,setShown:p,customPaperProps:{overflow:"inherit"},children:v.jsx(fG,{roles:o,emailSMs:n,fields:i,handleClose:()=>p(!1),id:A.id,title:A.title,currentConnectorId:e,setShowEnabledModal:t,setVisitedFieldVisTab:h})})]})},yG=({infoCards:A,currentConnectorId:e,setShowEnabledModal:t})=>v.jsx("div",{children:A.map(n=>v.jsx(bG,{setShowEnabledModal:t,currentConnectorId:e,infoCard:n},n.id))}),wG=k(kA)`
2620
2620
  text-align: left;
2621
2621
  ul {
2622
2622
  margin: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiver/connector-admin",
3
- "version": "1.4.0-beta.7",
3
+ "version": "1.4.0-beta.9",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts",