@hiver/connector-agent 4.19.0-attachment-beta.4 → 4.19.0-attachment-beta.5
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 +1 -1
- package/index.umd.js +1 -1
- package/package.json +1 -1
package/index.es.js
CHANGED
|
@@ -18909,7 +18909,7 @@ const Sw = ({
|
|
|
18909
18909
|
const [E, b] = P({}), [m, x] = P({}), [v, B] = P(!1), S = pe(() => Xd(500), []), _ = pe(() => {
|
|
18910
18910
|
if (!Array.isArray(n) || !n.length) return [];
|
|
18911
18911
|
const G = /* @__PURE__ */ new Set();
|
|
18912
|
-
return n.filter((Q) => G.has(Q.name) ? !1 : (G.add(Q.name), !0)).sort((Q, Y) => Q.priority - Y.priority);
|
|
18912
|
+
return n.filter((Q) => Q.type === "attachment" || G.has(Q.name) ? !1 : (G.add(Q.name), !0)).sort((Q, Y) => Q.priority - Y.priority);
|
|
18913
18913
|
}, [n]), T = ({ name: G, value: J }) => {
|
|
18914
18914
|
x((Q) => {
|
|
18915
18915
|
const Y = { ...Q };
|
package/index.umd.js
CHANGED
|
@@ -2390,7 +2390,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2390
2390
|
display: inline-block;
|
|
2391
2391
|
color: inherit;
|
|
2392
2392
|
}
|
|
2393
|
-
`,Bw={borderRadius:"0 !important",padding:"0 !important",width:"max-content !important",maxWidth:"max-content !important",height:"100% !important",maxHeight:"100% !important",position:"fixed",boxSizing:"border-box !important",top:0,bottom:0,right:0,margin:0};function ww(e){return e.name??e.rowId}const vw=({open:e,onClose:t,formId:u,fields:n,variables:r,connectorLogo:o,isSaving:f,title:i,isLoading:D=!1,defaultValues:c,customFields:l,checkMandatory:A=!1,className:F,customFieldsInDropdown:m=!0,showInfo:g=!0,fetchOptions:p,onSave:d,onCancel:C,onFieldChange:E})=>{const[b,y]=h.useState({}),[x,B]=h.useState({}),[v,S]=h.useState(!1),k=h.useMemo(()=>Y3(500),[]),O=h.useMemo(()=>{if(!Array.isArray(n)||!n.length)return[];const H=new Set;return n.filter(P=>H.has(P.name)?!1:(H.add(P.name),!0)).sort((P,z)=>P.priority-z.priority)},[n]),L=({name:H,value:Z})=>{B(P=>{const z={...P};return Z?z[H]=Z:delete z[H],z})};h.useEffect(()=>{c&&e&&y({...c})},[c,e]),h.useEffect(()=>()=>{e||(y({}),B({}))},[e]),h.useEffect(()=>{A&&k(()=>{const Z=n.filter(P=>{var z;return!!((z=P.validations)!=null&&z.isRequired)}).filter(P=>!b[P.name]);S(Z.length>0)})},[k,b,n,A]);const _=()=>{t(),y({})},j=()=>{C==null||C(),y({}),t()},M=()=>{const H={...b};for(const Z in H){const P=H[Z];(P===""||P===null||P===void 0)&&delete H[Z]}d(H)},Q=Object.keys(x).length>0||v;return a.jsx(s.Dialog,{className:F,open:e,onClose:_,PaperProps:{sx:Bw},maxWidth:!1,children:D?a.jsx(s.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"615px"},children:a.jsx(s.CircularProgress,{})}):a.jsxs(gw,{children:[a.jsxs(Fw,{children:[a.jsxs(s.Stack,{direction:"row",alignItems:"center",gap:2,children:[a.jsx(dw,{}),a.jsx(s.Stack,{gap:.5,flex:1,minWidth:0,children:a.jsxs(s.Stack,{direction:"row",alignItems:"center",gap:.5,children:[a.jsx(s.Typography,{variant:"h6",fontSize:18,fontWeight:600,color:s.theme.palette.gray.gray1,children:i}),g&&a.jsx(s.Tooltip,{title:"Set default values to have them pre-filled every time you create a task.",placement:"top",slotProps:{tooltip:{sx:{maxWidth:"260px !important"}}},children:a.jsx(s.IconButton,{size:"small","aria-label":"About mapping fields",sx:{padding:"4px"},children:a.jsx(s.icons.InfoOutlined,{sx:{fontSize:18,color:s.theme.palette.gray.gray3}})})})]})})]}),a.jsx(s.Tooltip,{title:"Close",placement:"bottom",children:a.jsx(s.IconButton,{onClick:_,size:"small","aria-label":"Close",children:a.jsx(s.icons.Close,{sx:{fontSize:20}})})})]}),a.jsx(hw,{children:a.jsxs(Ew,{children:[a.jsxs(s.Stack,{direction:"row",padding:"16px 24px",sx:{backgroundColor:s.theme.palette.gray.gray6a,borderBottom:"1px solid #ECEFF6",borderRadius:"8px 8px 0 0"},children:[a.jsx(pw,{src:o,alt:"Connector"}),a.jsx(s.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:s.theme.palette.gray.gray3,flex:1,children:"Field"}),a.jsx(s.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:s.theme.palette.gray.gray3,width:320,children:"Value"})]}),O.map((H,Z)=>{var ee;const P=ww(H),z=b[P]??"";return a.jsxs(s.Stack,{direction:"row",alignItems:"center",padding:"24px",gap:2,sx:{borderBottom:Z<O.length-1?"1px solid #F6F8FC":void 0,"&:last-child":{borderBottom:"none"}},children:[a.jsx(xw,{children:a.jsxs(s.Typography,{variant:"body2",fontSize:14,color:s.theme.palette.gray.gray2,children:[H.label,A&&((ee=H.validations)!=null&&ee.isRequired)?a.jsx(yw,{}):null]})}),a.jsx(Cw,{width:20,height:20}),a.jsx(bw,{children:a.jsx(cw,{field:H,formId:String(u),value:z,formValues:b,variables:r,customFields:l,errors:x,checkMandatory:A,customFieldsInDropdown:m,setError:L,fetchOptions:p,setFormValues:y,onFieldChange:E})})]},P)})]})}),a.jsxs(mw,{children:[a.jsx(s.Button,{variant:"contained",onClick:M,sx:{textTransform:"none",padding:"3px 32px !important"},disabled:f||Q,children:"Save"}),a.jsx(s.Button,{variant:"outlined",color:"inherit",onClick:j,disabled:f,sx:{textTransform:"none",padding:"3px 12px !important",borderColor:s.theme.palette.gray.gray5},children:"Cancel"})]})]})})},Sw=s.styled(s.Box)`
|
|
2393
|
+
`,Bw={borderRadius:"0 !important",padding:"0 !important",width:"max-content !important",maxWidth:"max-content !important",height:"100% !important",maxHeight:"100% !important",position:"fixed",boxSizing:"border-box !important",top:0,bottom:0,right:0,margin:0};function ww(e){return e.name??e.rowId}const vw=({open:e,onClose:t,formId:u,fields:n,variables:r,connectorLogo:o,isSaving:f,title:i,isLoading:D=!1,defaultValues:c,customFields:l,checkMandatory:A=!1,className:F,customFieldsInDropdown:m=!0,showInfo:g=!0,fetchOptions:p,onSave:d,onCancel:C,onFieldChange:E})=>{const[b,y]=h.useState({}),[x,B]=h.useState({}),[v,S]=h.useState(!1),k=h.useMemo(()=>Y3(500),[]),O=h.useMemo(()=>{if(!Array.isArray(n)||!n.length)return[];const H=new Set;return n.filter(P=>P.type==="attachment"||H.has(P.name)?!1:(H.add(P.name),!0)).sort((P,z)=>P.priority-z.priority)},[n]),L=({name:H,value:Z})=>{B(P=>{const z={...P};return Z?z[H]=Z:delete z[H],z})};h.useEffect(()=>{c&&e&&y({...c})},[c,e]),h.useEffect(()=>()=>{e||(y({}),B({}))},[e]),h.useEffect(()=>{A&&k(()=>{const Z=n.filter(P=>{var z;return!!((z=P.validations)!=null&&z.isRequired)}).filter(P=>!b[P.name]);S(Z.length>0)})},[k,b,n,A]);const _=()=>{t(),y({})},j=()=>{C==null||C(),y({}),t()},M=()=>{const H={...b};for(const Z in H){const P=H[Z];(P===""||P===null||P===void 0)&&delete H[Z]}d(H)},Q=Object.keys(x).length>0||v;return a.jsx(s.Dialog,{className:F,open:e,onClose:_,PaperProps:{sx:Bw},maxWidth:!1,children:D?a.jsx(s.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"615px"},children:a.jsx(s.CircularProgress,{})}):a.jsxs(gw,{children:[a.jsxs(Fw,{children:[a.jsxs(s.Stack,{direction:"row",alignItems:"center",gap:2,children:[a.jsx(dw,{}),a.jsx(s.Stack,{gap:.5,flex:1,minWidth:0,children:a.jsxs(s.Stack,{direction:"row",alignItems:"center",gap:.5,children:[a.jsx(s.Typography,{variant:"h6",fontSize:18,fontWeight:600,color:s.theme.palette.gray.gray1,children:i}),g&&a.jsx(s.Tooltip,{title:"Set default values to have them pre-filled every time you create a task.",placement:"top",slotProps:{tooltip:{sx:{maxWidth:"260px !important"}}},children:a.jsx(s.IconButton,{size:"small","aria-label":"About mapping fields",sx:{padding:"4px"},children:a.jsx(s.icons.InfoOutlined,{sx:{fontSize:18,color:s.theme.palette.gray.gray3}})})})]})})]}),a.jsx(s.Tooltip,{title:"Close",placement:"bottom",children:a.jsx(s.IconButton,{onClick:_,size:"small","aria-label":"Close",children:a.jsx(s.icons.Close,{sx:{fontSize:20}})})})]}),a.jsx(hw,{children:a.jsxs(Ew,{children:[a.jsxs(s.Stack,{direction:"row",padding:"16px 24px",sx:{backgroundColor:s.theme.palette.gray.gray6a,borderBottom:"1px solid #ECEFF6",borderRadius:"8px 8px 0 0"},children:[a.jsx(pw,{src:o,alt:"Connector"}),a.jsx(s.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:s.theme.palette.gray.gray3,flex:1,children:"Field"}),a.jsx(s.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:s.theme.palette.gray.gray3,width:320,children:"Value"})]}),O.map((H,Z)=>{var ee;const P=ww(H),z=b[P]??"";return a.jsxs(s.Stack,{direction:"row",alignItems:"center",padding:"24px",gap:2,sx:{borderBottom:Z<O.length-1?"1px solid #F6F8FC":void 0,"&:last-child":{borderBottom:"none"}},children:[a.jsx(xw,{children:a.jsxs(s.Typography,{variant:"body2",fontSize:14,color:s.theme.palette.gray.gray2,children:[H.label,A&&((ee=H.validations)!=null&&ee.isRequired)?a.jsx(yw,{}):null]})}),a.jsx(Cw,{width:20,height:20}),a.jsx(bw,{children:a.jsx(cw,{field:H,formId:String(u),value:z,formValues:b,variables:r,customFields:l,errors:x,checkMandatory:A,customFieldsInDropdown:m,setError:L,fetchOptions:p,setFormValues:y,onFieldChange:E})})]},P)})]})}),a.jsxs(mw,{children:[a.jsx(s.Button,{variant:"contained",onClick:M,sx:{textTransform:"none",padding:"3px 32px !important"},disabled:f||Q,children:"Save"}),a.jsx(s.Button,{variant:"outlined",color:"inherit",onClick:j,disabled:f,sx:{textTransform:"none",padding:"3px 12px !important",borderColor:s.theme.palette.gray.gray5},children:"Cancel"})]})]})})},Sw=s.styled(s.Box)`
|
|
2394
2394
|
position: fixed;
|
|
2395
2395
|
inset: 0;
|
|
2396
2396
|
z-index: ${({zIndex:e})=>e};
|