@angflow/angular 0.0.11 → 0.0.13

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.
@@ -310,164 +310,164 @@ export class EdgeRendererComponent {
310
310
  return `url('#${getMarkerId(marker, this.store.rfId())}')`;
311
311
  }
312
312
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: EdgeRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
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>
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>
471
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 }); }
472
472
  }
473
473
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: EdgeRendererComponent, decorators: [{
@@ -482,164 +482,164 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
482
482
  'class': 'ng-flow__edges xy-flow__edges',
483
483
  'style': 'position: absolute; width: 100%; height: 100%; top: 0; left: 0; pointer-events: none;',
484
484
  },
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>
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>
643
643
  `,
644
644
  }]
645
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"] }] } });