@angflow/angular 0.0.10 → 0.0.12

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 (54) hide show
  1. package/dist/esm/lib/components/connection-line/connection-line.component.d.ts.map +1 -1
  2. package/dist/esm/lib/components/connection-line/connection-line.component.js +47 -39
  3. package/dist/esm/lib/components/connection-line/connection-line.component.js.map +1 -1
  4. package/dist/esm/lib/components/edges/bezier-edge.component.d.ts +4 -2
  5. package/dist/esm/lib/components/edges/bezier-edge.component.d.ts.map +1 -1
  6. package/dist/esm/lib/components/edges/bezier-edge.component.js +17 -15
  7. package/dist/esm/lib/components/edges/bezier-edge.component.js.map +1 -1
  8. package/dist/esm/lib/components/edges/simple-bezier-edge.component.d.ts +4 -2
  9. package/dist/esm/lib/components/edges/simple-bezier-edge.component.d.ts.map +1 -1
  10. package/dist/esm/lib/components/edges/simple-bezier-edge.component.js +17 -15
  11. package/dist/esm/lib/components/edges/simple-bezier-edge.component.js.map +1 -1
  12. package/dist/esm/lib/components/edges/smooth-step-edge.component.d.ts +4 -2
  13. package/dist/esm/lib/components/edges/smooth-step-edge.component.d.ts.map +1 -1
  14. package/dist/esm/lib/components/edges/smooth-step-edge.component.js +17 -15
  15. package/dist/esm/lib/components/edges/smooth-step-edge.component.js.map +1 -1
  16. package/dist/esm/lib/components/edges/step-edge.component.d.ts +4 -2
  17. package/dist/esm/lib/components/edges/step-edge.component.d.ts.map +1 -1
  18. package/dist/esm/lib/components/edges/step-edge.component.js +17 -15
  19. package/dist/esm/lib/components/edges/step-edge.component.js.map +1 -1
  20. package/dist/esm/lib/components/edges/straight-edge.component.d.ts +4 -1
  21. package/dist/esm/lib/components/edges/straight-edge.component.d.ts.map +1 -1
  22. package/dist/esm/lib/components/edges/straight-edge.component.js +17 -15
  23. package/dist/esm/lib/components/edges/straight-edge.component.js.map +1 -1
  24. package/dist/esm/lib/components/handle/handle.component.d.ts +3 -1
  25. package/dist/esm/lib/components/handle/handle.component.d.ts.map +1 -1
  26. package/dist/esm/lib/components/handle/handle.component.js +18 -4
  27. package/dist/esm/lib/components/handle/handle.component.js.map +1 -1
  28. package/dist/esm/lib/components/handle-group/handle-group.component.d.ts +27 -0
  29. package/dist/esm/lib/components/handle-group/handle-group.component.d.ts.map +1 -0
  30. package/dist/esm/lib/components/handle-group/handle-group.component.js +39 -0
  31. package/dist/esm/lib/components/handle-group/handle-group.component.js.map +1 -0
  32. package/dist/esm/lib/components/handle-group/handle-row.component.d.ts +16 -0
  33. package/dist/esm/lib/components/handle-group/handle-row.component.d.ts.map +1 -0
  34. package/dist/esm/lib/components/handle-group/handle-row.component.js +35 -0
  35. package/dist/esm/lib/components/handle-group/handle-row.component.js.map +1 -0
  36. package/dist/esm/lib/components/nodes/default-node.component.js +1 -1
  37. package/dist/esm/lib/components/nodes/input-node.component.js +1 -1
  38. package/dist/esm/lib/components/nodes/output-node.component.js +1 -1
  39. package/dist/esm/lib/container/edge-renderer/edge-renderer.component.d.ts.map +1 -1
  40. package/dist/esm/lib/container/edge-renderer/edge-renderer.component.js +324 -316
  41. package/dist/esm/lib/container/edge-renderer/edge-renderer.component.js.map +1 -1
  42. package/dist/esm/lib/public-api.d.ts +2 -0
  43. package/dist/esm/lib/public-api.d.ts.map +1 -1
  44. package/dist/esm/lib/public-api.js +3 -0
  45. package/dist/esm/lib/public-api.js.map +1 -1
  46. package/dist/esm/lib/services/flow-store.service.d.ts +11 -1
  47. package/dist/esm/lib/services/flow-store.service.d.ts.map +1 -1
  48. package/dist/esm/lib/services/flow-store.service.js +43 -0
  49. package/dist/esm/lib/services/flow-store.service.js.map +1 -1
  50. package/dist/esm/lib/services/ng-flow.service.d.ts +13 -1
  51. package/dist/esm/lib/services/ng-flow.service.d.ts.map +1 -1
  52. package/dist/esm/lib/services/ng-flow.service.js +15 -0
  53. package/dist/esm/lib/services/ng-flow.service.js.map +1 -1
  54. package/package.json +66 -66
@@ -112,6 +112,12 @@ export class EdgeRendererComponent {
112
112
  const targetNode = this.store.nodeLookup.get(edge.target);
113
113
  const sourceHandle = sourceNode?.internals?.handleBounds?.source?.find((h) => h.id === edge.sourceHandle || (!edge.sourceHandle && h.id === null)) ?? sourceNode?.internals?.handleBounds?.source?.[0];
114
114
  const targetHandle = targetNode?.internals?.handleBounds?.target?.find((h) => h.id === edge.targetHandle || (!edge.targetHandle && h.id === null)) ?? targetNode?.internals?.handleBounds?.target?.[0];
115
+ const enrichedSourceHandle = sourceHandle
116
+ ? { ...sourceHandle, data: this.store.getHandleData(edge.source, sourceHandle.id ?? null, 'source') }
117
+ : null;
118
+ const enrichedTargetHandle = targetHandle
119
+ ? { ...targetHandle, data: this.store.getHandleData(edge.target, targetHandle.id ?? null, 'target') }
120
+ : null;
115
121
  const sourcePos = sourceNode?.internals?.positionAbsolute ?? sourceNode?.position ?? { x: 0, y: 0 };
116
122
  const targetPos = targetNode?.internals?.positionAbsolute ?? targetNode?.position ?? { x: 0, y: 0 };
117
123
  const sourceW = sourceNode?.measured?.width ?? sourceNode?.width ?? 150;
@@ -160,6 +166,8 @@ export class EdgeRendererComponent {
160
166
  pathOptions: edge.pathOptions,
161
167
  sourceHandleId: edge.sourceHandle,
162
168
  targetHandleId: edge.targetHandle,
169
+ sourceHandle: enrichedSourceHandle,
170
+ targetHandle: enrichedTargetHandle,
163
171
  };
164
172
  }
165
173
  onEdgeEvent(event, edge, eventType) {
@@ -302,164 +310,164 @@ export class EdgeRendererComponent {
302
310
  return `url('#${getMarkerId(marker, this.store.rfId())}')`;
303
311
  }
304
312
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: EdgeRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
305
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: EdgeRendererComponent, isStandalone: true, selector: "ng-flow-edge-renderer", inputs: { reconnectRadius: { classPropertyName: "reconnectRadius", publicName: "reconnectRadius", isSignal: true, isRequired: false, transformFunction: null }, customEdgeTypes: { classPropertyName: "customEdgeTypes", publicName: "customEdgeTypes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { edgeClick: "edgeClick", edgeDoubleClick: "edgeDoubleClick", edgeContextMenu: "edgeContextMenu", edgeMouseEnter: "edgeMouseEnter", edgeMouseMove: "edgeMouseMove", edgeMouseLeave: "edgeMouseLeave", reconnect: "reconnect", reconnectStart: "reconnectStart", reconnectEnd: "reconnectEnd" }, host: { styleAttribute: "position: absolute; width: 100%; height: 100%; top: 0; left: 0; pointer-events: none;", classAttribute: "ng-flow__edges xy-flow__edges" }, ngImport: i0, template: `
306
- <svg style="position: absolute; width: 100%; height: 100%; overflow: visible; pointer-events: none;">
307
- <defs>
308
- @for (marker of markers(); track marker.id) {
309
- <marker
310
- [id]="marker.id"
311
- [attr.markerWidth]="marker.width ?? 12.5"
312
- [attr.markerHeight]="marker.height ?? 12.5"
313
- viewBox="-10 -10 20 20"
314
- markerUnits="strokeWidth"
315
- orient="auto-start-reverse"
316
- refX="0"
317
- refY="0"
318
- >
319
- <polyline
320
- class="xy-flow__arrowhead"
321
- [class.arrowclosed]="marker.type === 'arrowclosed'"
322
- [attr.stroke]="marker.color || 'currentColor'"
323
- [attr.fill]="marker.type === 'arrowclosed' ? (marker.color || 'currentColor') : 'none'"
324
- stroke-linecap="round"
325
- stroke-linejoin="round"
326
- stroke-width="1"
327
- points="-5,-4 0,0 -5,4"
328
- />
329
- </marker>
330
- }
331
- </defs>
332
- </svg>
333
- @for (edge of visibleEdges(); track edge.id) {
334
- @if (!edge.hidden) {
335
- @let ei = getEdgeInputs(edge);
336
- <svg
337
- class="ng-flow__edge xy-flow__edge"
338
- [class]="getEdgeClasses(edge)"
339
- [class.selected]="edge.selected"
340
- [class.animated]="edge.animated"
341
- [class.selectable]="edge.selectable !== false"
342
- [style.z-index]="getEdgeZIndex(edge)"
343
- [attr.aria-label]="getEdgeAriaLabel(edge)"
344
- [attr.tabindex]="store.edgesFocusable() ? 0 : -1"
345
- role="img"
346
- style="overflow: visible; position: absolute; width: 100%; height: 100%; pointer-events: none;"
347
- (keydown)="onEdgeKeyDown($event, edge)"
348
- (focus)="onEdgeFocus(edge)"
349
- >
350
- <g
351
- [attr.data-id]="edge.id"
352
- [class]="getEdgeGClasses(edge)"
353
- [attr.aria-label]="edge.ariaLabel ? edge.ariaLabel : undefined"
354
- style="pointer-events: visibleStroke;"
355
- (click)="onEdgeEvent($event, edge, 'click')"
356
- (dblclick)="onEdgeEvent($event, edge, 'dblclick')"
357
- (contextmenu)="onEdgeEvent($event, edge, 'contextmenu')"
358
- (mouseenter)="onEdgeEvent($event, edge, 'mouseenter')"
359
- (mousemove)="onEdgeEvent($event, edge, 'mousemove')"
360
- (mouseleave)="onEdgeEvent($event, edge, 'mouseleave')"
361
- >
362
- @if (isCustomEdge(edge.type)) {
363
- <!--
364
- For custom edges the visual (path + labels) is rendered in the
365
- HTML overlay layer below, because NgComponentOutlet creates the
366
- dynamic component's host in the XHTML namespace which breaks SVG
367
- child rendering. We still emit a transparent interaction path
368
- here so that pointer events (click/hover/etc.) fire on the
369
- existing SVG <g> event handlers.
370
- -->
371
- <path
372
- class="xy-flow__edge-interaction"
373
- [attr.d]="getEdgePath(ei)"
374
- fill="none"
375
- stroke="transparent"
376
- [attr.stroke-width]="edge.interactionWidth ?? 20"
377
- style="pointer-events: all;"
378
- />
379
- } @else {
380
- <path
381
- class="xy-flow__edge-interaction"
382
- [attr.d]="getEdgePath(ei)"
383
- fill="none"
384
- stroke="transparent"
385
- [attr.stroke-width]="edge.interactionWidth ?? 20"
386
- style="pointer-events: all;"
387
- />
388
- <path
389
- class="ng-flow__edge-path xy-flow__edge-path"
390
- [attr.d]="getEdgePath(ei)"
391
- [attr.marker-start]="ei['markerStart']"
392
- [attr.marker-end]="ei['markerEnd']"
393
- [attr.style]="getEdgePathStyle(edge)"
394
- />
395
- }
396
- @if (isEdgeReconnectable(edge)) {
397
- <circle
398
- class="xy-flow__edgeupdater xy-flow__edgeupdater-source"
399
- [attr.cx]="shiftX(ei['sourceX'], reconnectRadius(), ei['sourcePosition'])"
400
- [attr.cy]="shiftY(ei['sourceY'], reconnectRadius(), ei['sourcePosition'])"
401
- [attr.r]="reconnectRadius()"
402
- stroke="transparent"
403
- fill="transparent"
404
- (mousedown)="onReconnectSourceMouseDown($event, edge)"
405
- />
406
- <circle
407
- class="xy-flow__edgeupdater xy-flow__edgeupdater-target"
408
- [attr.cx]="shiftX(ei['targetX'], reconnectRadius(), ei['targetPosition'])"
409
- [attr.cy]="shiftY(ei['targetY'], reconnectRadius(), ei['targetPosition'])"
410
- [attr.r]="reconnectRadius()"
411
- stroke="transparent"
412
- fill="transparent"
413
- (mousedown)="onReconnectTargetMouseDown($event, edge)"
414
- />
415
- }
416
- </g>
417
- </svg>
418
- }
419
- }
420
- <!--
421
- HTML overlay for custom edges. Angular's NgComponentOutlet can only
422
- create host elements in the XHTML namespace, so rendering a custom
423
- edge directly inside an <svg> sub-tree breaks its <path> children.
424
- We render the dynamic component here in an HTML context and let
425
- BaseEdgeComponent wrap its paths in an inline <svg>. Pointer events
426
- are still handled on the SVG <g> layer above via a transparent
427
- interaction path, so this overlay is pointer-events: none.
428
- -->
429
- @for (edge of visibleEdges(); track edge.id) {
430
- @if (!edge.hidden && isCustomEdge(edge.type)) {
431
- @let ei = getEdgeInputs(edge);
432
- <div
433
- class="ng-flow__custom-edge"
434
- [style.position]="'absolute'"
435
- [style.top]="'0'"
436
- [style.left]="'0'"
437
- [style.width]="'100%'"
438
- [style.height]="'100%'"
439
- [style.pointer-events]="'none'"
440
- [style.z-index]="getEdgeZIndex(edge)"
441
- >
442
- <ng-container
443
- *ngComponentOutlet="getEdgeComponent(edge.type); inputs: ei"
444
- />
445
- </div>
446
- }
447
- }
448
- <div class="xy-flow__edgelabel-renderer" style="position: absolute; width: 100%; height: 100%; pointer-events: none; top: 0; left: 0;">
449
- @for (edge of visibleEdges(); track edge.id) {
450
- @if (edge.label && !edge.hidden) {
451
- @let ei = getEdgeInputs(edge);
452
- <div
453
- class="xy-flow__edge-label"
454
- [style.position]="'absolute'"
455
- [style.transform]="'translate(-50%, -50%) translate(' + getEdgeCenterX(ei) + 'px, ' + getEdgeCenterY(ei) + 'px)'"
456
- [style.pointer-events]="'all'"
457
- >
458
- {{ edge.label }}
459
- </div>
460
- }
461
- }
462
- </div>
313
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: EdgeRendererComponent, isStandalone: true, selector: "ng-flow-edge-renderer", inputs: { reconnectRadius: { classPropertyName: "reconnectRadius", publicName: "reconnectRadius", isSignal: true, isRequired: false, transformFunction: null }, customEdgeTypes: { classPropertyName: "customEdgeTypes", publicName: "customEdgeTypes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { edgeClick: "edgeClick", edgeDoubleClick: "edgeDoubleClick", edgeContextMenu: "edgeContextMenu", edgeMouseEnter: "edgeMouseEnter", edgeMouseMove: "edgeMouseMove", edgeMouseLeave: "edgeMouseLeave", reconnect: "reconnect", reconnectStart: "reconnectStart", reconnectEnd: "reconnectEnd" }, host: { styleAttribute: "position: absolute; width: 100%; height: 100%; top: 0; left: 0; pointer-events: none;", classAttribute: "ng-flow__edges xy-flow__edges" }, ngImport: i0, template: `
314
+ <svg style="position: absolute; width: 100%; height: 100%; overflow: visible; pointer-events: none;">
315
+ <defs>
316
+ @for (marker of markers(); track marker.id) {
317
+ <marker
318
+ [id]="marker.id"
319
+ [attr.markerWidth]="marker.width ?? 12.5"
320
+ [attr.markerHeight]="marker.height ?? 12.5"
321
+ viewBox="-10 -10 20 20"
322
+ markerUnits="strokeWidth"
323
+ orient="auto-start-reverse"
324
+ refX="0"
325
+ refY="0"
326
+ >
327
+ <polyline
328
+ class="xy-flow__arrowhead"
329
+ [class.arrowclosed]="marker.type === 'arrowclosed'"
330
+ [attr.stroke]="marker.color || 'currentColor'"
331
+ [attr.fill]="marker.type === 'arrowclosed' ? (marker.color || 'currentColor') : 'none'"
332
+ stroke-linecap="round"
333
+ stroke-linejoin="round"
334
+ stroke-width="1"
335
+ points="-5,-4 0,0 -5,4"
336
+ />
337
+ </marker>
338
+ }
339
+ </defs>
340
+ </svg>
341
+ @for (edge of visibleEdges(); track edge.id) {
342
+ @if (!edge.hidden) {
343
+ @let ei = getEdgeInputs(edge);
344
+ <svg
345
+ class="ng-flow__edge xy-flow__edge"
346
+ [class]="getEdgeClasses(edge)"
347
+ [class.selected]="edge.selected"
348
+ [class.animated]="edge.animated"
349
+ [class.selectable]="edge.selectable !== false"
350
+ [style.z-index]="getEdgeZIndex(edge)"
351
+ [attr.aria-label]="getEdgeAriaLabel(edge)"
352
+ [attr.tabindex]="store.edgesFocusable() ? 0 : -1"
353
+ role="img"
354
+ style="overflow: visible; position: absolute; width: 100%; height: 100%; pointer-events: none;"
355
+ (keydown)="onEdgeKeyDown($event, edge)"
356
+ (focus)="onEdgeFocus(edge)"
357
+ >
358
+ <g
359
+ [attr.data-id]="edge.id"
360
+ [class]="getEdgeGClasses(edge)"
361
+ [attr.aria-label]="edge.ariaLabel ? edge.ariaLabel : undefined"
362
+ style="pointer-events: visibleStroke;"
363
+ (click)="onEdgeEvent($event, edge, 'click')"
364
+ (dblclick)="onEdgeEvent($event, edge, 'dblclick')"
365
+ (contextmenu)="onEdgeEvent($event, edge, 'contextmenu')"
366
+ (mouseenter)="onEdgeEvent($event, edge, 'mouseenter')"
367
+ (mousemove)="onEdgeEvent($event, edge, 'mousemove')"
368
+ (mouseleave)="onEdgeEvent($event, edge, 'mouseleave')"
369
+ >
370
+ @if (isCustomEdge(edge.type)) {
371
+ <!--
372
+ For custom edges the visual (path + labels) is rendered in the
373
+ HTML overlay layer below, because NgComponentOutlet creates the
374
+ dynamic component's host in the XHTML namespace which breaks SVG
375
+ child rendering. We still emit a transparent interaction path
376
+ here so that pointer events (click/hover/etc.) fire on the
377
+ existing SVG <g> event handlers.
378
+ -->
379
+ <path
380
+ class="xy-flow__edge-interaction"
381
+ [attr.d]="getEdgePath(ei)"
382
+ fill="none"
383
+ stroke="transparent"
384
+ [attr.stroke-width]="edge.interactionWidth ?? 20"
385
+ style="pointer-events: all;"
386
+ />
387
+ } @else {
388
+ <path
389
+ class="xy-flow__edge-interaction"
390
+ [attr.d]="getEdgePath(ei)"
391
+ fill="none"
392
+ stroke="transparent"
393
+ [attr.stroke-width]="edge.interactionWidth ?? 20"
394
+ style="pointer-events: all;"
395
+ />
396
+ <path
397
+ class="ng-flow__edge-path xy-flow__edge-path"
398
+ [attr.d]="getEdgePath(ei)"
399
+ [attr.marker-start]="ei['markerStart']"
400
+ [attr.marker-end]="ei['markerEnd']"
401
+ [attr.style]="getEdgePathStyle(edge)"
402
+ />
403
+ }
404
+ @if (isEdgeReconnectable(edge)) {
405
+ <circle
406
+ class="xy-flow__edgeupdater xy-flow__edgeupdater-source"
407
+ [attr.cx]="shiftX(ei['sourceX'], reconnectRadius(), ei['sourcePosition'])"
408
+ [attr.cy]="shiftY(ei['sourceY'], reconnectRadius(), ei['sourcePosition'])"
409
+ [attr.r]="reconnectRadius()"
410
+ stroke="transparent"
411
+ fill="transparent"
412
+ (mousedown)="onReconnectSourceMouseDown($event, edge)"
413
+ />
414
+ <circle
415
+ class="xy-flow__edgeupdater xy-flow__edgeupdater-target"
416
+ [attr.cx]="shiftX(ei['targetX'], reconnectRadius(), ei['targetPosition'])"
417
+ [attr.cy]="shiftY(ei['targetY'], reconnectRadius(), ei['targetPosition'])"
418
+ [attr.r]="reconnectRadius()"
419
+ stroke="transparent"
420
+ fill="transparent"
421
+ (mousedown)="onReconnectTargetMouseDown($event, edge)"
422
+ />
423
+ }
424
+ </g>
425
+ </svg>
426
+ }
427
+ }
428
+ <!--
429
+ HTML overlay for custom edges. Angular's NgComponentOutlet can only
430
+ create host elements in the XHTML namespace, so rendering a custom
431
+ edge directly inside an <svg> sub-tree breaks its <path> children.
432
+ We render the dynamic component here in an HTML context and let
433
+ BaseEdgeComponent wrap its paths in an inline <svg>. Pointer events
434
+ are still handled on the SVG <g> layer above via a transparent
435
+ interaction path, so this overlay is pointer-events: none.
436
+ -->
437
+ @for (edge of visibleEdges(); track edge.id) {
438
+ @if (!edge.hidden && isCustomEdge(edge.type)) {
439
+ @let ei = getEdgeInputs(edge);
440
+ <div
441
+ class="ng-flow__custom-edge"
442
+ [style.position]="'absolute'"
443
+ [style.top]="'0'"
444
+ [style.left]="'0'"
445
+ [style.width]="'100%'"
446
+ [style.height]="'100%'"
447
+ [style.pointer-events]="'none'"
448
+ [style.z-index]="getEdgeZIndex(edge)"
449
+ >
450
+ <ng-container
451
+ *ngComponentOutlet="getEdgeComponent(edge.type); inputs: ei"
452
+ />
453
+ </div>
454
+ }
455
+ }
456
+ <div class="xy-flow__edgelabel-renderer" style="position: absolute; width: 100%; height: 100%; pointer-events: none; top: 0; left: 0;">
457
+ @for (edge of visibleEdges(); track edge.id) {
458
+ @if (edge.label && !edge.hidden) {
459
+ @let ei = getEdgeInputs(edge);
460
+ <div
461
+ class="xy-flow__edge-label"
462
+ [style.position]="'absolute'"
463
+ [style.transform]="'translate(-50%, -50%) translate(' + getEdgeCenterX(ei) + 'px, ' + getEdgeCenterY(ei) + 'px)'"
464
+ [style.pointer-events]="'all'"
465
+ >
466
+ {{ edge.label }}
467
+ </div>
468
+ }
469
+ }
470
+ </div>
463
471
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
464
472
  }
465
473
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: EdgeRendererComponent, decorators: [{
@@ -474,164 +482,164 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
474
482
  'class': 'ng-flow__edges xy-flow__edges',
475
483
  'style': 'position: absolute; width: 100%; height: 100%; top: 0; left: 0; pointer-events: none;',
476
484
  },
477
- template: `
478
- <svg style="position: absolute; width: 100%; height: 100%; overflow: visible; pointer-events: none;">
479
- <defs>
480
- @for (marker of markers(); track marker.id) {
481
- <marker
482
- [id]="marker.id"
483
- [attr.markerWidth]="marker.width ?? 12.5"
484
- [attr.markerHeight]="marker.height ?? 12.5"
485
- viewBox="-10 -10 20 20"
486
- markerUnits="strokeWidth"
487
- orient="auto-start-reverse"
488
- refX="0"
489
- refY="0"
490
- >
491
- <polyline
492
- class="xy-flow__arrowhead"
493
- [class.arrowclosed]="marker.type === 'arrowclosed'"
494
- [attr.stroke]="marker.color || 'currentColor'"
495
- [attr.fill]="marker.type === 'arrowclosed' ? (marker.color || 'currentColor') : 'none'"
496
- stroke-linecap="round"
497
- stroke-linejoin="round"
498
- stroke-width="1"
499
- points="-5,-4 0,0 -5,4"
500
- />
501
- </marker>
502
- }
503
- </defs>
504
- </svg>
505
- @for (edge of visibleEdges(); track edge.id) {
506
- @if (!edge.hidden) {
507
- @let ei = getEdgeInputs(edge);
508
- <svg
509
- class="ng-flow__edge xy-flow__edge"
510
- [class]="getEdgeClasses(edge)"
511
- [class.selected]="edge.selected"
512
- [class.animated]="edge.animated"
513
- [class.selectable]="edge.selectable !== false"
514
- [style.z-index]="getEdgeZIndex(edge)"
515
- [attr.aria-label]="getEdgeAriaLabel(edge)"
516
- [attr.tabindex]="store.edgesFocusable() ? 0 : -1"
517
- role="img"
518
- style="overflow: visible; position: absolute; width: 100%; height: 100%; pointer-events: none;"
519
- (keydown)="onEdgeKeyDown($event, edge)"
520
- (focus)="onEdgeFocus(edge)"
521
- >
522
- <g
523
- [attr.data-id]="edge.id"
524
- [class]="getEdgeGClasses(edge)"
525
- [attr.aria-label]="edge.ariaLabel ? edge.ariaLabel : undefined"
526
- style="pointer-events: visibleStroke;"
527
- (click)="onEdgeEvent($event, edge, 'click')"
528
- (dblclick)="onEdgeEvent($event, edge, 'dblclick')"
529
- (contextmenu)="onEdgeEvent($event, edge, 'contextmenu')"
530
- (mouseenter)="onEdgeEvent($event, edge, 'mouseenter')"
531
- (mousemove)="onEdgeEvent($event, edge, 'mousemove')"
532
- (mouseleave)="onEdgeEvent($event, edge, 'mouseleave')"
533
- >
534
- @if (isCustomEdge(edge.type)) {
535
- <!--
536
- For custom edges the visual (path + labels) is rendered in the
537
- HTML overlay layer below, because NgComponentOutlet creates the
538
- dynamic component's host in the XHTML namespace which breaks SVG
539
- child rendering. We still emit a transparent interaction path
540
- here so that pointer events (click/hover/etc.) fire on the
541
- existing SVG <g> event handlers.
542
- -->
543
- <path
544
- class="xy-flow__edge-interaction"
545
- [attr.d]="getEdgePath(ei)"
546
- fill="none"
547
- stroke="transparent"
548
- [attr.stroke-width]="edge.interactionWidth ?? 20"
549
- style="pointer-events: all;"
550
- />
551
- } @else {
552
- <path
553
- class="xy-flow__edge-interaction"
554
- [attr.d]="getEdgePath(ei)"
555
- fill="none"
556
- stroke="transparent"
557
- [attr.stroke-width]="edge.interactionWidth ?? 20"
558
- style="pointer-events: all;"
559
- />
560
- <path
561
- class="ng-flow__edge-path xy-flow__edge-path"
562
- [attr.d]="getEdgePath(ei)"
563
- [attr.marker-start]="ei['markerStart']"
564
- [attr.marker-end]="ei['markerEnd']"
565
- [attr.style]="getEdgePathStyle(edge)"
566
- />
567
- }
568
- @if (isEdgeReconnectable(edge)) {
569
- <circle
570
- class="xy-flow__edgeupdater xy-flow__edgeupdater-source"
571
- [attr.cx]="shiftX(ei['sourceX'], reconnectRadius(), ei['sourcePosition'])"
572
- [attr.cy]="shiftY(ei['sourceY'], reconnectRadius(), ei['sourcePosition'])"
573
- [attr.r]="reconnectRadius()"
574
- stroke="transparent"
575
- fill="transparent"
576
- (mousedown)="onReconnectSourceMouseDown($event, edge)"
577
- />
578
- <circle
579
- class="xy-flow__edgeupdater xy-flow__edgeupdater-target"
580
- [attr.cx]="shiftX(ei['targetX'], reconnectRadius(), ei['targetPosition'])"
581
- [attr.cy]="shiftY(ei['targetY'], reconnectRadius(), ei['targetPosition'])"
582
- [attr.r]="reconnectRadius()"
583
- stroke="transparent"
584
- fill="transparent"
585
- (mousedown)="onReconnectTargetMouseDown($event, edge)"
586
- />
587
- }
588
- </g>
589
- </svg>
590
- }
591
- }
592
- <!--
593
- HTML overlay for custom edges. Angular's NgComponentOutlet can only
594
- create host elements in the XHTML namespace, so rendering a custom
595
- edge directly inside an <svg> sub-tree breaks its <path> children.
596
- We render the dynamic component here in an HTML context and let
597
- BaseEdgeComponent wrap its paths in an inline <svg>. Pointer events
598
- are still handled on the SVG <g> layer above via a transparent
599
- interaction path, so this overlay is pointer-events: none.
600
- -->
601
- @for (edge of visibleEdges(); track edge.id) {
602
- @if (!edge.hidden && isCustomEdge(edge.type)) {
603
- @let ei = getEdgeInputs(edge);
604
- <div
605
- class="ng-flow__custom-edge"
606
- [style.position]="'absolute'"
607
- [style.top]="'0'"
608
- [style.left]="'0'"
609
- [style.width]="'100%'"
610
- [style.height]="'100%'"
611
- [style.pointer-events]="'none'"
612
- [style.z-index]="getEdgeZIndex(edge)"
613
- >
614
- <ng-container
615
- *ngComponentOutlet="getEdgeComponent(edge.type); inputs: ei"
616
- />
617
- </div>
618
- }
619
- }
620
- <div class="xy-flow__edgelabel-renderer" style="position: absolute; width: 100%; height: 100%; pointer-events: none; top: 0; left: 0;">
621
- @for (edge of visibleEdges(); track edge.id) {
622
- @if (edge.label && !edge.hidden) {
623
- @let ei = getEdgeInputs(edge);
624
- <div
625
- class="xy-flow__edge-label"
626
- [style.position]="'absolute'"
627
- [style.transform]="'translate(-50%, -50%) translate(' + getEdgeCenterX(ei) + 'px, ' + getEdgeCenterY(ei) + 'px)'"
628
- [style.pointer-events]="'all'"
629
- >
630
- {{ edge.label }}
631
- </div>
632
- }
633
- }
634
- </div>
485
+ template: `
486
+ <svg style="position: absolute; width: 100%; height: 100%; overflow: visible; pointer-events: none;">
487
+ <defs>
488
+ @for (marker of markers(); track marker.id) {
489
+ <marker
490
+ [id]="marker.id"
491
+ [attr.markerWidth]="marker.width ?? 12.5"
492
+ [attr.markerHeight]="marker.height ?? 12.5"
493
+ viewBox="-10 -10 20 20"
494
+ markerUnits="strokeWidth"
495
+ orient="auto-start-reverse"
496
+ refX="0"
497
+ refY="0"
498
+ >
499
+ <polyline
500
+ class="xy-flow__arrowhead"
501
+ [class.arrowclosed]="marker.type === 'arrowclosed'"
502
+ [attr.stroke]="marker.color || 'currentColor'"
503
+ [attr.fill]="marker.type === 'arrowclosed' ? (marker.color || 'currentColor') : 'none'"
504
+ stroke-linecap="round"
505
+ stroke-linejoin="round"
506
+ stroke-width="1"
507
+ points="-5,-4 0,0 -5,4"
508
+ />
509
+ </marker>
510
+ }
511
+ </defs>
512
+ </svg>
513
+ @for (edge of visibleEdges(); track edge.id) {
514
+ @if (!edge.hidden) {
515
+ @let ei = getEdgeInputs(edge);
516
+ <svg
517
+ class="ng-flow__edge xy-flow__edge"
518
+ [class]="getEdgeClasses(edge)"
519
+ [class.selected]="edge.selected"
520
+ [class.animated]="edge.animated"
521
+ [class.selectable]="edge.selectable !== false"
522
+ [style.z-index]="getEdgeZIndex(edge)"
523
+ [attr.aria-label]="getEdgeAriaLabel(edge)"
524
+ [attr.tabindex]="store.edgesFocusable() ? 0 : -1"
525
+ role="img"
526
+ style="overflow: visible; position: absolute; width: 100%; height: 100%; pointer-events: none;"
527
+ (keydown)="onEdgeKeyDown($event, edge)"
528
+ (focus)="onEdgeFocus(edge)"
529
+ >
530
+ <g
531
+ [attr.data-id]="edge.id"
532
+ [class]="getEdgeGClasses(edge)"
533
+ [attr.aria-label]="edge.ariaLabel ? edge.ariaLabel : undefined"
534
+ style="pointer-events: visibleStroke;"
535
+ (click)="onEdgeEvent($event, edge, 'click')"
536
+ (dblclick)="onEdgeEvent($event, edge, 'dblclick')"
537
+ (contextmenu)="onEdgeEvent($event, edge, 'contextmenu')"
538
+ (mouseenter)="onEdgeEvent($event, edge, 'mouseenter')"
539
+ (mousemove)="onEdgeEvent($event, edge, 'mousemove')"
540
+ (mouseleave)="onEdgeEvent($event, edge, 'mouseleave')"
541
+ >
542
+ @if (isCustomEdge(edge.type)) {
543
+ <!--
544
+ For custom edges the visual (path + labels) is rendered in the
545
+ HTML overlay layer below, because NgComponentOutlet creates the
546
+ dynamic component's host in the XHTML namespace which breaks SVG
547
+ child rendering. We still emit a transparent interaction path
548
+ here so that pointer events (click/hover/etc.) fire on the
549
+ existing SVG <g> event handlers.
550
+ -->
551
+ <path
552
+ class="xy-flow__edge-interaction"
553
+ [attr.d]="getEdgePath(ei)"
554
+ fill="none"
555
+ stroke="transparent"
556
+ [attr.stroke-width]="edge.interactionWidth ?? 20"
557
+ style="pointer-events: all;"
558
+ />
559
+ } @else {
560
+ <path
561
+ class="xy-flow__edge-interaction"
562
+ [attr.d]="getEdgePath(ei)"
563
+ fill="none"
564
+ stroke="transparent"
565
+ [attr.stroke-width]="edge.interactionWidth ?? 20"
566
+ style="pointer-events: all;"
567
+ />
568
+ <path
569
+ class="ng-flow__edge-path xy-flow__edge-path"
570
+ [attr.d]="getEdgePath(ei)"
571
+ [attr.marker-start]="ei['markerStart']"
572
+ [attr.marker-end]="ei['markerEnd']"
573
+ [attr.style]="getEdgePathStyle(edge)"
574
+ />
575
+ }
576
+ @if (isEdgeReconnectable(edge)) {
577
+ <circle
578
+ class="xy-flow__edgeupdater xy-flow__edgeupdater-source"
579
+ [attr.cx]="shiftX(ei['sourceX'], reconnectRadius(), ei['sourcePosition'])"
580
+ [attr.cy]="shiftY(ei['sourceY'], reconnectRadius(), ei['sourcePosition'])"
581
+ [attr.r]="reconnectRadius()"
582
+ stroke="transparent"
583
+ fill="transparent"
584
+ (mousedown)="onReconnectSourceMouseDown($event, edge)"
585
+ />
586
+ <circle
587
+ class="xy-flow__edgeupdater xy-flow__edgeupdater-target"
588
+ [attr.cx]="shiftX(ei['targetX'], reconnectRadius(), ei['targetPosition'])"
589
+ [attr.cy]="shiftY(ei['targetY'], reconnectRadius(), ei['targetPosition'])"
590
+ [attr.r]="reconnectRadius()"
591
+ stroke="transparent"
592
+ fill="transparent"
593
+ (mousedown)="onReconnectTargetMouseDown($event, edge)"
594
+ />
595
+ }
596
+ </g>
597
+ </svg>
598
+ }
599
+ }
600
+ <!--
601
+ HTML overlay for custom edges. Angular's NgComponentOutlet can only
602
+ create host elements in the XHTML namespace, so rendering a custom
603
+ edge directly inside an <svg> sub-tree breaks its <path> children.
604
+ We render the dynamic component here in an HTML context and let
605
+ BaseEdgeComponent wrap its paths in an inline <svg>. Pointer events
606
+ are still handled on the SVG <g> layer above via a transparent
607
+ interaction path, so this overlay is pointer-events: none.
608
+ -->
609
+ @for (edge of visibleEdges(); track edge.id) {
610
+ @if (!edge.hidden && isCustomEdge(edge.type)) {
611
+ @let ei = getEdgeInputs(edge);
612
+ <div
613
+ class="ng-flow__custom-edge"
614
+ [style.position]="'absolute'"
615
+ [style.top]="'0'"
616
+ [style.left]="'0'"
617
+ [style.width]="'100%'"
618
+ [style.height]="'100%'"
619
+ [style.pointer-events]="'none'"
620
+ [style.z-index]="getEdgeZIndex(edge)"
621
+ >
622
+ <ng-container
623
+ *ngComponentOutlet="getEdgeComponent(edge.type); inputs: ei"
624
+ />
625
+ </div>
626
+ }
627
+ }
628
+ <div class="xy-flow__edgelabel-renderer" style="position: absolute; width: 100%; height: 100%; pointer-events: none; top: 0; left: 0;">
629
+ @for (edge of visibleEdges(); track edge.id) {
630
+ @if (edge.label && !edge.hidden) {
631
+ @let ei = getEdgeInputs(edge);
632
+ <div
633
+ class="xy-flow__edge-label"
634
+ [style.position]="'absolute'"
635
+ [style.transform]="'translate(-50%, -50%) translate(' + getEdgeCenterX(ei) + 'px, ' + getEdgeCenterY(ei) + 'px)'"
636
+ [style.pointer-events]="'all'"
637
+ >
638
+ {{ edge.label }}
639
+ </div>
640
+ }
641
+ }
642
+ </div>
635
643
  `,
636
644
  }]
637
645
  }], propDecorators: { reconnectRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "reconnectRadius", required: false }] }], edgeClick: [{ type: i0.Output, args: ["edgeClick"] }], edgeDoubleClick: [{ type: i0.Output, args: ["edgeDoubleClick"] }], edgeContextMenu: [{ type: i0.Output, args: ["edgeContextMenu"] }], edgeMouseEnter: [{ type: i0.Output, args: ["edgeMouseEnter"] }], edgeMouseMove: [{ type: i0.Output, args: ["edgeMouseMove"] }], edgeMouseLeave: [{ type: i0.Output, args: ["edgeMouseLeave"] }], customEdgeTypes: [{ type: i0.Input, args: [{ isSignal: true, alias: "customEdgeTypes", required: false }] }], reconnect: [{ type: i0.Output, args: ["reconnect"] }], reconnectStart: [{ type: i0.Output, args: ["reconnectStart"] }], reconnectEnd: [{ type: i0.Output, args: ["reconnectEnd"] }] } });