@hiver/connector-agent 2.0.5-emailSelect-beta.1 → 2.0.5-emailSelect-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":"email-selection.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/email-selection.tsx"],"names":[],"mappings":"AASA,UAAU,MAAM;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AA8ED,eAAO,MAAM,cAAc,wCAAyC,MAAM,4CA+BzE,CAAC"}
1
+ {"version":3,"file":"email-selection.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/email-selection.tsx"],"names":[],"mappings":"AASA,UAAU,MAAM;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AA8ED,eAAO,MAAM,cAAc,wCAAyC,MAAM,4CAiCzE,CAAC"}
package/index.es.js CHANGED
@@ -41035,7 +41035,9 @@ const Ac = (e) => {
41035
41035
  onChange: (r) => t(String((r == null ? void 0 : r.value) || "")),
41036
41036
  components: { MenuList: NX, Option: UX, SingleValue: LX },
41037
41037
  styles: jX,
41038
- isSearchable: !1
41038
+ isSearchable: !1,
41039
+ closeMenuOnSelect: !1,
41040
+ menuIsOpen: !0
41039
41041
  }
41040
41042
  );
41041
41043
  }, HX = V(ur)`
package/index.umd.js CHANGED
@@ -2688,7 +2688,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2688
2688
  width: 40px;
2689
2689
  height: 40px;
2690
2690
  }
2691
- `,BX=e=>T.createElement("svg",{width:35,height:35,viewBox:"0 0 35 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},T.createElement("rect",{x:9,y:9,width:15,height:17,fill:"white"}),T.createElement("g",{clipPath:"url(#clip0_7787_114457)"},T.createElement("path",{d:"M17.1981 2.86633C9.28704 2.86633 2.86646 9.28691 2.86646 17.198C2.86646 25.1091 9.28704 31.5296 17.1981 31.5296C25.1092 31.5296 31.5298 25.1091 31.5298 17.198C31.5298 9.28691 25.1092 2.86633 17.1981 2.86633ZM14.3318 23.6472V10.7487L22.9308 17.198L14.3318 23.6472Z",fill:"#4D596C"})),T.createElement("defs",null,T.createElement("clipPath",{id:"clip0_7787_114457"},T.createElement("rect",{width:34.396,height:34.396,fill:"white"})))),mX=({aspectRatio:e="auto",...t})=>{const[n,o]=b.useState(!1);return n?null:y.jsxs(hX,{aspectRatio:e,children:[y.jsx("img",{className:"preview-img",onError:()=>o(!0),...t}),y.jsx(BX,{className:"play-icon"})]})},QX={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_HIVER_CDN_URL:"https://cdn.hiverhq.com/",VITE_MY_ENV_VAR:"myVariable From Agent"},{VITE_HIVER_CDN_URL:vX}=QX,IQ=({isAdmin:e=!0,hideHeading:t=!1})=>{const{sendTrackingEvent:n,availableFeatures:o,connectorFunctions:r}=b.useContext(eo),i=br(o,QN),a=c=>{c.stopPropagation(),n(zN),r==null||r.redirectToAdmin()},A=c=>{c.stopPropagation(),n(YN),window.open(XW,"_blank")},l=()=>{n(CU,{source:"main_tab"})};return y.jsxs("div",{"data-testid":"noConnectors",children:[i?y.jsxs(y.Fragment,{children:[t?null:y.jsx(He,{variant:"h2",children:qW}),y.jsx(tz,{onClick:l,href:_W,target:"_blank",children:y.jsx(mX,{src:vX+ZW,alt:JW,aspectRatio:"1000/783"})})]}):y.jsxs($W,{children:[y.jsx(ez,{variant:"body1_medium",children:HW}),y.jsx("img",{src:sz,alt:WW})]}),y.jsx(nz,{variant:"body2",children:zW}),e?y.jsx(dm,{endIcon:y.jsx(Oo.ArrowForward,{}),onClick:a,...i&&{size:"medium"},children:YW}):y.jsxs(y.Fragment,{children:[y.jsx(dm,{onClick:A,children:GW}),y.jsxs(oz,{direction:"row",children:[y.jsx(rz,{}),y.jsx(iz,{variant:"caption",children:KW})]})]})]})},yX=()=>y.jsxs(oB,{children:[y.jsxs(Ne,{direction:"row",marginBottom:"12px",height:"36px",alignItems:"center",children:[y.jsx(tB,{}),y.jsx(nB,{variant:"h2",children:"Connectors"})]}),y.jsxs(Ne,{gap:"12px",children:[y.jsx(ui,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),y.jsx(ui,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),y.jsx(ui,{variant:"rounded",width:"100%",height:"46px",animation:"wave"})]})]}),bX=()=>{const{metaData:e,sendTrackingEvent:t,isAdmin:n,connectorFunctions:o}=b.useContext(eo),[r,i]=b.useState(!1),a=b.useRef(null),[A,l]=b.useState(0),{templateUpdates:c}=e||{},{sections:u=[],actionButtons:p=[],title:g}=c||{},{version:B=""}=c||{},C=WN(B),f=b.useMemo(()=>HN(B),[B]),d=b.useMemo(()=>(p==null?void 0:p.filter(({isAdminPanelLink:m})=>!(!n&&m)))??[],[p,n]);if(b.useEffect(()=>{!f&&c&&uf(B,!0)},[f,B,c]),b.useLayoutEffect(()=>{var m;(m=a.current)!=null&&m.scrollHeight&&l(a.current.scrollHeight)},[a]),b.useEffect(()=>{c&&!C&&t(ZN,{update_version_id:B})},[]),!c||C)return null;const E=m=>{var I;m.stopPropagation(),i(v=>!v),(I=a.current)!=null&&I.scrollHeight&&l(a.current.scrollHeight),uf(B,!1,!0)},Q=(m,I="",v=!1,w=!1)=>{var x;if(m.stopPropagation(),v&&w?t(JN,{update_version_id:B}):w&&t(qN,{update_version_id:B}),!v&&I){(x=window.open(I,"_blank"))==null||x.focus();return}h(m,!1),o==null||o.redirectToAdmin()},h=(m,I=!0)=>{m.stopPropagation(),uf(B,!1),i(!1),I&&t($N,{update_version_id:B})};return y.jsxs(fj,{children:[y.jsxs(pj,{children:[y.jsx(gj,{variant:"h3",children:g}),y.jsxs(Et,{children:[r?y.jsx(Rt,{title:ON,placement:"bottom",children:y.jsx(nn,{onClick:h,children:y.jsx(Oo.Close,{sx:{height:"16px",width:"16px",opacity:"0.8"}})})}):null,y.jsx(Rt,{title:r?FN:Af,placement:"bottom",children:y.jsx(di,{onClick:E,children:y.jsx(Ef,{className:r?"":"hiver-up"})})})]})]}),y.jsx(Cj,{className:r?"slideDown":"slideUp",ref:a,height:A,children:y.jsxs(Ej,{children:[u.map(({title:m,items:I,type:v})=>y.jsxs(Qj,{children:[y.jsx(He,{variant:"body2_medium",children:m}),I.map(w=>{const x=v===NN,{deeplink:S,textHtml:O,imageUrl:k}=w,P=()=>y.jsx(oj,{className:x?"":"ellipsisClass",component:"div",variant:"body2",dangerouslySetInnerHTML:{__html:O}});return y.jsx(Ij,{component:"ul",children:y.jsxs(hj,{component:x?"li":"div",marginLeft:k?"0":"14px",children:[k?y.jsx("img",{src:k}):null,S?y.jsx(sB,{target:"_blank",underline:"none",onClick:D=>Q(D,S),fontSize:"13px",children:P()}):P()]})},O)})]},m)),y.jsx(Ne,{flexDirection:"row",gap:"8px",marginBottom:"11.5px",children:d.map(({text:m,link:I,isAdminPanelLink:v})=>y.jsx(Bj,{variant:v?"contained":"text",children:y.jsx(mj,{variant:"caption",onClick:w=>Q(w,I,v,!0),children:m})},m))})]})})]})},hQ=e=>{const t=b.useRef(null),[n,o]=b.useState(!1);return b.useEffect(()=>{t.current&&o(t.current.scrollWidth>t.current.clientWidth)},[e]),{textRef:t,isOverflow:n}},wX=e=>{const{textRef:t,isOverflow:n}=hQ(e.data.label);return y.jsx(Rt,{title:n?e.data.label:null,placement:"bottom",children:y.jsx(vj,{ref:t,variant:"body2",children:e.data.label})})},xX=e=>y.jsxs(Bi.MenuList,{...e,children:[y.jsx(yj,{children:y.jsx(He,{variant:"body2_medium",children:Oj})}),e.children]}),TX=e=>{const{isSelected:t}=e,{textRef:n,isOverflow:o}=hQ(e.data.label);return y.jsx(Bi.Option,{...e,children:y.jsxs(Ne,{direction:"row",gap:"8px",justifyContent:"space-between",children:[y.jsx(Rt,{title:o?e.data.label:null,placement:"bottom",children:y.jsx(wj,{ref:n,className:"dropdown-item-text",variant:"body2",children:e.data.label})}),t&&y.jsx(bj,{})]})})},SX={control:e=>({...e,border:"none",boxShadow:"none",height:"20px","&:hover":{border:"none"},"& > :first-child":{display:"flex !important",alignItems:"center",flexGrow:1}}),option:(e,t)=>({...e,backgroundColor:Fe.palette.gray.white,color:Fe.palette.gray.black,"&:hover":{backgroundColor:t.isFocused?Fe.palette.gray.gray7:Fe.palette.gray.white}}),singleValue:e=>({...e})},FX=({selectedEmail:e,setSelectedEmail:t})=>{const n=wt(dW),o=n?Object.entries(n).map(([r,i])=>({value:r,label:`${i}: ${r}`})):e?[{value:e,label:e}]:[];return console.log("SSSSSSSSSSSSS 1 selectedEmail : ",e),console.log("SSSSSSSSSSSSS 1 emailHeadersArray : ",o),b.useEffect(()=>{!e&&n&&Object.keys(n).length>0&&(t(Object.keys(n)[0]),console.log("SSSSSSSSSSSSS 1 useEffect : ",e))},[n,t,e]),y.jsx(gQ,{options:o,value:e?{value:e,label:e}:null,placeholder:e||"Select an email",name:"email-selection",type:"select",onChange:r=>t(String((r==null?void 0:r.value)||"")),components:{MenuList:xX,Option:TX,SingleValue:wX},styles:SX,isSearchable:!1})},OX=V(Yo)`
2691
+ `,BX=e=>T.createElement("svg",{width:35,height:35,viewBox:"0 0 35 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},T.createElement("rect",{x:9,y:9,width:15,height:17,fill:"white"}),T.createElement("g",{clipPath:"url(#clip0_7787_114457)"},T.createElement("path",{d:"M17.1981 2.86633C9.28704 2.86633 2.86646 9.28691 2.86646 17.198C2.86646 25.1091 9.28704 31.5296 17.1981 31.5296C25.1092 31.5296 31.5298 25.1091 31.5298 17.198C31.5298 9.28691 25.1092 2.86633 17.1981 2.86633ZM14.3318 23.6472V10.7487L22.9308 17.198L14.3318 23.6472Z",fill:"#4D596C"})),T.createElement("defs",null,T.createElement("clipPath",{id:"clip0_7787_114457"},T.createElement("rect",{width:34.396,height:34.396,fill:"white"})))),mX=({aspectRatio:e="auto",...t})=>{const[n,o]=b.useState(!1);return n?null:y.jsxs(hX,{aspectRatio:e,children:[y.jsx("img",{className:"preview-img",onError:()=>o(!0),...t}),y.jsx(BX,{className:"play-icon"})]})},QX={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_HIVER_CDN_URL:"https://cdn.hiverhq.com/",VITE_MY_ENV_VAR:"myVariable From Agent"},{VITE_HIVER_CDN_URL:vX}=QX,IQ=({isAdmin:e=!0,hideHeading:t=!1})=>{const{sendTrackingEvent:n,availableFeatures:o,connectorFunctions:r}=b.useContext(eo),i=br(o,QN),a=c=>{c.stopPropagation(),n(zN),r==null||r.redirectToAdmin()},A=c=>{c.stopPropagation(),n(YN),window.open(XW,"_blank")},l=()=>{n(CU,{source:"main_tab"})};return y.jsxs("div",{"data-testid":"noConnectors",children:[i?y.jsxs(y.Fragment,{children:[t?null:y.jsx(He,{variant:"h2",children:qW}),y.jsx(tz,{onClick:l,href:_W,target:"_blank",children:y.jsx(mX,{src:vX+ZW,alt:JW,aspectRatio:"1000/783"})})]}):y.jsxs($W,{children:[y.jsx(ez,{variant:"body1_medium",children:HW}),y.jsx("img",{src:sz,alt:WW})]}),y.jsx(nz,{variant:"body2",children:zW}),e?y.jsx(dm,{endIcon:y.jsx(Oo.ArrowForward,{}),onClick:a,...i&&{size:"medium"},children:YW}):y.jsxs(y.Fragment,{children:[y.jsx(dm,{onClick:A,children:GW}),y.jsxs(oz,{direction:"row",children:[y.jsx(rz,{}),y.jsx(iz,{variant:"caption",children:KW})]})]})]})},yX=()=>y.jsxs(oB,{children:[y.jsxs(Ne,{direction:"row",marginBottom:"12px",height:"36px",alignItems:"center",children:[y.jsx(tB,{}),y.jsx(nB,{variant:"h2",children:"Connectors"})]}),y.jsxs(Ne,{gap:"12px",children:[y.jsx(ui,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),y.jsx(ui,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),y.jsx(ui,{variant:"rounded",width:"100%",height:"46px",animation:"wave"})]})]}),bX=()=>{const{metaData:e,sendTrackingEvent:t,isAdmin:n,connectorFunctions:o}=b.useContext(eo),[r,i]=b.useState(!1),a=b.useRef(null),[A,l]=b.useState(0),{templateUpdates:c}=e||{},{sections:u=[],actionButtons:p=[],title:g}=c||{},{version:B=""}=c||{},C=WN(B),f=b.useMemo(()=>HN(B),[B]),d=b.useMemo(()=>(p==null?void 0:p.filter(({isAdminPanelLink:m})=>!(!n&&m)))??[],[p,n]);if(b.useEffect(()=>{!f&&c&&uf(B,!0)},[f,B,c]),b.useLayoutEffect(()=>{var m;(m=a.current)!=null&&m.scrollHeight&&l(a.current.scrollHeight)},[a]),b.useEffect(()=>{c&&!C&&t(ZN,{update_version_id:B})},[]),!c||C)return null;const E=m=>{var I;m.stopPropagation(),i(v=>!v),(I=a.current)!=null&&I.scrollHeight&&l(a.current.scrollHeight),uf(B,!1,!0)},Q=(m,I="",v=!1,w=!1)=>{var x;if(m.stopPropagation(),v&&w?t(JN,{update_version_id:B}):w&&t(qN,{update_version_id:B}),!v&&I){(x=window.open(I,"_blank"))==null||x.focus();return}h(m,!1),o==null||o.redirectToAdmin()},h=(m,I=!0)=>{m.stopPropagation(),uf(B,!1),i(!1),I&&t($N,{update_version_id:B})};return y.jsxs(fj,{children:[y.jsxs(pj,{children:[y.jsx(gj,{variant:"h3",children:g}),y.jsxs(Et,{children:[r?y.jsx(Rt,{title:ON,placement:"bottom",children:y.jsx(nn,{onClick:h,children:y.jsx(Oo.Close,{sx:{height:"16px",width:"16px",opacity:"0.8"}})})}):null,y.jsx(Rt,{title:r?FN:Af,placement:"bottom",children:y.jsx(di,{onClick:E,children:y.jsx(Ef,{className:r?"":"hiver-up"})})})]})]}),y.jsx(Cj,{className:r?"slideDown":"slideUp",ref:a,height:A,children:y.jsxs(Ej,{children:[u.map(({title:m,items:I,type:v})=>y.jsxs(Qj,{children:[y.jsx(He,{variant:"body2_medium",children:m}),I.map(w=>{const x=v===NN,{deeplink:S,textHtml:O,imageUrl:k}=w,P=()=>y.jsx(oj,{className:x?"":"ellipsisClass",component:"div",variant:"body2",dangerouslySetInnerHTML:{__html:O}});return y.jsx(Ij,{component:"ul",children:y.jsxs(hj,{component:x?"li":"div",marginLeft:k?"0":"14px",children:[k?y.jsx("img",{src:k}):null,S?y.jsx(sB,{target:"_blank",underline:"none",onClick:D=>Q(D,S),fontSize:"13px",children:P()}):P()]})},O)})]},m)),y.jsx(Ne,{flexDirection:"row",gap:"8px",marginBottom:"11.5px",children:d.map(({text:m,link:I,isAdminPanelLink:v})=>y.jsx(Bj,{variant:v?"contained":"text",children:y.jsx(mj,{variant:"caption",onClick:w=>Q(w,I,v,!0),children:m})},m))})]})})]})},hQ=e=>{const t=b.useRef(null),[n,o]=b.useState(!1);return b.useEffect(()=>{t.current&&o(t.current.scrollWidth>t.current.clientWidth)},[e]),{textRef:t,isOverflow:n}},wX=e=>{const{textRef:t,isOverflow:n}=hQ(e.data.label);return y.jsx(Rt,{title:n?e.data.label:null,placement:"bottom",children:y.jsx(vj,{ref:t,variant:"body2",children:e.data.label})})},xX=e=>y.jsxs(Bi.MenuList,{...e,children:[y.jsx(yj,{children:y.jsx(He,{variant:"body2_medium",children:Oj})}),e.children]}),TX=e=>{const{isSelected:t}=e,{textRef:n,isOverflow:o}=hQ(e.data.label);return y.jsx(Bi.Option,{...e,children:y.jsxs(Ne,{direction:"row",gap:"8px",justifyContent:"space-between",children:[y.jsx(Rt,{title:o?e.data.label:null,placement:"bottom",children:y.jsx(wj,{ref:n,className:"dropdown-item-text",variant:"body2",children:e.data.label})}),t&&y.jsx(bj,{})]})})},SX={control:e=>({...e,border:"none",boxShadow:"none",height:"20px","&:hover":{border:"none"},"& > :first-child":{display:"flex !important",alignItems:"center",flexGrow:1}}),option:(e,t)=>({...e,backgroundColor:Fe.palette.gray.white,color:Fe.palette.gray.black,"&:hover":{backgroundColor:t.isFocused?Fe.palette.gray.gray7:Fe.palette.gray.white}}),singleValue:e=>({...e})},FX=({selectedEmail:e,setSelectedEmail:t})=>{const n=wt(dW),o=n?Object.entries(n).map(([r,i])=>({value:r,label:`${i}: ${r}`})):e?[{value:e,label:e}]:[];return console.log("SSSSSSSSSSSSS 1 selectedEmail : ",e),console.log("SSSSSSSSSSSSS 1 emailHeadersArray : ",o),b.useEffect(()=>{!e&&n&&Object.keys(n).length>0&&(t(Object.keys(n)[0]),console.log("SSSSSSSSSSSSS 1 useEffect : ",e))},[n,t,e]),y.jsx(gQ,{options:o,value:e?{value:e,label:e}:null,placeholder:e||"Select an email",name:"email-selection",type:"select",onChange:r=>t(String((r==null?void 0:r.value)||"")),components:{MenuList:xX,Option:TX,SingleValue:wX},styles:SX,isSearchable:!1,closeMenuOnSelect:!1,menuIsOpen:!0})},OX=V(Yo)`
2692
2692
  width: stretch;
2693
2693
  height: 100%;
2694
2694
  position: absolute;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiver/connector-agent",
3
- "version": "2.0.5-emailSelect-beta.1",
3
+ "version": "2.0.5-emailSelect-beta.2",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts",