@next-bricks/diagram 0.29.0 → 0.30.0
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/bricks.json +5 -5
- package/dist/chunks/1728.cf49ae61.js +2 -0
- package/dist/chunks/1728.cf49ae61.js.map +1 -0
- package/dist/chunks/709.bc74a999.js +2 -0
- package/dist/chunks/709.bc74a999.js.map +1 -0
- package/dist/chunks/editable-label.e37e189e.js +3 -0
- package/dist/chunks/{editable-label.8e6f528c.js.map → editable-label.e37e189e.js.map} +1 -1
- package/dist/chunks/eo-display-canvas.74087b7e.js +2 -0
- package/dist/chunks/eo-display-canvas.74087b7e.js.map +1 -0
- package/dist/chunks/eo-draw-canvas.5602b10d.js +2 -0
- package/dist/chunks/eo-draw-canvas.5602b10d.js.map +1 -0
- package/dist/chunks/main.229129b2.js +2 -0
- package/dist/chunks/{main.08edb90f.js.map → main.229129b2.js.map} +1 -1
- package/dist/examples.json +3 -3
- package/dist/index.439a5d8f.js +2 -0
- package/dist/{index.6f17b5d2.js.map → index.439a5d8f.js.map} +1 -1
- package/dist/manifest.json +116 -116
- package/dist/types.json +3236 -3158
- package/dist-types/draw-canvas/CellComponent.d.ts +3 -4
- package/dist-types/draw-canvas/EdgeComponent.d.ts +3 -4
- package/dist-types/draw-canvas/constants.d.ts +3 -0
- package/dist-types/draw-canvas/interfaces.d.ts +13 -0
- package/dist-types/shared/canvas/useLineMarkers.d.ts +10 -0
- package/package.json +2 -2
- package/dist/chunks/1728.1dbc9d53.js +0 -2
- package/dist/chunks/1728.1dbc9d53.js.map +0 -1
- package/dist/chunks/2311.1877f3a0.js +0 -2
- package/dist/chunks/2311.1877f3a0.js.map +0 -1
- package/dist/chunks/editable-label.8e6f528c.js +0 -3
- package/dist/chunks/eo-display-canvas.577f0b51.js +0 -2
- package/dist/chunks/eo-display-canvas.577f0b51.js.map +0 -1
- package/dist/chunks/eo-draw-canvas.cdb7565f.js +0 -2
- package/dist/chunks/eo-draw-canvas.cdb7565f.js.map +0 -1
- package/dist/chunks/main.08edb90f.js +0 -2
- package/dist/index.6f17b5d2.js +0 -2
- /package/dist/chunks/{editable-label.8e6f528c.js.LICENSE.txt → editable-label.e37e189e.js.LICENSE.txt} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[2311],{3739:(e,t,r)=>{r.d(t,{c:()=>o});var n=r(8769),a=r.n(n);function o(e){var t,{id:r,type:n,strokeColor:o}=e;switch(n){case"0..1":t=l;break;case"0..N":t=d;break;default:t=i}return a().createElement(t,{id:r,strokeColor:o})}function i(e){var{id:t,strokeColor:r}=e;return a().createElement("marker",{id:t,viewBox:"0 0 6 6",refX:5,refY:3,markerWidth:6,markerHeight:6,orient:"auto-start-reverse",strokeLinejoin:"round"},a().createElement("path",{d:"M 0.5 0.5 L 5.5 3 L 0.5 5.5 z",stroke:r,strokeWidth:1,fill:r}))}function l(e){var{id:t,strokeColor:r}=e;return a().createElement("marker",{id:t,viewBox:"0 0 21 11",refX:.5,refY:5.5,markerWidth:21,markerHeight:11,orient:"auto-start-reverse"},a().createElement("path",{d:"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 15.5 0.5 V 10.5 M 10.5 5.5 H 20.5",stroke:r,strokeWidth:1,fill:"none"}))}function d(e){var{id:t,strokeColor:r}=e;return a().createElement("marker",{id:t,viewBox:"0 0 21 11",refX:.5,refY:5.5,markerWidth:21,markerHeight:11,orient:"auto-start-reverse"},a().createElement("path",{d:"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 20.5 0.5 L 10.5 5.5 L 20.5 10.5 M 10.5 5.5 H 20.5",stroke:r,strokeWidth:1,fill:"none"}))}},3188:(e,t,r)=>{r.d(t,{h:()=>a});var n=r(733);function a(e,t){if(e===t||(0,n.w)(e,t,0,0))return null;var r,a,o,i,l=t.x-e.x,d=t.y-e.y,c=l>0?1:-1;if(0!==d){var s=Math.abs(l/d),u=d>0?1:-1;s<e.width/e.height?(r=e.x+s*e.height/2*c,a=e.y+e.height/2*u):(r=e.x+e.width/2*c,a=e.y+e.width/2/s*u),s<t.width/t.height?(o=t.x-s*t.height/2*c,i=t.y-t.height/2*u):(o=t.x-t.width/2*c,i=t.y-t.width/2/s*u)}else r=e.x+e.width/2*c,o=t.x-t.width/2*c,a=i=e.y;return[{x:r,y:a},{x:o,y:i}]}},733:(e,t,r)=>{function n(e,t,r,n){var o=r?a(e,r):e,i=n?a(t,n):t,l=Math.min(o.x-o.width/2,i.x-i.width/2),d=Math.max(o.x+o.width/2,i.x+i.width/2),c=Math.min(o.y-o.height/2,i.y-i.height/2),s=Math.max(o.y+o.height/2,i.y+i.height/2);return d-l<o.width+i.width&&s-c<o.height+i.height}function a(e,t){return{x:e.x-e.width/2-t,y:e.y-e.height/2-t,width:e.width+2*t,height:e.height+2*t}}r.d(t,{w:()=>n})},8802:(e,t,r)=>{function n(e){if(Array.isArray(e)){var t=e[0],r=e.length>1?e[1]:t;return[t,r,e.length>2?e[2]:t,e.length>3?e[3]:r]}return new Array(4).fill(e)}r.d(t,{D:()=>n})},2830:(e,t,r)=>{r.d(t,{m:()=>z});var n=r(8769),a=r.n(n),o=r(3373),i=r.n(o),l=r(531),d=r(7410),c=r(3188);function s(e,t){return e.find((e=>(0,l.N)(e)&&e.id===t))}function u(e){var{edge:t,cells:r,markerEnd:o,defaultEdgeLines:l}=e,u=(0,n.useMemo)((()=>s(r,t.source)),[r,t.source]),v=(0,n.useMemo)((()=>s(r,t.target)),[r,t.target]),f=(0,n.useMemo)((()=>null==l?void 0:l.find((e=>(0,d.checkIfByTransform)(e,{edge:t})))),[l,t]),m=(0,n.useMemo)((()=>u&&v&&null!=u.view.x&&null!=v.view.x?(0,c.h)(h(u.view,5),h(v.view,5)):null),[u,v]);if(!m)return null;var g="M".concat(m[0].x," ").concat(m[0].y,"L").concat(m[1].x," ").concat(m[1].y);return a().createElement(a().Fragment,null,a().createElement("path",{d:g,fill:"none",stroke:"transparent",strokeWidth:16}),a().createElement("path",{className:i()("line",{dashed:null==f?void 0:f.dashed}),d:g,fill:"none",stroke:"gray",markerEnd:"url(#".concat(o,")")}),a().createElement("path",{className:"line-active-bg",d:g,fill:"none"}))}function h(e,t){return{x:e.x+e.width/2,y:e.y+e.height/2,width:e.width+t,height:e.height+t}}var v=r(4993),f=r(1030),m=r(9126);function g(e){var{node:t,defaultNodeBricks:r,onResize:o}=e,i=function(e){var[t,r]=(0,n.useState)(e);return(0,n.useEffect)((()=>{r((t=>(0,f.isEqual)(t,e)?t:e))}),[e]),t}({node:{id:t.id,data:t.data}}),l=t.useBrick,c=(0,n.useRef)(null),s=(0,n.useMemo)((()=>{var e;return null!=l?l:null==r||null===(e=r.find((e=>(0,d.checkIfByTransform)(e,i))))||void 0===e?void 0:e.useBrick}),[r,l,i]),u=(0,n.useCallback)((e=>{var r=c.current;r&&(r.disconnect(),c.current=null),e?setTimeout((()=>{var r=new m.A((()=>{o(t.id,[e.offsetWidth,e.offsetHeight])}));r.observe(e),c.current=r})):o(t.id,null)}),[t.id,o]);return s?a().createElement("foreignObject",{width:9999,height:9999,className:"node"},s&&a().createElement(v.ReactUseBrick,{useBrick:s,data:i,refCallback:u})):null}function p(e){return"edge"===e.type?(0,f.pick)(e,["type","source","target","data"]):(0,f.pick)(e,["type","id","data"])}function w(e,t){var{action:r,cell:n,scale:a,layout:o,onCellMoving:i,onCellMoved:d,onCellResizing:c,onCellResized:s,onSwitchActiveTarget:u}=t;if(e.stopPropagation(),null==u||u(p(n)),!(0,l.WW)(n)&&("force"!==o&&"dagre"!==o||!(0,l.N)(n))){var h=[e.clientX,e.clientY],v="move"===r?[n.view.x,n.view.y]:[n.view.width,n.view.height],f=!1,m=(e,t)=>{var o,l,u=function(e){return[(e.clientX-h[0])/a,(e.clientY-h[1])/a]}(e);f||(f=u[0]**2+u[1]**2>=9),f&&("move"===r?null===(o=t?d:i)||void 0===o||o({type:n.type,id:n.id,x:v[0]+u[0],y:v[1]+u[1]}):null===(l=t?s:c)||void 0===l||l({type:n.type,id:n.id,width:v[0]+u[0],height:v[1]+u[1]}))},g=e=>{m(e)},w=e=>{m(e,!0),f=!1,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",w)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",w)}}function y(e){var{cell:t,transform:r,readOnly:o,onCellResizing:i,onCellResized:l,onSwitchActiveTarget:d}=e,c=a().useRef(null);return(0,n.useEffect)((()=>{var e=c.current;if(e&&!o){var n=e=>{w(e,{action:"resize",cell:t,scale:r.k,onCellResizing:i,onCellResized:l,onSwitchActiveTarget:d})};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}}}),[t,l,i,d,o,r.k]),a().createElement("g",{className:"decorator-area"},a().createElement("rect",{width:t.view.width,height:t.view.height,className:"area"}),!o&&a().createElement("g",{ref:c,className:"resize-handle",transform:"translate(".concat(t.view.width-20," ").concat(t.view.height-20,")")},a().createElement("rect",{width:20,height:20}),a().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})))}var x=r(9740);function k(e){var t,{cell:r,readOnly:o,onDecoratorTextEditing:l,onDecoratorTextChange:d}=e,c=null!==(t=r.view.text)&&void 0!==t?t:"",[s,u]=(0,n.useState)(c),[h,v]=(0,n.useState)(!1),f=(0,n.useRef)(!1),[m,g]=(0,n.useState)(!1),p=(0,n.useRef)(null),w=(0,n.useCallback)((e=>{o||(e.preventDefault(),e.stopPropagation(),v(!0))}),[o]);(0,n.useEffect)((()=>{var e=p.current;e&&e.textContent!==s&&(e.textContent=s)}),[s]),(0,n.useEffect)((()=>{h&&p.current&&(p.current.focus(),function(e){var t=document.createRange();t.selectNodeContents(e);var r=window.getSelection();r.removeAllRanges(),r.addRange(t)}(p.current)),null==l||l({id:r.id,editing:h})}),[r.id,h,l]),(0,n.useEffect)((()=>{f.current?null==l||l({id:r.id,editing:h}):f.current=!0}),[r.id,h,l]);var y=(0,n.useCallback)((e=>{o||u(e.target.textContent)}),[o]),k=(0,n.useCallback)((()=>{o||(v(!1),g(!0))}),[o]);return(0,n.useEffect)((()=>{m&&(null==d||d({id:r.id,view:(0,x.A)((0,x.A)({},r.view),{},{text:s})}),g(!1))}),[r,s,d,m]),a().createElement("foreignObject",{className:"decorator-text"},a().createElement("div",{className:i()("text-container",{editing:h}),onDoubleClick:w},a().createElement("div",{className:"text",contentEditable:h,ref:p,onInput:y,onBlur:k})))}function E(e){var t,{cell:r,transform:n,readOnly:o,onCellResizing:i,onCellResized:l,onSwitchActiveTarget:d,onDecoratorTextEditing:c,onDecoratorTextChange:s}=e;switch(r.decorator){case"area":t=y;break;case"text":t=k;break;default:return console.error("Unknown decorator: ".concat(r.decorator)),null}return a().createElement(t,{cell:r,transform:n,readOnly:o,onCellResizing:i,onCellResized:l,onSwitchActiveTarget:d,onDecoratorTextEditing:c,onDecoratorTextChange:s})}var b=r(8185);function z(e){var{layout:t,cell:r,cells:o,defaultNodeBricks:d,defaultEdgeLines:c,markerEnd:s,active:h,readOnly:v,transform:f,unrelatedCells:m,onCellMoving:y,onCellMoved:x,onCellResizing:k,onCellResized:z,onSwitchActiveTarget:C,onCellContextMenu:A,onDecoratorTextEditing:M,onDecoratorTextChange:R,onNodeBrickResize:N,onCellMouseEnter:L,onCellMouseLeave:S}=e,T=(0,n.useRef)(null),D=(0,n.useMemo)((()=>m.some((e=>(0,b.c)(e,r)))),[r,m]);(0,n.useEffect)((()=>{var e=T.current;if(e&&!v){var n=e=>{w(e,{layout:t,action:"move",cell:r,scale:f.k,onCellMoving:y,onCellMoved:x,onSwitchActiveTarget:C})};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}}}),[t,r,x,y,C,v,f.k]);var W=(0,n.useCallback)((e=>{v&&"decorator"===r.type||(e.preventDefault(),C(p(r)),A({cell:r,clientX:e.clientX,clientY:e.clientY}))}),[r,A,C,v]),H=(0,n.useCallback)((()=>{null==L||L(r)}),[r,L]),B=(0,n.useCallback)((()=>{null==S||S(r)}),[r,S]);return a().createElement("g",{className:i()("cell",{active:h,faded:D,"read-only":v}),ref:T,transform:"edge"===r.type||null==r.view.x?void 0:"translate(".concat(r.view.x," ").concat(r.view.y,")"),onContextMenu:W,onMouseEnter:H,onMouseLeave:B},(0,l.N)(r)?a().createElement(g,{node:r,defaultNodeBricks:d,onResize:N}):(0,l.WW)(r)?a().createElement(u,{edge:r,defaultEdgeLines:c,cells:o,markerEnd:s}):(0,l.mH)(r)?a().createElement(E,{cell:r,transform:f,readOnly:v,onCellResizing:k,onCellResized:z,onSwitchActiveTarget:C,onDecoratorTextEditing:M,onDecoratorTextChange:R}):null)}},3033:(e,t,r)=>{r.d(t,{CV:()=>n,HP:()=>o,N8:()=>l,Yt:()=>s,sS:()=>c,sz:()=>i,w1:()=>d,xc:()=>a});var n=Symbol.for("size-initialized"),a=Symbol.for("layout-initialized"),o=20,i=36,l=100,d=60,c=.5,s=2},531:(e,t,r)=>{function n(e){return"node"===e.type}function a(e){return"decorator"===e.type}function o(e){return"node"===e.type}function i(e){return"edge"===e.type}function l(e){return"node"===e.type||"edge"===e.type}r.d(t,{N:()=>n,WW:()=>i,mH:()=>a,nv:()=>l,vC:()=>o})},227:(e,t,r)=>{r.d(t,{Y:()=>a});var n=r(8185);function a(e,t,r){var a=[];if(t){var o=new Set;for(var i of e)"edge"===i.type&&i.source===t.source.id&&o.add(i.target);for(var l of e)"node"===l.type?o.has(l.id)&&a.push(l):a.push(l)}else switch(null==r?void 0:r.type){case"node":var d=new Map,c=new Set([r.id]);for(var s of e)"node"===s.type?d.set(s.id,s):"edge"===s.type?s.source===r.id?c.add(s.target):s.target===r.id?c.add(s.source):a.push(s):a.push(s);for(var[u,h]of d)c.has(u)||a.push(h);break;case"edge":for(var v of e)("edge"===v.type?(0,n.c)(v,r):"node"===v.type&&(v.id===r.source||v.id===r.target))||a.push(v);break;case"decorator":for(var f of e)"decorator"===f.type&&f.id===r.id||a.push(f)}return a}},3783:(e,t,r)=>{r.d(t,{C:()=>o});var n=r(9740),a=r(531);function o(e,t){var{defaultNodeSize:r}=t;return(null!=e?e:[]).map((e=>{var t,o;return!(0,a.vC)(e)||void 0!==(null===(t=e.view)||void 0===t?void 0:t.width)&&void 0!==(null===(o=e.view)||void 0===o?void 0:o.height)?e:(0,n.A)((0,n.A)({},e),{},{view:(0,n.A)({width:r[0],height:r[1]},e.view)})}))}},8185:(e,t,r)=>{function n(e,t){return e?!!t&&e.type===t.type&&("node"===e.type||"decorator"===e.type?e.id===t.id:e.source===t.source&&e.target===t.target):!t}r.d(t,{c:()=>n})},908:(e,t,r)=>{r.d(t,{r:()=>a});var n=r(531);function a(e,t){var{canvasWidth:r,canvasHeight:a,scaleRange:o}=t,i=1/0,l=1/0,d=-1/0,c=-1/0,s=!0;for(var u of e)if(!(0,n.WW)(u)){s=!1;var{view:h}=u,v=h.x+h.width,f=h.y+h.height;h.x<i&&(i=h.x),v>d&&(d=v),h.y<l&&(l=h.y),f>c&&(c=f)}var m=d-i,g=c-l,p=o&&!s&&(m>r||g>a)?Math.max(Math.min(r/m,a/g,o[1]),o[0]):1;return{x:s?0:(r-m*p)/2-i*p,y:s?0:(a-g*p)/2-l*p,k:p}}},1083:(e,t,r)=>{r.d(t,{d:()=>d});var n=r(9740),a=r(531),o=r(3033);function i(e,t,r){var n=e.findLastIndex(r)+1;return[...e.slice(0,n),t,...e.slice(n)]}var l,d=(l={cells:(e,t)=>{switch(t.type){case"drop-node":return i(e,t.payload,(e=>!("decorator"===e.type&&"text"===e.decorator)));case"drop-decorator":return"text"===t.payload.decorator?[...e,t.payload]:i(e,t.payload,(e=>"decorator"===e.type&&"area"===e.decorator));case"add-nodes":var r=e.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1;return[...e.slice(0,r),...t.payload,...e.slice(r)];case"add-edge":return i(e,t.payload,(e=>"edge"===e.type||"decorator"===e.type&&"area"===e.decorator));case"move-cell":var{type:l,id:d,x:c,y:s}=t.payload,u=e.findIndex((e=>e.type===l&&e.id===d));if(-1!==u){var h=e[u];return[...e.slice(0,u),(0,n.A)((0,n.A)({},h),{},{view:(0,n.A)((0,n.A)({},h.view),{},{x:c,y:s})}),...e.slice(u+1)]}return e;case"resize-cell":var{type:v,id:f,width:m,height:g}=t.payload,p=e.findIndex((e=>e.type===v&&e.id===f));if(-1!==p){var w=e[p];return[...e.slice(0,p),(0,n.A)((0,n.A)({},w),{},{view:(0,n.A)((0,n.A)({},w.view),{},{width:m,height:g})}),...e.slice(p+1)]}return e;case"update-cells":return t.payload;case"update-node-size":return e.map((e=>(0,a.N)(e)&&e.id===t.payload.id?(0,n.A)((0,n.A)({},e),{},{[o.CV]:!0,view:t.payload.size?(0,n.A)((0,n.A)({},e.view),{},{width:t.payload.size[0],height:t.payload.size[1]}):e.view}):e))}return e}},(e,t)=>Object.fromEntries(Object.entries(l).map((r=>{var[n,a]=r;return[n,a(e[n],t)]}))))},7099:(e,t,r)=>{r.d(t,{Y:()=>f});var n=r(8769),a=r.n(n),o=r(2657),i=r(6768),l=r(198),d=r(8621),c=r(4993),s=r(9575);const u=e=>n.createElement("svg",(0,s.A)({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),n.createElement("path",{d:"M12 0a.5.5 0 0 1 .5.5v2.013a9.5 9.5 0 0 1 8.987 8.988L23.5 11.5a.5.5 0 0 1 0 1h-2.013a9.5 9.5 0 0 1-8.987 8.987V23.5a.5.5 0 0 1-1 0v-2.013A9.5 9.5 0 0 1 2.514 12.5H.5a.5.5 0 0 1 0-1h2.013A9.5 9.5 0 0 1 11.5 2.514V.5A.5.5 0 0 1 12 0M3.514 11.5H7.5a.5.5 0 0 1 0 1H3.514a8.5 8.5 0 0 0 7.987 7.986L11.5 16.5a.5.5 0 0 1 1 0v3.986a8.5 8.5 0 0 0 7.986-7.986H16.5a.5.5 0 0 1 0-1h3.986A8.5 8.5 0 0 0 12.5 3.515V7.5a.5.5 0 0 1-1 0V3.514a8.5 8.5 0 0 0-7.986 7.987zm8.486-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3"})),h=e=>n.createElement("svg",(0,s.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),n.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),n.createElement("path",{d:"M744.448 486.4h-204.8V281.6a25.6 25.6 0 1 0-51.2 0v204.8h-204.8a25.6 25.6 0 0 0 0 51.2h204.8v204.8a25.6 25.6 0 0 0 51.2 0V537.6h204.8a25.6 25.6 0 0 0 0-51.2"})),v=e=>n.createElement("svg",(0,s.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),n.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),n.createElement("path",{d:"M744.448 486.4H280.064a25.6 25.6 0 1 0 0 51.2h464.384a25.6 25.6 0 0 0 0-51.2"}));function f(e){var{shadowRoot:t,scale:r,scaleRange:s,onZoomChange:f,onReCenter:m}=e,g=(0,c.useCurrentTheme)(),p=(0,n.useMemo)((()=>(0,d.VC)()),[]),w=(0,n.useRef)(null),y=100*s[0],x=100*s[1],k=100*r,E=(0,n.useMemo)((()=>({formatter:e=>"".concat(e,"%"),placement:"left",getPopupContainer:()=>w.current})),[]),b=(0,n.useCallback)((()=>{f(Math.min(k+5,x))}),[x,f,k]),z=(0,n.useCallback)((()=>{f(Math.max(k-5,y))}),[y,f,k]);return a().createElement(o.Ay,{theme:{algorithm:"dark-v2"===g?i.A.darkAlgorithm:i.A.defaultAlgorithm}},a().createElement(d.N7,{container:t,autoClear:!0,cache:p,hashPriority:"high"},a().createElement("div",{className:"zoom-bar",ref:w},a().createElement("div",{className:"center-button",onClick:m,role:"button"},a().createElement(u,null)),a().createElement("div",{className:"zoom-slider"},a().createElement("div",{className:"zoom-button",role:"button",onClick:b},a().createElement(h,null)),a().createElement(l.A,{min:y,max:x,value:k,step:5,vertical:!0,included:!1,tooltip:E,onChange:f}),a().createElement("div",{className:"zoom-button",role:"button",onClick:z},a().createElement(v,null))))))}},1819:(e,t,r)=>{r.d(t,{J:()=>o});var n=r(8769),a=r(8185);function o(e){var{cellsRef:t,activeTarget:r,onActiveTargetChange:o}=e,i=null!=r?r:null,[l,d]=(0,n.useState)(i);(0,n.useEffect)((()=>{d((e=>(0,a.c)(e,i)?e:i))}),[i]);var c=(0,n.useRef)(!1);return(0,n.useEffect)((()=>{c.current?o(l):c.current=!0}),[l,o]),(0,n.useEffect)((()=>{if(l){var e=e=>{e.composedPath().indexOf(t.current)<=0&&d(null)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}}),[l,t]),l}},2361:(e,t,r)=>{r.d(t,{g:()=>E});var n=r(4223),a=r(9740),o=r(8769),i=r(6149),l=r(4842),d=r(1945),c=r(9418),s=r(3854),u=r(7931),h=r(7586),v=r.n(h),f=r(1030),m=r(7566),g=r(1517),p=r(3033),w=r(531),y=r(908),x=r(8802),k=["nodePadding"];function E(e){var{layout:t,layoutOptions:r,rootRef:h,cells:E,zoomable:b,zoomer:z,scaleRange:C,dispatch:A}=e,[M,R]=(0,o.useState)("force"!==t&&"dagre"!==t),[N,L]=function(e){var{rootRef:t,cells:r,layoutInitialized:n,zoomable:a,zoomer:i,scaleRange:l}=e,[d,c]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{var e=t.current;if(e&&n&&!d&&r.some((e=>(0,w.N)(e)||(0,w.mH)(e)))&&!r.some((e=>(0,w.N)(e)&&!e[p.CV]))){var{k:o,x:s,y:u}=(0,y.r)(r,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:a?l:void 0});i.transform((0,m.A)(e),new g.uV(o,s,u)),c(!0)}}),[r,d,n,t,l,a,i]),(0,o.useEffect)((()=>{r.some((e=>(0,w.N)(e)||(0,w.mH)(e)))||c(!1)}),[r]),[d,c]}({rootRef:h,layoutInitialized:M,cells:E,zoomable:b,zoomer:z,scaleRange:C}),S=(0,o.useRef)(null);return(0,o.useEffect)((()=>{if(!E.some((e=>(0,w.N)(e)&&!e[p.CV])))if("force"===t||"dagre"===t){if(e=S.current,o=E.filter(w.nv),(null==e?void 0:e.length)!==o.length||!e.every(((e,t)=>e===o[t]))){var e,o,h,m;if("force"===t){var g=r,{nodePadding:y,collide:b}=(0,a.A)((0,a.A)({nodePadding:0},(0,f.pick)(g,["nodePadding"])),{},{collide:!1!==(null==g?void 0:g.collide)&&(0,a.A)({radiusDiff:18,strength:1,iterations:1},!0===(null==g?void 0:g.collide)?null:null==g?void 0:g.collide)});m=(0,x.D)(y);var z=[],C=[],M=new Map;for(var N of E)if((0,w.N)(N)){var T={id:N.id,width:N.view.width+m[1]+m[3],height:N.view.height+m[0]+m[2]};z.push(T),M.set(T.id,T)}else(0,w.WW)(N)&&C.push({source:N.source,target:N.target});var D=(0,i.A)(C).id((e=>e.id)),W=(0,l.A)(z).force("link",D).force("x",(0,d.A)()).force("y",(0,c.A)()).force("charge",(0,s.A)());b&&W.force("collide",(0,u.A)().radius((e=>Math.sqrt(e.width**2+e.height**2)/2+b.radiusDiff)).strength(b.strength).iterations(b.iterations)),W.stop(),function(e){e.tick(Math.ceil(Math.log(e.alphaMin())/Math.log(1-e.alphaDecay())))}(W),h=e=>M.get(e)}else{var H=r,B=(0,a.A)({nodePadding:0,rankdir:"TB",ranksep:50,edgesep:10,nodesep:50},(0,f.pick)(H,["nodePadding","rankdir","ranksep","edgesep","nodesep","align"])),{nodePadding:P}=B,V=(0,n.A)(B,k);m=(0,x.D)(P);var O=new(v().graphlib.Graph);for(var Y of(O.setGraph(V),O.setDefaultEdgeLabel((function(){return{}})),E))(0,w.N)(Y)?O.setNode(Y.id,{id:Y.id,width:Y.view.width+m[1]+m[3],height:Y.view.height+m[0]+m[2]}):(0,w.WW)(Y)&&O.setEdge(Y.source,Y.target);v().layout(O),h=e=>O.node(e)}var I=E.map((e=>{if((0,w.N)(e)){var t=h(e.id);return(0,a.A)((0,a.A)({},e),{},{view:(0,a.A)((0,a.A)({},e.view),{},{x:t.x-t.width/2+m[3],y:t.y-t.height/2+m[0]}),[p.xc]:!0})}return e}));S.current=I.filter(w.nv),A({type:"update-cells",payload:I}),L(!1),R(!0)}}else R(!0)}),[E,A,t,r,L]),{centered:N,setCentered:L}}},8197:(e,t,r)=>{r.d(t,{H:()=>i});var n=r(8769),a=r(531),o=r(3033);function i(e){var{cells:t,layout:r,centered:i}=e;return(0,n.useMemo)((()=>i&&t.every((e=>!(0,a.N)(e)||e[o.CV]&&("force"!==r&&"dagre"!==r||e[o.xc])))),[t,i,r])}},8091:(e,t,r)=>{r.d(t,{f:()=>l});var n=r(8769),a=r(7566),o=r(1517),i=r(3033);function l(e){var{rootRef:t,zoomable:r,scrollable:l,pannable:d,scaleRange:c,onSwitchActiveTarget:s}=e,[u,h]=(0,n.useState)(!1),[v,f]=(0,n.useState)({k:1,x:0,y:0}),m=(0,n.useMemo)((()=>null!=c?c:[i.sS,i.Yt]),[c]),g=(0,n.useMemo)((()=>(0,o.s_)()),[]);return(0,n.useEffect)((()=>{var e=!1;g.scaleExtent(r?m:[1,1]).on("start",(()=>{e=!1,h(!0)})).on("zoom",(t=>{e=!0,f(t.transform)})).on("end",(()=>{h(!1),e||null==s||s(null)}))}),[s,m,r,g]),(0,n.useEffect)((()=>{var e=t.current;if(e){var n=(0,a.A)(e),o=()=>{n.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(r||l||d)return(r||l)&&n.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),l&&(e.preventDefault(),g.translateBy(n,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),n.call(g).on("wheel",(e=>e.preventDefault())).on("dblclick.zoom",null).on("mousedown.zoom",null),d||n.on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),o;o()}}),[d,t,l,r,g]),{grabbing:u,transform:v,zoomer:g,scaleRange:m}}},8618:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(6758),a=r.n(n),o=r(935),i=r.n(o)()(a());i.push([e.id,'.zoom-bar{position:absolute;bottom:20px;right:20px;width:40px}.zoom-slider,\n.center-button{width:100%;display:flex;align-items:center;border:1px solid var(--antd-background-color-base);border-radius:var(--larger-border-radius);box-shadow:var(--connected-overlay-shadow);background-color:var(--color-fill-bg-container-4)}.zoom-slider{height:140px;padding:8px 0;flex-direction:column}[role="button"]{cursor:pointer}.center-button{justify-content:center;margin-bottom:8px;height:40px}.center-button:hover{border-color:var(--antd-btn-default-hover-border-color)}.center-button path{fill:var(--antd-link-hover-color)}.center-button:hover path{fill:var(--palette-blue-7)}.zoom-button{font-size:16px;line-height:0}.zoom-button svg{width:1em;height:1em;fill:var(--antd-link-hover-color)}.zoom-slider .ant-slider-vertical{padding-inline:5px}.zoom-slider .ant-slider-vertical .ant-slider-rail{width:2px}.zoom-slider .ant-slider-vertical .ant-slider-handle{width:6px;height:6px;inset-inline-start:3px}.zoom-slider .ant-slider .ant-slider-handle:hover::before,\n.zoom-slider .ant-slider .ant-slider-handle:focus::before,\n.zoom-slider .ant-slider .ant-slider-handle::before{width:10px;height:10px;inset-inline-start:-2px}.zoom-slider .ant-slider .ant-slider-handle:hover::after,\n.zoom-slider .ant-slider .ant-slider-handle:focus::after,\n.zoom-slider .ant-slider .ant-slider-handle::after{width:6px;height:6px;inset-block-start:0;inset-inline-start:0}',""]);const l=i.toString()},3012:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(6758),a=r.n(n),o=r(935),i=r.n(o)()(a());i.push([e.id,"*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root{opacity:0}.root.ready{opacity:1}.root:focus{outline:none}.decorator-area .area{fill:rgba(119,141,195,0.1);stroke:none;stroke-width:0}.node,\n.decorator-text{overflow:visible}.cell.active .decorator-area .area,\n.cell.active .line-active-bg{stroke:var(--palette-blue-5);stroke-dasharray:4;stroke-width:1}.cell:not(.read-only){-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-handle{cursor:nwse-resize;opacity:0}.resize-handle rect{fill:transparent;stroke:none}.resize-handle path{fill:none;stroke:var(--palette-gray-5);stroke-width:1.5}.cell.active .decorator-area .resize-handle,\n.decorator-area:hover .resize-handle{opacity:1}.connect-line{pointer-events:none}.connect-line:not(.connecting){display:none}.line.dashed{stroke-dasharray:4}.cell.active .decorator-text .text-container{outline:1px dashed var(--palette-blue-5)}.decorator-text .text-container{width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:0.5em}.decorator-text .text:focus{outline:none}.cell.faded{opacity:0.3}.cell .node{pointer-events:none}.cell .node > *{pointer-events:auto}",""]);const l=i.toString()}}]);
|
|
2
|
-
//# sourceMappingURL=2311.1877f3a0.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/2311.1877f3a0.js","mappings":"oKAYO,SAASA,EAAeC,GAIO,IAChCC,GAL0B,GAC9BC,EAAE,KACFC,EAAI,YACJC,GACqBJ,EAGrB,OAAQG,GACN,IAAK,OACHF,EAAYI,EACZ,MACF,IAAK,OACHJ,EAAYK,EACZ,MACF,QACEL,EAAYM,EAGhB,OAAOC,IAAAA,cAACP,EAAS,CAACC,GAAIA,EAAIE,YAAaA,GACzC,CAEA,SAASG,EAAWE,GAGsB,IAHrB,GACnBP,EAAE,YACFE,GACyBK,EACzB,OACED,IAAAA,cAAA,UACEN,GAAIA,EACJQ,QAAQ,UACRC,KAAM,EACNC,KAAM,EACNC,YAAa,EACbC,aAAc,EACdC,OAAO,qBACPC,eAAe,SAEfR,IAAAA,cAAA,QACES,EAAE,gCACFC,OAAQd,EACRe,YAAa,EACbC,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AkB,MACrBA,GAAG,gBAAiB,MAGlBE,EAzCLA,GAZF,CAqDgB,GACf,CAACT,EAAUrE,EAASoE,EAAYnE,EAAUC,IAEtC,CAAEqE,WAAUjP,YAAW4K,SAAQxE,aACxC,C,kEClII2J,E,MAA0B,GAA4B,KAE1DA,EAAwBzK,KAAK,CAAC0K,EAAOhZ,GAAI,o6CAK2E,KAEpH,QAAe+Y,EAAwBE,U,kECTnCF,E,MAA0B,GAA4B,KAE1DA,EAAwBzK,KAAK,CAAC0K,EAAOhZ,GAAI,8tCAImc,KAE5e,QAAe+Y,EAAwBE,U","sources":["webpack:///./src/diagram/MarkerComponent.tsx","webpack:///./src/diagram/lines/getDirectLinePoints.ts","webpack:///./src/diagram/processors/doTwoNodesOverlap.ts","webpack:///./src/diagram/processors/extractPartialRectTuple.ts","webpack:///./src/draw-canvas/processors/findNode.ts","webpack:///./src/draw-canvas/EdgeComponent.tsx","webpack:///./src/draw-canvas/NodeComponent.tsx","webpack:///./src/draw-canvas/processors/cellToTarget.ts","webpack:///./src/draw-canvas/processors/handleMouseDown.ts","webpack:///./src/draw-canvas/decorators/DecoratorArea.tsx","webpack:///./src/draw-canvas/decorators/DecoratorText.tsx","webpack:///./src/draw-canvas/decorators/index.tsx","webpack:///./src/draw-canvas/CellComponent.tsx","webpack:///./src/draw-canvas/constants.ts","webpack:///./src/draw-canvas/processors/asserts.ts","webpack:///./src/draw-canvas/processors/getUnrelatedCells.ts","webpack:///./src/draw-canvas/processors/initializeCells.ts","webpack:///./src/draw-canvas/processors/sameTarget.ts","webpack:///./src/draw-canvas/processors/transformToCenter.ts","webpack:///./src/draw-canvas/reducers/cells.ts","webpack:///./src/draw-canvas/reducers/index.ts","webpack:///./src/shared/canvas/icons/center.svg","webpack:///./src/shared/canvas/icons/zoom-in.svg","webpack:///./src/shared/canvas/icons/zoom-out.svg","webpack:///./src/shared/canvas/ZoomBarComponent.tsx","webpack:///./src/shared/canvas/useActiveTarget.ts","webpack:///./src/shared/canvas/useLayout.ts","webpack:///./src/shared/canvas/useAutoCenter.ts","webpack:///./src/shared/canvas/useReady.ts","webpack:///./src/shared/canvas/useZoom.ts","webpack:///./src/shared/canvas/ZoomBarComponent.shadow.css","webpack:///./src/shared/canvas/styles.shadow.css"],"sourcesContent":["import React from \"react\";\nimport type { LineMarkerType } from \"./interfaces\";\n\nexport interface MarkerComponentProps extends BaseMarkerComponentProps {\n type: LineMarkerType;\n}\n\nexport interface BaseMarkerComponentProps {\n id: string;\n strokeColor?: string;\n}\n\nexport function MarkerComponent({\n id,\n type,\n strokeColor,\n}: MarkerComponentProps): JSX.Element {\n let Component: (props: BaseMarkerComponentProps) => JSX.Element;\n\n switch (type) {\n case \"0..1\":\n Component = EntityRelationZeroOrOneMarker;\n break;\n case \"0..N\":\n Component = EntityRelationZeroOrManyMarker;\n break;\n default:\n Component = ArrowMarker;\n }\n\n return <Component id={id} strokeColor={strokeColor} />;\n}\n\nfunction ArrowMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n return (\n <marker\n id={id}\n viewBox=\"0 0 6 6\"\n refX={5}\n refY={3}\n markerWidth={6}\n markerHeight={6}\n orient=\"auto-start-reverse\"\n strokeLinejoin=\"round\"\n >\n <path\n d=\"M 0.5 0.5 L 5.5 3 L 0.5 5.5 z\"\n stroke={strokeColor}\n strokeWidth={1}\n fill={strokeColor}\n />\n </marker>\n );\n}\n\nfunction EntityRelationZeroOrOneMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n return (\n <marker\n id={id}\n viewBox=\"0 0 21 11\"\n refX={0.5}\n refY={5.5}\n markerWidth={21}\n markerHeight={11}\n orient=\"auto-start-reverse\"\n >\n <path\n d=\"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 15.5 0.5 V 10.5 M 10.5 5.5 H 20.5\"\n stroke={strokeColor}\n strokeWidth={1}\n fill=\"none\"\n />\n </marker>\n );\n}\n\nfunction EntityRelationZeroOrManyMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n return (\n <marker\n id={id}\n viewBox=\"0 0 21 11\"\n refX={0.5}\n refY={5.5}\n markerWidth={21}\n markerHeight={11}\n orient=\"auto-start-reverse\"\n >\n <path\n d=\"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 20.5 0.5 L 10.5 5.5 L 20.5 10.5 M 10.5 5.5 H 20.5\"\n stroke={strokeColor}\n strokeWidth={1}\n fill=\"none\"\n />\n </marker>\n );\n}\n","import type { NodePosition, NodeRect } from \"../interfaces\";\nimport { doTwoNodesOverlap } from \"../processors/doTwoNodesOverlap\";\n\nexport function getDirectLinePoints(\n source: NodeRect,\n target: NodeRect\n): NodePosition[] | null {\n // Ignore if two nodes are the same.\n // Ignore if two nodes overlap.\n if (source === target || doTwoNodesOverlap(source, target, 0, 0)) {\n return null;\n }\n\n const dx = target.x - source.x;\n const dy = target.y - source.y;\n\n let x0: number, y0: number, x1: number, y1: number;\n const directionX = dx > 0 ? 1 : -1;\n if (dy !== 0) {\n const deltaRadio = Math.abs(dx / dy);\n const directionY = dy > 0 ? 1 : -1;\n const sourceRadio = source.width / source.height;\n if (deltaRadio < sourceRadio) {\n x0 = source.x + ((deltaRadio * source.height) / 2) * directionX;\n y0 = source.y + (source.height / 2) * directionY;\n } else {\n x0 = source.x + (source.width / 2) * directionX;\n y0 = source.y + (source.width / 2 / deltaRadio) * directionY;\n }\n const targetRadio = target.width / target.height;\n if (deltaRadio < targetRadio) {\n x1 = target.x - ((deltaRadio * target.height) / 2) * directionX;\n y1 = target.y - (target.height / 2) * directionY;\n } else {\n x1 = target.x - (target.width / 2) * directionX;\n y1 = target.y - (target.width / 2 / deltaRadio) * directionY;\n }\n } else {\n x0 = source.x + (source.width / 2) * directionX;\n x1 = target.x - (target.width / 2) * directionX;\n y0 = y1 = source.y;\n }\n\n return [\n { x: x0, y: y0 },\n { x: x1, y: y1 },\n ];\n}\n","import type { NodeRect } from \"../interfaces\";\n\nexport function doTwoNodesOverlap(\n a: NodeRect,\n b: NodeRect,\n paddingA: number,\n paddingB: number\n): boolean {\n const A = paddingA ? getNodesWithPadding(a, paddingA) : a;\n const B = paddingB ? getNodesWithPadding(b, paddingB) : b;\n const left = Math.min(A.x - A.width / 2, B.x - B.width / 2);\n const right = Math.max(A.x + A.width / 2, B.x + B.width / 2);\n const top = Math.min(A.y - A.height / 2, B.y - B.height / 2);\n const bottom = Math.max(A.y + A.height / 2, B.y + B.height / 2);\n return right - left < A.width + B.width && bottom - top < A.height + B.height;\n}\n\nfunction getNodesWithPadding(node: NodeRect, padding: number) {\n return {\n x: node.x - node.width / 2 - padding,\n y: node.y - node.height / 2 - padding,\n width: node.width + padding * 2,\n height: node.height + padding * 2,\n };\n}\n","import type { FullRectTuple, PartialRectTuple } from \"../interfaces\";\n\nexport function extractPartialRectTuple(\n value: PartialRectTuple\n): FullRectTuple {\n if (Array.isArray(value)) {\n const v0 = value[0];\n const v1 = value.length > 1 ? value[1]! : v0;\n const v2 = value.length > 2 ? value[2]! : v0;\n const v3 = value.length > 3 ? value[3]! : v1;\n return [v0, v1, v2, v3];\n }\n return new Array(4).fill(value) as FullRectTuple;\n}\n","import type { Cell, NodeCell, NodeId } from \"../interfaces\";\nimport { isNodeCell } from \"./asserts\";\n\nexport function findNode(cells: Cell[], id: NodeId): NodeCell | undefined {\n return cells.find((cell) => isNodeCell(cell) && cell.id === id) as\n | NodeCell\n | undefined;\n}\n","import React, { useMemo } from \"react\";\nimport { checkIfByTransform } from \"@next-core/runtime\";\nimport classNames from \"classnames\";\nimport type { Cell, EdgeCell, EdgeLineConf, NodeView } from \"./interfaces\";\nimport { getDirectLinePoints } from \"../diagram/lines/getDirectLinePoints\";\nimport type { NodeRect } from \"../diagram/interfaces\";\nimport { findNode } from \"./processors/findNode\";\n\nexport interface EdgeComponentProps {\n edge: EdgeCell;\n cells: Cell[];\n markerEnd: string;\n defaultEdgeLines?: EdgeLineConf[];\n}\n\nexport function EdgeComponent({\n edge,\n cells,\n markerEnd,\n defaultEdgeLines,\n}: EdgeComponentProps): JSX.Element | null {\n const sourceNode = useMemo(\n () => findNode(cells, edge.source),\n [cells, edge.source]\n );\n const targetNode = useMemo(\n () => findNode(cells, edge.target),\n [cells, edge.target]\n );\n const lineConf = useMemo(\n () => defaultEdgeLines?.find((item) => checkIfByTransform(item, { edge })),\n [defaultEdgeLines, edge]\n );\n\n const padding = 5;\n\n const line = useMemo(\n () =>\n sourceNode &&\n targetNode &&\n sourceNode.view.x != null &&\n targetNode.view.x != null\n ? getDirectLinePoints(\n nodeViewToNodeRect(sourceNode.view, padding),\n nodeViewToNodeRect(targetNode.view, padding)\n )\n : null,\n [sourceNode, targetNode]\n );\n\n if (!line) {\n // This happens when source or target is not found,\n // or when source or target has not been positioned yet.\n return null;\n }\n\n const d = `M${line[0].x} ${line[0].y}L${line[1].x} ${line[1].y}`;\n\n return (\n <>\n <path\n // This `path` is made for expanding interaction area of graph lines.\n d={d}\n fill=\"none\"\n stroke=\"transparent\"\n strokeWidth={16}\n />\n <path\n className={classNames(\"line\", { dashed: lineConf?.dashed })}\n d={d}\n fill=\"none\"\n stroke=\"gray\"\n markerEnd={`url(#${markerEnd})`}\n />\n <path className=\"line-active-bg\" d={d} fill=\"none\" />\n </>\n );\n}\n\nfunction nodeViewToNodeRect(view: NodeView, padding: number): NodeRect {\n return {\n x: view.x + view.width / 2,\n y: view.y + view.height / 2,\n width: view.width + padding,\n height: view.height + padding,\n };\n}\n","import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { ReactUseBrick } from \"@next-core/react-runtime\";\nimport { checkIfByTransform } from \"@next-core/runtime\";\nimport { isEqual } from \"lodash\";\nimport ResizeObserver from \"resize-observer-polyfill\";\nimport type { NodeBrickCell, NodeBrickConf, NodeCell } from \"./interfaces\";\nimport type { SizeTuple } from \"../diagram/interfaces\";\n\nexport interface NodeComponentProps {\n node: NodeCell;\n defaultNodeBricks?: NodeBrickConf[];\n onResize(id: string, size: SizeTuple | null): void;\n}\n\nexport function NodeComponent({\n node,\n defaultNodeBricks,\n onResize,\n}: NodeComponentProps): JSX.Element | null {\n const memoizedData = useDeepMemo({ node: { id: node.id, data: node.data } });\n const specifiedUseBrick = (node as NodeBrickCell).useBrick;\n const observerRef = useRef<ResizeObserver | null>(null);\n\n const useBrick = useMemo(() => {\n return (\n specifiedUseBrick ??\n defaultNodeBricks?.find((item) => checkIfByTransform(item, memoizedData))\n ?.useBrick\n );\n }, [defaultNodeBricks, specifiedUseBrick, memoizedData]);\n\n const refCallback = useCallback(\n (element: HTMLElement | null) => {\n const prevObserver = observerRef.current;\n if (prevObserver) {\n prevObserver.disconnect();\n observerRef.current = null;\n }\n if (element) {\n // Todo: correctly wait for `useBrick` in v3 to be rendered (after layout)\n // Wait a macro task to let `useBrick` to be rendered.\n setTimeout(() => {\n const observer = new ResizeObserver(() => {\n onResize(node.id, [element.offsetWidth, element.offsetHeight]);\n });\n observer.observe(element);\n observerRef.current = observer;\n });\n } else {\n onResize(node.id, null);\n }\n },\n [node.id, onResize]\n );\n\n return useBrick ? (\n <foreignObject\n // Make a large size to avoid the brick inside to be clipped by the foreignObject.\n width={9999}\n height={9999}\n className=\"node\"\n >\n {useBrick && (\n <ReactUseBrick\n useBrick={useBrick}\n data={memoizedData}\n refCallback={refCallback}\n />\n )}\n </foreignObject>\n ) : null;\n}\n\nfunction useDeepMemo<T>(value: T): T {\n const [memoizedValue, setMemoizedValue] = useState(value);\n\n useEffect(() => {\n setMemoizedValue((prev) => (isEqual(prev, value) ? prev : value));\n }, [value]);\n\n return memoizedValue;\n}\n","import { pick } from \"lodash\";\nimport type { ActiveTarget, Cell } from \"../interfaces\";\n\nexport function cellToTarget(cell: Cell): ActiveTarget {\n return cell.type === \"edge\"\n ? pick(cell, [\"type\", \"source\", \"target\", \"data\"])\n : pick(cell, [\"type\", \"id\", \"data\"]);\n}\n","import type { PositionTuple } from \"../../diagram/interfaces\";\nimport type { ActiveTarget, Cell, LayoutType } from \"../interfaces\";\nimport type {\n MoveCellPayload,\n ResizeCellPayload,\n} from \"../reducers/interfaces\";\nimport { isEdgeCell, isNodeCell } from \"./asserts\";\nimport { cellToTarget } from \"./cellToTarget\";\n\nexport function handleMouseDown(\n event: MouseEvent,\n {\n action,\n cell,\n scale,\n layout,\n onCellMoving,\n onCellMoved,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n }: {\n action: \"move\" | \"resize\";\n cell: Cell;\n scale: number;\n layout?: LayoutType;\n onCellMoving?(info: MoveCellPayload): void;\n onCellMoved?(info: MoveCellPayload): void;\n onCellResizing?(info: ResizeCellPayload): void;\n onCellResized?(info: ResizeCellPayload): void;\n onSwitchActiveTarget?(activeTarget: ActiveTarget | null): void;\n }\n) {\n event.stopPropagation();\n // Drag node\n onSwitchActiveTarget?.(cellToTarget(cell));\n\n if (\n isEdgeCell(cell) ||\n ((layout === \"force\" || layout === \"dagre\") && isNodeCell(cell))\n ) {\n return;\n }\n\n const from: PositionTuple = [event.clientX, event.clientY];\n const original =\n action === \"move\"\n ? [cell.view.x, cell.view.y]\n : [cell.view.width, cell.view.height];\n\n function getMovement(e: MouseEvent): PositionTuple {\n return [(e.clientX - from[0]) / scale, (e.clientY - from[1]) / scale];\n }\n\n let moved = false;\n\n const handleMove = (e: MouseEvent, finished?: boolean) => {\n // Respect the scale\n const movement = getMovement(e);\n if (!moved) {\n moved = movement[0] ** 2 + movement[1] ** 2 >= 9;\n }\n // const [x, y] = getNewPosition(movement);\n // adjustCellPosition(x, y);\n if (moved) {\n if (action === \"move\") {\n (finished ? onCellMoved : onCellMoving)?.({\n type: cell.type,\n id: cell.id,\n x: original[0] + movement[0],\n y: original[1] + movement[1],\n });\n } else {\n (finished ? onCellResized : onCellResizing)?.({\n type: cell.type,\n id: cell.id,\n width: original[0] + movement[0],\n height: original[1] + movement[1],\n });\n }\n }\n };\n\n const onMouseMove = (e: MouseEvent) => {\n handleMove(e);\n };\n const onMouseUp = (e: MouseEvent) => {\n handleMove(e, true);\n moved = false;\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n };\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n}\n","import React, { useEffect } from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport { handleMouseDown } from \"../processors/handleMouseDown\";\n\nexport function DecoratorArea({\n cell,\n transform,\n readOnly,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n}: BasicDecoratorProps): JSX.Element {\n const resizeHandleRef = React.useRef<SVGGElement>(null);\n\n useEffect(() => {\n const resizeHandle = resizeHandleRef.current;\n if (!resizeHandle || readOnly) {\n return;\n }\n const onMouseDown = (event: MouseEvent) => {\n handleMouseDown(event, {\n action: \"resize\",\n cell,\n scale: transform.k,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n });\n };\n resizeHandle.addEventListener(\"mousedown\", onMouseDown);\n return () => {\n resizeHandle.removeEventListener(\"mousedown\", onMouseDown);\n };\n }, [\n cell,\n onCellResized,\n onCellResizing,\n onSwitchActiveTarget,\n readOnly,\n transform.k,\n ]);\n\n return (\n <g className=\"decorator-area\">\n <rect\n width={cell.view.width}\n height={cell.view.height}\n className=\"area\"\n />\n {!readOnly && (\n <g\n ref={resizeHandleRef}\n className=\"resize-handle\"\n transform={`translate(${cell.view.width - 20} ${cell.view.height - 20})`}\n >\n <rect width={20} height={20} />\n <path d=\"M10 18L18 10 M15 18L18 15\" />\n </g>\n )}\n </g>\n );\n}\n","import React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport classNames from \"classnames\";\n\nexport type DecoratorTextProps = Pick<\n BasicDecoratorProps,\n \"cell\" | \"readOnly\" | \"onDecoratorTextEditing\" | \"onDecoratorTextChange\"\n>;\n\nexport function DecoratorText({\n cell,\n readOnly,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: DecoratorTextProps): JSX.Element {\n const label = cell.view.text ?? \"\";\n const [currentLabel, setCurrentLabel] = useState<string>(label);\n const [editingLabel, setEditingLabel] = useState(false);\n const editingLabelInitialized = useRef(false);\n const [shouldEmitLabelChange, setShouldEmitLabelChange] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n const handleEnableEdit = useCallback(\n (e: React.MouseEvent) => {\n if (readOnly) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n setEditingLabel(true);\n },\n [readOnly]\n );\n\n useEffect(() => {\n const element = ref.current;\n if (element && element.textContent !== currentLabel) {\n element.textContent = currentLabel;\n }\n }, [currentLabel]);\n\n useEffect(() => {\n if (editingLabel && ref.current) {\n ref.current.focus();\n selectAllText(ref.current);\n }\n onDecoratorTextEditing?.({ id: cell.id, editing: editingLabel });\n }, [cell.id, editingLabel, onDecoratorTextEditing]);\n\n useEffect(() => {\n if (editingLabelInitialized.current) {\n onDecoratorTextEditing?.({ id: cell.id, editing: editingLabel });\n } else {\n editingLabelInitialized.current = true;\n }\n }, [cell.id, editingLabel, onDecoratorTextEditing]);\n\n const handleInput = useCallback(\n (event: React.FormEvent<HTMLDivElement>) => {\n if (readOnly) {\n return;\n }\n setCurrentLabel((event.target as HTMLDivElement).textContent!);\n },\n [readOnly]\n );\n\n const handleBlur = useCallback(() => {\n if (readOnly) {\n return;\n }\n setEditingLabel(false);\n setShouldEmitLabelChange(true);\n }, [readOnly]);\n\n useEffect(() => {\n if (shouldEmitLabelChange) {\n onDecoratorTextChange?.({\n id: cell.id,\n view: { ...cell.view, text: currentLabel },\n });\n setShouldEmitLabelChange(false);\n }\n }, [cell, currentLabel, onDecoratorTextChange, shouldEmitLabelChange]);\n\n return (\n <foreignObject className=\"decorator-text\">\n <div\n className={classNames(\"text-container\", { editing: editingLabel })}\n onDoubleClick={handleEnableEdit}\n >\n <div\n className=\"text\"\n contentEditable={editingLabel}\n ref={ref}\n onInput={handleInput}\n onBlur={handleBlur}\n />\n </div>\n </foreignObject>\n );\n}\n\nfunction selectAllText(element: HTMLElement) {\n const range = document.createRange();\n range.selectNodeContents(element);\n const selection = window.getSelection()!;\n selection.removeAllRanges();\n selection.addRange(range);\n}\n","import React from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport { DecoratorArea } from \"./DecoratorArea\";\nimport { DecoratorText } from \"./DecoratorText\";\n\nexport function DecoratorComponent({\n cell,\n transform,\n readOnly,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: BasicDecoratorProps): JSX.Element | null {\n let SpecifiedComponent: (props: BasicDecoratorProps) => JSX.Element | null;\n\n switch (cell.decorator) {\n case \"area\":\n SpecifiedComponent = DecoratorArea;\n break;\n case \"text\":\n SpecifiedComponent = DecoratorText;\n break;\n // istanbul ignore next\n default:\n // eslint-disable-next-line no-console\n console.error(`Unknown decorator: ${cell.decorator}`);\n return null;\n }\n\n return (\n <SpecifiedComponent\n cell={cell}\n transform={transform}\n readOnly={readOnly}\n onCellResizing={onCellResizing}\n onCellResized={onCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onDecoratorTextEditing={onDecoratorTextEditing}\n onDecoratorTextChange={onDecoratorTextChange}\n />\n );\n}\n","import React, { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport classNames from \"classnames\";\nimport type {\n ActiveTarget,\n Cell,\n CellContextMenuDetail,\n DecoratorTextChangeDetail,\n EdgeLineConf,\n LayoutType,\n NodeBrickConf,\n} from \"./interfaces\";\nimport { isDecoratorCell, isEdgeCell, isNodeCell } from \"./processors/asserts\";\nimport { EdgeComponent } from \"./EdgeComponent\";\nimport { NodeComponent } from \"./NodeComponent\";\nimport { handleMouseDown } from \"./processors/handleMouseDown\";\nimport type { MoveCellPayload, ResizeCellPayload } from \"./reducers/interfaces\";\nimport { DecoratorComponent } from \"./decorators\";\nimport { cellToTarget } from \"./processors/cellToTarget\";\nimport type { SizeTuple, TransformLiteral } from \"../diagram/interfaces\";\nimport { sameTarget } from \"./processors/sameTarget\";\n\nexport interface CellComponentProps {\n layout: LayoutType;\n cell: Cell;\n cells: Cell[];\n defaultNodeBricks?: NodeBrickConf[];\n defaultEdgeLines?: EdgeLineConf[];\n transform: TransformLiteral;\n markerEnd: string;\n active: boolean;\n readOnly?: boolean;\n unrelatedCells: Cell[];\n onCellMoving?(info: MoveCellPayload): void;\n onCellMoved?(info: MoveCellPayload): void;\n onCellResizing?(info: ResizeCellPayload): void;\n onCellResized?(info: ResizeCellPayload): void;\n onSwitchActiveTarget(target: ActiveTarget | null): void;\n onCellContextMenu(detail: CellContextMenuDetail): void;\n onDecoratorTextEditing?(detail: { id: string; editing: boolean }): void;\n onDecoratorTextChange?(detail: DecoratorTextChangeDetail): void;\n onNodeBrickResize(id: string, size: SizeTuple | null): void;\n onCellMouseEnter?(cell: Cell): void;\n onCellMouseLeave?(cell: Cell): void;\n}\n\nexport function CellComponent({\n layout,\n cell,\n cells,\n defaultNodeBricks,\n defaultEdgeLines,\n markerEnd,\n active,\n readOnly,\n transform,\n unrelatedCells,\n onCellMoving,\n onCellMoved,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n onCellContextMenu,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n onNodeBrickResize,\n onCellMouseEnter,\n onCellMouseLeave,\n}: CellComponentProps): JSX.Element | null {\n const gRef = useRef<SVGGElement>(null);\n\n const unrelated = useMemo(\n () => unrelatedCells.some((item) => sameTarget(item, cell)),\n [cell, unrelatedCells]\n );\n\n useEffect(() => {\n const g = gRef.current;\n if (!g || readOnly) {\n return;\n }\n const onMouseDown = (event: MouseEvent) => {\n handleMouseDown(event, {\n layout,\n action: \"move\",\n cell,\n scale: transform.k,\n onCellMoving,\n onCellMoved,\n onSwitchActiveTarget,\n });\n };\n g.addEventListener(\"mousedown\", onMouseDown);\n return () => {\n g.removeEventListener(\"mousedown\", onMouseDown);\n };\n }, [\n layout,\n cell,\n onCellMoved,\n onCellMoving,\n onSwitchActiveTarget,\n readOnly,\n transform.k,\n ]);\n\n const handleContextMenu = useCallback(\n (event: React.MouseEvent<SVGGElement>) => {\n if (readOnly && cell.type === \"decorator\") {\n return;\n }\n event.preventDefault();\n onSwitchActiveTarget(cellToTarget(cell));\n onCellContextMenu({\n cell,\n clientX: event.clientX,\n clientY: event.clientY,\n });\n },\n [cell, onCellContextMenu, onSwitchActiveTarget, readOnly]\n );\n\n const handleMouseEnter = useCallback(() => {\n onCellMouseEnter?.(cell);\n }, [cell, onCellMouseEnter]);\n\n const handleMouseLeave = useCallback(() => {\n onCellMouseLeave?.(cell);\n }, [cell, onCellMouseLeave]);\n\n return (\n <g\n className={classNames(\"cell\", {\n active,\n faded: unrelated,\n \"read-only\": readOnly,\n })}\n ref={gRef}\n transform={\n cell.type === \"edge\" || cell.view.x == null\n ? undefined\n : `translate(${cell.view.x} ${cell.view.y})`\n }\n onContextMenu={handleContextMenu}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {isNodeCell(cell) ? (\n <NodeComponent\n node={cell}\n defaultNodeBricks={defaultNodeBricks}\n onResize={onNodeBrickResize}\n />\n ) : isEdgeCell(cell) ? (\n <EdgeComponent\n edge={cell}\n defaultEdgeLines={defaultEdgeLines}\n cells={cells}\n markerEnd={markerEnd}\n />\n ) : isDecoratorCell(cell) ? (\n <DecoratorComponent\n cell={cell}\n transform={transform}\n readOnly={readOnly}\n onCellResizing={onCellResizing}\n onCellResized={onCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onDecoratorTextEditing={onDecoratorTextEditing}\n onDecoratorTextChange={onDecoratorTextChange}\n />\n ) : null}\n </g>\n );\n}\n","export const SYMBOL_FOR_SIZE_INITIALIZED = Symbol.for(\"size-initialized\");\nexport const SYMBOL_FOR_LAYOUT_INITIALIZED = Symbol.for(\"layout-initialized\");\nexport const DEFAULT_NODE_SIZE = 20;\nexport const DEFAULT_NODE_GAP = 36;\nexport const DEFAULT_AREA_WIDTH = 100;\nexport const DEFAULT_AREA_HEIGHT = 60;\nexport const DEFAULT_SCALE_RANGE_MIN = 0.5;\nexport const DEFAULT_SCALE_RANGE_MAX = 2;\n","import type {\n Cell,\n DecoratorCell,\n EdgeCell,\n InitialCell,\n InitialNodeCell,\n NodeCell,\n} from \"../interfaces\";\n\nexport function isNodeCell(cell: Cell): cell is NodeCell {\n return cell.type === \"node\";\n}\n\nexport function isDecoratorCell(cell: Cell): cell is DecoratorCell {\n return cell.type === \"decorator\";\n}\n\nexport function isInitialNodeCell(cell: InitialCell): cell is InitialNodeCell {\n return cell.type === \"node\";\n}\n\nexport function isEdgeCell(cell: Cell): cell is EdgeCell {\n return cell.type === \"edge\";\n}\n\nexport function isNodeOrEdgeCell(cell: Cell): cell is NodeCell | EdgeCell {\n return cell.type === \"node\" || cell.type === \"edge\";\n}\n","import type { ActiveTarget, Cell, ConnectLineState } from \"../interfaces\";\nimport { sameTarget } from \"./sameTarget\";\n\nexport function getUnrelatedCells(\n cells: Cell[],\n connectLineState: ConnectLineState | null,\n activeTarget: ActiveTarget | null\n): Cell[] {\n const unrelated: Cell[] = [];\n\n if (connectLineState) {\n const existedTargets = new Set<string>();\n for (const cell of cells) {\n if (cell.type === \"edge\" && cell.source === connectLineState.source.id) {\n existedTargets.add(cell.target);\n }\n }\n for (const cell of cells) {\n switch (cell.type) {\n case \"node\":\n if (existedTargets.has(cell.id)) {\n unrelated.push(cell);\n }\n break;\n default:\n unrelated.push(cell);\n }\n }\n } else {\n switch (activeTarget?.type) {\n case \"node\": {\n const nodesMap = new Map<string, Cell>();\n const relatedNodeIds = new Set<string>([activeTarget.id]);\n for (const cell of cells) {\n if (cell.type === \"node\") {\n nodesMap.set(cell.id, cell);\n } else if (cell.type === \"edge\") {\n if (cell.source === activeTarget.id) {\n relatedNodeIds.add(cell.target);\n } else if (cell.target === activeTarget.id) {\n relatedNodeIds.add(cell.source);\n } else {\n unrelated.push(cell);\n }\n } else {\n unrelated.push(cell);\n }\n }\n for (const [id, cell] of nodesMap) {\n if (!relatedNodeIds.has(id)) {\n unrelated.push(cell);\n }\n }\n break;\n }\n\n case \"edge\":\n for (const cell of cells) {\n if (\n !(cell.type === \"edge\"\n ? sameTarget(cell, activeTarget)\n : cell.type === \"node\" &&\n (cell.id === activeTarget.source ||\n cell.id === activeTarget.target))\n ) {\n unrelated.push(cell);\n }\n }\n break;\n\n case \"decorator\":\n for (const cell of cells) {\n if (cell.type !== \"decorator\" || cell.id !== activeTarget.id) {\n unrelated.push(cell);\n }\n }\n break;\n }\n }\n\n return unrelated;\n}\n","import type { SizeTuple } from \"../../diagram/interfaces\";\nimport type { Cell, InitialCell, NodeCell } from \"../interfaces\";\nimport { isInitialNodeCell } from \"./asserts\";\n\nexport function initializeCells(\n initialCells: InitialCell[] | undefined,\n {\n defaultNodeSize,\n }: {\n defaultNodeSize: SizeTuple;\n }\n): Cell[] {\n const originalCells = initialCells ?? [];\n const finalCells: Cell[] = originalCells.map<Cell>((cell) => {\n if (\n !isInitialNodeCell(cell) ||\n (cell.view?.width !== undefined && cell.view?.height !== undefined)\n ) {\n return cell as NodeCell;\n }\n return {\n ...cell,\n view: {\n width: defaultNodeSize[0],\n height: defaultNodeSize[1],\n ...cell.view,\n },\n } as NodeCell;\n });\n return finalCells;\n}\n","import type {\n ActiveTarget,\n ActiveTargetOfEdge,\n ActiveTargetOfNode,\n} from \"../interfaces\";\n\nexport function sameTarget(\n a: ActiveTarget | null | undefined,\n b: ActiveTarget | null | undefined\n): boolean {\n return a\n ? !!b &&\n a.type === b.type &&\n (a.type === \"node\" || a.type === \"decorator\"\n ? a.id === (b as ActiveTargetOfNode).id\n : a.source === (b as ActiveTargetOfEdge).source &&\n a.target === (b as ActiveTargetOfEdge).target)\n : !b;\n}\n","import type { TransformLiteral } from \"../../diagram/interfaces\";\nimport type { Cell } from \"../interfaces\";\nimport { isEdgeCell } from \"./asserts\";\n\nexport interface TransformToCenterOptions {\n canvasWidth: number;\n canvasHeight: number;\n scaleRange?: [min: number, max: number];\n}\n\nexport function transformToCenter(\n cells: Cell[],\n { canvasWidth, canvasHeight, scaleRange }: TransformToCenterOptions\n): TransformLiteral {\n let left = Infinity;\n let top = Infinity;\n let right = -Infinity;\n let bottom = -Infinity;\n let empty = true;\n for (const cell of cells) {\n if (!isEdgeCell(cell)) {\n empty = false;\n const { view } = cell;\n const r = view.x + view.width;\n const b = view.y + view.height;\n if (view.x < left) {\n left = view.x;\n }\n if (r > right) {\n right = r;\n }\n if (view.y < top) {\n top = view.y;\n }\n if (b > bottom) {\n bottom = b;\n }\n }\n }\n\n const width = right - left;\n const height = bottom - top;\n\n const scale =\n scaleRange && !empty && (width > canvasWidth || height > canvasHeight)\n ? Math.max(\n Math.min(canvasWidth / width, canvasHeight / height, scaleRange[1]),\n scaleRange[0]\n )\n : 1;\n\n const x = empty ? 0 : (canvasWidth - width * scale) / 2 - left * scale;\n const y = empty ? 0 : (canvasHeight - height * scale) / 2 - top * scale;\n\n return { x, y, k: scale };\n}\n","import type { Reducer } from \"react\";\nimport type { DrawCanvasAction } from \"./interfaces\";\nimport type { Cell, NodeCell } from \"../interfaces\";\nimport { isNodeCell } from \"../processors/asserts\";\nimport { SYMBOL_FOR_SIZE_INITIALIZED } from \"../constants\";\n\nexport const cells: Reducer<Cell[], DrawCanvasAction> = (state, action) => {\n switch (action.type) {\n case \"drop-node\":\n return insertCellAfter(\n state,\n action.payload,\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n );\n case \"drop-decorator\": {\n if (action.payload.decorator === \"text\") {\n return [...state, action.payload];\n }\n return insertCellAfter(\n state,\n action.payload,\n (cell) => cell.type === \"decorator\" && cell.decorator === \"area\"\n );\n }\n case \"add-nodes\": {\n const index =\n state.findLastIndex(\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n ) + 1;\n return [\n ...state.slice(0, index),\n ...action.payload,\n ...state.slice(index),\n ];\n }\n case \"add-edge\":\n // Add the edge to just next to the previous last edge or area decorator.\n // If not found, append to the start.\n return insertCellAfter(\n state,\n action.payload,\n (cell) =>\n cell.type === \"edge\" ||\n (cell.type === \"decorator\" && cell.decorator === \"area\")\n );\n case \"move-cell\": {\n const { type, id, x, y } = action.payload;\n const index = state.findIndex(\n (cell) => cell.type === type && cell.id === id\n );\n if (index !== -1) {\n const node = state[index] as NodeCell;\n return [\n ...state.slice(0, index),\n { ...node, view: { ...node.view, x, y } },\n ...state.slice(index + 1),\n ];\n }\n return state;\n }\n case \"resize-cell\": {\n const { type, id, width, height } = action.payload;\n const index = state.findIndex(\n (cell) => cell.type === type && cell.id === id\n );\n if (index !== -1) {\n const node = state[index] as NodeCell;\n return [\n ...state.slice(0, index),\n { ...node, view: { ...node.view, width, height } },\n ...state.slice(index + 1),\n ];\n }\n return state;\n }\n case \"update-cells\":\n return action.payload;\n case \"update-node-size\":\n return state.map((cell) =>\n isNodeCell(cell) && cell.id === action.payload.id\n ? {\n ...cell,\n [SYMBOL_FOR_SIZE_INITIALIZED]: true,\n view: action.payload.size\n ? {\n ...cell.view,\n width: action.payload.size[0],\n height: action.payload.size[1],\n }\n : cell.view,\n }\n : cell\n );\n }\n return state;\n};\n\nfunction insertCellAfter(\n cells: Cell[],\n newCell: Cell,\n after: (cell: Cell) => boolean\n) {\n const index = cells.findLastIndex(after) + 1;\n return [...cells.slice(0, index), newCell, ...cells.slice(index)];\n}\n","import { Reducer } from \"react\";\nimport type { DrawCanvasAction, DrawCanvasState } from \"./interfaces\";\nimport { cells } from \"./cells\";\n\ntype ReducersMapObject<S, A> = {\n [K in keyof S]: Reducer<S[K], A>;\n};\n\nfunction combineReducers<S, A>(\n reducers: ReducersMapObject<S, A>\n): Reducer<S, A> {\n return ((state, action) =>\n Object.fromEntries(\n Object.entries<Reducer<any, A>>(reducers).map(([key, value]) => [\n key,\n value(state[key as keyof S], action),\n ])\n )) as Reducer<S, A>;\n}\n\nexport const rootReducer = combineReducers<DrawCanvasState, DrawCanvasAction>({\n cells,\n});\n","import * as React from \"react\";\nconst SvgCenter = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={24} height={24} viewBox=\"0 0 24 24\" {...props}><path d=\"M12 0a.5.5 0 0 1 .5.5v2.013a9.5 9.5 0 0 1 8.987 8.988L23.5 11.5a.5.5 0 0 1 0 1h-2.013a9.5 9.5 0 0 1-8.987 8.987V23.5a.5.5 0 0 1-1 0v-2.013A9.5 9.5 0 0 1 2.514 12.5H.5a.5.5 0 0 1 0-1h2.013A9.5 9.5 0 0 1 11.5 2.514V.5A.5.5 0 0 1 12 0M3.514 11.5H7.5a.5.5 0 0 1 0 1H3.514a8.5 8.5 0 0 0 7.987 7.986L11.5 16.5a.5.5 0 0 1 1 0v3.986a8.5 8.5 0 0 0 7.986-7.986H16.5a.5.5 0 0 1 0-1h3.986A8.5 8.5 0 0 0 12.5 3.515V7.5a.5.5 0 0 1-1 0V3.514a8.5 8.5 0 0 0-7.986 7.987zm8.486-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3\" /></svg>;\nexport default SvgCenter;","import * as React from \"react\";\nconst SvgZoomIn = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={128} height={128} className=\"icon\" viewBox=\"0 0 1024 1024\" {...props}><path d=\"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384\" /><path d=\"M744.448 486.4h-204.8V281.6a25.6 25.6 0 1 0-51.2 0v204.8h-204.8a25.6 25.6 0 0 0 0 51.2h204.8v204.8a25.6 25.6 0 0 0 51.2 0V537.6h204.8a25.6 25.6 0 0 0 0-51.2\" /></svg>;\nexport default SvgZoomIn;","import * as React from \"react\";\nconst SvgZoomOut = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={128} height={128} className=\"icon\" viewBox=\"0 0 1024 1024\" {...props}><path d=\"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384\" /><path d=\"M744.448 486.4H280.064a25.6 25.6 0 1 0 0 51.2h464.384a25.6 25.6 0 0 0 0-51.2\" /></svg>;\nexport default SvgZoomOut;","import React, { useCallback, useMemo, useRef } from \"react\";\nimport { ConfigProvider, Slider, theme } from \"antd\";\nimport { StyleProvider, createCache } from \"@ant-design/cssinjs\";\nimport { useCurrentTheme } from \"@next-core/react-runtime\";\nimport type { RangeTuple } from \"../../diagram/interfaces\";\nimport CenterSVG from \"./icons/center.svg\";\nimport ZoomInSVG from \"./icons/zoom-in.svg\";\nimport ZoomOutSVG from \"./icons/zoom-out.svg\";\n\nexport interface ZoomBarComponentProps {\n shadowRoot: ShadowRoot;\n scale: number;\n scaleRange: RangeTuple;\n onZoomChange(value: number): void;\n onReCenter(): void;\n}\n\nexport function ZoomBarComponent({\n shadowRoot,\n scale,\n scaleRange,\n onZoomChange,\n onReCenter,\n}: ZoomBarComponentProps): JSX.Element | null {\n const currentTheme = useCurrentTheme();\n const cache = useMemo(() => createCache(), []);\n const zoomBarRef = useRef<HTMLDivElement | null>(null);\n const min = scaleRange[0] * 100;\n const max = scaleRange[1] * 100;\n const value = scale * 100;\n const step = 5;\n\n const tooltip = useMemo(() => {\n return {\n formatter: (value: number | undefined) => `${value}%`,\n placement: \"left\" as const,\n getPopupContainer: () => zoomBarRef.current!,\n };\n }, []);\n\n const onZoomIn = useCallback(() => {\n onZoomChange(Math.min(value + step, max));\n }, [max, onZoomChange, value]);\n\n const onZoomOut = useCallback(() => {\n onZoomChange(Math.max(value - step, min));\n }, [min, onZoomChange, value]);\n\n return (\n <ConfigProvider\n theme={{\n algorithm:\n currentTheme === \"dark-v2\"\n ? theme.darkAlgorithm\n : theme.defaultAlgorithm,\n }}\n >\n <StyleProvider\n container={shadowRoot}\n // Auto clear injected styles after unmount\n autoClear\n cache={cache}\n // Set hashPriority to \"high\" to disable `:where()` usage for compatibility\n hashPriority=\"high\"\n >\n <div className=\"zoom-bar\" ref={zoomBarRef}>\n <div className=\"center-button\" onClick={onReCenter} role=\"button\">\n <CenterSVG />\n </div>\n <div className=\"zoom-slider\">\n <div className=\"zoom-button\" role=\"button\" onClick={onZoomIn}>\n <ZoomInSVG />\n </div>\n <Slider\n min={min}\n max={max}\n value={value}\n step={step}\n vertical\n included={false}\n tooltip={tooltip}\n onChange={onZoomChange}\n />\n <div className=\"zoom-button\" role=\"button\" onClick={onZoomOut}>\n <ZoomOutSVG />\n </div>\n </div>\n </div>\n </StyleProvider>\n </ConfigProvider>\n );\n}\n","import React, { useEffect, useRef, useState } from \"react\";\nimport type { ActiveTarget } from \"../../draw-canvas/interfaces\";\nimport { sameTarget } from \"../../draw-canvas/processors/sameTarget\";\n\nexport interface UseActiveTargetOptions {\n cellsRef: React.RefObject<SVGGElement>;\n activeTarget?: ActiveTarget | null;\n onActiveTargetChange(target: ActiveTarget | null): void;\n}\n\nexport type UseActiveTargetResult = ActiveTarget | null;\n\nexport function useActiveTarget({\n cellsRef,\n activeTarget: _activeTarget,\n onActiveTargetChange,\n}: UseActiveTargetOptions): UseActiveTargetResult {\n const newActiveTarget = _activeTarget ?? null;\n const [activeTarget, setActiveTarget] = useState<ActiveTarget | null>(\n newActiveTarget\n );\n\n useEffect(() => {\n setActiveTarget((previous) =>\n sameTarget(previous, newActiveTarget) ? previous : newActiveTarget\n );\n }, [newActiveTarget]);\n\n const activeTargetChangeInitialized = useRef(false);\n useEffect(() => {\n if (!activeTargetChangeInitialized.current) {\n activeTargetChangeInitialized.current = true;\n return;\n }\n onActiveTargetChange(activeTarget);\n }, [activeTarget, onActiveTargetChange]);\n\n useEffect(() => {\n if (!activeTarget) {\n return;\n }\n const resetActiveTarget = (e: MouseEvent) => {\n const path = e.composedPath();\n const cellsContainerIndex = path.indexOf(cellsRef.current!);\n // Reset active target to null when clicking outside of the cells container,\n // Or inside the cells container but not on any cell.\n if (cellsContainerIndex <= 0) {\n setActiveTarget(null);\n }\n };\n document.addEventListener(\"click\", resetActiveTarget);\n return () => {\n document.removeEventListener(\"click\", resetActiveTarget);\n };\n }, [activeTarget, cellsRef]);\n\n return activeTarget;\n}\n","import { useEffect, useRef, useState } from \"react\";\nimport type { ZoomBehavior } from \"d3-zoom\";\nimport {\n forceCollide,\n forceLink,\n forceManyBody,\n forceSimulation,\n forceX,\n forceY,\n type Simulation,\n} from \"d3-force\";\nimport dagre from \"@dagrejs/dagre\";\nimport { pick } from \"lodash\";\nimport type {\n Cell,\n ForceCollideOptions,\n ForceLink,\n ForceNode,\n LayoutOptions,\n LayoutOptionsForce,\n LayoutType,\n NodeId,\n NodeView,\n} from \"../../draw-canvas/interfaces\";\nimport type { FullRectTuple, RangeTuple } from \"../../diagram/interfaces\";\nimport { useAutoCenter } from \"./useAutoCenter\";\nimport {\n isEdgeCell,\n isNodeCell,\n isNodeOrEdgeCell,\n} from \"../../draw-canvas/processors/asserts\";\nimport {\n SYMBOL_FOR_LAYOUT_INITIALIZED,\n SYMBOL_FOR_SIZE_INITIALIZED,\n} from \"../../draw-canvas/constants\";\nimport type { DrawCanvasAction } from \"../../draw-canvas/reducers/interfaces\";\nimport { extractPartialRectTuple } from \"../../diagram/processors/extractPartialRectTuple\";\n\nexport interface UseLayoutOptions {\n layout: LayoutType;\n layoutOptions?: LayoutOptions;\n rootRef: React.RefObject<SVGSVGElement>;\n cells: Cell[];\n zoomable?: boolean;\n zoomer: ZoomBehavior<SVGSVGElement, unknown>;\n scaleRange: RangeTuple;\n dispatch: (value: DrawCanvasAction) => void;\n}\n\nexport function useLayout({\n layout,\n layoutOptions,\n rootRef,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n dispatch,\n}: UseLayoutOptions) {\n const [layoutInitialized, setLayoutInitialized] = useState(\n layout !== \"force\" && layout !== \"dagre\"\n );\n\n const [centered, setCentered] = useAutoCenter({\n rootRef,\n layoutInitialized,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n });\n\n const previousLayoutRef = useRef<Cell[] | null>(null);\n\n useEffect(() => {\n // Wait for all nodes to be size-initialized before layout.\n if (\n cells.some(\n (cell) => isNodeCell(cell) && !cell[SYMBOL_FOR_SIZE_INITIALIZED]\n )\n ) {\n return;\n }\n\n if (layout !== \"force\" && layout !== \"dagre\") {\n setLayoutInitialized(true);\n return;\n }\n\n // Do not re-layout if nodes and edges not changed.\n if (\n isSameArray(previousLayoutRef.current, cells.filter(isNodeOrEdgeCell))\n ) {\n return;\n }\n\n let getNodeView: (id: NodeId) => NodeView;\n let nodePaddings: FullRectTuple;\n\n if (layout === \"force\") {\n const forceLayoutOptions = layoutOptions as LayoutOptionsForce;\n const { nodePadding, collide } = {\n nodePadding: 0,\n ...pick(forceLayoutOptions, [\"nodePadding\"]),\n collide:\n forceLayoutOptions?.collide !== false\n ? ({\n radiusDiff: 18,\n strength: 1,\n iterations: 1,\n ...(forceLayoutOptions?.collide === true\n ? null\n : (forceLayoutOptions?.collide as ForceCollideOptions)),\n } as Required<ForceCollideOptions>)\n : (false as const),\n };\n nodePaddings = extractPartialRectTuple(nodePadding);\n const forceNodes: ForceNode[] = [];\n const forceLinks: ForceLink[] = [];\n const nodesMap = new Map<NodeId, ForceNode>();\n for (const cell of cells) {\n if (isNodeCell(cell)) {\n const node: ForceNode = {\n id: cell.id,\n width: cell.view.width + nodePaddings[1] + nodePaddings[3],\n height: cell.view.height + nodePaddings[0] + nodePaddings[2],\n };\n forceNodes.push(node);\n nodesMap.set(node.id, node);\n } else if (isEdgeCell(cell)) {\n forceLinks.push({ source: cell.source, target: cell.target });\n }\n }\n\n const linkSimulation = forceLink<ForceNode, ForceLink>(forceLinks).id(\n (d) => d.id\n );\n const simulation = forceSimulation<ForceNode, ForceLink>(forceNodes)\n .force(\"link\", linkSimulation)\n .force(\"x\", forceX())\n .force(\"y\", forceY())\n .force(\"charge\", forceManyBody());\n\n if (collide) {\n simulation.force(\n \"collide\",\n forceCollide<ForceNode>()\n .radius(\n (d) =>\n Math.sqrt(d.width ** 2 + d.height ** 2) / 2 + collide.radiusDiff\n )\n .strength(collide.strength)\n .iterations(collide.iterations)\n );\n }\n\n simulation.stop();\n manuallyTickToTheEnd(simulation);\n\n getNodeView = (id: NodeId) => nodesMap.get(id) as NodeView;\n } else {\n const dagreLayoutOptions = layoutOptions as LayoutOptionsForce;\n const { nodePadding, ...dagreGraphOptions } = {\n nodePadding: 0,\n rankdir: \"TB\",\n ranksep: 50,\n edgesep: 10,\n nodesep: 50,\n // align: undefined,\n ...pick(dagreLayoutOptions, [\n \"nodePadding\",\n \"rankdir\",\n \"ranksep\",\n \"edgesep\",\n \"nodesep\",\n \"align\",\n ]),\n };\n nodePaddings = extractPartialRectTuple(nodePadding);\n const graph = new dagre.graphlib.Graph<ForceNode>();\n graph.setGraph(dagreGraphOptions);\n // Default to assigning a new object as a label for each new edge.\n graph.setDefaultEdgeLabel(function () {\n return {};\n });\n for (const cell of cells) {\n if (isNodeCell(cell)) {\n graph.setNode(cell.id, {\n id: cell.id,\n width: cell.view.width + nodePaddings[1] + nodePaddings[3],\n height: cell.view.height + nodePaddings[0] + nodePaddings[2],\n });\n } else if (isEdgeCell(cell)) {\n graph.setEdge(cell.source, cell.target);\n }\n }\n dagre.layout(graph);\n\n getNodeView = (id: NodeId) => graph.node(id);\n }\n\n const newCells: Cell[] = cells.map((cell) => {\n if (isNodeCell(cell)) {\n const nodeView = getNodeView(cell.id);\n return {\n ...cell,\n view: {\n ...cell.view,\n x: nodeView.x! - nodeView.width / 2 + nodePaddings[3],\n y: nodeView.y! - nodeView.height / 2 + nodePaddings[0],\n },\n [SYMBOL_FOR_LAYOUT_INITIALIZED]: true,\n };\n }\n return cell;\n });\n previousLayoutRef.current = newCells.filter(isNodeOrEdgeCell);\n dispatch({ type: \"update-cells\", payload: newCells });\n\n setCentered(false);\n setLayoutInitialized(true);\n }, [cells, dispatch, layout, layoutOptions, setCentered]);\n\n return { centered, setCentered };\n}\n\nfunction manuallyTickToTheEnd(\n simulation: Simulation<ForceNode, ForceLink>\n): void {\n // Manually tick to the end.\n simulation.tick(\n Math.ceil(\n Math.log(simulation.alphaMin()) / Math.log(1 - simulation.alphaDecay())\n )\n );\n}\n\nfunction isSameArray<T = unknown>(a: T[] | null, b: T[]): boolean {\n return a?.length === b.length && a.every((v, i) => v === b[i]);\n}\n","import React, { useEffect, useState } from \"react\";\nimport { select } from \"d3-selection\";\nimport { ZoomTransform, type ZoomBehavior } from \"d3-zoom\";\nimport type { RangeTuple } from \"../../diagram/interfaces\";\nimport { SYMBOL_FOR_SIZE_INITIALIZED } from \"../../draw-canvas/constants\";\nimport type { Cell } from \"../../draw-canvas/interfaces\";\nimport {\n isDecoratorCell,\n isNodeCell,\n} from \"../../draw-canvas/processors/asserts\";\nimport { transformToCenter } from \"../../draw-canvas/processors/transformToCenter\";\n\nexport interface UseAutoCenterOptions {\n rootRef: React.RefObject<SVGSVGElement>;\n cells: Cell[];\n layoutInitialized: boolean;\n zoomable?: boolean;\n zoomer: ZoomBehavior<SVGSVGElement, unknown>;\n scaleRange: RangeTuple;\n}\n\nexport type UseAutoCenterResult = [\n centered: boolean,\n setCentered: React.Dispatch<React.SetStateAction<boolean>>,\n];\n\nexport function useAutoCenter({\n rootRef,\n cells,\n layoutInitialized,\n zoomable,\n zoomer,\n scaleRange,\n}: UseAutoCenterOptions): UseAutoCenterResult {\n const [centered, setCentered] = useState(false);\n\n useEffect(() => {\n const root = rootRef.current;\n if (\n !root ||\n !layoutInitialized ||\n centered ||\n !cells.some((cell) => isNodeCell(cell) || isDecoratorCell(cell)) ||\n cells.some(\n (cell) => isNodeCell(cell) && !cell[SYMBOL_FOR_SIZE_INITIALIZED]\n )\n ) {\n return;\n }\n const { k, x, y } = transformToCenter(cells, {\n canvasWidth: root.clientWidth,\n canvasHeight: root.clientHeight,\n scaleRange: zoomable ? scaleRange : undefined,\n });\n // istanbul ignore next\n if (process.env.NODE_ENV !== \"test\") {\n // jsdom doesn't support svg baseVal yet.\n // https://github.com/jsdom/jsdom/issues/2531\n zoomer.transform(select(root), new ZoomTransform(k, x, y));\n }\n setCentered(true);\n }, [\n cells,\n centered,\n layoutInitialized,\n rootRef,\n scaleRange,\n zoomable,\n zoomer,\n ]);\n\n useEffect(() => {\n // Reset auto centering when nodes and decorators are all removed.\n if (!cells.some((cell) => isNodeCell(cell) || isDecoratorCell(cell))) {\n setCentered(false);\n }\n }, [cells]);\n\n return [centered, setCentered];\n}\n","import { useMemo } from \"react\";\nimport type { Cell, LayoutType } from \"../../draw-canvas/interfaces\";\nimport { isNodeCell } from \"../../draw-canvas/processors/asserts\";\nimport {\n SYMBOL_FOR_LAYOUT_INITIALIZED,\n SYMBOL_FOR_SIZE_INITIALIZED,\n} from \"../../draw-canvas/constants\";\n\nexport interface UseReadyOptions {\n cells: Cell[];\n layout: LayoutType;\n centered: boolean;\n}\n\nexport function useReady({ cells, layout, centered }: UseReadyOptions) {\n const ready = useMemo(\n () =>\n centered &&\n cells.every(\n (cell) =>\n !isNodeCell(cell) ||\n (cell[SYMBOL_FOR_SIZE_INITIALIZED] &&\n ((layout !== \"force\" && layout !== \"dagre\") ||\n cell[SYMBOL_FOR_LAYOUT_INITIALIZED]))\n ),\n [cells, centered, layout]\n );\n return ready;\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport { select } from \"d3-selection\";\nimport { zoom, type ZoomBehavior } from \"d3-zoom\";\nimport type { RangeTuple, TransformLiteral } from \"../../diagram/interfaces\";\nimport {\n DEFAULT_SCALE_RANGE_MIN,\n DEFAULT_SCALE_RANGE_MAX,\n} from \"../../draw-canvas/constants\";\nimport type { ActiveTarget } from \"../../draw-canvas/interfaces\";\n\nexport interface UseZoomOptions {\n rootRef: React.RefObject<SVGSVGElement>;\n zoomable?: boolean;\n scrollable?: boolean;\n pannable?: boolean;\n scaleRange?: RangeTuple;\n onSwitchActiveTarget?(target: ActiveTarget | null): void;\n}\n\nexport interface UseZoomResult {\n grabbing: boolean;\n transform: TransformLiteral;\n scaleRange: RangeTuple;\n zoomer: ZoomBehavior<SVGSVGElement, unknown>;\n}\n\nexport function useZoom({\n rootRef,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onSwitchActiveTarget,\n}: UseZoomOptions): UseZoomResult {\n const [grabbing, setGrabbing] = useState(false);\n const [transform, setTransform] = useState<TransformLiteral>({\n k: 1,\n x: 0,\n y: 0,\n });\n\n const scaleRange = useMemo(\n () =>\n _scaleRange ??\n ([DEFAULT_SCALE_RANGE_MIN, DEFAULT_SCALE_RANGE_MAX] as RangeTuple),\n [_scaleRange]\n );\n\n const zoomer = useMemo(() => zoom<SVGSVGElement, unknown>(), []);\n\n // istanbul ignore next: d3-zoom currently hard to test\n useEffect(() => {\n let moved = false;\n zoomer\n .scaleExtent(zoomable ? scaleRange : [1, 1])\n .on(\"start\", () => {\n moved = false;\n setGrabbing(true);\n })\n .on(\"zoom\", (e: { transform: TransformLiteral }) => {\n moved = true;\n setTransform(e.transform);\n })\n .on(\"end\", () => {\n setGrabbing(false);\n if (!moved) {\n onSwitchActiveTarget?.(null);\n }\n });\n }, [onSwitchActiveTarget, scaleRange, zoomable, zoomer]);\n\n // istanbul ignore next: d3-zoom currently hard to test\n useEffect(() => {\n const root = rootRef.current;\n if (!root) {\n return;\n }\n\n const rootSelection = select(root);\n\n const unsetZoom = () => {\n rootSelection\n .on(\".zoom\", null)\n .on(\".zoom.custom\", null)\n .on(\"wheel\", null);\n };\n\n if (!(zoomable || scrollable || pannable)) {\n unsetZoom();\n return;\n }\n\n if (zoomable || scrollable) {\n // Do not override default d3 zoom handler.\n // Only handles *panning*\n rootSelection.on(\n \"wheel.zoom.custom\",\n (e: WheelEvent & { wheelDeltaX: number; wheelDeltaY: number }) => {\n // Mac OS trackpad pinch event is emitted as a wheel.zoom and d3.event.ctrlKey set to true\n if (!e.ctrlKey) {\n // Stop immediate propagation for default d3 zoom handler\n e.stopImmediatePropagation();\n if (scrollable) {\n e.preventDefault();\n zoomer.translateBy(\n rootSelection,\n e.wheelDeltaX / 5,\n e.wheelDeltaY / 5\n );\n }\n }\n // zoomer.scaleBy(rootSelection, Math.pow(2, defaultWheelDelta(e)))\n }\n );\n }\n\n rootSelection\n .call(zoomer)\n .on(\"wheel\", (e: WheelEvent) => e.preventDefault())\n .on(\"dblclick.zoom\", null)\n .on(\"mousedown.zoom\", null);\n\n if (!pannable) {\n rootSelection\n .on(\"touchstart.zoom\", null)\n .on(\"touchmove.zoom\", null)\n .on(\"touchend.zoom\", null);\n }\n\n return unsetZoom;\n }, [pannable, rootRef, scrollable, zoomable, zoomer]);\n\n return { grabbing, transform, zoomer, scaleRange };\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.zoom-bar{position:absolute;bottom:20px;right:20px;width:40px}.zoom-slider,\n.center-button{width:100%;display:flex;align-items:center;border:1px solid var(--antd-background-color-base);border-radius:var(--larger-border-radius);box-shadow:var(--connected-overlay-shadow);background-color:var(--color-fill-bg-container-4)}.zoom-slider{height:140px;padding:8px 0;flex-direction:column}[role=\"button\"]{cursor:pointer}.center-button{justify-content:center;margin-bottom:8px;height:40px}.center-button:hover{border-color:var(--antd-btn-default-hover-border-color)}.center-button path{fill:var(--antd-link-hover-color)}.center-button:hover path{fill:var(--palette-blue-7)}.zoom-button{font-size:16px;line-height:0}.zoom-button svg{width:1em;height:1em;fill:var(--antd-link-hover-color)}.zoom-slider .ant-slider-vertical{padding-inline:5px}.zoom-slider .ant-slider-vertical .ant-slider-rail{width:2px}.zoom-slider .ant-slider-vertical .ant-slider-handle{width:6px;height:6px;inset-inline-start:3px}.zoom-slider .ant-slider .ant-slider-handle:hover::before,\n.zoom-slider .ant-slider .ant-slider-handle:focus::before,\n.zoom-slider .ant-slider .ant-slider-handle::before{width:10px;height:10px;inset-inline-start:-2px}.zoom-slider .ant-slider .ant-slider-handle:hover::after,\n.zoom-slider .ant-slider .ant-slider-handle:focus::after,\n.zoom-slider .ant-slider .ant-slider-handle::after{width:6px;height:6px;inset-block-start:0;inset-inline-start:0}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root{opacity:0}.root.ready{opacity:1}.root:focus{outline:none}.decorator-area .area{fill:rgba(119,141,195,0.1);stroke:none;stroke-width:0}.node,\n.decorator-text{overflow:visible}.cell.active .decorator-area .area,\n.cell.active .line-active-bg{stroke:var(--palette-blue-5);stroke-dasharray:4;stroke-width:1}.cell:not(.read-only){-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-handle{cursor:nwse-resize;opacity:0}.resize-handle rect{fill:transparent;stroke:none}.resize-handle path{fill:none;stroke:var(--palette-gray-5);stroke-width:1.5}.cell.active .decorator-area .resize-handle,\n.decorator-area:hover .resize-handle{opacity:1}.connect-line{pointer-events:none}.connect-line:not(.connecting){display:none}.line.dashed{stroke-dasharray:4}.cell.active .decorator-text .text-container{outline:1px dashed var(--palette-blue-5)}.decorator-text .text-container{width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:0.5em}.decorator-text .text:focus{outline:none}.cell.faded{opacity:0.3}.cell .node{pointer-events:none}.cell .node > *{pointer-events:auto}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n"],"names":["MarkerComponent","_ref","Component","id","type","strokeColor","EntityRelationZeroOrOneMarker","EntityRelationZeroOrManyMarker","ArrowMarker","React","_ref2","viewBox","refX","refY","markerWidth","markerHeight","orient","strokeLinejoin","d","stroke","strokeWidth","fill","_ref3","_ref4","getDirectLinePoints","source","target","doTwoNodesOverlap","x0","y0","x1","y1","dx","x","dy","y","directionX","deltaRadio","Math","abs","directionY","width","height","a","b","paddingA","paddingB","A","getNodesWithPadding","B","left","min","right","max","top","bottom","node","padding","extractPartialRectTuple","value","Array","isArray","v0","v1","length","findNode","cells","find","cell","isNodeCell","EdgeComponent","edge","markerEnd","defaultEdgeLines","sourceNode","useMemo","targetNode","lineConf","item","checkIfByTransform","line","view","nodeViewToNodeRect","concat","className","classNames","dashed","NodeComponent","defaultNodeBricks","onResize","memoizedData","memoizedValue","setMemoizedValue","useState","useEffect","prev","isEqual","useDeepMemo","data","specifiedUseBrick","useBrick","observerRef","useRef","_defaultNodeBricks$fi","refCallback","useCallback","element","prevObserver","current","disconnect","setTimeout","observer","ResizeObserver","offsetWidth","offsetHeight","observe","ReactUseBrick","cellToTarget","pick","handleMouseDown","event","action","scale","layout","onCellMoving","onCellMoved","onCellResizing","onCellResized","onSwitchActiveTarget","stopPropagation","isEdgeCell","from","clientX","clientY","original","moved","handleMove","e","finished","movement","getMovement","onMouseMove","onMouseUp","document","removeEventListener","addEventListener","DecoratorArea","transform","readOnly","resizeHandleRef","resizeHandle","onMouseDown","k","ref","DecoratorText","_cell$view$text","onDecoratorTextEditing","onDecoratorTextChange","label","text","currentLabel","setCurrentLabel","editingLabel","setEditingLabel","editingLabelInitialized","shouldEmitLabelChange","setShouldEmitLabelChange","handleEnableEdit","preventDefault","textContent","focus","range","createRange","selectNodeContents","selection","window","getSelection","removeAllRanges","addRange","selectAllText","editing","handleInput","handleBlur","_objectSpread","onDoubleClick","contentEditable","onInput","onBlur","DecoratorComponent","SpecifiedComponent","decorator","console","error","CellComponent","active","unrelatedCells","onCellContextMenu","onNodeBrickResize","onCellMouseEnter","onCellMouseLeave","gRef","unrelated","some","sameTarget","g","handleContextMenu","handleMouseEnter","handleMouseLeave","faded","undefined","onContextMenu","onMouseEnter","onMouseLeave","isDecoratorCell","SYMBOL_FOR_SIZE_INITIALIZED","Symbol","for","SYMBOL_FOR_LAYOUT_INITIALIZED","DEFAULT_NODE_SIZE","DEFAULT_NODE_GAP","DEFAULT_AREA_WIDTH","DEFAULT_AREA_HEIGHT","DEFAULT_SCALE_RANGE_MIN","DEFAULT_SCALE_RANGE_MAX","isInitialNodeCell","isNodeOrEdgeCell","getUnrelatedCells","connectLineState","activeTarget","existedTargets","Set","add","has","push","nodesMap","Map","relatedNodeIds","set","initializeCells","initialCells","defaultNodeSize","map","_cell$view","_cell$view2","transformToCenter","canvasWidth","canvasHeight","scaleRange","Infinity","empty","r","insertCellAfter","newCell","after","index","findLastIndex","slice","reducers","rootReducer","state","payload","findIndex","size","Object","fromEntries","entries","key","props","_extends","xmlns","ZoomBarComponent","shadowRoot","onZoomChange","onReCenter","currentTheme","useCurrentTheme","cache","createCache","zoomBarRef","tooltip","formatter","placement","getPopupContainer","onZoomIn","onZoomOut","ConfigProvider","theme","algorithm","darkAlgorithm","defaultAlgorithm","StyleProvider","container","autoClear","hashPriority","onClick","role","CenterSVG","ZoomInSVG","Slider","step","vertical","included","onChange","ZoomOutSVG","useActiveTarget","cellsRef","_activeTarget","onActiveTargetChange","newActiveTarget","setActiveTarget","previous","activeTargetChangeInitialized","resetActiveTarget","composedPath","indexOf","useLayout","layoutOptions","rootRef","zoomable","zoomer","dispatch","layoutInitialized","setLayoutInitialized","centered","setCentered","root","clientWidth","clientHeight","select","ZoomTransform","useAutoCenter","previousLayoutRef","filter","every","v","i","getNodeView","nodePaddings","forceLayoutOptions","nodePadding","collide","radiusDiff","strength","iterations","forceNodes","forceLinks","linkSimulation","forceLink","simulation","forceSimulation","force","forceX","forceY","forceManyBody","forceCollide","radius","sqrt","stop","tick","ceil","log","alphaMin","alphaDecay","manuallyTickToTheEnd","get","dagreLayoutOptions","_nodePadding$rankdir$","rankdir","ranksep","edgesep","nodesep","dagreGraphOptions","_objectWithoutProperties","_excluded","graph","dagre","Graph","setGraph","setDefaultEdgeLabel","setNode","setEdge","newCells","nodeView","useReady","useZoom","scrollable","pannable","_scaleRange","grabbing","setGrabbing","setTransform","zoom","scaleExtent","on","rootSelection","unsetZoom","ctrlKey","stopImmediatePropagation","translateBy","wheelDeltaX","wheelDeltaY","call","___CSS_LOADER_EXPORT___","module","toString"],"sourceRoot":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see editable-label.8e6f528c.js.LICENSE.txt */
|
|
2
|
-
(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[6006,2052],{3328:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EditableLabel:()=>T,EditableLabelComponent:()=>I,LegacyEditableLabelComponent:()=>V});var r,i,a,o,l,c,s,u,f,h,p,d,b,g,v,m=n(4635),y=n(918),w=n(1369),A=n(8449),x=n(6902),E=n(8769),k=n.n(E),S=n(9929),C=n(9938),j=(n(330),n(3373)),z=n.n(j),P=n(3971);function D(e,t,n){return n(O(e,t))}function L(e,t,n){return e.set(O(e,t),n),n}function M(e,t){return e.get(O(e,t))}function O(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var T,{defineElement:W,property:R,event:_,method:N}=(0,S.createDecorators)(),I=(0,E.forwardRef)(V),B=new WeakMap,H=new WeakMap,K=new WeakMap,q=new WeakSet,F=new WeakMap,G=new WeakMap,J=new WeakMap,Q=new WeakMap;class U extends C.ReactNextElement{constructor(){super(...arguments),(0,m.A)(this,q),(0,y.A)(this,B,(r(this),a(this))),(0,y.A)(this,H,(o(this),l(this))),(0,y.A)(this,K,(c(this),s(this))),(0,y.A)(this,F,(h(this),e=>{D(q,this,u).emit(e)})),(0,y.A)(this,G,p(this)),(0,y.A)(this,J,(g(this),e=>{D(q,this,d).emit(e)})),(0,y.A)(this,Q,(0,E.createRef)())}get label(){return M(B,this)}set label(e){L(B,this,e)}get type(){return M(H,this)}set type(e){L(H,this,e)}enableEditing(){var e;null===(e=M(Q,this).current)||void 0===e||e.enableEditing()}render(){return k().createElement(I,{ref:M(Q,this),label:this.label,onLabelEditingChange:M(F,this),onLabelChange:M(J,this)})}}function V(e,t){var{label:n,onLabelChange:r,onLabelEditingChange:i}=e,a=null!=n?n:"",[o,l]=(0,E.useState)(a),[c,s]=(0,E.useState)(!1),u=(0,E.useRef)(!1),[f,h]=(0,E.useState)(!1),p=(0,E.useRef)(null);(0,E.useImperativeHandle)(t,(()=>({enableEditing(){s(!0)}}))),(0,E.useEffect)((()=>{l(a)}),[a]);var d=(0,E.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),s(!0)}),[]);(0,E.useEffect)((()=>{var e,t;c&&(null===(e=p.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=p.current)||void 0===t||t.select())}),[c]),(0,E.useEffect)((()=>{u.current?null==i||i(c):u.current=!0}),[c,i]);var b=(0,E.useCallback)((e=>{l(e.target.value)}),[]),g=(0,E.useCallback)((e=>{var t,n=e.key||e.keyCode||e.which;"Enter"!==n&&13!==n||null===(t=p.current)||void 0===t||t.blur()}),[]),v=(0,E.useCallback)((()=>{s(!1),h(!0)}),[]);(0,E.useEffect)((()=>{f&&(null==r||r(o),h(!1))}),[o,r,f]);var m=(0,E.useCallback)((e=>{e.stopPropagation()}),[]);return k().createElement("div",{className:z()("label",{editing:c,empty:!o}),onDoubleClick:m,onMouseDown:m},k().createElement("input",{className:"label-input",value:o,ref:p,onChange:b,onKeyDown:g,onBlur:v}),k().createElement("div",{className:"label-text",onDoubleClick:d},o))}v=U,({e:[a,o,l,c,s,u,f,h,p,d,b,g,r],c:[T,i]}=function(e,t,n,r,i,a){var o,l,c,s,u,f,h,p=Symbol.metadata||Symbol.for("Symbol.metadata"),d=Object.defineProperty,b=Object.create,g=[b(null),b(null)],v=t.length;function m(t,n,r){return function(i,a){n&&(a=i,i=e);for(var o=0;o<t.length;o++)a=t[o].apply(i,r?[a]:[]);return r?a:i}}function y(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function E(e,t,n,r,i,a,c,s,u,f,h){function p(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var b=[].concat(t[0]),v=t[3],w=!c,x=1===i,E=3===i,k=4===i,S=2===i;function C(t,n,r){return function(i,a){return n&&(a=i,i=e),r&&r(i),j[t].call(i,a)}}if(!w){var j={},z=[],P=E?"get":k||x?"set":"value";if(u?(f||x?j={get:(0,A.A)((function(){return v(this)}),r,"get"),set:function(e){t[4](this,e)}}:j[P]=v,f||(0,A.A)(j[P],r,S?"":P)):f||(j=Object.getOwnPropertyDescriptor(e,r)),!f&&!u){if((l=g[+s][r])&&7!=(l^i))throw new Error("Decorating two elements with the same name ("+j[P].name+") is not supported yet");g[+s][r]=i<3?1:i}}for(var D=e,L=b.length-1;L>=0;L-=n?2:1){var M=b[L],O=n?b[L-1]:void 0,T={},W={kind:["field","accessor","method","getter","setter","class"][i],name:r,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),a.push(t)}.bind(null,T)};if(w)l=M.call(O,D,W),T.v=1,y(l,"class decorators","return")&&(D=l);else if(W.static=s,W.private=u,l=W.access={has:u?h.bind():function(e){return r in e}},k||(l.get=u?S?function(e){return p(e),j.value}:C("get",0,p):function(e){return e[r]}),S||E||(l.set=u?C("set",0,p):function(e,t){e[r]=t}),D=M.call(O,x?{get:j.get,set:j.set}:j[P],W),T.v=1,x){if("object"==typeof D&&D)(l=y(D.get,"accessor.get"))&&(j.get=l),(l=y(D.set,"accessor.set"))&&(j.set=l),(l=y(D.init,"accessor.init"))&&z.unshift(l);else if(void 0!==D)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(D,(f?"field":"method")+" decorators","return")&&(f?z.unshift(D):j[P]=D)}return i<2&&c.push(m(z,s,1),m(a,s,0)),f||w||(u?x?c.splice(-1,0,C("get",s),C("set",s)):c.push(S?j[P]:y.call.bind(j[P])):d(e,r,j)),D}function k(e){return d(e,p,{configurable:!0,enumerable:!0,value:o})}return void 0!==a&&(o=a[p]),o=b(null==o?null:o),u=[],f=function(e){e&&u.push(m(e))},(h=function(t,r){for(var a=0;a<n.length;a++){var o=n[a],l=o[1],f=7&l;if((8&l)==t&&!f==r){var h=o[2],p=!!o[3],d=16&l;E(t?e:e.prototype,o,d,p?"#"+h:(0,w.A)(h),f,f<2?[]:t?s=s||[]:c=c||[],u,!!t,p,r,t&&p?function(t){return(0,x.A)(t)===e}:i)}}})(8,0),h(0,0),h(8,1),h(0,1),f(c),f(s),l=u,v||k(e),{e:l,get c(){var n=[];return v&&[k(e=E(e,[t],0,e.name,5,n)),m(n,1)]}}}(v,[W("diagram.editable-label",{styleTexts:[P.A]})],[[R(),1,"label"],[R({render:!1}),1,"type"],[_({type:"label.editing.change"}),1,"labelEditingChange",e=>M(K,e),(e,t)=>L(K,e,t)],[_({type:"label.change"}),1,"labelChange",e=>M(G,e),(e,t)=>L(G,e,t)],[N(),2,"enableEditing"]],0,(e=>Q.has((0,x.A)(e))),C.ReactNextElement)),i()},3971:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(6758),i=n.n(r),a=n(935),o=n.n(a)()(i());o.push([e.id,':host{display:block;--local-label-line-height:inherit;--local-label-font-size:inherit;--local-label-color:inherit;--local-label-font-weight:inherit}:host([hidden]){display:none}:host([type="line"]){--local-label-line-height:18px;--local-label-font-size:11px;--local-label-color:var(--color-secondary-text);--local-label-font-weight:400}*{box-sizing:border-box}.label{max-width:168px;margin:-3px}.label-text,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:var(--local-label-line-height);font-size:var(--local-label-font-size);color:var(--local-label-color);font-weight:var(--local-label-font-weight);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;-moz-user-select:text;user-select:text}.label-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.label.editing .label-text,\n.label.empty:not(.editing) .label-text,\n.label:not(.editing) .label-input{display:none}',""]);const l=o.toString()},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,a){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var l=0;l<this.length;l++){var c=this[l][0];null!=c&&(o[c]=!0)}for(var s=0;s<e.length;s++){var u=[].concat(e[s]);r&&o[u[0]]||(void 0!==a&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},6758:e=>{"use strict";e.exports=function(e){return e[1]}},3373:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=o(e,a(n)))}return e}function a(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=o(t,n));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()},6902:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(7545);function i(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==e?(0,r.A)(e):"null"));return e}},2016:(e,t,n)=>{"use strict";function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{A:()=>r})},918:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2016);function i(e,t,n){(0,r.A)(e,t),t.set(e,n)}},4635:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2016);function i(e,t){(0,r.A)(e,t),t.add(e)}},8449:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(7545);function i(e,t,n){"symbol"==(0,r.A)(t)&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+" "+t:t})}catch(e){}return e}},1369:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(7545);function i(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=(0,r.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,r.A)(t)?t:String(t)}},7545:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})}}]);
|
|
3
|
-
//# sourceMappingURL=editable-label.8e6f528c.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[9823],{6094:(e,t,a)=>{a.r(t),a.d(t,{EoDisplayCanvas:()=>pe});var n,s,i,r,l,o,c,u,h,d,f,g,p,b,m,v,y,w,k,A,C,E,M,R,T,z,N,W,S,x,B,O,L,j,U=a(4635),_=a(918),P=a(1369),D=a(8449),I=a(6902),H=a(8769),Y=a.n(H),q=a(9929),F=a(9938),J=(a(330),a(1030)),Z=a(3373),G=a.n(Z),K=a(7566),Q=a(3739),V=a(8185),X=a(2830),$=a(3783),ee=a(3033),te=a(8091),ae=a(1819),ne=a(1083),se=a(227),ie=a(531),re=a(7099),le=a(2361),oe=a(8197),ce=a(3012),ue=a(8618);function he(e,t,a){return a(ge(e,t))}function de(e,t,a){return e.set(ge(e,t),a),a}function fe(e,t){return e.get(ge(e,t))}function ge(e,t,a){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:a;throw new TypeError("Private element is not present on this object")}var pe,{defineElement:be,property:me,event:ve}=(0,q.createDecorators)(),ye=new WeakMap,we=new WeakMap,ke=new WeakMap,Ae=new WeakMap,Ce=new WeakMap,Ee=new WeakMap,Me=new WeakMap,Re=new WeakMap,Te=new WeakMap,ze=new WeakMap,Ne=new WeakMap,We=new WeakMap,Se=new WeakMap,xe=new WeakSet,Be=new WeakMap,Oe=new WeakMap,Le=new WeakMap,je=new WeakMap;class Ue extends F.ReactNextElement{constructor(){super(...arguments),(0,U.A)(this,xe),(0,_.A)(this,ye,s(this)),(0,_.A)(this,we,(i(this),r(this))),(0,_.A)(this,ke,(l(this),o(this))),(0,_.A)(this,Ae,(c(this),u(this,[ee.HP,ee.HP]))),(0,_.A)(this,Ce,(h(this),d(this))),(0,_.A)(this,Ee,(f(this),g(this))),(0,_.A)(this,Me,(p(this),b(this))),(0,_.A)(this,Re,(m(this),v(this))),(0,_.A)(this,Te,(y(this),w(this,!0))),(0,_.A)(this,ze,(k(this),A(this,!0))),(0,_.A)(this,Ne,(C(this),E(this,!0))),(0,_.A)(this,We,(M(this),R(this))),(0,_.A)(this,Se,(T(this),z(this))),(0,_.A)(this,Be,(S(this),e=>{he(xe,this,N).emit(e)})),(0,_.A)(this,Oe,(e=>{(0,V.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,_.A)(this,Le,x(this)),(0,_.A)(this,je,(L(this),e=>{he(xe,this,B).emit(e)}))}get cells(){return fe(ye,this)}set cells(e){de(ye,this,e)}get layout(){return fe(we,this)}set layout(e){de(we,this,e)}get layoutOptions(){return fe(ke,this)}set layoutOptions(e){de(ke,this,e)}get defaultNodeSize(){return fe(Ae,this)}set defaultNodeSize(e){de(Ae,this,e)}get defaultNodeBricks(){return fe(Ce,this)}set defaultNodeBricks(e){de(Ce,this,e)}get defaultEdgeLines(){return fe(Ee,this)}set defaultEdgeLines(e){de(Ee,this,e)}get activeTarget(){return fe(Me,this)}set activeTarget(e){de(Me,this,e)}get fadeUnrelatedCells(){return fe(Re,this)}set fadeUnrelatedCells(e){de(Re,this,e)}get zoomable(){return fe(Te,this)}set zoomable(e){de(Te,this,e)}get scrollable(){return fe(ze,this)}set scrollable(e){de(ze,this,e)}get pannable(){return fe(Ne,this)}set pannable(e){de(Ne,this,e)}get scaleRange(){return fe(We,this)}set scaleRange(e){de(We,this,e)}render(){return Y().createElement(_e,{shadowRoot:this.shadowRoot,cells:this.cells,layout:this.layout,layoutOptions:this.layoutOptions,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:fe(Be,this),onSwitchActiveTarget:fe(Oe,this),onCellContextMenu:fe(je,this)})}}function _e(e){var{shadowRoot:t,cells:a,layout:n,layoutOptions:s,defaultNodeSize:i,defaultNodeBricks:r,defaultEdgeLines:l,activeTarget:o,fadeUnrelatedCells:c,zoomable:u,scrollable:h,pannable:d,scaleRange:f,onActiveTargetChange:g,onSwitchActiveTarget:p,onCellContextMenu:b}=e,[{cells:m},v]=(0,H.useReducer)(ne.d,a,(e=>({cells:(0,$.C)(e,{defaultNodeSize:i})}))),y=(0,H.useRef)(null),w=(0,H.useRef)(null),{grabbing:k,transform:A,zoomer:C,scaleRange:E}=(0,te.f)({rootRef:y,zoomable:u,scrollable:h,pannable:d,scaleRange:f,onSwitchActiveTarget:p}),{centered:M,setCentered:R}=(0,le.g)({layout:n,layoutOptions:s,rootRef:y,cells:m,zoomable:u,zoomer:C,scaleRange:E,dispatch:v}),T=(0,ae.J)({cellsRef:w,activeTarget:o,onActiveTargetChange:g}),z=(0,H.useMemo)((()=>"".concat((0,J.uniqueId)("diagram-"),"-")),[]),N="".concat(z,"line-arrow-"),W="".concat(N,"1"),S=(0,H.useCallback)(((e,t)=>{v({type:"update-node-size",payload:{id:e,size:t}})}),[]),[x,B]=(0,H.useState)(null),O=(0,H.useCallback)((e=>{B(e)}),[]),L=(0,H.useCallback)((e=>{B((t=>t===e?null:t))}),[]),[j,U]=(0,H.useState)([]);(0,H.useEffect)((()=>{var e=c?(0,se.Y)(m,null,x):[];U((t=>0===t.length&&0===e.length?t:e))}),[m,c,x]);var _=(0,H.useCallback)((e=>{C.scaleTo((0,K.A)(y.current),e/100)}),[C]),P=(0,H.useCallback)((()=>{R(!1)}),[R]),D=(0,oe.H)({cells:m,layout:n,centered:M});return Y().createElement(Y().Fragment,null,Y().createElement("svg",{width:"100%",height:"100%",ref:y,className:G()("root",{grabbing:k,pannable:d,ready:D}),tabIndex:-1},Y().createElement("defs",null,Y().createElement(Q.c,{id:W,type:"arrow",strokeColor:"gray"})),Y().createElement("g",{transform:"translate(".concat(A.x," ").concat(A.y,") scale(").concat(A.k,")")},Y().createElement("g",{className:"cells",ref:w},m.map((e=>Y().createElement(X.m,{key:"".concat(e.type,":").concat((0,ie.WW)(e)?"".concat(e.source,"~").concat(e.target):e.id),layout:void 0,cell:e,cells:m,defaultNodeBricks:r,defaultEdgeLines:l,transform:A,markerEnd:W,active:(0,V.c)(T,e),readOnly:!0,unrelatedCells:j,onSwitchActiveTarget:p,onCellContextMenu:b,onNodeBrickResize:S,onCellMouseEnter:c&&(0,ie.N)(e)?O:void 0,onCellMouseLeave:c&&(0,ie.N)(e)?L:void 0})))))),Y().createElement(re.Y,{shadowRoot:t,scale:A.k,scaleRange:E,onZoomChange:_,onReCenter:P}))}j=Ue,({e:[s,i,r,l,o,c,u,h,d,f,g,p,b,m,v,y,w,k,A,C,E,M,R,T,z,N,W,S,x,B,O,L],c:[pe,n]}=function(e,t,a,n,s,i){var r,l,o,c,u,h,d,f=Symbol.metadata||Symbol.for("Symbol.metadata"),g=Object.defineProperty,p=Object.create,b=[p(null),p(null)],m=t.length;function v(t,a,n){return function(s,i){a&&(i=s,s=e);for(var r=0;r<t.length;r++)i=t[r].apply(s,n?[i]:[]);return n?i:s}}function y(e,t,a,n){if("function"!=typeof e&&(n||void 0!==e))throw new TypeError(t+" must "+(a||"be")+" a function"+(n?"":" or undefined"));return e}function w(e,t,a,n,s,i,o,c,u,h,d){function f(e){if(!d(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),m=t[3],w=!o,k=1===s,A=3===s,C=4===s,E=2===s;function M(t,a,n){return function(s,i){return a&&(i=s,s=e),n&&n(s),R[t].call(s,i)}}if(!w){var R={},T=[],z=A?"get":C||k?"set":"value";if(u?(h||k?R={get:(0,D.A)((function(){return m(this)}),n,"get"),set:function(e){t[4](this,e)}}:R[z]=m,h||(0,D.A)(R[z],n,E?"":z)):h||(R=Object.getOwnPropertyDescriptor(e,n)),!h&&!u){if((l=b[+c][n])&&7!=(l^s))throw new Error("Decorating two elements with the same name ("+R[z].name+") is not supported yet");b[+c][n]=s<3?1:s}}for(var N=e,W=p.length-1;W>=0;W-=a?2:1){var S=p[W],x=a?p[W-1]:void 0,B={},O={kind:["field","accessor","method","getter","setter","class"][s],name:n,metadata:r,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),i.push(t)}.bind(null,B)};if(w)l=S.call(x,N,O),B.v=1,y(l,"class decorators","return")&&(N=l);else if(O.static=c,O.private=u,l=O.access={has:u?d.bind():function(e){return n in e}},C||(l.get=u?E?function(e){return f(e),R.value}:M("get",0,f):function(e){return e[n]}),E||A||(l.set=u?M("set",0,f):function(e,t){e[n]=t}),N=S.call(x,k?{get:R.get,set:R.set}:R[z],O),B.v=1,k){if("object"==typeof N&&N)(l=y(N.get,"accessor.get"))&&(R.get=l),(l=y(N.set,"accessor.set"))&&(R.set=l),(l=y(N.init,"accessor.init"))&&T.unshift(l);else if(void 0!==N)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(N,(h?"field":"method")+" decorators","return")&&(h?T.unshift(N):R[z]=N)}return s<2&&o.push(v(T,c,1),v(i,c,0)),h||w||(u?k?o.splice(-1,0,M("get",c),M("set",c)):o.push(E?R[z]:y.call.bind(R[z])):g(e,n,R)),N}function k(e){return g(e,f,{configurable:!0,enumerable:!0,value:r})}return void 0!==i&&(r=i[f]),r=p(null==r?null:r),u=[],h=function(e){e&&u.push(v(e))},(d=function(t,n){for(var i=0;i<a.length;i++){var r=a[i],l=r[1],h=7&l;if((8&l)==t&&!h==n){var d=r[2],f=!!r[3],g=16&l;w(t?e:e.prototype,r,g,f?"#"+d:(0,P.A)(d),h,h<2?[]:t?c=c||[]:o=o||[],u,!!t,f,n,t&&f?function(t){return(0,I.A)(t)===e}:s)}}})(8,0),d(0,0),d(8,1),d(0,1),h(o),h(c),l=u,m||k(e),{e:l,get c(){var a=[];return m&&[k(e=w(e,[t],0,e.name,5,a)),v(a,1)]}}}(j,[be("eo-display-canvas",{styleTexts:[ce.A,ue.A]})],[[me({attribute:!1}),1,"cells"],[me({type:String}),1,"layout"],[me({attribute:!1}),1,"layoutOptions"],[me({attribute:!1}),1,"defaultNodeSize"],[me({attribute:!1}),1,"defaultNodeBricks"],[me({attribute:!1}),1,"defaultEdgeLines"],[me({attribute:!1}),1,"activeTarget"],[me({type:Boolean}),1,"fadeUnrelatedCells"],[me({type:Boolean}),1,"zoomable"],[me({type:Boolean}),1,"scrollable"],[me({type:Boolean}),1,"pannable"],[me({attribute:!1}),1,"scaleRange"],[ve({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>fe(Se,e),(e,t)=>de(Se,e,t)],[ve({type:"cell.contextmenu"}),1,"cellContextMenu",e=>fe(Le,e),(e,t)=>de(Le,e,t)]],0,(e=>je.has((0,I.A)(e))),F.ReactNextElement)),n()}}]);
|
|
2
|
-
//# sourceMappingURL=eo-display-canvas.577f0b51.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/eo-display-canvas.577f0b51.js","mappings":"wyBAyCA,IAA8DA,IAAxD,cAAEC,GAAa,SAAEC,GAAQ,MAAEC,KAAUC,EAAAA,EAAAA,oBAAmBC,GAAA,IAAAC,QAAAC,GAAA,IAAAD,QAAAE,GAAA,IAAAF,QAAAG,GAAA,IAAAH,QAAAI,GAAA,IAAAJ,QAAAK,GAAA,IAAAL,QAAAM,GAAA,IAAAN,QAAAO,GAAA,IAAAP,QAAAQ,GAAA,IAAAR,QAAAS,GAAA,IAAAT,QAAAU,GAAA,IAAAV,QAAAW,GAAA,IAAAX,QAAAY,GAAA,IAAAZ,QAAAa,GAAA,IAAAC,QAAAC,GAAA,IAAAf,QAAAgB,GAAA,IAAAhB,QAAAiB,GAAA,IAAAjB,QAAAkB,GAAA,IAAAlB,QAqB9D,MAAAmB,WAG8BC,EAAAA,iBAAiDC,WAAAA,GAAA,SAAAC,YAAAC,EAAAA,EAAAA,GAAA,KAAAV,KAC7EW,EAAAA,EAAAA,GAAA,KAAAzB,GAAA0B,EAAA,QAAAD,EAAAA,EAAAA,GAAA,KAAAvB,IAAAyB,EAAA,MAAAC,EAAA,SAAAH,EAAAA,EAAAA,GAAA,KAAAtB,IAAA0B,EAAA,MAAAC,EAAA,SAAAL,EAAAA,EAAAA,GAAA,KAAArB,IAAA2B,EAAA,MAAAC,EAAA,KAasC,CAACC,GAAAA,GAAmBA,GAAAA,QAAkBR,EAAAA,EAA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AEqH,KAAM8D,UAAU,yBAG3BnL,GAAS,CAAEqH,KAAM8D,UAAU,eAG3BnL,GAAS,CAAEqH,KAAM8D,UAAU,iBAG3BnL,GAAS,CAAEqH,KAAM8D,UAAU,eAG3BnL,GAAS,CAAEiL,WAAW,IAAQ,iBAG9BhL,GAAM,CAAEoH,KAAM,wBAAwB,4BAAA+D,GAAAhH,GAAApD,GAAAoK,GAAA,CAAAA,EAAA/G,IAAAC,GAAAtD,GAAAoK,EAAA/G,IAAA,CAatCpE,GAAM,CAAEoH,KAAM,qBAAqB,oBAAA+D,GAAAhH,GAAA/C,GAAA+J,GAAA,CAAAA,EAAA/G,IAAAC,GAAAjD,GAAA+J,EAAA/G,KAAA,GAAAgH,GAAA/J,GAAAgK,KAAAC,EAAAA,EAAAA,GAAAF,KAjER7J,EAAAA,mBAAgBoJ,G","sources":["webpack:///./src/display-canvas/index.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from \"react\";\nimport { createDecorators, type EventEmitter } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport \"@next-core/theme\";\nimport { uniqueId } from \"lodash\";\nimport classNames from \"classnames\";\nimport { select } from \"d3-selection\";\nimport type { RangeTuple, SizeTuple } from \"../diagram/interfaces\";\nimport type {\n ActiveTarget,\n InitialCell,\n NodeBrickConf,\n CellContextMenuDetail,\n EdgeLineConf,\n Cell,\n LayoutType,\n LayoutOptions,\n} from \"../draw-canvas/interfaces\";\nimport { MarkerComponent } from \"../diagram/MarkerComponent\";\nimport { sameTarget } from \"../draw-canvas/processors/sameTarget\";\nimport { CellComponent } from \"../draw-canvas/CellComponent\";\nimport { initializeCells } from \"../draw-canvas/processors/initializeCells\";\nimport { DEFAULT_NODE_SIZE } from \"../draw-canvas/constants\";\nimport { useZoom } from \"../shared/canvas/useZoom\";\nimport { useActiveTarget } from \"../shared/canvas/useActiveTarget\";\nimport { rootReducer } from \"../draw-canvas/reducers\";\nimport { getUnrelatedCells } from \"../draw-canvas/processors/getUnrelatedCells\";\nimport { isEdgeCell, isNodeCell } from \"../draw-canvas/processors/asserts\";\nimport { ZoomBarComponent } from \"../shared/canvas/ZoomBarComponent\";\nimport { useLayout } from \"../shared/canvas/useLayout\";\nimport { useReady } from \"../shared/canvas/useReady\";\nimport styleText from \"../shared/canvas/styles.shadow.css\";\nimport zoomBarStyleText from \"../shared/canvas/ZoomBarComponent.shadow.css\";\n\nconst { defineElement, property, event } = createDecorators();\n\nexport interface EoDisplayCanvasProps {\n cells: InitialCell[] | undefined;\n layout: LayoutType;\n layoutOptions?: LayoutOptions;\n defaultNodeSize: SizeTuple;\n defaultNodeBricks?: NodeBrickConf[];\n defaultEdgeLines?: EdgeLineConf[];\n activeTarget?: ActiveTarget | null;\n fadeUnrelatedCells?: boolean;\n zoomable?: boolean;\n scrollable?: boolean;\n pannable?: boolean;\n scaleRange?: RangeTuple;\n}\n\n/**\n * 用于展示查看的画布。\n */\nexport\n@defineElement(\"eo-display-canvas\", {\n styleTexts: [styleText, zoomBarStyleText],\n})\nclass EoDisplayCanvas extends ReactNextElement implements EoDisplayCanvasProps {\n /**\n * 仅当初始化时使用,渲染后重新设置 `cells` 将无效。\n */\n @property({ attribute: false })\n accessor cells: InitialCell[] | undefined;\n\n @property({ type: String })\n accessor layout: LayoutType;\n\n @property({ attribute: false })\n accessor layoutOptions: LayoutOptions | undefined;\n\n @property({ attribute: false })\n accessor defaultNodeSize: SizeTuple = [DEFAULT_NODE_SIZE, DEFAULT_NODE_SIZE];\n\n @property({ attribute: false })\n accessor defaultNodeBricks: NodeBrickConf[] | undefined;\n\n /**\n * 使用条件判断设置默认的边对应的连线。在 `if` 表达式中 `DATA` 为 `{ edge }`,例如:\n *\n * ```yaml\n * defaultEdgeLines:\n * - if: <% DATA.edge.data?.virtual %>\n * dashed: true\n * ```\n */\n @property({ attribute: false })\n accessor defaultEdgeLines: EdgeLineConf[] | undefined;\n\n @property({ attribute: false })\n accessor activeTarget: ActiveTarget | null | undefined;\n\n /**\n * 当鼠标悬浮到某节点上时,隐藏其他跟该节点无关的元素。\n */\n @property({ type: Boolean })\n accessor fadeUnrelatedCells: boolean | undefined;\n\n @property({ type: Boolean })\n accessor zoomable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor scrollable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor pannable: boolean | undefined = true;\n\n @property({ attribute: false })\n accessor scaleRange: RangeTuple | undefined;\n\n @event({ type: \"activeTarget.change\" })\n accessor #activeTargetChangeEvent!: EventEmitter<ActiveTarget | null>;\n\n #handleActiveTargetChange = (target: ActiveTarget | null) => {\n this.#activeTargetChangeEvent.emit(target);\n };\n\n #handleSwitchActiveTarget = (target: ActiveTarget | null) => {\n if (!sameTarget(target, this.activeTarget)) {\n this.activeTarget = target;\n }\n };\n\n @event({ type: \"cell.contextmenu\" })\n accessor #cellContextMenu!: EventEmitter<CellContextMenuDetail>;\n\n #handleCellContextMenu = (detail: CellContextMenuDetail) => {\n this.#cellContextMenu.emit(detail);\n };\n\n render() {\n return (\n <EoDisplayCanvasComponent\n shadowRoot={this.shadowRoot!}\n cells={this.cells}\n layout={this.layout}\n layoutOptions={this.layoutOptions}\n defaultNodeSize={this.defaultNodeSize}\n defaultNodeBricks={this.defaultNodeBricks}\n defaultEdgeLines={this.defaultEdgeLines}\n activeTarget={this.activeTarget}\n fadeUnrelatedCells={this.fadeUnrelatedCells}\n zoomable={this.zoomable}\n scrollable={this.scrollable}\n pannable={this.pannable}\n scaleRange={this.scaleRange}\n onActiveTargetChange={this.#handleActiveTargetChange}\n onSwitchActiveTarget={this.#handleSwitchActiveTarget}\n onCellContextMenu={this.#handleCellContextMenu}\n />\n );\n }\n}\n\nexport interface EoDisplayCanvasComponentProps extends EoDisplayCanvasProps {\n shadowRoot: ShadowRoot;\n onActiveTargetChange(target: ActiveTarget | null): void;\n onSwitchActiveTarget(target: ActiveTarget | null): void;\n onCellContextMenu(detail: CellContextMenuDetail): void;\n}\n\nfunction EoDisplayCanvasComponent({\n shadowRoot,\n cells: initialCells,\n layout,\n layoutOptions,\n defaultNodeSize,\n defaultNodeBricks,\n defaultEdgeLines,\n activeTarget: _activeTarget,\n fadeUnrelatedCells,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onActiveTargetChange,\n onSwitchActiveTarget,\n onCellContextMenu,\n}: EoDisplayCanvasComponentProps) {\n const [{ cells }, dispatch] = useReducer(\n rootReducer,\n initialCells,\n (initialCells) => ({\n cells: initializeCells(initialCells, { defaultNodeSize }),\n })\n );\n\n const rootRef = useRef<SVGSVGElement>(null);\n const cellsRef = useRef<SVGGElement>(null);\n\n const { grabbing, transform, zoomer, scaleRange } = useZoom({\n rootRef,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onSwitchActiveTarget,\n });\n\n const { centered, setCentered } = useLayout({\n layout,\n layoutOptions,\n rootRef,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n dispatch,\n });\n\n const activeTarget = useActiveTarget({\n cellsRef,\n activeTarget: _activeTarget,\n onActiveTargetChange,\n });\n\n const defPrefix = useMemo(() => `${uniqueId(\"diagram-\")}-`, []);\n const markerPrefix = `${defPrefix}line-arrow-`;\n const markerEnd = `${markerPrefix}1`;\n\n const handleNodeBrickResize = useCallback(\n (id: string, size: SizeTuple | null) => {\n dispatch({ type: \"update-node-size\", payload: { id, size } });\n },\n []\n );\n\n const [hoverCell, setHoverCell] = useState<Cell | null>(null);\n const handleCellMouseEnter = useCallback((cell: Cell) => {\n setHoverCell(cell);\n }, []);\n const handleCellMouseLeave = useCallback((cell: Cell) => {\n setHoverCell((prev) => (prev === cell ? null : prev));\n }, []);\n\n const [unrelatedCells, setUnrelatedCells] = useState<Cell[]>([]);\n useEffect(() => {\n const nextUnrelated = fadeUnrelatedCells\n ? getUnrelatedCells(cells, null, hoverCell)\n : [];\n // Do not update the state when prev and next are both empty.\n setUnrelatedCells((prev) =>\n prev.length === 0 && nextUnrelated.length === 0 ? prev : nextUnrelated\n );\n }, [cells, fadeUnrelatedCells, hoverCell]);\n\n const handleZoomSlide = useCallback(\n (value: number) => {\n // istanbul ignore next\n if (process.env.NODE_ENV !== \"test\") {\n zoomer.scaleTo(select(rootRef.current!), value / 100);\n }\n },\n [zoomer]\n );\n\n const reCenter = useCallback(() => {\n setCentered(false);\n }, [setCentered]);\n\n const ready = useReady({ cells, layout, centered });\n\n return (\n <>\n <svg\n width=\"100%\"\n height=\"100%\"\n ref={rootRef}\n className={classNames(\"root\", { grabbing, pannable, ready })}\n tabIndex={-1}\n >\n <defs>\n <MarkerComponent id={markerEnd} type=\"arrow\" strokeColor=\"gray\" />\n </defs>\n <g\n transform={`translate(${transform.x} ${transform.y}) scale(${transform.k})`}\n >\n <g className=\"cells\" ref={cellsRef}>\n {cells.map((cell) => (\n <CellComponent\n key={`${cell.type}:${isEdgeCell(cell) ? `${cell.source}~${cell.target}` : cell.id}`}\n layout={undefined}\n cell={cell}\n cells={cells}\n defaultNodeBricks={defaultNodeBricks}\n defaultEdgeLines={defaultEdgeLines}\n transform={transform}\n markerEnd={markerEnd}\n active={sameTarget(activeTarget, cell)}\n readOnly\n unrelatedCells={unrelatedCells}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onCellContextMenu={onCellContextMenu}\n onNodeBrickResize={handleNodeBrickResize}\n onCellMouseEnter={\n fadeUnrelatedCells && isNodeCell(cell)\n ? handleCellMouseEnter\n : undefined\n }\n onCellMouseLeave={\n fadeUnrelatedCells && isNodeCell(cell)\n ? handleCellMouseLeave\n : undefined\n }\n />\n ))}\n </g>\n </g>\n </svg>\n <ZoomBarComponent\n shadowRoot={shadowRoot}\n scale={transform.k}\n scaleRange={scaleRange}\n onZoomChange={handleZoomSlide}\n onReCenter={reCenter}\n />\n </>\n );\n}\n"],"names":["_EoDisplayCanvas","defineElement","property","event","createDecorators","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_EoDisplayCanvas_brand","WeakSet","_handleActiveTargetChange","_handleSwitchActiveTarget","_N","_handleCellContextMenu","EoDisplayCanvas","ReactNextElement","constructor","arguments","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","_init_cells","_init_extra_cells","_init_layout","_init_extra_layout","_init_layoutOptions","_init_extra_layoutOptions","_init_defaultNodeSize","DEFAULT_NODE_SIZE","_init_extra_defaultNodeSize","_init_defaultNodeBricks","_init_extra_defaultNodeBricks","_init_defaultEdgeLines","_init_extra_defaultEdgeLines","_init_activeTarget","_init_extra_activeTarget","_init_fadeUnrelatedCells","_init_extra_fadeUnrelatedCells","_init_zoomable","_init_extra_zoomable","_init_scrollable","_init_extra_scrollable","_init_pannable","_init_extra_pannable","_init_scaleRange","_init_extra_scaleRange","_init_activeTargetChangeEvent","_init_extra_activeTargetChangeEvent","target","_classPrivateGetter","this","_get_activeTargetChangeEvent","emit","sameTarget","activeTarget","_init_cellContextMenu","_init_extra_cellContextMenu","detail","_get_cellContextMenu","cells","_classPrivateFieldGet","v","_classPrivateFieldSet","layout","layoutOptions","defaultNodeSize","defaultNodeBricks","defaultEdgeLines","fadeUnrelatedCells","zoomable","scrollable","pannable","scaleRange","render","React","EoDisplayCanvasComponent","shadowRoot","onActiveTargetChange","onSwitchActiveTarget","onCellContextMenu","_ref","initialCells","_activeTarget","_scaleRange","dispatch","useReducer","rootReducer","initializeCells","rootRef","useRef","cellsRef","grabbing","transform","zoomer","useZoom","centered","setCentered","useLayout","useActiveTarget","defPrefix","useMemo","concat","uniqueId","markerPrefix","markerEnd","handleNodeBrickResize","useCallback","id","size","type","payload","hoverCell","setHoverCell","useState","handleCellMouseEnter","cell","handleCellMouseLeave","prev","unrelatedCells","setUnrelatedCells","useEffect","nextUnrelated","getUnrelatedCells","length","handleZoomSlide","value","scaleTo","select","current","reCenter","ready","useReady","width","height","ref","className","classNames","tabIndex","MarkerComponent","strokeColor","x","y","k","map","CellComponent","key","isEdgeCell","source","undefined","active","readOnly","onNodeBrickResize","onCellMouseEnter","isNodeCell","onCellMouseLeave","ZoomBarComponent","scale","onZoomChange","onReCenter","_EoDisplayCanvas2","e","_set_activeTargetChangeEvent","_set_cellContextMenu","c","_initClass","_applyDecs","styleTexts","styleText","zoomBarStyleText","attribute","String","Boolean","o","_","has","_checkInRHS"],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[8939],{3639:(e,t,a)=>{a.d(t,{w:()=>l});var n=a(8769),i=a.n(n),r=a(3373),o=a.n(r);function l(e){var{connectLineState:t,transform:a,markerEnd:r,onConnect:l}=e,[s,c]=(0,n.useState)(null);return(0,n.useEffect)((()=>{t&&c(t.from)}),[t]),(0,n.useEffect)((()=>{if(t){var e=e=>{c([(e.clientX-a.x-t.offset[0])/a.k,(e.clientY-a.y-t.offset[1])/a.k])},n=e=>{e.stopPropagation()},i=e=>{e.stopPropagation(),r(),l(t,[(e.clientX-a.x-t.offset[0])/a.k,(e.clientY-a.y-t.offset[1])/a.k])},r=()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mousedown",n,{capture:!0}),document.removeEventListener("click",i,{capture:!0}),c(null)};return document.addEventListener("mousemove",e),document.addEventListener("mousedown",n,{capture:!0}),document.addEventListener("click",i,{capture:!0}),r}}),[t,l,a]),i().createElement("path",{className:o()("connect-line",{connecting:!!t&&s&&(s[0]-t.from[0])**2+(s[1]-t.from[1])**2>25}),d:t&&s?"M".concat(t.from.join(" "),"L").concat(s.join(" ")):"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:"url(#".concat(r,")")})}},9068:(e,t,a)=>{a.r(t),a.d(t,{EoDrawCanvas:()=>Ge,EoDrawCanvasComponent:()=>at});var n,i,r,o,l,s,c,d,u,h,v,f,p,g,w,m,y,k,x,C,b,A,E,z,M,N,W,S,R,T,L,B,D,P,H,j,O,I,U,_,Y,F,V,X,q,J,Z,G,K,Q,$,ee,te,ae,ne,ie,re,oe,le,se,ce,de,ue,he=a(9740),ve=a(6330),fe=a(4635),pe=a(918),ge=a(1369),we=a(8449),me=a(6902),ye=a(8769),ke=a.n(ye),xe=a(9929),Ce=a(9938),be=a(8438),Ae=(a(330),a(1030)),Ee=a(3373),ze=a.n(Ee),Me=a(7566),Ne=a(1083),We=a(3739),Se=a(531),Re=a(8185),Te=a(5114),Le=a(2830),Be=a(3639),De=a(3783),Pe=a(2098),He=a(227),je=a(3033),Oe=a(8091),Ie=a(1819),Ue=a(7099),_e=a(2361),Ye=a(8197),Fe=a(3012),Ve=a(8618);function Xe(e,t,a){return a(Ze(e,t))}function qe(e,t,a){return e.set(Ze(e,t),a),a}function Je(e,t){return e.get(Ze(e,t))}function Ze(e,t,a){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:a;throw new TypeError("Private element is not present on this object")}var Ge,Ke=(0,be.unwrapProvider)("basic.lock-body-scroll"),{defineElement:Qe,property:$e,method:et,event:tt}=(0,xe.createDecorators)(),at=ke().forwardRef(Dt),nt=new WeakMap,it=new WeakMap,rt=new WeakMap,ot=new WeakMap,lt=new WeakMap,st=new WeakMap,ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,ht=new WeakMap,vt=new WeakMap,ft=new WeakMap,pt=new WeakMap,gt=new WeakSet,wt=new WeakMap,mt=new WeakMap,yt=new WeakMap,kt=new WeakMap,xt=new WeakMap,Ct=new WeakMap,bt=new WeakMap,At=new WeakMap,Et=new WeakMap,zt=new WeakMap,Mt=new WeakMap,Nt=new WeakMap,Wt=new WeakMap,St=new WeakMap,Rt=new WeakMap,Tt=new WeakMap,Lt=new WeakMap;class Bt extends Ce.ReactNextElement{constructor(){super(...arguments),(0,fe.A)(this,gt),(0,pe.A)(this,nt,(n(this),r(this))),(0,pe.A)(this,it,(o(this),l(this))),(0,pe.A)(this,rt,(s(this),c(this))),(0,pe.A)(this,ot,(d(this),u(this,[je.HP,je.HP]))),(0,pe.A)(this,lt,(h(this),v(this))),(0,pe.A)(this,st,(f(this),p(this))),(0,pe.A)(this,ct,(g(this),w(this))),(0,pe.A)(this,dt,(m(this),y(this))),(0,pe.A)(this,ut,(k(this),x(this,!0))),(0,pe.A)(this,ht,(C(this),b(this,!0))),(0,pe.A)(this,vt,(A(this),E(this,!0))),(0,pe.A)(this,ft,(z(this),M(this))),(0,pe.A)(this,pt,(N(this),W(this))),(0,pe.A)(this,wt,(T(this),e=>{Xe(gt,this,S).emit(e)})),(0,pe.A)(this,mt,(e=>{(0,Re.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,pe.A)(this,yt,L(this)),(0,pe.A)(this,kt,(P(this),H(this))),(0,pe.A)(this,xt,(I(this),e=>{Xe(gt,this,j).emit(e),"node"===e.type&&Xe(gt,this,B).emit(e)})),(0,pe.A)(this,Ct,U(this)),(0,pe.A)(this,bt,(F(this),e=>{Xe(gt,this,_).emit(e)})),(0,pe.A)(this,At,V(this)),(0,pe.A)(this,Et,(J(this),Z(this))),(0,pe.A)(this,zt,(Q(this),e=>{Xe(gt,this,G).emit(e),"node"===e.type&&Xe(gt,this,X).emit(e)})),(0,pe.A)(this,Mt,$(this)),(0,pe.A)(this,Nt,(ae(this),e=>{Xe(gt,this,ee).emit(e)})),(0,pe.A)(this,Wt,ne(this)),(0,pe.A)(this,St,(oe(this),e=>{Xe(gt,this,ie).emit(e)})),(0,pe.A)(this,Rt,le(this)),(0,pe.A)(this,Tt,(de(this),e=>{Xe(gt,this,se).emit(e)})),(0,pe.A)(this,Lt,(0,ye.createRef)())}get cells(){return Je(nt,this)}set cells(e){qe(nt,this,e)}get layout(){return Je(it,this)}set layout(e){qe(it,this,e)}get layoutOptions(){return Je(rt,this)}set layoutOptions(e){qe(rt,this,e)}get defaultNodeSize(){return Je(ot,this)}set defaultNodeSize(e){qe(ot,this,e)}get defaultNodeBricks(){return Je(lt,this)}set defaultNodeBricks(e){qe(lt,this,e)}get defaultEdgeLines(){return Je(st,this)}set defaultEdgeLines(e){qe(st,this,e)}get activeTarget(){return Je(ct,this)}set activeTarget(e){qe(ct,this,e)}get fadeUnrelatedCells(){return Je(dt,this)}set fadeUnrelatedCells(e){qe(dt,this,e)}get zoomable(){return Je(ut,this)}set zoomable(e){qe(ut,this,e)}get scrollable(){return Je(ht,this)}set scrollable(e){qe(ht,this,e)}get pannable(){return Je(vt,this)}set pannable(e){qe(vt,this,e)}get scaleRange(){return Je(ft,this)}set scaleRange(e){qe(ft,this,e)}dropNode(e){var t=this;return(0,ve.A)((function*(){var a,n,{id:i,position:r,size:o,data:l,useBrick:s}=e;if(null===(a=(n=document).elementsFromPoint)||void 0===a||null===(a=a.call(n,r[0],r[1]))||void 0===a?void 0:a.includes(t)){var c,d,u,h=t.getBoundingClientRect(),v=Je(Lt,t).current.getTransform(),f={type:"node",id:i,view:(0,he.A)((0,he.A)({},"force"===t.layout||"dagre"===t.layout?null:{x:(r[0]-h.left-v.x)/v.k,y:(r[1]-h.top-v.y)/v.k}),{},{width:null!==(c=null==o?void 0:o[0])&&void 0!==c?c:t.defaultNodeSize[0],height:null!==(d=null==o?void 0:o[1])&&void 0!==d?d:t.defaultNodeSize[0]}),data:l,useBrick:s};return null===(u=Je(Lt,t).current)||void 0===u||u.dropNode(f),f}return null}))()}dropDecorator(e){var t=this;return(0,ve.A)((function*(){var a,n,{position:i,decorator:r,text:o}=e;if(null===(a=(n=document).elementsFromPoint)||void 0===a||null===(a=a.call(n,i[0],i[1]))||void 0===a?void 0:a.includes(t)){var l,s=t.getBoundingClientRect(),c=Je(Lt,t).current.getTransform(),d={type:"decorator",decorator:r,id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),view:{x:(i[0]-s.left-c.x)/c.k,y:(i[1]-s.top-c.y)/c.k,width:je.N8,height:je.w1,text:o}};return null===(l=Je(Lt,t).current)||void 0===l||l.dropDecorator(d),d}return null}))()}addNodes(e){var t=this;return(0,ve.A)((function*(){if(0===e.length)return[];var a=e.map((e=>{var a,n,{size:i,useBrick:r,id:o,data:l}=e;return{type:"node",id:o,data:l,view:{width:null!==(a=null==i?void 0:i[0])&&void 0!==a?a:t.defaultNodeSize[0],height:null!==(n=null==i?void 0:i[1])&&void 0!==n?n:t.defaultNodeSize[0]},useBrick:r}}));return Je(Lt,t).current.addNodes(a,{defaultNodeSize:t.defaultNodeSize,canvasWidth:t.clientWidth,canvasHeight:t.clientHeight})}))()}addEdge(e){var t=this;return(0,ve.A)((function*(){var a,{source:n,target:i,data:r}=e,o={type:"edge",source:n,target:i,data:r};return null===(a=Je(Lt,t).current)||void 0===a||a.addEdge(o),o}))()}manuallyConnectNodes(e){return Je(Lt,this).current.manuallyConnectNodes(e)}updateCells(e,t){var a=this;return(0,ve.A)((function*(){var{updated:n}=Je(Lt,a).current.updateCells(e,(0,he.A)((0,he.A)({},t),{},{defaultNodeSize:a.defaultNodeSize,canvasWidth:a.clientWidth,canvasHeight:a.clientHeight}));return{updated:n}}))()}disconnectedCallback(){super.disconnectedCallback(),Ke(this,!1)}render(){return ke().createElement(at,{host:this,ref:Je(Lt,this),layout:this.layout,layoutOptions:this.layoutOptions,cells:this.cells,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:Je(wt,this),onSwitchActiveTarget:Je(mt,this),onCellMove:Je(xt,this),onCellResize:Je(bt,this),onCellDelete:Je(zt,this),onCellContextMenu:Je(Nt,this),onDecoratorTextChange:Je(St,this),onScaleChange:Je(Tt,this)})}}function Dt(e,t){var{host:a,layout:n,layoutOptions:i,cells:r,defaultNodeSize:o,defaultNodeBricks:l,defaultEdgeLines:s,activeTarget:c,fadeUnrelatedCells:d,zoomable:u,scrollable:h,pannable:v,scaleRange:f,onActiveTargetChange:p,onSwitchActiveTarget:g,onCellMove:w,onCellResize:m,onCellDelete:y,onCellContextMenu:k,onDecoratorTextChange:x,onScaleChange:C}=e,[{cells:b},A]=(0,ye.useReducer)(Ne.d,r,(e=>({cells:(0,De.C)(e,{defaultNodeSize:o})}))),E=(0,ye.useRef)(null),z=(0,ye.useRef)(null),M=(0,ye.useRef)(null),[N,W]=(0,ye.useState)([]),{grabbing:S,transform:R,zoomer:T,scaleRange:L}=(0,Oe.f)({rootRef:E,zoomable:u,scrollable:h,pannable:v,scaleRange:f,onSwitchActiveTarget:g});(0,ye.useEffect)((()=>{C(R.k)}),[C,R.k]);var[B,D]=(0,ye.useState)(null),{centered:P,setCentered:H}=(0,_e.g)({layout:n,layoutOptions:i,rootRef:E,cells:b,zoomable:u,zoomer:T,scaleRange:L,dispatch:A});(0,ye.useImperativeHandle)(t,(()=>({dropNode(e){H(!0),A({type:"drop-node",payload:e})},dropDecorator(e){H(!0),A({type:"drop-decorator",payload:e})},addNodes(e,t){var{defaultNodeSize:a,canvasWidth:i,canvasHeight:r}=t,o=b.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1,l=[...b.slice(0,o),...e,...b.slice(o)],{cells:s,updated:c}=(0,Pe.L)({cells:l,layout:n,previousCells:b,defaultNodeSize:a,canvasWidth:i,canvasHeight:r,scaleRange:L,transform:R});return A({type:"update-cells",payload:s}),c.filter((t=>e.includes(t)))},addEdge(e){A({type:"add-edge",payload:e})},updateCells(e,t){var a=(0,Pe.L)((0,he.A)((0,he.A)({},t),{},{layout:n,previousCells:b,cells:e,scaleRange:L,transform:R}));return A({type:"update-cells",payload:a.cells}),a},getTransform:()=>R,manuallyConnectNodes(e){var t=b.find((t=>(0,Se.N)(t)&&t.id===e));if(t){var a=E.current.getBoundingClientRect();return D({source:t,from:[t.view.x+t.view.width/2,t.view.y+t.view.height/2],offset:[a.left,a.top]}),new Promise(((e,t)=>{M.current={resolve:e,reject:t}}))}return Promise.reject(null)}})),[b,n,L,H,R]);var j=(0,ye.useCallback)(((e,t)=>{for(var a,n=0;n<b.length;n++){var i=b[n];if((0,Se.N)(i)&&i.id!==e.source.id&&i.view.x<t[0]&&i.view.x+i.view.width>t[0]&&i.view.y<t[1]&&i.view.y+i.view.height>t[1]){var r;null===(r=M.current)||void 0===r||r.resolve({source:e.source,target:i});break}}null===(a=M.current)||void 0===a||a.reject(null),D(null)}),[b]);(0,ye.useEffect)((()=>{Ke(a,!!B)}),[B,a]);var O=(0,Ie.J)({cellsRef:z,activeTarget:c,onActiveTargetChange:p}),[I,U]=(0,ye.useState)([]);(0,ye.useEffect)((()=>{var e=d?(0,He.Y)(b,B,O):[];U((t=>0===t.length&&0===e.length?t:e))}),[O,b,B,d]),(0,ye.useEffect)((()=>{var e=E.current;if(e&&!(N.length>0)){var t=e=>{var t=(0,Te.a)(e,{cells:b,activeTarget:O});"delete-cell"===(null==t?void 0:t.action)&&y(t.cell)};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}}),[O,b,N.length,y]);var _=(0,ye.useMemo)((()=>"".concat((0,Ae.uniqueId)("diagram-"),"-")),[]),Y="".concat(_,"line-arrow-"),F="".concat(Y,"1"),V=(0,ye.useCallback)((e=>{A({type:"move-cell",payload:e})}),[]),X=(0,ye.useCallback)((e=>{A({type:"move-cell",payload:e}),w(e)}),[w]),q=(0,ye.useCallback)((e=>{A({type:"resize-cell",payload:e})}),[]),J=(0,ye.useCallback)((e=>{A({type:"resize-cell",payload:e}),m(e)}),[m]),Z=(0,ye.useCallback)((e=>{var{id:t,editing:a}=e;W(a?e=>e.includes(t)?e:[...e,t]:e=>e.filter((e=>e!==t)))}),[]),G=(0,ye.useCallback)(((e,t)=>{A({type:"update-node-size",payload:{id:e,size:t}})}),[]),K=(0,ye.useCallback)((e=>{T.scaleTo((0,Me.A)(E.current),e/100)}),[T]),Q=(0,ye.useCallback)((()=>{H(!1)}),[H]),$=(0,Ye.H)({cells:b,layout:n,centered:P});return ke().createElement(ke().Fragment,null,ke().createElement("svg",{width:"100%",height:"100%",ref:E,className:ze()("root",{grabbing:S,pannable:v,ready:$}),tabIndex:-1},ke().createElement("defs",null,ke().createElement(We.c,{id:F,type:"arrow",strokeColor:"gray"})),ke().createElement("g",{transform:"translate(".concat(R.x," ").concat(R.y,") scale(").concat(R.k,")")},ke().createElement("g",{className:"cells",ref:z},b.map((e=>ke().createElement(Le.m,{key:"".concat(e.type,":").concat("edge"===e.type?"".concat(e.source,"~").concat(e.target):e.id),layout:n,cell:e,cells:b,defaultNodeBricks:l,defaultEdgeLines:s,transform:R,markerEnd:F,active:(0,Re.c)(O,e),unrelatedCells:I,onCellMoving:V,onCellMoved:X,onCellResizing:q,onCellResized:J,onSwitchActiveTarget:g,onCellContextMenu:k,onDecoratorTextChange:x,onDecoratorTextEditing:Z,onNodeBrickResize:G})))),ke().createElement(Be.w,{connectLineState:B,transform:R,markerEnd:F,onConnect:j}))),ke().createElement(Ue.Y,{shadowRoot:a.shadowRoot,scale:R.k,scaleRange:L,onZoomChange:K,onReCenter:Q}))}ue=Bt,({e:[r,o,l,s,c,d,u,h,v,f,p,g,w,m,y,k,x,C,b,A,E,z,M,N,W,S,R,T,L,B,D,P,H,j,O,I,U,_,Y,F,V,X,q,J,Z,G,K,Q,$,ee,te,ae,ne,ie,re,oe,le,se,ce,de,n],c:[Ge,i]}=function(e,t,a,n,i,r){var o,l,s,c,d,u,h,v=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,p=Object.create,g=[p(null),p(null)],w=t.length;function m(t,a,n){return function(i,r){a&&(r=i,i=e);for(var o=0;o<t.length;o++)r=t[o].apply(i,n?[r]:[]);return n?r:i}}function y(e,t,a,n){if("function"!=typeof e&&(n||void 0!==e))throw new TypeError(t+" must "+(a||"be")+" a function"+(n?"":" or undefined"));return e}function k(e,t,a,n,i,r,s,c,d,u,h){function v(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),w=t[3],k=!s,x=1===i,C=3===i,b=4===i,A=2===i;function E(t,a,n){return function(i,r){return a&&(r=i,i=e),n&&n(i),z[t].call(i,r)}}if(!k){var z={},M=[],N=C?"get":b||x?"set":"value";if(d?(u||x?z={get:(0,we.A)((function(){return w(this)}),n,"get"),set:function(e){t[4](this,e)}}:z[N]=w,u||(0,we.A)(z[N],n,A?"":N)):u||(z=Object.getOwnPropertyDescriptor(e,n)),!u&&!d){if((l=g[+c][n])&&7!=(l^i))throw new Error("Decorating two elements with the same name ("+z[N].name+") is not supported yet");g[+c][n]=i<3?1:i}}for(var W=e,S=p.length-1;S>=0;S-=a?2:1){var R=p[S],T=a?p[S-1]:void 0,L={},B={kind:["field","accessor","method","getter","setter","class"][i],name:n,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),r.push(t)}.bind(null,L)};if(k)l=R.call(T,W,B),L.v=1,y(l,"class decorators","return")&&(W=l);else if(B.static=c,B.private=d,l=B.access={has:d?h.bind():function(e){return n in e}},b||(l.get=d?A?function(e){return v(e),z.value}:E("get",0,v):function(e){return e[n]}),A||C||(l.set=d?E("set",0,v):function(e,t){e[n]=t}),W=R.call(T,x?{get:z.get,set:z.set}:z[N],B),L.v=1,x){if("object"==typeof W&&W)(l=y(W.get,"accessor.get"))&&(z.get=l),(l=y(W.set,"accessor.set"))&&(z.set=l),(l=y(W.init,"accessor.init"))&&M.unshift(l);else if(void 0!==W)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(W,(u?"field":"method")+" decorators","return")&&(u?M.unshift(W):z[N]=W)}return i<2&&s.push(m(M,c,1),m(r,c,0)),u||k||(d?x?s.splice(-1,0,E("get",c),E("set",c)):s.push(A?z[N]:y.call.bind(z[N])):f(e,n,z)),W}function x(e){return f(e,v,{configurable:!0,enumerable:!0,value:o})}return void 0!==r&&(o=r[v]),o=p(null==o?null:o),d=[],u=function(e){e&&d.push(m(e))},(h=function(t,n){for(var r=0;r<a.length;r++){var o=a[r],l=o[1],u=7&l;if((8&l)==t&&!u==n){var h=o[2],v=!!o[3],f=16&l;k(t?e:e.prototype,o,f,v?"#"+h:(0,ge.A)(h),u,u<2?[]:t?c=c||[]:s=s||[],d,!!t,v,n,t&&v?function(t){return(0,me.A)(t)===e}:i)}}})(8,0),h(0,0),h(8,1),h(0,1),u(s),u(c),l=d,w||x(e),{e:l,get c(){var a=[];return w&&[x(e=k(e,[t],0,e.name,5,a)),m(a,1)]}}}(ue,[Qe("eo-draw-canvas",{styleTexts:[Fe.A,Ve.A]})],[[$e({attribute:!1}),1,"cells"],[$e({type:String}),1,"layout"],[$e({attribute:!1}),1,"layoutOptions"],[$e({attribute:!1}),1,"defaultNodeSize"],[$e({attribute:!1}),1,"defaultNodeBricks"],[$e({attribute:!1}),1,"defaultEdgeLines"],[$e({attribute:!1}),1,"activeTarget"],[$e({type:Boolean}),1,"fadeUnrelatedCells"],[$e({type:Boolean}),1,"zoomable"],[$e({type:Boolean}),1,"scrollable"],[$e({type:Boolean}),1,"pannable"],[$e({attribute:!1}),1,"scaleRange"],[tt({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>Je(pt,e),(e,t)=>qe(pt,e,t)],[tt({type:"node.move"}),1,"nodeMoveEvent",e=>Je(yt,e),(e,t)=>qe(yt,e,t)],[tt({type:"cell.move"}),1,"cellMoveEvent",e=>Je(kt,e),(e,t)=>qe(kt,e,t)],[tt({type:"cell.resize"}),1,"cellResizeEvent",e=>Je(Ct,e),(e,t)=>qe(Ct,e,t)],[tt({type:"node.delete"}),1,"nodeDelete",e=>Je(At,e),(e,t)=>qe(At,e,t)],[tt({type:"cell.delete"}),1,"cellDelete",e=>Je(Et,e),(e,t)=>qe(Et,e,t)],[tt({type:"cell.contextmenu"}),1,"cellContextMenu",e=>Je(Mt,e),(e,t)=>qe(Mt,e,t)],[tt({type:"decorator.text.change"}),1,"decoratorTextChange",e=>Je(Wt,e),(e,t)=>qe(Wt,e,t)],[tt({type:"scale.change"}),1,"scaleChange",e=>Je(Rt,e),(e,t)=>qe(Rt,e,t)],[et(),2,"dropNode"],[et(),2,"dropDecorator"],[et(),2,"addNodes"],[et(),2,"addEdge"],[et(),2,"manuallyConnectNodes"],[et(),2,"updateCells"]],0,(e=>Lt.has((0,me.A)(e))),Ce.ReactNextElement)),i()},5114:(e,t,a)=>{a.d(t,{a:()=>i});var n=a(8185);function i(e,t){var{cells:a,activeTarget:i}=t,r=a.find((e=>(0,n.c)(e,i)));if(r)switch(e.key||e.keyCode||e.which){case"Backspace":case 8:case"Delete":case 46:return e.preventDefault(),e.stopPropagation(),{action:"delete-cell",cell:r}}}},2098:(e,t,a)=>{a.d(t,{L:()=>s});var n=a(1030),i=a(3033),r=a(531),o=a(3783),l=a(908);function s(e){var{cells:t,layout:a,previousCells:s,defaultNodeSize:c,canvasWidth:d,canvasHeight:u,scaleRange:h,transform:v,reason:f,parent:p}=e,g="force"!==a&&"dagre"!==a,w=(0,o.C)(t,{defaultNodeSize:c}),m=[],y=new Map,k=!1;for(var x of s)(0,r.mH)(x)?k=!0:(0,r.N)(x)&&(k=!0,x[i.CV]&&y.set(x.id,x));var C=new Map;for(var b of w)if((0,r.N)(b)){C.set(b.id,b);var A=y.get(b.id);A&&(b.view.width=A.view.width,b.view.height=A.view.height,b[i.CV]=!0)}var E=!1;if("add-related-nodes"===f&&p){var z=new Set;for(var M of w)(0,r.WW)(M)&&M.source===p&&M.target!==p&&z.add(M.target);var N=C.get(p);if(void 0!==(null==N?void 0:N.view.x)&&void 0!==N.view.y){E=!0;var W=[...z].map((e=>C.get(e))).filter(Boolean),S=void 0;for(var R of W)void 0!==R.view.x&&void 0!==R.view.y?(!S||R.view.x>S.view.x)&&R.view.y>N.view.y&&(S=R):m.push(R);if(m.length>0&&g){var T,L;if(S)T=S.view.x+S.view.width+i.sz,L=S.view.y;else{var B=m.reduce(((e,t)=>e+t.view.width+i.sz),-i.sz);T=N.view.x-B/2+N.view.width/2,L=N.view.y+N.view.height+i.sz}for(var D of m)D.view.x=T,D.view.y=L,T+=D.view.width+i.sz}}}if(!E){var P=c[0],H=c[1],j=[];for(var O of w)(0,r.N)(O)&&(O.view.width>P&&(P=O.view.width),O.view.height>H&&(H=O.view.height),void 0===O.view.x||void 0===O.view.y?m.push(O):j.push(O.view));if(g){k||(v=(0,l.r)((0,n.without)(w,...m),{canvasWidth:d,canvasHeight:u,scaleRange:h}));var I=P+i.sz,U=H+i.sz,_=new Set;for(var Y of j)for(var F=Math.floor((Y.x+v.x/v.k)/I),V=Math.floor((Y.y+v.y/v.k)/U),X=Math.floor((Y.x+v.x/v.k+Y.width)/I),q=Math.floor((Y.y+v.y/v.k+Y.height)/U),J=F;J<=X;J++)for(var Z=V;Z<=q;Z++)_.add("".concat(J,",").concat(Z));var G=I*v.k,K=U*v.k,Q=Math.max(1,Math.floor(u/K)),$=0;for(var ee of m){var te=void 0,ae=void 0;do{te=Math.floor($/Q),ae=$%Q,$++}while(_.has("".concat(te,",").concat(ae)));ee.view.x=(te*G-v.x)/v.k+i.sz/2,ee.view.y=(ae*K-v.y)/v.k+i.sz/2}}}return{cells:w,updated:m}}},6330:(e,t,a)=>{function n(e,t,a,n,i,r,o){try{var l=e[r](o),s=l.value}catch(e){return void a(e)}l.done?t(s):Promise.resolve(s).then(n,i)}function i(e){return function(){var t=this,a=arguments;return new Promise((function(i,r){var o=e.apply(t,a);function l(e){n(o,i,r,l,s,"next",e)}function s(e){n(o,i,r,l,s,"throw",e)}l(void 0)}))}}a.d(t,{A:()=>i})}}]);
|
|
2
|
-
//# sourceMappingURL=eo-draw-canvas.cdb7565f.js.map
|