@ship-ui/core 0.15.29 → 0.15.31

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.
@@ -1023,6 +1023,7 @@ class ShipBlueprintComponent {
1023
1023
  }
1024
1024
  }
1025
1025
  onTouchMove(event) {
1026
+ event.preventDefault();
1026
1027
  if (this.isLocked())
1027
1028
  return;
1028
1029
  if (this.#isNodeDragging()) {
@@ -1035,6 +1036,11 @@ class ShipBlueprintComponent {
1035
1036
  this.handleTouchMove(event);
1036
1037
  }
1037
1038
  }
1039
+ onDocumentTouchEnd(event) {
1040
+ if (this.isLocked())
1041
+ return;
1042
+ this.handleTouchEnd();
1043
+ }
1038
1044
  startNodeDrag(event, nodeId) {
1039
1045
  event.stopPropagation();
1040
1046
  event.preventDefault();
@@ -1089,6 +1095,7 @@ class ShipBlueprintComponent {
1089
1095
  this.#lastMouseY.set(clientY);
1090
1096
  }
1091
1097
  startPortDrag(event, nodeId, portId) {
1098
+ event.preventDefault();
1092
1099
  event.stopPropagation();
1093
1100
  if (this.draggingConnection())
1094
1101
  this.cancelPortDrag();
@@ -1216,6 +1223,7 @@ class ShipBlueprintComponent {
1216
1223
  }
1217
1224
  }
1218
1225
  handleTouchMove(event) {
1226
+ event.preventDefault();
1219
1227
  if (event.touches.length === 1 && this.#isDragging()) {
1220
1228
  const dx = event.touches[0].clientX - this.#lastMouseX();
1221
1229
  const dy = event.touches[0].clientY - this.#lastMouseY();
@@ -1242,6 +1250,10 @@ class ShipBlueprintComponent {
1242
1250
  }
1243
1251
  handleTouchEnd() {
1244
1252
  this.#isDragging.set(false);
1253
+ this.endNodeDrag();
1254
+ if (this.draggingConnection()) {
1255
+ this.cancelPortDrag();
1256
+ }
1245
1257
  }
1246
1258
  closeMidpointDiv() {
1247
1259
  this.showMidpointDiv.set(false);
@@ -1422,7 +1434,7 @@ class ShipBlueprintComponent {
1422
1434
  return Math.max(min, Math.min(max, value));
1423
1435
  }
1424
1436
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ShipBlueprintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1425
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: ShipBlueprintComponent, isStandalone: true, selector: "sh-blueprint", inputs: { forceUnique: { classPropertyName: "forceUnique", publicName: "forceUnique", isSignal: true, isRequired: false, transformFunction: null }, autoLayout: { classPropertyName: "autoLayout", publicName: "autoLayout", isSignal: true, isRequired: false, transformFunction: null }, gridSize: { classPropertyName: "gridSize", publicName: "gridSize", isSignal: true, isRequired: false, transformFunction: null }, snapToGrid: { classPropertyName: "snapToGrid", publicName: "snapToGrid", isSignal: true, isRequired: false, transformFunction: null }, gridColor: { classPropertyName: "gridColor", publicName: "gridColor", isSignal: true, isRequired: false, transformFunction: null }, nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodes: "nodesChange" }, host: { listeners: { "document:mouseup": "onMouseUp($event)", "document:click": "onClick($event)", "document:keydown.escape": "onEscape($event)", "document:mousemove": "onMouseMove($event)", "document:touchmove": "onTouchMove($event)" } }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["blueprintCanvas"], descendants: true, static: true }], ngImport: i0, template: `
1437
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: ShipBlueprintComponent, isStandalone: true, selector: "sh-blueprint", inputs: { forceUnique: { classPropertyName: "forceUnique", publicName: "forceUnique", isSignal: true, isRequired: false, transformFunction: null }, autoLayout: { classPropertyName: "autoLayout", publicName: "autoLayout", isSignal: true, isRequired: false, transformFunction: null }, gridSize: { classPropertyName: "gridSize", publicName: "gridSize", isSignal: true, isRequired: false, transformFunction: null }, snapToGrid: { classPropertyName: "snapToGrid", publicName: "snapToGrid", isSignal: true, isRequired: false, transformFunction: null }, gridColor: { classPropertyName: "gridColor", publicName: "gridColor", isSignal: true, isRequired: false, transformFunction: null }, nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodes: "nodesChange" }, host: { listeners: { "document:mouseup": "onMouseUp($event)", "document:click": "onClick($event)", "document:keydown.escape": "onEscape($event)", "document:mousemove": "onMouseMove($event)", "document:touchmove": "onTouchMove($event)", "document:touchend": "onDocumentTouchEnd($event)" } }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["blueprintCanvas"], descendants: true, static: true }], ngImport: i0, template: `
1426
1438
  <div
1427
1439
  class="canvas-container"
1428
1440
  [class.locked]="isLocked()"
@@ -1469,25 +1481,25 @@ class ShipBlueprintComponent {
1469
1481
  <div class="ports">
1470
1482
  <div class="inputs">
1471
1483
  @for (inputPort of node.inputs; track inputPort.id) {
1472
- <div class="port-wrap">
1473
- <div
1474
- class="port input-port"
1475
- [attr.data-node-id]="node.id"
1476
- [attr.data-port-id]="inputPort.id"
1477
- (click)="endPortDrag($event, node.id, inputPort.id)"></div>
1484
+ <div
1485
+ class="port-wrap"
1486
+ [attr.data-node-id]="node.id"
1487
+ [attr.data-port-id]="inputPort.id"
1488
+ (click)="endPortDrag($event, node.id, inputPort.id)">
1489
+ <div class="port input-port"></div>
1478
1490
  <span class="port-name">{{ inputPort.name }}</span>
1479
1491
  </div>
1480
1492
  }
1481
1493
  </div>
1482
1494
  <div class="outputs">
1483
1495
  @for (outputPort of node.outputs; track outputPort.id) {
1484
- <div class="port-wrap">
1496
+ <div
1497
+ class="port-wrap"
1498
+ [attr.data-node-id]="node.id"
1499
+ [attr.data-port-id]="outputPort.id"
1500
+ (click)="startPortDrag($event, node.id, outputPort.id)">
1485
1501
  <span class="port-name">{{ outputPort.name }}</span>
1486
- <div
1487
- class="port output-port"
1488
- [attr.data-node-id]="node.id"
1489
- [attr.data-port-id]="outputPort.id"
1490
- (click)="startPortDrag($event, node.id, outputPort.id)"></div>
1502
+ <div class="port output-port"></div>
1491
1503
  </div>
1492
1504
  }
1493
1505
  </div>
@@ -1562,25 +1574,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
1562
1574
  <div class="ports">
1563
1575
  <div class="inputs">
1564
1576
  @for (inputPort of node.inputs; track inputPort.id) {
1565
- <div class="port-wrap">
1566
- <div
1567
- class="port input-port"
1568
- [attr.data-node-id]="node.id"
1569
- [attr.data-port-id]="inputPort.id"
1570
- (click)="endPortDrag($event, node.id, inputPort.id)"></div>
1577
+ <div
1578
+ class="port-wrap"
1579
+ [attr.data-node-id]="node.id"
1580
+ [attr.data-port-id]="inputPort.id"
1581
+ (click)="endPortDrag($event, node.id, inputPort.id)">
1582
+ <div class="port input-port"></div>
1571
1583
  <span class="port-name">{{ inputPort.name }}</span>
1572
1584
  </div>
1573
1585
  }
1574
1586
  </div>
1575
1587
  <div class="outputs">
1576
1588
  @for (outputPort of node.outputs; track outputPort.id) {
1577
- <div class="port-wrap">
1589
+ <div
1590
+ class="port-wrap"
1591
+ [attr.data-node-id]="node.id"
1592
+ [attr.data-port-id]="outputPort.id"
1593
+ (click)="startPortDrag($event, node.id, outputPort.id)">
1578
1594
  <span class="port-name">{{ outputPort.name }}</span>
1579
- <div
1580
- class="port output-port"
1581
- [attr.data-node-id]="node.id"
1582
- [attr.data-port-id]="outputPort.id"
1583
- (click)="startPortDrag($event, node.id, outputPort.id)"></div>
1595
+ <div class="port output-port"></div>
1584
1596
  </div>
1585
1597
  }
1586
1598
  </div>
@@ -1622,6 +1634,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
1622
1634
  }], onTouchMove: [{
1623
1635
  type: HostListener,
1624
1636
  args: ['document:touchmove', ['$event']]
1637
+ }], onDocumentTouchEnd: [{
1638
+ type: HostListener,
1639
+ args: ['document:touchend', ['$event']]
1625
1640
  }] } });
1626
1641
 
1627
1642
  class ShipButtonGroupComponent {