@object-ui/plugin-designer 11.5.0 → 13.2.0
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/CHANGELOG.md +85 -0
- package/dist/index.js +112 -93
- package/dist/index.umd.cjs +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,90 @@
|
|
|
1
1
|
# @object-ui/plugin-designer
|
|
2
2
|
|
|
3
|
+
## 13.2.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [80901aa]
|
|
8
|
+
- Updated dependencies [53c40c2]
|
|
9
|
+
- Updated dependencies [e492b9d]
|
|
10
|
+
- Updated dependencies [5da9905]
|
|
11
|
+
- @object-ui/components@13.2.0
|
|
12
|
+
- @object-ui/plugin-grid@13.2.0
|
|
13
|
+
- @object-ui/i18n@13.2.0
|
|
14
|
+
- @object-ui/data-objectstack@13.2.0
|
|
15
|
+
- @object-ui/fields@13.2.0
|
|
16
|
+
- @object-ui/plugin-form@13.2.0
|
|
17
|
+
- @object-ui/react@13.2.0
|
|
18
|
+
- @object-ui/types@13.2.0
|
|
19
|
+
- @object-ui/core@13.2.0
|
|
20
|
+
|
|
21
|
+
## 13.1.0
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- @object-ui/types@13.1.0
|
|
26
|
+
- @object-ui/core@13.1.0
|
|
27
|
+
- @object-ui/i18n@13.1.0
|
|
28
|
+
- @object-ui/react@13.1.0
|
|
29
|
+
- @object-ui/components@13.1.0
|
|
30
|
+
- @object-ui/fields@13.1.0
|
|
31
|
+
- @object-ui/data-objectstack@13.1.0
|
|
32
|
+
- @object-ui/plugin-form@13.1.0
|
|
33
|
+
- @object-ui/plugin-grid@13.1.0
|
|
34
|
+
|
|
35
|
+
## 13.0.0
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [9e38270]
|
|
40
|
+
- Updated dependencies [ac04b76]
|
|
41
|
+
- Updated dependencies [619097e]
|
|
42
|
+
- @object-ui/i18n@13.0.0
|
|
43
|
+
- @object-ui/components@13.0.0
|
|
44
|
+
- @object-ui/types@13.0.0
|
|
45
|
+
- @object-ui/fields@13.0.0
|
|
46
|
+
- @object-ui/plugin-form@13.0.0
|
|
47
|
+
- @object-ui/plugin-grid@13.0.0
|
|
48
|
+
- @object-ui/react@13.0.0
|
|
49
|
+
- @object-ui/core@13.0.0
|
|
50
|
+
- @object-ui/data-objectstack@13.0.0
|
|
51
|
+
|
|
52
|
+
## 12.1.0
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- Updated dependencies [6cbccf3]
|
|
57
|
+
- Updated dependencies [e1840bf]
|
|
58
|
+
- Updated dependencies [c31874d]
|
|
59
|
+
- Updated dependencies [195121a]
|
|
60
|
+
- @object-ui/components@12.1.0
|
|
61
|
+
- @object-ui/fields@12.1.0
|
|
62
|
+
- @object-ui/i18n@12.1.0
|
|
63
|
+
- @object-ui/types@12.1.0
|
|
64
|
+
- @object-ui/plugin-form@12.1.0
|
|
65
|
+
- @object-ui/plugin-grid@12.1.0
|
|
66
|
+
- @object-ui/react@12.1.0
|
|
67
|
+
- @object-ui/core@12.1.0
|
|
68
|
+
- @object-ui/data-objectstack@12.1.0
|
|
69
|
+
|
|
70
|
+
## 12.0.0
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- Updated dependencies [226fde9]
|
|
75
|
+
- Updated dependencies [e36a9c7]
|
|
76
|
+
- Updated dependencies [e4de456]
|
|
77
|
+
- Updated dependencies [68e2d1c]
|
|
78
|
+
- @object-ui/types@12.0.0
|
|
79
|
+
- @object-ui/core@12.0.0
|
|
80
|
+
- @object-ui/components@12.0.0
|
|
81
|
+
- @object-ui/fields@12.0.0
|
|
82
|
+
- @object-ui/plugin-form@12.0.0
|
|
83
|
+
- @object-ui/plugin-grid@12.0.0
|
|
84
|
+
- @object-ui/data-objectstack@12.0.0
|
|
85
|
+
- @object-ui/react@12.0.0
|
|
86
|
+
- @object-ui/i18n@12.0.0
|
|
87
|
+
|
|
3
88
|
## 11.5.0
|
|
4
89
|
|
|
5
90
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -607,8 +607,8 @@ function vt({ canvas: e = {
|
|
|
607
607
|
height: i?.height ?? 100
|
|
608
608
|
},
|
|
609
609
|
props: r?.defaultProps ?? {}
|
|
610
|
-
};
|
|
611
|
-
_(
|
|
610
|
+
}, o = [...g, a];
|
|
611
|
+
_(o), x.selectOne(a.id), k({
|
|
612
612
|
type: "insert",
|
|
613
613
|
elementId: a.id,
|
|
614
614
|
data: { component: a }
|
|
@@ -621,11 +621,13 @@ function vt({ canvas: e = {
|
|
|
621
621
|
x,
|
|
622
622
|
k
|
|
623
623
|
]), te = i((e) => {
|
|
624
|
-
|
|
624
|
+
if (d) return;
|
|
625
|
+
let t = g.filter((t) => t.id !== e);
|
|
626
|
+
_(t), x.isSelected(e) && x.clearSelection(), k({
|
|
625
627
|
type: "delete",
|
|
626
628
|
elementId: e,
|
|
627
629
|
data: {}
|
|
628
|
-
})
|
|
630
|
+
});
|
|
629
631
|
}, [
|
|
630
632
|
g,
|
|
631
633
|
d,
|
|
@@ -634,8 +636,8 @@ function vt({ canvas: e = {
|
|
|
634
636
|
k
|
|
635
637
|
]), ne = i(async () => {
|
|
636
638
|
if (d || x.count === 0 || !await E.confirm("Delete components", `Are you sure you want to delete ${x.count} component${x.count > 1 ? "s" : ""}?`)) return;
|
|
637
|
-
let e = x.selectedIds;
|
|
638
|
-
_(
|
|
639
|
+
let e = x.selectedIds, t = g.filter((t) => !e.has(t.id));
|
|
640
|
+
_(t), x.clearSelection(), e.forEach((e) => {
|
|
639
641
|
k({
|
|
640
642
|
type: "delete",
|
|
641
643
|
elementId: e,
|
|
@@ -650,7 +652,8 @@ function vt({ canvas: e = {
|
|
|
650
652
|
_,
|
|
651
653
|
k
|
|
652
654
|
]), re = i((e, t) => {
|
|
653
|
-
d || !S
|
|
655
|
+
if (d || !S) return;
|
|
656
|
+
let n = g.map((n) => n.id === S ? e === "label" ? {
|
|
654
657
|
...n,
|
|
655
658
|
label: String(t)
|
|
656
659
|
} : e === "x" ? {
|
|
@@ -683,11 +686,12 @@ function vt({ canvas: e = {
|
|
|
683
686
|
...n.props,
|
|
684
687
|
[e]: t
|
|
685
688
|
}
|
|
686
|
-
} : n)
|
|
689
|
+
} : n);
|
|
690
|
+
_(n), k({
|
|
687
691
|
type: "update",
|
|
688
692
|
elementId: S,
|
|
689
693
|
data: { [e]: t }
|
|
690
|
-
})
|
|
694
|
+
});
|
|
691
695
|
}, [
|
|
692
696
|
d,
|
|
693
697
|
S,
|
|
@@ -715,8 +719,8 @@ function vt({ canvas: e = {
|
|
|
715
719
|
x: e.position.x + 20,
|
|
716
720
|
y: e.position.y + 20
|
|
717
721
|
}
|
|
718
|
-
}));
|
|
719
|
-
_(
|
|
722
|
+
})), r = [...g, ...n];
|
|
723
|
+
_(r), x.selectMany(n.map((e) => e.id)), n.forEach((e) => {
|
|
720
724
|
k({
|
|
721
725
|
type: "insert",
|
|
722
726
|
elementId: e.id,
|
|
@@ -742,15 +746,15 @@ function vt({ canvas: e = {
|
|
|
742
746
|
e.preventDefault();
|
|
743
747
|
let t = L.current;
|
|
744
748
|
if (!t || d) return;
|
|
745
|
-
let n = (e.clientX - t.startX) / y, r = (e.clientY - t.startY) / y
|
|
746
|
-
_(g.map((e) => e.id === t.id ? {
|
|
749
|
+
let n = (e.clientX - t.startX) / y, r = (e.clientY - t.startY) / y, i = g.map((e) => e.id === t.id ? {
|
|
747
750
|
...e,
|
|
748
751
|
position: {
|
|
749
752
|
...e.position,
|
|
750
753
|
x: z(e.position.x + n),
|
|
751
754
|
y: z(e.position.y + r)
|
|
752
755
|
}
|
|
753
|
-
} : e)
|
|
756
|
+
} : e);
|
|
757
|
+
_(i), k({
|
|
754
758
|
type: "move",
|
|
755
759
|
elementId: t.id,
|
|
756
760
|
data: {}
|
|
@@ -1343,11 +1347,11 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1343
1347
|
x: 50 + e.entities.length % 4 * 280,
|
|
1344
1348
|
y: 50 + Math.floor(e.entities.length / 4) * 250
|
|
1345
1349
|
}
|
|
1346
|
-
}
|
|
1347
|
-
_({
|
|
1350
|
+
}, n = {
|
|
1348
1351
|
entities: [...e.entities, t],
|
|
1349
1352
|
relationships: e.relationships
|
|
1350
|
-
}
|
|
1353
|
+
};
|
|
1354
|
+
_(n), x.selectOne(t.id), D?.sendOperation({
|
|
1351
1355
|
type: "insert",
|
|
1352
1356
|
userId: D?.currentUserId ?? "",
|
|
1353
1357
|
elementId: t.id,
|
|
@@ -1366,11 +1370,11 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1366
1370
|
if (a) return;
|
|
1367
1371
|
let t = m.find((t) => t.id === e);
|
|
1368
1372
|
if (!await y.confirm("Delete Entity", `Are you sure you want to delete "${t?.label ?? e}"? This action cannot be undone.`)) return;
|
|
1369
|
-
let n = p.current
|
|
1370
|
-
_({
|
|
1373
|
+
let n = p.current, r = {
|
|
1371
1374
|
entities: n.entities.filter((t) => t.id !== e),
|
|
1372
1375
|
relationships: n.relationships.filter((t) => t.sourceEntity !== e && t.targetEntity !== e)
|
|
1373
|
-
}
|
|
1376
|
+
};
|
|
1377
|
+
_(r), x.isSelected(e) && x.clearSelection(), D?.sendOperation({
|
|
1374
1378
|
type: "delete",
|
|
1375
1379
|
userId: D?.currentUserId ?? "",
|
|
1376
1380
|
elementId: e,
|
|
@@ -1388,11 +1392,11 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1388
1392
|
if (a || x.count === 0) return;
|
|
1389
1393
|
let e = Array.from(x.selectedIds);
|
|
1390
1394
|
if (!await y.confirm("Delete Entities", `Are you sure you want to delete ${e.length} selected entity(s)? This action cannot be undone.`)) return;
|
|
1391
|
-
let t = p.current, n = new Set(e)
|
|
1392
|
-
_({
|
|
1395
|
+
let t = p.current, n = new Set(e), r = {
|
|
1393
1396
|
entities: t.entities.filter((e) => !n.has(e.id)),
|
|
1394
1397
|
relationships: t.relationships.filter((e) => !n.has(e.sourceEntity) && !n.has(e.targetEntity))
|
|
1395
|
-
}
|
|
1398
|
+
};
|
|
1399
|
+
_(r), x.clearSelection();
|
|
1396
1400
|
}, [
|
|
1397
1401
|
a,
|
|
1398
1402
|
x,
|
|
@@ -1401,11 +1405,11 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1401
1405
|
_
|
|
1402
1406
|
]), ie = i(() => {
|
|
1403
1407
|
if (a) return;
|
|
1404
|
-
let e = p.current
|
|
1405
|
-
_({
|
|
1408
|
+
let e = p.current, t = {
|
|
1406
1409
|
entities: Ct(e.entities),
|
|
1407
1410
|
relationships: e.relationships
|
|
1408
|
-
}
|
|
1411
|
+
};
|
|
1412
|
+
_(t);
|
|
1409
1413
|
}, [
|
|
1410
1414
|
a,
|
|
1411
1415
|
p,
|
|
@@ -1430,11 +1434,11 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1430
1434
|
x: e.position.x + 30,
|
|
1431
1435
|
y: e.position.y + 30
|
|
1432
1436
|
}
|
|
1433
|
-
}))
|
|
1434
|
-
_({
|
|
1437
|
+
})), r = {
|
|
1435
1438
|
entities: [...t.entities, ...n],
|
|
1436
1439
|
relationships: t.relationships
|
|
1437
|
-
}
|
|
1440
|
+
};
|
|
1441
|
+
_(r), x.selectMany(n.map((e) => e.id));
|
|
1438
1442
|
}, [
|
|
1439
1443
|
a,
|
|
1440
1444
|
C,
|
|
@@ -1443,8 +1447,7 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1443
1447
|
x
|
|
1444
1448
|
]), oe = i((e) => {
|
|
1445
1449
|
if (a) return;
|
|
1446
|
-
let t = p.current
|
|
1447
|
-
_({
|
|
1450
|
+
let t = p.current, n = {
|
|
1448
1451
|
entities: t.entities.map((t) => {
|
|
1449
1452
|
if (t.id !== e) return t;
|
|
1450
1453
|
let n = {
|
|
@@ -1458,7 +1461,8 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1458
1461
|
};
|
|
1459
1462
|
}),
|
|
1460
1463
|
relationships: t.relationships
|
|
1461
|
-
}
|
|
1464
|
+
};
|
|
1465
|
+
_(n);
|
|
1462
1466
|
}, [
|
|
1463
1467
|
a,
|
|
1464
1468
|
p,
|
|
@@ -1475,8 +1479,7 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1475
1479
|
N(null);
|
|
1476
1480
|
return;
|
|
1477
1481
|
}
|
|
1478
|
-
let t = p.current
|
|
1479
|
-
_({
|
|
1482
|
+
let t = p.current, n = {
|
|
1480
1483
|
entities: t.entities.map((t) => {
|
|
1481
1484
|
if (t.id !== M.entityId) return t;
|
|
1482
1485
|
let n = t.fields.map((t, n) => n === M.fieldIndex ? {
|
|
@@ -1489,7 +1492,8 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1489
1492
|
};
|
|
1490
1493
|
}),
|
|
1491
1494
|
relationships: t.relationships
|
|
1492
|
-
}
|
|
1495
|
+
};
|
|
1496
|
+
_(n), N(null);
|
|
1493
1497
|
}, [
|
|
1494
1498
|
M,
|
|
1495
1499
|
F,
|
|
@@ -1506,14 +1510,14 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1506
1510
|
R(null);
|
|
1507
1511
|
return;
|
|
1508
1512
|
}
|
|
1509
|
-
let t = p.current
|
|
1510
|
-
_({
|
|
1513
|
+
let t = p.current, n = {
|
|
1511
1514
|
entities: t.entities.map((t) => t.id === L ? {
|
|
1512
1515
|
...t,
|
|
1513
1516
|
label: e
|
|
1514
1517
|
} : t),
|
|
1515
1518
|
relationships: t.relationships
|
|
1516
|
-
}
|
|
1519
|
+
};
|
|
1520
|
+
_(n), R(null);
|
|
1517
1521
|
}, [
|
|
1518
1522
|
L,
|
|
1519
1523
|
z,
|
|
@@ -1523,8 +1527,7 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1523
1527
|
R(null);
|
|
1524
1528
|
}, []), pe = i((e, t, n) => {
|
|
1525
1529
|
if (a) return;
|
|
1526
|
-
let r = p.current
|
|
1527
|
-
_({
|
|
1530
|
+
let r = p.current, i = {
|
|
1528
1531
|
entities: r.entities.map((r) => {
|
|
1529
1532
|
if (r.id !== e) return r;
|
|
1530
1533
|
let i = r.fields.map((e, r) => r === t ? {
|
|
@@ -1537,7 +1540,8 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1537
1540
|
};
|
|
1538
1541
|
}),
|
|
1539
1542
|
relationships: r.relationships
|
|
1540
|
-
}
|
|
1543
|
+
};
|
|
1544
|
+
_(i);
|
|
1541
1545
|
}, [
|
|
1542
1546
|
a,
|
|
1543
1547
|
p,
|
|
@@ -1554,8 +1558,7 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1554
1558
|
e.preventDefault(), e.dataTransfer.dropEffect = "move";
|
|
1555
1559
|
}, []), ge = i((e) => {
|
|
1556
1560
|
if (e.preventDefault(), !B.current) return;
|
|
1557
|
-
let t = e.currentTarget.getBoundingClientRect(), n = E.zoom, r = (e.clientX - t.left - E.panOffset.x) / n - B.current.offsetX, i = (e.clientY - t.top - E.panOffset.y) / n - B.current.offsetY, a = p.current
|
|
1558
|
-
_({
|
|
1561
|
+
let t = e.currentTarget.getBoundingClientRect(), n = E.zoom, r = (e.clientX - t.left - E.panOffset.x) / n - B.current.offsetX, i = (e.clientY - t.top - E.panOffset.y) / n - B.current.offsetY, a = p.current, o = {
|
|
1559
1562
|
entities: a.entities.map((e) => e.id === B.current.entityId ? {
|
|
1560
1563
|
...e,
|
|
1561
1564
|
position: {
|
|
@@ -1564,7 +1567,8 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1564
1567
|
}
|
|
1565
1568
|
} : e),
|
|
1566
1569
|
relationships: a.relationships
|
|
1567
|
-
}
|
|
1570
|
+
};
|
|
1571
|
+
_(o), B.current = null;
|
|
1568
1572
|
}, [
|
|
1569
1573
|
E.zoom,
|
|
1570
1574
|
E.panOffset,
|
|
@@ -1615,8 +1619,7 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1615
1619
|
}
|
|
1616
1620
|
] : [], _e = i((e, t) => {
|
|
1617
1621
|
if (!S) return;
|
|
1618
|
-
let n = p.current
|
|
1619
|
-
_({
|
|
1622
|
+
let n = p.current, r = {
|
|
1620
1623
|
entities: n.entities.map((n) => n.id === S ? e === "position.x" ? {
|
|
1621
1624
|
...n,
|
|
1622
1625
|
position: {
|
|
@@ -1634,7 +1637,8 @@ function wt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1634
1637
|
[e]: t
|
|
1635
1638
|
} : n),
|
|
1636
1639
|
relationships: n.relationships
|
|
1637
|
-
}
|
|
1640
|
+
};
|
|
1641
|
+
_(r);
|
|
1638
1642
|
}, [
|
|
1639
1643
|
S,
|
|
1640
1644
|
p,
|
|
@@ -2057,8 +2061,8 @@ function kt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2057
2061
|
x: 200 + _.length * 160,
|
|
2058
2062
|
y: 200
|
|
2059
2063
|
}
|
|
2060
|
-
};
|
|
2061
|
-
y(
|
|
2064
|
+
}, r = [..._, n];
|
|
2065
|
+
y(r, v), k(n.id), S.selectOne(n.id), D?.sendOperation({
|
|
2062
2066
|
type: "insert",
|
|
2063
2067
|
elementId: n.id,
|
|
2064
2068
|
data: { label: t },
|
|
@@ -2074,12 +2078,14 @@ function kt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2074
2078
|
]), oe = i(async (e) => {
|
|
2075
2079
|
if (f) return;
|
|
2076
2080
|
let t = _.find((t) => t.id === e);
|
|
2077
|
-
await x.confirm("Delete Node", `Are you sure you want to delete "${t?.label ?? e}"? This will also remove all connected edges.`)
|
|
2081
|
+
if (!await x.confirm("Delete Node", `Are you sure you want to delete "${t?.label ?? e}"? This will also remove all connected edges.`)) return;
|
|
2082
|
+
let n = _.filter((t) => t.id !== e), r = v.filter((t) => t.source !== e && t.target !== e);
|
|
2083
|
+
y(n, r), O === e && k(null), S.clearSelection(), D?.sendOperation({
|
|
2078
2084
|
type: "delete",
|
|
2079
2085
|
elementId: e,
|
|
2080
2086
|
data: {},
|
|
2081
2087
|
userId: D.currentUserId ?? ""
|
|
2082
|
-
})
|
|
2088
|
+
});
|
|
2083
2089
|
}, [
|
|
2084
2090
|
_,
|
|
2085
2091
|
v,
|
|
@@ -2091,8 +2097,8 @@ function kt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2091
2097
|
D
|
|
2092
2098
|
]), se = i(async () => {
|
|
2093
2099
|
if (f || S.count === 0 || !await x.confirm("Delete Selected Nodes", `Are you sure you want to delete ${S.count} selected node(s) and their connected edges?`)) return;
|
|
2094
|
-
let e = S.selectedIds;
|
|
2095
|
-
y(
|
|
2100
|
+
let e = S.selectedIds, t = _.filter((t) => !e.has(t.id)), n = v.filter((t) => !e.has(t.source) && !e.has(t.target));
|
|
2101
|
+
y(t, n), k(null), S.clearSelection();
|
|
2096
2102
|
}, [
|
|
2097
2103
|
_,
|
|
2098
2104
|
v,
|
|
@@ -2121,8 +2127,8 @@ function kt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2121
2127
|
x: e.position.x + 40,
|
|
2122
2128
|
y: e.position.y + 40
|
|
2123
2129
|
}
|
|
2124
|
-
}));
|
|
2125
|
-
y(
|
|
2130
|
+
})), n = [..._, ...t];
|
|
2131
|
+
y(n, v), S.selectMany(t.map((e) => e.id)), k(t[0].id);
|
|
2126
2132
|
}, [
|
|
2127
2133
|
f,
|
|
2128
2134
|
_,
|
|
@@ -2140,8 +2146,8 @@ function kt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2140
2146
|
id: `edge-${Date.now()}`,
|
|
2141
2147
|
source: N,
|
|
2142
2148
|
target: e
|
|
2143
|
-
};
|
|
2144
|
-
return y(_,
|
|
2149
|
+
}, n = [...v, t];
|
|
2150
|
+
return y(_, n), P(null), j(!1), D?.sendOperation({
|
|
2145
2151
|
type: "insert",
|
|
2146
2152
|
elementId: t.id,
|
|
2147
2153
|
data: {
|
|
@@ -2158,7 +2164,9 @@ function kt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2158
2164
|
y,
|
|
2159
2165
|
D
|
|
2160
2166
|
]), fe = i(() => {
|
|
2161
|
-
f || _.length === 0
|
|
2167
|
+
if (f || _.length === 0) return;
|
|
2168
|
+
let e = Ot(_, v);
|
|
2169
|
+
y(e, v);
|
|
2162
2170
|
}, [
|
|
2163
2171
|
_,
|
|
2164
2172
|
v,
|
|
@@ -2174,14 +2182,14 @@ function kt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2174
2182
|
}), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", t);
|
|
2175
2183
|
}, [f, _]), me = i((e) => {
|
|
2176
2184
|
if (e.preventDefault(), f || !z) return;
|
|
2177
|
-
let t = e.currentTarget.getBoundingClientRect(), n = T.zoom, r = (e.clientX - t.left - T.panOffset.x) / n - te.x, i = (e.clientY - t.top - T.panOffset.y) / n - te.y, a = Math.max(0, Math.round(r / 20) * 20), o = Math.max(0, Math.round(i / 20) * 20)
|
|
2178
|
-
y(_.map((e) => e.id === z ? {
|
|
2185
|
+
let t = e.currentTarget.getBoundingClientRect(), n = T.zoom, r = (e.clientX - t.left - T.panOffset.x) / n - te.x, i = (e.clientY - t.top - T.panOffset.y) / n - te.y, a = Math.max(0, Math.round(r / 20) * 20), o = Math.max(0, Math.round(i / 20) * 20), s = _.map((e) => e.id === z ? {
|
|
2179
2186
|
...e,
|
|
2180
2187
|
position: {
|
|
2181
2188
|
x: a,
|
|
2182
2189
|
y: o
|
|
2183
2190
|
}
|
|
2184
|
-
} : e)
|
|
2191
|
+
} : e);
|
|
2192
|
+
y(s, v), ee(null);
|
|
2185
2193
|
}, [
|
|
2186
2194
|
f,
|
|
2187
2195
|
z,
|
|
@@ -2250,10 +2258,12 @@ function kt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2250
2258
|
group: "General"
|
|
2251
2259
|
}
|
|
2252
2260
|
] : [], [W]), ve = i((e, t) => {
|
|
2253
|
-
f || !O
|
|
2261
|
+
if (f || !O) return;
|
|
2262
|
+
let n = _.map((n) => n.id === O ? {
|
|
2254
2263
|
...n,
|
|
2255
2264
|
[e]: t
|
|
2256
|
-
} : n)
|
|
2265
|
+
} : n);
|
|
2266
|
+
y(n, v);
|
|
2257
2267
|
}, [
|
|
2258
2268
|
f,
|
|
2259
2269
|
O,
|
|
@@ -2790,11 +2800,11 @@ function Nt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
2790
2800
|
text: t === "text" ? "New Text" : void 0,
|
|
2791
2801
|
field: t === "field" ? "field_name" : void 0
|
|
2792
2802
|
}
|
|
2793
|
-
}
|
|
2794
|
-
y(v.map((t, r) => r === e ? {
|
|
2803
|
+
}, r = v.map((t, r) => r === e ? {
|
|
2795
2804
|
...t,
|
|
2796
2805
|
elements: [...t.elements, n]
|
|
2797
|
-
} : t)
|
|
2806
|
+
} : t);
|
|
2807
|
+
y(r), x.selectOne(n.id), D({
|
|
2798
2808
|
type: "insert",
|
|
2799
2809
|
elementId: n.id,
|
|
2800
2810
|
data: { element: n }
|
|
@@ -2807,14 +2817,16 @@ function Nt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
2807
2817
|
x,
|
|
2808
2818
|
D
|
|
2809
2819
|
]), ee = i((e) => {
|
|
2810
|
-
|
|
2820
|
+
if (m) return;
|
|
2821
|
+
let t = v.map((t) => ({
|
|
2811
2822
|
...t,
|
|
2812
2823
|
elements: t.elements.filter((t) => t.id !== e)
|
|
2813
|
-
}))
|
|
2824
|
+
}));
|
|
2825
|
+
y(t), x.isSelected(e) && x.clearSelection(), D({
|
|
2814
2826
|
type: "delete",
|
|
2815
2827
|
elementId: e,
|
|
2816
2828
|
data: {}
|
|
2817
|
-
})
|
|
2829
|
+
});
|
|
2818
2830
|
}, [
|
|
2819
2831
|
v,
|
|
2820
2832
|
m,
|
|
@@ -2823,11 +2835,11 @@ function Nt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
2823
2835
|
D
|
|
2824
2836
|
]), B = i(async () => {
|
|
2825
2837
|
if (m || x.count === 0 || !await T.confirm(Z.deleteElementsTitle, Z.deleteElementMessage(x.count))) return;
|
|
2826
|
-
let e = x.selectedIds
|
|
2827
|
-
y(v.map((t) => ({
|
|
2838
|
+
let e = x.selectedIds, t = v.map((t) => ({
|
|
2828
2839
|
...t,
|
|
2829
2840
|
elements: t.elements.filter((t) => !e.has(t.id))
|
|
2830
|
-
}))
|
|
2841
|
+
}));
|
|
2842
|
+
y(t), x.clearSelection(), e.forEach((e) => {
|
|
2831
2843
|
D({
|
|
2832
2844
|
type: "delete",
|
|
2833
2845
|
elementId: e,
|
|
@@ -2842,7 +2854,8 @@ function Nt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
2842
2854
|
y,
|
|
2843
2855
|
D
|
|
2844
2856
|
]), te = i((e, t) => {
|
|
2845
|
-
m || !S
|
|
2857
|
+
if (m || !S) return;
|
|
2858
|
+
let n = v.map((n) => ({
|
|
2846
2859
|
...n,
|
|
2847
2860
|
elements: n.elements.map((n) => n.id === S ? e === "x" ? {
|
|
2848
2861
|
...n,
|
|
@@ -2875,11 +2888,12 @@ function Nt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
2875
2888
|
[e]: t
|
|
2876
2889
|
}
|
|
2877
2890
|
} : n)
|
|
2878
|
-
}))
|
|
2891
|
+
}));
|
|
2892
|
+
y(n), D({
|
|
2879
2893
|
type: "update",
|
|
2880
2894
|
elementId: S,
|
|
2881
2895
|
data: { [e]: t }
|
|
2882
|
-
})
|
|
2896
|
+
});
|
|
2883
2897
|
}, [
|
|
2884
2898
|
m,
|
|
2885
2899
|
S,
|
|
@@ -2907,11 +2921,11 @@ function Nt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
2907
2921
|
x: e.position.x + 20,
|
|
2908
2922
|
y: e.position.y + 20
|
|
2909
2923
|
}
|
|
2910
|
-
})), r = v.findIndex((e) => e.type === "detail"), i = r >= 0 ? r : 0
|
|
2911
|
-
y(v.map((e, t) => t === i ? {
|
|
2924
|
+
})), r = v.findIndex((e) => e.type === "detail"), i = r >= 0 ? r : 0, a = v.map((e, t) => t === i ? {
|
|
2912
2925
|
...e,
|
|
2913
2926
|
elements: [...e.elements, ...n]
|
|
2914
|
-
} : e)
|
|
2927
|
+
} : e);
|
|
2928
|
+
y(a), x.selectMany(n.map((e) => e.id)), n.forEach((e) => {
|
|
2915
2929
|
D({
|
|
2916
2930
|
type: "insert",
|
|
2917
2931
|
elementId: e.id,
|
|
@@ -2939,18 +2953,20 @@ function Nt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
2939
2953
|
let n = j.current;
|
|
2940
2954
|
if (!n || m) return;
|
|
2941
2955
|
let r = e.clientX - n.startX, i = e.clientY - n.startY;
|
|
2942
|
-
if (n.sectionIndex === t)
|
|
2943
|
-
|
|
2944
|
-
elements: e.elements.map((e) => e.id === n.id ? {
|
|
2956
|
+
if (n.sectionIndex === t) {
|
|
2957
|
+
let e = v.map((e, a) => a === t ? {
|
|
2945
2958
|
...e,
|
|
2946
|
-
|
|
2947
|
-
...e
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2959
|
+
elements: e.elements.map((e) => e.id === n.id ? {
|
|
2960
|
+
...e,
|
|
2961
|
+
position: {
|
|
2962
|
+
...e.position,
|
|
2963
|
+
x: Math.max(0, e.position.x + r),
|
|
2964
|
+
y: Math.max(0, (typeof e.position.y == "number" ? e.position.y : 0) + i)
|
|
2965
|
+
}
|
|
2966
|
+
} : e)
|
|
2967
|
+
} : e);
|
|
2968
|
+
y(e);
|
|
2969
|
+
} else {
|
|
2954
2970
|
let e = null, i = v.map((t, i) => {
|
|
2955
2971
|
if (i !== n.sectionIndex) return t;
|
|
2956
2972
|
let a = t.elements.find((e) => e.id === n.id);
|
|
@@ -2966,10 +2982,13 @@ function Nt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
2966
2982
|
elements: t.elements.filter((e) => e.id !== n.id)
|
|
2967
2983
|
};
|
|
2968
2984
|
});
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2985
|
+
if (e) {
|
|
2986
|
+
let n = i.map((n, r) => r === t ? {
|
|
2987
|
+
...n,
|
|
2988
|
+
elements: [...n.elements, e]
|
|
2989
|
+
} : n);
|
|
2990
|
+
y(n);
|
|
2991
|
+
}
|
|
2973
2992
|
}
|
|
2974
2993
|
D({
|
|
2975
2994
|
type: "move",
|