@mx-sose-front/mx-sose-graph 1.2.7 → 1.2.9

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.
Files changed (154) hide show
  1. package/dist/index.d.ts +3 -5259
  2. package/dist/index.esm.js +88 -61
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.umd.js +1 -1
  5. package/dist/index.umd.js.map +1 -1
  6. package/dist/src/components/Common/index.d.ts +3 -0
  7. package/dist/src/components/Common/index.d.ts.map +1 -0
  8. package/dist/src/components/ContextMenu/ContextMenu.vue.d.ts +55 -0
  9. package/dist/src/components/ContextMenu/ContextMenu.vue.d.ts.map +1 -0
  10. package/dist/src/components/Diagram/StrategicTaxonomyDiagram.vue.d.ts +21 -0
  11. package/dist/src/components/Diagram/StrategicTaxonomyDiagram.vue.d.ts.map +1 -0
  12. package/dist/src/components/DiagramListTooltip/DiagramListTooltip.vue.d.ts +32 -0
  13. package/dist/src/components/DiagramListTooltip/DiagramListTooltip.vue.d.ts.map +1 -0
  14. package/dist/src/components/Edge/Edge.vue.d.ts +36 -0
  15. package/dist/src/components/Edge/Edge.vue.d.ts.map +1 -0
  16. package/dist/src/components/Gantt/Gantt.vue.d.ts +17 -0
  17. package/dist/src/components/Gantt/Gantt.vue.d.ts.map +1 -0
  18. package/dist/src/components/GanttContextMenu/GanttContextMenu.vue.d.ts +37 -0
  19. package/dist/src/components/GanttContextMenu/GanttContextMenu.vue.d.ts.map +1 -0
  20. package/dist/src/components/InteractionLayer.vue.d.ts +28 -0
  21. package/dist/src/components/InteractionLayer.vue.d.ts.map +1 -0
  22. package/dist/src/components/LineStyle/ConnectionLine.vue.d.ts +30 -0
  23. package/dist/src/components/LineStyle/ConnectionLine.vue.d.ts.map +1 -0
  24. package/dist/src/components/LineStyle/LineStyleMarker.vue.d.ts +15 -0
  25. package/dist/src/components/LineStyle/LineStyleMarker.vue.d.ts.map +1 -0
  26. package/dist/src/components/Matrix/Matrix.vue.d.ts +9 -0
  27. package/dist/src/components/Matrix/Matrix.vue.d.ts.map +1 -0
  28. package/dist/src/components/Matrix/index.d.ts +34 -0
  29. package/dist/src/components/Matrix/index.d.ts.map +1 -0
  30. package/dist/src/components/MatrixContextMenu/MatrixContextMenu.vue.d.ts +31 -0
  31. package/dist/src/components/MatrixContextMenu/MatrixContextMenu.vue.d.ts.map +1 -0
  32. package/dist/src/components/NameEditor/NameEditor.vue.d.ts +30 -0
  33. package/dist/src/components/NameEditor/NameEditor.vue.d.ts.map +1 -0
  34. package/dist/src/components/Pin/Pin.vue.d.ts +25 -0
  35. package/dist/src/components/Pin/Pin.vue.d.ts.map +1 -0
  36. package/dist/src/components/Pin/Port.vue.d.ts +23 -0
  37. package/dist/src/components/Pin/Port.vue.d.ts.map +1 -0
  38. package/dist/src/components/SelectionBox/SelectionBox.vue.d.ts +30 -0
  39. package/dist/src/components/SelectionBox/SelectionBox.vue.d.ts.map +1 -0
  40. package/dist/src/components/Shape/Action.vue.d.ts +25 -0
  41. package/dist/src/components/Shape/Action.vue.d.ts.map +1 -0
  42. package/dist/src/components/Shape/ActivityAction.vue.d.ts +25 -0
  43. package/dist/src/components/Shape/ActivityAction.vue.d.ts.map +1 -0
  44. package/dist/src/components/Shape/Block.vue.d.ts +25 -0
  45. package/dist/src/components/Shape/Block.vue.d.ts.map +1 -0
  46. package/dist/src/components/Shape/ConceptualRole.vue.d.ts +25 -0
  47. package/dist/src/components/Shape/ConceptualRole.vue.d.ts.map +1 -0
  48. package/dist/src/components/Shape/Diagram.vue.d.ts +25 -0
  49. package/dist/src/components/Shape/Diagram.vue.d.ts.map +1 -0
  50. package/dist/src/components/Shape/DividingLine.vue.d.ts +36 -0
  51. package/dist/src/components/Shape/DividingLine.vue.d.ts.map +1 -0
  52. package/dist/src/components/Shape/DogEar.vue.d.ts +25 -0
  53. package/dist/src/components/Shape/DogEar.vue.d.ts.map +1 -0
  54. package/dist/src/components/Shape/Package.vue.d.ts +25 -0
  55. package/dist/src/components/Shape/Package.vue.d.ts.map +1 -0
  56. package/dist/src/components/Table/Table.vue.d.ts +20 -0
  57. package/dist/src/components/Table/Table.vue.d.ts.map +1 -0
  58. package/dist/src/constants/edgeShapeKeys.d.ts +46 -0
  59. package/dist/src/constants/edgeShapeKeys.d.ts.map +1 -0
  60. package/dist/src/constants/index.d.ts +668 -0
  61. package/dist/src/constants/index.d.ts.map +1 -0
  62. package/dist/src/hooks/index.d.ts +6 -0
  63. package/dist/src/hooks/index.d.ts.map +1 -0
  64. package/dist/src/hooks/useChartRowSelection.d.ts +89 -0
  65. package/dist/src/hooks/useChartRowSelection.d.ts.map +1 -0
  66. package/dist/src/hooks/useHighlight.d.ts +82 -0
  67. package/dist/src/hooks/useHighlight.d.ts.map +1 -0
  68. package/dist/src/hooks/useNameEdit.d.ts +76 -0
  69. package/dist/src/hooks/useNameEdit.d.ts.map +1 -0
  70. package/dist/src/hooks/useResize.d.ts +65 -0
  71. package/dist/src/hooks/useResize.d.ts.map +1 -0
  72. package/dist/src/hooks/useVirtualScroll.d.ts +110 -0
  73. package/dist/src/hooks/useVirtualScroll.d.ts.map +1 -0
  74. package/dist/src/index.d.ts +18 -0
  75. package/dist/src/index.d.ts.map +1 -0
  76. package/dist/src/render/shape-registry.d.ts +9 -0
  77. package/dist/src/render/shape-registry.d.ts.map +1 -0
  78. package/dist/src/render/shape-renderer.d.ts +12 -0
  79. package/dist/src/render/shape-renderer.d.ts.map +1 -0
  80. package/dist/src/store/eventBus.d.ts +10 -0
  81. package/dist/src/store/eventBus.d.ts.map +1 -0
  82. package/dist/src/store/graphStore.d.ts +4644 -0
  83. package/dist/src/store/graphStore.d.ts.map +1 -0
  84. package/dist/src/store/index.d.ts +3 -0
  85. package/dist/src/store/index.d.ts.map +1 -0
  86. package/dist/src/types/index.d.ts +279 -0
  87. package/dist/src/types/index.d.ts.map +1 -0
  88. package/dist/src/types/interactionLayer.d.ts +23 -0
  89. package/dist/src/types/interactionLayer.d.ts.map +1 -0
  90. package/dist/src/utils/autoExpandParent.d.ts +38 -0
  91. package/dist/src/utils/autoExpandParent.d.ts.map +1 -0
  92. package/dist/src/utils/batchAutoExpand.d.ts +12 -0
  93. package/dist/src/utils/batchAutoExpand.d.ts.map +1 -0
  94. package/dist/src/utils/colorUtils.d.ts +38 -0
  95. package/dist/src/utils/colorUtils.d.ts.map +1 -0
  96. package/dist/src/utils/compartment.d.ts +92 -0
  97. package/dist/src/utils/compartment.d.ts.map +1 -0
  98. package/dist/src/utils/containers.d.ts +119 -0
  99. package/dist/src/utils/containers.d.ts.map +1 -0
  100. package/dist/src/utils/contextMenuUtils.d.ts +108 -0
  101. package/dist/src/utils/contextMenuUtils.d.ts.map +1 -0
  102. package/dist/src/utils/dateUtils.d.ts +77 -0
  103. package/dist/src/utils/dateUtils.d.ts.map +1 -0
  104. package/dist/src/utils/diagram.d.ts +289 -0
  105. package/dist/src/utils/diagram.d.ts.map +1 -0
  106. package/dist/src/utils/dom.d.ts +2 -0
  107. package/dist/src/utils/dom.d.ts.map +1 -0
  108. package/dist/src/utils/drag.d.ts +65 -0
  109. package/dist/src/utils/drag.d.ts.map +1 -0
  110. package/dist/src/utils/edgeUtils.d.ts +326 -0
  111. package/dist/src/utils/edgeUtils.d.ts.map +1 -0
  112. package/dist/src/utils/edgeWorker.d.ts +182 -0
  113. package/dist/src/utils/edgeWorker.d.ts.map +1 -0
  114. package/dist/src/utils/geom.d.ts +103 -0
  115. package/dist/src/utils/geom.d.ts.map +1 -0
  116. package/dist/src/utils/graphDragService.d.ts +62 -0
  117. package/dist/src/utils/graphDragService.d.ts.map +1 -0
  118. package/dist/src/utils/hittest.d.ts +27 -0
  119. package/dist/src/utils/hittest.d.ts.map +1 -0
  120. package/dist/src/utils/iconLoader.d.ts +16 -0
  121. package/dist/src/utils/iconLoader.d.ts.map +1 -0
  122. package/dist/src/utils/index.d.ts +8 -0
  123. package/dist/src/utils/index.d.ts.map +1 -0
  124. package/dist/src/utils/keyboardUtils.d.ts +25 -0
  125. package/dist/src/utils/keyboardUtils.d.ts.map +1 -0
  126. package/dist/src/utils/license-guard.d.ts +10 -0
  127. package/dist/src/utils/license-guard.d.ts.map +1 -0
  128. package/dist/src/utils/packageOutline.d.ts +32 -0
  129. package/dist/src/utils/packageOutline.d.ts.map +1 -0
  130. package/dist/src/utils/pinUtils.d.ts +79 -0
  131. package/dist/src/utils/pinUtils.d.ts.map +1 -0
  132. package/dist/src/utils/policy.d.ts +44 -0
  133. package/dist/src/utils/policy.d.ts.map +1 -0
  134. package/dist/src/utils/rafThrottle.d.ts +63 -0
  135. package/dist/src/utils/rafThrottle.d.ts.map +1 -0
  136. package/dist/src/utils/shapeOps/shapeOps.d.ts +21 -0
  137. package/dist/src/utils/shapeOps/shapeOps.d.ts.map +1 -0
  138. package/dist/src/utils/viewportCulling.d.ts +73 -0
  139. package/dist/src/utils/viewportCulling.d.ts.map +1 -0
  140. package/dist/src/utils/workerManager.d.ts +86 -0
  141. package/dist/src/utils/workerManager.d.ts.map +1 -0
  142. package/dist/src/utils/zorder.d.ts +4 -0
  143. package/dist/src/utils/zorder.d.ts.map +1 -0
  144. package/dist/src/view/graph.vue.d.ts +180 -0
  145. package/dist/src/view/graph.vue.d.ts.map +1 -0
  146. package/dist/style.css +1 -1
  147. package/package.json +1 -1
  148. package/src/components/ContextMenu/ContextMenu.vue +2 -2
  149. package/src/store/graphStore.ts +0 -4
  150. package/src/utils/edgeUtils.ts +77 -63
  151. package/src/utils/workerManager.ts +4 -1
  152. package/src/view/graph.vue +2 -2
  153. package/src/vite-env.d.ts +2 -2
  154. package/dist/assets/edgeWorker-b57ca007.js +0 -2
@@ -1,5 +1,6 @@
1
1
  // workerManager.ts - Web Worker manager for handling edge calculations
2
2
 
3
+ import EdgeWorker from './edgeWorker?worker&inline';
3
4
  import type { Shape } from '../types';
4
5
 
5
6
  interface WorkerMessage {
@@ -46,7 +47,9 @@ export class WorkerManager {
46
47
 
47
48
  this.initializationPromise = new Promise((resolve, reject) => {
48
49
  try {
49
- this.worker = new Worker(new URL('./edgeWorker.ts', import.meta.url), { type: 'module' });
50
+ // Inline the worker so consumers do not depend on a separate emitted
51
+ // asset path, which is fragile under Electron file:// packaging.
52
+ this.worker = new EdgeWorker();
50
53
 
51
54
  this.worker.addEventListener('message', (event: MessageEvent<WorkerResponse>) => {
52
55
  this.handleWorkerMessage(event.data);
@@ -123,7 +123,7 @@ const emit = defineEmits<{
123
123
  (e: 'shapes-property', value: { selectedShape: Shape, showPropertyPanel: boolean }): void
124
124
  (e: 'shapes-edit-name', value: { shape: Shape, newName: string, oldName: string }): void
125
125
  (e: 'connect-end', value: { sourceId: string, targetId: string, sourcePoint: { x: number, y: number }, targetPoint: { x: number, y: number }, waypoints: Array<{ x: number, y: number }> }): void
126
- (e: 'object-flow-connect-end', value: { connectionData: { sourceId: string; targetId: string; sourcePoint: { x: number; y: number }; targetPoint: { x: number; y: number }; waypoints: Array<{ x: number; y: number }> }, outputPinBounds: { x: number; y: number; width: number; height: number }, inputPinBounds: { x: number; y: number; width: number; height: number } }): void
126
+ (e: 'object-flow-connect-end', value: { connectionData: { sourceId: string; targetId: string; sourcePoint: { x: number; y: number }; targetPoint: { x: number; y: number }; waypoints: Array<{ x: number; y: number }> }, outputPinBounds: { x: number; y: number; width: number; height: number } | null, inputPinBounds: { x: number; y: number; width: number; height: number } | null }): void
127
127
  (e: 'action-button-click', value: string, shape: Shape): void
128
128
  (e: 'diagramDoubleClick', data: any): void
129
129
  (e: 'model-type-property-id-button-click', value: string, shape: Shape): void
@@ -288,7 +288,7 @@ const handleConnectEnd = (connectionData: { sourceId: string; targetId: string;
288
288
  console.log('连接结束事件已传递给父组件:', connectionData);
289
289
  }
290
290
 
291
- const handleObjectFlowConnectEnd = (connectionData: { connectionData: { sourceId: string; targetId: string; sourcePoint: { x: number; y: number }; targetPoint: { x: number; y: number }; waypoints: Array<{ x: number; y: number }> }, outputPinBounds: { x: number; y: number; width: number; height: number }, inputPinBounds: { x: number; y: number; width: number; height: number } }) => {
291
+ const handleObjectFlowConnectEnd = (connectionData: { connectionData: { sourceId: string; targetId: string; sourcePoint: { x: number; y: number }; targetPoint: { x: number; y: number }; waypoints: Array<{ x: number; y: number }> }, outputPinBounds: { x: number; y: number; width: number; height: number } | null, inputPinBounds: { x: number; y: number; width: number; height: number } | null }) => {
292
292
  emit('object-flow-connect-end', connectionData);
293
293
  }
294
294
 
package/src/vite-env.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // / <reference types="vite/client" />
1
+ /// <reference types="vite/client" />
2
2
 
3
3
  interface ImportMetaEnv {
4
4
  readonly VITE_API_BASE_URL: string
@@ -30,4 +30,4 @@ declare global {
30
30
  }
31
31
  }
32
32
 
33
- declare module 'lodash'
33
+ declare module 'lodash'
@@ -1,2 +0,0 @@
1
- !function(){"use strict";class t{static getShapeCenterPoints(t){const{x:e,y:s,width:n,height:o}=t;return{top:{x:e+n/2,y:s},bottom:{x:e+n/2,y:s+o},left:{x:e,y:s+o/2},right:{x:e+n,y:s+o/2}}}static getDistance(t,e){const s=t.x-e.x,n=t.y-e.y;return Math.sqrt(s*s+n*n)}static buildSelfLoopWaypoints(t,e=0){const{x:s,y:n,width:o,height:i}=t,a=s+o/2,d={x:a,y:n},r={x:a,y:n+i},c=Math.max(.24*o,20)+12*e,u=Math.max(.45*i,26)+10*e;return{sourcePoint:d,targetPoint:r,waypoints:[d,{x:a,y:n-u},{x:s+o+c,y:n-u},{x:s+o+c,y:n+i+u},{x:a,y:n+i+u},r]}}static buildEdgeWaypoints(t,e,s,n){if(n)return this.buildSelfLoopWaypoints(t,s);const{sourcePoint:o,targetPoint:i}=this.calcBestEndpoints(t,e,s);return{sourcePoint:o,targetPoint:i,waypoints:[o,i]}}static calcBestEndpoints(t,e,s){const n=this.getShapeCenterPoints(t),o=this.getShapeCenterPoints(e);let i=1/0,a=n.top,d=o.top;for(const r of Object.values(n))for(const t of Object.values(o)){const e=this.getDistance(r,t);e<i&&(i=e,a=r,d=t)}if(s>0){const n=e.x+e.width/2-(t.x+t.width/2),o=e.y+e.height/2-(t.y+t.height/2),i=5*(s+1);let r=0,c=0;return Math.abs(n)>Math.abs(o)?c=i:r=i,s%2==1&&(r=-r,c=-c),{sourcePoint:{x:a.x+r,y:a.y+c},targetPoint:{x:d.x+r,y:d.y+c}}}return{sourcePoint:a,targetPoint:d}}static updateRelatedEdges(t,e,s,n){let o;if(s){const t=new Set;o=[];for(const n of e){const e=s.get(n);if(e)for(const s of e)t.has(s.id)||(t.add(s.id),o.push(s))}}else o=t.filter(t=>"edge"===t.shapeType);const i=n?t=>n.get(t)??null:e=>t.find(t=>t.id===e)??null,a=new Map;o.forEach(t=>{if(t.sourceId&&t.targetId){const e=t.sourceId.localeCompare(t.targetId)<=0?`${t.sourceId}-${t.targetId}`:`${t.targetId}-${t.sourceId}`;a.has(e)||a.set(e,[]),a.get(e).push(t)}});const d=new Set(e),r=[];return a.forEach(t=>{t.forEach((e,s)=>{const n=e.sourceId&&d.has(e.sourceId),o=e.targetId&&d.has(e.targetId);if(n||o){const n=e.sourceId?i(e.sourceId):null,o=e.targetId?i(e.targetId):null;if(n&&o&&n.bounds&&o.bounds){const i=t.length>1?s:0,{waypoints:a}=this.buildEdgeWaypoints(n.bounds,o.bounds,i,n.id===o.id);r.push({...e,waypointId:JSON.stringify(a)})}}})}),r}static initializeAllEdgeEndpoints(t,e){const s=t.filter(t=>"edge"===t.shapeType),n=e?t=>e.get(t)??null:e=>t.find(t=>t.id===e)??null,o=new Map;s.forEach(t=>{if(t.sourceId&&t.targetId){const e=t.sourceId.localeCompare(t.targetId)<=0?`${t.sourceId}-${t.targetId}`:`${t.targetId}-${t.sourceId}`;o.has(e)||o.set(e,[]),o.get(e).push(t)}});const i=[];return o.forEach(t=>{t.forEach((e,s)=>{const o=e.sourceId?n(e.sourceId):null,a=e.targetId?n(e.targetId):null;if(o&&a&&o.bounds&&a.bounds){const n=t.length>1?s:0,{waypoints:d}=this.buildEdgeWaypoints(o.bounds,a.bounds,n,o.id===a.id);i.push({...e,waypointId:JSON.stringify(d)})}})}),i}static completeConnection(t,e,s,n,o=[]){if(!e.bounds||!t?.bounds)return null;const i=o.filter(s=>"edge"===s.shapeType&&(s.sourceId===t?.id&&s.targetId===e.id||s.sourceId===e.id&&s.targetId===t?.id)).length,{sourcePoint:a,targetPoint:d,waypoints:r}=this.buildEdgeWaypoints(t.bounds,e.bounds,i,t.id===e.id);return{sourceId:t?.id,sourceModelId:t?.modelId,targetId:e.id,targetModelId:e.modelId,sourcePoint:a,targetPoint:d,waypoints:r}}static findNearestConnectPoint(t,e){if(!e?.bounds)return null;const s=t.x,n=t.y,{x:o=0,y:i=0,width:a=0,height:d=0}=e.bounds,r=o,c=o+a,u=i,h=i+d,g=s-o,l=n-i,p=l<0,y=l>d,f=g<0,b=g>a,I=this.getShapeCenterPoints({x:e.bounds.x??0,y:e.bounds.y??0,width:e.bounds.width??0,height:e.bounds.height??0}),x={x:s,y:n};if(p||y||f||b){const t={top:this.getDistance(x,I.top),bottom:this.getDistance(x,I.bottom),left:this.getDistance(x,I.left),right:this.getDistance(x,I.right)};return I[Object.entries(t).reduce((t,[e,s])=>s<t.distance?{key:e,distance:s}:t,{key:"top",distance:1/0}).key]}const w={top:Math.abs(n-u),bottom:Math.abs(n-h),left:Math.abs(s-r),right:Math.abs(s-c)};switch(Object.entries(w).reduce((t,[e,s])=>s<t.distance?{key:e,distance:s}:t,{key:"top",distance:1/0}).key){case"top":return{x:s,y:u};case"bottom":return{x:s,y:h};case"left":return{x:r,y:n};case"right":return{x:c,y:n};default:return I.top}}}self.addEventListener("message",e=>{const{type:s,data:n,id:o}=e.data;try{let e;switch(s){case"updateRelatedEdges":{const{shapes:s,changedIds:o,edgeIndex:i,shapeMapIndex:a}=n,d=i?new Map(Object.entries(i)):void 0,r=a?new Map(Object.entries(a)):void 0;e=t.updateRelatedEdges(s,o,d,r);break}case"initializeAllEdgeEndpoints":{const{shapes:s,shapeMapIndex:o}=n,i=o?new Map(Object.entries(o)):void 0;e=t.initializeAllEdgeEndpoints(s,i);break}case"completeConnection":e=t.completeConnection(n.sourceShape,n.targetShape,n.clickPoint,n.currentConnectPoint,n.shapes);break;case"findNearestConnectPoint":e=t.findNearestConnectPoint(n.mousePos,n.shape);break;default:throw new Error(`Unknown message type: ${s}`)}self.postMessage({id:o,result:e})}catch(i){self.postMessage({id:o,error:i instanceof Error?i.message:String(i)})}})}();
2
- //# sourceMappingURL=edgeWorker-b57ca007.js.map