@notmrabhi/flowforge 0.1.15 → 0.1.17
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/{GatewayBranchEdge-DH-aHDPm.js → GatewayBranchEdge-4XMPBHne.js} +130 -130
- package/dist/GatewayBranchEdge-mRo5aZ3f.js +1 -0
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.d.ts +160 -11
- package/dist/canvas.js +2 -2
- package/dist/core.d.ts +41 -0
- package/dist/defaultUi.cjs +1 -1
- package/dist/defaultUi.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +41 -0
- package/dist/index.js +2 -2
- package/dist/nodeRegistry.d.ts +41 -0
- package/dist/templateSkeletons-BXebwps_.js +2945 -0
- package/dist/templateSkeletons-S_rxSXbs.js +1 -0
- package/package.json +1 -1
- package/dist/GatewayBranchEdge-CrDMz9RP.js +0 -1
- package/dist/templateSkeletons-CLTHjrVA.js +0 -1
- package/dist/templateSkeletons-CrVa5zSa.js +0 -2925
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=require("reactflow"),E=require("@mui/material"),ce=require("react-icons/gr"),V=require("react"),fe=require("./messages-O9Tw_XXR.js"),h=require("react-icons/md"),L=require("react-icons/fa"),ae=require("react-icons/fi"),C=require("./canvasTokens-gKNYrPl4.js"),Z=V.createContext({onEditNode:()=>{},onDeleteNode:()=>{},onAddStep:()=>{},onClickAddTrigger:()=>{},messages:fe.defaultFlowForgeMessages,nodeRegistry:null,nodeBody:"full"}),w=()=>V.useContext(Z),Y=()=>e.jsxs("div",{style:{width:350,display:"flex",justifyContent:"center"},children:[e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0,left:"50%"}}),e.jsx("div",{style:{padding:"8px 28px",borderRadius:999,background:"#f5f5f5",border:"1.5px solid #bdbdbd",fontSize:13,fontWeight:500,color:"#424242",userSelect:"none"},children:"Start"})]}),J=()=>e.jsxs("div",{style:{width:350,display:"flex",justifyContent:"center"},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0,left:"50%"}}),e.jsx("div",{style:{padding:"8px 28px",borderRadius:999,background:"#f5f5f5",border:"1.5px solid #bdbdbd",fontSize:13,fontWeight:500,color:"#424242",userSelect:"none"},children:"End"})]}),Q=()=>{const{onClickAddTrigger:t,messages:s}=w();return e.jsxs("div",{style:{width:350,display:"flex",justifyContent:"center"},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0,left:"50%"}}),e.jsx(E.Tooltip,{title:s.addTriggerTooltip,placement:"top",arrow:!0,children:e.jsxs("div",{onClick:t,role:"button",tabIndex:0,onKeyDown:d=>{d.key==="Enter"&&t()},style:{padding:"10px 24px",borderRadius:8,border:"1.5px dashed #d0d0d0",background:"#fff",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:[e.jsx(ce.GrTrigger,{size:16}),e.jsx("span",{className:"ff-text-black",style:{fontSize:13},"data-testid":"add-trigger-btn-text",children:s.addTriggerButton})]})}),e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0,left:"50%"}})]})},pe=({id:t})=>{const{onAddStep:s}=w();return e.jsxs("div",{onClick:()=>s(t),role:"button",tabIndex:0,onKeyDown:d=>{d.key==="Enter"&&s(t)},style:{width:28,height:28,borderRadius:"50%",border:"1.5px solid #9e9e9e",background:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:18,color:"#757575",lineHeight:1,userSelect:"none"},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0}}),"+",e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0}})]})};function xe(t){return t?t==="END_USER_CREATION"?"New User Registration":t==="END_USER_UPDATION"?"On User Update":t.replace(/[_-]+/g," ").replace(/\b\w/g,s=>s.toUpperCase()):""}function ge(t){const s=typeof t=="string"?t:t.value??"";return s==="SIGNUP_FLOW"?"User Self-Registration":s==="ADMIN_CREATION_FLOW"?"Create User via Admin Portal":s==="SHEDULAR"?"Scheduler":typeof t!="string"&&t.label?t.label:s.replace(/[_-]+/g," ").replace(/\b\w/g,d=>d.toUpperCase())}const X=({data:t})=>{const{onClickAddTrigger:s}=w(),{type:d,eventType:a,sources:r,label:o,source:x,previewWorkflow:n,executionStatus:i,infoText:f="This node decides the flow trigger type and configuration."}=t??{},y=m=>{m==null||m.stopPropagation(),s()},g=Array.isArray(r)&&r.length>0,j=!!(o||x),p=d==="scheduler"?"Scheduler Trigger":d==="event"||g||j?"Event Trigger Source":"Select Trigger",c=d==="scheduler"?e.jsx("span",{children:"Scheduler to be configured"}):d==="event"||g?e.jsxs("div",{children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center",children:[e.jsx("span",{style:{fontWeight:600},children:xe(a)}),e.jsx("span",{className:"ff-ms-2 ff-text-muted",style:{fontSize:12},children:"via"})]}),e.jsx("div",{className:"ff-d-flex ff-flex-wrap ff-mt-2",style:{gap:4},children:g?r.map((m,k)=>e.jsx(E.Chip,{label:ge(m),variant:"outlined",size:"small",className:"ff-text-dark"},k)):e.jsx("span",{className:"ff-text-muted",style:{fontSize:12},children:"No source selected"})})]}):j?e.jsxs("div",{className:"ff-d-flex ff-flex-wrap ff-align-items-center",style:{gap:6},children:[o&&e.jsx("span",{style:{fontWeight:600},children:o}),x&&e.jsx(E.Chip,{label:x,variant:"outlined",size:"small"})]}):e.jsx("span",{role:"button",tabIndex:0,onClick:y,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&y(m)},style:{cursor:"pointer",color:"#1e88e5"},children:"Click to select a trigger to start your workflow"}),N=i?e.jsxs(e.Fragment,{children:[i.status==="success"&&e.jsx(L.FaCheckCircle,{size:16,color:"#1DBF60",style:{marginRight:8}}),i.status==="failed"&&e.jsx(L.FaTimesCircle,{size:16,color:"#f44336",style:{marginRight:8}})]}):e.jsxs("div",{className:"ff-d-flex ff-align-items-center",children:[!n&&e.jsx("div",{role:"button",tabIndex:0,onClick:y,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&y(m)},className:"ff-me-2",style:{cursor:"pointer",color:"#212121"},"aria-label":"Edit trigger",children:e.jsx(h.MdOutlineModeEdit,{size:16})}),e.jsx(E.Tooltip,{title:e.jsx("div",{children:f}),placement:"right",arrow:!0,children:e.jsx("span",{children:e.jsx(h.MdInfoOutline,{color:"gray",size:16})})})]});return e.jsxs("div",{style:{width:350},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #a5d6a7",borderRadius:8,background:"#fff",overflow:"hidden"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{style:{width:28,height:28,borderRadius:6,background:"rgba(76,175,80,0.1)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(h.MdInput,{size:16,color:"#388e3c"})}),e.jsx("span",{style:{fontSize:14,fontWeight:500,color:"#212121"},children:p})]}),e.jsx("div",{className:"ff-d-flex ff-align-items-center",children:N})]}),e.jsx("div",{style:{background:"#f5f5f5",fontSize:12,color:"#212121",padding:"10px 6px",margin:"0 6px 10px",borderRadius:6},children:c})]}),e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0},id:"1"})]})};function he(t){return t?t==="END_USER_CREATION"?"New User Registration":t==="END_USER_UPDATION"?"On User Update":t.replace(/[_-]+/g," ").replace(/\b\w/g,s=>s.toUpperCase()):""}function ye(t){const s=typeof t=="string"?t:t.value??"";return s==="SIGNUP_FLOW"?"User Self-Registration":s==="ADMIN_CREATION_FLOW"?"Create User via Admin Portal":s==="SHEDULAR"||s==="SCHEDULER"?"Scheduler":typeof t!="string"&&t.label?t.label:s.replace(/[_-]+/g," ").replace(/\b\w/g,d=>d.toUpperCase())}const ue=({data:t})=>{const{header:s="Event",title:d,eventType:a,sources:r,executionStatus:o,infoText:x="This event is raised by the system. It cannot be configured."}=t??{},n=d??he(a)??"—";return e.jsxs("div",{style:{width:350},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #a5d6a7",borderRadius:8,background:"#fff",overflow:"hidden"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{style:{width:28,height:28,borderRadius:6,background:"rgba(76,175,80,0.1)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(h.MdInput,{size:16,color:"#388e3c"})}),e.jsx("span",{style:{fontSize:14,fontWeight:500,color:"#212121"},children:s})]}),e.jsxs("div",{className:"ff-d-flex ff-align-items-center",children:[(o==null?void 0:o.status)==="success"&&e.jsx(L.FaCheckCircle,{size:16,color:"#1DBF60",style:{marginRight:8}}),(o==null?void 0:o.status)==="failed"&&e.jsx(L.FaTimesCircle,{size:16,color:"#f44336",style:{marginRight:8}}),!o&&e.jsx(E.Tooltip,{title:e.jsx("div",{children:x}),placement:"right",arrow:!0,children:e.jsx("span",{children:e.jsx(h.MdInfoOutline,{color:"gray",size:16})})})]})]}),e.jsxs("div",{style:{background:"#f5f5f5",fontSize:13,color:"#212121",padding:"10px 12px",margin:"0 6px 10px",borderRadius:6},children:[e.jsx("div",{style:{fontWeight:600},children:n}),Array.isArray(r)&&r.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ff-text-muted",style:{fontSize:12,marginTop:4},children:"via"}),e.jsx("div",{className:"ff-d-flex ff-flex-wrap ff-mt-1",style:{gap:4},children:r.map((i,f)=>e.jsx(E.Chip,{label:ye(i),variant:"outlined",size:"small",className:"ff-text-dark"},f))})]})]})]}),e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0},id:"1"})]})},ee=({rail:t,cardWidth:s})=>{const d=s/2;s/2+t.indent;const a="var(--ff-edge-color, #b0bec5)";return e.jsxs("svg",{width:s+t.indent+200,height:t.height,style:{position:"absolute",left:0,top:"100%",pointerEvents:"none",overflow:"visible"},children:[e.jsx("line",{x1:d,y1:0,x2:d,y2:t.height,stroke:a,strokeWidth:1.5}),t.branches.map((r,o)=>{const x=r.y;return e.jsxs("g",{transform:`translate(0, ${x})`,children:[e.jsx("rect",{x:d-5,y:-5,width:10,height:10,fill:"#fff",stroke:a,strokeWidth:1.5,transform:`rotate(45, ${d}, 0)`}),e.jsx("text",{x:d+14,y:4,fontSize:12,fontWeight:500,fill:"var(--ff-text, #212121)",style:{fontFamily:"sans-serif"},children:r.label})]},o)})]})},te=({id:t,data:s})=>{const{onEditNode:d,onDeleteNode:a}=w(),{conditions:r=[],infoText:o="Filter conditions applied to workflow data",_branchRail:x}=s;return e.jsxs("div",{style:{width:350,position:"relative"},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #ffe082",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center",children:[e.jsx("div",{className:"ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded",style:{width:25,height:25,background:"rgba(255,160,0,0.1)"},children:e.jsx(ae.FiFilter,{className:"ff-text-warning",size:16})}),e.jsx("span",{className:"ff-ms-2 ff-fw-medium ff-text-dark",style:{fontSize:14},children:"Filter"})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:n=>{n.stopPropagation(),d(t)},onKeyDown:n=>{n.key==="Enter"&&(n.stopPropagation(),d(t))},children:e.jsx(h.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:n=>{n.stopPropagation(),a(t)},onKeyDown:n=>{n.key==="Enter"&&(n.stopPropagation(),a(t))},children:e.jsx(h.MdDeleteOutline,{color:"red",size:16})}),e.jsx(E.Tooltip,{title:o,placement:"right",arrow:!0,children:e.jsx("div",{className:"ff-ms-2",children:e.jsx(h.MdInfoOutline,{color:"gray",size:16})})})]})]}),e.jsx("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#fafafa",fontSize:12},children:r.length===0?e.jsx("span",{className:"ff-text-muted",children:"No conditions configured"}):r.map((n,i)=>e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-mb-1",children:[e.jsx("p",{className:"ff-m-0 ff-fw-bold ff-me-1 ff-text-truncate",style:{maxWidth:100},title:n.field,children:n.field}),e.jsx("span",{className:"ff-text-muted",children:n.operator}),e.jsx("p",{className:"ff-text-dark ff-text-truncate ff-mx-1 ff-m-0",title:n.value,children:n.value}),i<r.length-1&&e.jsx("p",{className:"ff-bg-primary ff-text-white ff-fw-bold ff-ms-1 ff-px-1 ff-rounded-1 ff-m-0",children:n.logicalOperator})]},i))})]}),e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0}}),x&&e.jsx(ee,{rail:x,cardWidth:350})]})},ne=({id:t,data:s})=>{const{onEditNode:d,onDeleteNode:a,nodeRegistry:r,nodeBody:o="full"}=w(),{title:x="Task",descriptorType:n,groupBlocks:i,groups:f,roles:y,groupId:g,roleId:j,infoText:p=""}=s,c=n?r==null?void 0:r.forType(n):void 0,N=c==null?void 0:c.icon,m=u=>u==null?"":typeof u=="string"?u:typeof u=="object"&&"label"in u?String(u.label):String(u),k=u=>Array.isArray(u)?u.map(m).filter(Boolean):u!=null&&u!==""?[m(u)]:[],b=(i==null?void 0:i.flatMap(u=>u.groups??[]))??[...k(f),...k(y),...k(g),...k(j)],P=b.length>0;return e.jsxs("div",{style:{width:350},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #b0bec5",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[N&&e.jsx("div",{style:{display:"flex",alignItems:"center"},children:N}),e.jsx("span",{className:"ff-text-dark",style:{fontSize:14,fontWeight:500},children:x})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:u=>{u.stopPropagation(),d(t)},onKeyDown:u=>{u.key==="Enter"&&(u.stopPropagation(),d(t))},children:e.jsx(h.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:u=>{u.stopPropagation(),a(t)},onKeyDown:u=>{u.key==="Enter"&&(u.stopPropagation(),a(t))},children:e.jsx(h.MdDeleteOutline,{color:"red",size:16})}),p&&e.jsx(E.Tooltip,{title:p,placement:"right",arrow:!0,children:e.jsx("div",{className:"ff-ms-2",children:e.jsx(h.MdInfoOutline,{color:"gray",size:16})})})]})]}),o!=="title-only"&&e.jsx("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#fafafa",fontSize:12},children:c!=null&&c.renderNode?c.renderNode(s):P?e.jsx("div",{className:"ff-d-flex ff-flex-wrap ff-gap-1",children:b.map((u,T)=>e.jsx("span",{className:"ff-badge ff-bg-dark ff-text-white ff-py-1 ff-px-2 ff-rounded",style:{fontSize:11},title:u,children:u},T))}):e.jsx("span",{className:"ff-text-muted",children:"Not configured"})})]}),e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0}})]})},M=5,se=({id:t,data:s})=>{const{onEditNode:d,onDeleteNode:a}=w(),{approvalData:r,isPreview:o=!1,_branchRail:x}=s,n=(r==null?void 0:r.policy)??{},i=n.stages??[],f=i.length,y=i.slice(0,M),g=f-M,j=n.name??n.policyName??"Untitled Policy";return e.jsxs("div",{style:{width:350,position:"relative"},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #ffe082",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{className:"ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded",style:{width:25,height:25,background:"rgba(251,192,45,0.2)"},children:e.jsx(h.MdCheckCircle,{style:{color:"#FBC02D"},size:16})}),e.jsx("span",{className:"ff-fw-medium ff-text-dark",style:{fontSize:14},children:"Approval Policy"})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[!o&&e.jsx("div",{role:"button",tabIndex:0,style:{cursor:"pointer"},onClick:p=>{p.stopPropagation(),d(t)},onKeyDown:p=>{p.key==="Enter"&&(p.stopPropagation(),d(t))},children:e.jsx(h.MdOutlineModeEdit,{size:16,className:"ff-text-secondary"})}),!o&&e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,style:{cursor:"pointer"},onClick:p=>{p.stopPropagation(),a(t)},onKeyDown:p=>{p.key==="Enter"&&(p.stopPropagation(),a(t))},children:e.jsx(h.MdDeleteOutline,{color:"red",size:16})}),e.jsx(E.Tooltip,{title:"This approval policy determines who must approve a request before the workflow continues.",arrow:!0,placement:"right",children:e.jsx("span",{className:"ff-ms-2 ff-d-inline-flex",children:e.jsx(h.MdInfoOutline,{color:"gray",size:16})})})]})]}),e.jsxs("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#FCFCFC"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-start ff-align-items-center ff-mb-2",children:[e.jsx("h6",{className:"ff-text-dark ff-mb-0 ff-text-truncate ff-flex-grow-1 ff-me-2",style:{fontSize:13,fontWeight:700},title:j,children:j}),e.jsxs("span",{className:"ff-badge ff-rounded-pill ff-px-2 ff-py-1 ff-flex-shrink-0",style:{background:"#FFF9C4",color:"#616161",fontSize:11,fontWeight:600},children:[f," Stage",f!==1?"s":""]})]}),i.length>0?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[y.map((p,c)=>{var T,I,S;const N=((T=p.stageName)==null?void 0:T.trim())||`Stage ${c+1}`,m=Array.isArray(p.userIds)?p.userIds.length:0,k=((I=p.groupName)==null?void 0:I.trim())??"",b=((S=p.roleName)==null?void 0:S.trim())??"",P=m>0||k||b;let u="Not configured";return k?u=`Group: ${k}`:b?u=`Role: ${b}`:m>0&&(u=`${m} approver${m!==1?"s":""}`),e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{className:"ff-rounded-circle ff-d-flex ff-align-items-center ff-justify-content-center ff-flex-shrink-0",style:{width:28,height:28,background:"#FFF9C4",color:"#5D4037",fontSize:12,fontWeight:700},children:c+1}),e.jsxs("div",{className:"ff-flex-grow-1 ff-rounded ff-p-2 ff-d-flex ff-justify-content-between ff-align-items-center ff-border",style:{background:"#FFFDE7",borderColor:"#FEE79A"},children:[e.jsx("span",{style:{fontSize:12,fontWeight:700,color:"#212121"},children:N}),e.jsxs("span",{className:`ff-d-flex ff-align-items-center ff-gap-1 ${P?"ff-text-dark":"ff-text-muted"}`,style:{fontSize:12},children:[e.jsx(h.MdPeople,{size:16,className:"ff-flex-shrink-0",style:{color:P?"#5D4037":"#9E9E9E"}}),u]})]})]},c)}),g>0&&e.jsxs("div",{className:"ff-text-center ff-fw-bold ff-py-2 ff-border ff-rounded",style:{fontSize:11,color:"#1976d2",borderColor:"#FEE79A",background:"#FFFDE7",borderStyle:"dashed",cursor:o?"default":"pointer"},role:o?void 0:"button",tabIndex:o?void 0:0,onClick:p=>{o||(p.stopPropagation(),d(t))},onKeyDown:p=>{o||p.key!=="Enter"||(p.stopPropagation(),d(t))},children:["+ ",g," More Stage",g>1?"s":""]})]}):e.jsx("div",{className:"ff-text-center ff-py-3 ff-rounded ff-border",style:{fontSize:12,color:"#9e9e9e",background:"#FFFDE7",borderColor:"#FEE79A",borderStyle:"dashed"},children:"No stages configured"})]})]}),e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0}}),x&&e.jsx(ee,{rail:x,cardWidth:350})]})},ie=({id:t,data:s})=>{const{onEditNode:d,onDeleteNode:a}=w(),{duration:r,unit:o}=s,x=r!=null&&o,n=x?`Wait ${r} ${o}`:"Not configured";return e.jsxs("div",{style:{width:350},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #b0bec5",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2 ff-mb-1",children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{className:"ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded",style:{width:25,height:25,background:"rgba(33,150,243,0.1)"},children:e.jsx(h.MdSchedule,{size:16,color:"#1976d2"})}),e.jsx("span",{className:"ff-fw-medium ff-text-dark",style:{fontSize:14},children:"Delay"})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:i=>{i.stopPropagation(),d(t)},onKeyDown:i=>{i.key==="Enter"&&(i.stopPropagation(),d(t))},children:e.jsx(h.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:i=>{i.stopPropagation(),a(t)},onKeyDown:i=>{i.key==="Enter"&&(i.stopPropagation(),a(t))},children:e.jsx(h.MdDeleteOutline,{color:"red",size:16})})]})]}),e.jsx("div",{className:"ff-mx-2 ff-mb-2 ff-p-2 ff-rounded",style:{background:"#fafafa",fontSize:12},children:e.jsx("span",{className:x?"ff-text-dark ff-fw-medium":"ff-text-muted",children:n})})]}),e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0}})]})},W={email:{label:"Email",bg:"#e3f2fd",color:"#1565c0",iconType:h.MdEmail},slack:{label:"Slack",bg:"#e8f5e9",color:"#2e7d32",iconType:h.MdNotifications},teams:{label:"MS Teams",bg:"#ede7f6",color:"#4527a0",iconType:h.MdNotifications},sms:{label:"SMS",bg:"#fce4ec",color:"#880e4f",iconType:h.MdSms},"in-app":{label:"In-App",bg:"#fff3e0",color:"#e65100",iconType:h.MdNotifications},webhook:{label:"Webhook",bg:"#f3e5f5",color:"#6a1b9a",iconType:h.MdWebhook}},me={label:"Notification",bg:"rgba(156,39,176,0.1)",color:"#7b1fa2",iconType:h.MdNotifications};function je(t){var s;switch(t.channel){case"email":return((s=t.emailTo)==null?void 0:s.join(", "))??t.recipient??null;case"slack":return t.slackChannel??null;case"teams":return t.teamsMessage?"Message configured":null;case"sms":return t.smsTo??null;case"in-app":return t.inAppRecipient??null;case"webhook":return t.webhookUrl??null;default:return t.recipient??null}}function be(t){switch(t.channel){case"email":return t.emailSubject??t.subject??null;case"slack":{const s=t.slackMessage;return s?s.length>60?`${s.slice(0,60)}…`:s:null}case"in-app":return t.inAppTitle??null;default:return t.subject??null}}const oe=({id:t,data:s})=>{const{onEditNode:d,onDeleteNode:a}=w(),r=s,o=r.channel&&W[r.channel]?W[r.channel]:me,x=je(r),n=be(r),i=!!(r.channel&&x),f=o.iconType;return e.jsxs("div",{style:{width:C.NODE_WIDTH},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #b0bec5",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{className:"ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded",style:{width:25,height:25,background:o.bg},children:e.jsx(f,{size:16,color:o.color})}),e.jsx("span",{className:"ff-fw-medium ff-text-dark",style:{fontSize:14},children:r.channel?`${o.label} Notification`:"Notification"})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:y=>{y.stopPropagation(),d(t)},onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.stopPropagation(),d(t))},children:e.jsx(h.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:y=>{y.stopPropagation(),a(t)},onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.stopPropagation(),a(t))},children:e.jsx(h.MdDeleteOutline,{color:"red",size:16})})]})]}),e.jsx("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#fafafa",fontSize:12},children:i?e.jsxs("div",{className:"ff-d-flex ff-flex-column ff-gap-1",children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("span",{className:"ff-px-2 ff-py-1 ff-rounded",style:{fontSize:10,background:o.bg,color:o.color,fontWeight:600,flexShrink:0},children:o.label}),e.jsx("span",{className:"ff-text-dark ff-text-truncate",style:{maxWidth:220},children:x})]}),n&&e.jsx("span",{className:"ff-text-muted ff-text-truncate",style:{maxWidth:280},children:n})]}):e.jsx("span",{className:"ff-text-muted",children:"Not configured"})})]}),e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0}})]})},F={"api-key":"API Key",hmac:"HMAC"},le=({data:t})=>{const{onClickAddTrigger:s}=w(),{label:d="Webhook Trigger",endpointUrl:a,authMethod:r,source:o}=t,x=i=>{i.stopPropagation(),s()},n=i=>{i.stopPropagation(),a&&navigator.clipboard.writeText(a).catch(()=>{})};return e.jsxs("div",{style:{width:C.NODE_WIDTH},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #90caf9",borderRadius:8,background:"#fff",overflow:"hidden"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{style:{width:28,height:28,borderRadius:6,background:"rgba(33,150,243,0.1)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(h.MdWebhook,{size:16,color:"#1565c0"})}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:"#212121"},children:"Webhook Trigger"})]}),e.jsx("div",{role:"button",tabIndex:0,onClick:x,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&x(i)},className:"ff-d-flex ff-align-items-center",style:{paddingRight:4,cursor:"pointer"},children:e.jsx(h.MdOutlineModeEdit,{size:16,color:"#555"})})]}),e.jsxs("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#e3f2fd",border:"1px solid #90caf9"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-flex-wrap ff-gap-2 ff-mb-1",children:[e.jsx("span",{style:{fontSize:12,color:"#1565c0",fontWeight:600},children:d}),o&&e.jsx("span",{className:"ff-px-2 ff-py-1 ff-rounded",style:{fontSize:11,background:"#fff",border:"1px solid #90caf9",color:"#1565c0"},children:o}),r&&r!=="none"&&F[r]&&e.jsx("span",{className:"ff-px-2 ff-py-1 ff-rounded",style:{fontSize:10,background:"#1565c0",color:"#fff",fontWeight:600},children:F[r]})]}),a&&e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-1",style:{marginTop:4},children:[e.jsx("span",{style:{fontSize:10,color:"#1565c0",fontFamily:"monospace",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a}),e.jsx(E.Tooltip,{title:"Copy URL",placement:"top",arrow:!0,children:e.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&n(i)},style:{cursor:"pointer",flexShrink:0},children:e.jsx(h.MdContentCopy,{size:12,color:"#1565c0"})})})]})]})]}),e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0}})]})},re=({id:t,data:s})=>{var j;const{onEditNode:d,onDeleteNode:a,nodeRegistry:r}=w(),{method:o,url:x,descriptorType:n}=s,i=n?(j=r==null?void 0:r.forType(n))==null?void 0:j.icon:e.jsx(h.MdHttp,{size:16,color:"#546e7a"}),f=!!(o&&x),y=(o==null?void 0:o.toUpperCase())??"",g=C.HTTP_METHOD_STYLE[y]??null;return e.jsxs("div",{style:{width:C.NODE_WIDTH},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #b0bec5",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{style:{width:25,height:25,display:"flex",alignItems:"center",justifyContent:"center"},children:i}),e.jsx("span",{className:"ff-fw-medium ff-text-dark",style:{fontSize:14},children:"REST API Call"})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:p=>{p.stopPropagation(),d(t)},onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.stopPropagation(),d(t))},children:e.jsx(h.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:p=>{p.stopPropagation(),a(t)},onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.stopPropagation(),a(t))},children:e.jsx(h.MdDeleteOutline,{color:"red",size:16})})]})]}),e.jsx("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#fafafa",fontSize:12},children:f?e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[g&&e.jsx("span",{style:{fontSize:10,fontWeight:700,padding:"2px 6px",borderRadius:4,background:g.bg,color:g.color,flexShrink:0},children:y}),e.jsx("span",{className:"ff-text-dark ff-text-truncate",style:{fontFamily:"monospace",fontSize:11},title:x,children:x})]}):e.jsx("span",{className:"ff-text-muted",children:"Not configured"})})]}),e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0}})]})},Ne={eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",contains:"contains",startsWith:"starts with",endsWith:"ends with",isEmpty:"is empty",isNotEmpty:"is not empty"},ke=({id:t,data:s})=>{const{onEditNode:d,onDeleteNode:a}=w(),{title:r="Condition Branch",branchConfigs:o=[],defaultBranch:x}=s,n=o.length>0;return e.jsxs("div",{style:{width:C.NODE_WIDTH},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #b39ddb",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{style:{width:25,height:25,borderRadius:6,background:"rgba(103,58,183,0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(h.MdCallSplit,{size:16,color:"#512da8"})}),e.jsx("span",{className:"ff-fw-medium ff-text-dark",style:{fontSize:14},children:r})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:i=>{i.stopPropagation(),d(t)},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.stopPropagation(),d(t))},children:e.jsx(h.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:i=>{i.stopPropagation(),a(t)},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.stopPropagation(),a(t))},children:e.jsx(h.MdDeleteOutline,{color:"red",size:16})})]})]}),e.jsx("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#fafafa",fontSize:12},children:n?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[o.map((i,f)=>{var p,c;const y=C.BRANCH_PALETTE[f%C.BRANCH_PALETTE.length],g=(p=i.conditions)==null?void 0:p[0],j=(((c=i.conditions)==null?void 0:c.length)??0)-1;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 7px",borderRadius:10,background:y.bg,color:y.color,flexShrink:0},children:i.label||i.key}),g?e.jsxs("span",{style:{fontSize:11,color:"#616161",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[g.field," ",Ne[g.operator]??g.operator,g.value?` ${g.value}`:"",j>0?` +${j} more`:""]}):e.jsx("span",{style:{fontSize:11,color:"#9e9e9e"},children:"No conditions yet"})]},i.key)}),x&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginTop:2},children:[e.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 7px",borderRadius:10,background:"#f5f5f5",color:"#757575",flexShrink:0},children:"Default"}),e.jsx("span",{style:{fontSize:11,color:"#9e9e9e"},children:"fallback path"})]})]}):e.jsx("span",{className:"ff-text-muted",children:"Not configured — click edit to add branches"})})]}),e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0}})]})},ve=({id:t,data:s})=>{var p;const{onEditNode:d,onDeleteNode:a,nodeRegistry:r}=w(),{title:o="Sub-Workflow",workflowId:x,workflowLabel:n,descriptorType:i,onPreview:f}=s,y=i?(p=r==null?void 0:r.forType(i))==null?void 0:p.icon:e.jsx(h.MdAccountTree,{size:16,color:"#00695c"}),g=!!x,j=c=>{c.stopPropagation(),x&&f&&f(x)};return e.jsxs("div",{style:{width:C.NODE_WIDTH},children:[e.jsx(l.Handle,{type:"target",position:l.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #80cbc4",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{style:{width:25,height:25,borderRadius:6,background:"rgba(0,137,123,0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:y}),e.jsx("span",{className:"ff-fw-medium ff-text-dark",style:{fontSize:14},children:o})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:c=>{c.stopPropagation(),d(t)},onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.stopPropagation(),d(t))},children:e.jsx(h.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:c=>{c.stopPropagation(),a(t)},onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.stopPropagation(),a(t))},children:e.jsx(h.MdDeleteOutline,{color:"red",size:16})})]})]}),e.jsx("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:g?"#e0f2f1":"#fafafa",fontSize:12,border:g?"1px solid #b2dfdb":"none"},children:g?e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-justify-content-between",children:[e.jsxs("div",{className:"ff-d-flex ff-flex-column ff-gap-1",children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"#00695c"},children:n||x}),e.jsxs("span",{style:{fontSize:10,color:"#80cbc4",fontFamily:"monospace"},children:["ID: ",x]})]}),f&&e.jsxs("div",{role:"button",tabIndex:0,onClick:j,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&j(c)},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:3,fontSize:11,color:"#00897b"},children:[e.jsx(h.MdOpenInNew,{size:13}),"Preview"]})]}):e.jsx("span",{className:"ff-text-muted",children:"Not configured — select a workflow"})})]}),e.jsx(l.Handle,{type:"source",position:l.Position.Bottom,style:{opacity:0}})]})},we={startNode:Y,endNode:J,addTriggerNode:Q,addStepNode:pe,triggerNode:X,eventNode:ue,filterNode:te,actionNode:ne,approvalNode:se,delayNode:ie,notificationNode:oe,webhookTriggerNode:le,restApiNode:re,conditionBranchNode:ke,subWorkflowNode:ve},Se=11.5,H=2,D=6,$=40,O=20,B=4,Ee=({id:t,sourceX:s,sourceY:d,targetX:a,targetY:r,sourcePosition:o,targetPosition:x,source:n,target:i,data:f})=>{const[y,g,j]=l.getStraightPath({sourceX:s,sourceY:d,targetX:a,targetY:r}),p=f==null?void 0:f.label,c=p==="Pass",N=c||p==="Fail",m=s+(a-s)/3,k=d+(r-d)/3,b=s+2*(a-s)/3,P=d+2*(r-d)/3,u=f==null?void 0:f.onAddStepClick,T=z=>{if(z.stopPropagation(),typeof u!="function")return;const de={edgeId:t,nodeId:n,sourceNodeId:n,targetNodeId:i,position:"between",referenceNodeId:n,referenceNodeType:f==null?void 0:f.referenceNodeType,stepVisibility:f==null?void 0:f.stepVisibility};u(n,de)},I=z=>{(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),T(z))},S=()=>e.jsxs(e.Fragment,{children:[e.jsxs("g",{className:"plus-icon-container",children:[e.jsx("circle",{r:Se,className:"edge-plus-circle"}),e.jsx("line",{x1:0,y1:-D,x2:0,y2:D,strokeWidth:H,strokeLinecap:"round",className:"plus-line"}),e.jsx("line",{x1:-D,y1:0,x2:D,y2:0,strokeWidth:H,strokeLinecap:"round",className:"plus-line"})]}),e.jsxs("g",{className:"edge-plus-tooltip",transform:"translate(18, 0)",children:[e.jsx("rect",{x:0,y:-10,width:65,height:20,rx:4,className:"tooltip-bg"}),e.jsx("path",{d:"M0 -4 L-4 0 L0 4 Z",className:"tooltip-bg"}),e.jsx("text",{x:32,y:0,textAnchor:"middle",dominantBaseline:"central",fill:"white",style:{fontSize:10,fontWeight:600,pointerEvents:"none"},children:"Add Step"})]})]}),v=u?{onClick:T,onKeyDown:I,role:"button",tabIndex:0,style:{cursor:"pointer",pointerEvents:"all"}}:{style:{cursor:"default",pointerEvents:"all"}};return e.jsxs("g",{className:"edge-with-plus-wrapper",children:[e.jsx(l.BaseEdge,{id:t,path:y}),N?e.jsxs(e.Fragment,{children:[e.jsxs("g",{transform:`translate(${m}, ${k})`,children:[e.jsx("rect",{x:-$/2,y:-O/2,width:$,height:O,rx:B,ry:B,fill:c?"#ADE6C5":"#FDBFBF"}),e.jsx("text",{textAnchor:"middle",dominantBaseline:"central",fill:c?"#1DBF60":"#C50000",style:{fontSize:12,fontWeight:500},children:p})]}),e.jsx("g",{className:"nodrag nopan edge-plus-svg",transform:`translate(${b}, ${P})`,"data-testid":"plus-node-icon",...v,children:e.jsx(S,{})})]}):e.jsx("g",{className:"nodrag nopan edge-plus-svg",transform:`translate(${g}, ${j})`,"data-testid":"plus-node-icon",...v,children:e.jsx(S,{})})]})},Te=11.5,_=2,A=6,Pe=({id:t,sourceX:s,sourceY:d,targetX:a,targetY:r,source:o,target:x,data:n})=>{const[i,f,y]=l.getStraightPath({sourceX:s,sourceY:d,targetX:a,targetY:r}),g=n==null?void 0:n.onAddStepClick,j=c=>{c.stopPropagation(),typeof g=="function"&&g(o,{edgeId:t,nodeId:o,sourceNodeId:o,targetNodeId:x,position:"between",referenceNodeId:o,referenceNodeType:n==null?void 0:n.referenceNodeType,stepVisibility:n==null?void 0:n.stepVisibility,filterId:n==null?void 0:n.filterId,branch:n==null?void 0:n.branch})},p=c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),j(c))};return e.jsxs("g",{className:"edge-with-plus-wrapper",children:[e.jsx(l.BaseEdge,{id:t,path:i,style:{stroke:"#b0bec5"}}),e.jsxs("g",{className:"nodrag nopan edge-plus-svg",transform:`translate(${f}, ${y})`,style:{cursor:g?"pointer":"default",pointerEvents:"all",outline:"none"},onClick:g?j:void 0,onKeyDown:g?p:void 0,role:g?"button":void 0,tabIndex:g?0:void 0,"data-testid":"plus-node-icon",children:[e.jsx("circle",{r:Te,className:"edge-plus-circle"}),e.jsx("line",{x1:0,y1:-A,x2:0,y2:A,strokeWidth:_,strokeLinecap:"round",className:"plus-line"}),e.jsx("line",{x1:-A,y1:0,x2:A,y2:0,strokeWidth:_,strokeLinecap:"round",className:"plus-line"}),e.jsxs("g",{className:"edge-plus-tooltip",transform:"translate(18, 0)",children:[e.jsx("rect",{x:0,y:-10,width:65,height:20,rx:4,className:"tooltip-bg"}),e.jsx("path",{d:"M0 -4 L-4 0 L0 4 Z",className:"tooltip-bg"}),e.jsx("text",{x:32,y:0,textAnchor:"middle",dominantBaseline:"central",fill:"white",style:{fontSize:10,fontWeight:600,pointerEvents:"none"},children:"Add Step"})]})]})]})},Ce=({id:t,sourceX:s,sourceY:d,targetX:a,targetY:r})=>{const[o]=l.getStraightPath({sourceX:s,sourceY:d,targetX:a,targetY:r});return e.jsx(l.BaseEdge,{id:t,path:o,style:{stroke:"#b0bec5"}})},Ie=11.5,K=2,R=6,ze=-24,U=40,q=20,G=4,De=({id:t,sourceX:s,sourceY:d,targetX:a,targetY:r,source:o,target:x,data:n})=>{const[i,f,y]=l.getStraightPath({sourceX:s,sourceY:d,targetX:a,targetY:r}),g=n==null?void 0:n.label,j=g==="Pass",p=j||g==="Fail",c=n==null?void 0:n.onAddStepClick,N=(n==null?void 0:n.showPlus)!==!1&&!!c,m=b=>{b.stopPropagation(),typeof c=="function"&&c(o,{edgeId:t,nodeId:o,sourceNodeId:o,targetNodeId:x,position:"between",referenceNodeId:o,referenceNodeType:n==null?void 0:n.referenceNodeType,stepVisibility:n==null?void 0:n.stepVisibility})},k=b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),m(b))};return e.jsxs("g",{className:"edge-with-plus-wrapper",children:[e.jsx(l.BaseEdge,{id:t,path:i,style:{stroke:"#b0bec5"}}),e.jsxs("g",{className:"nodrag nopan edge-plus-svg",transform:`translate(${f}, ${y})`,style:{cursor:c?"pointer":"default",pointerEvents:"all",outline:"none"},onClick:c?m:void 0,onKeyDown:c?k:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,children:[p&&e.jsxs("g",{transform:`translate(0, ${N?ze:0})`,children:[e.jsx("rect",{x:-U/2,y:-q/2,width:U,height:q,rx:G,ry:G,fill:j?"#ADE6C5":"#FDBFBF"}),e.jsx("text",{textAnchor:"middle",dominantBaseline:"central",fill:j?"#1DBF60":"#C50000",style:{fontSize:12,fontWeight:500},children:g})]}),N&&e.jsxs("g",{className:"plus-icon-container",children:[e.jsx("circle",{r:Ie,className:"edge-plus-circle"}),e.jsx("line",{x1:0,y1:-R,x2:0,y2:R,strokeWidth:K,strokeLinecap:"round",className:"plus-line"}),e.jsx("line",{x1:-R,y1:0,x2:R,y2:0,strokeWidth:K,strokeLinecap:"round",className:"plus-line"})]}),N&&e.jsxs("g",{className:"edge-plus-tooltip",transform:"translate(22, 0)",children:[e.jsx("rect",{x:0,y:-10,width:65,height:20,rx:4,className:"tooltip-bg"}),e.jsx("path",{d:"M0 -4 L-4 0 L0 4 Z",className:"tooltip-bg"}),e.jsx("text",{x:32,y:0,textAnchor:"middle",dominantBaseline:"central",fill:"white",style:{fontSize:10,fontWeight:600,pointerEvents:"none"},children:"Add Step"})]})]})]})},Ae=({id:t,source:s,target:d,sourceX:a,sourceY:r,targetX:o,targetY:x,style:n={},markerEnd:i,data:f})=>{const y=(f==null?void 0:f.verticalRouting)??!1,g=30,j=y?(()=>{const v=x-g;return`M ${a},${v} L ${o},${v} L ${o},${x}`})():(()=>{const v=r+30;return`M ${a},${r} L ${a},${v} L ${o},${v} L ${o},${x}`})(),p=n.stroke||"#d1d5db",c=f==null?void 0:f.label,N=(f==null?void 0:f.isFirst)??!1,m=f==null?void 0:f.onAddStepClick,k=y?x-g:r+30,b=a+(o-a)*(y?.25:.35),P=a+(o-a)*(y?.65:.7),u=k,T=v=>{v.stopPropagation(),m&&m(s,{edgeId:t,nodeId:s,sourceNodeId:s,targetNodeId:d,position:"between",referenceNodeId:s,filterId:f==null?void 0:f.filterId,branch:f==null?void 0:f.branch})},I=11.5,S=6;return e.jsxs("g",{children:[e.jsx("path",{id:t,d:j,fill:"none",stroke:p,strokeWidth:1.5,markerEnd:i}),c&&!y&&e.jsx("g",{transform:`translate(${b}, ${u})`,children:(()=>{const v=Math.max(44,c.length*7+20);return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:-v/2,y:-11,width:v,height:22,rx:11,fill:N?"#e8f5e9":"#ffebee",stroke:N?"#81c784":"#e57373",strokeWidth:1}),e.jsx("text",{x:0,y:4,textAnchor:"middle",fontSize:10,fontWeight:600,fill:N?"#2e7d32":"#c62828",style:{fontFamily:"sans-serif",pointerEvents:"none"},children:c})]})})()}),m&&e.jsxs("g",{transform:`translate(${P}, ${u})`,onClick:T,style:{cursor:"pointer",pointerEvents:"all"},className:"nodrag nopan edge-plus-svg",children:[e.jsx("circle",{r:I,className:"edge-plus-circle"}),e.jsx("line",{x1:0,y1:-S,x2:0,y2:S,strokeWidth:2,strokeLinecap:"round",className:"plus-line"}),e.jsx("line",{x1:-S,y1:0,x2:S,y2:0,strokeWidth:2,strokeLinecap:"round",className:"plus-line"})]})]})};exports.ActionNode=ne;exports.AddTriggerNode=Q;exports.ApprovalNode=se;exports.DelayNode=ie;exports.EdgeWithPlusLabel=Ee;exports.EndNode=J;exports.FilterNode=te;exports.GatewayBranchEdge=Ae;exports.LabelPlusEdge=De;exports.NotificationNode=oe;exports.PlainEdge=Ce;exports.PlusEdge=Pe;exports.RestApiNode=re;exports.StartNode=Y;exports.TriggerNode=X;exports.WebhookTriggerNode=le;exports.WorkflowCanvasContext=Z;exports.builtInNodeTypes=we;
|
package/dist/canvas.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./templateSkeletons-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./templateSkeletons-S_rxSXbs.js"),t=require("./messages-O9Tw_XXR.js"),r=require("./bpmn-CcuE2X_Q.js"),e=require("./GatewayBranchEdge-mRo5aZ3f.js");exports.FlowForgeCanvas=o.FlowForgeCanvas;exports.SubWorkflowPreviewDrawer=o.SubWorkflowPreviewDrawer;exports.WorkflowCanvas=o.FlowForgeCanvas;exports.WorkflowExecutionHistory=o.WorkflowExecutionHistory;exports.WorkflowTemplateLibrary=o.WorkflowTemplateLibrary;exports.accessRequestSkeleton=o.accessRequestSkeleton;exports.offboardingSkeleton=o.offboardingSkeleton;exports.userOnboardingSkeleton=o.userOnboardingSkeleton;exports.webhookIntegrationSkeleton=o.webhookIntegrationSkeleton;exports.defaultFlowForgeMessages=t.defaultFlowForgeMessages;exports.loadWorkflowFromBpmn=r.loadWorkflowFromBpmn;exports.saveWorkflowToBpmn=r.saveWorkflowToBpmn;exports.ActionNode=e.ActionNode;exports.ApprovalNode=e.ApprovalNode;exports.EdgeWithPlusLabel=e.EdgeWithPlusLabel;exports.EndNode=e.EndNode;exports.FilterNode=e.FilterNode;exports.RestApiNode=e.RestApiNode;exports.StartNode=e.StartNode;exports.TriggerNode=e.TriggerNode;exports.WebhookTriggerNode=e.WebhookTriggerNode;exports.builtInNodeTypes=e.builtInNodeTypes;
|
package/dist/canvas.d.ts
CHANGED
|
@@ -45,11 +45,13 @@ export declare interface BpmnSaveOptions {
|
|
|
45
45
|
|
|
46
46
|
declare type BranchChain = CanvasSlot_2[];
|
|
47
47
|
|
|
48
|
-
declare type BranchChain_2 =
|
|
48
|
+
declare type BranchChain_2 = CanvasSlot_3[];
|
|
49
|
+
|
|
50
|
+
declare type BranchChain_3 = CanvasSlot[];
|
|
49
51
|
|
|
50
52
|
export declare interface BranchMap {
|
|
51
53
|
[filterId: string]: {
|
|
52
|
-
[branchKey: string]:
|
|
54
|
+
[branchKey: string]: BranchChain_3;
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
57
|
|
|
@@ -59,11 +61,17 @@ declare interface BranchMap_2 {
|
|
|
59
61
|
};
|
|
60
62
|
}
|
|
61
63
|
|
|
64
|
+
declare interface BranchMap_3 {
|
|
65
|
+
[filterId: string]: {
|
|
66
|
+
[branchKey: string]: BranchChain_2;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
62
70
|
export declare const builtInNodeTypes: NodeTypes;
|
|
63
71
|
|
|
64
72
|
export declare interface CanvasSlot {
|
|
65
73
|
id: string;
|
|
66
|
-
kind:
|
|
74
|
+
kind: SlotKind_3;
|
|
67
75
|
reactFlowType: string;
|
|
68
76
|
descriptorType?: string;
|
|
69
77
|
formData?: Record<string, unknown>;
|
|
@@ -87,6 +95,19 @@ declare interface CanvasSlot_2 {
|
|
|
87
95
|
branchLabels?: Record<string, string>;
|
|
88
96
|
}
|
|
89
97
|
|
|
98
|
+
declare interface CanvasSlot_3 {
|
|
99
|
+
id: string;
|
|
100
|
+
kind: SlotKind_2;
|
|
101
|
+
reactFlowType: string;
|
|
102
|
+
descriptorType?: string;
|
|
103
|
+
formData?: Record<string, unknown>;
|
|
104
|
+
nodeData?: Record<string, unknown>;
|
|
105
|
+
deletable?: boolean;
|
|
106
|
+
label?: string;
|
|
107
|
+
/** Maps branch key → display label. e.g. { pass: 'Pass', fail: 'Fail' } */
|
|
108
|
+
branchLabels?: Record<string, string>;
|
|
109
|
+
}
|
|
110
|
+
|
|
90
111
|
/** One column in a per-field condition row */
|
|
91
112
|
declare interface ConditionFieldDef {
|
|
92
113
|
/** Key used to store this column's value in ConditionEntry */
|
|
@@ -309,6 +330,12 @@ declare interface FixedEdge_2 {
|
|
|
309
330
|
target: string;
|
|
310
331
|
}
|
|
311
332
|
|
|
333
|
+
declare interface FixedEdge_3 {
|
|
334
|
+
id: string;
|
|
335
|
+
source: string;
|
|
336
|
+
target: string;
|
|
337
|
+
}
|
|
338
|
+
|
|
312
339
|
declare interface FixedNode {
|
|
313
340
|
id: string;
|
|
314
341
|
type: string;
|
|
@@ -323,6 +350,13 @@ declare interface FixedNode_2 {
|
|
|
323
350
|
deletable?: false;
|
|
324
351
|
}
|
|
325
352
|
|
|
353
|
+
declare interface FixedNode_3 {
|
|
354
|
+
id: string;
|
|
355
|
+
type: string;
|
|
356
|
+
data?: Record<string, unknown>;
|
|
357
|
+
deletable?: false;
|
|
358
|
+
}
|
|
359
|
+
|
|
326
360
|
declare const FlowForgeCanvas: ({ nodeRegistry, templateRegistry, initialValue, nodeTypes: consumerNodeTypes, edgeTypes: consumerEdgeTypes, onSave, readOnly, theme, messages: messageOverrides, canvasOptions, renderTriggerSelector, loadTriggerSources, renderNodePicker, renderNodeConfig, onNodeClick: onNodeClickProp, maxNodes, layoutDirection, executionRecord, onFetchWorkflow, }: FlowForgeCanvasProps) => JSX_2.Element;
|
|
327
361
|
export { FlowForgeCanvas }
|
|
328
362
|
export { FlowForgeCanvas as WorkflowCanvas }
|
|
@@ -446,6 +480,50 @@ export declare interface FlowForgeTheme {
|
|
|
446
480
|
backgroundColor?: string;
|
|
447
481
|
}
|
|
448
482
|
|
|
483
|
+
/**
|
|
484
|
+
* Context passed to `NodeDescriptor.canInsert(ctx)` describing where on the
|
|
485
|
+
* canvas the user clicked "+ Add step". Used by position-aware insertion rules.
|
|
486
|
+
*/
|
|
487
|
+
declare interface InsertContext {
|
|
488
|
+
/** The slot the user clicked under (the one whose "+" edge was clicked). */
|
|
489
|
+
insertAfterSlot: CanvasSlot_2 | null;
|
|
490
|
+
/** Every slot before the insertion point, including the click slot.
|
|
491
|
+
* When inside a branch: spine up to + including the branching parent, then
|
|
492
|
+
* the branch's own slots up to the insertion point. */
|
|
493
|
+
upstreamSlots: CanvasSlot_2[];
|
|
494
|
+
/** Every slot after the insertion point in the same chain. */
|
|
495
|
+
downstreamSlots: CanvasSlot_2[];
|
|
496
|
+
/** Branch context, if the insertion is happening inside a branch. */
|
|
497
|
+
branch: {
|
|
498
|
+
filterId: string;
|
|
499
|
+
branch: string;
|
|
500
|
+
} | null;
|
|
501
|
+
/** The currently active template (the one whose trigger is in use). */
|
|
502
|
+
template: WorkflowTemplate_2 | null;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Context passed to `NodeDescriptor.canInsert(ctx)` describing where on the
|
|
507
|
+
* canvas the user clicked "+ Add step". Used by position-aware insertion rules.
|
|
508
|
+
*/
|
|
509
|
+
declare interface InsertContext_2 {
|
|
510
|
+
/** The slot the user clicked under (the one whose "+" edge was clicked). */
|
|
511
|
+
insertAfterSlot: CanvasSlot | null;
|
|
512
|
+
/** Every slot before the insertion point, including the click slot.
|
|
513
|
+
* When inside a branch: spine up to + including the branching parent, then
|
|
514
|
+
* the branch's own slots up to the insertion point. */
|
|
515
|
+
upstreamSlots: CanvasSlot[];
|
|
516
|
+
/** Every slot after the insertion point in the same chain. */
|
|
517
|
+
downstreamSlots: CanvasSlot[];
|
|
518
|
+
/** Branch context, if the insertion is happening inside a branch. */
|
|
519
|
+
branch: {
|
|
520
|
+
filterId: string;
|
|
521
|
+
branch: string;
|
|
522
|
+
} | null;
|
|
523
|
+
/** The currently active template (the one whose trigger is in use). */
|
|
524
|
+
template: WorkflowTemplate | null;
|
|
525
|
+
}
|
|
526
|
+
|
|
449
527
|
export declare function loadWorkflowFromBpmn(xml: string): WorkflowState;
|
|
450
528
|
|
|
451
529
|
export declare interface NodeDescriptor {
|
|
@@ -479,6 +557,25 @@ export declare interface NodeDescriptor {
|
|
|
479
557
|
* Receives the node's saved formData.
|
|
480
558
|
*/
|
|
481
559
|
renderNode?: (nodeData: Record<string, unknown>) => ReactNode;
|
|
560
|
+
/**
|
|
561
|
+
* Position constraint — this descriptor can be inserted only if at least ONE
|
|
562
|
+
* of the listed tokens appears in the upstream chain of the click site.
|
|
563
|
+
* Tokens can be a descriptorType (e.g. 'createUserTask'), a slot id
|
|
564
|
+
* (e.g. 'event-userCreated'), or a slot kind (e.g. 'triggerFixed').
|
|
565
|
+
* Ignored when `canInsert` is set.
|
|
566
|
+
*/
|
|
567
|
+
insertAfter?: string[];
|
|
568
|
+
/**
|
|
569
|
+
* Symmetric — must appear DOWNSTREAM of the click site. Same token rules
|
|
570
|
+
* as `insertAfter`. Ignored when `canInsert` is set.
|
|
571
|
+
*/
|
|
572
|
+
insertBefore?: string[];
|
|
573
|
+
/**
|
|
574
|
+
* Full custom rule. Overrides `insertAfter` / `insertBefore`. Receives the
|
|
575
|
+
* click context (upstream/downstream slots, branch info, active template);
|
|
576
|
+
* returns `true` to allow the descriptor at this insertion point.
|
|
577
|
+
*/
|
|
578
|
+
canInsert?: (ctx: InsertContext_2) => boolean;
|
|
482
579
|
/** Maps branch key → display label. e.g. { pass: 'Pass', fail: 'Fail' }. Only applies to branching nodes (filterNode, approvalNode). */
|
|
483
580
|
branchLabels?: Record<string, string>;
|
|
484
581
|
formSchema: FieldDescriptor_2[] | ((nodeId: string) => Promise<FieldDescriptor_2[]>);
|
|
@@ -517,6 +614,25 @@ declare interface NodeDescriptor_2 {
|
|
|
517
614
|
* Receives the node's saved formData.
|
|
518
615
|
*/
|
|
519
616
|
renderNode?: (nodeData: Record<string, unknown>) => ReactNode;
|
|
617
|
+
/**
|
|
618
|
+
* Position constraint — this descriptor can be inserted only if at least ONE
|
|
619
|
+
* of the listed tokens appears in the upstream chain of the click site.
|
|
620
|
+
* Tokens can be a descriptorType (e.g. 'createUserTask'), a slot id
|
|
621
|
+
* (e.g. 'event-userCreated'), or a slot kind (e.g. 'triggerFixed').
|
|
622
|
+
* Ignored when `canInsert` is set.
|
|
623
|
+
*/
|
|
624
|
+
insertAfter?: string[];
|
|
625
|
+
/**
|
|
626
|
+
* Symmetric — must appear DOWNSTREAM of the click site. Same token rules
|
|
627
|
+
* as `insertAfter`. Ignored when `canInsert` is set.
|
|
628
|
+
*/
|
|
629
|
+
insertBefore?: string[];
|
|
630
|
+
/**
|
|
631
|
+
* Full custom rule. Overrides `insertAfter` / `insertBefore`. Receives the
|
|
632
|
+
* click context (upstream/downstream slots, branch info, active template);
|
|
633
|
+
* returns `true` to allow the descriptor at this insertion point.
|
|
634
|
+
*/
|
|
635
|
+
canInsert?: (ctx: InsertContext) => boolean;
|
|
520
636
|
/** Maps branch key → display label. e.g. { pass: 'Pass', fail: 'Fail' }. Only applies to branching nodes (filterNode, approvalNode). */
|
|
521
637
|
branchLabels?: Record<string, string>;
|
|
522
638
|
formSchema: FieldDescriptor[] | ((nodeId: string) => Promise<FieldDescriptor[]>);
|
|
@@ -542,6 +658,8 @@ declare type SlotKind = 'start' | 'end' | 'addTrigger' | 'triggerFixed' | 'userT
|
|
|
542
658
|
|
|
543
659
|
declare type SlotKind_2 = 'start' | 'end' | 'addTrigger' | 'triggerFixed' | 'userTask' | 'addStep' | 'filter' | 'approval';
|
|
544
660
|
|
|
661
|
+
declare type SlotKind_3 = 'start' | 'end' | 'addTrigger' | 'triggerFixed' | 'userTask' | 'addStep' | 'filter' | 'approval';
|
|
662
|
+
|
|
545
663
|
export declare const StartNode: () => JSX_2.Element;
|
|
546
664
|
|
|
547
665
|
export declare type StepStatus = 'pending' | 'running' | 'success' | 'failed' | 'skipped';
|
|
@@ -559,12 +677,12 @@ declare interface SubWorkflowPreviewDrawerProps {
|
|
|
559
677
|
|
|
560
678
|
declare class TemplateRegistry {
|
|
561
679
|
private templates;
|
|
562
|
-
register(template:
|
|
563
|
-
lookup(triggerKey: string):
|
|
564
|
-
list():
|
|
565
|
-
listByCategory(category: string):
|
|
566
|
-
listByTag(tag: string):
|
|
567
|
-
search(query: string):
|
|
680
|
+
register(template: WorkflowTemplate_3): this;
|
|
681
|
+
lookup(triggerKey: string): WorkflowTemplate_3 | undefined;
|
|
682
|
+
list(): WorkflowTemplate_3[];
|
|
683
|
+
listByCategory(category: string): WorkflowTemplate_3[];
|
|
684
|
+
listByTag(tag: string): WorkflowTemplate_3[];
|
|
685
|
+
search(query: string): WorkflowTemplate_3[];
|
|
568
686
|
categories(): string[];
|
|
569
687
|
}
|
|
570
688
|
|
|
@@ -597,6 +715,11 @@ declare interface WorkflowState_2 {
|
|
|
597
715
|
branches: BranchMap_2;
|
|
598
716
|
}
|
|
599
717
|
|
|
718
|
+
declare interface WorkflowState_3 {
|
|
719
|
+
slots: CanvasSlot_3[];
|
|
720
|
+
branches: BranchMap_3;
|
|
721
|
+
}
|
|
722
|
+
|
|
600
723
|
export declare interface WorkflowTemplate {
|
|
601
724
|
triggerKey: string;
|
|
602
725
|
label: string;
|
|
@@ -606,8 +729,8 @@ export declare interface WorkflowTemplate {
|
|
|
606
729
|
availableTasks?: string[];
|
|
607
730
|
maxTasks?: number;
|
|
608
731
|
taskLabels?: Record<string, string>;
|
|
609
|
-
fixedNodes?:
|
|
610
|
-
fixedEdges?:
|
|
732
|
+
fixedNodes?: FixedNode_3[];
|
|
733
|
+
fixedEdges?: FixedEdge_3[];
|
|
611
734
|
insertionPoints?: string[];
|
|
612
735
|
source?: string;
|
|
613
736
|
product?: string;
|
|
@@ -649,6 +772,32 @@ declare interface WorkflowTemplate_2 {
|
|
|
649
772
|
popularity?: number;
|
|
650
773
|
}
|
|
651
774
|
|
|
775
|
+
declare interface WorkflowTemplate_3 {
|
|
776
|
+
triggerKey: string;
|
|
777
|
+
label: string;
|
|
778
|
+
description?: string;
|
|
779
|
+
icon?: ReactNode;
|
|
780
|
+
triggerCategory?: 'event' | 'scheduler' | 'webhook' | string;
|
|
781
|
+
availableTasks?: string[];
|
|
782
|
+
maxTasks?: number;
|
|
783
|
+
taskLabels?: Record<string, string>;
|
|
784
|
+
fixedNodes?: FixedNode_2[];
|
|
785
|
+
fixedEdges?: FixedEdge_2[];
|
|
786
|
+
insertionPoints?: string[];
|
|
787
|
+
source?: string;
|
|
788
|
+
product?: string;
|
|
789
|
+
/** Pre-built workflow state to clone when user selects this template */
|
|
790
|
+
skeletonState?: WorkflowState_3;
|
|
791
|
+
/** Tags for filtering in the template library */
|
|
792
|
+
tags?: string[];
|
|
793
|
+
/** Category grouping in the library */
|
|
794
|
+
category?: string;
|
|
795
|
+
/** Team or author that owns this template */
|
|
796
|
+
author?: string;
|
|
797
|
+
/** Relative popularity score (higher = shown first in library) */
|
|
798
|
+
popularity?: number;
|
|
799
|
+
}
|
|
800
|
+
|
|
652
801
|
export declare const WorkflowTemplateLibrary: default_2.FC<WorkflowTemplateLibraryProps>;
|
|
653
802
|
|
|
654
803
|
declare interface WorkflowTemplateLibraryProps {
|
package/dist/canvas.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { F as a, S as s, F as r, W as t, a as l, b as n, o as d, u as i, w as f } from "./templateSkeletons-
|
|
1
|
+
import { F as a, S as s, F as r, W as t, a as l, b as n, o as d, u as i, w as f } from "./templateSkeletons-BXebwps_.js";
|
|
2
2
|
import { d as w } from "./messages-CO299wPN.js";
|
|
3
3
|
import { l as p, s as b } from "./bpmn-CtfWDaOY.js";
|
|
4
|
-
import { A as F, b as N, E as m, c as u, F as S, R as T, S as c, T as v, W as x, e as A } from "./GatewayBranchEdge-
|
|
4
|
+
import { A as F, b as N, E as m, c as u, F as S, R as T, S as c, T as v, W as x, e as A } from "./GatewayBranchEdge-4XMPBHne.js";
|
|
5
5
|
export {
|
|
6
6
|
F as ActionNode,
|
|
7
7
|
N as ApprovalNode,
|
package/dist/core.d.ts
CHANGED
|
@@ -187,6 +187,28 @@ export declare interface FlowForgeMessages {
|
|
|
187
187
|
cancel: string;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
/**
|
|
191
|
+
* Context passed to `NodeDescriptor.canInsert(ctx)` describing where on the
|
|
192
|
+
* canvas the user clicked "+ Add step". Used by position-aware insertion rules.
|
|
193
|
+
*/
|
|
194
|
+
declare interface InsertContext {
|
|
195
|
+
/** The slot the user clicked under (the one whose "+" edge was clicked). */
|
|
196
|
+
insertAfterSlot: CanvasSlot | null;
|
|
197
|
+
/** Every slot before the insertion point, including the click slot.
|
|
198
|
+
* When inside a branch: spine up to + including the branching parent, then
|
|
199
|
+
* the branch's own slots up to the insertion point. */
|
|
200
|
+
upstreamSlots: CanvasSlot[];
|
|
201
|
+
/** Every slot after the insertion point in the same chain. */
|
|
202
|
+
downstreamSlots: CanvasSlot[];
|
|
203
|
+
/** Branch context, if the insertion is happening inside a branch. */
|
|
204
|
+
branch: {
|
|
205
|
+
filterId: string;
|
|
206
|
+
branch: string;
|
|
207
|
+
} | null;
|
|
208
|
+
/** The currently active template (the one whose trigger is in use). */
|
|
209
|
+
template: WorkflowTemplate | null;
|
|
210
|
+
}
|
|
211
|
+
|
|
190
212
|
export declare function loadWorkflowFromBpmn(xml: string): WorkflowState;
|
|
191
213
|
|
|
192
214
|
export declare function makeSubWorkflowDescriptor(opts?: SubWorkflowDescriptorOptions): NodeDescriptor;
|
|
@@ -222,6 +244,25 @@ export declare interface NodeDescriptor {
|
|
|
222
244
|
* Receives the node's saved formData.
|
|
223
245
|
*/
|
|
224
246
|
renderNode?: (nodeData: Record<string, unknown>) => ReactNode;
|
|
247
|
+
/**
|
|
248
|
+
* Position constraint — this descriptor can be inserted only if at least ONE
|
|
249
|
+
* of the listed tokens appears in the upstream chain of the click site.
|
|
250
|
+
* Tokens can be a descriptorType (e.g. 'createUserTask'), a slot id
|
|
251
|
+
* (e.g. 'event-userCreated'), or a slot kind (e.g. 'triggerFixed').
|
|
252
|
+
* Ignored when `canInsert` is set.
|
|
253
|
+
*/
|
|
254
|
+
insertAfter?: string[];
|
|
255
|
+
/**
|
|
256
|
+
* Symmetric — must appear DOWNSTREAM of the click site. Same token rules
|
|
257
|
+
* as `insertAfter`. Ignored when `canInsert` is set.
|
|
258
|
+
*/
|
|
259
|
+
insertBefore?: string[];
|
|
260
|
+
/**
|
|
261
|
+
* Full custom rule. Overrides `insertAfter` / `insertBefore`. Receives the
|
|
262
|
+
* click context (upstream/downstream slots, branch info, active template);
|
|
263
|
+
* returns `true` to allow the descriptor at this insertion point.
|
|
264
|
+
*/
|
|
265
|
+
canInsert?: (ctx: InsertContext) => boolean;
|
|
225
266
|
/** Maps branch key → display label. e.g. { pass: 'Pass', fail: 'Fail' }. Only applies to branching nodes (filterNode, approvalNode). */
|
|
226
267
|
branchLabels?: Record<string, string>;
|
|
227
268
|
formSchema: FieldDescriptor[] | ((nodeId: string) => Promise<FieldDescriptor[]>);
|
package/dist/defaultUi.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./GatewayBranchEdge-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./GatewayBranchEdge-mRo5aZ3f.js");exports.ActionNode=e.ActionNode;exports.AddTriggerNode=e.AddTriggerNode;exports.ApprovalNode=e.ApprovalNode;exports.DelayNode=e.DelayNode;exports.EdgeWithPlusLabel=e.EdgeWithPlusLabel;exports.EndNode=e.EndNode;exports.FilterNode=e.FilterNode;exports.GatewayBranchEdge=e.GatewayBranchEdge;exports.LabelPlusEdge=e.LabelPlusEdge;exports.NotificationNode=e.NotificationNode;exports.PlainEdge=e.PlainEdge;exports.PlusEdge=e.PlusEdge;exports.StartNode=e.StartNode;exports.TriggerNode=e.TriggerNode;exports.builtInNodeTypes=e.builtInNodeTypes;
|
package/dist/defaultUi.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as d, a as s, b as o, D as N, E as i, c as l, F as r, G as t, L as g, N as E, P as n, d as P, S as b, T as c, e as p } from "./GatewayBranchEdge-
|
|
1
|
+
import { A as d, a as s, b as o, D as N, E as i, c as l, F as r, G as t, L as g, N as E, P as n, d as P, S as b, T as c, e as p } from "./GatewayBranchEdge-4XMPBHne.js";
|
|
2
2
|
export {
|
|
3
3
|
d as ActionNode,
|
|
4
4
|
s as AddTriggerNode,
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DNZlQp9z.js"),a=require("./SchemaBuilderDrawer-jbSe-O-O.js");require("react/jsx-runtime");require("react");require("@mui/material");require("react-icons/md");const r=require("./nodeRegistry.cjs"),l=require("./templateRegistry.cjs"),i=require("./templateSkeletons-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DNZlQp9z.js"),a=require("./SchemaBuilderDrawer-jbSe-O-O.js");require("react/jsx-runtime");require("react");require("@mui/material");require("react-icons/md");const r=require("./nodeRegistry.cjs"),l=require("./templateRegistry.cjs"),i=require("./templateSkeletons-S_rxSXbs.js"),d=require("./messages-O9Tw_XXR.js"),n=require("./bpmn-CcuE2X_Q.js"),o=require("./GatewayBranchEdge-mRo5aZ3f.js");class u{constructor(){this.channels=new Map}register(t,s){this.channels.set(t,s)}get(t){return this.channels.get(t)}list(){return Array.from(this.channels.entries()).map(([t,s])=>({key:t,...s}))}has(t){return this.channels.has(t)}}const c=new u;exports.DynamicFormRenderer=e.DynamicFormRenderer;exports.FF=e.FF;exports.FlowForgeRegistry=e.FlowForgeRegistry;exports.FlowForm=e.FlowForm;exports.FormulaInput=e.FormulaInput;exports.InfiniteSelectField=e.InfiniteSelectField;exports.TablePickerField=e.TablePickerField;exports.VariablePicker=e.VariablePicker;exports.VariablePickerProvider=e.VariablePickerProvider;exports.astHasRefs=e.astHasRefs;exports.astToTokens=e.astToTokens;exports.buildEvaluationPayload=e.buildEvaluationPayload;exports.buildFieldConfig=e.buildFieldConfig;exports.buildFormulaPath=e.buildFormulaPath;exports.buildSelectStyles=e.buildSelectStyles;exports.buildValidationSchema=e.buildValidationSchema;exports.dataSourceRegistry=e.dataSourceRegistry;exports.errorTextStyle=e.errorTextStyle;exports.extractLabel=e.extractLabel;exports.fieldRegistry=e.fieldRegistry;exports.hasFormulaTokens=e.hasFormulaTokens;exports.helperTextStyle=e.helperTextStyle;exports.inputStyle=e.inputStyle;exports.isFormula=e.isFormula;exports.parseToAST=e.parseToAST;exports.serializeAST=e.serializeAST;exports.serializeASTAsConfig=e.serializeASTAsConfig;exports.serializeConditionExpressions=e.serializeConditionExpressions;exports.stripFormulaTokens=e.stripFormulaTokens;exports.tokenize=e.tokenize;exports.unwrapFormula=e.unwrapFormula;exports.useVariablePickerContext=e.useVariablePickerContext;exports.wrapFormula=e.wrapFormula;exports.FIELD_TYPE_OPTIONS=a.FIELD_TYPE_OPTIONS;exports.SchemaBuilder=a.SchemaBuilder;exports.SchemaBuilderDrawer=a.SchemaBuilderDrawer;exports.useFlowForm=a.useFlowForm;exports.NodeTypeRegistry=r.NodeTypeRegistry;exports.baseNodeDefaults=r.baseNodeDefaults;exports.conditionBranchDescriptor=r.conditionBranchDescriptor;exports.defineNode=r.defineNode;exports.endEventDescriptor=r.endEventDescriptor;exports.makeSubWorkflowDescriptor=r.makeSubWorkflowDescriptor;exports.nodeTypeRegistry=r.nodeTypeRegistry;exports.notificationDescriptor=r.notificationDescriptor;exports.restApiDescriptor=r.restApiDescriptor;exports.startEventDescriptor=r.startEventDescriptor;exports.subWorkflowDescriptor=r.subWorkflowDescriptor;exports.webhookTriggerDescriptor=r.webhookTriggerDescriptor;exports.webhookTriggerTemplate=r.webhookTriggerTemplate;exports.TemplateRegistry=l.TemplateRegistry;exports.templateRegistry=l.templateRegistry;exports.FlowForgeCanvas=i.FlowForgeCanvas;exports.SubWorkflowPreviewDrawer=i.SubWorkflowPreviewDrawer;exports.WorkflowCanvas=i.FlowForgeCanvas;exports.WorkflowExecutionHistory=i.WorkflowExecutionHistory;exports.WorkflowTemplateLibrary=i.WorkflowTemplateLibrary;exports.accessRequestSkeleton=i.accessRequestSkeleton;exports.offboardingSkeleton=i.offboardingSkeleton;exports.userOnboardingSkeleton=i.userOnboardingSkeleton;exports.webhookIntegrationSkeleton=i.webhookIntegrationSkeleton;exports.defaultFlowForgeMessages=d.defaultFlowForgeMessages;exports.loadWorkflowFromBpmn=n.loadWorkflowFromBpmn;exports.saveWorkflowToBpmn=n.saveWorkflowToBpmn;exports.ActionNode=o.ActionNode;exports.ApprovalNode=o.ApprovalNode;exports.EdgeWithPlusLabel=o.EdgeWithPlusLabel;exports.EndNode=o.EndNode;exports.FilterNode=o.FilterNode;exports.RestApiNode=o.RestApiNode;exports.StartNode=o.StartNode;exports.TriggerNode=o.TriggerNode;exports.WebhookTriggerNode=o.WebhookTriggerNode;exports.builtInNodeTypes=o.builtInNodeTypes;exports.notificationChannelRegistry=c;
|
package/dist/index.d.ts
CHANGED
|
@@ -824,6 +824,28 @@ export declare function inputStyle(opts: {
|
|
|
824
824
|
extraStyle?: React.CSSProperties;
|
|
825
825
|
}): React.CSSProperties;
|
|
826
826
|
|
|
827
|
+
/**
|
|
828
|
+
* Context passed to `NodeDescriptor.canInsert(ctx)` describing where on the
|
|
829
|
+
* canvas the user clicked "+ Add step". Used by position-aware insertion rules.
|
|
830
|
+
*/
|
|
831
|
+
declare interface InsertContext {
|
|
832
|
+
/** The slot the user clicked under (the one whose "+" edge was clicked). */
|
|
833
|
+
insertAfterSlot: CanvasSlot | null;
|
|
834
|
+
/** Every slot before the insertion point, including the click slot.
|
|
835
|
+
* When inside a branch: spine up to + including the branching parent, then
|
|
836
|
+
* the branch's own slots up to the insertion point. */
|
|
837
|
+
upstreamSlots: CanvasSlot[];
|
|
838
|
+
/** Every slot after the insertion point in the same chain. */
|
|
839
|
+
downstreamSlots: CanvasSlot[];
|
|
840
|
+
/** Branch context, if the insertion is happening inside a branch. */
|
|
841
|
+
branch: {
|
|
842
|
+
filterId: string;
|
|
843
|
+
branch: string;
|
|
844
|
+
} | null;
|
|
845
|
+
/** The currently active template (the one whose trigger is in use). */
|
|
846
|
+
template: WorkflowTemplate | null;
|
|
847
|
+
}
|
|
848
|
+
|
|
827
849
|
export declare function isFormula(value: unknown): value is string;
|
|
828
850
|
|
|
829
851
|
export declare interface LoadPageParams {
|
|
@@ -872,6 +894,25 @@ export declare interface NodeDescriptor {
|
|
|
872
894
|
* Receives the node's saved formData.
|
|
873
895
|
*/
|
|
874
896
|
renderNode?: (nodeData: Record<string, unknown>) => ReactNode;
|
|
897
|
+
/**
|
|
898
|
+
* Position constraint — this descriptor can be inserted only if at least ONE
|
|
899
|
+
* of the listed tokens appears in the upstream chain of the click site.
|
|
900
|
+
* Tokens can be a descriptorType (e.g. 'createUserTask'), a slot id
|
|
901
|
+
* (e.g. 'event-userCreated'), or a slot kind (e.g. 'triggerFixed').
|
|
902
|
+
* Ignored when `canInsert` is set.
|
|
903
|
+
*/
|
|
904
|
+
insertAfter?: string[];
|
|
905
|
+
/**
|
|
906
|
+
* Symmetric — must appear DOWNSTREAM of the click site. Same token rules
|
|
907
|
+
* as `insertAfter`. Ignored when `canInsert` is set.
|
|
908
|
+
*/
|
|
909
|
+
insertBefore?: string[];
|
|
910
|
+
/**
|
|
911
|
+
* Full custom rule. Overrides `insertAfter` / `insertBefore`. Receives the
|
|
912
|
+
* click context (upstream/downstream slots, branch info, active template);
|
|
913
|
+
* returns `true` to allow the descriptor at this insertion point.
|
|
914
|
+
*/
|
|
915
|
+
canInsert?: (ctx: InsertContext) => boolean;
|
|
875
916
|
/** Maps branch key → display label. e.g. { pass: 'Pass', fail: 'Fail' }. Only applies to branching nodes (filterNode, approvalNode). */
|
|
876
917
|
branchLabels?: Record<string, string>;
|
|
877
918
|
formSchema: FieldDescriptor[] | ((nodeId: string) => Promise<FieldDescriptor[]>);
|
package/dist/index.js
CHANGED
|
@@ -6,10 +6,10 @@ import "@mui/material";
|
|
|
6
6
|
import "react-icons/md";
|
|
7
7
|
import { NodeTypeRegistry as U, baseNodeDefaults as X, conditionBranchDescriptor as Z, defineNode as $, endEventDescriptor as ee, makeSubWorkflowDescriptor as ae, nodeTypeRegistry as se, notificationDescriptor as re, restApiDescriptor as oe, startEventDescriptor as te, subWorkflowDescriptor as ie, webhookTriggerDescriptor as le, webhookTriggerTemplate as ne } from "./nodeRegistry.js";
|
|
8
8
|
import { TemplateRegistry as de, templateRegistry as ce } from "./templateRegistry.js";
|
|
9
|
-
import { F as me, S as fe, F as ge, W as Fe, a as he, b as be, o as ke, u as Te, w as we } from "./templateSkeletons-
|
|
9
|
+
import { F as me, S as fe, F as ge, W as Fe, a as he, b as be, o as ke, u as Te, w as we } from "./templateSkeletons-BXebwps_.js";
|
|
10
10
|
import { d as ye } from "./messages-CO299wPN.js";
|
|
11
11
|
import { l as De, s as Ne } from "./bpmn-CtfWDaOY.js";
|
|
12
|
-
import { A as We, b as Ae, E as Pe, c as ve, F as Ee, R as Ce, S as Ie, T as Be, W as ze, e as Ve } from "./GatewayBranchEdge-
|
|
12
|
+
import { A as We, b as Ae, E as Pe, c as ve, F as Ee, R as Ce, S as Ie, T as Be, W as ze, e as Ve } from "./GatewayBranchEdge-4XMPBHne.js";
|
|
13
13
|
class s {
|
|
14
14
|
constructor() {
|
|
15
15
|
this.channels = /* @__PURE__ */ new Map();
|
package/dist/nodeRegistry.d.ts
CHANGED
|
@@ -164,6 +164,28 @@ declare interface FixedNode {
|
|
|
164
164
|
deletable?: false;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Context passed to `NodeDescriptor.canInsert(ctx)` describing where on the
|
|
169
|
+
* canvas the user clicked "+ Add step". Used by position-aware insertion rules.
|
|
170
|
+
*/
|
|
171
|
+
declare interface InsertContext {
|
|
172
|
+
/** The slot the user clicked under (the one whose "+" edge was clicked). */
|
|
173
|
+
insertAfterSlot: CanvasSlot | null;
|
|
174
|
+
/** Every slot before the insertion point, including the click slot.
|
|
175
|
+
* When inside a branch: spine up to + including the branching parent, then
|
|
176
|
+
* the branch's own slots up to the insertion point. */
|
|
177
|
+
upstreamSlots: CanvasSlot[];
|
|
178
|
+
/** Every slot after the insertion point in the same chain. */
|
|
179
|
+
downstreamSlots: CanvasSlot[];
|
|
180
|
+
/** Branch context, if the insertion is happening inside a branch. */
|
|
181
|
+
branch: {
|
|
182
|
+
filterId: string;
|
|
183
|
+
branch: string;
|
|
184
|
+
} | null;
|
|
185
|
+
/** The currently active template (the one whose trigger is in use). */
|
|
186
|
+
template: WorkflowTemplate | null;
|
|
187
|
+
}
|
|
188
|
+
|
|
167
189
|
export declare function makeSubWorkflowDescriptor(opts?: SubWorkflowDescriptorOptions): NodeDescriptor;
|
|
168
190
|
|
|
169
191
|
export declare interface NodeDescriptor {
|
|
@@ -197,6 +219,25 @@ export declare interface NodeDescriptor {
|
|
|
197
219
|
* Receives the node's saved formData.
|
|
198
220
|
*/
|
|
199
221
|
renderNode?: (nodeData: Record<string, unknown>) => ReactNode;
|
|
222
|
+
/**
|
|
223
|
+
* Position constraint — this descriptor can be inserted only if at least ONE
|
|
224
|
+
* of the listed tokens appears in the upstream chain of the click site.
|
|
225
|
+
* Tokens can be a descriptorType (e.g. 'createUserTask'), a slot id
|
|
226
|
+
* (e.g. 'event-userCreated'), or a slot kind (e.g. 'triggerFixed').
|
|
227
|
+
* Ignored when `canInsert` is set.
|
|
228
|
+
*/
|
|
229
|
+
insertAfter?: string[];
|
|
230
|
+
/**
|
|
231
|
+
* Symmetric — must appear DOWNSTREAM of the click site. Same token rules
|
|
232
|
+
* as `insertAfter`. Ignored when `canInsert` is set.
|
|
233
|
+
*/
|
|
234
|
+
insertBefore?: string[];
|
|
235
|
+
/**
|
|
236
|
+
* Full custom rule. Overrides `insertAfter` / `insertBefore`. Receives the
|
|
237
|
+
* click context (upstream/downstream slots, branch info, active template);
|
|
238
|
+
* returns `true` to allow the descriptor at this insertion point.
|
|
239
|
+
*/
|
|
240
|
+
canInsert?: (ctx: InsertContext) => boolean;
|
|
200
241
|
/** Maps branch key → display label. e.g. { pass: 'Pass', fail: 'Fail' }. Only applies to branching nodes (filterNode, approvalNode). */
|
|
201
242
|
branchLabels?: Record<string, string>;
|
|
202
243
|
formSchema: FieldDescriptor[] | ((nodeId: string) => Promise<FieldDescriptor[]>);
|