@next-bricks/diagram 0.68.1 → 0.68.3
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 +3 -3
- package/dist/chunks/{1045.9922394f.js → 1045.fc9b1386.js} +2 -2
- package/dist/chunks/{1045.9922394f.js.map → 1045.fc9b1386.js.map} +1 -1
- package/dist/chunks/114.d6b90de0.js +2 -0
- package/dist/chunks/{114.55d15cc4.js.map → 114.d6b90de0.js.map} +1 -1
- package/dist/chunks/{1370.1496da04.js → 1370.ff678c2c.js} +2 -2
- package/dist/chunks/{1370.1496da04.js.map → 1370.ff678c2c.js.map} +1 -1
- package/dist/chunks/{1889.4b02d212.js → 1889.9e9ad16a.js} +2 -2
- package/dist/chunks/1889.9e9ad16a.js.map +1 -0
- package/dist/chunks/{3171.01b43f94.js → 3171.444b8224.js} +2 -2
- package/dist/chunks/{3171.01b43f94.js.map → 3171.444b8224.js.map} +1 -1
- package/dist/chunks/{3233.91b64cbf.js → 3233.9dcf6451.js} +3 -3
- package/dist/chunks/{3233.91b64cbf.js.map → 3233.9dcf6451.js.map} +1 -1
- package/dist/chunks/4306.77b9c504.js +2 -0
- package/dist/chunks/4306.77b9c504.js.map +1 -0
- package/dist/chunks/{7146.7d2da15a.js → 4765.f9d9b831.js} +2 -2
- package/dist/chunks/{7146.7d2da15a.js.map → 4765.f9d9b831.js.map} +1 -1
- package/dist/chunks/{7218.7bdc6392.js → 4837.174d842b.js} +2 -2
- package/dist/chunks/{7218.7bdc6392.js.map → 4837.174d842b.js.map} +1 -1
- package/dist/chunks/{551.fae24cae.js → 551.f066ac71.js} +2 -2
- package/dist/chunks/551.f066ac71.js.map +1 -0
- package/dist/chunks/{5552.185e1236.js → 5552.27c9068d.js} +2 -2
- package/dist/chunks/{5552.185e1236.js.map → 5552.27c9068d.js.map} +1 -1
- package/dist/chunks/{4765.b570abab.js → 7146.e003b717.js} +2 -2
- package/dist/chunks/{4765.b570abab.js.map → 7146.e003b717.js.map} +1 -1
- package/dist/chunks/{4837.1533c6b0.js → 7218.e17d2bd1.js} +2 -2
- package/dist/chunks/{4837.1533c6b0.js.map → 7218.e17d2bd1.js.map} +1 -1
- package/dist/chunks/7733.4982e8bf.js +2 -0
- package/dist/chunks/{7733.037d6b91.js.map → 7733.4982e8bf.js.map} +1 -1
- package/dist/chunks/{7920.8fd94cae.js → 7920.367555e2.js} +3 -3
- package/dist/chunks/7920.367555e2.js.map +1 -0
- package/dist/chunks/{8989.2b239acc.js → 8989.1bb9349d.js} +2 -2
- package/dist/chunks/8989.1bb9349d.js.map +1 -0
- package/dist/chunks/948.9cb41d7c.js +3 -0
- package/dist/chunks/948.9cb41d7c.js.map +1 -0
- package/dist/chunks/9711.ecaa0666.js +2 -0
- package/dist/chunks/{9711.3db3a4d9.js.map → 9711.ecaa0666.js.map} +1 -1
- package/dist/chunks/{4603.1e380ebe.js → 9996.6bc6e11e.js} +2 -2
- package/dist/chunks/{4603.1e380ebe.js.map → 9996.6bc6e11e.js.map} +1 -1
- package/dist/chunks/editable-label.595d319c.js +3 -0
- package/dist/chunks/editable-label.595d319c.js.map +1 -0
- package/dist/chunks/eo-diagram.ccbb3f33.js +2 -0
- package/dist/chunks/{eo-diagram.b464a596.js.map → eo-diagram.ccbb3f33.js.map} +1 -1
- package/dist/chunks/eo-display-canvas.969c8dc2.js +2 -0
- package/dist/chunks/{eo-display-canvas.331140e5.js.map → eo-display-canvas.969c8dc2.js.map} +1 -1
- package/dist/chunks/eo-draw-canvas.2fb409f0.js +2 -0
- package/dist/chunks/{eo-draw-canvas.7b3cecc3.js.map → eo-draw-canvas.2fb409f0.js.map} +1 -1
- package/dist/chunks/experimental-node.e8e2498e.js +2 -0
- package/dist/chunks/experimental-node.e8e2498e.js.map +1 -0
- package/dist/chunks/main.3e38efa4.js +2 -0
- package/dist/chunks/main.3e38efa4.js.map +1 -0
- package/dist/examples.json +3 -3
- package/dist/index.23039003.js +2 -0
- package/dist/index.23039003.js.map +1 -0
- package/dist/manifest.json +220 -220
- package/dist/types.json +5745 -5745
- package/package.json +3 -3
- package/dist/chunks/114.55d15cc4.js +0 -2
- package/dist/chunks/1889.4b02d212.js.map +0 -1
- package/dist/chunks/4306.2443e1cb.js +0 -2
- package/dist/chunks/4306.2443e1cb.js.map +0 -1
- package/dist/chunks/551.fae24cae.js.map +0 -1
- package/dist/chunks/7733.037d6b91.js +0 -2
- package/dist/chunks/7920.8fd94cae.js.map +0 -1
- package/dist/chunks/8989.2b239acc.js.map +0 -1
- package/dist/chunks/9140.dd4f8e2e.js +0 -3
- package/dist/chunks/9140.dd4f8e2e.js.map +0 -1
- package/dist/chunks/9711.3db3a4d9.js +0 -2
- package/dist/chunks/editable-label.aa7a3018.js +0 -3
- package/dist/chunks/editable-label.aa7a3018.js.map +0 -1
- package/dist/chunks/eo-diagram.b464a596.js +0 -2
- package/dist/chunks/eo-display-canvas.331140e5.js +0 -2
- package/dist/chunks/eo-draw-canvas.7b3cecc3.js +0 -2
- package/dist/chunks/experimental-node.533e95c7.js +0 -2
- package/dist/chunks/experimental-node.533e95c7.js.map +0 -1
- package/dist/chunks/main.d89b7eab.js +0 -2
- package/dist/chunks/main.d89b7eab.js.map +0 -1
- package/dist/index.27002b52.js +0 -2
- package/dist/index.27002b52.js.map +0 -1
- /package/dist/chunks/{3233.91b64cbf.js.LICENSE.txt → 3233.9dcf6451.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{7920.8fd94cae.js.LICENSE.txt → 7920.367555e2.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{9140.dd4f8e2e.js.LICENSE.txt → 948.9cb41d7c.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{editable-label.aa7a3018.js.LICENSE.txt → editable-label.595d319c.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[9996],{733:(t,e,r)=>{function i(t,e,r,i){const o=r?n(t,r):t,h=i?n(e,i):e,s=Math.min(o.x-o.width/2,h.x-h.width/2),y=Math.max(o.x+o.width/2,h.x+h.width/2),x=Math.min(o.y-o.height/2,h.y-h.height/2),a=Math.max(o.y+o.height/2,h.y+h.height/2);return y-s<o.width+h.width&&a-x<o.height+h.height}function n(t,e){return{x:t.x-t.width/2-e,y:t.y-t.height/2-e,width:t.width+2*e,height:t.height+2*e}}r.d(e,{w:()=>i})},3188:(t,e,r)=>{r.d(e,{h:()=>o});var i=r(733),n=r(4525);function o(t,e,r,n){const o=!(null==n||!n.exitPosition),s=!(null==n||!n.entryPosition);if(t===e||(0,i.w)(t,e,0,0)&&!o&&!s)return null;let y,x,a=0,c=0;if(r){const i=e.x-t.x,n=e.y-t.y,o=Math.atan2(n,i);a=r/2*Math.cos(o+Math.PI/2),c=r/2*Math.sin(o+Math.PI/2)}const l=[o?[t.x+(n.exitPosition.x-.5)*t.width,t.y+(n.exitPosition.y-.5)*t.height]:[t.x+a,t.y+c],s?[e.x+(n.entryPosition.x-.5)*e.width,e.y+(n.entryPosition.y-.5)*e.height]:[e.x+a,e.y+c]];if(o)y=l[0];else{const e=h(t,l);y=e.length>0?e[0]:[t.x,t.y]}if(s)x=l[1];else{const t=h(e,l);x=t.length>0?t[0]:[e.x,e.y]}return[{x:y[0],y:y[1]},{x:x[0],y:x[1]}]}function h(t,e){const r=[[t.x-t.width/2,t.y-t.height/2],[t.x+t.width/2,t.y-t.height/2],[t.x+t.width/2,t.y+t.height/2],[t.x-t.width/2,t.y+t.height/2]],i=[];for(let t=0;t<4;t++)i.push([r[t],r[(t+1)%4]]);const o=[];for(const t of i){const r=(0,n.y)(e[0],e[1],t[0],t[1]);r&&o.push(r)}return o}},3739:(t,e,r)=>{r.d(e,{c:()=>o});var i=r(8769),n=r.n(i);function o(t){let e,{id:r,type:i,strokeColor:o}=t;switch(i){case"0..1":e=y;break;case"0..N":e=x;break;case"circle":e=h;break;default:e=s}return n().createElement(e,{id:r,strokeColor:o})}function h(t){let{id:e,strokeColor:r}=t;return n().createElement("marker",{viewBox:"0 0 9 9",refX:3,refY:3,id:e,overflow:"visible",markerWidth:9,markerHeight:9},n().createElement("circle",{stroke:"none",fill:r,cx:3,cy:3,r:3}))}function s(t){let{id:e,strokeColor:r}=t;return n().createElement("marker",{id:e,viewBox:"0 0 6 6",refX:5,refY:3,markerWidth:6,markerHeight:6,orient:"auto-start-reverse",strokeLinejoin:"round"},n().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 y(t){let{id:e,strokeColor:r}=t;return n().createElement("marker",{id:e,viewBox:"0 0 21 11",refX:.5,refY:5.5,markerWidth:21,markerHeight:11,orient:"auto-start-reverse"},n().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 x(t){let{id:e,strokeColor:r}=t;return n().createElement("marker",{id:e,viewBox:"0 0 21 11",refX:.5,refY:5.5,markerWidth:21,markerHeight:11,orient:"auto-start-reverse"},n().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"}))}},4059:(t,e,r)=>{r.d(e,{o:()=>n});const i=20;function n(t,e,r,n,h,s){const y=o(t,r,h),x=o(e,n,s);let a=[],c=!1;const l="top"===r||"bottom"===r;if(l!==("top"===n||"bottom"===n)){let o,h,s,u,f,d;l?(o=e,h=t,s="right"===n?1:-1,u="bottom"===r?1:-1,f=x,d=y):(o=t,h=e,s="right"===r?1:-1,u="bottom"===n?1:-1,f=y,d=x,c=!0);const g=f.x+i*s,k=d.y+i*u;if((o.x-h.x)*s>=0)if((h.y-o.y)*u>=0)a=[{x:d.x,y:k},{x:g,y:k},{x:g,y:f.y}];else{const t=h.y+(h.height/2+i)*u,e=o.y-(o.height/2+i)*u;if((e-t)*u>=0){const r=(t+e)/2;a=[{x:d.x,y:r},{x:g,y:r},{x:g,y:f.y}]}else{const r=(h.x+h.width/2*s+o.x-o.width/2*s)/2;a=[{x:d.x,y:t},{x:r,y:t},{x:r,y:e},{x:g,y:e},{x:g,y:f.y}]}}else if((f.y-k)*u>=0)if((d.x-g)*s>=0)a=[{x:d.x,y:f.y}];else{const t=(h.y+(h.height/2+i)*u+(o.y-(o.height/2+i)*u))/2;a=[{x:d.x,y:t},{x:g,y:t},{x:g,y:f.y}]}else{const t=h.x-(h.width/2+i)*s;if((t-g)*s>=0){const e=(t+g)/2;a=[{x:d.x,y:k},{x:e,y:k},{x:e,y:f.y}]}else{const e=(h.y-h.height/2*u+o.y+o.height/2*u)/2;a=[{x:d.x,y:k},{x:t,y:k},{x:t,y:e},{x:g,y:e},{x:g,y:f.y}]}}}else if(r===n){const n="bottom"===r||"right"===r?1:-1;let o,h,s,u;const f=l?"y":"x",d=l?"x":"y";let g,k,m,w;e[f]<t[f]?(o=e,h=t,s=x,u=y,c=1===n):(o=t,h=e,s=y,u=x,c=1!==n),1===n?(g=h,k=o,m=u,w=s):(g=o,k=h,m=s,w=u);const M=g===(e[d]<t[d]?t:e)?1:-1;if(l){const t=g.x-(g.width/2+i)*M,e=m.y+i*n;if((t-w.x)*M>=0)a=[{x:w.x,y:e},{x:m.x,y:e}];else{const r=(k.y+k.height/2*n+g.y-g.height/2*n)/2;a=[{x:w.x,y:r},{x:t,y:r},{x:t,y:e},{x:m.x,y:e}]}}else{const t=m.x+i*n,e=g.y-(g.height/2+i)*M;if((e-w.y)*M>=0)a=[{x:t,y:w.y},{x:t,y:m.y}];else{const r=(k.x+k.width/2*n+g.x-g.width/2*n)/2;a=[{x:r,y:w.y},{x:r,y:e},{x:t,y:e},{x:t,y:m.y}]}}}else{const r="bottom"===n||"right"===n?1:-1;let o,h,s,c;l?(o="y",h="x",s="height",c="width"):(o="x",h="y",s="width",c="height");const u=e[o]+e[s]/2*r,f=t[o]-t[s]/2*r,d=u+i*r,g=f-i*r,k=y[h]===x[h];if((g-d)*r>=0){const t=(g+d)/2;a=k?[]:[{[h]:y[h],[o]:t},{[h]:x[h],[o]:t}]}else if(k&&(f-u)*r>=0)a=[];else{const n=e[h]<t[h]?-1:1,l=t[h]+(t[c]/2+i)*n,u=e[h]-(e[c]/2+i)*n;if((u-l)*n>=0||Math.abs((g-d)*r)<i){const t=(l+u)/2;a=[{[h]:y[h],[o]:g},{[h]:t,[o]:g},{[h]:t,[o]:d},{[h]:x[h],[o]:d}]}else{const i=(t[o]+t[s]/2*r+e[o]-e[s]/2*r)/2;a=[{[h]:y[h],[o]:g},{[h]:l,[o]:g},{[h]:l,[o]:i},{[h]:u,[o]:i},{[h]:u,[o]:d},{[h]:x[h],[o]:d}]}}}return c&&a.reverse(),[y,...a,x]}function o(t,e,r){const{x:i,y:n,width:o,height:h}=t;switch(e){case"top":return{x:i-o/2+o*r,y:n-h/2};case"bottom":return{x:i-o/2+o*r,y:n+h/2};case"left":return{x:i-o/2,y:n-h/2+h*r};case"right":return{x:i+o/2,y:n-h/2+h*r}}}},4525:(t,e,r)=>{function i(t,e,r,i){let[n,o]=t,[h,s]=e,[y,x]=r,[a,c]=i;if(n===h&&o===s||y===a&&x===c)return null;const l=(c-x)*(h-n)-(a-y)*(s-o);if(0===l)return null;const u=((a-y)*(o-x)-(c-x)*(n-y))/l,f=((h-n)*(o-x)-(s-o)*(n-y))/l;return u<0||u>1||f<0||f>1?null:[n+u*(h-n),o+u*(s-o)]}r.d(e,{y:()=>i})},8653:(t,e,r)=>{r.d(e,{S:()=>x});var i=r(482),n=r(4643),o=r(3488),h=r(6066),s=r(4993),y=r(3269);function x(t,e,r,x,c){if(!Array.isArray(t))return"";let l;switch(e){case"curveLinear":l=i.A;break;case"curveBumpX":l=n.dJ;break;case"curveBumpY":l=n.kl;break;case"curveMonotoneX":l=o.G;break;case"curveMonotoneY":l=o.N;break;case"curveNatural":l=h.A;break;default:l=s.Ay}const u=a(t[1],t[0],r),f=a(t[t.length-2],t[t.length-1],x),d=(0,y.A)().x(((e,r)=>e.x-(0===r?u.x:r===t.length-1?f.x:0))).y(((e,r)=>e.y-(0===r?u.y:r===t.length-1?f.y:0))).curve(l);if(c&&"curveLinear"==e){const e=[];for(let r=0;r<t.length-1;r++){const i=t[r],n=t[r+1];0===r&&e.push(`M${i.x},${i.y}`);const o=c.get(r);if(o){const t=n.x-i.x,r=n.y-i.y,h=Math.atan2(r,t),s=Math.abs(h)<=Math.PI/2?-1:1,y=h+Math.PI/2*s,x=1.3*o.radius*Math.cos(y),a=1.3*o.radius*Math.sin(y),c=o.radius*Math.cos(h),l=o.radius*Math.sin(h);for(const t of o.jumpPoints){const r=t.x-c,i=t.y-l,n=t.x+c,o=t.y+l;e.push(`L${r},${i}`),e.push(`C${r+x},${i+a} ${n+x},${o+a} ${n},${o}`)}}e.push(`L${n.x},${n.y}`)}return e.join("")}return d(t)}function a(t,e,r){if(!r)return{x:0,y:0};const{x:i,y:n}=t,{x:o,y:h}=e,s=r/Math.sqrt(Math.pow(o-i,2)+Math.pow(h-n,2));return{x:(o-i)*s,y:(h-n)*s}}},8802:(t,e,r)=>{function i(t){if(Array.isArray(t)){const e=t[0],r=t.length>1?t[1]:e;return[e,r,t.length>2?t[2]:e,t.length>3?t[3]:r]}return new Array(4).fill(t)}r.d(e,{D:()=>i})}}]);
|
|
2
|
+
//# sourceMappingURL=9996.6bc6e11e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/4603.1e380ebe.js","mappings":"uIAEO,SAASA,EACdC,EACAC,EACAC,EACAC,GAEA,MAAMC,EAAIF,EAAWG,EAAoBL,EAAGE,GA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EAAKJ,KAAWtC,EAAKoC,KAAWnC,EAAKqC,KAAWtC,KAAMC,IAE9E,CACF,CACAzD,EAAE/B,KAAK,IAAI4D,EAAInG,KAAKmG,EAAI9F,IAC1B,CACA,OAAOiE,EAAEmG,KAAK,GAChB,CAEA,OAAOb,EAAalB,EACtB,CAEA,SAASgB,EACPxD,EACAC,EACAuE,GAEA,IAAKA,EACH,MAAO,CAAE1K,EAAG,EAAGK,EAAG,GAEpB,MAAQL,EAAGuK,EAAIlK,EAAGmK,GAAOtE,GACjBlG,EAAG8H,EAAIzH,EAAG0H,GAAO5B,EAEnBwE,EAAQD,EADG5K,KAAK8K,KAAK9K,KAAK+K,IAAI/C,EAAKyC,EAAI,GAAKzK,KAAK+K,IAAI9C,EAAKyC,EAAI,IAEpE,MAAO,CACLxK,GAAI8H,EAAKyC,GAAMI,EACftK,GAAI0H,EAAKyC,GAAMG,EAEnB,C,iBCpIO,SAASG,EACdC,GAEA,GAAIhC,MAAMC,QAAQ+B,GAAQ,CACxB,MAAMC,EAAKD,EAAM,GACXE,EAAKF,EAAM9I,OAAS,EAAI8I,EAAM,GAAMC,EAG1C,MAAO,CAACA,EAAIC,EAFDF,EAAM9I,OAAS,EAAI8I,EAAM,GAAMC,EAC/BD,EAAM9I,OAAS,EAAI8I,EAAM,GAAME,EAE5C,CACA,OAAO,IAAIlC,MAAM,GAAG/E,KAAK+G,EAC3B,C","sources":["webpack:///./src/diagram/processors/doTwoNodesOverlap.ts","webpack:///./src/diagram/lines/getDirectLinePoints.ts","webpack:///./src/diagram/MarkerComponent.tsx","webpack:///./src/diagram/lines/getPolyLinePoints.ts","webpack:///./src/diagram/lines/intersect.ts","webpack:///./src/diagram/lines/curveLine.ts","webpack:///./src/diagram/processors/extractPartialRectTuple.ts"],"sourcesContent":["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 { EdgeView } from \"../../draw-canvas/interfaces\";\nimport type { NodePosition, NodeRect, PositionTuple } from \"../interfaces\";\nimport { doTwoNodesOverlap } from \"../processors/doTwoNodesOverlap\";\nimport { intersect } from \"./intersect\";\n\ntype LineTuple = [start: PositionTuple, end: PositionTuple];\n\nexport function getDirectLinePoints(\n source: NodeRect,\n target: NodeRect,\n parallelGap?: number,\n edgeView?: EdgeView\n): NodePosition[] | null {\n const hasExitPosition = !!edgeView?.exitPosition;\n const hasEntryPosition = !!edgeView?.entryPosition;\n\n // Ignore if two nodes are the same.\n // Ignore if two nodes overlap and no entry nor exit position.\n if (\n source === target ||\n (doTwoNodesOverlap(source, target, 0, 0) &&\n !(hasExitPosition || hasEntryPosition))\n ) {\n return null;\n }\n\n let p0: PositionTuple;\n let p1: PositionTuple;\n\n let xDiff = 0;\n let yDiff = 0;\n\n if (parallelGap) {\n const dx = target.x - source.x;\n const dy = target.y - source.y;\n const angle = Math.atan2(dy, dx);\n xDiff = (parallelGap / 2) * Math.cos(angle + Math.PI / 2);\n yDiff = (parallelGap / 2) * Math.sin(angle + Math.PI / 2);\n }\n\n const line: LineTuple = [\n hasExitPosition\n ? [\n source.x + (edgeView!.exitPosition!.x - 0.5) * source.width,\n source.y + (edgeView!.exitPosition!.y - 0.5) * source.height,\n ]\n : [source.x + xDiff, source.y + yDiff],\n hasEntryPosition\n ? [\n target.x + (edgeView!.entryPosition!.x - 0.5) * target.width,\n target.y + (edgeView!.entryPosition!.y - 0.5) * target.height,\n ]\n : [target.x + xDiff, target.y + yDiff],\n ];\n\n if (hasExitPosition) {\n p0 = line[0];\n } else {\n const sourceIntersections = getIntersections(source, line);\n // Todo: handle when more than one intersection\n if (sourceIntersections.length > 0) {\n p0 = sourceIntersections[0];\n } else {\n p0 = [source.x, source.y];\n }\n }\n\n if (hasEntryPosition) {\n p1 = line[1];\n } else {\n const targetIntersections = getIntersections(target, line);\n // Todo: handle when more than one intersection\n if (targetIntersections.length > 0) {\n p1 = targetIntersections[0];\n } else {\n p1 = [target.x, target.y];\n }\n }\n\n return [\n { x: p0[0], y: p0[1] },\n { x: p1[0], y: p1[1] },\n ];\n}\n\nfunction getIntersections(rect: NodeRect, line: LineTuple) {\n const vertices: PositionTuple[] = [\n [rect.x - rect.width / 2, rect.y - rect.height / 2],\n [rect.x + rect.width / 2, rect.y - rect.height / 2],\n [rect.x + rect.width / 2, rect.y + rect.height / 2],\n [rect.x - rect.width / 2, rect.y + rect.height / 2],\n ];\n const possibleLines: [start: PositionTuple, end: PositionTuple][] = [];\n for (let i = 0; i < 4; i++) {\n possibleLines.push([vertices[i], vertices[(i + 1) % 4]]);\n }\n const intersections: PositionTuple[] = [];\n for (const item of possibleLines) {\n const intersection = intersect(line[0], line[1], item[0], item[1]);\n if (intersection) {\n intersections.push(intersection);\n }\n }\n return intersections;\n}\n","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 case \"circle\":\n Component = CircleMarker;\n break;\n default:\n Component = ArrowMarker;\n }\n return <Component id={id} strokeColor={strokeColor} />;\n}\n\nfunction CircleMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n const r = 3;\n const d = r * 3;\n return (\n <marker\n viewBox={`0 0 ${d} ${d}`}\n refX={r}\n refY={r}\n id={id}\n overflow=\"visible\"\n markerWidth={d}\n markerHeight={d}\n >\n <circle stroke=\"none\" fill={strokeColor} cx={r} cy={r} r={r} />\n </marker>\n );\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 { Direction, NodePosition, NodeRect } from \"../interfaces\";\n\nconst MINIMAL_OFFSET = 20;\n\nexport function getPolyLinePoints(\n source: NodeRect,\n target: NodeRect,\n sourceDirection: Direction,\n targetDirection: Direction,\n sourcePosition: number,\n targetPosition: number\n): NodePosition[] {\n const p0 = getCoordinates(source, sourceDirection, sourcePosition);\n const p1 = getCoordinates(target, targetDirection, targetPosition);\n\n let controls: NodePosition[] = [];\n let reverseControls = false;\n\n const sourceIsVertical =\n sourceDirection === \"top\" || sourceDirection === \"bottom\";\n const targetIsVertical =\n targetDirection === \"top\" || targetDirection === \"bottom\";\n\n if (sourceIsVertical !== targetIsVertical) {\n // One is vertical and the other is horizontal\n let horizontal: NodeRect;\n let vertical: NodeRect;\n let horizontalSign: number;\n let verticalSign: number;\n let horizontalPosition: NodePosition;\n let verticalPosition: NodePosition;\n if (sourceIsVertical) {\n horizontal = target;\n vertical = source;\n horizontalSign = targetDirection === \"right\" ? 1 : -1;\n verticalSign = sourceDirection === \"bottom\" ? 1 : -1;\n horizontalPosition = p1;\n verticalPosition = p0;\n } else {\n horizontal = source;\n vertical = target;\n horizontalSign = sourceDirection === \"right\" ? 1 : -1;\n verticalSign = targetDirection === \"bottom\" ? 1 : -1;\n horizontalPosition = p0;\n verticalPosition = p1;\n reverseControls = true;\n }\n\n const defaultControlX =\n horizontalPosition.x + MINIMAL_OFFSET * horizontalSign;\n const defaultControlY = verticalPosition.y + MINIMAL_OFFSET * verticalSign;\n\n if ((horizontal.x - vertical.x) * horizontalSign >= 0) {\n if ((vertical.y - horizontal.y) * verticalSign >= 0) {\n // ┌──────────────┐\n // ┌──┴──┐ ┌─────┐ │\n // │ S │ │ T ├─┘\n // └─────┘ └─────┘\n controls = [\n { x: verticalPosition.x, y: defaultControlY },\n { x: defaultControlX, y: defaultControlY },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n } else {\n const controlY0 =\n vertical.y + (vertical.height / 2 + MINIMAL_OFFSET) * verticalSign;\n const controlY1 =\n horizontal.y -\n (horizontal.height / 2 + MINIMAL_OFFSET) * verticalSign;\n if ((controlY1 - controlY0) * verticalSign >= 0) {\n // ┌─────┐\n // │ T ├─┐\n // └─────┘ │\n // ┌────────┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n const middleY = (controlY0 + controlY1) / 2;\n controls = [\n { x: verticalPosition.x, y: middleY },\n { x: defaultControlX, y: middleY },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n } else {\n // ┌─────┐\n // ┌────┐ │ T ├─┐\n // ┌──┴──┐ │ └─────┘ │\n // │ S │ └─────────┘\n // └─────┘\n const middleX =\n (vertical.x +\n (vertical.width / 2) * horizontalSign +\n horizontal.x -\n (horizontal.width / 2) * horizontalSign) /\n 2;\n controls = [\n { x: verticalPosition.x, y: controlY0 },\n { x: middleX, y: controlY0 },\n { x: middleX, y: controlY1 },\n { x: defaultControlX, y: controlY1 },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n }\n }\n } else if ((horizontalPosition.y - defaultControlY) * verticalSign >= 0) {\n if ((verticalPosition.x - defaultControlX) * horizontalSign >= 0) {\n // ┌─────┐\n // ┌──┤ T │\n // │ └─────┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n controls = [{ x: verticalPosition.x, y: horizontalPosition.y }];\n } else {\n // ┌─────┐\n // │ T ├─┐\n // └─────┘ │\n // ┌─┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n const controlY0 =\n vertical.y + (vertical.height / 2 + MINIMAL_OFFSET) * verticalSign;\n const controlY1 =\n horizontal.y -\n (horizontal.height / 2 + MINIMAL_OFFSET) * verticalSign;\n const middleY = (controlY0 + controlY1) / 2;\n controls = [\n { x: verticalPosition.x, y: middleY },\n { x: defaultControlX, y: middleY },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n }\n } else {\n const sourceExtendX =\n vertical.x - (vertical.width / 2 + MINIMAL_OFFSET) * horizontalSign;\n if ((sourceExtendX - defaultControlX) * horizontalSign >= 0) {\n // ┌────┐\n // │ ┌──┴──┐\n // │ │ S │\n // ┌─────┐ │ └─────┘\n // │ T ├─┘\n // └─────┘\n const middleX = (sourceExtendX + defaultControlX) / 2;\n controls = [\n { x: verticalPosition.x, y: defaultControlY },\n { x: middleX, y: defaultControlY },\n { x: middleX, y: horizontalPosition.y },\n ];\n } else {\n // ┌────┐\n // │ ┌──┴──┐\n // │ │ S │\n // │ └─────┘\n // └───┐\n // ┌─────┐ │\n // │ T ├─┘\n // └─────┘\n const middleY =\n (vertical.y -\n (vertical.height / 2) * verticalSign +\n horizontal.y +\n (horizontal.height / 2) * verticalSign) /\n 2;\n controls = [\n { x: verticalPosition.x, y: defaultControlY },\n { x: sourceExtendX, y: defaultControlY },\n { x: sourceExtendX, y: middleY },\n { x: defaultControlX, y: middleY },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n }\n }\n } else if (sourceDirection === targetDirection) {\n // Same direction\n const sign =\n sourceDirection === \"bottom\" || sourceDirection === \"right\" ? 1 : -1;\n let start: NodeRect;\n let end: NodeRect;\n let startPosition: NodePosition;\n let endPosition: NodePosition;\n const axis = sourceIsVertical ? \"y\" : \"x\";\n const oppositeAxis = sourceIsVertical ? \"x\" : \"y\";\n if (target[axis] < source[axis]) {\n start = target;\n end = source;\n startPosition = p1;\n endPosition = p0;\n reverseControls = sign === 1;\n } else {\n start = source;\n end = target;\n startPosition = p0;\n endPosition = p1;\n reverseControls = sign !== 1;\n }\n const perpendicular =\n target[oppositeAxis] < source[oppositeAxis] ? source : target;\n let around: NodeRect;\n let nonAround: NodeRect;\n let aroundPosition: NodePosition;\n let nonAroundPosition: NodePosition;\n if (sign === 1) {\n around = end;\n nonAround = start;\n aroundPosition = endPosition;\n nonAroundPosition = startPosition;\n } else {\n around = start;\n nonAround = end;\n aroundPosition = startPosition;\n nonAroundPosition = endPosition;\n }\n const aroundSign = around === perpendicular ? 1 : -1;\n if (sourceIsVertical) {\n const defaultControlX =\n around.x - (around.width / 2 + MINIMAL_OFFSET) * aroundSign;\n const defaultControlY = aroundPosition.y + MINIMAL_OFFSET * sign;\n if ((defaultControlX - nonAroundPosition.x) * aroundSign >= 0) {\n // ┌─────────┐\n // │ ┌──┴──┐\n // │ │ T │\n // ┌──┴──┐ └─────┘\n // │ S │\n // └─────┘\n controls = [\n { x: nonAroundPosition.x, y: defaultControlY },\n { x: aroundPosition.x, y: defaultControlY },\n ];\n } else {\n // ┌────┐\n // │ ┌──┴──┐\n // │ │ T │\n // │ └─────┘\n // └─┐\n // ┌──┴──┐\n // │ S │\n // └─────┘\n const middleY =\n (nonAround.y +\n (nonAround.height / 2) * sign +\n around.y -\n (around.height / 2) * sign) /\n 2;\n controls = [\n { x: nonAroundPosition.x, y: middleY },\n { x: defaultControlX, y: middleY },\n { x: defaultControlX, y: defaultControlY },\n { x: aroundPosition.x, y: defaultControlY },\n ];\n }\n } else {\n const defaultControlX = aroundPosition.x + MINIMAL_OFFSET * sign;\n const defaultControlY =\n around.y - (around.height / 2 + MINIMAL_OFFSET) * aroundSign;\n if ((defaultControlY - nonAroundPosition.y) * aroundSign >= 0) {\n // ┌─────┐\n // ┌─────────┤ T │\n // │ ┌─────┐ └─────┘\n // └─┤ S │\n // └─────┘\n controls = [\n { x: defaultControlX, y: nonAroundPosition.y },\n { x: defaultControlX, y: aroundPosition.y },\n ];\n } else {\n // ┌─────────┐\n // │ ┌─────┐ │ ┌─────┐\n // └─┤ S │ └─┤ T │\n // └─────┘ └─────┘\n const middleX =\n (nonAround.x +\n (nonAround.width / 2) * sign +\n around.x -\n (around.width / 2) * sign) /\n 2;\n controls = [\n { x: middleX, y: nonAroundPosition.y },\n { x: middleX, y: defaultControlY },\n { x: defaultControlX, y: defaultControlY },\n { x: defaultControlX, y: aroundPosition.y },\n ];\n }\n }\n } else {\n // Opposite direction\n const targetSign =\n targetDirection === \"bottom\" || targetDirection === \"right\" ? 1 : -1;\n let axis: \"x\" | \"y\";\n let oppositeAxis: \"x\" | \"y\";\n let size: \"width\" | \"height\";\n let oppositeSize: \"width\" | \"height\";\n if (sourceIsVertical) {\n axis = \"y\";\n oppositeAxis = \"x\";\n size = \"height\";\n oppositeSize = \"width\";\n } else {\n axis = \"x\";\n oppositeAxis = \"y\";\n size = \"width\";\n oppositeSize = \"height\";\n }\n const targetEdge = target[axis] + (target[size] / 2) * targetSign;\n const sourceEdge = source[axis] - (source[size] / 2) * targetSign;\n const targetControl = targetEdge + MINIMAL_OFFSET * targetSign;\n const sourceControl = sourceEdge - MINIMAL_OFFSET * targetSign;\n const oppositeIsStraight = p0[oppositeAxis] === p1[oppositeAxis];\n if ((sourceControl - targetControl) * targetSign >= 0) {\n const middle = (sourceControl + targetControl) / 2;\n if (oppositeIsStraight) {\n // Straight line\n // ┌─────┐\n // │ T │\n // └──┬──┘\n // │\n // ┌──┴──┐\n // │ S │\n // └─────┘\n controls = [];\n } else {\n // ┌─────┐\n // │ T │\n // └──┬──┘\n // ┌───┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n controls = [\n { [oppositeAxis]: p0[oppositeAxis], [axis]: middle },\n { [oppositeAxis]: p1[oppositeAxis], [axis]: middle },\n ] as unknown[] as NodePosition[];\n }\n } else if (\n oppositeIsStraight &&\n (sourceEdge - targetEdge) * targetSign >= 0\n ) {\n // Straight line (very close)\n // ┌─────┐\n // │ T │\n // └──┬──┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n controls = [];\n } else {\n const targetOppositeSign =\n target[oppositeAxis] < source[oppositeAxis] ? -1 : 1;\n const sourceOppositeControl =\n source[oppositeAxis] +\n (source[oppositeSize] / 2 + MINIMAL_OFFSET) * targetOppositeSign;\n const targetOppositeControl =\n target[oppositeAxis] -\n (target[oppositeSize] / 2 + MINIMAL_OFFSET) * targetOppositeSign;\n if (\n (targetOppositeControl - sourceOppositeControl) * targetOppositeSign >=\n 0 ||\n Math.abs((sourceControl - targetControl) * targetSign) < MINIMAL_OFFSET\n ) {\n // ┌─────┐\n // ┌────┐ │ T │\n // ┌──┴──┐ │ └──┬──┘\n // │ S │ └────┘\n // └─────┘\n const oppositeMiddle =\n (sourceOppositeControl + targetOppositeControl) / 2;\n controls = [\n { [oppositeAxis]: p0[oppositeAxis], [axis]: sourceControl },\n { [oppositeAxis]: oppositeMiddle, [axis]: sourceControl },\n { [oppositeAxis]: oppositeMiddle, [axis]: targetControl },\n { [oppositeAxis]: p1[oppositeAxis], [axis]: targetControl },\n ] as unknown[] as NodePosition[];\n } else {\n // ┌────┐\n // ┌──┴──┐ │\n // │ S │ │\n // └─────┘ │\n // ┌─────────┘\n // │ ┌─────┐\n // │ │ T │\n // │ └──┬──┘\n // └────┘\n const middle =\n (source[axis] +\n (source[size] / 2) * targetSign +\n target[axis] -\n (target[size] / 2) * targetSign) /\n 2;\n controls = [\n { [oppositeAxis]: p0[oppositeAxis], [axis]: sourceControl },\n { [oppositeAxis]: sourceOppositeControl, [axis]: sourceControl },\n { [oppositeAxis]: sourceOppositeControl, [axis]: middle },\n { [oppositeAxis]: targetOppositeControl, [axis]: middle },\n { [oppositeAxis]: targetOppositeControl, [axis]: targetControl },\n { [oppositeAxis]: p1[oppositeAxis], [axis]: targetControl },\n ] as unknown[] as NodePosition[];\n }\n }\n }\n\n if (reverseControls) {\n controls.reverse();\n }\n\n return [p0, ...controls, p1] as NodePosition[];\n}\n\nfunction getCoordinates(\n node: NodeRect,\n direction: Direction,\n position: number\n): NodePosition {\n const { x, y, width, height } = node;\n switch (direction) {\n case \"top\":\n return {\n x: x - width / 2 + width * position,\n y: y - height / 2,\n };\n case \"bottom\":\n return {\n x: x - width / 2 + width * position,\n y: y + height / 2,\n };\n case \"left\":\n return {\n x: x - width / 2,\n y: y - height / 2 + height * position,\n };\n case \"right\":\n return {\n x: x + width / 2,\n y: y - height / 2 + height * position,\n };\n }\n}\n","import type { PositionTuple } from \"../interfaces\";\n\n// https://paulbourke.net/geometry/pointlineplane/javascript.txt\nexport function intersect(\n [x1, y1]: PositionTuple,\n [x2, y2]: PositionTuple,\n [x3, y3]: PositionTuple,\n [x4, y4]: PositionTuple\n): null | PositionTuple {\n // Check if none of the lines are of length 0\n if ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n return null;\n }\n\n const denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n\n // Lines are parallel\n if (denominator === 0) {\n return null;\n }\n\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;\n const ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator;\n\n // is the intersection along the segments\n if (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n return null;\n }\n\n // Return a object with the x and y coordinates of the intersection\n const x = x1 + ua * (x2 - x1);\n const y = y1 + ua * (y2 - y1);\n\n return [x, y];\n}\n","import {\n curveLinear,\n line,\n curveBasis,\n curveBumpX,\n curveBumpY,\n type CurveFactory,\n curveMonotoneX,\n curveNatural,\n curveMonotoneY,\n} from \"d3-shape\";\nimport type { CurveType, NodePosition } from \"../interfaces\";\nimport type { LineSegmentJumps } from \"../../draw-canvas/interfaces\";\n\n/**\n * Generate Line from points\n */\nexport function curveLine(\n points: Array<NodePosition> | null | undefined,\n curveType: CurveType | undefined,\n startOffset: number,\n endOffset: number,\n jumpsMap?: Map<number, LineSegmentJumps> | null\n): string {\n if (!Array.isArray(points)) {\n return \"\";\n }\n let curveFactory: CurveFactory;\n switch (curveType) {\n case \"curveLinear\":\n curveFactory = curveLinear;\n break;\n case \"curveBumpX\":\n curveFactory = curveBumpX;\n break;\n case \"curveBumpY\":\n curveFactory = curveBumpY;\n break;\n case \"curveMonotoneX\":\n curveFactory = curveMonotoneX;\n break;\n case \"curveMonotoneY\":\n curveFactory = curveMonotoneY;\n break;\n case \"curveNatural\":\n curveFactory = curveNatural;\n break;\n default:\n curveFactory = curveBasis;\n }\n const startOffsets = getOffsets(points[1], points[0], startOffset);\n const endOffsets = getOffsets(\n points[points.length - 2],\n points[points.length - 1],\n endOffset\n );\n const lineFunction = line<NodePosition>()\n .x(\n (d, index) =>\n d.x -\n (index === 0\n ? startOffsets.x\n : index === points.length - 1\n ? endOffsets.x\n : 0)\n )\n .y(\n (d, index) =>\n d.y -\n (index === 0\n ? startOffsets.y\n : index === points.length - 1\n ? endOffsets.y\n : 0)\n )\n .curve(curveFactory);\n\n if (jumpsMap && curveType == \"curveLinear\") {\n const d: string[] = [];\n for (let i = 0; i < points.length - 1; i++) {\n const start = points[i];\n const end = points[i + 1];\n if (i === 0) {\n d.push(`M${start.x},${start.y}`);\n }\n // 处理交叉跨线点\n const jump = jumpsMap.get(i);\n if (jump) {\n // 跨线点近似为一段半圆,参考 draw.io 使用三次贝赛尔曲线实现。\n // 一条 jump 记录中所有的 jumpPoints 都在同一线段上,因此角度一致、尺寸一致。\n const dx = end.x - start.x;\n const dy = end.y - start.y;\n const angle = Math.atan2(dy, dx);\n const direction = Math.abs(angle) <= Math.PI / 2 ? -1 : 1;\n const verticalAngle = angle + (Math.PI / 2) * direction;\n const offsetX = jump.radius * 1.3 * Math.cos(verticalAngle);\n const offsetY = jump.radius * 1.3 * Math.sin(verticalAngle);\n const xDiff = jump.radius * Math.cos(angle);\n const yDiff = jump.radius * Math.sin(angle);\n for (const p of jump.jumpPoints) {\n const x0 = p.x - xDiff;\n const y0 = p.y - yDiff;\n const x1 = p.x + xDiff;\n const y1 = p.y + yDiff;\n d.push(`L${x0},${y0}`);\n d.push(\n `C${x0 + offsetX},${y0 + offsetY} ${x1 + offsetX},${y1 + offsetY} ${x1},${y1}`\n );\n }\n }\n d.push(`L${end.x},${end.y}`);\n }\n return d.join(\"\");\n }\n\n return lineFunction(points)!;\n}\n\nfunction getOffsets(\n start: NodePosition,\n end: NodePosition,\n offset: number\n): NodePosition {\n if (!offset) {\n return { x: 0, y: 0 };\n }\n const { x: x0, y: y0 } = start;\n const { x: x1, y: y1 } = end;\n const distance = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2));\n const ratio = offset / distance;\n return {\n x: (x1 - x0) * ratio,\n y: (y1 - y0) * ratio,\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"],"names":["doTwoNodesOverlap","a","b","paddingA","paddingB","A","getNodesWithPadding","B","left","Math","min","x","width","right","max","top","y","height","bottom","node","padding","getDirectLinePoints","source","target","parallelGap","edgeView","hasExitPosition","exitPosition","hasEntryPosition","entryPosition","p0","p1","xDiff","yDiff","dx","dy","angle","atan2","cos","PI","sin","line","sourceIntersections","getIntersections","length","targetIntersections","rect","vertices","possibleLines","i","push","intersections","item","intersection","intersect","MarkerComponent","_ref","Component","id","type","strokeColor","EntityRelationZeroOrOneMarker","EntityRelationZeroOrManyMarker","CircleMarker","ArrowMarker","React","_ref2","viewBox","refX","refY","overflow","markerWidth","r","markerHeight","stroke","fill","cx","cy","_ref3","orient","strokeLinejoin","d","strokeWidth","_ref4","_ref5","MINIMAL_OFFSET","getPolyLinePoints","sourceDirection","targetDirection","sourcePosition","targetPosition","getCoordinates","controls","reverseControls","sourceIsVertical","horizontal","vertical","horizontalSign","verticalSign","horizontalPosition","verticalPosition","defaultControlX","defaultControlY","controlY0","controlY1","middleY","middleX","sourceExtendX","sign","start","end","startPosition","endPosition","axis","oppositeAxis","around","nonAround","aroundPosition","nonAroundPosition","aroundSign","targetSign","size","oppositeSize","targetEdge","sourceEdge","targetControl","sourceControl","oppositeIsStraight","middle","targetOppositeSign","sourceOppositeControl","targetOppositeControl","abs","oppositeMiddle","reverse","direction","position","x1","y1","x2","y2","x3","y3","x4","y4","denominator","ua","ub","curveLine","points","curveType","startOffset","endOffset","jumpsMap","Array","isArray","curveFactory","curveLinear","curveBumpX","curveBumpY","curveMonotoneX","curveMonotoneY","curveNatural","curveBasis","startOffsets","getOffsets","endOffsets","lineFunction","index","curve","jump","get","verticalAngle","offsetX","radius","offsetY","p","jumpPoints","x0","y0","join","offset","ratio","sqrt","pow","extractPartialRectTuple","value","v0","v1"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"chunks/9996.6bc6e11e.js","mappings":"uIAEO,SAASA,EACdC,EACAC,EACAC,EACAC,GAEA,MAAMC,EAAIF,EAAWG,EAAoBL,EAAGE,GAAYF,EAClDM,EAAIH,EAAWE,EAAoBJ,EAAGE,GAAYF,EAClDM,EAAOC,KAAKC,IAAIL,EAAEM,EAAIN,EAAEO,MAAQ,EAAGL,EAAEI,EAAIJ,EAAEK,MAAQ,GACnDC,EAAQJ,KAAKK,IAAIT,EAAEM,EAAIN,EAAEO,MAAQ,EAAGL,EAAEI,EAAIJ,EAAEK,MAAQ,GACpDG,EAAMN,KAAKC,IAAIL,EAAEW,EAAIX,EAAEY,OAAS,EAAGV,EAAES,EAAIT,EAAEU,OAAS,GACpDC,EAAST,KAAKK,IAAIT,EAAEW,EAAIX,EAAEY,OAAS,EAAGV,EAAES,EAAIT,EAAEU,OAAS,GAC7D,OAAOJ,EAAQL,EAAOH,EAAEO,MAAQL,EAAEK,OAASM,EAASH,EAAMV,EAAEY,OAASV,EAAEU,MACzE,CAEA,SAASX,EAAoBa,EAAgBC,GAC3C,MAAO,CACLT,EAAGQ,EAAKR,EAAIQ,EAAKP,MAAQ,EAAIQ,EAC7BJ,EAAGG,EAAKH,EAAIG,EAAKF,OAAS,EAAIG,EAC9BR,MAAOO,EAAKP,MAAkB,EAAVQ,EACpBH,OAAQE,EAAKF,OAAmB,EAAVG,EAE1B,C,yECjBO,SAASC,EACdC,EACAC,EACAC,EACAC,GA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,EAAI8I,EAAM,GAAME,EAE5C,CACA,OAAO,IAAIlC,MAAM,GAAG/E,KAAK+G,EAC3B,C","sources":["webpack:///./src/diagram/processors/doTwoNodesOverlap.ts","webpack:///./src/diagram/lines/getDirectLinePoints.ts","webpack:///./src/diagram/MarkerComponent.tsx","webpack:///./src/diagram/lines/getPolyLinePoints.ts","webpack:///./src/diagram/lines/intersect.ts","webpack:///./src/diagram/lines/curveLine.ts","webpack:///./src/diagram/processors/extractPartialRectTuple.ts"],"sourcesContent":["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 { EdgeView } from \"../../draw-canvas/interfaces\";\nimport type { NodePosition, NodeRect, PositionTuple } from \"../interfaces\";\nimport { doTwoNodesOverlap } from \"../processors/doTwoNodesOverlap\";\nimport { intersect } from \"./intersect\";\n\ntype LineTuple = [start: PositionTuple, end: PositionTuple];\n\nexport function getDirectLinePoints(\n source: NodeRect,\n target: NodeRect,\n parallelGap?: number,\n edgeView?: EdgeView\n): NodePosition[] | null {\n const hasExitPosition = !!edgeView?.exitPosition;\n const hasEntryPosition = !!edgeView?.entryPosition;\n\n // Ignore if two nodes are the same.\n // Ignore if two nodes overlap and no entry nor exit position.\n if (\n source === target ||\n (doTwoNodesOverlap(source, target, 0, 0) &&\n !(hasExitPosition || hasEntryPosition))\n ) {\n return null;\n }\n\n let p0: PositionTuple;\n let p1: PositionTuple;\n\n let xDiff = 0;\n let yDiff = 0;\n\n if (parallelGap) {\n const dx = target.x - source.x;\n const dy = target.y - source.y;\n const angle = Math.atan2(dy, dx);\n xDiff = (parallelGap / 2) * Math.cos(angle + Math.PI / 2);\n yDiff = (parallelGap / 2) * Math.sin(angle + Math.PI / 2);\n }\n\n const line: LineTuple = [\n hasExitPosition\n ? [\n source.x + (edgeView!.exitPosition!.x - 0.5) * source.width,\n source.y + (edgeView!.exitPosition!.y - 0.5) * source.height,\n ]\n : [source.x + xDiff, source.y + yDiff],\n hasEntryPosition\n ? [\n target.x + (edgeView!.entryPosition!.x - 0.5) * target.width,\n target.y + (edgeView!.entryPosition!.y - 0.5) * target.height,\n ]\n : [target.x + xDiff, target.y + yDiff],\n ];\n\n if (hasExitPosition) {\n p0 = line[0];\n } else {\n const sourceIntersections = getIntersections(source, line);\n // Todo: handle when more than one intersection\n if (sourceIntersections.length > 0) {\n p0 = sourceIntersections[0];\n } else {\n p0 = [source.x, source.y];\n }\n }\n\n if (hasEntryPosition) {\n p1 = line[1];\n } else {\n const targetIntersections = getIntersections(target, line);\n // Todo: handle when more than one intersection\n if (targetIntersections.length > 0) {\n p1 = targetIntersections[0];\n } else {\n p1 = [target.x, target.y];\n }\n }\n\n return [\n { x: p0[0], y: p0[1] },\n { x: p1[0], y: p1[1] },\n ];\n}\n\nfunction getIntersections(rect: NodeRect, line: LineTuple) {\n const vertices: PositionTuple[] = [\n [rect.x - rect.width / 2, rect.y - rect.height / 2],\n [rect.x + rect.width / 2, rect.y - rect.height / 2],\n [rect.x + rect.width / 2, rect.y + rect.height / 2],\n [rect.x - rect.width / 2, rect.y + rect.height / 2],\n ];\n const possibleLines: [start: PositionTuple, end: PositionTuple][] = [];\n for (let i = 0; i < 4; i++) {\n possibleLines.push([vertices[i], vertices[(i + 1) % 4]]);\n }\n const intersections: PositionTuple[] = [];\n for (const item of possibleLines) {\n const intersection = intersect(line[0], line[1], item[0], item[1]);\n if (intersection) {\n intersections.push(intersection);\n }\n }\n return intersections;\n}\n","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 case \"circle\":\n Component = CircleMarker;\n break;\n default:\n Component = ArrowMarker;\n }\n return <Component id={id} strokeColor={strokeColor} />;\n}\n\nfunction CircleMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n const r = 3;\n const d = r * 3;\n return (\n <marker\n viewBox={`0 0 ${d} ${d}`}\n refX={r}\n refY={r}\n id={id}\n overflow=\"visible\"\n markerWidth={d}\n markerHeight={d}\n >\n <circle stroke=\"none\" fill={strokeColor} cx={r} cy={r} r={r} />\n </marker>\n );\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 { Direction, NodePosition, NodeRect } from \"../interfaces\";\n\nconst MINIMAL_OFFSET = 20;\n\nexport function getPolyLinePoints(\n source: NodeRect,\n target: NodeRect,\n sourceDirection: Direction,\n targetDirection: Direction,\n sourcePosition: number,\n targetPosition: number\n): NodePosition[] {\n const p0 = getCoordinates(source, sourceDirection, sourcePosition);\n const p1 = getCoordinates(target, targetDirection, targetPosition);\n\n let controls: NodePosition[] = [];\n let reverseControls = false;\n\n const sourceIsVertical =\n sourceDirection === \"top\" || sourceDirection === \"bottom\";\n const targetIsVertical =\n targetDirection === \"top\" || targetDirection === \"bottom\";\n\n if (sourceIsVertical !== targetIsVertical) {\n // One is vertical and the other is horizontal\n let horizontal: NodeRect;\n let vertical: NodeRect;\n let horizontalSign: number;\n let verticalSign: number;\n let horizontalPosition: NodePosition;\n let verticalPosition: NodePosition;\n if (sourceIsVertical) {\n horizontal = target;\n vertical = source;\n horizontalSign = targetDirection === \"right\" ? 1 : -1;\n verticalSign = sourceDirection === \"bottom\" ? 1 : -1;\n horizontalPosition = p1;\n verticalPosition = p0;\n } else {\n horizontal = source;\n vertical = target;\n horizontalSign = sourceDirection === \"right\" ? 1 : -1;\n verticalSign = targetDirection === \"bottom\" ? 1 : -1;\n horizontalPosition = p0;\n verticalPosition = p1;\n reverseControls = true;\n }\n\n const defaultControlX =\n horizontalPosition.x + MINIMAL_OFFSET * horizontalSign;\n const defaultControlY = verticalPosition.y + MINIMAL_OFFSET * verticalSign;\n\n if ((horizontal.x - vertical.x) * horizontalSign >= 0) {\n if ((vertical.y - horizontal.y) * verticalSign >= 0) {\n // ┌──────────────┐\n // ┌──┴──┐ ┌─────┐ │\n // │ S │ │ T ├─┘\n // └─────┘ └─────┘\n controls = [\n { x: verticalPosition.x, y: defaultControlY },\n { x: defaultControlX, y: defaultControlY },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n } else {\n const controlY0 =\n vertical.y + (vertical.height / 2 + MINIMAL_OFFSET) * verticalSign;\n const controlY1 =\n horizontal.y -\n (horizontal.height / 2 + MINIMAL_OFFSET) * verticalSign;\n if ((controlY1 - controlY0) * verticalSign >= 0) {\n // ┌─────┐\n // │ T ├─┐\n // └─────┘ │\n // ┌────────┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n const middleY = (controlY0 + controlY1) / 2;\n controls = [\n { x: verticalPosition.x, y: middleY },\n { x: defaultControlX, y: middleY },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n } else {\n // ┌─────┐\n // ┌────┐ │ T ├─┐\n // ┌──┴──┐ │ └─────┘ │\n // │ S │ └─────────┘\n // └─────┘\n const middleX =\n (vertical.x +\n (vertical.width / 2) * horizontalSign +\n horizontal.x -\n (horizontal.width / 2) * horizontalSign) /\n 2;\n controls = [\n { x: verticalPosition.x, y: controlY0 },\n { x: middleX, y: controlY0 },\n { x: middleX, y: controlY1 },\n { x: defaultControlX, y: controlY1 },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n }\n }\n } else if ((horizontalPosition.y - defaultControlY) * verticalSign >= 0) {\n if ((verticalPosition.x - defaultControlX) * horizontalSign >= 0) {\n // ┌─────┐\n // ┌──┤ T │\n // │ └─────┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n controls = [{ x: verticalPosition.x, y: horizontalPosition.y }];\n } else {\n // ┌─────┐\n // │ T ├─┐\n // └─────┘ │\n // ┌─┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n const controlY0 =\n vertical.y + (vertical.height / 2 + MINIMAL_OFFSET) * verticalSign;\n const controlY1 =\n horizontal.y -\n (horizontal.height / 2 + MINIMAL_OFFSET) * verticalSign;\n const middleY = (controlY0 + controlY1) / 2;\n controls = [\n { x: verticalPosition.x, y: middleY },\n { x: defaultControlX, y: middleY },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n }\n } else {\n const sourceExtendX =\n vertical.x - (vertical.width / 2 + MINIMAL_OFFSET) * horizontalSign;\n if ((sourceExtendX - defaultControlX) * horizontalSign >= 0) {\n // ┌────┐\n // │ ┌──┴──┐\n // │ │ S │\n // ┌─────┐ │ └─────┘\n // │ T ├─┘\n // └─────┘\n const middleX = (sourceExtendX + defaultControlX) / 2;\n controls = [\n { x: verticalPosition.x, y: defaultControlY },\n { x: middleX, y: defaultControlY },\n { x: middleX, y: horizontalPosition.y },\n ];\n } else {\n // ┌────┐\n // │ ┌──┴──┐\n // │ │ S │\n // │ └─────┘\n // └───┐\n // ┌─────┐ │\n // │ T ├─┘\n // └─────┘\n const middleY =\n (vertical.y -\n (vertical.height / 2) * verticalSign +\n horizontal.y +\n (horizontal.height / 2) * verticalSign) /\n 2;\n controls = [\n { x: verticalPosition.x, y: defaultControlY },\n { x: sourceExtendX, y: defaultControlY },\n { x: sourceExtendX, y: middleY },\n { x: defaultControlX, y: middleY },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n }\n }\n } else if (sourceDirection === targetDirection) {\n // Same direction\n const sign =\n sourceDirection === \"bottom\" || sourceDirection === \"right\" ? 1 : -1;\n let start: NodeRect;\n let end: NodeRect;\n let startPosition: NodePosition;\n let endPosition: NodePosition;\n const axis = sourceIsVertical ? \"y\" : \"x\";\n const oppositeAxis = sourceIsVertical ? \"x\" : \"y\";\n if (target[axis] < source[axis]) {\n start = target;\n end = source;\n startPosition = p1;\n endPosition = p0;\n reverseControls = sign === 1;\n } else {\n start = source;\n end = target;\n startPosition = p0;\n endPosition = p1;\n reverseControls = sign !== 1;\n }\n const perpendicular =\n target[oppositeAxis] < source[oppositeAxis] ? source : target;\n let around: NodeRect;\n let nonAround: NodeRect;\n let aroundPosition: NodePosition;\n let nonAroundPosition: NodePosition;\n if (sign === 1) {\n around = end;\n nonAround = start;\n aroundPosition = endPosition;\n nonAroundPosition = startPosition;\n } else {\n around = start;\n nonAround = end;\n aroundPosition = startPosition;\n nonAroundPosition = endPosition;\n }\n const aroundSign = around === perpendicular ? 1 : -1;\n if (sourceIsVertical) {\n const defaultControlX =\n around.x - (around.width / 2 + MINIMAL_OFFSET) * aroundSign;\n const defaultControlY = aroundPosition.y + MINIMAL_OFFSET * sign;\n if ((defaultControlX - nonAroundPosition.x) * aroundSign >= 0) {\n // ┌─────────┐\n // │ ┌──┴──┐\n // │ │ T │\n // ┌──┴──┐ └─────┘\n // │ S │\n // └─────┘\n controls = [\n { x: nonAroundPosition.x, y: defaultControlY },\n { x: aroundPosition.x, y: defaultControlY },\n ];\n } else {\n // ┌────┐\n // │ ┌──┴──┐\n // │ │ T │\n // │ └─────┘\n // └─┐\n // ┌──┴──┐\n // │ S │\n // └─────┘\n const middleY =\n (nonAround.y +\n (nonAround.height / 2) * sign +\n around.y -\n (around.height / 2) * sign) /\n 2;\n controls = [\n { x: nonAroundPosition.x, y: middleY },\n { x: defaultControlX, y: middleY },\n { x: defaultControlX, y: defaultControlY },\n { x: aroundPosition.x, y: defaultControlY },\n ];\n }\n } else {\n const defaultControlX = aroundPosition.x + MINIMAL_OFFSET * sign;\n const defaultControlY =\n around.y - (around.height / 2 + MINIMAL_OFFSET) * aroundSign;\n if ((defaultControlY - nonAroundPosition.y) * aroundSign >= 0) {\n // ┌─────┐\n // ┌─────────┤ T │\n // │ ┌─────┐ └─────┘\n // └─┤ S │\n // └─────┘\n controls = [\n { x: defaultControlX, y: nonAroundPosition.y },\n { x: defaultControlX, y: aroundPosition.y },\n ];\n } else {\n // ┌─────────┐\n // │ ┌─────┐ │ ┌─────┐\n // └─┤ S │ └─┤ T │\n // └─────┘ └─────┘\n const middleX =\n (nonAround.x +\n (nonAround.width / 2) * sign +\n around.x -\n (around.width / 2) * sign) /\n 2;\n controls = [\n { x: middleX, y: nonAroundPosition.y },\n { x: middleX, y: defaultControlY },\n { x: defaultControlX, y: defaultControlY },\n { x: defaultControlX, y: aroundPosition.y },\n ];\n }\n }\n } else {\n // Opposite direction\n const targetSign =\n targetDirection === \"bottom\" || targetDirection === \"right\" ? 1 : -1;\n let axis: \"x\" | \"y\";\n let oppositeAxis: \"x\" | \"y\";\n let size: \"width\" | \"height\";\n let oppositeSize: \"width\" | \"height\";\n if (sourceIsVertical) {\n axis = \"y\";\n oppositeAxis = \"x\";\n size = \"height\";\n oppositeSize = \"width\";\n } else {\n axis = \"x\";\n oppositeAxis = \"y\";\n size = \"width\";\n oppositeSize = \"height\";\n }\n const targetEdge = target[axis] + (target[size] / 2) * targetSign;\n const sourceEdge = source[axis] - (source[size] / 2) * targetSign;\n const targetControl = targetEdge + MINIMAL_OFFSET * targetSign;\n const sourceControl = sourceEdge - MINIMAL_OFFSET * targetSign;\n const oppositeIsStraight = p0[oppositeAxis] === p1[oppositeAxis];\n if ((sourceControl - targetControl) * targetSign >= 0) {\n const middle = (sourceControl + targetControl) / 2;\n if (oppositeIsStraight) {\n // Straight line\n // ┌─────┐\n // │ T │\n // └──┬──┘\n // │\n // ┌──┴──┐\n // │ S │\n // └─────┘\n controls = [];\n } else {\n // ┌─────┐\n // │ T │\n // └──┬──┘\n // ┌───┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n controls = [\n { [oppositeAxis]: p0[oppositeAxis], [axis]: middle },\n { [oppositeAxis]: p1[oppositeAxis], [axis]: middle },\n ] as unknown[] as NodePosition[];\n }\n } else if (\n oppositeIsStraight &&\n (sourceEdge - targetEdge) * targetSign >= 0\n ) {\n // Straight line (very close)\n // ┌─────┐\n // │ T │\n // └──┬──┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n controls = [];\n } else {\n const targetOppositeSign =\n target[oppositeAxis] < source[oppositeAxis] ? -1 : 1;\n const sourceOppositeControl =\n source[oppositeAxis] +\n (source[oppositeSize] / 2 + MINIMAL_OFFSET) * targetOppositeSign;\n const targetOppositeControl =\n target[oppositeAxis] -\n (target[oppositeSize] / 2 + MINIMAL_OFFSET) * targetOppositeSign;\n if (\n (targetOppositeControl - sourceOppositeControl) * targetOppositeSign >=\n 0 ||\n Math.abs((sourceControl - targetControl) * targetSign) < MINIMAL_OFFSET\n ) {\n // ┌─────┐\n // ┌────┐ │ T │\n // ┌──┴──┐ │ └──┬──┘\n // │ S │ └────┘\n // └─────┘\n const oppositeMiddle =\n (sourceOppositeControl + targetOppositeControl) / 2;\n controls = [\n { [oppositeAxis]: p0[oppositeAxis], [axis]: sourceControl },\n { [oppositeAxis]: oppositeMiddle, [axis]: sourceControl },\n { [oppositeAxis]: oppositeMiddle, [axis]: targetControl },\n { [oppositeAxis]: p1[oppositeAxis], [axis]: targetControl },\n ] as unknown[] as NodePosition[];\n } else {\n // ┌────┐\n // ┌──┴──┐ │\n // │ S │ │\n // └─────┘ │\n // ┌─────────┘\n // │ ┌─────┐\n // │ │ T │\n // │ └──┬──┘\n // └────┘\n const middle =\n (source[axis] +\n (source[size] / 2) * targetSign +\n target[axis] -\n (target[size] / 2) * targetSign) /\n 2;\n controls = [\n { [oppositeAxis]: p0[oppositeAxis], [axis]: sourceControl },\n { [oppositeAxis]: sourceOppositeControl, [axis]: sourceControl },\n { [oppositeAxis]: sourceOppositeControl, [axis]: middle },\n { [oppositeAxis]: targetOppositeControl, [axis]: middle },\n { [oppositeAxis]: targetOppositeControl, [axis]: targetControl },\n { [oppositeAxis]: p1[oppositeAxis], [axis]: targetControl },\n ] as unknown[] as NodePosition[];\n }\n }\n }\n\n if (reverseControls) {\n controls.reverse();\n }\n\n return [p0, ...controls, p1] as NodePosition[];\n}\n\nfunction getCoordinates(\n node: NodeRect,\n direction: Direction,\n position: number\n): NodePosition {\n const { x, y, width, height } = node;\n switch (direction) {\n case \"top\":\n return {\n x: x - width / 2 + width * position,\n y: y - height / 2,\n };\n case \"bottom\":\n return {\n x: x - width / 2 + width * position,\n y: y + height / 2,\n };\n case \"left\":\n return {\n x: x - width / 2,\n y: y - height / 2 + height * position,\n };\n case \"right\":\n return {\n x: x + width / 2,\n y: y - height / 2 + height * position,\n };\n }\n}\n","import type { PositionTuple } from \"../interfaces\";\n\n// https://paulbourke.net/geometry/pointlineplane/javascript.txt\nexport function intersect(\n [x1, y1]: PositionTuple,\n [x2, y2]: PositionTuple,\n [x3, y3]: PositionTuple,\n [x4, y4]: PositionTuple\n): null | PositionTuple {\n // Check if none of the lines are of length 0\n if ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n return null;\n }\n\n const denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n\n // Lines are parallel\n if (denominator === 0) {\n return null;\n }\n\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;\n const ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator;\n\n // is the intersection along the segments\n if (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n return null;\n }\n\n // Return a object with the x and y coordinates of the intersection\n const x = x1 + ua * (x2 - x1);\n const y = y1 + ua * (y2 - y1);\n\n return [x, y];\n}\n","import {\n curveLinear,\n line,\n curveBasis,\n curveBumpX,\n curveBumpY,\n type CurveFactory,\n curveMonotoneX,\n curveNatural,\n curveMonotoneY,\n} from \"d3-shape\";\nimport type { CurveType, NodePosition } from \"../interfaces\";\nimport type { LineSegmentJumps } from \"../../draw-canvas/interfaces\";\n\n/**\n * Generate Line from points\n */\nexport function curveLine(\n points: Array<NodePosition> | null | undefined,\n curveType: CurveType | undefined,\n startOffset: number,\n endOffset: number,\n jumpsMap?: Map<number, LineSegmentJumps> | null\n): string {\n if (!Array.isArray(points)) {\n return \"\";\n }\n let curveFactory: CurveFactory;\n switch (curveType) {\n case \"curveLinear\":\n curveFactory = curveLinear;\n break;\n case \"curveBumpX\":\n curveFactory = curveBumpX;\n break;\n case \"curveBumpY\":\n curveFactory = curveBumpY;\n break;\n case \"curveMonotoneX\":\n curveFactory = curveMonotoneX;\n break;\n case \"curveMonotoneY\":\n curveFactory = curveMonotoneY;\n break;\n case \"curveNatural\":\n curveFactory = curveNatural;\n break;\n default:\n curveFactory = curveBasis;\n }\n const startOffsets = getOffsets(points[1], points[0], startOffset);\n const endOffsets = getOffsets(\n points[points.length - 2],\n points[points.length - 1],\n endOffset\n );\n const lineFunction = line<NodePosition>()\n .x(\n (d, index) =>\n d.x -\n (index === 0\n ? startOffsets.x\n : index === points.length - 1\n ? endOffsets.x\n : 0)\n )\n .y(\n (d, index) =>\n d.y -\n (index === 0\n ? startOffsets.y\n : index === points.length - 1\n ? endOffsets.y\n : 0)\n )\n .curve(curveFactory);\n\n if (jumpsMap && curveType == \"curveLinear\") {\n const d: string[] = [];\n for (let i = 0; i < points.length - 1; i++) {\n const start = points[i];\n const end = points[i + 1];\n if (i === 0) {\n d.push(`M${start.x},${start.y}`);\n }\n // 处理交叉跨线点\n const jump = jumpsMap.get(i);\n if (jump) {\n // 跨线点近似为一段半圆,参考 draw.io 使用三次贝赛尔曲线实现。\n // 一条 jump 记录中所有的 jumpPoints 都在同一线段上,因此角度一致、尺寸一致。\n const dx = end.x - start.x;\n const dy = end.y - start.y;\n const angle = Math.atan2(dy, dx);\n const direction = Math.abs(angle) <= Math.PI / 2 ? -1 : 1;\n const verticalAngle = angle + (Math.PI / 2) * direction;\n const offsetX = jump.radius * 1.3 * Math.cos(verticalAngle);\n const offsetY = jump.radius * 1.3 * Math.sin(verticalAngle);\n const xDiff = jump.radius * Math.cos(angle);\n const yDiff = jump.radius * Math.sin(angle);\n for (const p of jump.jumpPoints) {\n const x0 = p.x - xDiff;\n const y0 = p.y - yDiff;\n const x1 = p.x + xDiff;\n const y1 = p.y + yDiff;\n d.push(`L${x0},${y0}`);\n d.push(\n `C${x0 + offsetX},${y0 + offsetY} ${x1 + offsetX},${y1 + offsetY} ${x1},${y1}`\n );\n }\n }\n d.push(`L${end.x},${end.y}`);\n }\n return d.join(\"\");\n }\n\n return lineFunction(points)!;\n}\n\nfunction getOffsets(\n start: NodePosition,\n end: NodePosition,\n offset: number\n): NodePosition {\n if (!offset) {\n return { x: 0, y: 0 };\n }\n const { x: x0, y: y0 } = start;\n const { x: x1, y: y1 } = end;\n const distance = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2));\n const ratio = offset / distance;\n return {\n x: (x1 - x0) * ratio,\n y: (y1 - y0) * ratio,\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"],"names":["doTwoNodesOverlap","a","b","paddingA","paddingB","A","getNodesWithPadding","B","left","Math","min","x","width","right","max","top","y","height","bottom","node","padding","getDirectLinePoints","source","target","parallelGap","edgeView","hasExitPosition","exitPosition","hasEntryPosition","entryPosition","p0","p1","xDiff","yDiff","dx","dy","angle","atan2","cos","PI","sin","line","sourceIntersections","getIntersections","length","targetIntersections","rect","vertices","possibleLines","i","push","intersections","item","intersection","intersect","MarkerComponent","_ref","Component","id","type","strokeColor","EntityRelationZeroOrOneMarker","EntityRelationZeroOrManyMarker","CircleMarker","ArrowMarker","React","_ref2","viewBox","refX","refY","overflow","markerWidth","r","markerHeight","stroke","fill","cx","cy","_ref3","orient","strokeLinejoin","d","strokeWidth","_ref4","_ref5","MINIMAL_OFFSET","getPolyLinePoints","sourceDirection","targetDirection","sourcePosition","targetPosition","getCoordinates","controls","reverseControls","sourceIsVertical","horizontal","vertical","horizontalSign","verticalSign","horizontalPosition","verticalPosition","defaultControlX","defaultControlY","controlY0","controlY1","middleY","middleX","sourceExtendX","sign","start","end","startPosition","endPosition","axis","oppositeAxis","around","nonAround","aroundPosition","nonAroundPosition","aroundSign","targetSign","size","oppositeSize","targetEdge","sourceEdge","targetControl","sourceControl","oppositeIsStraight","middle","targetOppositeSign","sourceOppositeControl","targetOppositeControl","abs","oppositeMiddle","reverse","direction","position","x1","y1","x2","y2","x3","y3","x4","y4","denominator","ua","ub","curveLine","points","curveType","startOffset","endOffset","jumpsMap","Array","isArray","curveFactory","curveLinear","curveBumpX","curveBumpY","curveMonotoneX","curveMonotoneY","curveNatural","curveBasis","startOffsets","getOffsets","endOffsets","lineFunction","index","curve","jump","get","verticalAngle","offsetX","radius","offsetY","p","jumpPoints","x0","y0","join","offset","ratio","sqrt","pow","extractPartialRectTuple","value","v0","v1"],"sourceRoot":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see editable-label.595d319c.js.LICENSE.txt */
|
|
2
|
+
(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[2052,6006],{829:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2559);function i(e,t){return e.get((0,r.A)(e,t))}},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)}},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,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&a[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),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}},1369:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(7545);function i(e){var t=function(e){if("object"!=(0,r.A)(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=(0,r.A)(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,r.A)(t)?t:t+""}},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})},2559:(e,t,n)=>{"use strict";function r(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")}n.d(t,{A:()=>r})},2740:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(7545),i=n(6902);function o(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}var a=n(1369);function l(e,t,n,l,s,c){var u,f,h,d,p,b,g,v=Symbol.metadata||Symbol.for("Symbol.metadata"),y=Object.defineProperty,m=Object.create,A=[m(null),m(null)],w=t.length;function x(t,n,r){return function(i,o){n&&(o=i,i=e);for(var a=0;a<t.length;a++)o=t[a].apply(i,r?[o]:[]);return r?o:i}}function E(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 k(e,t,n,i,a,l,s,c,h,d,p){function b(e){if(!p(e))throw new TypeError("Attempted to access private element on non-instance")}var g=[].concat(t[0]),v=t[3],m=!s,w=1===a,k=3===a,S=4===a,C=2===a;function j(t,n,r){return function(i,o){return n&&(o=i,i=e),r&&r(i),O[t].call(i,o)}}if(!m){var O={},M=[],P=k?"get":S||w?"set":"value";if(h?(d||w?O={get:o((function(){return v(this)}),i,"get"),set:function(e){t[4](this,e)}}:O[P]=v,d||o(O[P],i,C?"":P)):d||(O=Object.getOwnPropertyDescriptor(e,i)),!d&&!h){if((f=A[+c][i])&&7!=(f^a))throw Error("Decorating two elements with the same name ("+O[P].name+") is not supported yet");A[+c][i]=a<3?1:a}}for(var T=e,z=g.length-1;z>=0;z-=n?2:1){var W=E(g[z],"A decorator","be",!0),D=n?g[z-1]:void 0,L={},R={kind:["field","accessor","method","getter","setter","class"][a],name:i,metadata:u,addInitializer:function(e,t){if(e.v)throw Error("attempted to call addInitializer after decoration was finished");E(t,"An initializer","be",!0),l.push(t)}.bind(null,L)};if(m)f=W.call(D,T,R),L.v=1,E(f,"class decorators","return")&&(T=f);else if(R.static=c,R.private=h,f=R.access={has:h?p.bind():function(e){return i in e}},S||(f.get=h?C?function(e){return b(e),O.value}:j("get",0,b):function(e){return e[i]}),C||k||(f.set=h?j("set",0,b):function(e,t){e[i]=t}),T=W.call(D,w?{get:O.get,set:O.set}:O[P],R),L.v=1,w){if("object"==(0,r.A)(T)&&T)(f=E(T.get,"accessor.get"))&&(O.get=f),(f=E(T.set,"accessor.set"))&&(O.set=f),(f=E(T.init,"accessor.init"))&&M.unshift(f);else if(void 0!==T)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else E(T,(d?"field":"method")+" decorators","return")&&(d?M.unshift(T):O[P]=T)}return a<2&&s.push(x(M,c,1),x(l,c,0)),d||m||(h?w?s.splice(-1,0,j("get",c),j("set",c)):s.push(C?O[P]:E.call.bind(O[P])):y(e,i,O)),T}function S(e){return y(e,v,{configurable:!0,enumerable:!0,value:u})}return void 0!==c&&(u=c[v]),u=m(null==u?null:u),p=[],b=function(e){e&&p.push(x(e))},g=function(t,r){for(var o=0;o<n.length;o++){var l=n[o],c=l[1],u=7&c;if((8&c)==t&&!u==r){var f=l[2],b=!!l[3],g=16&c;k(t?e:e.prototype,l,g,b?"#"+f:(0,a.A)(f),u,u<2?[]:t?d=d||[]:h=h||[],p,!!t,b,r,t&&b?function(t){return(0,i.A)(t)===e}:s)}}},g(8,0),g(0,0),g(8,1),g(0,1),b(h),b(d),f=p,w||S(e),{e:f,get c(){var n=[];return w&&[S(e=k(e,[t],l,e.name,5,n)),x(n,1)]}}}},3328:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EditableLabel:()=>I,EditableLabelComponent:()=>N,LegacyEditableLabelComponent:()=>X});var r,i=n(4635),o=n(918),a=n(6902),l=n(5536),s=n(6121),c=n(829),u=n(2740),f=n(8769),h=n.n(f),d=n(870),p=n(981),b=(n(4419),n(3373)),g=n.n(b),v=n(3971);let y,m,A,w,x,E,k,S,C,j,O,M,P,T,z,W;const{defineElement:D,property:L,event:R,method:_}=(0,d.createDecorators)(),N=(0,f.forwardRef)(X);let I;var B=new WeakMap,H=new WeakMap,K=new WeakMap,q=new WeakMap,F=new WeakSet,G=new WeakMap,J=new WeakMap,Q=new WeakMap,U=new WeakMap;class V extends p.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,F),(0,o.A)(this,B,(y(this),A(this))),(0,o.A)(this,H,(w(this),x(this))),(0,o.A)(this,K,(E(this),k(this))),(0,o.A)(this,q,(S(this),C(this))),(0,o.A)(this,G,(M(this),e=>{(0,l.A)(F,this,j).emit(e)})),(0,o.A)(this,J,P(this)),(0,o.A)(this,Q,(W(this),e=>{(0,l.A)(F,this,T).emit(e)})),(0,o.A)(this,U,(0,f.createRef)())}get label(){return(0,c.A)(B,this)}set label(e){(0,s.A)(B,this,e)}get type(){return(0,c.A)(H,this)}set type(e){(0,s.A)(H,this,e)}get readOnly(){return(0,c.A)(K,this)}set readOnly(e){(0,s.A)(K,this,e)}enableEditing(){var e;null===(e=(0,c.A)(U,this).current)||void 0===e||e.enableEditing()}render(){return h().createElement(N,{ref:(0,c.A)(U,this),label:this.label,readOnly:this.readOnly,onLabelEditingChange:(0,c.A)(G,this),onLabelChange:(0,c.A)(Q,this)})}}function X(e,t){let{label:n,readOnly:r,onLabelChange:i,onLabelEditingChange:o}=e;const a=null!=n?n:"",[l,s]=(0,f.useState)(a),[c,u]=(0,f.useState)(!1),d=(0,f.useRef)(!1),[p,b]=(0,f.useState)(!1),v=(0,f.useRef)(null);(0,f.useImperativeHandle)(t,(()=>({enableEditing(){r||u(!0)}}))),(0,f.useEffect)((()=>{s(a)}),[a]);const y=(0,f.useCallback)((e=>{r||(e.preventDefault(),e.stopPropagation(),u(!0))}),[r]);(0,f.useEffect)((()=>{var e,t;c&&(null===(e=v.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=v.current)||void 0===t||t.select())}),[c]),(0,f.useEffect)((()=>{d.current?null==o||o(c):d.current=!0}),[c,o]);const m=(0,f.useCallback)((e=>{s(e.target.value)}),[]),A=(0,f.useCallback)((e=>{e.stopPropagation();const t=e.key||e.keyCode||e.which;var n;"Enter"!==t&&13!==t||null===(n=v.current)||void 0===n||n.blur()}),[]),w=(0,f.useCallback)((()=>{u(!1),b(!0)}),[]);(0,f.useEffect)((()=>{p&&(null==i||i(l),b(!1))}),[l,i,p]);const x=(0,f.useCallback)((e=>{e.stopPropagation()}),[]);return h().createElement("div",{className:g()("label",{editing:c,empty:!l}),onDoubleClick:x,onMouseDown:x},h().createElement("input",{className:"label-input",value:l,ref:v,onChange:m,onKeyDown:A,onBlur:w,onContextMenu:x}),h().createElement("div",{className:"label-text",onDoubleClick:y},l))}r=V,({e:[A,w,x,E,k,S,C,j,O,M,P,T,z,W,y],c:[I,m]}=(0,u.A)(r,[D("diagram.editable-label",{styleTexts:[v.A]})],[[L(),1,"label"],[L({render:!1}),1,"type"],[L({type:Boolean}),1,"readOnly"],[R({type:"label.editing.change"}),1,"labelEditingChange",e=>(0,c.A)(q,e),(e,t)=>(0,s.A)(q,e,t)],[R({type:"label.change"}),1,"labelChange",e=>(0,c.A)(J,e),(e,t)=>(0,s.A)(J,e,t)],[_(),2,"enableEditing"]],0,(e=>U.has((0,a.A)(e))),p.ReactNextElement)),m()},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=a(e,o(n)))}return e}function o(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=a(t,n));return t}function a(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)}()},3971:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(6758),i=n.n(r),o=n(935),a=n.n(o)()(i());a.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;user-select:text}.label-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-user-select:none;user-select:none}.label.editing .label-text,\n.label.empty:not(.editing) .label-text,\n.label:not(.editing) .label-input{display:none}',""]);const l=a.toString()},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)}},5536:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2559);function i(e,t,n){return n((0,r.A)(e,t))}},6121:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2559);function i(e,t,n){return e.set((0,r.A)(e,t),n),n}},6758:e=>{"use strict";e.exports=function(e){return e[1]}},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}},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.595d319c.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunks/editable-label.595d319c.js","mappings":";2KACe,SAASA,EAAuBC,EAAGC,GAChD,OAAOD,EAAEE,KAAI,OAAiBF,EAAGC,GACnC,6DCFe,SAASE,EAA2BC,EAAKC,EAAYC,IAClE,OAA0BF,EAAKC,GAC/BA,EAAWE,IAAIH,EAAKE,EACtB,wBCEAE,EAAOC,QAAU,SAAUC,GACzB,IAAIC,EAAO,GA4EX,OAzEAA,EAAKC,SAAW,WACd,OAAOC,KAAKC,KAAI,SAAUC,GACxB,IAAIC,EAAU,GACVC,OAA+B,IAAZF,EAAK,GAoB5B,OAnBIA,EAAK,KACPC,GAAW,cAAcE,OAAOH,EAAK,GAAI,QAEvCA,EAAK,KACPC,GAAW,UAAUE,OAAOH,EAAK,GAAI,OAEnCE,IACFD,GA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QAAeuL,EAAwBzM,uECTxB,SAAS6G,EAA4BrH,EAAKkN,IACvD,OAA0BlN,EAAKkN,GAC/BA,EAAWC,IAAInN,EACjB,8DCHe,SAAS+H,EAAoBnI,EAAGuC,EAAGtC,GAChD,OAAOA,GAAE,OAAiBD,EAAGuC,GAC/B,8DCFe,SAASiL,EAAuBxN,EAAGC,EAAGsC,GACnD,OAAOvC,EAAEO,KAAI,OAAiBP,EAAGC,GAAIsC,GAAIA,CAC3C,yBCDA/B,EAAOC,QAAU,SAAUY,GACzB,OAAOA,EAAE,EACX,8DCHe,SAASoL,EAAYtK,GAClC,GAAIe,OAAOf,KAAOA,EAAG,MAAMK,UAAU,qDAAuD,OAASL,GAAI,OAAQA,GAAK,SACtH,OAAOA,CACT,+BCJe,SAASsL,EAAQnK,GAG9B,OAAOmK,EAAU,mBAAqBrL,QAAU,iBAAmBA,OAAOsL,SAAW,SAAUpK,GAC7F,cAAcA,CAChB,EAAI,SAAUA,GACZ,OAAOA,GAAK,mBAAqBlB,QAAUkB,EAAEkE,cAAgBpF,QAAUkB,IAAMlB,OAAO4D,UAAY,gBAAkB1C,CACpH,EAAGmK,EAAQnK,EACb","sources":["webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js","webpack:///../../node_modules/css-loader/dist/runtime/api.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/assertClassBrand.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/setFunctionName.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/applyDecs2311.js","webpack:///./src/editable-label/index.tsx","webpack:///../../node_modules/classnames/index.js","webpack:///./src/editable-label/styles.shadow.css","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateGetter.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js","webpack:///../../node_modules/css-loader/dist/runtime/noSourceMaps.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/checkInRHS.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/typeof.js"],"sourcesContent":["import assertClassBrand from \"./assertClassBrand.js\";\nexport default function _classPrivateFieldGet2(s, a) {\n return s.get(assertClassBrand(s, a));\n}","import checkPrivateRedeclaration from \"./checkPrivateRedeclaration.js\";\nexport default function _classPrivateFieldInitSpec(obj, privateMap, value) {\n checkPrivateRedeclaration(obj, privateMap);\n privateMap.set(obj, value);\n}","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","export default function _checkPrivateRedeclaration(obj, privateCollection) {\n if (privateCollection.has(obj)) {\n throw new TypeError(\"Cannot initialize the same private elements twice on an object\");\n }\n}","export default function _assertClassBrand(e, t, n) {\n if (\"function\" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;\n throw new TypeError(\"Private element is not present on this object\");\n}","import _typeof from \"./typeof.js\";\nexport default function setFunctionName(e, t, n) {\n \"symbol\" == _typeof(t) && (t = (t = t.description) ? \"[\" + t + \"]\" : \"\");\n try {\n Object.defineProperty(e, \"name\", {\n configurable: !0,\n value: n ? n + \" \" + t : t\n });\n } catch (e) {}\n return e;\n}","import _typeof from \"./typeof.js\";\nimport checkInRHS from \"./checkInRHS.js\";\nimport setFunctionName from \"./setFunctionName.js\";\nimport toPropertyKey from \"./toPropertyKey.js\";\nexport default function applyDecs2311(e, t, n, r, o, i) {\n var a,\n c,\n u,\n s,\n f,\n l,\n p,\n d = Symbol.metadata || Symbol[\"for\"](\"Symbol.metadata\"),\n m = Object.defineProperty,\n h = Object.create,\n y = [h(null), h(null)],\n v = t.length;\n function g(t, n, r) {\n return function (o, i) {\n n && (i = o, o = e);\n for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []);\n return r ? i : o;\n };\n }\n function b(e, t, n, r) {\n if (\"function\" != typeof e && (r || void 0 !== e)) throw new TypeError(t + \" must \" + (n || \"be\") + \" a function\" + (r ? \"\" : \" or undefined\"));\n return e;\n }\n function applyDec(e, t, n, r, o, i, u, s, f, l, p) {\n function d(e) {\n if (!p(e)) throw new TypeError(\"Attempted to access private element on non-instance\");\n }\n var h = [].concat(t[0]),\n v = t[3],\n w = !u,\n D = 1 === o,\n S = 3 === o,\n j = 4 === o,\n E = 2 === o;\n function I(t, n, r) {\n return function (o, i) {\n return n && (i = o, o = e), r && r(o), P[t].call(o, i);\n };\n }\n if (!w) {\n var P = {},\n k = [],\n F = S ? \"get\" : j || D ? \"set\" : \"value\";\n if (f ? (l || D ? P = {\n get: setFunctionName(function () {\n return v(this);\n }, r, \"get\"),\n set: function set(e) {\n t[4](this, e);\n }\n } : P[F] = v, l || setFunctionName(P[F], r, E ? \"\" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) {\n if ((c = y[+s][r]) && 7 != (c ^ o)) throw Error(\"Decorating two elements with the same name (\" + P[F].name + \") is not supported yet\");\n y[+s][r] = o < 3 ? 1 : o;\n }\n }\n for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) {\n var z = b(h[O], \"A decorator\", \"be\", !0),\n A = n ? h[O - 1] : void 0,\n H = {},\n K = {\n kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][o],\n name: r,\n metadata: a,\n addInitializer: function (e, t) {\n if (e.v) throw Error(\"attempted to call addInitializer after decoration was finished\");\n b(t, \"An initializer\", \"be\", !0), i.push(t);\n }.bind(null, H)\n };\n if (w) c = z.call(A, N, K), H.v = 1, b(c, \"class decorators\", \"return\") && (N = c);else if (K[\"static\"] = s, K[\"private\"] = f, c = K.access = {\n has: f ? p.bind() : function (e) {\n return r in e;\n }\n }, j || (c.get = f ? E ? function (e) {\n return d(e), P.value;\n } : I(\"get\", 0, d) : function (e) {\n return e[r];\n }), E || S || (c.set = f ? I(\"set\", 0, d) : function (e, t) {\n e[r] = t;\n }), N = z.call(A, D ? {\n get: P.get,\n set: P.set\n } : P[F], K), H.v = 1, D) {\n if (\"object\" == _typeof(N) && N) (c = b(N.get, \"accessor.get\")) && (P.get = c), (c = b(N.set, \"accessor.set\")) && (P.set = c), (c = b(N.init, \"accessor.init\")) && k.unshift(c);else if (void 0 !== N) throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\");\n } else b(N, (l ? \"field\" : \"method\") + \" decorators\", \"return\") && (l ? k.unshift(N) : P[F] = N);\n }\n return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I(\"get\", s), I(\"set\", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N;\n }\n function w(e) {\n return m(e, d, {\n configurable: !0,\n enumerable: !0,\n value: a\n });\n }\n return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function l(e) {\n e && f.push(g(e));\n }, p = function p(t, r) {\n for (var i = 0; i < n.length; i++) {\n var a = n[i],\n c = a[1],\n l = 7 & c;\n if ((8 & c) == t && !l == r) {\n var p = a[2],\n d = !!a[3],\n m = 16 & c;\n applyDec(t ? e : e.prototype, a, m, d ? \"#\" + p : toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) {\n return checkInRHS(t) === e;\n } : o);\n }\n }\n }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), {\n e: c,\n get c() {\n var n = [];\n return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)];\n }\n };\n}","import React, {\n createRef,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\nimport { EventEmitter, createDecorators } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport \"@next-core/theme\";\nimport classNames from \"classnames\";\nimport styleText from \"./styles.shadow.css\";\n\nconst { defineElement, property, event, method } = createDecorators();\n\nexport interface EditableLabelProps {\n label?: string;\n type?: LabelType;\n readOnly?: boolean;\n}\n\nexport type LabelType = \"line\" | \"default\";\n\nexport interface EditableLabelRef {\n enableEditing(): void;\n}\n\nexport const EditableLabelComponent = forwardRef(LegacyEditableLabelComponent);\n\n/**\n * 构件 `diagram.editable-label`\n */\nexport\n@defineElement(\"diagram.editable-label\", {\n styleTexts: [styleText],\n})\nclass EditableLabel extends ReactNextElement implements EditableLabelProps {\n @property()\n accessor label: string | undefined;\n\n @property({ render: false })\n accessor type: LabelType | undefined;\n\n @property({ type: Boolean })\n accessor readOnly: boolean | undefined;\n\n @event({ type: \"label.editing.change\" })\n accessor #labelEditingChange!: EventEmitter<boolean>;\n\n #handleLabelEditingChange = (value: boolean) => {\n this.#labelEditingChange.emit(value);\n };\n\n @event({ type: \"label.change\" })\n accessor #labelChange!: EventEmitter<string>;\n\n #handleLabelChange = (value: string) => {\n this.#labelChange.emit(value);\n };\n\n @method()\n enableEditing() {\n this.#editableLabelRef.current?.enableEditing();\n }\n\n #editableLabelRef = createRef<EditableLabelRef>();\n\n render() {\n return (\n <EditableLabelComponent\n ref={this.#editableLabelRef}\n label={this.label}\n readOnly={this.readOnly}\n onLabelEditingChange={this.#handleLabelEditingChange}\n onLabelChange={this.#handleLabelChange}\n />\n );\n }\n}\n\nexport interface EditableLabelComponentProps extends EditableLabelProps {\n onLabelEditingChange?(value: boolean): void;\n onLabelChange?(value: string): void;\n}\n\nexport function LegacyEditableLabelComponent(\n {\n label: _label,\n readOnly,\n onLabelChange,\n onLabelEditingChange,\n }: EditableLabelComponentProps,\n ref: React.Ref<EditableLabelRef>\n) {\n const label = _label ?? \"\";\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 labelInputRef = useRef<HTMLInputElement>(null);\n\n useImperativeHandle(ref, () => ({\n enableEditing() {\n readOnly || setEditingLabel(true);\n },\n }));\n\n useEffect(() => {\n setCurrentLabel(label);\n }, [label]);\n\n const handleEditLabel = 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 if (editingLabel) {\n // Prevent scroll when focusing.\n // Otherwise the diagram svg may be clipped in Chrome.\n labelInputRef.current?.focus({ preventScroll: true });\n labelInputRef.current?.select();\n }\n }, [editingLabel]);\n\n useEffect(() => {\n if (editingLabelInitialized.current) {\n onLabelEditingChange?.(editingLabel);\n } else {\n editingLabelInitialized.current = true;\n }\n }, [editingLabel, onLabelEditingChange]);\n\n const handleInputChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setCurrentLabel(event.target.value);\n },\n []\n );\n\n const handleInputKeydown = useCallback((event: React.KeyboardEvent) => {\n event.stopPropagation();\n const key =\n event.key ||\n /* istanbul ignore next: compatibility */ event.keyCode ||\n /* istanbul ignore next: compatibility */ event.which;\n if (key === \"Enter\" || key === 13) {\n labelInputRef.current?.blur();\n }\n }, []);\n\n const handleInputBlur = useCallback(() => {\n setEditingLabel(false);\n setShouldEmitLabelChange(true);\n }, []);\n\n useEffect(() => {\n if (shouldEmitLabelChange) {\n onLabelChange?.(currentLabel);\n setShouldEmitLabelChange(false);\n }\n }, [currentLabel, onLabelChange, shouldEmitLabelChange]);\n\n const stopPropagation = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n }, []);\n\n return (\n <div\n className={classNames(\"label\", {\n editing: editingLabel,\n empty: !currentLabel,\n })}\n onDoubleClick={stopPropagation}\n onMouseDown={stopPropagation}\n >\n <input\n className=\"label-input\"\n value={currentLabel}\n ref={labelInputRef}\n onChange={handleInputChange}\n onKeyDown={handleInputKeydown}\n onBlur={handleInputBlur}\n onContextMenu={stopPropagation}\n />\n <div className=\"label-text\" onDoubleClick={handleEditLabel}>\n {currentLabel}\n </div>\n </div>\n );\n}\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\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, `: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;user-select:text}.label-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-user-select:none;user-select:none}.label.editing .label-text,\n.label.empty:not(.editing) .label-text,\n.label:not(.editing) .label-input{display:none}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","import checkPrivateRedeclaration from \"./checkPrivateRedeclaration.js\";\nexport default function _classPrivateMethodInitSpec(obj, privateSet) {\n checkPrivateRedeclaration(obj, privateSet);\n privateSet.add(obj);\n}","import assertClassBrand from \"./assertClassBrand.js\";\nexport default function _classPrivateGetter(s, r, a) {\n return a(assertClassBrand(s, r));\n}","import assertClassBrand from \"./assertClassBrand.js\";\nexport default function _classPrivateFieldSet2(s, a, r) {\n return s.set(assertClassBrand(s, a), r), r;\n}","\"use strict\";\n\nmodule.exports = function (i) {\n return i[1];\n};","import _typeof from \"./typeof.js\";\nexport default function _checkInRHS(e) {\n if (Object(e) !== e) throw TypeError(\"right-hand side of 'in' should be an object, got \" + (null !== e ? _typeof(e) : \"null\"));\n return e;\n}","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}"],"names":["_classPrivateFieldGet2","s","a","get","_classPrivateFieldInitSpec","obj","privateMap","value","set","module","exports","cssWithMappingToString","list","toString","this","map","item","content","needLayer","concat","length","join","i","modules","media","dedupe","supports","layer","undefined","alreadyImportedModules","k","id","_k","push","toPropertyKey","t","e","Symbol","toPrimitive","call","r","TypeError","String","_checkPrivateRedeclaration","privateCollection","has","_assertClassBrand","n","arguments","setFunctionName","description","Object","defineProperty","configurable","applyDecs2311","o","c","u","f","l","p","d","metadata","m","h","create","y","v","g","apply","b","applyDec","w","D","S","j","E","I","P","F","getOwnPropertyDescriptor","Error","name","N","O","z","A","H","K","kind","addInitializer","bind","access","init","unshift","splice","enumerable","prototype","checkInRHS","defineElement","property","event","method","createDecorators","EditableLabelComponent","forwardRef","LegacyEditableLabelComponent","_EditableLabel","_A","WeakMap","_B","_C","_D","_EditableLabel_brand","WeakSet","_handleLabelEditingChange","_E","_handleLabelChange","_editableLabelRef","EditableLabel","ReactNextElement","constructor","_classPrivateMethodInitSpec","_initProto","_init_label","_init_extra_label","_init_type","_init_extra_type","_init_readOnly","_init_extra_readOnly","_init_labelEditingChange","_init_extra_labelEditingChange","_classPrivateGetter","_get_labelEditingChange","emit","_init_labelChange","_init_extra_labelChange","_get_labelChange","createRef","label","_classPrivateFieldGet","_classPrivateFieldSet","type","readOnly","enableEditing","current","render","React","ref","onLabelEditingChange","onLabelChange","_ref","_label","currentLabel","setCurrentLabel","useState","editingLabel","setEditingLabel","editingLabelInitialized","useRef","shouldEmitLabelChange","setShouldEmitLabelChange","labelInputRef","useImperativeHandle","useEffect","handleEditLabel","useCallback","preventDefault","stopPropagation","_labelInputRef$curren","_labelInputRef$curren2","focus","preventScroll","select","handleInputChange","target","handleInputKeydown","key","keyCode","which","_labelInputRef$curren3","blur","handleInputBlur","className","classNames","editing","empty","onDoubleClick","onMouseDown","onChange","onKeyDown","onBlur","onContextMenu","_EditableLabel2","_set_labelEditingChange","_set_labelChange","_initClass","_applyDecs","styleTexts","styleText","Boolean","_","_checkInRHS","hasOwn","hasOwnProperty","classes","arg","appendClass","parseValue","Array","isArray","includes","newClass","default","___CSS_LOADER_EXPORT___","privateSet","add","_classPrivateFieldSet2","_typeof","iterator"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[3039],{1508:(e,t,n)=>{n.r(t),n.d(t,{EoDiagram:()=>Xe,EoDiagramComponent:()=>Ye,LegacyEoDiagramComponent:()=>wt});var a,s=n(4635),i=n(918),o=n(6902),l=n(5536),r=n(6121),c=n(829),d=n(2740),u=n(8769),h=n.n(u),m=n(870),g=n(981),A=(n(4419),n(7566)),p=n(9047),k=n(3373),y=n.n(k),b=n(1030),f=n(9126),v=n(8892),w=n(5157),M=n(8308),E=n(1518),W=n(9137),L=n(2547),N=n(1803),R=n(3739),S=n(9191),C=n(6671),x=n(8060),T=n(2448),z=n(8657),D=n(8069),$=n(1324),B=n(821),O=n(6753),I=n(2673),H=n(5987);let P,V,_,K,Y,X,Z,q,F,G,U,j,J,Q,ee,te,ne,ae,se,ie,oe,le,re,ce,de,ue,he,me,ge,Ae,pe,ke,ye,be,fe,ve,we,Me,Ee,We,Le,Ne,Re,Se,Ce,xe,Te,ze,De,$e,Be,Oe,Ie,He;const{defineElement:Pe,property:Ve,event:_e,method:Ke}=(0,m.createDecorators)(),Ye=(0,u.forwardRef)(wt);let Xe;var Ze=new WeakMap,qe=new WeakMap,Fe=new WeakMap,Ge=new WeakMap,Ue=new WeakMap,je=new WeakMap,Je=new WeakMap,Qe=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,at=new WeakMap,st=new WeakMap,it=new WeakMap,ot=new WeakMap,lt=new WeakSet,rt=new WeakMap,ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,ht=new WeakMap,mt=new WeakMap,gt=new WeakMap,At=new WeakMap,pt=new WeakMap,kt=new WeakMap,yt=new WeakMap,bt=new WeakMap,ft=new WeakMap;class vt extends g.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,lt),(0,i.A)(this,Ze,(P(this),_(this))),(0,i.A)(this,qe,(K(this),Y(this))),(0,i.A)(this,Fe,(X(this),Z(this))),(0,i.A)(this,Ge,(q(this),F(this))),(0,i.A)(this,Ue,(G(this),U(this))),(0,i.A)(this,je,(j(this),J(this))),(0,i.A)(this,Je,(Q(this),ee(this))),(0,i.A)(this,Qe,(te(this),ne(this))),(0,i.A)(this,et,(ae(this),se(this))),(0,i.A)(this,tt,(ie(this),oe(this))),(0,i.A)(this,nt,(le(this),re(this,!0))),(0,i.A)(this,at,(ce(this),de(this,!0))),(0,i.A)(this,st,(ue(this),he(this,!0))),(0,i.A)(this,it,(me(this),ge(this))),(0,i.A)(this,ot,(Ae(this),pe(this))),(0,i.A)(this,rt,(be(this),e=>{(0,l.A)(lt,this,ke).emit(e)})),(0,i.A)(this,ct,fe(this)),(0,i.A)(this,dt,(Me(this),e=>{(0,l.A)(lt,this,ve).emit(e)})),(0,i.A)(this,ut,Ee(this)),(0,i.A)(this,ht,(Ne(this),e=>{(0,l.A)(lt,this,We).emit(e)})),(0,i.A)(this,mt,Re(this)),(0,i.A)(this,gt,(xe(this),e=>{(0,l.A)(lt,this,Se).emit(e)})),(0,i.A)(this,At,Te(this)),(0,i.A)(this,pt,($e(this),e=>{(0,l.A)(lt,this,ze).emit(e)})),(0,i.A)(this,kt,Be(this)),(0,i.A)(this,yt,(He(this),e=>{(0,l.A)(lt,this,Oe).emit(e)})),(0,i.A)(this,bt,(e=>{(0,I.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,i.A)(this,ft,(0,u.createRef)())}get layout(){return(0,c.A)(Ze,this)}set layout(e){(0,r.A)(Ze,this,e)}get nodes(){return(0,c.A)(qe,this)}set nodes(e){(0,r.A)(qe,this,e)}get edges(){return(0,c.A)(Fe,this)}set edges(e){(0,r.A)(Fe,this,e)}get nodeBricks(){return(0,c.A)(Ge,this)}set nodeBricks(e){(0,r.A)(Ge,this,e)}get lines(){return(0,c.A)(Ue,this)}set lines(e){(0,r.A)(Ue,this,e)}get layoutOptions(){return(0,c.A)(je,this)}set layoutOptions(e){(0,r.A)(je,this,e)}get activeTarget(){return(0,c.A)(Je,this)}set activeTarget(e){(0,r.A)(Je,this,e)}get disableKeyboardAction(){return(0,c.A)(Qe,this)}set disableKeyboardAction(e){(0,r.A)(Qe,this,e)}get connectNodes(){return(0,c.A)(et,this)}set connectNodes(e){(0,r.A)(et,this,e)}get dragNodes(){return(0,c.A)(tt,this)}set dragNodes(e){(0,r.A)(tt,this,e)}get zoomable(){return(0,c.A)(nt,this)}set zoomable(e){(0,r.A)(nt,this,e)}get scrollable(){return(0,c.A)(at,this)}set scrollable(e){(0,r.A)(at,this,e)}get pannable(){return(0,c.A)(st,this)}set pannable(e){(0,r.A)(st,this,e)}get scaleRange(){return(0,c.A)(it,this)}set scaleRange(e){(0,r.A)(it,this,e)}callOnLineLabel(e,t){for(var n,a=arguments.length,s=new Array(a>2?a-2:0),i=2;i<a;i++)s[i-2]=arguments[i];null===(n=(0,c.A)(ft,this).current)||void 0===n||n.callOnLineLabel(e,t,...s)}render(){return h().createElement(Ye,{ref:(0,c.A)(ft,this),layout:this.layout,nodes:this.nodes,edges:this.edges,nodeBricks:this.nodeBricks,lines:this.lines,layoutOptions:this.layoutOptions,connectNodes:this.connectNodes,dragNodes:this.dragNodes,activeTarget:this.activeTarget,disableKeyboardAction:this.disableKeyboardAction,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:(0,c.A)(rt,this),onSwitchActiveTarget:(0,c.A)(bt,this),onNodeDelete:(0,c.A)(dt,this),onEdgeDelete:(0,c.A)(ht,this),onLineClick:(0,c.A)(gt,this),onLineDoubleClick:(0,c.A)(pt,this),onNodesConnect:(0,c.A)(yt,this)})}}function wt(e,t){let{layout:n,nodes:a,edges:s,nodeBricks:i,lines:o,layoutOptions:l,connectNodes:r,dragNodes:c,activeTarget:d,disableKeyboardAction:m,zoomable:g,scrollable:k,pannable:B,scaleRange:P,onActiveTargetChange:V,onSwitchActiveTarget:_,onNodeDelete:K,onEdgeDelete:Y,onLineClick:X,onLineDoubleClick:Z,onNodesConnect:q}=e;const[F,G]=(0,u.useState)(!1),[U,j]=(0,u.useState)(0),[J,Q]=(0,u.useState)(null),[ee,te]=(0,u.useState)(!1),[ne,ae]=(0,u.useState)(0),[se,ie]=(0,u.useState)(null),[oe,le]=(0,u.useState)([]),[re,ce]=(0,u.useState)(!1),[de,ue]=(0,u.useState)({k:1,x:0,y:0}),he=(0,u.useRef)(new Map),me=(0,u.useRef)(null),ge=(0,u.useRef)(null),[Ae,pe]=(0,u.useState)(!1),{userViewReady:ke,userViewNodesMap:ye,saveUserView:be}=(0,O._)(null==c?void 0:c.save),[fe,ve]=(0,u.useState)([0,0]),[we,Me]=(0,u.useState)(null),[Ee,We]=(0,u.useState)("initial"),[Le,Ne]=(0,u.useState)(null);(0,u.useImperativeHandle)(t,(()=>({callOnLineLabel(e,t){for(var n,a=arguments.length,s=new Array(a>2?a-2:0),i=2;i<a;i++)s[i-2]=arguments[i];null==se||null===(n=se.get(e))||void 0===n||null===(n=n.firstElementChild)||void 0===n||n[t](...s)}}))),(0,u.useEffect)((()=>{const e=e=>{(0,T.P)(e,{nodes:a,nodesRefRepository:J,connectNodes:r,dragNodes:c,scale:de.k,setConnectLineState:Me,setConnectLineTo:ve,setManualLayoutStatus:We,setNodeMovement:Ne,onSwitchActiveTarget:_,onNodesConnect:q})},t=ge.current;return null==t||t.addEventListener("mousedown",e),()=>{null==t||t.removeEventListener("mousedown",e)}}),[a,r,c,de.k,J,q,_]);const{normalizedLines:Re,normalizedLinesMap:Se,markers:Ce}=(0,u.useMemo)((()=>(0,W.t)(s,o)),[s,o]),xe=(0,u.useMemo)((()=>Re.flatMap((e=>{let t,n,{line:{text:a,label:s,$id:i},edge:o}=e;return a||s?(s?(t="label",n=[].concat(s)):(t="text",n=[].concat(a)),n.map((e=>{var n;return{[t]:e,id:`${i}-${null!==(n=e.placement)&&void 0!==n?n:"center"}`,edge:o}}))):[]}))),[Re]),{nodes:Te,edges:ze}=(0,D.o)({layout:n,nodes:a,edges:s,manualLayoutStatus:Ee,userViewReady:ke,userViewNodesMap:ye,nodeMovement:Le,nodesRefRepository:J,lineLabelsRefRepository:se,normalizedLinesMap:Se,layoutOptions:l,nodesRenderId:U,lineLabelsRenderId:ne});(0,u.useEffect)((()=>{"finished"===Ee&&be(Te.map((e=>({id:e.id,x:e.x,y:e.y}))))}),[Ee]);const De=(0,u.useMemo)((()=>(0,E.R)(ze,Te,Re)),[Re,Te,ze]),$e=null!=d?d:null,[Be,Oe]=(0,u.useState)($e);(0,u.useEffect)((()=>{Oe((e=>(0,I.c)(e,$e)?e:$e))}),[$e]);const Ie=(0,u.useRef)(!1);(0,u.useEffect)((()=>{Ie.current?null==V||V(Be):Ie.current=!0}),[Be,V]),(0,u.useEffect)((()=>{const e=me.current;if(!e||m)return;const t=e=>{const t=(0,w.a)(e,{renderedNodes:Te,activeTarget:Be});"delete-node"===(null==t?void 0:t.action)?null==K||K(t.node):"delete-edge"===(null==t?void 0:t.action)?null==Y||Y(t.edge):"switch-active-node"===(null==t?void 0:t.action)&&t.node&&(null==_||_({type:"node",nodeId:t.node.id}))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[Be,Te,m,_,K,Y]);const He=(0,u.useCallback)((e=>{e&&(j((e=>e+1)),Q(e)),G((t=>t||!!e))}),[]),Pe=(0,u.useCallback)((e=>{e&&(ae((e=>e+1)),ie(e)),te((t=>t||!!e))}),[]),Ve=(0,u.useMemo)((()=>null!=P?P:[z.sS,z.Yt]),[P]),_e=(0,u.useMemo)((()=>(0,p.s_)()),[]);(0,u.useEffect)((()=>{let e=!1;_e.scaleExtent(g?Ve:[1,1]).on("start",(()=>{e=!1,ce(!0)})).on("zoom",(t=>{e=!0,ue(t.transform)})).on("end",(()=>{ce(!1),e||null==_||_(null)}))}),[_,Ve,g,_e]),(0,u.useEffect)((()=>{const e=me.current;if(!e)return;const t=(0,A.A)(e),n=()=>{t.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(g||k||B)return(g||k)&&t.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),k&&(e.preventDefault(),_e.translateBy(t,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),t.call(_e).on("wheel",(e=>e.preventDefault())).on("dblclick.zoom",null),B||t.on("mousedown.zoom",null).on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),n;n()}),[B,k,g,_e]),(0,u.useEffect)((()=>{const e=me.current;if(0===Te.length||!e||Ae)return;const{k:t,x:n,y:a}=(0,M.r)(Te,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:g?Ve:void 0});_e.transform((0,A.A)(e),new p.uV(t,n,a)),pe(!0)}),[Ae,Te,Ve,g,_e]);const Ke=(0,u.useMemo)((()=>`${(0,b.uniqueId)("diagram-")}-`),[]),Ye=`${Ke}line-arrow-`,Xe=`${Ke}mask-`,Ze=`${Ke}active-line-`;(0,u.useEffect)((()=>{le((e=>(0,x.z)(e,De,he.current)))}),[De]);const[qe,Fe]=h().useState(new Map);return(0,u.useEffect)((()=>{if(!se)return;(0,$.F)(oe,se);const e=new f.A((()=>{Fe((0,H.G)(oe,se))}));for(const t of se.values())e.observe(t);return()=>{e.disconnect()}}),[ne,se,oe]),"dagre"!==n&&"force"!==n?h().createElement("div",null,`Diagram layout not supported: "${n}"`):h().createElement("div",{className:y()("diagram",{ready:F&&Ae,grabbing:re,pannable:B}),tabIndex:-1,ref:me},h().createElement("svg",{width:"100%",height:"100%",className:"lines"},h().createElement("defs",null,Ce.map(((e,t)=>{let{type:n,strokeColor:a}=e;return h().createElement(R.c,{key:t,id:`${Ye}${t}`,type:n,strokeColor:a})})),[...qe].map((e=>{let[t,n]=e;return h().createElement(S.y,{key:t,lineId:t,rects:n,maskPrefix:Xe,renderedLineLabels:oe})})),h().createElement("marker",{id:`${Ze}start`,viewBox:"0 0 8 8",refX:4,refY:4,markerWidth:8,markerHeight:8,orient:"auto"},h().createElement("path",{d:"M 0.5 0.5 H 7.5 V 7.5 H 0.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"})),h().createElement("marker",{id:`${Ze}end`,viewBox:"0 0 14 8",refX:3,refY:4,markerWidth:14,markerHeight:8,orient:"auto"},h().createElement("path",{d:"M 0.5 1.5 L 5.5 4 L 0.5 6.5 z",stroke:"var(--palette-blue-3)",strokeWidth:1,fill:"var(--palette-blue-3)"}),h().createElement("path",{d:"M 6.5 0.5 H 13.5 V 7.5 H 6.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"}))),h().createElement("g",{transform:`translate(${de.x} ${de.y}) scale(${de.k})`},De.map((e=>h().createElement(N.m,{key:e.line.$id,line:e,linePaths:he.current,lineMaskRects:qe,maskPrefix:Xe,markerPrefix:Ye,activeLineMarkerPrefix:Ze,active:"edge"===(null==Be?void 0:Be.type)&&Be.edge.source===e.edge.source&&Be.edge.target===e.edge.target,activeRelated:"node"===(null==Be?void 0:Be.type)&&(e.edge.source===Be.nodeId||e.edge.target===Be.nodeId),onLineClick:X,onLineDoubleClick:Z}))))),h().createElement("div",{className:y()("line-labels",{ready:ee}),style:{left:de.x,top:de.y,transform:`scale(${de.k})`}},h().createElement(L.d2,{labels:xe,onRendered:Pe})),h().createElement("div",{className:"nodes",ref:ge,style:{left:de.x,top:de.y,transform:`scale(${de.k})`}},h().createElement(v.p,{nodes:a,nodeBricks:i,onRendered:He})),h().createElement(C.w,{connectLineState:we,connectLineTo:fe,markerPrefix:Ye}))}a=vt,({e:[_,K,Y,X,Z,q,F,G,U,j,J,Q,ee,te,ne,ae,se,ie,oe,le,re,ce,de,ue,he,me,ge,Ae,pe,ke,ye,be,fe,ve,we,Me,Ee,We,Le,Ne,Re,Se,Ce,xe,Te,ze,De,$e,Be,Oe,Ie,He,P],c:[Xe,V]}=(0,d.A)(a,[Pe("eo-diagram",{styleTexts:[B.A]})],[[Ve({type:String}),1,"layout"],[Ve({attribute:!1}),1,"nodes"],[Ve({attribute:!1}),1,"edges"],[Ve({attribute:!1}),1,"nodeBricks"],[Ve({attribute:!1}),1,"lines"],[Ve({attribute:!1}),1,"layoutOptions"],[Ve({attribute:!1}),1,"activeTarget"],[Ve({type:Boolean}),1,"disableKeyboardAction"],[Ve({attribute:!1}),1,"connectNodes"],[Ve({attribute:!1}),1,"dragNodes"],[Ve({type:Boolean}),1,"zoomable"],[Ve({type:Boolean}),1,"scrollable"],[Ve({type:Boolean}),1,"pannable"],[Ve({attribute:!1}),1,"scaleRange"],[_e({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,c.A)(ot,e),(e,t)=>(0,r.A)(ot,e,t)],[_e({type:"node.delete"}),1,"nodeDelete",e=>(0,c.A)(ct,e),(e,t)=>(0,r.A)(ct,e,t)],[_e({type:"edge.delete"}),1,"edgeDelete",e=>(0,c.A)(ut,e),(e,t)=>(0,r.A)(ut,e,t)],[_e({type:"line.click"}),1,"lineClick",e=>(0,c.A)(mt,e),(e,t)=>(0,r.A)(mt,e,t)],[_e({type:"line.dblclick"}),1,"lineDoubleClick",e=>(0,c.A)(At,e),(e,t)=>(0,r.A)(At,e,t)],[_e({type:"nodes.connect"}),1,"connectNodes",e=>(0,c.A)(kt,e),(e,t)=>(0,r.A)(kt,e,t)],[Ke(),2,"callOnLineLabel"]],0,(e=>ft.has((0,o.A)(e))),g.ReactNextElement)),V()}}]);
|
|
2
|
+
//# sourceMappingURL=eo-diagram.ccbb3f33.js.map
|