@synertech/ui 0.55.0 → 0.56.1
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/.claude/skills/use-synertech-ui/SKILL.md +66 -3
- package/README.md +55 -187
- package/dist/components/accordion/Accordion.cjs +1 -1
- package/dist/components/accordion/Accordion.js +1 -1
- package/dist/components/area-chart/AreaChart.cjs +1 -1
- package/dist/components/area-chart/AreaChart.js +1 -1
- package/dist/components/chart/ChartExportButton.cjs +1 -1
- package/dist/components/chart/ChartExportButton.js +1 -1
- package/dist/components/datagrid/ActiveFilters.cjs +1 -0
- package/dist/components/datagrid/ActiveFilters.js +1 -0
- package/dist/components/datagrid/BulkActionsBar.cjs +1 -0
- package/dist/components/datagrid/BulkActionsBar.js +1 -0
- package/dist/components/datagrid/ColumnToggle.cjs +1 -0
- package/dist/components/datagrid/ColumnToggle.js +1 -0
- package/dist/components/datagrid/DataGrid.cjs +1 -1
- package/dist/components/datagrid/DataGrid.js +1 -1
- package/dist/components/datagrid/DataGridPagination.cjs +1 -0
- package/dist/components/datagrid/DataGridPagination.js +1 -0
- package/dist/components/datagrid/EditableCell.cjs +1 -0
- package/dist/components/datagrid/EditableCell.js +1 -0
- package/dist/components/datagrid/FilterPopover.cjs +1 -0
- package/dist/components/datagrid/FilterPopover.js +1 -0
- package/dist/components/datagrid/export.cjs +1 -0
- package/dist/components/datagrid/export.js +1 -0
- package/dist/components/datagrid/icons.cjs +1 -0
- package/dist/components/datagrid/icons.js +1 -0
- package/dist/components/datagrid/index.cjs +1 -1
- package/dist/components/datagrid/types.cjs +1 -0
- package/dist/components/datagrid/types.js +0 -0
- package/dist/components/datagrid/utils.cjs +1 -0
- package/dist/components/datagrid/utils.js +1 -0
- package/dist/components/dropdown/DropdownContent.cjs +1 -1
- package/dist/components/dropdown/DropdownContent.js +1 -1
- package/dist/components/dropdown/DropdownSubMenu.cjs +1 -1
- package/dist/components/dropdown/DropdownSubMenu.js +1 -1
- package/dist/components/dropdown/hooks/usePositioning.cjs +1 -1
- package/dist/components/dropdown/hooks/usePositioning.js +1 -1
- package/dist/components/form/mention-input/MentionInput.cjs +5 -5
- package/dist/components/form/mention-input/MentionInput.js +5 -5
- package/dist/components/help-button/HelpButton.cjs +2 -2
- package/dist/components/help-button/HelpButton.js +2 -2
- package/dist/components/indicator/Indicator.cjs +1 -1
- package/dist/components/indicator/Indicator.js +1 -1
- package/dist/components/line-chart/LineChart.cjs +1 -1
- package/dist/components/line-chart/LineChart.js +1 -1
- package/dist/components/progress-bar/ProgressBar.cjs +1 -1
- package/dist/components/progress-bar/ProgressBar.js +1 -1
- package/dist/components/schema-editor/SchemaEditor.cjs +1 -1
- package/dist/components/schema-editor/SchemaEditor.js +1 -1
- package/dist/components/select/Select.cjs +1 -1
- package/dist/components/select/Select.js +1 -1
- package/dist/components/skeleton/Skeleton.cjs +1 -1
- package/dist/components/skeleton/Skeleton.js +1 -1
- package/dist/components/workflow-editor/WorkflowEditor.cjs +1 -1
- package/dist/components/workflow-editor/WorkflowEditor.js +1 -1
- package/dist/index.d.cts +158 -8
- package/dist/index.d.ts +158 -8
- package/dist/lib/ui-labels.cjs +1 -1
- package/dist/lib/ui-labels.js +1 -1
- package/dist/styles-no-preflight.css +935 -891
- package/dist/styles.css +935 -891
- package/package.json +26 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var Dt=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var Ee=Object.prototype.hasOwnProperty;var ve=(R,I)=>{for(var Y in I)Dt(R,Y,{get:I[Y],enumerable:!0})},ye=(R,I,Y,X)=>{if(I&&typeof I=="object"||typeof I=="function")for(let v of we(I))!Ee.call(R,v)&&v!==Y&&Dt(R,v,{get:()=>I[v],enumerable:!(X=ge(I,v))||X.enumerable});return R};var ke=R=>ye(Dt({},"__esModule",{value:!0}),R);var Pe={};ve(Pe,{WorkflowEditor:()=>jt});module.exports=ke(Pe);var n=require("react"),z=require("../../lib/canvas-events.cjs"),Bt=require("../../lib/cn.cjs"),Tt=require("../../lib/editable-target.cjs"),Q=require("../../lib/i18n.cjs"),Ut=require("../../lib/owner-document.cjs"),Kt=require("./canvas/GridLayer.cjs"),$t=require("./nodes/WorkflowNodeRenderer.cjs"),Gt=require("./edges/WorkflowEdgeRenderer.cjs"),qt=require("./toolbar/WorkflowToolbar.cjs"),a=require("./utils/geometry.cjs"),L=require("./utils/import.cjs"),k=require("react/jsx-runtime"),ht={x:0,y:0,zoom:1},Rt=.1,Ie=.1,De=3,he=20,Re=25;function Te(){return`edge-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function We({value:R,defaultValue:I,onValueChange:Y,nodeRegistry:X,direction:v="horizontal",onDirectionChange:Qt,onNodeClick:Z,onNodeDoubleClick:tt,onNodeContextMenu:et,onNodeAction:B,readOnly:T=!1,disabled:f=!1,draggableNodes:nt=!0,connectable:Wt=!0,selectable:A=!0,multiSelect:Pt=!1,panOnDrag:Nt=!0,zoomOnWheel:Zt=!0,minZoom:x=Ie,maxZoom:S=De,snapToGrid:zt=!1,gridSize:ot=he,showGrid:te=!0,toolbar:ee=!0,autoFit:Xt=!1,labels:ne,className:oe},re){let U=(0,Q.useUILabels)(ne),rt=R!==void 0,[se,ie]=(0,n.useState)(()=>I??{nodes:[],edges:[],viewport:{...ht}}),W=rt?R:se,p=W.nodes,st=W.edges,r=W.viewport??ht,D=(0,n.useRef)(null),O=(0,n.useRef)(null),[K,M]=(0,n.useState)(new Set),[$,H]=(0,n.useState)(null),[P,it]=(0,n.useState)(null),ct=(0,n.useRef)(r);ct.current=r;let lt=(0,n.useRef)(p);lt.current=p;let Yt=(0,n.useRef)(st);Yt.current=st;let xt=(0,n.useRef)(zt);xt.current=zt;let dt=(0,n.useRef)(ot);dt.current=ot;let ut=(0,n.useRef)(X);ut.current=X;let at=(0,n.useRef)(v);at.current=v;let St=(0,n.useRef)(W);St.current=W;let G=(0,n.useRef)(W);G.current=W;let ft=(0,n.useRef)(!1),Mt=(0,n.useRef)(rt);Mt.current=rt;let Vt=(0,n.useRef)(Y);Vt.current=Y;let w=(0,n.useCallback)(t=>{let e=G.current,o=t(e);o!==e&&(G.current=o,Mt.current?ft.current||(ft.current=!0,queueMicrotask(()=>{ft.current=!1,G.current=St.current})):ie(o),Vt.current?.(o))},[]),pt=(0,n.useRef)(w);pt.current=w;let h=(0,n.useCallback)(t=>{w(e=>({...e,viewport:t}))},[w]),Ct=(0,n.useRef)(h);Ct.current=h;let V=(0,n.useCallback)(t=>{let e=(0,L.registryEntry)(X,t.type);return e?.getPorts?e.getPorts(t):t.ports??[]},[X]),q=(0,n.useRef)(V);q.current=V;let bt=(0,n.useCallback)((t,e,o)=>{let s=lt.current,i=Yt.current,l=s.find(u=>u.id===t.fromNodeId),c=s.find(u=>u.id===e);if(!l||!c)return;let m=q.current(l),d=q.current(c),g=m.find(u=>u.id===t.fromPortId),E=d.find(u=>u.id===o);if(!g||!E||E.kind!=="in"||g.disabled||E.disabled||t.fromNodeId===e)return;let N=(0,L.registryEntry)(ut.current,l.type);if(N?.canConnect&&!N.canConnect({fromNode:l,toNode:c,fromPort:g,toPort:E}))return;i.some(u=>u.from.nodeId===t.fromNodeId&&u.from.portId===t.fromPortId&&u.to.nodeId===e&&u.to.portId===o)||pt.current(u=>({...u,edges:[...u.edges,{id:Te(),from:{nodeId:t.fromNodeId,portId:t.fromPortId},to:{nodeId:e,portId:o}}]}))},[]),_=(0,n.useRef)(null),F=(0,n.useRef)(null),C=(0,n.useCallback)(()=>{F.current?.(),F.current=null,O.current=null,_.current=null,it(null)},[]),Lt=(0,n.useCallback)(t=>{let e=t.target instanceof Element?t.target.closest('[data-port-id][data-port-kind="in"]'):null,o=e?.getAttribute("data-node-id"),s=e?.getAttribute("data-port-id");if(o&&s)return{nodeId:o,portId:s};let i=D.current?.getBoundingClientRect();if(!i)return null;let l=(0,a.screenToCanvas)(t.clientX,t.clientY,ct.current,i),c=null,m=Re;for(let d of lt.current){let g=q.current(d);for(let E of g){if(E.kind!=="in")continue;let N=(0,a.getPortAbsolutePosition)(d,E,g,at.current),y=Math.hypot(l.x-N.x,l.y-N.y);y<m&&(m=y,c={nodeId:d.id,portId:E.id})}}return c},[]),mt=(0,n.useCallback)(t=>{let e=O.current;if(!e||t.pointerId!==_.current)return;if(t.buttons===0){C();return}let o=D.current?.getBoundingClientRect();if(!o)return;let s=ct.current;if(e.type==="pan"){let i=t.clientX-e.startX,l=t.clientY-e.startY;Ct.current({...s,x:e.startViewportX+i,y:e.startViewportY+l})}if(e.type==="node"){let i=(0,a.screenToCanvas)(t.clientX,t.clientY,s,o),l=i.x-e.offsetX,c=i.y-e.offsetY;xt.current&&(l=(0,a.snapValue)(l,dt.current),c=(0,a.snapValue)(c,dt.current)),pt.current(m=>({...m,nodes:m.nodes.map(d=>d.id===e.nodeId?{...d,x:l,y:c}:d)}))}if(e.type==="edge"){let i=(0,a.screenToCanvas)(t.clientX,t.clientY,s,o);O.current={...e,currentX:i.x,currentY:i.y},it({fromX:e.fromX,fromY:e.fromY,currentX:i.x,currentY:i.y})}},[C]),gt=(0,n.useCallback)(t=>{let e=O.current;if(!(!e||t.pointerId!==_.current)){if(e.type==="edge"){let o=Lt(t);o&&bt(e,o.nodeId,o.portId)}C()}},[Lt,bt,C]),wt=(0,n.useCallback)(t=>{t.pointerId===_.current&&C()},[C]),j=(0,n.useCallback)((t,e)=>{F.current?.(),O.current=t,_.current=e;let o=(0,Ut.ownerDocumentOf)(D.current);o.addEventListener("pointermove",mt),o.addEventListener("pointerup",gt),o.addEventListener("pointercancel",wt),F.current=()=>{o.removeEventListener("pointermove",mt),o.removeEventListener("pointerup",gt),o.removeEventListener("pointercancel",wt)}},[mt,gt,wt]);(0,n.useEffect)(()=>()=>F.current?.(),[]),(0,z.useCanvasWheel)(D,t=>{if(!Zt||f)return;let e=(0,z.wheelZoomDirection)(t);if(e===null)return;t.preventDefault();let o=D.current?.getBoundingClientRect();if(!o)return;let s=t.clientX-o.left,i=t.clientY-o.top,l=(0,a.clampZoom)(r.zoom+e*Rt,x,S),c=l/r.zoom;h({x:s-(s-r.x)*c,y:i-(i-r.y)*c,zoom:l})});let ce=(0,n.useCallback)(t=>{if(f||!(0,z.isInCanvas)(D.current,t.target))return;let e=(0,z.isPrimaryPress)(t),o=t.target;if(o.closest("[data-action-id]"))return;let i=o.closest("[data-port-id]");if(i){if(!Wt||T||!e)return;t.preventDefault();let c=i.getAttribute("data-node-id"),m=i.getAttribute("data-port-id"),d=i.getAttribute("data-port-kind");if(!c||!m||d!=="out")return;let g=p.find(u=>u.id===c);if(!g)return;let E=V(g),N=E.find(u=>u.id===m);if(!N||N.disabled)return;let y=(0,a.getPortAbsolutePosition)(g,N,E,at.current);j({type:"edge",fromNodeId:c,fromPortId:m,fromX:y.x,fromY:y.y,currentX:y.x,currentY:y.y},t.pointerId),it({fromX:y.x,fromY:y.y,currentX:y.x,currentY:y.y});return}let l=o.closest("[data-node-id]");if(l){if(T)return;let c=l.getAttribute("data-node-id");if(A&&(H(null),Pt&&t.shiftKey?M(m=>{let d=new Set(m);return d.has(c)?d.delete(c):d.add(c),d}):M(new Set([c]))),e&&nt&&!(0,Tt.isEditableTarget)(o)){let m=D.current?.getBoundingClientRect();if(!m)return;let d=p.find(E=>E.id===c);if(!d||d.locked)return;let g=(0,a.screenToCanvas)(t.clientX,t.clientY,r,m);j({type:"node",nodeId:c,startX:g.x,startY:g.y,offsetX:g.x-d.x,offsetY:g.y-d.y},t.pointerId)}return}A&&(M(new Set),H(null)),Nt&&e&&j({type:"pan",startX:t.clientX,startY:t.clientY,startViewportX:r.x,startViewportY:r.y},t.pointerId)},[f,Wt,T,A,Pt,nt,Nt,r,p,V,j]),b=(0,n.useCallback)(t=>{let e=t.target;if(e.closest("[data-port-id]")||e.closest("[data-action-id]"))return null;let i=e.closest("[data-node-id]");if(!i)return null;let l=i.getAttribute("data-node-id");return p.find(c=>c.id===l)??null},[p]),le=(0,n.useCallback)(t=>{if(!Z||f)return;let e=b(t);e&&Z({node:e,nativeEvent:t.nativeEvent})},[Z,f,b]),de=(0,n.useCallback)(t=>{if(!tt||f)return;let e=b(t);e&&tt({node:e,nativeEvent:t.nativeEvent})},[tt,f,b]),ue=(0,n.useCallback)(t=>{if(!et||f)return;let e=b(t);e&&(t.preventDefault(),et({node:e,nativeEvent:t.nativeEvent}))},[et,f,b]),ae=(0,n.useCallback)((t,e,o)=>{if(!B||f)return;let s=p.find(i=>i.id===t);s&&B({node:s,actionId:e,nativeEvent:o})},[B,f,p]),fe=(0,n.useCallback)((t,e)=>{!A||f||(e.stopPropagation(),M(new Set),H(t))},[A,f]),pe=(0,n.useCallback)(t=>{if(!(T||f)&&(0,z.isInCanvas)(D.current,t.target)){if(t.key==="Delete"||t.key==="Backspace"){if((0,Tt.isEditableTarget)(t.target))return;K.size>0&&(w(e=>{let o=new Set(e.nodes.filter(s=>K.has(s.id)&&!s.locked).map(s=>s.id));return o.size===0?e:{...e,nodes:e.nodes.filter(s=>!o.has(s.id)),edges:e.edges.filter(s=>!o.has(s.from.nodeId)&&!o.has(s.to.nodeId))}}),M(new Set)),$&&(w(e=>({...e,edges:e.edges.filter(o=>o.id!==$)})),H(null))}t.key==="Escape"&&(M(new Set),H(null))}},[T,f,K,$,w]),Et=(0,n.useCallback)(()=>{let t=(0,a.clampZoom)(r.zoom+Rt,x,S);h({...r,zoom:t})},[r,x,S,h]),vt=(0,n.useCallback)(()=>{let t=(0,a.clampZoom)(r.zoom-Rt,x,S);h({...r,zoom:t})},[r,x,S,h]),yt=(0,n.useCallback)(()=>{h({...ht})},[h]),J=(0,n.useCallback)(()=>{let t=D.current?.getBoundingClientRect();if(!t)return;let e=(0,a.fitViewport)(p,t.width,t.height),o=(0,a.clampZoom)(e.zoom,x,S);h({...e,zoom:o})},[p,x,S,h]),At=(0,n.useCallback)(t=>{w(e=>({...e,nodes:[...e.nodes,t]}))},[w]),Ot=(0,n.useCallback)(t=>{w(e=>({...e,nodes:e.nodes.filter(o=>o.id!==t),edges:e.edges.filter(o=>o.from.nodeId!==t&&o.to.nodeId!==t)}))},[w]),kt=(0,n.useCallback)(()=>JSON.stringify(W,null,2),[W]),It=(0,n.useCallback)(t=>{let e=(0,L.readWorkflowJSON)(t,ut.current);return e.ok?(w(()=>e.value),null):e.reason==="json"?U.editorImportInvalidJson:(0,Q.formatUILabel)(U.editorImportInvalidContent,{path:e.path})},[w,U]),Ht=(0,n.useCallback)(t=>It(t)===null,[It]);(0,n.useImperativeHandle)(re,()=>({zoomIn:Et,zoomOut:vt,resetView:yt,fitToContent:J,addNode:At,removeNode:Ot,toJSON:kt,loadJSON:Ht}),[Et,vt,yt,J,At,Ot,kt,Ht]);let _t=(0,n.useRef)(!1),Ft=p.length>0;(0,n.useEffect)(()=>{Xt&&Ft&&!_t.current&&D.current&&(_t.current=!0,J())},[Xt,Ft,J]);let Jt=(0,n.useMemo)(()=>{let t=new Map;for(let e of p)t.set(e.id,V(e));return t},[p,V]),me=(0,n.useMemo)(()=>({transform:`translate(${r.x}px, ${r.y}px) scale(${r.zoom})`,transformOrigin:"0 0"}),[r.x,r.y,r.zoom]);return(0,k.jsxs)("div",{ref:D,"data-testid":"workflow-editor",className:(0,Bt.cn)("relative w-full overflow-hidden bg-gray-50 dark:bg-gray-900 select-none touch-none",f&&"opacity-60 pointer-events-none",oe),tabIndex:0,onPointerDown:ce,onClick:le,onDoubleClick:de,onContextMenu:ue,onKeyDown:pe,children:[te&&(0,k.jsx)(Kt.GridLayer,{gridSize:ot,zoom:r.zoom}),ee&&!T&&(0,k.jsx)(qt.WorkflowToolbar,{zoom:r.zoom,direction:v,onDirectionChange:Qt,onZoomIn:Et,onZoomOut:vt,onResetView:yt,onFitToContent:J,onExportJSON:kt,onImportJSON:It,disabled:f,labels:U}),(0,k.jsxs)("div",{style:me,children:[(0,k.jsx)(Gt.WorkflowEdgeRenderer,{edges:st,nodes:p,selectedEdgeId:$,disabled:f||T,direction:v,onEdgeClick:fe,getNodePorts:t=>Jt.get(t.id)??[]}),p.map(t=>{let e=(0,L.registryEntry)(X,t.type);if(!e)return null;let o=Jt.get(t.id)??[];return(0,k.jsx)($t.WorkflowNodeRenderer,{node:t,registry:e,ports:o,selected:K.has(t.id),disabled:f||T,draggable:nt&&!T,direction:v,onActionClick:B?ae:void 0},t.id)})]}),P&&(0,k.jsxs)("svg",{"data-testid":"drag-edge-overlay",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:1e3,overflow:"visible"},children:[(0,k.jsx)("path",{d:(0,a.computeBezierPath)(P.fromX*r.zoom+r.x,P.fromY*r.zoom+r.y,P.currentX*r.zoom+r.x,P.currentY*r.zoom+r.y,v),fill:"none",stroke:"#3b82f6",strokeWidth:2.5,strokeDasharray:"8 4"}),(0,k.jsx)("circle",{cx:P.fromX*r.zoom+r.x,cy:P.fromY*r.zoom+r.y,r:5,fill:"#3b82f6"}),(0,k.jsx)("circle",{cx:P.currentX*r.zoom+r.x,cy:P.currentY*r.zoom+r.y,r:4,fill:"#3b82f6",opacity:.6})]})]})}var jt=(0,n.forwardRef)(We);jt.displayName="WorkflowEditor";0&&(module.exports={WorkflowEditor});
|
|
1
|
+
"use strict";"use client";var Dt=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var Ee=Object.prototype.hasOwnProperty;var ve=(R,I)=>{for(var X in I)Dt(R,X,{get:I[X],enumerable:!0})},ye=(R,I,X,z)=>{if(I&&typeof I=="object"||typeof I=="function")for(let v of we(I))!Ee.call(R,v)&&v!==X&&Dt(R,v,{get:()=>I[v],enumerable:!(z=ge(I,v))||z.enumerable});return R};var ke=R=>ye(Dt({},"__esModule",{value:!0}),R);var Pe={};ve(Pe,{WorkflowEditor:()=>qt});module.exports=ke(Pe);var n=require("react"),x=require("../../lib/canvas-events.cjs"),Bt=require("../../lib/cn.cjs"),Tt=require("../../lib/editable-target.cjs"),Q=require("../../lib/i18n.cjs"),Ut=require("../../lib/owner-document.cjs"),Kt=require("./canvas/GridLayer.cjs"),$t=require("./nodes/WorkflowNodeRenderer.cjs"),Gt=require("./edges/WorkflowEdgeRenderer.cjs"),jt=require("./toolbar/WorkflowToolbar.cjs"),a=require("./utils/geometry.cjs"),L=require("./utils/import.cjs"),k=require("react/jsx-runtime"),ht={x:0,y:0,zoom:1},Rt=.1,Ie=.1,De=3,he=20,Re=25;function Te(){return`edge-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function We({value:R,defaultValue:I,onValueChange:X,nodeRegistry:z,direction:v="horizontal",onDirectionChange:Qt,onNodeClick:Z,onNodeDoubleClick:tt,onNodeContextMenu:et,onNodeAction:B,readOnly:T=!1,disabled:f=!1,draggableNodes:nt=!0,connectable:Wt=!0,selectable:A=!0,multiSelect:Pt=!1,panOnDrag:Nt=!0,zoomOnWheel:Zt=!0,minZoom:Y=Ie,maxZoom:S=De,snapToGrid:xt=!1,gridSize:ot=he,showGrid:te=!0,toolbar:ee=!0,autoFit:zt=!1,labels:ne,className:oe},re){let U=(0,Q.useUILabels)(ne),rt=R!==void 0,[se,ie]=(0,n.useState)(()=>I??{nodes:[],edges:[],viewport:{...ht}}),W=rt?R:se,p=W.nodes,st=W.edges,r=W.viewport??ht,D=(0,n.useRef)(null),O=(0,n.useRef)(null),[K,M]=(0,n.useState)(new Set),[$,H]=(0,n.useState)(null),[P,it]=(0,n.useState)(null),ct=(0,n.useRef)(r);ct.current=r;let lt=(0,n.useRef)(p);lt.current=p;let Xt=(0,n.useRef)(st);Xt.current=st;let Yt=(0,n.useRef)(xt);Yt.current=xt;let dt=(0,n.useRef)(ot);dt.current=ot;let ut=(0,n.useRef)(z);ut.current=z;let at=(0,n.useRef)(v);at.current=v;let St=(0,n.useRef)(W);St.current=W;let G=(0,n.useRef)(W);G.current=W;let ft=(0,n.useRef)(!1),Mt=(0,n.useRef)(rt);Mt.current=rt;let Vt=(0,n.useRef)(X);Vt.current=X;let w=(0,n.useCallback)(t=>{let e=G.current,o=t(e);o!==e&&(G.current=o,Mt.current?ft.current||(ft.current=!0,queueMicrotask(()=>{ft.current=!1,G.current=St.current})):ie(o),Vt.current?.(o))},[]),pt=(0,n.useRef)(w);pt.current=w;let h=(0,n.useCallback)(t=>{w(e=>({...e,viewport:t}))},[w]),bt=(0,n.useRef)(h);bt.current=h;let V=(0,n.useCallback)(t=>{let e=(0,L.registryEntry)(z,t.type);return e?.getPorts?e.getPorts(t):t.ports??[]},[z]),j=(0,n.useRef)(V);j.current=V;let Ct=(0,n.useCallback)((t,e,o)=>{let s=lt.current,i=Xt.current,l=s.find(u=>u.id===t.fromNodeId),c=s.find(u=>u.id===e);if(!l||!c)return;let m=j.current(l),d=j.current(c),g=m.find(u=>u.id===t.fromPortId),E=d.find(u=>u.id===o);if(!g||!E||E.kind!=="in"||g.disabled||E.disabled||t.fromNodeId===e)return;let N=(0,L.registryEntry)(ut.current,l.type);if(N?.canConnect&&!N.canConnect({fromNode:l,toNode:c,fromPort:g,toPort:E}))return;i.some(u=>u.from.nodeId===t.fromNodeId&&u.from.portId===t.fromPortId&&u.to.nodeId===e&&u.to.portId===o)||pt.current(u=>({...u,edges:[...u.edges,{id:Te(),from:{nodeId:t.fromNodeId,portId:t.fromPortId},to:{nodeId:e,portId:o}}]}))},[]),_=(0,n.useRef)(null),F=(0,n.useRef)(null),b=(0,n.useCallback)(()=>{F.current?.(),F.current=null,O.current=null,_.current=null,it(null)},[]),Lt=(0,n.useCallback)(t=>{let e=t.target instanceof Element?t.target.closest('[data-port-id][data-port-kind="in"]'):null,o=e?.getAttribute("data-node-id"),s=e?.getAttribute("data-port-id");if(o&&s)return{nodeId:o,portId:s};let i=D.current?.getBoundingClientRect();if(!i)return null;let l=(0,a.screenToCanvas)(t.clientX,t.clientY,ct.current,i),c=null,m=Re;for(let d of lt.current){let g=j.current(d);for(let E of g){if(E.kind!=="in")continue;let N=(0,a.getPortAbsolutePosition)(d,E,g,at.current),y=Math.hypot(l.x-N.x,l.y-N.y);y<m&&(m=y,c={nodeId:d.id,portId:E.id})}}return c},[]),mt=(0,n.useCallback)(t=>{let e=O.current;if(!e||t.pointerId!==_.current)return;if(t.buttons===0){b();return}let o=D.current?.getBoundingClientRect();if(!o)return;let s=ct.current;if(e.type==="pan"){let i=t.clientX-e.startX,l=t.clientY-e.startY;bt.current({...s,x:e.startViewportX+i,y:e.startViewportY+l})}if(e.type==="node"){let i=(0,a.screenToCanvas)(t.clientX,t.clientY,s,o),l=i.x-e.offsetX,c=i.y-e.offsetY;Yt.current&&(l=(0,a.snapValue)(l,dt.current),c=(0,a.snapValue)(c,dt.current)),pt.current(m=>({...m,nodes:m.nodes.map(d=>d.id===e.nodeId?{...d,x:l,y:c}:d)}))}if(e.type==="edge"){let i=(0,a.screenToCanvas)(t.clientX,t.clientY,s,o);O.current={...e,currentX:i.x,currentY:i.y},it({fromX:e.fromX,fromY:e.fromY,currentX:i.x,currentY:i.y})}},[b]),gt=(0,n.useCallback)(t=>{let e=O.current;if(!(!e||t.pointerId!==_.current)){if(e.type==="edge"){let o=Lt(t);o&&Ct(e,o.nodeId,o.portId)}b()}},[Lt,Ct,b]),wt=(0,n.useCallback)(t=>{t.pointerId===_.current&&b()},[b]),q=(0,n.useCallback)((t,e)=>{F.current?.(),O.current=t,_.current=e;let o=(0,Ut.ownerDocumentOf)(D.current);o.addEventListener("pointermove",mt),o.addEventListener("pointerup",gt),o.addEventListener("pointercancel",wt),F.current=()=>{o.removeEventListener("pointermove",mt),o.removeEventListener("pointerup",gt),o.removeEventListener("pointercancel",wt)}},[mt,gt,wt]);(0,n.useEffect)(()=>()=>F.current?.(),[]),(0,x.useCanvasWheel)(D,t=>{if(!Zt||f)return;let e=(0,x.wheelZoomDirection)(t);if(e===null)return;t.preventDefault();let o=D.current?.getBoundingClientRect();if(!o)return;let s=t.clientX-o.left,i=t.clientY-o.top,l=(0,a.clampZoom)(r.zoom+e*Rt,Y,S),c=l/r.zoom;h({x:s-(s-r.x)*c,y:i-(i-r.y)*c,zoom:l})});let ce=(0,n.useCallback)(t=>{if(f||!(0,x.isInCanvas)(D.current,t.target))return;let e=(0,x.isPrimaryPress)(t),o=t.target;if(o.closest("[data-action-id]"))return;let i=o.closest("[data-port-id]");if(i){if(!Wt||T||!e)return;t.preventDefault();let c=i.getAttribute("data-node-id"),m=i.getAttribute("data-port-id"),d=i.getAttribute("data-port-kind");if(!c||!m||d!=="out")return;let g=p.find(u=>u.id===c);if(!g)return;let E=V(g),N=E.find(u=>u.id===m);if(!N||N.disabled)return;let y=(0,a.getPortAbsolutePosition)(g,N,E,at.current);q({type:"edge",fromNodeId:c,fromPortId:m,fromX:y.x,fromY:y.y,currentX:y.x,currentY:y.y},t.pointerId),it({fromX:y.x,fromY:y.y,currentX:y.x,currentY:y.y});return}let l=o.closest("[data-node-id]");if(l){if(T)return;let c=l.getAttribute("data-node-id");if(A&&(H(null),Pt&&t.shiftKey?M(m=>{let d=new Set(m);return d.has(c)?d.delete(c):d.add(c),d}):M(new Set([c]))),e&&nt&&!(0,Tt.isEditableTarget)(o)){let m=D.current?.getBoundingClientRect();if(!m)return;let d=p.find(E=>E.id===c);if(!d||d.locked)return;let g=(0,a.screenToCanvas)(t.clientX,t.clientY,r,m);q({type:"node",nodeId:c,startX:g.x,startY:g.y,offsetX:g.x-d.x,offsetY:g.y-d.y},t.pointerId)}return}A&&(M(new Set),H(null)),Nt&&e&&q({type:"pan",startX:t.clientX,startY:t.clientY,startViewportX:r.x,startViewportY:r.y},t.pointerId)},[f,Wt,T,A,Pt,nt,Nt,r,p,V,q]),C=(0,n.useCallback)(t=>{let e=t.target;if(e.closest("[data-port-id]")||e.closest("[data-action-id]"))return null;let i=e.closest("[data-node-id]");if(!i)return null;let l=i.getAttribute("data-node-id");return p.find(c=>c.id===l)??null},[p]),le=(0,n.useCallback)(t=>{if(!Z||f)return;let e=C(t);e&&Z({node:e,nativeEvent:t.nativeEvent})},[Z,f,C]),de=(0,n.useCallback)(t=>{if(!tt||f)return;let e=C(t);e&&tt({node:e,nativeEvent:t.nativeEvent})},[tt,f,C]),ue=(0,n.useCallback)(t=>{if(!et||f)return;let e=C(t);e&&(t.preventDefault(),et({node:e,nativeEvent:t.nativeEvent}))},[et,f,C]),ae=(0,n.useCallback)((t,e,o)=>{if(!B||f)return;let s=p.find(i=>i.id===t);s&&B({node:s,actionId:e,nativeEvent:o})},[B,f,p]),fe=(0,n.useCallback)((t,e)=>{!A||f||(e.stopPropagation(),M(new Set),H(t))},[A,f]),pe=(0,n.useCallback)(t=>{if(!(T||f)&&(0,x.isInCanvas)(D.current,t.target)){if(t.key==="Delete"||t.key==="Backspace"){if((0,Tt.isEditableTarget)(t.target))return;K.size>0&&(w(e=>{let o=new Set(e.nodes.filter(s=>K.has(s.id)&&!s.locked).map(s=>s.id));return o.size===0?e:{...e,nodes:e.nodes.filter(s=>!o.has(s.id)),edges:e.edges.filter(s=>!o.has(s.from.nodeId)&&!o.has(s.to.nodeId))}}),M(new Set)),$&&(w(e=>({...e,edges:e.edges.filter(o=>o.id!==$)})),H(null))}t.key==="Escape"&&(M(new Set),H(null))}},[T,f,K,$,w]),Et=(0,n.useCallback)(()=>{let t=(0,a.clampZoom)(r.zoom+Rt,Y,S);h({...r,zoom:t})},[r,Y,S,h]),vt=(0,n.useCallback)(()=>{let t=(0,a.clampZoom)(r.zoom-Rt,Y,S);h({...r,zoom:t})},[r,Y,S,h]),yt=(0,n.useCallback)(()=>{h({...ht})},[h]),J=(0,n.useCallback)(()=>{let t=D.current?.getBoundingClientRect();if(!t)return;let e=(0,a.fitViewport)(p,t.width,t.height),o=(0,a.clampZoom)(e.zoom,Y,S);h({...e,zoom:o})},[p,Y,S,h]),At=(0,n.useCallback)(t=>{w(e=>({...e,nodes:[...e.nodes,t]}))},[w]),Ot=(0,n.useCallback)(t=>{w(e=>({...e,nodes:e.nodes.filter(o=>o.id!==t),edges:e.edges.filter(o=>o.from.nodeId!==t&&o.to.nodeId!==t)}))},[w]),kt=(0,n.useCallback)(()=>JSON.stringify(W,null,2),[W]),It=(0,n.useCallback)(t=>{let e=(0,L.readWorkflowJSON)(t,ut.current);return e.ok?(w(()=>e.value),null):e.reason==="json"?U.editorImportInvalidJson:(0,Q.formatUILabel)(U.editorImportInvalidContent,{path:e.path})},[w,U]),Ht=(0,n.useCallback)(t=>It(t)===null,[It]);(0,n.useImperativeHandle)(re,()=>({zoomIn:Et,zoomOut:vt,resetView:yt,fitToContent:J,addNode:At,removeNode:Ot,toJSON:kt,loadJSON:Ht}),[Et,vt,yt,J,At,Ot,kt,Ht]);let _t=(0,n.useRef)(!1),Ft=p.length>0;(0,n.useEffect)(()=>{zt&&Ft&&!_t.current&&D.current&&(_t.current=!0,J())},[zt,Ft,J]);let Jt=(0,n.useMemo)(()=>{let t=new Map;for(let e of p)t.set(e.id,V(e));return t},[p,V]),me=(0,n.useMemo)(()=>({transform:`translate(${r.x}px, ${r.y}px) scale(${r.zoom})`,transformOrigin:"0 0"}),[r.x,r.y,r.zoom]);return(0,k.jsxs)("div",{ref:D,"data-testid":"workflow-editor",className:(0,Bt.cn)("relative w-full overflow-hidden bg-gray-50 dark:bg-gray-900 select-none touch-none",f&&"opacity-60 pointer-events-none",oe),tabIndex:0,onPointerDown:ce,onClick:le,onDoubleClick:de,onContextMenu:ue,onKeyDown:pe,children:[te&&(0,k.jsx)(Kt.GridLayer,{gridSize:ot,zoom:r.zoom}),ee&&!T&&(0,k.jsx)(jt.WorkflowToolbar,{zoom:r.zoom,direction:v,onDirectionChange:Qt,onZoomIn:Et,onZoomOut:vt,onResetView:yt,onFitToContent:J,onExportJSON:kt,onImportJSON:It,disabled:f,labels:U}),(0,k.jsxs)("div",{style:me,children:[(0,k.jsx)(Gt.WorkflowEdgeRenderer,{edges:st,nodes:p,selectedEdgeId:$,disabled:f||T,direction:v,onEdgeClick:fe,getNodePorts:t=>Jt.get(t.id)??[]}),p.map(t=>{let e=(0,L.registryEntry)(z,t.type);if(!e)return null;let o=Jt.get(t.id)??[];return(0,k.jsx)($t.WorkflowNodeRenderer,{node:t,registry:e,ports:o,selected:K.has(t.id),disabled:f||T,draggable:nt&&!T,direction:v,onActionClick:B?ae:void 0},t.id)})]}),P&&(0,k.jsxs)("svg",{"data-testid":"drag-edge-overlay",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:1e3,overflow:"visible"},children:[(0,k.jsx)("path",{d:(0,a.computeBezierPath)(P.fromX*r.zoom+r.x,P.fromY*r.zoom+r.y,P.currentX*r.zoom+r.x,P.currentY*r.zoom+r.y,v),fill:"none",stroke:"#3b82f6",strokeWidth:2.5,strokeDasharray:"8 4"}),(0,k.jsx)("circle",{cx:P.fromX*r.zoom+r.x,cy:P.fromY*r.zoom+r.y,r:5,fill:"#3b82f6"}),(0,k.jsx)("circle",{cx:P.currentX*r.zoom+r.x,cy:P.currentY*r.zoom+r.y,r:4,fill:"#3b82f6",opacity:.6})]})]})}var qt=(0,n.forwardRef)(We);qt.displayName="WorkflowEditor";0&&(module.exports={WorkflowEditor});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{forwardRef as me,useCallback as i,useEffect as Jt,useImperativeHandle as ge,useMemo as Bt,useRef as a,useState as K}from"react";import{isInCanvas as Ut,isPrimaryPress as we,useCanvasWheel as Ee,wheelZoomDirection as ve}from"../../lib/canvas-events.js";import{cn as ye}from"../../lib/cn.js";import{isEditableTarget as Kt}from"../../lib/editable-target.js";import{formatUILabel as ke,useUILabels as Ie}from"../../lib/i18n.js";import{ownerDocumentOf as De}from"../../lib/owner-document.js";import{GridLayer as he}from"./canvas/GridLayer.js";import{WorkflowNodeRenderer as Re}from"./nodes/WorkflowNodeRenderer.js";import{WorkflowEdgeRenderer as Te}from"./edges/WorkflowEdgeRenderer.js";import{WorkflowToolbar as We}from"./toolbar/WorkflowToolbar.js";import{clampZoom as $,computeBezierPath as Pe,fitViewport as Ne,getPortAbsolutePosition as $t,screenToCanvas as G,snapValue as Gt}from"./utils/geometry.js";import{readWorkflowJSON as ze,registryEntry as yt}from"./utils/import.js";import{jsx as P,jsxs as Dt}from"react/jsx-runtime";var kt={x:0,y:0,zoom:1},It=.1,Xe=.1,Ye=3,xe=20,Se=25;function Me(){return`edge-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function Ve({value:ht,defaultValue:qt,onValueChange:Rt,nodeRegistry:S,direction:N="horizontal",onDirectionChange:jt,onNodeClick:q,onNodeDoubleClick:j,onNodeContextMenu:Q,onNodeAction:O,readOnly:I=!1,disabled:f=!1,draggableNodes:Z=!0,connectable:Tt=!0,selectable:M=!0,multiSelect:Wt=!1,panOnDrag:Pt=!0,zoomOnWheel:Qt=!0,minZoom:T=Xe,maxZoom:W=Ye,snapToGrid:Nt=!1,gridSize:tt=xe,showGrid:Zt=!0,toolbar:te=!0,autoFit:zt=!1,labels:ee,className:ne},oe){let H=Ie(ee),et=ht!==void 0,[re,se]=K(()=>qt??{nodes:[],edges:[],viewport:{...kt}}),D=et?ht:re,p=D.nodes,nt=D.edges,o=D.viewport??kt,y=a(null),V=a(null),[_,z]=K(new Set),[F,C]=K(null),[h,ot]=K(null),rt=a(o);rt.current=o;let st=a(p);st.current=p;let Xt=a(nt);Xt.current=nt;let Yt=a(Nt);Yt.current=Nt;let it=a(tt);it.current=tt;let ct=a(S);ct.current=S;let lt=a(N);lt.current=N;let xt=a(D);xt.current=D;let J=a(D);J.current=D;let dt=a(!1),St=a(et);St.current=et;let Mt=a(Rt);Mt.current=Rt;let w=i(t=>{let e=J.current,n=t(e);n!==e&&(J.current=n,St.current?dt.current||(dt.current=!0,queueMicrotask(()=>{dt.current=!1,J.current=xt.current})):se(n),Mt.current?.(n))},[]),ut=a(w);ut.current=w;let k=i(t=>{w(e=>({...e,viewport:t}))},[w]),Vt=a(k);Vt.current=k;let X=i(t=>{let e=yt(S,t.type);return e?.getPorts?e.getPorts(t):t.ports??[]},[S]),B=a(X);B.current=X;let Ct=i((t,e,n)=>{let r=st.current,s=Xt.current,l=r.find(u=>u.id===t.fromNodeId),c=r.find(u=>u.id===e);if(!l||!c)return;let m=B.current(l),d=B.current(c),g=m.find(u=>u.id===t.fromPortId),E=d.find(u=>u.id===n);if(!g||!E||E.kind!=="in"||g.disabled||E.disabled||t.fromNodeId===e)return;let R=yt(ct.current,l.type);if(R?.canConnect&&!R.canConnect({fromNode:l,toNode:c,fromPort:g,toPort:E}))return;s.some(u=>u.from.nodeId===t.fromNodeId&&u.from.portId===t.fromPortId&&u.to.nodeId===e&&u.to.portId===n)||ut.current(u=>({...u,edges:[...u.edges,{id:Me(),from:{nodeId:t.fromNodeId,portId:t.fromPortId},to:{nodeId:e,portId:n}}]}))},[]),b=a(null),L=a(null),Y=i(()=>{L.current?.(),L.current=null,V.current=null,b.current=null,ot(null)},[]),bt=i(t=>{let e=t.target instanceof Element?t.target.closest('[data-port-id][data-port-kind="in"]'):null,n=e?.getAttribute("data-node-id"),r=e?.getAttribute("data-port-id");if(n&&r)return{nodeId:n,portId:r};let s=y.current?.getBoundingClientRect();if(!s)return null;let l=G(t.clientX,t.clientY,rt.current,s),c=null,m=Se;for(let d of st.current){let g=B.current(d);for(let E of g){if(E.kind!=="in")continue;let R=$t(d,E,g,lt.current),v=Math.hypot(l.x-R.x,l.y-R.y);v<m&&(m=v,c={nodeId:d.id,portId:E.id})}}return c},[]),at=i(t=>{let e=V.current;if(!e||t.pointerId!==b.current)return;if(t.buttons===0){Y();return}let n=y.current?.getBoundingClientRect();if(!n)return;let r=rt.current;if(e.type==="pan"){let s=t.clientX-e.startX,l=t.clientY-e.startY;Vt.current({...r,x:e.startViewportX+s,y:e.startViewportY+l})}if(e.type==="node"){let s=G(t.clientX,t.clientY,r,n),l=s.x-e.offsetX,c=s.y-e.offsetY;Yt.current&&(l=Gt(l,it.current),c=Gt(c,it.current)),ut.current(m=>({...m,nodes:m.nodes.map(d=>d.id===e.nodeId?{...d,x:l,y:c}:d)}))}if(e.type==="edge"){let s=G(t.clientX,t.clientY,r,n);V.current={...e,currentX:s.x,currentY:s.y},ot({fromX:e.fromX,fromY:e.fromY,currentX:s.x,currentY:s.y})}},[Y]),ft=i(t=>{let e=V.current;if(!(!e||t.pointerId!==b.current)){if(e.type==="edge"){let n=bt(t);n&&Ct(e,n.nodeId,n.portId)}Y()}},[bt,Ct,Y]),pt=i(t=>{t.pointerId===b.current&&Y()},[Y]),U=i((t,e)=>{L.current?.(),V.current=t,b.current=e;let n=De(y.current);n.addEventListener("pointermove",at),n.addEventListener("pointerup",ft),n.addEventListener("pointercancel",pt),L.current=()=>{n.removeEventListener("pointermove",at),n.removeEventListener("pointerup",ft),n.removeEventListener("pointercancel",pt)}},[at,ft,pt]);Jt(()=>()=>L.current?.(),[]),Ee(y,t=>{if(!Qt||f)return;let e=ve(t);if(e===null)return;t.preventDefault();let n=y.current?.getBoundingClientRect();if(!n)return;let r=t.clientX-n.left,s=t.clientY-n.top,l=$(o.zoom+e*It,T,W),c=l/o.zoom;k({x:r-(r-o.x)*c,y:s-(s-o.y)*c,zoom:l})});let ie=i(t=>{if(f||!Ut(y.current,t.target))return;let e=we(t),n=t.target;if(n.closest("[data-action-id]"))return;let s=n.closest("[data-port-id]");if(s){if(!Tt||I||!e)return;t.preventDefault();let c=s.getAttribute("data-node-id"),m=s.getAttribute("data-port-id"),d=s.getAttribute("data-port-kind");if(!c||!m||d!=="out")return;let g=p.find(u=>u.id===c);if(!g)return;let E=X(g),R=E.find(u=>u.id===m);if(!R||R.disabled)return;let v=$t(g,R,E,lt.current);U({type:"edge",fromNodeId:c,fromPortId:m,fromX:v.x,fromY:v.y,currentX:v.x,currentY:v.y},t.pointerId),ot({fromX:v.x,fromY:v.y,currentX:v.x,currentY:v.y});return}let l=n.closest("[data-node-id]");if(l){if(I)return;let c=l.getAttribute("data-node-id");if(M&&(C(null),Wt&&t.shiftKey?z(m=>{let d=new Set(m);return d.has(c)?d.delete(c):d.add(c),d}):z(new Set([c]))),e&&Z&&!Kt(n)){let m=y.current?.getBoundingClientRect();if(!m)return;let d=p.find(E=>E.id===c);if(!d||d.locked)return;let g=G(t.clientX,t.clientY,o,m);U({type:"node",nodeId:c,startX:g.x,startY:g.y,offsetX:g.x-d.x,offsetY:g.y-d.y},t.pointerId)}return}M&&(z(new Set),C(null)),Pt&&e&&U({type:"pan",startX:t.clientX,startY:t.clientY,startViewportX:o.x,startViewportY:o.y},t.pointerId)},[f,Tt,I,M,Wt,Z,Pt,o,p,X,U]),x=i(t=>{let e=t.target;if(e.closest("[data-port-id]")||e.closest("[data-action-id]"))return null;let s=e.closest("[data-node-id]");if(!s)return null;let l=s.getAttribute("data-node-id");return p.find(c=>c.id===l)??null},[p]),ce=i(t=>{if(!q||f)return;let e=x(t);e&&q({node:e,nativeEvent:t.nativeEvent})},[q,f,x]),le=i(t=>{if(!j||f)return;let e=x(t);e&&j({node:e,nativeEvent:t.nativeEvent})},[j,f,x]),de=i(t=>{if(!Q||f)return;let e=x(t);e&&(t.preventDefault(),Q({node:e,nativeEvent:t.nativeEvent}))},[Q,f,x]),ue=i((t,e,n)=>{if(!O||f)return;let r=p.find(s=>s.id===t);r&&O({node:r,actionId:e,nativeEvent:n})},[O,f,p]),ae=i((t,e)=>{!M||f||(e.stopPropagation(),z(new Set),C(t))},[M,f]),fe=i(t=>{if(!(I||f)&&Ut(y.current,t.target)){if(t.key==="Delete"||t.key==="Backspace"){if(Kt(t.target))return;_.size>0&&(w(e=>{let n=new Set(e.nodes.filter(r=>_.has(r.id)&&!r.locked).map(r=>r.id));return n.size===0?e:{...e,nodes:e.nodes.filter(r=>!n.has(r.id)),edges:e.edges.filter(r=>!n.has(r.from.nodeId)&&!n.has(r.to.nodeId))}}),z(new Set)),F&&(w(e=>({...e,edges:e.edges.filter(n=>n.id!==F)})),C(null))}t.key==="Escape"&&(z(new Set),C(null))}},[I,f,_,F,w]),mt=i(()=>{let t=$(o.zoom+It,T,W);k({...o,zoom:t})},[o,T,W,k]),gt=i(()=>{let t=$(o.zoom-It,T,W);k({...o,zoom:t})},[o,T,W,k]),wt=i(()=>{k({...kt})},[k]),A=i(()=>{let t=y.current?.getBoundingClientRect();if(!t)return;let e=Ne(p,t.width,t.height),n=$(e.zoom,T,W);k({...e,zoom:n})},[p,T,W,k]),Lt=i(t=>{w(e=>({...e,nodes:[...e.nodes,t]}))},[w]),At=i(t=>{w(e=>({...e,nodes:e.nodes.filter(n=>n.id!==t),edges:e.edges.filter(n=>n.from.nodeId!==t&&n.to.nodeId!==t)}))},[w]),Et=i(()=>JSON.stringify(D,null,2),[D]),vt=i(t=>{let e=ze(t,ct.current);return e.ok?(w(()=>e.value),null):e.reason==="json"?H.editorImportInvalidJson:ke(H.editorImportInvalidContent,{path:e.path})},[w,H]),Ot=i(t=>vt(t)===null,[vt]);ge(oe,()=>({zoomIn:mt,zoomOut:gt,resetView:wt,fitToContent:A,addNode:Lt,removeNode:At,toJSON:Et,loadJSON:Ot}),[mt,gt,wt,A,Lt,At,Et,Ot]);let Ht=a(!1),_t=p.length>0;Jt(()=>{zt&&_t&&!Ht.current&&y.current&&(Ht.current=!0,A())},[zt,_t,A]);let Ft=Bt(()=>{let t=new Map;for(let e of p)t.set(e.id,X(e));return t},[p,X]),pe=Bt(()=>({transform:`translate(${o.x}px, ${o.y}px) scale(${o.zoom})`,transformOrigin:"0 0"}),[o.x,o.y,o.zoom]);return Dt("div",{ref:y,"data-testid":"workflow-editor",className:ye("relative w-full overflow-hidden bg-gray-50 dark:bg-gray-900 select-none touch-none",f&&"opacity-60 pointer-events-none",ne),tabIndex:0,onPointerDown:ie,onClick:ce,onDoubleClick:le,onContextMenu:de,onKeyDown:fe,children:[Zt&&P(he,{gridSize:tt,zoom:o.zoom}),te&&!I&&P(We,{zoom:o.zoom,direction:N,onDirectionChange:jt,onZoomIn:mt,onZoomOut:gt,onResetView:wt,onFitToContent:A,onExportJSON:Et,onImportJSON:vt,disabled:f,labels:H}),Dt("div",{style:pe,children:[P(Te,{edges:nt,nodes:p,selectedEdgeId:F,disabled:f||I,direction:N,onEdgeClick:ae,getNodePorts:t=>Ft.get(t.id)??[]}),p.map(t=>{let e=yt(S,t.type);if(!e)return null;let n=Ft.get(t.id)??[];return P(Re,{node:t,registry:e,ports:n,selected:_.has(t.id),disabled:f||I,draggable:Z&&!I,direction:N,onActionClick:O?ue:void 0},t.id)})]}),h&&Dt("svg",{"data-testid":"drag-edge-overlay",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:1e3,overflow:"visible"},children:[P("path",{d:Pe(h.fromX*o.zoom+o.x,h.fromY*o.zoom+o.y,h.currentX*o.zoom+o.x,h.currentY*o.zoom+o.y,N),fill:"none",stroke:"#3b82f6",strokeWidth:2.5,strokeDasharray:"8 4"}),P("circle",{cx:h.fromX*o.zoom+o.x,cy:h.fromY*o.zoom+o.y,r:5,fill:"#3b82f6"}),P("circle",{cx:h.currentX*o.zoom+o.x,cy:h.currentY*o.zoom+o.y,r:4,fill:"#3b82f6",opacity:.6})]})]})}var Ce=me(Ve);Ce.displayName="WorkflowEditor";export{Ce as WorkflowEditor};
|
|
1
|
+
"use client";import{forwardRef as me,useCallback as i,useEffect as Jt,useImperativeHandle as ge,useMemo as Bt,useRef as a,useState as K}from"react";import{isInCanvas as Ut,isPrimaryPress as we,useCanvasWheel as Ee,wheelZoomDirection as ve}from"../../lib/canvas-events.js";import{cn as ye}from"../../lib/cn.js";import{isEditableTarget as Kt}from"../../lib/editable-target.js";import{formatUILabel as ke,useUILabels as Ie}from"../../lib/i18n.js";import{ownerDocumentOf as De}from"../../lib/owner-document.js";import{GridLayer as he}from"./canvas/GridLayer.js";import{WorkflowNodeRenderer as Re}from"./nodes/WorkflowNodeRenderer.js";import{WorkflowEdgeRenderer as Te}from"./edges/WorkflowEdgeRenderer.js";import{WorkflowToolbar as We}from"./toolbar/WorkflowToolbar.js";import{clampZoom as $,computeBezierPath as Pe,fitViewport as Ne,getPortAbsolutePosition as $t,screenToCanvas as G,snapValue as Gt}from"./utils/geometry.js";import{readWorkflowJSON as xe,registryEntry as yt}from"./utils/import.js";import{jsx as P,jsxs as Dt}from"react/jsx-runtime";var kt={x:0,y:0,zoom:1},It=.1,ze=.1,Xe=3,Ye=20,Se=25;function Me(){return`edge-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function Ve({value:ht,defaultValue:jt,onValueChange:Rt,nodeRegistry:S,direction:N="horizontal",onDirectionChange:qt,onNodeClick:j,onNodeDoubleClick:q,onNodeContextMenu:Q,onNodeAction:O,readOnly:I=!1,disabled:f=!1,draggableNodes:Z=!0,connectable:Tt=!0,selectable:M=!0,multiSelect:Wt=!1,panOnDrag:Pt=!0,zoomOnWheel:Qt=!0,minZoom:T=ze,maxZoom:W=Xe,snapToGrid:Nt=!1,gridSize:tt=Ye,showGrid:Zt=!0,toolbar:te=!0,autoFit:xt=!1,labels:ee,className:ne},oe){let H=Ie(ee),et=ht!==void 0,[re,se]=K(()=>jt??{nodes:[],edges:[],viewport:{...kt}}),D=et?ht:re,p=D.nodes,nt=D.edges,o=D.viewport??kt,y=a(null),V=a(null),[_,x]=K(new Set),[F,b]=K(null),[h,ot]=K(null),rt=a(o);rt.current=o;let st=a(p);st.current=p;let zt=a(nt);zt.current=nt;let Xt=a(Nt);Xt.current=Nt;let it=a(tt);it.current=tt;let ct=a(S);ct.current=S;let lt=a(N);lt.current=N;let Yt=a(D);Yt.current=D;let J=a(D);J.current=D;let dt=a(!1),St=a(et);St.current=et;let Mt=a(Rt);Mt.current=Rt;let w=i(t=>{let e=J.current,n=t(e);n!==e&&(J.current=n,St.current?dt.current||(dt.current=!0,queueMicrotask(()=>{dt.current=!1,J.current=Yt.current})):se(n),Mt.current?.(n))},[]),ut=a(w);ut.current=w;let k=i(t=>{w(e=>({...e,viewport:t}))},[w]),Vt=a(k);Vt.current=k;let z=i(t=>{let e=yt(S,t.type);return e?.getPorts?e.getPorts(t):t.ports??[]},[S]),B=a(z);B.current=z;let bt=i((t,e,n)=>{let r=st.current,s=zt.current,l=r.find(u=>u.id===t.fromNodeId),c=r.find(u=>u.id===e);if(!l||!c)return;let m=B.current(l),d=B.current(c),g=m.find(u=>u.id===t.fromPortId),E=d.find(u=>u.id===n);if(!g||!E||E.kind!=="in"||g.disabled||E.disabled||t.fromNodeId===e)return;let R=yt(ct.current,l.type);if(R?.canConnect&&!R.canConnect({fromNode:l,toNode:c,fromPort:g,toPort:E}))return;s.some(u=>u.from.nodeId===t.fromNodeId&&u.from.portId===t.fromPortId&&u.to.nodeId===e&&u.to.portId===n)||ut.current(u=>({...u,edges:[...u.edges,{id:Me(),from:{nodeId:t.fromNodeId,portId:t.fromPortId},to:{nodeId:e,portId:n}}]}))},[]),C=a(null),L=a(null),X=i(()=>{L.current?.(),L.current=null,V.current=null,C.current=null,ot(null)},[]),Ct=i(t=>{let e=t.target instanceof Element?t.target.closest('[data-port-id][data-port-kind="in"]'):null,n=e?.getAttribute("data-node-id"),r=e?.getAttribute("data-port-id");if(n&&r)return{nodeId:n,portId:r};let s=y.current?.getBoundingClientRect();if(!s)return null;let l=G(t.clientX,t.clientY,rt.current,s),c=null,m=Se;for(let d of st.current){let g=B.current(d);for(let E of g){if(E.kind!=="in")continue;let R=$t(d,E,g,lt.current),v=Math.hypot(l.x-R.x,l.y-R.y);v<m&&(m=v,c={nodeId:d.id,portId:E.id})}}return c},[]),at=i(t=>{let e=V.current;if(!e||t.pointerId!==C.current)return;if(t.buttons===0){X();return}let n=y.current?.getBoundingClientRect();if(!n)return;let r=rt.current;if(e.type==="pan"){let s=t.clientX-e.startX,l=t.clientY-e.startY;Vt.current({...r,x:e.startViewportX+s,y:e.startViewportY+l})}if(e.type==="node"){let s=G(t.clientX,t.clientY,r,n),l=s.x-e.offsetX,c=s.y-e.offsetY;Xt.current&&(l=Gt(l,it.current),c=Gt(c,it.current)),ut.current(m=>({...m,nodes:m.nodes.map(d=>d.id===e.nodeId?{...d,x:l,y:c}:d)}))}if(e.type==="edge"){let s=G(t.clientX,t.clientY,r,n);V.current={...e,currentX:s.x,currentY:s.y},ot({fromX:e.fromX,fromY:e.fromY,currentX:s.x,currentY:s.y})}},[X]),ft=i(t=>{let e=V.current;if(!(!e||t.pointerId!==C.current)){if(e.type==="edge"){let n=Ct(t);n&&bt(e,n.nodeId,n.portId)}X()}},[Ct,bt,X]),pt=i(t=>{t.pointerId===C.current&&X()},[X]),U=i((t,e)=>{L.current?.(),V.current=t,C.current=e;let n=De(y.current);n.addEventListener("pointermove",at),n.addEventListener("pointerup",ft),n.addEventListener("pointercancel",pt),L.current=()=>{n.removeEventListener("pointermove",at),n.removeEventListener("pointerup",ft),n.removeEventListener("pointercancel",pt)}},[at,ft,pt]);Jt(()=>()=>L.current?.(),[]),Ee(y,t=>{if(!Qt||f)return;let e=ve(t);if(e===null)return;t.preventDefault();let n=y.current?.getBoundingClientRect();if(!n)return;let r=t.clientX-n.left,s=t.clientY-n.top,l=$(o.zoom+e*It,T,W),c=l/o.zoom;k({x:r-(r-o.x)*c,y:s-(s-o.y)*c,zoom:l})});let ie=i(t=>{if(f||!Ut(y.current,t.target))return;let e=we(t),n=t.target;if(n.closest("[data-action-id]"))return;let s=n.closest("[data-port-id]");if(s){if(!Tt||I||!e)return;t.preventDefault();let c=s.getAttribute("data-node-id"),m=s.getAttribute("data-port-id"),d=s.getAttribute("data-port-kind");if(!c||!m||d!=="out")return;let g=p.find(u=>u.id===c);if(!g)return;let E=z(g),R=E.find(u=>u.id===m);if(!R||R.disabled)return;let v=$t(g,R,E,lt.current);U({type:"edge",fromNodeId:c,fromPortId:m,fromX:v.x,fromY:v.y,currentX:v.x,currentY:v.y},t.pointerId),ot({fromX:v.x,fromY:v.y,currentX:v.x,currentY:v.y});return}let l=n.closest("[data-node-id]");if(l){if(I)return;let c=l.getAttribute("data-node-id");if(M&&(b(null),Wt&&t.shiftKey?x(m=>{let d=new Set(m);return d.has(c)?d.delete(c):d.add(c),d}):x(new Set([c]))),e&&Z&&!Kt(n)){let m=y.current?.getBoundingClientRect();if(!m)return;let d=p.find(E=>E.id===c);if(!d||d.locked)return;let g=G(t.clientX,t.clientY,o,m);U({type:"node",nodeId:c,startX:g.x,startY:g.y,offsetX:g.x-d.x,offsetY:g.y-d.y},t.pointerId)}return}M&&(x(new Set),b(null)),Pt&&e&&U({type:"pan",startX:t.clientX,startY:t.clientY,startViewportX:o.x,startViewportY:o.y},t.pointerId)},[f,Tt,I,M,Wt,Z,Pt,o,p,z,U]),Y=i(t=>{let e=t.target;if(e.closest("[data-port-id]")||e.closest("[data-action-id]"))return null;let s=e.closest("[data-node-id]");if(!s)return null;let l=s.getAttribute("data-node-id");return p.find(c=>c.id===l)??null},[p]),ce=i(t=>{if(!j||f)return;let e=Y(t);e&&j({node:e,nativeEvent:t.nativeEvent})},[j,f,Y]),le=i(t=>{if(!q||f)return;let e=Y(t);e&&q({node:e,nativeEvent:t.nativeEvent})},[q,f,Y]),de=i(t=>{if(!Q||f)return;let e=Y(t);e&&(t.preventDefault(),Q({node:e,nativeEvent:t.nativeEvent}))},[Q,f,Y]),ue=i((t,e,n)=>{if(!O||f)return;let r=p.find(s=>s.id===t);r&&O({node:r,actionId:e,nativeEvent:n})},[O,f,p]),ae=i((t,e)=>{!M||f||(e.stopPropagation(),x(new Set),b(t))},[M,f]),fe=i(t=>{if(!(I||f)&&Ut(y.current,t.target)){if(t.key==="Delete"||t.key==="Backspace"){if(Kt(t.target))return;_.size>0&&(w(e=>{let n=new Set(e.nodes.filter(r=>_.has(r.id)&&!r.locked).map(r=>r.id));return n.size===0?e:{...e,nodes:e.nodes.filter(r=>!n.has(r.id)),edges:e.edges.filter(r=>!n.has(r.from.nodeId)&&!n.has(r.to.nodeId))}}),x(new Set)),F&&(w(e=>({...e,edges:e.edges.filter(n=>n.id!==F)})),b(null))}t.key==="Escape"&&(x(new Set),b(null))}},[I,f,_,F,w]),mt=i(()=>{let t=$(o.zoom+It,T,W);k({...o,zoom:t})},[o,T,W,k]),gt=i(()=>{let t=$(o.zoom-It,T,W);k({...o,zoom:t})},[o,T,W,k]),wt=i(()=>{k({...kt})},[k]),A=i(()=>{let t=y.current?.getBoundingClientRect();if(!t)return;let e=Ne(p,t.width,t.height),n=$(e.zoom,T,W);k({...e,zoom:n})},[p,T,W,k]),Lt=i(t=>{w(e=>({...e,nodes:[...e.nodes,t]}))},[w]),At=i(t=>{w(e=>({...e,nodes:e.nodes.filter(n=>n.id!==t),edges:e.edges.filter(n=>n.from.nodeId!==t&&n.to.nodeId!==t)}))},[w]),Et=i(()=>JSON.stringify(D,null,2),[D]),vt=i(t=>{let e=xe(t,ct.current);return e.ok?(w(()=>e.value),null):e.reason==="json"?H.editorImportInvalidJson:ke(H.editorImportInvalidContent,{path:e.path})},[w,H]),Ot=i(t=>vt(t)===null,[vt]);ge(oe,()=>({zoomIn:mt,zoomOut:gt,resetView:wt,fitToContent:A,addNode:Lt,removeNode:At,toJSON:Et,loadJSON:Ot}),[mt,gt,wt,A,Lt,At,Et,Ot]);let Ht=a(!1),_t=p.length>0;Jt(()=>{xt&&_t&&!Ht.current&&y.current&&(Ht.current=!0,A())},[xt,_t,A]);let Ft=Bt(()=>{let t=new Map;for(let e of p)t.set(e.id,z(e));return t},[p,z]),pe=Bt(()=>({transform:`translate(${o.x}px, ${o.y}px) scale(${o.zoom})`,transformOrigin:"0 0"}),[o.x,o.y,o.zoom]);return Dt("div",{ref:y,"data-testid":"workflow-editor",className:ye("relative w-full overflow-hidden bg-gray-50 dark:bg-gray-900 select-none touch-none",f&&"opacity-60 pointer-events-none",ne),tabIndex:0,onPointerDown:ie,onClick:ce,onDoubleClick:le,onContextMenu:de,onKeyDown:fe,children:[Zt&&P(he,{gridSize:tt,zoom:o.zoom}),te&&!I&&P(We,{zoom:o.zoom,direction:N,onDirectionChange:qt,onZoomIn:mt,onZoomOut:gt,onResetView:wt,onFitToContent:A,onExportJSON:Et,onImportJSON:vt,disabled:f,labels:H}),Dt("div",{style:pe,children:[P(Te,{edges:nt,nodes:p,selectedEdgeId:F,disabled:f||I,direction:N,onEdgeClick:ae,getNodePorts:t=>Ft.get(t.id)??[]}),p.map(t=>{let e=yt(S,t.type);if(!e)return null;let n=Ft.get(t.id)??[];return P(Re,{node:t,registry:e,ports:n,selected:_.has(t.id),disabled:f||I,draggable:Z&&!I,direction:N,onActionClick:O?ue:void 0},t.id)})]}),h&&Dt("svg",{"data-testid":"drag-edge-overlay",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:1e3,overflow:"visible"},children:[P("path",{d:Pe(h.fromX*o.zoom+o.x,h.fromY*o.zoom+o.y,h.currentX*o.zoom+o.x,h.currentY*o.zoom+o.y,N),fill:"none",stroke:"#3b82f6",strokeWidth:2.5,strokeDasharray:"8 4"}),P("circle",{cx:h.fromX*o.zoom+o.x,cy:h.fromY*o.zoom+o.y,r:5,fill:"#3b82f6"}),P("circle",{cx:h.currentX*o.zoom+o.x,cy:h.currentY*o.zoom+o.y,r:4,fill:"#3b82f6",opacity:.6})]})]})}var be=me(Ve);be.displayName="WorkflowEditor";export{be as WorkflowEditor};
|
package/dist/index.d.cts
CHANGED
|
@@ -58,7 +58,7 @@ interface AccordionContentProps {
|
|
|
58
58
|
declare function Accordion({ type, value: valueProp, defaultValue, onValueChange, collapsible, variant, size, disabled, iconPosition, icon, hideIcon, className, children, }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
59
59
|
declare function AccordionItem({ value, disabled: disabledProp, className, children, }: AccordionItemProps): react_jsx_runtime.JSX.Element;
|
|
60
60
|
declare function AccordionTrigger({ className, icon: iconOverride, children, }: AccordionTriggerProps): react_jsx_runtime.JSX.Element;
|
|
61
|
-
declare function AccordionContent({ className, children
|
|
61
|
+
declare function AccordionContent({ className, children }: AccordionContentProps): react_jsx_runtime.JSX.Element;
|
|
62
62
|
|
|
63
63
|
interface AdvanceDetachableRenderContext {
|
|
64
64
|
open: () => void;
|
|
@@ -1455,6 +1455,8 @@ interface UILabels {
|
|
|
1455
1455
|
selectCreateOption: string;
|
|
1456
1456
|
/** Shown in the suggestion list of a MentionInput while it loads. */
|
|
1457
1457
|
mentionInputLoading: string;
|
|
1458
|
+
/** Accessible name of the suggestion list of a MentionInput. */
|
|
1459
|
+
mentionInputSuggestions: string;
|
|
1458
1460
|
/** Hint after the title of an optional Wizard step. */
|
|
1459
1461
|
wizardOptional: string;
|
|
1460
1462
|
/** Label of the WizardPrevious button. */
|
|
@@ -1537,6 +1539,16 @@ interface UILabels {
|
|
|
1537
1539
|
dataGridCollapseRow: string;
|
|
1538
1540
|
/** Accessible name and tooltip of the DataGrid column visibility button. */
|
|
1539
1541
|
dataGridToggleColumns: string;
|
|
1542
|
+
/** Accessible name and tooltip of the DataGrid button listing the columns to move them, when it does not hide them. */
|
|
1543
|
+
dataGridReorderColumns: string;
|
|
1544
|
+
/** Accessible name of the button moving a DataGrid column one place up its menu, towards the start of the table. `{column}` is the header of the column. */
|
|
1545
|
+
dataGridMoveColumnUp: string;
|
|
1546
|
+
/** Accessible name of the button moving a DataGrid column one place down its menu, towards the end of the table. `{column}` is the header of the column. */
|
|
1547
|
+
dataGridMoveColumnDown: string;
|
|
1548
|
+
/** Said once a DataGrid column has been moved from its menu. `{column}` is its header, `{position}` its place and `{count}` the number of places. */
|
|
1549
|
+
dataGridColumnMoved: string;
|
|
1550
|
+
/** Accessible name of the handle that resizes a DataGrid column, from the pointer or the arrow keys. `{column}` is the header of the column. */
|
|
1551
|
+
dataGridResizeColumn: string;
|
|
1540
1552
|
/** Tooltip of a DataGrid export button. `{format}` is CSV or JSON. */
|
|
1541
1553
|
dataGridExportAs: string;
|
|
1542
1554
|
/** Accessible name of the filter button of a DataGrid column. `{column}` is the header of the column. */
|
|
@@ -1607,6 +1619,42 @@ interface UILabels {
|
|
|
1607
1619
|
dataGridNextPage: string;
|
|
1608
1620
|
/** Accessible name of the DataGrid button going to the last page. */
|
|
1609
1621
|
dataGridLastPage: string;
|
|
1622
|
+
/** Accessible name of the bar of a DataGrid that holds the actions on its selected rows. */
|
|
1623
|
+
dataGridBulkActions: string;
|
|
1624
|
+
/** Button of a DataGrid that clears its selection, in the bar of its actions. */
|
|
1625
|
+
dataGridClearSelection: string;
|
|
1626
|
+
/** Accessible name of the row of a DataGrid that lists its active filters. */
|
|
1627
|
+
dataGridActiveFilters: string;
|
|
1628
|
+
/** An active filter of a DataGrid, in its row. `{column}` is the column, `{condition}` what it keeps. */
|
|
1629
|
+
dataGridActiveFilter: string;
|
|
1630
|
+
/** Accessible name of the button removing an active filter of a DataGrid. `{filter}` is the filter in words. */
|
|
1631
|
+
dataGridRemoveFilter: string;
|
|
1632
|
+
/** Button of a DataGrid that removes every active filter. */
|
|
1633
|
+
dataGridClearFilters: string;
|
|
1634
|
+
/** An active text filter of a DataGrid that looks for `{value}` in a cell. */
|
|
1635
|
+
dataGridConditionContains: string;
|
|
1636
|
+
/** An active text filter of a DataGrid that keeps the cells starting with `{value}`. */
|
|
1637
|
+
dataGridConditionStartsWith: string;
|
|
1638
|
+
/** An active text filter of a DataGrid that keeps the cells ending with `{value}`. */
|
|
1639
|
+
dataGridConditionEndsWith: string;
|
|
1640
|
+
/** An active filter of a DataGrid that keeps the empty cells. */
|
|
1641
|
+
dataGridConditionIsEmpty: string;
|
|
1642
|
+
/** An active filter of a DataGrid that keeps the cells holding something. */
|
|
1643
|
+
dataGridConditionIsNotEmpty: string;
|
|
1644
|
+
/** An active number filter of a DataGrid: greater than `{value}`. */
|
|
1645
|
+
dataGridConditionGreaterThan: string;
|
|
1646
|
+
/** An active filter of a DataGrid: `{value}` or more. */
|
|
1647
|
+
dataGridConditionGreaterOrEqual: string;
|
|
1648
|
+
/** An active number filter of a DataGrid: less than `{value}`. */
|
|
1649
|
+
dataGridConditionLessThan: string;
|
|
1650
|
+
/** An active filter of a DataGrid: `{value}` or less. */
|
|
1651
|
+
dataGridConditionLessOrEqual: string;
|
|
1652
|
+
/** An active filter of a DataGrid between two bounds, both included: `{from}` and `{to}`. */
|
|
1653
|
+
dataGridConditionBetween: string;
|
|
1654
|
+
/** An active date filter of a DataGrid: before the day `{value}`. */
|
|
1655
|
+
dataGridConditionBefore: string;
|
|
1656
|
+
/** An active date filter of a DataGrid: after the day `{value}`. */
|
|
1657
|
+
dataGridConditionAfter: string;
|
|
1610
1658
|
/** What a FileSelector says it accepts when `accept` is not set. */
|
|
1611
1659
|
fileSelectorAllFiles: string;
|
|
1612
1660
|
/** Invitation of a FileSelector drop zone taking one file. */
|
|
@@ -4191,6 +4239,36 @@ interface PaginationConfig {
|
|
|
4191
4239
|
showPageSizeSelector?: boolean;
|
|
4192
4240
|
showTotalItems?: boolean;
|
|
4193
4241
|
}
|
|
4242
|
+
/**
|
|
4243
|
+
* What a user arranges in a grid and expects to find again: what a saved view
|
|
4244
|
+
* holds. Read with `getView()`, shown with `setView()`, reported by
|
|
4245
|
+
* `onViewChange`.
|
|
4246
|
+
*/
|
|
4247
|
+
interface DataGridView {
|
|
4248
|
+
/** The sort criteria, in order. */
|
|
4249
|
+
sort: SortState[];
|
|
4250
|
+
/** The column filters in force. */
|
|
4251
|
+
filters: FilterValue[];
|
|
4252
|
+
/** The text of the search field. */
|
|
4253
|
+
search: string;
|
|
4254
|
+
/** Keys of the hidden columns. */
|
|
4255
|
+
hiddenColumns: string[];
|
|
4256
|
+
/** Keys of every column, the hidden ones included, in the order shown. */
|
|
4257
|
+
columnOrder: string[];
|
|
4258
|
+
/** Widths in pixels of the columns resized by hand, by key. */
|
|
4259
|
+
columnWidths: Record<string, number>;
|
|
4260
|
+
/** Rows per page. */
|
|
4261
|
+
pageSize: number;
|
|
4262
|
+
}
|
|
4263
|
+
/** What a `bulkActions` function receives: the selection, and a way to clear it. */
|
|
4264
|
+
interface DataGridSelection<T = unknown> {
|
|
4265
|
+
/** Every selected key, on every page. */
|
|
4266
|
+
keys: string[];
|
|
4267
|
+
/** The selected rows `data` holds, in its order: in server mode, those of the page shown. */
|
|
4268
|
+
rows: T[];
|
|
4269
|
+
/** Clears the selection. */
|
|
4270
|
+
clear: () => void;
|
|
4271
|
+
}
|
|
4194
4272
|
interface ColumnDef<T = unknown> {
|
|
4195
4273
|
/** Unique key matching a property in the data object */
|
|
4196
4274
|
key: string;
|
|
@@ -4219,7 +4297,10 @@ interface ColumnDef<T = unknown> {
|
|
|
4219
4297
|
filterOptions?: string[];
|
|
4220
4298
|
/** Custom cell renderer */
|
|
4221
4299
|
render?: (value: unknown, row: T, rowIndex: number) => ReactNode;
|
|
4222
|
-
/**
|
|
4300
|
+
/**
|
|
4301
|
+
* Custom header renderer. In a column that sorts, it is drawn inside the
|
|
4302
|
+
* sort button: no button, link or field in it.
|
|
4303
|
+
*/
|
|
4223
4304
|
renderHeader?: (column: ColumnDef<T>) => ReactNode;
|
|
4224
4305
|
/** Column is resizable */
|
|
4225
4306
|
resizable?: boolean;
|
|
@@ -4285,6 +4366,12 @@ interface DataGridProps<T = unknown> {
|
|
|
4285
4366
|
page?: number;
|
|
4286
4367
|
/** Page change callback */
|
|
4287
4368
|
onPageChange?: (page: number) => void;
|
|
4369
|
+
/**
|
|
4370
|
+
* Rows per page (controlled). The size selector calls `onPageSizeChange`
|
|
4371
|
+
* and shows what this says; `pagination.pageSize` is where an uncontrolled
|
|
4372
|
+
* grid starts.
|
|
4373
|
+
*/
|
|
4374
|
+
pageSize?: number;
|
|
4288
4375
|
/** Page size change callback */
|
|
4289
4376
|
onPageSizeChange?: (pageSize: number) => void;
|
|
4290
4377
|
/** Total items for server-mode pagination */
|
|
@@ -4297,6 +4384,13 @@ interface DataGridProps<T = unknown> {
|
|
|
4297
4384
|
selectedRows?: string[];
|
|
4298
4385
|
/** Selection change callback */
|
|
4299
4386
|
onSelectionChange?: (selectedKeys: string[]) => void;
|
|
4387
|
+
/**
|
|
4388
|
+
* Actions on the selected rows, in a bar shown above the grid as soon as a
|
|
4389
|
+
* row is selected, beside the count and a button that clears the
|
|
4390
|
+
* selection. A function receives the selection: every selected key, and
|
|
4391
|
+
* the selected rows `data` holds.
|
|
4392
|
+
*/
|
|
4393
|
+
bulkActions?: ReactNode | ((selection: DataGridSelection<T>) => ReactNode);
|
|
4300
4394
|
/** Enable global search */
|
|
4301
4395
|
searchable?: boolean;
|
|
4302
4396
|
/** Search placeholder */
|
|
@@ -4309,6 +4403,12 @@ interface DataGridProps<T = unknown> {
|
|
|
4309
4403
|
filters?: FilterValue[];
|
|
4310
4404
|
/** Column filter change callback */
|
|
4311
4405
|
onFilterChange?: (filters: FilterValue[]) => void;
|
|
4406
|
+
/**
|
|
4407
|
+
* Writes the column filters in force in a row above the grid, each removed
|
|
4408
|
+
* in one click, with a button that removes them all. On unless it is
|
|
4409
|
+
* `false`: a filter on a column out of sight is otherwise nowhere to be seen.
|
|
4410
|
+
*/
|
|
4411
|
+
showActiveFilters?: boolean;
|
|
4312
4412
|
/** Enable expandable rows */
|
|
4313
4413
|
expandable?: boolean;
|
|
4314
4414
|
/** Render expanded row content */
|
|
@@ -4330,16 +4430,53 @@ interface DataGridProps<T = unknown> {
|
|
|
4330
4430
|
* sort puts it.
|
|
4331
4431
|
*/
|
|
4332
4432
|
onReorder?: (fromIndex: number, toIndex: number) => void;
|
|
4333
|
-
/**
|
|
4433
|
+
/**
|
|
4434
|
+
* Lets the columns be reordered: dragged from one header to another, or
|
|
4435
|
+
* moved one place at a time from the column menu of the toolbar, which the
|
|
4436
|
+
* keyboard reaches.
|
|
4437
|
+
*/
|
|
4334
4438
|
columnReorderable?: boolean;
|
|
4335
|
-
/**
|
|
4439
|
+
/** Called with the column moved and the column whose place it takes, by a drop or from the column menu. */
|
|
4336
4440
|
onColumnReorder?: (fromKey: string, toKey: string) => void;
|
|
4441
|
+
/**
|
|
4442
|
+
* Keys of the columns in the order shown (controlled), the hidden ones
|
|
4443
|
+
* included. A column it does not name comes after the others, in the order
|
|
4444
|
+
* of `columns`; a key that names no column is passed over.
|
|
4445
|
+
*/
|
|
4446
|
+
columnOrder?: string[];
|
|
4447
|
+
/** Called with the new order of every column when one is dropped on another, or moved from the column menu. */
|
|
4448
|
+
onColumnOrderChange?: (order: string[]) => void;
|
|
4449
|
+
/**
|
|
4450
|
+
* Widths in pixels of the columns resized by hand (controlled), by key. A
|
|
4451
|
+
* column it does not name keeps its `width`.
|
|
4452
|
+
*/
|
|
4453
|
+
columnWidths?: Record<string, number>;
|
|
4454
|
+
/**
|
|
4455
|
+
* Called once a column has been resized, when the pointer is released or at
|
|
4456
|
+
* each press of an arrow key on its handle, with every width set by hand.
|
|
4457
|
+
* The column follows the pointer while it moves.
|
|
4458
|
+
*/
|
|
4459
|
+
onColumnWidthsChange?: (widths: Record<string, number>) => void;
|
|
4337
4460
|
/** Enable column visibility toggle */
|
|
4338
4461
|
columnToggle?: boolean;
|
|
4339
4462
|
/** Hidden column keys (controlled) */
|
|
4340
4463
|
hiddenColumns?: string[];
|
|
4341
4464
|
/** Column visibility change callback */
|
|
4342
4465
|
onColumnVisibilityChange?: (hiddenKeys: string[]) => void;
|
|
4466
|
+
/**
|
|
4467
|
+
* Where an uncontrolled grid starts: a view saved earlier, whole or in part.
|
|
4468
|
+
* Read at mount only. A part the grid receives through its own prop (`sort`,
|
|
4469
|
+
* `filters`…) is read from that prop, and `defaultSort` is read when the
|
|
4470
|
+
* view holds no `sort`.
|
|
4471
|
+
*/
|
|
4472
|
+
defaultView?: Partial<DataGridView>;
|
|
4473
|
+
/**
|
|
4474
|
+
* Called with the whole view whenever a part of it changes from inside the
|
|
4475
|
+
* grid — a sort, a filter, the search, a column hidden, moved or resized,
|
|
4476
|
+
* the page size — or through `setView`. What an application stores to give
|
|
4477
|
+
* each user the grid as they left it.
|
|
4478
|
+
*/
|
|
4479
|
+
onViewChange?: (view: DataGridView) => void;
|
|
4343
4480
|
/**
|
|
4344
4481
|
* Group rows by column key(s). The rows of a group are kept together, the
|
|
4345
4482
|
* groups in the order their first row comes in once sorted; pagination and
|
|
@@ -4410,8 +4547,9 @@ interface DataGridProps<T = unknown> {
|
|
|
4410
4547
|
*/
|
|
4411
4548
|
labels?: UILabelsOf<"dataGrid">;
|
|
4412
4549
|
/**
|
|
4413
|
-
* BCP 47 tag the footer aggregates are written in.
|
|
4414
|
-
* of `UILabelsProvider`, then to the language of
|
|
4550
|
+
* BCP 47 tag the footer aggregates and the active filters are written in.
|
|
4551
|
+
* Defaults to the `locale` of `UILabelsProvider`, then to the language of
|
|
4552
|
+
* the runtime.
|
|
4415
4553
|
*/
|
|
4416
4554
|
locale?: string;
|
|
4417
4555
|
/** Show footer with aggregates */
|
|
@@ -4446,7 +4584,15 @@ interface DataGridRef {
|
|
|
4446
4584
|
exportData: (format: "csv" | "json") => void;
|
|
4447
4585
|
/** Scroll to a specific row by index */
|
|
4448
4586
|
scrollToRow: (index: number) => void;
|
|
4587
|
+
/** The view the grid shows now: sort, filters, search, columns, page size. */
|
|
4588
|
+
getView: () => DataGridView;
|
|
4589
|
+
/**
|
|
4590
|
+
* Shows a view: each part it holds replaces the grid's own — a controlled
|
|
4591
|
+
* one through its callback — and the grid goes back to page 1.
|
|
4592
|
+
*/
|
|
4593
|
+
setView: (view: Partial<DataGridView>) => void;
|
|
4449
4594
|
}
|
|
4595
|
+
|
|
4450
4596
|
declare function DataGridInner<T>(props: DataGridProps<T>, ref: react__default.ForwardedRef<DataGridRef>): react_jsx_runtime.JSX.Element;
|
|
4451
4597
|
declare const DataGrid: <T = unknown>(props: DataGridProps<T> & {
|
|
4452
4598
|
ref?: react__default.Ref<DataGridRef>;
|
|
@@ -6244,6 +6390,10 @@ interface SelectOption {
|
|
|
6244
6390
|
interface SelectBaseProps {
|
|
6245
6391
|
options: SelectOption[];
|
|
6246
6392
|
searchable?: boolean;
|
|
6393
|
+
/**
|
|
6394
|
+
* A button that empties the field once it holds a value. From the keyboard,
|
|
6395
|
+
* Delete or Backspace on the field does the same.
|
|
6396
|
+
*/
|
|
6247
6397
|
clearable?: boolean;
|
|
6248
6398
|
disabled?: boolean;
|
|
6249
6399
|
readOnly?: boolean;
|
|
@@ -6473,7 +6623,7 @@ declare function Sidebar({ collapsed: collapsedProp, defaultCollapsed, onCollaps
|
|
|
6473
6623
|
declare function SidebarHeader({ className, children }: SidebarHeaderProps): react_jsx_runtime.JSX.Element;
|
|
6474
6624
|
declare function SidebarContent({ className, children }: SidebarContentProps): react_jsx_runtime.JSX.Element;
|
|
6475
6625
|
declare function SidebarFooter({ className, children }: SidebarFooterProps): react_jsx_runtime.JSX.Element;
|
|
6476
|
-
declare function SidebarGroup({ label, className, children
|
|
6626
|
+
declare function SidebarGroup({ label, className, children }: SidebarGroupProps): react_jsx_runtime.JSX.Element;
|
|
6477
6627
|
declare function SidebarItem({ icon, label, badge, badgeColor, active, disabled, href, onClick, tooltip, className, }: SidebarItemProps): react_jsx_runtime.JSX.Element;
|
|
6478
6628
|
declare function SidebarSubMenu({ icon, label, badge, defaultOpen, className, children, }: SidebarSubMenuProps): react_jsx_runtime.JSX.Element;
|
|
6479
6629
|
declare function SidebarToggle({ className }: SidebarToggleProps): react_jsx_runtime.JSX.Element;
|
|
@@ -7926,4 +8076,4 @@ declare function isFocusable(element: HTMLElement): boolean;
|
|
|
7926
8076
|
*/
|
|
7927
8077
|
declare function getFocusableElements(container: HTMLElement): HTMLElement[];
|
|
7928
8078
|
|
|
7929
|
-
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionSize, AccordionTrigger, type AccordionTriggerProps, type AccordionType, type AccordionVariant, AdvanceDetachable, type AdvanceDetachableProps, type AdvanceDetachableRef, type AdvanceDetachableRenderContext, type AggregateFunction, type Align, AreaChart, type AreaChartProps, Avatar, type AvatarProps, Badge, type BadgeColor, type BadgeProps, type BadgeSize, type BadgeVariant, Banner, type BannerProps, type BannerType, type BannerVariant, BarChart, type BarChartOrientation, type BarChartProps, type BinSpec, BoxPlot, type BoxPlotBox, type BoxPlotProps, type BoxPlotQuantileKeys, type BoxStats, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, BulletChart, type BulletChartProps, type BulletRow, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CHART_ALL_PAIRS_LIMIT, CHART_DIVERGING_COLORS, CHART_DIVERGING_DARK_STOPS, CHART_DIVERGING_NEUTRAL_INDEX, CHART_DOWN_COLOR, CHART_MAX_COLOR_CLASSES, CHART_MUTED_COLOR, CHART_ORDINAL_COLORS, CHART_ORDINAL_DARK_STOPS, CHART_PALETTE_SIZE, CHART_PATTERNS, CHART_POINT_BUDGET, CHART_SEQUENTIAL_COLORS, CHART_SEQUENTIAL_DARK_STOPS, CHART_SERIES_COLORS, CHART_SURFACE_COLOR, CHART_UP_COLOR, Calendar, type CalendarColor, type CalendarDateRange, type CalendarDayState, type CalendarLabels, type CalendarMode, type CalendarProps, type CalendarSize, type CalendarWeekStart, type Candle, CandlestickChart, type CandlestickChartProps, Card, CardBody, type CardBodyProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, CardImage, type CardImageProps, type CardProps, CardTitle, type CardTitleProps, type CartesianChartBaseProps, type CartesianGeometry, type CartesianGeometryOptions, type CartesianOrientation, type CategoryPlacement, type ChartAnnotation, type ChartAnnotationBase, ChartAnnotationLayer, type ChartAnnotationLayerProps, ChartAxis, type ChartAxisOrientation, type ChartAxisProps, type ChartBandAnnotation, ChartBrushLayer, type ChartBrushLayerProps, type ChartBrushRange, type ChartColorScale, ChartContainer, type ChartContainerProps, type ChartContainerRenderArgs, type ChartCurve, type ChartDatum, type ChartDimensions, ChartExportButton, type ChartExportButtonProps, type ChartExportFormat, type ChartExportOptions, type ChartExportRow, type ChartExportSource, type ChartFacetPanel, ChartFacets, type ChartFacetsProps, ChartFilterBar, type ChartFilterBarProps, ChartGrid, type ChartGridLines, type ChartGridProps, ChartLegend, type ChartLegendItem, type ChartLegendMarker, type ChartLegendPosition, type ChartLegendProps, type ChartLineAnnotation, type ChartMargin, type ChartOrientation, type ChartOverlay, type ChartOverlayRenderer, type ChartPattern, ChartPatternDefs, type ChartPatternDefsProps, type ChartPatternEntry, type ChartPeriod, ChartPeriodPicker, type ChartPeriodPickerProps, type ChartPeriodPreset, type ChartPlotContext, type ChartPoint, type ChartPointAnnotation, type ChartPointEvent, type ChartReferenceLine, type ChartResolvedSeries, ChartScaleLegend, type ChartScaleLegendProps, type ChartScaleType, type ChartSeries, type ChartSize, type ChartStatusProps, type ChartSyncContextValue, ChartSyncProvider, type ChartSyncProviderProps, ChartTableView, type ChartTableViewProps, type ChartTick, ChartTooltip, ChartTooltipContent, type ChartTooltipContentProps, type ChartTooltipPayload, type ChartTooltipProps, type ChartXAxisConfig, type ChartXValue, type ChartYAxisConfig, Checkbox, CheckboxGroup, CheckboxGroupItem, type CheckboxGroupItemProps, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipColor, type ChipProps, type ChipSize, type ChipVariant, CircularProgress, type CircularProgressColor, type CircularProgressProps, type CircularProgressSize, type CircularProgressThickness, type ColumnDef, CommandGroup, type CommandGroupProps, CommandItem, type CommandItemProps, CommandPalette, type CommandPaletteProps, DEFAULT_CHART_PERIOD_PRESETS, DEFAULT_CHART_WIDTH, DEFAULT_FIELD_TYPES, DataGrid, type DataGridMode, type DataGridProps, type DataGridRef, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DateRangePresetKey, type DateRangePresetOption, type Density, Detachable, type DetachableProps, type DetachableRef, DeviceMockup, type DeviceMockupProps, type DeviceOrientation, type DeviceSize, type DeviceTheme, type DeviceType, type DialogA11yProps, type DialogInitialFocus, type DialogReturnFocus, type DivergingScaleOptions, Divider, type DividerOrientation, type DividerProps, type DividerTextAlign, type DividerVariant, Drawer, type DrawerPosition, type DrawerProps, type DrawerSize, Dropdown, DropdownCheckboxItem, type DropdownCheckboxItemProps, DropdownContent, type DropdownContentProps, type DropdownContextValue, DropdownItem, type DropdownItemProps, DropdownLabel, type DropdownLabelProps, type DropdownProps, DropdownRadioGroup, type DropdownRadioGroupProps, DropdownRadioItem, type DropdownRadioItemProps, DropdownSeparator, type DropdownSeparatorProps, DropdownSubMenu, DropdownSubMenuContent, type DropdownSubMenuContentProps, type DropdownSubMenuProps, DropdownSubMenuTrigger, type DropdownSubMenuTriggerProps, DropdownTrigger, type DropdownTriggerProps, DumbbellChart, type DumbbellChartProps, type DumbbellRow, type DumbbellSort, EmptyState, type EmptyStateProps, type EmptyStateSize, FOCUSABLE_SELECTOR, FileSelector, type FileSelectorProps, type FilterOperator, type FilterType, type FilterValue, Footer, FooterBottom, type FooterBottomProps, FooterColumn, type FooterColumnProps, FooterLink, type FooterLinkProps, type FooterProps, FooterSection, type FooterSectionProps, FooterSocial, FooterSocialLink, type FooterSocialLinkProps, type FooterSocialProps, FormField, type FormFieldControlProps, type FormFieldProps, type FormFieldState, FunnelChart, type FunnelChartProps, type FunnelStage, GanttChart, type GanttChartProps, type GanttTask, Header, type HeaderProps, Heatmap, type HeatmapCell, type HeatmapProps, HelpButton, type HelpButtonProps, type HistogramBin, INERT_IGNORE_ATTRIBUTE, ImageUploader, type ImageUploaderProps, Indicator, type IndicatorColor, type IndicatorPlacement, type IndicatorProps, type IndicatorSize, type IndicatorVariant, Input, type InputProps, Label, type LabelColor, type LabelProps, type LabelSize, type LabelVariant, type LabelWeight, LineChart, type LineChartProps, MarkdownEditorComponent, type MentionData, MentionInput, type MentionInputProps, type MentionInputValue, type MentionSuggestion, Modal, type ModalProps, type NavItem, type NodeRegistryEntry, NumberInput, type NumberInputProps, Pagination, type PaginationConfig, type PaginationProps, PieChart, type PieChartProps, Popover, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, type Position, ProgressBar, type ProgressBarColor, type ProgressBarProps, type ProgressBarSize, type ProgressBarVariant, RadioButton, type RadioButtonProps, type ScatterBubble, ScatterChart, type ScatterChartProps, SchemaEditor, type SchemaEditorProps, type SchemaEditorRef, type SchemaField, type SchemaFieldEvent, type SchemaFieldType, type SchemaRelation, type SchemaRelationCardinality, type SchemaTable, type SchemaTableEvent, type SchemaValue, type SchemaViewport, Select, type SelectBaseProps, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectSingleProps, type SelectedFile, type SelectionMode, type SequentialScaleOptions, type Side, Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarGroup, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarItem, type SidebarItemProps, type SidebarPosition, type SidebarProps, SidebarSubMenu, type SidebarSubMenuProps, SidebarToggle, type SidebarToggleProps, type SidebarVariant, Skeleton, type SkeletonAnimation, type SkeletonProps, type SkeletonVariant, Slider, type SliderColor, type SliderMark, type SliderProps, type SliderSize, type SortDirection, type SortState, Sparkline, type SparklineProps, StatCard, type StatCardDelta, type StatCardDeltaDirection, type StatCardDeltaTone, StatCardGroup, type StatCardGroupProps, type StatCardProps, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHeader, TableHeaderCell, type TableHeaderCellProps, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsColor, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsOrientation, type TabsProps, type TabsSize, TabsTrigger, type TabsTriggerProps, type TabsVariant, type TimeTickScale, type TimeUnit, Timeline, TimelineItem, type TimelineItemColor, type TimelineItemProps, type TimelineItemStatus, type TimelineOrientation, type TimelineProps, Toast, type ToastAction, type ToastApi, type ToastCloseReason, type ToastContent, type ToastOptions, type ToastPosition, type ToastPromiseMessage, type ToastPromiseMessages, type ToastProps, type ToastType, type ToastVariant, Toaster, type ToasterProps, Tooltip, type TooltipPosition, type TooltipProps, type TooltipSize, type TooltipTrigger, type TooltipVariant, type TreeCheckState, type TreeItemState, type TreeNode, type TreeSelectionMode, TreeView, type TreeViewProps, type UILabels, type UILabelsOf, UILabelsProvider, type UILabelsProviderProps, type UILinkComponent, type UILinkProps, type UseChartBrushOptions, type UseChartBrushResult, type UseChartSizeOptions, type UseChartSizeResult, type UseClickOutsideOptions, type UseDialogA11yOptions, type UseDialogA11yResult, type UseKeyboardNavigationOptions, type UsePositioningOptions, WaterfallChart, type WaterfallChartProps, type WaterfallKind, type WaterfallStep, WithHelpButton, type WithHelpButtonProps, Wizard, WizardActions, type WizardActionsProps, type WizardColor, WizardContent, type WizardContentProps, type WizardContextValue, type WizardDirection, WizardNext, type WizardNextProps, type WizardOrientation, WizardPanel, type WizardPanelProps, WizardPrevious, type WizardPreviousProps, type WizardProps, type WizardSize, type WizardStepChangeMeta, type WizardStepDefinition, type WizardStepStatus, WizardSteps, type WizardStepsProps, type WizardVariant, type WorkflowDirection, type WorkflowEdge, WorkflowEditor, type WorkflowEditorProps, type WorkflowEditorRef, type WorkflowNode, type WorkflowNodeAction, type WorkflowNodeActionEvent, type WorkflowNodeActionPosition, type WorkflowNodeEvent, type WorkflowPort, type WorkflowValue, type WorkflowViewport, autoLayoutTables, binEdges, binValues, boxStats, brushToPeriod, buildCartesianGeometry, cn, createCategoryLocator, createDefaultField, createDefaultTable, createDivergingScale, createPeriod, createPlotContext, createSequentialScale, decimateIndices, decimatePath, defaultUILabels, describeAnnotations, downloadChartData, endOfDay, findOwnedLayers, formatPeriodRange, formatTimeTick, formatUILabel, frenchUILabels, generateFieldId, generateRelationId, generateSQL, generateTableId, getFocusableElements, getOrdinalColor, getPattern, getSeriesColor, getSeriesLabel, hideOthers, isElementVisible, isFocusable, lttb, niceTimeTicks, patternBackground, patternFill, patternId, quantile, quantileSorted, rampColor, registerFloatingLayer, resetBarChartWarnings, resetDumbbellWarnings, resetFacetWarnings, resetPointBudgetWarning, resolvePeriodPreset, resolveSeriesColor, samePeriod, sampleEvenly, splitOverlay, startOfDay, sturgesBins, toChartCsv, toChartJson, toChartRows, toLegendItems, toTimestamp, toast, useChartBrush, useChartSize, useChartSync, useClickOutside, useDialogA11y, useDropdownContext, useFocusItem, useKeyboardNavigation, usePositioning, useSidebar, useToast, useUILabels, useUILinkComponent, useUILocale, useWizard };
|
|
8079
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionSize, AccordionTrigger, type AccordionTriggerProps, type AccordionType, type AccordionVariant, AdvanceDetachable, type AdvanceDetachableProps, type AdvanceDetachableRef, type AdvanceDetachableRenderContext, type AggregateFunction, type Align, AreaChart, type AreaChartProps, Avatar, type AvatarProps, Badge, type BadgeColor, type BadgeProps, type BadgeSize, type BadgeVariant, Banner, type BannerProps, type BannerType, type BannerVariant, BarChart, type BarChartOrientation, type BarChartProps, type BinSpec, BoxPlot, type BoxPlotBox, type BoxPlotProps, type BoxPlotQuantileKeys, type BoxStats, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, BulletChart, type BulletChartProps, type BulletRow, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CHART_ALL_PAIRS_LIMIT, CHART_DIVERGING_COLORS, CHART_DIVERGING_DARK_STOPS, CHART_DIVERGING_NEUTRAL_INDEX, CHART_DOWN_COLOR, CHART_MAX_COLOR_CLASSES, CHART_MUTED_COLOR, CHART_ORDINAL_COLORS, CHART_ORDINAL_DARK_STOPS, CHART_PALETTE_SIZE, CHART_PATTERNS, CHART_POINT_BUDGET, CHART_SEQUENTIAL_COLORS, CHART_SEQUENTIAL_DARK_STOPS, CHART_SERIES_COLORS, CHART_SURFACE_COLOR, CHART_UP_COLOR, Calendar, type CalendarColor, type CalendarDateRange, type CalendarDayState, type CalendarLabels, type CalendarMode, type CalendarProps, type CalendarSize, type CalendarWeekStart, type Candle, CandlestickChart, type CandlestickChartProps, Card, CardBody, type CardBodyProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, CardImage, type CardImageProps, type CardProps, CardTitle, type CardTitleProps, type CartesianChartBaseProps, type CartesianGeometry, type CartesianGeometryOptions, type CartesianOrientation, type CategoryPlacement, type ChartAnnotation, type ChartAnnotationBase, ChartAnnotationLayer, type ChartAnnotationLayerProps, ChartAxis, type ChartAxisOrientation, type ChartAxisProps, type ChartBandAnnotation, ChartBrushLayer, type ChartBrushLayerProps, type ChartBrushRange, type ChartColorScale, ChartContainer, type ChartContainerProps, type ChartContainerRenderArgs, type ChartCurve, type ChartDatum, type ChartDimensions, ChartExportButton, type ChartExportButtonProps, type ChartExportFormat, type ChartExportOptions, type ChartExportRow, type ChartExportSource, type ChartFacetPanel, ChartFacets, type ChartFacetsProps, ChartFilterBar, type ChartFilterBarProps, ChartGrid, type ChartGridLines, type ChartGridProps, ChartLegend, type ChartLegendItem, type ChartLegendMarker, type ChartLegendPosition, type ChartLegendProps, type ChartLineAnnotation, type ChartMargin, type ChartOrientation, type ChartOverlay, type ChartOverlayRenderer, type ChartPattern, ChartPatternDefs, type ChartPatternDefsProps, type ChartPatternEntry, type ChartPeriod, ChartPeriodPicker, type ChartPeriodPickerProps, type ChartPeriodPreset, type ChartPlotContext, type ChartPoint, type ChartPointAnnotation, type ChartPointEvent, type ChartReferenceLine, type ChartResolvedSeries, ChartScaleLegend, type ChartScaleLegendProps, type ChartScaleType, type ChartSeries, type ChartSize, type ChartStatusProps, type ChartSyncContextValue, ChartSyncProvider, type ChartSyncProviderProps, ChartTableView, type ChartTableViewProps, type ChartTick, ChartTooltip, ChartTooltipContent, type ChartTooltipContentProps, type ChartTooltipPayload, type ChartTooltipProps, type ChartXAxisConfig, type ChartXValue, type ChartYAxisConfig, Checkbox, CheckboxGroup, CheckboxGroupItem, type CheckboxGroupItemProps, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipColor, type ChipProps, type ChipSize, type ChipVariant, CircularProgress, type CircularProgressColor, type CircularProgressProps, type CircularProgressSize, type CircularProgressThickness, type ColumnDef, CommandGroup, type CommandGroupProps, CommandItem, type CommandItemProps, CommandPalette, type CommandPaletteProps, DEFAULT_CHART_PERIOD_PRESETS, DEFAULT_CHART_WIDTH, DEFAULT_FIELD_TYPES, DataGrid, type DataGridMode, type DataGridProps, type DataGridRef, type DataGridSelection, type DataGridView, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DateRangePresetKey, type DateRangePresetOption, type Density, Detachable, type DetachableProps, type DetachableRef, DeviceMockup, type DeviceMockupProps, type DeviceOrientation, type DeviceSize, type DeviceTheme, type DeviceType, type DialogA11yProps, type DialogInitialFocus, type DialogReturnFocus, type DivergingScaleOptions, Divider, type DividerOrientation, type DividerProps, type DividerTextAlign, type DividerVariant, Drawer, type DrawerPosition, type DrawerProps, type DrawerSize, Dropdown, DropdownCheckboxItem, type DropdownCheckboxItemProps, DropdownContent, type DropdownContentProps, type DropdownContextValue, DropdownItem, type DropdownItemProps, DropdownLabel, type DropdownLabelProps, type DropdownProps, DropdownRadioGroup, type DropdownRadioGroupProps, DropdownRadioItem, type DropdownRadioItemProps, DropdownSeparator, type DropdownSeparatorProps, DropdownSubMenu, DropdownSubMenuContent, type DropdownSubMenuContentProps, type DropdownSubMenuProps, DropdownSubMenuTrigger, type DropdownSubMenuTriggerProps, DropdownTrigger, type DropdownTriggerProps, DumbbellChart, type DumbbellChartProps, type DumbbellRow, type DumbbellSort, EmptyState, type EmptyStateProps, type EmptyStateSize, FOCUSABLE_SELECTOR, FileSelector, type FileSelectorProps, type FilterOperator, type FilterType, type FilterValue, Footer, FooterBottom, type FooterBottomProps, FooterColumn, type FooterColumnProps, FooterLink, type FooterLinkProps, type FooterProps, FooterSection, type FooterSectionProps, FooterSocial, FooterSocialLink, type FooterSocialLinkProps, type FooterSocialProps, FormField, type FormFieldControlProps, type FormFieldProps, type FormFieldState, FunnelChart, type FunnelChartProps, type FunnelStage, GanttChart, type GanttChartProps, type GanttTask, Header, type HeaderProps, Heatmap, type HeatmapCell, type HeatmapProps, HelpButton, type HelpButtonProps, type HistogramBin, INERT_IGNORE_ATTRIBUTE, ImageUploader, type ImageUploaderProps, Indicator, type IndicatorColor, type IndicatorPlacement, type IndicatorProps, type IndicatorSize, type IndicatorVariant, Input, type InputProps, Label, type LabelColor, type LabelProps, type LabelSize, type LabelVariant, type LabelWeight, LineChart, type LineChartProps, MarkdownEditorComponent, type MentionData, MentionInput, type MentionInputProps, type MentionInputValue, type MentionSuggestion, Modal, type ModalProps, type NavItem, type NodeRegistryEntry, NumberInput, type NumberInputProps, Pagination, type PaginationConfig, type PaginationProps, PieChart, type PieChartProps, Popover, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, type Position, ProgressBar, type ProgressBarColor, type ProgressBarProps, type ProgressBarSize, type ProgressBarVariant, RadioButton, type RadioButtonProps, type ScatterBubble, ScatterChart, type ScatterChartProps, SchemaEditor, type SchemaEditorProps, type SchemaEditorRef, type SchemaField, type SchemaFieldEvent, type SchemaFieldType, type SchemaRelation, type SchemaRelationCardinality, type SchemaTable, type SchemaTableEvent, type SchemaValue, type SchemaViewport, Select, type SelectBaseProps, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectSingleProps, type SelectedFile, type SelectionMode, type SequentialScaleOptions, type Side, Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarGroup, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarItem, type SidebarItemProps, type SidebarPosition, type SidebarProps, SidebarSubMenu, type SidebarSubMenuProps, SidebarToggle, type SidebarToggleProps, type SidebarVariant, Skeleton, type SkeletonAnimation, type SkeletonProps, type SkeletonVariant, Slider, type SliderColor, type SliderMark, type SliderProps, type SliderSize, type SortDirection, type SortState, Sparkline, type SparklineProps, StatCard, type StatCardDelta, type StatCardDeltaDirection, type StatCardDeltaTone, StatCardGroup, type StatCardGroupProps, type StatCardProps, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHeader, TableHeaderCell, type TableHeaderCellProps, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsColor, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsOrientation, type TabsProps, type TabsSize, TabsTrigger, type TabsTriggerProps, type TabsVariant, type TimeTickScale, type TimeUnit, Timeline, TimelineItem, type TimelineItemColor, type TimelineItemProps, type TimelineItemStatus, type TimelineOrientation, type TimelineProps, Toast, type ToastAction, type ToastApi, type ToastCloseReason, type ToastContent, type ToastOptions, type ToastPosition, type ToastPromiseMessage, type ToastPromiseMessages, type ToastProps, type ToastType, type ToastVariant, Toaster, type ToasterProps, Tooltip, type TooltipPosition, type TooltipProps, type TooltipSize, type TooltipTrigger, type TooltipVariant, type TreeCheckState, type TreeItemState, type TreeNode, type TreeSelectionMode, TreeView, type TreeViewProps, type UILabels, type UILabelsOf, UILabelsProvider, type UILabelsProviderProps, type UILinkComponent, type UILinkProps, type UseChartBrushOptions, type UseChartBrushResult, type UseChartSizeOptions, type UseChartSizeResult, type UseClickOutsideOptions, type UseDialogA11yOptions, type UseDialogA11yResult, type UseKeyboardNavigationOptions, type UsePositioningOptions, WaterfallChart, type WaterfallChartProps, type WaterfallKind, type WaterfallStep, WithHelpButton, type WithHelpButtonProps, Wizard, WizardActions, type WizardActionsProps, type WizardColor, WizardContent, type WizardContentProps, type WizardContextValue, type WizardDirection, WizardNext, type WizardNextProps, type WizardOrientation, WizardPanel, type WizardPanelProps, WizardPrevious, type WizardPreviousProps, type WizardProps, type WizardSize, type WizardStepChangeMeta, type WizardStepDefinition, type WizardStepStatus, WizardSteps, type WizardStepsProps, type WizardVariant, type WorkflowDirection, type WorkflowEdge, WorkflowEditor, type WorkflowEditorProps, type WorkflowEditorRef, type WorkflowNode, type WorkflowNodeAction, type WorkflowNodeActionEvent, type WorkflowNodeActionPosition, type WorkflowNodeEvent, type WorkflowPort, type WorkflowValue, type WorkflowViewport, autoLayoutTables, binEdges, binValues, boxStats, brushToPeriod, buildCartesianGeometry, cn, createCategoryLocator, createDefaultField, createDefaultTable, createDivergingScale, createPeriod, createPlotContext, createSequentialScale, decimateIndices, decimatePath, defaultUILabels, describeAnnotations, downloadChartData, endOfDay, findOwnedLayers, formatPeriodRange, formatTimeTick, formatUILabel, frenchUILabels, generateFieldId, generateRelationId, generateSQL, generateTableId, getFocusableElements, getOrdinalColor, getPattern, getSeriesColor, getSeriesLabel, hideOthers, isElementVisible, isFocusable, lttb, niceTimeTicks, patternBackground, patternFill, patternId, quantile, quantileSorted, rampColor, registerFloatingLayer, resetBarChartWarnings, resetDumbbellWarnings, resetFacetWarnings, resetPointBudgetWarning, resolvePeriodPreset, resolveSeriesColor, samePeriod, sampleEvenly, splitOverlay, startOfDay, sturgesBins, toChartCsv, toChartJson, toChartRows, toLegendItems, toTimestamp, toast, useChartBrush, useChartSize, useChartSync, useClickOutside, useDialogA11y, useDropdownContext, useFocusItem, useKeyboardNavigation, usePositioning, useSidebar, useToast, useUILabels, useUILinkComponent, useUILocale, useWizard };
|