@metadev/daga 5.1.0 → 5.1.1

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/index.cjs.js CHANGED
@@ -1172,7 +1172,9 @@ exports.CursorStyle = void 0;
1172
1172
  CursorStyle["Grabbing"] = "grabbing";
1173
1173
  CursorStyle["Move"] = "move";
1174
1174
  CursorStyle["NoDrop"] = "no-drop";
1175
+ CursorStyle["NESWResize"] = "nesw-resize";
1175
1176
  CursorStyle["NSResize"] = "ns-resize";
1177
+ CursorStyle["NWSEResize"] = "nwse-resize";
1176
1178
  CursorStyle["NotAllowed"] = "not-allowed";
1177
1179
  CursorStyle["ZoomIn"] = "zoom-in";
1178
1180
  CursorStyle["ZoomOut"] = "zoom-out";
@@ -1271,283 +1273,6 @@ const extractLooksFromConfig = lookConfig => {
1271
1273
  };
1272
1274
  };
1273
1275
 
1274
- /**
1275
- * Represents a collection of diagram entities of a type that exists as part of a diagram model.
1276
- * @public
1277
- * @see DiagramEntity
1278
- * @see DiagramModel
1279
- */
1280
- class DiagramEntitySet {
1281
- constructor() {
1282
- /**
1283
- * The list of entities contained in this set.
1284
- * @private
1285
- */
1286
- this.entities = [];
1287
- /**
1288
- * A mapping of entity ids to their corresponding entity in this set for quickly fetching entities based on their id.
1289
- * @private
1290
- */
1291
- this.entityMap = {};
1292
- }
1293
- /**
1294
- * The number of entities in this set.
1295
- * @public
1296
- */
1297
- get length() {
1298
- return this.size();
1299
- }
1300
- /**
1301
- * Gets all of the entities of this set.
1302
- * @public
1303
- * @returns An array containing all of the entities of this set.
1304
- */
1305
- all() {
1306
- return [...this.entities];
1307
- }
1308
- /**
1309
- * Adds an entity to this set if there are no entities with the same id. Has no effect if there already exists an entity with the same id as the given entity.
1310
- * For creating entities with relationships with other entities, the new() method should be used instead. The add() method adds an entity but doesn't take care of setting that entity's relationships with other entities.
1311
- * @private
1312
- * @param entity An entity to be added to this set.
1313
- */
1314
- add(entity) {
1315
- if (this.entityMap[entity.id] === undefined) {
1316
- this.entityMap[entity.id] = entity;
1317
- this.entities.push(entity);
1318
- }
1319
- }
1320
- /**
1321
- * Removes all the entities in this set.
1322
- * @public
1323
- */
1324
- clear() {
1325
- // remove each entity individually in case classes that extend this implement their own specific cleanup
1326
- while (this.entities.length > 0) {
1327
- this.remove(this.entities[0].id);
1328
- }
1329
- }
1330
- /**
1331
- * Checks if this set contains an entity with the given id.
1332
- * @public
1333
- * @param id An id.
1334
- * @returns `true` if this set contains an entity with the given id, `false` otherwise.
1335
- */
1336
- contains(id) {
1337
- return this.entityMap[id] !== undefined;
1338
- }
1339
- /**
1340
- * Counts the number of entities of this set following the given criteria.
1341
- * @public
1342
- * @returns The number of entities of this set following the given criteria.
1343
- */
1344
- count(predicate) {
1345
- return this.entities.filter(predicate).length;
1346
- }
1347
- /**
1348
- * Gets all of the entities of this set filtered following given criteria.
1349
- * @public
1350
- * @returns An array containing the entities of this set that meet the given criteria.
1351
- */
1352
- filter(predicate) {
1353
- return this.entities.filter(predicate);
1354
- }
1355
- /**
1356
- * Gets an entity of this set matching specific criteria.
1357
- * @public
1358
- * @returns An entity of this set.
1359
- */
1360
- find(predicate) {
1361
- return this.entities.find(predicate);
1362
- }
1363
- /**
1364
- * Gets an entity from this set.
1365
- * @public
1366
- * @param id An id.
1367
- * @returns An entity with the given id, or `undefined` if there are no entities with the given id.
1368
- */
1369
- get(id) {
1370
- return this.entityMap[id];
1371
- }
1372
- /**
1373
- * Gets all of the entities of this set mapped to the result of the given function applied to them.
1374
- * @public
1375
- * @returns An array containing the entities of this set that meet the given criteria.
1376
- */
1377
- map(callback) {
1378
- return this.entities.map(callback);
1379
- }
1380
- /**
1381
- * Attempts to find and remove an entity with the given id. Has no effect if there are no entities with the given id.
1382
- * @public
1383
- * @param id An id.
1384
- */
1385
- remove(id) {
1386
- const entity = this.get(id);
1387
- if (entity !== undefined) {
1388
- delete this.entityMap[id];
1389
- removeIfExists(this.entities, entity);
1390
- }
1391
- }
1392
- /**
1393
- * Gets the number of entities in this set.
1394
- * @public
1395
- */
1396
- size() {
1397
- return this.entities.length;
1398
- }
1399
- /**
1400
- * Iterator to iterate over the entities of this set.
1401
- * @public
1402
- */
1403
- *[Symbol.iterator]() {
1404
- for (const entity of this.entities) {
1405
- yield entity;
1406
- }
1407
- }
1408
- }
1409
-
1410
- /**
1411
- * Default priority value for diagram elements.
1412
- * @private
1413
- */
1414
- const DEFAULT_PRIORITY = 0;
1415
- /**
1416
- * Represents an object which exists as part of a specific diagram model and has a visual representation in a diagram canvas.
1417
- * @public
1418
- * @see DiagramModel
1419
- * @see DiagramCanvas
1420
- */
1421
- class DiagramElement {
1422
- /**
1423
- * Identifier that uniquely identifies this element within its diagram model. Cannot be an empty string.
1424
- * @public
1425
- */
1426
- get id() {
1427
- return this._id;
1428
- }
1429
- /**
1430
- * Whether this diagram element is currently in the user highlight.
1431
- * @private
1432
- */
1433
- get highlighted() {
1434
- var _a, _b;
1435
- return ((_b = (_a = this.model.canvas) === null || _a === void 0 ? void 0 : _a.userHighlight) === null || _b === void 0 ? void 0 : _b.contains(this.id)) || false;
1436
- }
1437
- /**
1438
- * Whether this diagram element is currently in the user selection.
1439
- */
1440
- get selected() {
1441
- var _a, _b;
1442
- return ((_b = (_a = this.model.canvas) === null || _a === void 0 ? void 0 : _a.userSelection) === null || _b === void 0 ? void 0 : _b.contains(this.id)) || false;
1443
- }
1444
- constructor(model, id) {
1445
- /**
1446
- * Whether this diagram element has itself been explicitly removed.
1447
- *
1448
- * Override the `removed` getter so that it returns true if and only if:
1449
- * - `selfRemoved` is true, or
1450
- * - `removed` is true for any of this element's dependencies.
1451
- *
1452
- * For example, a DiagramConnection is removed if either of its ports are removed,
1453
- * even if the connection's own `selfRemoved` field is false.
1454
- * @private
1455
- */
1456
- this.selfRemoved = false;
1457
- /**
1458
- * Collaborative timestamp for selfRemoved.
1459
- * @private
1460
- */
1461
- this.selfRemovedTimestamp = null;
1462
- this.model = model;
1463
- this._id = id;
1464
- }
1465
- /**
1466
- * Obtain the selection of this element.
1467
- * @private
1468
- */
1469
- select() {
1470
- var _a, _b;
1471
- return (_b = (_a = this.model.canvas) === null || _a === void 0 ? void 0 : _a.selectCanvasView()) === null || _b === void 0 ? void 0 : _b.select(`[id='${escapeSelector(this.id)}']`);
1472
- }
1473
- }
1474
- class DiagramElementSet extends DiagramEntitySet {
1475
- all(includeRemoved = false) {
1476
- if (includeRemoved) {
1477
- return super.all();
1478
- } else {
1479
- return super.filter(e => !e.removed);
1480
- }
1481
- }
1482
- contains(id, includeRemoved = false) {
1483
- if (includeRemoved) {
1484
- return super.contains(id);
1485
- } else {
1486
- return super.contains(id) && !this.entityMap[id].removed;
1487
- }
1488
- }
1489
- count(predicate, includeRemoved = false) {
1490
- if (includeRemoved) {
1491
- return super.count(predicate);
1492
- } else {
1493
- return super.count((e, i, a) => predicate(e, i, a) && !e.removed);
1494
- }
1495
- }
1496
- filter(predicate, includeRemoved = false) {
1497
- if (includeRemoved) {
1498
- return super.filter(predicate);
1499
- } else {
1500
- return super.filter((e, i, a) => predicate(e, i, a) && !e.removed);
1501
- }
1502
- }
1503
- find(predicate, includeRemoved = false) {
1504
- if (includeRemoved) {
1505
- return super.find(predicate);
1506
- } else {
1507
- return super.find((e, i, a) => predicate(e, i, a) && !e.removed);
1508
- }
1509
- }
1510
- get(id, includeRemoved = false) {
1511
- if (includeRemoved) {
1512
- return super.get(id);
1513
- } else {
1514
- return this.contains(id) ? super.get(id) : undefined;
1515
- }
1516
- }
1517
- map(callback, includeRemoved = false) {
1518
- if (includeRemoved) {
1519
- return super.map(callback);
1520
- } else {
1521
- return super.filter(e => !e.removed).map(callback);
1522
- }
1523
- }
1524
- remove(id) {
1525
- const entity = this.get(id, true);
1526
- if (entity !== undefined) {
1527
- delete this.entityMap[id];
1528
- removeIfExists(this.entities, entity);
1529
- }
1530
- }
1531
- size(includeRemoved = false) {
1532
- if (includeRemoved) {
1533
- return super.size();
1534
- } else {
1535
- return super.filter(e => !e.removed).length;
1536
- }
1537
- }
1538
- *[Symbol.iterator](includeRemoved = false) {
1539
- if (includeRemoved) {
1540
- for (const entity of this.entities) {
1541
- yield entity;
1542
- }
1543
- } else {
1544
- for (const entity of this.entities.filter(e => !e.removed)) {
1545
- yield entity;
1546
- }
1547
- }
1548
- }
1549
- }
1550
-
1551
1276
  /**
1552
1277
  * A property which is part of a property set and defines what values a value in a value set can take.
1553
1278
  * @public
@@ -2044,94 +1769,371 @@ class ValueSet {
2044
1769
  }
2045
1770
  }
2046
1771
  /**
2047
- * Variant of `overwriteValues` that applies last-writer-wins to each key, updating timestamps if appropriate.
2048
- * @private
2049
- * @param values An object containing all values to set the values to.
1772
+ * Variant of `overwriteValues` that applies last-writer-wins to each key, updating timestamps if appropriate.
1773
+ * @private
1774
+ * @param values An object containing all values to set the values to.
1775
+ */
1776
+ overwriteValuesLww(values, timestamp) {
1777
+ for (const key in values) {
1778
+ const property = this.propertySet.getProperty(key);
1779
+ if (property.type === exports.Type.Object) {
1780
+ this.valueSets[key].overwriteValuesLww(values[key], timestamp);
1781
+ } else {
1782
+ if (timestampWins(timestamp, this.ownTimestamps[key])) {
1783
+ this.setValue(key, values[key]);
1784
+ this.ownTimestamps[key] = timestamp;
1785
+ }
1786
+ }
1787
+ }
1788
+ }
1789
+ /**
1790
+ * Sets all the values of this set to the defaults.
1791
+ * If this set has a root element and any of its properties have root attributes, the root element's attributes are also set to the property's default value if one is provided.
1792
+ * @private
1793
+ */
1794
+ resetValues() {
1795
+ this.displayedProperties = [];
1796
+ this.hiddenProperties = [];
1797
+ this.ownTimestamps = {};
1798
+ for (const key in this.propertySet.propertyMap) {
1799
+ const property = this.propertySet.getProperty(key);
1800
+ const rootAttribute = property.rootAttribute;
1801
+ if (property.type === exports.Type.Object) {
1802
+ this.valueSets[key] = this.constructSubValueSet(key);
1803
+ } else {
1804
+ this.values[key] = clone(property.defaultValue);
1805
+ }
1806
+ if (rootAttribute !== undefined && rootAttribute !== null) {
1807
+ if (property.defaultValue !== undefined && !equals(this.getRootElementValue(rootAttribute), property.defaultValue)) {
1808
+ this.setRootElementValue(rootAttribute, this.values[key]);
1809
+ }
1810
+ }
1811
+ if (property.basic !== false) {
1812
+ this.displayedProperties.push(property);
1813
+ } else {
1814
+ this.hiddenProperties.push(property);
1815
+ }
1816
+ }
1817
+ }
1818
+ /**
1819
+ * Constructs a ValueSet with its corresponding PropertySet representing the values of the object.
1820
+ * @private
1821
+ * @param key Key that the ValueSet is under.
1822
+ * @returns The constructed ValueSet.
1823
+ */
1824
+ constructSubValueSet(key) {
1825
+ const property = this.propertySet.getProperty(key);
1826
+ const propertySet = new PropertySet(property.properties);
1827
+ const valueSet = new ValueSet(propertySet, this.rootElement);
1828
+ valueSet.overwriteValues(clone(property.defaultValue));
1829
+ return valueSet;
1830
+ }
1831
+ /**
1832
+ * Gets the ValueSet under the given key when there are nested ValueSets.
1833
+ * @private
1834
+ * @param key A key.
1835
+ * @returns A ValueSet.
1836
+ */
1837
+ getSubValueSet(key) {
1838
+ return this.valueSets[key];
1839
+ }
1840
+ /**
1841
+ * Moves the given property to the list of displayed properties.
1842
+ * @private
1843
+ * @param property A property.
1844
+ */
1845
+ displayProperty(property) {
1846
+ if (!this.displayedProperties.includes(property)) {
1847
+ this.displayedProperties.push(property);
1848
+ removeIfExists(this.hiddenProperties, property);
1849
+ }
1850
+ }
1851
+ /**
1852
+ * Moves the given property to the list of hidden properties.
1853
+ * @private
1854
+ * @param property A property.
1855
+ */
1856
+ hideProperty(property) {
1857
+ if (!this.hiddenProperties.includes(property)) {
1858
+ this.hiddenProperties.push(property);
1859
+ removeIfExists(this.displayedProperties, property);
1860
+ }
1861
+ }
1862
+ }
1863
+
1864
+ /**
1865
+ * Represents a collection of diagram entities of a type that exists as part of a diagram model.
1866
+ * @public
1867
+ * @see DiagramEntity
1868
+ * @see DiagramModel
1869
+ */
1870
+ class DiagramEntitySet {
1871
+ constructor() {
1872
+ /**
1873
+ * The list of entities contained in this set.
1874
+ * @private
1875
+ */
1876
+ this.entities = [];
1877
+ /**
1878
+ * A mapping of entity ids to their corresponding entity in this set for quickly fetching entities based on their id.
1879
+ * @private
1880
+ */
1881
+ this.entityMap = {};
1882
+ }
1883
+ /**
1884
+ * The number of entities in this set.
1885
+ * @public
1886
+ */
1887
+ get length() {
1888
+ return this.size();
1889
+ }
1890
+ /**
1891
+ * Gets all of the entities of this set.
1892
+ * @public
1893
+ * @returns An array containing all of the entities of this set.
1894
+ */
1895
+ all() {
1896
+ return [...this.entities];
1897
+ }
1898
+ /**
1899
+ * Adds an entity to this set if there are no entities with the same id. Has no effect if there already exists an entity with the same id as the given entity.
1900
+ * For creating entities with relationships with other entities, the new() method should be used instead. The add() method adds an entity but doesn't take care of setting that entity's relationships with other entities.
1901
+ * @private
1902
+ * @param entity An entity to be added to this set.
1903
+ */
1904
+ add(entity) {
1905
+ if (this.entityMap[entity.id] === undefined) {
1906
+ this.entityMap[entity.id] = entity;
1907
+ this.entities.push(entity);
1908
+ }
1909
+ }
1910
+ /**
1911
+ * Removes all the entities in this set.
1912
+ * @public
1913
+ */
1914
+ clear() {
1915
+ // remove each entity individually in case classes that extend this implement their own specific cleanup
1916
+ while (this.entities.length > 0) {
1917
+ this.remove(this.entities[0].id);
1918
+ }
1919
+ }
1920
+ /**
1921
+ * Checks if this set contains an entity with the given id.
1922
+ * @public
1923
+ * @param id An id.
1924
+ * @returns `true` if this set contains an entity with the given id, `false` otherwise.
1925
+ */
1926
+ contains(id) {
1927
+ return this.entityMap[id] !== undefined;
1928
+ }
1929
+ /**
1930
+ * Counts the number of entities of this set following the given criteria.
1931
+ * @public
1932
+ * @returns The number of entities of this set following the given criteria.
1933
+ */
1934
+ count(predicate) {
1935
+ return this.entities.filter(predicate).length;
1936
+ }
1937
+ /**
1938
+ * Gets all of the entities of this set filtered following given criteria.
1939
+ * @public
1940
+ * @returns An array containing the entities of this set that meet the given criteria.
1941
+ */
1942
+ filter(predicate) {
1943
+ return this.entities.filter(predicate);
1944
+ }
1945
+ /**
1946
+ * Gets an entity of this set matching specific criteria.
1947
+ * @public
1948
+ * @returns An entity of this set.
1949
+ */
1950
+ find(predicate) {
1951
+ return this.entities.find(predicate);
1952
+ }
1953
+ /**
1954
+ * Gets an entity from this set.
1955
+ * @public
1956
+ * @param id An id.
1957
+ * @returns An entity with the given id, or `undefined` if there are no entities with the given id.
1958
+ */
1959
+ get(id) {
1960
+ return this.entityMap[id];
1961
+ }
1962
+ /**
1963
+ * Gets all of the entities of this set mapped to the result of the given function applied to them.
1964
+ * @public
1965
+ * @returns An array containing the entities of this set that meet the given criteria.
1966
+ */
1967
+ map(callback) {
1968
+ return this.entities.map(callback);
1969
+ }
1970
+ /**
1971
+ * Attempts to find and remove an entity with the given id. Has no effect if there are no entities with the given id.
1972
+ * @public
1973
+ * @param id An id.
1974
+ */
1975
+ remove(id) {
1976
+ const entity = this.get(id);
1977
+ if (entity !== undefined) {
1978
+ delete this.entityMap[id];
1979
+ removeIfExists(this.entities, entity);
1980
+ }
1981
+ }
1982
+ /**
1983
+ * Gets the number of entities in this set.
1984
+ * @public
2050
1985
  */
2051
- overwriteValuesLww(values, timestamp) {
2052
- for (const key in values) {
2053
- const property = this.propertySet.getProperty(key);
2054
- if (property.type === exports.Type.Object) {
2055
- this.valueSets[key].overwriteValuesLww(values[key], timestamp);
2056
- } else {
2057
- if (timestampWins(timestamp, this.ownTimestamps[key])) {
2058
- this.setValue(key, values[key]);
2059
- this.ownTimestamps[key] = timestamp;
2060
- }
2061
- }
2062
- }
1986
+ size() {
1987
+ return this.entities.length;
2063
1988
  }
2064
1989
  /**
2065
- * Sets all the values of this set to the defaults.
2066
- * If this set has a root element and any of its properties have root attributes, the root element's attributes are also set to the property's default value if one is provided.
2067
- * @private
1990
+ * Iterator to iterate over the entities of this set.
1991
+ * @public
2068
1992
  */
2069
- resetValues() {
2070
- this.displayedProperties = [];
2071
- this.hiddenProperties = [];
2072
- this.ownTimestamps = {};
2073
- for (const key in this.propertySet.propertyMap) {
2074
- const property = this.propertySet.getProperty(key);
2075
- const rootAttribute = property.rootAttribute;
2076
- if (property.type === exports.Type.Object) {
2077
- this.valueSets[key] = this.constructSubValueSet(key);
2078
- } else {
2079
- this.values[key] = clone(property.defaultValue);
2080
- }
2081
- if (rootAttribute !== undefined && rootAttribute !== null) {
2082
- if (property.defaultValue !== undefined && !equals(this.getRootElementValue(rootAttribute), property.defaultValue)) {
2083
- this.setRootElementValue(rootAttribute, this.values[key]);
2084
- }
2085
- }
2086
- if (property.basic !== false) {
2087
- this.displayedProperties.push(property);
2088
- } else {
2089
- this.hiddenProperties.push(property);
2090
- }
1993
+ *[Symbol.iterator]() {
1994
+ for (const entity of this.entities) {
1995
+ yield entity;
2091
1996
  }
2092
1997
  }
1998
+ }
1999
+
2000
+ /**
2001
+ * Default priority value for diagram elements.
2002
+ * @private
2003
+ */
2004
+ const DEFAULT_PRIORITY = 0;
2005
+ /**
2006
+ * Represents an object which exists as part of a specific diagram model and has a visual representation in a diagram canvas.
2007
+ * @public
2008
+ * @see DiagramModel
2009
+ * @see DiagramCanvas
2010
+ */
2011
+ class DiagramElement {
2093
2012
  /**
2094
- * Constructs a ValueSet with its corresponding PropertySet representing the values of the object.
2095
- * @private
2096
- * @param key Key that the ValueSet is under.
2097
- * @returns The constructed ValueSet.
2013
+ * Identifier that uniquely identifies this element within its diagram model. Cannot be an empty string.
2014
+ * @public
2098
2015
  */
2099
- constructSubValueSet(key) {
2100
- const property = this.propertySet.getProperty(key);
2101
- const propertySet = new PropertySet(property.properties);
2102
- const valueSet = new ValueSet(propertySet, this.rootElement);
2103
- valueSet.overwriteValues(clone(property.defaultValue));
2104
- return valueSet;
2016
+ get id() {
2017
+ return this._id;
2105
2018
  }
2106
2019
  /**
2107
- * Gets the ValueSet under the given key when there are nested ValueSets.
2020
+ * Whether this diagram element is currently in the user highlight.
2108
2021
  * @private
2109
- * @param key A key.
2110
- * @returns A ValueSet.
2111
2022
  */
2112
- getSubValueSet(key) {
2113
- return this.valueSets[key];
2023
+ get highlighted() {
2024
+ var _a, _b;
2025
+ return ((_b = (_a = this.model.canvas) === null || _a === void 0 ? void 0 : _a.userHighlight) === null || _b === void 0 ? void 0 : _b.contains(this.id)) || false;
2114
2026
  }
2115
2027
  /**
2116
- * Moves the given property to the list of displayed properties.
2117
- * @private
2118
- * @param property A property.
2028
+ * Whether this diagram element is currently in the user selection.
2119
2029
  */
2120
- displayProperty(property) {
2121
- if (!this.displayedProperties.includes(property)) {
2122
- this.displayedProperties.push(property);
2123
- removeIfExists(this.hiddenProperties, property);
2124
- }
2030
+ get selected() {
2031
+ var _a, _b;
2032
+ return ((_b = (_a = this.model.canvas) === null || _a === void 0 ? void 0 : _a.userSelection) === null || _b === void 0 ? void 0 : _b.contains(this.id)) || false;
2033
+ }
2034
+ constructor(model, id) {
2035
+ /**
2036
+ * Whether this diagram element has itself been explicitly removed.
2037
+ *
2038
+ * Override the `removed` getter so that it returns true if and only if:
2039
+ * - `selfRemoved` is true, or
2040
+ * - `removed` is true for any of this element's dependencies.
2041
+ *
2042
+ * For example, a DiagramConnection is removed if either of its ports are removed,
2043
+ * even if the connection's own `selfRemoved` field is false.
2044
+ * @private
2045
+ */
2046
+ this.selfRemoved = false;
2047
+ /**
2048
+ * Collaborative timestamp for selfRemoved.
2049
+ * @private
2050
+ */
2051
+ this.selfRemovedTimestamp = null;
2052
+ this.model = model;
2053
+ this._id = id;
2125
2054
  }
2126
2055
  /**
2127
- * Moves the given property to the list of hidden properties.
2056
+ * Obtain the selection of this element.
2128
2057
  * @private
2129
- * @param property A property.
2130
2058
  */
2131
- hideProperty(property) {
2132
- if (!this.hiddenProperties.includes(property)) {
2133
- this.hiddenProperties.push(property);
2134
- removeIfExists(this.displayedProperties, property);
2059
+ select() {
2060
+ var _a, _b;
2061
+ return (_b = (_a = this.model.canvas) === null || _a === void 0 ? void 0 : _a.selectCanvasView()) === null || _b === void 0 ? void 0 : _b.select(`[id='${escapeSelector(this.id)}']`);
2062
+ }
2063
+ }
2064
+ class DiagramElementSet extends DiagramEntitySet {
2065
+ all(includeRemoved = false) {
2066
+ if (includeRemoved) {
2067
+ return super.all();
2068
+ } else {
2069
+ return super.filter(e => !e.removed);
2070
+ }
2071
+ }
2072
+ contains(id, includeRemoved = false) {
2073
+ if (includeRemoved) {
2074
+ return super.contains(id);
2075
+ } else {
2076
+ return super.contains(id) && !this.entityMap[id].removed;
2077
+ }
2078
+ }
2079
+ count(predicate, includeRemoved = false) {
2080
+ if (includeRemoved) {
2081
+ return super.count(predicate);
2082
+ } else {
2083
+ return super.count((e, i, a) => predicate(e, i, a) && !e.removed);
2084
+ }
2085
+ }
2086
+ filter(predicate, includeRemoved = false) {
2087
+ if (includeRemoved) {
2088
+ return super.filter(predicate);
2089
+ } else {
2090
+ return super.filter((e, i, a) => predicate(e, i, a) && !e.removed);
2091
+ }
2092
+ }
2093
+ find(predicate, includeRemoved = false) {
2094
+ if (includeRemoved) {
2095
+ return super.find(predicate);
2096
+ } else {
2097
+ return super.find((e, i, a) => predicate(e, i, a) && !e.removed);
2098
+ }
2099
+ }
2100
+ get(id, includeRemoved = false) {
2101
+ if (includeRemoved) {
2102
+ return super.get(id);
2103
+ } else {
2104
+ return this.contains(id) ? super.get(id) : undefined;
2105
+ }
2106
+ }
2107
+ map(callback, includeRemoved = false) {
2108
+ if (includeRemoved) {
2109
+ return super.map(callback);
2110
+ } else {
2111
+ return super.filter(e => !e.removed).map(callback);
2112
+ }
2113
+ }
2114
+ remove(id) {
2115
+ const entity = this.get(id, true);
2116
+ if (entity !== undefined) {
2117
+ delete this.entityMap[id];
2118
+ removeIfExists(this.entities, entity);
2119
+ }
2120
+ }
2121
+ size(includeRemoved = false) {
2122
+ if (includeRemoved) {
2123
+ return super.size();
2124
+ } else {
2125
+ return super.filter(e => !e.removed).length;
2126
+ }
2127
+ }
2128
+ *[Symbol.iterator](includeRemoved = false) {
2129
+ if (includeRemoved) {
2130
+ for (const entity of this.entities) {
2131
+ yield entity;
2132
+ }
2133
+ } else {
2134
+ for (const entity of this.entities.filter(e => !e.removed)) {
2135
+ yield entity;
2136
+ }
2135
2137
  }
2136
2138
  }
2137
2139
  }
@@ -2145,7 +2147,6 @@ const DIAGRAM_CONNECTION_TYPE_DEFAULTS = {
2145
2147
  name: '',
2146
2148
  label: null,
2147
2149
  look: {
2148
- lookType: 'connection-look',
2149
2150
  color: '#000000',
2150
2151
  thickness: 1,
2151
2152
  shape: exports.LineShape.Straight,
@@ -2687,9 +2688,26 @@ class DiagramConnectionSet extends DiagramElementSet {
2687
2688
  }
2688
2689
  }
2689
2690
 
2691
+ /**
2692
+ * The different modes for when a node or section can be resized.
2693
+ * @public
2694
+ * @see DiagramNode
2695
+ * @see DiagramSection
2696
+ */
2690
2697
  exports.ResizableMode = void 0;
2691
2698
  (function (ResizableMode) {
2692
- ResizableMode[ResizableMode["OnlyWhenSelected"] = 0] = "OnlyWhenSelected";
2699
+ /**
2700
+ * Resizable mode for always being resizable.
2701
+ */
2702
+ ResizableMode[ResizableMode["Always"] = 0] = "Always";
2703
+ /**
2704
+ * Resizable mode for only being resizable while selected.
2705
+ */
2706
+ ResizableMode[ResizableMode["OnlyWhenSelected"] = 1] = "OnlyWhenSelected";
2707
+ /**
2708
+ * Resizable mode for never being resizable.
2709
+ */
2710
+ ResizableMode[ResizableMode["Never"] = 2] = "Never";
2693
2711
  })(exports.ResizableMode || (exports.ResizableMode = {}));
2694
2712
 
2695
2713
  /**
@@ -2708,7 +2726,6 @@ const DIAGRAM_FIELD_DEFAULTS = {
2708
2726
  fit: false,
2709
2727
  shrink: true,
2710
2728
  look: {
2711
- lookType: 'field-look',
2712
2729
  fillColor: 'transparent',
2713
2730
  fontColor: '#000000',
2714
2731
  fontFamily: "'Wonder Unit Sans', sans-serif",
@@ -2881,9 +2898,7 @@ const getBottomMargin = config => {
2881
2898
  } else if (typeof config.margin === 'number') {
2882
2899
  return config.margin;
2883
2900
  } else {
2884
- if (config.margin.length === 0) {
2885
- return DIAGRAM_FIELD_DEFAULTS.margin;
2886
- } else if (config.margin.length === 1) {
2901
+ if (config.margin.length === 1) {
2887
2902
  return config.margin[0];
2888
2903
  } else if (config.margin.length === 2) {
2889
2904
  return config.margin[0];
@@ -2900,9 +2915,7 @@ const getLeftMargin = config => {
2900
2915
  } else if (typeof config.margin === 'number') {
2901
2916
  return config.margin;
2902
2917
  } else {
2903
- if (config.margin.length === 0) {
2904
- return DIAGRAM_FIELD_DEFAULTS.margin;
2905
- } else if (config.margin.length === 1) {
2918
+ if (config.margin.length === 1) {
2906
2919
  return config.margin[0];
2907
2920
  } else if (config.margin.length === 2) {
2908
2921
  return config.margin[1];
@@ -2919,9 +2932,7 @@ const getRightMargin = config => {
2919
2932
  } else if (typeof config.margin === 'number') {
2920
2933
  return config.margin;
2921
2934
  } else {
2922
- if (config.margin.length === 0) {
2923
- return DIAGRAM_FIELD_DEFAULTS.margin;
2924
- } else if (config.margin.length === 1) {
2935
+ if (config.margin.length === 1) {
2925
2936
  return config.margin[0];
2926
2937
  } else if (config.margin.length === 2) {
2927
2938
  return config.margin[1];
@@ -2938,9 +2949,7 @@ const getTopMargin = config => {
2938
2949
  } else if (typeof config.margin === 'number') {
2939
2950
  return config.margin;
2940
2951
  } else {
2941
- if (config.margin.length === 0) {
2942
- return DIAGRAM_FIELD_DEFAULTS.margin;
2943
- } else if (config.margin.length === 1) {
2952
+ if (config.margin.length === 1) {
2944
2953
  return config.margin[0];
2945
2954
  } else if (config.margin.length === 2) {
2946
2955
  return config.margin[0];
@@ -2957,9 +2966,7 @@ const getBottomPadding$1 = config => {
2957
2966
  } else if (typeof config.padding === 'number') {
2958
2967
  return config.padding;
2959
2968
  } else {
2960
- if (config.padding.length === 0) {
2961
- return DIAGRAM_FIELD_DEFAULTS.padding;
2962
- } else if (config.padding.length === 1) {
2969
+ if (config.padding.length === 1) {
2963
2970
  return config.padding[0];
2964
2971
  } else if (config.padding.length === 2) {
2965
2972
  return config.padding[0];
@@ -2976,9 +2983,7 @@ const getLeftPadding$1 = config => {
2976
2983
  } else if (typeof config.padding === 'number') {
2977
2984
  return config.padding;
2978
2985
  } else {
2979
- if (config.padding.length === 0) {
2980
- return DIAGRAM_FIELD_DEFAULTS.padding;
2981
- } else if (config.padding.length === 1) {
2986
+ if (config.padding.length === 1) {
2982
2987
  return config.padding[0];
2983
2988
  } else if (config.padding.length === 2) {
2984
2989
  return config.padding[1];
@@ -2995,38 +3000,105 @@ const getRightPadding$1 = config => {
2995
3000
  } else if (typeof config.padding === 'number') {
2996
3001
  return config.padding;
2997
3002
  } else {
2998
- if (config.padding.length === 0) {
2999
- return DIAGRAM_FIELD_DEFAULTS.padding;
3000
- } else if (config.padding.length === 1) {
3003
+ if (config.padding.length === 1) {
3001
3004
  return config.padding[0];
3002
3005
  } else if (config.padding.length === 2) {
3003
3006
  return config.padding[1];
3004
3007
  } else if (config.padding.length === 3) {
3005
3008
  return config.padding[1];
3006
3009
  } else {
3007
- return config.padding[1];
3010
+ return config.padding[1];
3011
+ }
3012
+ }
3013
+ };
3014
+ const getTopPadding$1 = config => {
3015
+ if ((config === null || config === void 0 ? void 0 : config.padding) === null || (config === null || config === void 0 ? void 0 : config.padding) === undefined) {
3016
+ return DIAGRAM_FIELD_DEFAULTS.padding;
3017
+ } else if (typeof config.padding === 'number') {
3018
+ return config.padding;
3019
+ } else {
3020
+ if (config.padding.length === 1) {
3021
+ return config.padding[0];
3022
+ } else if (config.padding.length === 2) {
3023
+ return config.padding[0];
3024
+ } else if (config.padding.length === 3) {
3025
+ return config.padding[0];
3026
+ } else {
3027
+ return config.padding[0];
3028
+ }
3029
+ }
3030
+ };
3031
+
3032
+ /**
3033
+ * Default values of the parameters of a diagram field.
3034
+ * @private
3035
+ * @see ResizerConfig
3036
+ */
3037
+ const DIAGRAM_RESIZER_DEFAULTS = {
3038
+ mode: exports.ResizableMode.Never,
3039
+ thickness: 10,
3040
+ outerMargin: 0,
3041
+ look: {
3042
+ fillColor: 'transparent',
3043
+ borderColor: 'transparent',
3044
+ borderThickness: 0
3045
+ }
3046
+ };
3047
+ /**
3048
+ * Holds the data for the resizers of a type of node or section.
3049
+ * @public
3050
+ * @see DiagramNode
3051
+ * @see DiagramSection
3052
+ */
3053
+ class DiagramResizer {
3054
+ constructor(options) {
3055
+ var _a;
3056
+ let config;
3057
+ if (typeof options === 'boolean') {
3058
+ config = {
3059
+ mode: options ? exports.ResizableMode.Always : exports.ResizableMode.Never
3060
+ };
3061
+ } else if (typeof options === 'string' || typeof options === 'number') {
3062
+ config = {
3063
+ mode: options
3064
+ };
3065
+ } else {
3066
+ config = options;
3008
3067
  }
3068
+ config = Object.assign(Object.assign({}, DIAGRAM_RESIZER_DEFAULTS), config);
3069
+ this.mode = config.mode;
3070
+ this.thickness = config.thickness;
3071
+ this.outerMargin = config.outerMargin;
3072
+ const looks = extractLooksFromConfig((_a = config.look) !== null && _a !== void 0 ? _a : DIAGRAM_RESIZER_DEFAULTS.look);
3073
+ this.defaultLook = looks.defaultLook;
3074
+ this.selectedLook = looks.selectedLook;
3075
+ this.highlightedLook = looks.highlightedLook;
3076
+ this.selectedAndHighlightedLook = looks.selectedAndHighlightedLook;
3009
3077
  }
3010
- };
3011
- const getTopPadding$1 = config => {
3012
- if ((config === null || config === void 0 ? void 0 : config.padding) === null || (config === null || config === void 0 ? void 0 : config.padding) === undefined) {
3013
- return DIAGRAM_FIELD_DEFAULTS.padding;
3014
- } else if (typeof config.padding === 'number') {
3015
- return config.padding;
3016
- } else {
3017
- if (config.padding.length === 0) {
3018
- return DIAGRAM_FIELD_DEFAULTS.padding;
3019
- } else if (config.padding.length === 1) {
3020
- return config.padding[0];
3021
- } else if (config.padding.length === 2) {
3022
- return config.padding[0];
3023
- } else if (config.padding.length === 3) {
3024
- return config.padding[0];
3078
+ /**
3079
+ * Current look of this resizer.
3080
+ * @private
3081
+ */
3082
+ getLook(rootElement) {
3083
+ if (!rootElement) {
3084
+ return this.defaultLook;
3085
+ }
3086
+ if (rootElement.selected) {
3087
+ if (rootElement.highlighted) {
3088
+ return this.selectedAndHighlightedLook;
3089
+ } else {
3090
+ return this.selectedLook;
3091
+ }
3025
3092
  } else {
3026
- return config.padding[0];
3093
+ if (rootElement.highlighted) {
3094
+ return this.highlightedLook;
3095
+ } else {
3096
+ return this.defaultLook;
3097
+ }
3027
3098
  }
3028
3099
  }
3029
- };
3100
+ }
3101
+ const DIAGRAM_DEFAULT_RESIZER = new DiagramResizer(DIAGRAM_RESIZER_DEFAULTS);
3030
3102
 
3031
3103
  /**
3032
3104
  * Default value of the default width of a diagram section.
@@ -3080,8 +3152,21 @@ class DiagramSectionType {
3080
3152
  this.label = options.label || null;
3081
3153
  this.ports = options.ports || [];
3082
3154
  this.priority = options.priority || DEFAULT_PRIORITY;
3083
- this.resizableX = options.resizableX;
3084
- this.resizableY = options.resizableY;
3155
+ if (typeof options.resizableX === 'undefined') {
3156
+ this.resizerX = undefined;
3157
+ } else {
3158
+ this.resizerX = new DiagramResizer(options.resizableX);
3159
+ }
3160
+ if (typeof options.resizableY === 'undefined') {
3161
+ this.resizerY = undefined;
3162
+ } else {
3163
+ this.resizerY = new DiagramResizer(options.resizableY);
3164
+ }
3165
+ if (typeof options.resizableXY === 'undefined') {
3166
+ this.resizerXY = undefined;
3167
+ } else {
3168
+ this.resizerXY = new DiagramResizer(options.resizableXY);
3169
+ }
3085
3170
  const looks = extractLooksFromConfig(options.look || DIAGRAM_NODE_LOOK_DEFAULTS);
3086
3171
  this.defaultLook = looks.defaultLook;
3087
3172
  this.selectedLook = looks.selectedLook;
@@ -3225,6 +3310,30 @@ class DiagramSection extends DiagramElement {
3225
3310
  var _a, _b, _c, _d, _e, _f;
3226
3311
  return ((_f = (_e = (_d = (_c = (_b = (_a = this.node) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.sectionGrid) === null || _c === void 0 ? void 0 : _c.sections) === null || _d === void 0 ? void 0 : _d[this.indexYInNode]) === null || _e === void 0 ? void 0 : _e[this.indexXInNode]) === null || _f === void 0 ? void 0 : _f.priority) || DEFAULT_PRIORITY;
3227
3312
  }
3313
+ /**
3314
+ * Returns the horizontal resizer of this section.
3315
+ * @public
3316
+ */
3317
+ getResizerX() {
3318
+ var _a, _b, _c, _d;
3319
+ return (_d = (_b = (_a = this.type) === null || _a === void 0 ? void 0 : _a.resizerX) !== null && _b !== void 0 ? _b : (_c = this.node) === null || _c === void 0 ? void 0 : _c.getResizerX()) !== null && _d !== void 0 ? _d : DIAGRAM_DEFAULT_RESIZER;
3320
+ }
3321
+ /**
3322
+ * Returns the vertical resizer of this section.
3323
+ * @public
3324
+ */
3325
+ getResizerY() {
3326
+ var _a, _b, _c, _d;
3327
+ return (_d = (_b = (_a = this.type) === null || _a === void 0 ? void 0 : _a.resizerY) !== null && _b !== void 0 ? _b : (_c = this.node) === null || _c === void 0 ? void 0 : _c.getResizerY()) !== null && _d !== void 0 ? _d : DIAGRAM_DEFAULT_RESIZER;
3328
+ }
3329
+ /**
3330
+ * Returns the diagonal resizer of this section.
3331
+ * @public
3332
+ */
3333
+ getResizerXY() {
3334
+ var _a, _b, _c, _d;
3335
+ return (_d = (_b = (_a = this.type) === null || _a === void 0 ? void 0 : _a.resizerXY) !== null && _b !== void 0 ? _b : (_c = this.node) === null || _c === void 0 ? void 0 : _c.getResizerXY()) !== null && _d !== void 0 ? _d : DIAGRAM_DEFAULT_RESIZER;
3336
+ }
3228
3337
  /**
3229
3338
  * Returns whether this section can be resized horizontally.
3230
3339
  * If the section has a specific resizableX setting, it uses that.
@@ -3234,11 +3343,16 @@ class DiagramSection extends DiagramElement {
3234
3343
  getResizableX() {
3235
3344
  var _a;
3236
3345
  const sectionType = this.type;
3237
- if ((sectionType === null || sectionType === void 0 ? void 0 : sectionType.resizableX) !== undefined) {
3238
- if (sectionType.resizableX === exports.ResizableMode.OnlyWhenSelected) {
3239
- return this.selected;
3346
+ if ((sectionType === null || sectionType === void 0 ? void 0 : sectionType.resizerX) !== undefined) {
3347
+ switch (sectionType.resizerX.mode) {
3348
+ case exports.ResizableMode.OnlyWhenSelected:
3349
+ return this.selected;
3350
+ case exports.ResizableMode.Always:
3351
+ return true;
3352
+ case exports.ResizableMode.Never:
3353
+ default:
3354
+ return false;
3240
3355
  }
3241
- return sectionType.resizableX;
3242
3356
  }
3243
3357
  return ((_a = this.node) === null || _a === void 0 ? void 0 : _a.getResizableX()) || false;
3244
3358
  }
@@ -3251,14 +3365,41 @@ class DiagramSection extends DiagramElement {
3251
3365
  getResizableY() {
3252
3366
  var _a;
3253
3367
  const sectionType = this.type;
3254
- if ((sectionType === null || sectionType === void 0 ? void 0 : sectionType.resizableY) !== undefined) {
3255
- if (sectionType.resizableY === exports.ResizableMode.OnlyWhenSelected) {
3256
- return this.selected;
3368
+ if ((sectionType === null || sectionType === void 0 ? void 0 : sectionType.resizerY) !== undefined) {
3369
+ switch (sectionType.resizerY.mode) {
3370
+ case exports.ResizableMode.OnlyWhenSelected:
3371
+ return this.selected;
3372
+ case exports.ResizableMode.Always:
3373
+ return true;
3374
+ case exports.ResizableMode.Never:
3375
+ default:
3376
+ return false;
3257
3377
  }
3258
- return sectionType.resizableY;
3259
3378
  }
3260
3379
  return ((_a = this.node) === null || _a === void 0 ? void 0 : _a.getResizableY()) || false;
3261
3380
  }
3381
+ /**
3382
+ * Returns whether this section can be resized diagonally.
3383
+ * If the section has a specific resizableXY setting, it uses that.
3384
+ * Otherwise, it inherits from the parent node's resizableXY setting.
3385
+ * @public
3386
+ */
3387
+ getResizableXY() {
3388
+ var _a;
3389
+ const sectionType = this.type;
3390
+ if ((sectionType === null || sectionType === void 0 ? void 0 : sectionType.resizerXY) !== undefined) {
3391
+ switch (sectionType.resizerXY.mode) {
3392
+ case exports.ResizableMode.OnlyWhenSelected:
3393
+ return this.selected;
3394
+ case exports.ResizableMode.Always:
3395
+ return true;
3396
+ case exports.ResizableMode.Never:
3397
+ default:
3398
+ return false;
3399
+ }
3400
+ }
3401
+ return ((_a = this.node) === null || _a === void 0 ? void 0 : _a.getResizableXY()) || false;
3402
+ }
3262
3403
  /**
3263
3404
  * Get the port of this section which is closest to the given coordinates.
3264
3405
  * @param coords A point in the diagram.
@@ -3579,8 +3720,27 @@ class DiagramNodeType {
3579
3720
  this.defaultHeight = values.defaultHeight;
3580
3721
  this.minWidth = values.minWidth;
3581
3722
  this.minHeight = values.minHeight;
3582
- this.resizableX = values.resizableX;
3583
- this.resizableY = values.resizableY;
3723
+ if (typeof options.resizableX === 'undefined') {
3724
+ this.resizerX = new DiagramResizer({
3725
+ mode: exports.ResizableMode.Never
3726
+ });
3727
+ } else {
3728
+ this.resizerX = new DiagramResizer(options.resizableX);
3729
+ }
3730
+ if (typeof options.resizableY === 'undefined') {
3731
+ this.resizerY = new DiagramResizer({
3732
+ mode: exports.ResizableMode.Never
3733
+ });
3734
+ } else {
3735
+ this.resizerY = new DiagramResizer(options.resizableY);
3736
+ }
3737
+ if (typeof options.resizableXY === 'undefined') {
3738
+ this.resizerXY = new DiagramResizer({
3739
+ mode: exports.ResizableMode.Never
3740
+ });
3741
+ } else {
3742
+ this.resizerXY = new DiagramResizer(options.resizableXY);
3743
+ }
3584
3744
  this.snapToGridOffset = values.snapToGridOffset;
3585
3745
  this.bottomPadding = getBottomPadding(values);
3586
3746
  this.leftPadding = getLeftPadding(values);
@@ -3649,7 +3809,7 @@ class DiagramNode extends DiagramElement {
3649
3809
  }
3650
3810
  }
3651
3811
  /**
3652
- * Current look of this port.
3812
+ * Current look of this node.
3653
3813
  * @private
3654
3814
  */
3655
3815
  get look() {
@@ -3770,27 +3930,71 @@ class DiagramNode extends DiagramElement {
3770
3930
  getPriority() {
3771
3931
  return this.type.priority;
3772
3932
  }
3933
+ /**
3934
+ * Returns the horizontal resizer of this node.
3935
+ * @public
3936
+ */
3937
+ getResizerX() {
3938
+ return this.type.resizerX;
3939
+ }
3940
+ /**
3941
+ * Returns the vertical resizer of this node.
3942
+ * @public
3943
+ */
3944
+ getResizerY() {
3945
+ return this.type.resizerY;
3946
+ }
3947
+ /**
3948
+ * Returns the diagonal resizer of this node.
3949
+ * @public
3950
+ */
3951
+ getResizerXY() {
3952
+ return this.type.resizerXY;
3953
+ }
3773
3954
  /**
3774
3955
  * Returns whether this node can be resized horizontally.
3775
3956
  * @public
3776
3957
  */
3777
3958
  getResizableX() {
3778
- const resizableX = this.type.resizableX;
3779
- if (resizableX === exports.ResizableMode.OnlyWhenSelected) {
3780
- return this.selected;
3959
+ switch (this.type.resizerX.mode) {
3960
+ case exports.ResizableMode.OnlyWhenSelected:
3961
+ return this.selected;
3962
+ case exports.ResizableMode.Always:
3963
+ return true;
3964
+ case exports.ResizableMode.Never:
3965
+ default:
3966
+ return false;
3781
3967
  }
3782
- return resizableX;
3783
3968
  }
3784
3969
  /**
3785
3970
  * Returns whether this node can be resized vertically.
3786
3971
  * @public
3787
3972
  */
3788
3973
  getResizableY() {
3789
- const resizableY = this.type.resizableY;
3790
- if (resizableY === exports.ResizableMode.OnlyWhenSelected) {
3791
- return this.selected;
3974
+ switch (this.type.resizerY.mode) {
3975
+ case exports.ResizableMode.OnlyWhenSelected:
3976
+ return this.selected;
3977
+ case exports.ResizableMode.Always:
3978
+ return true;
3979
+ case exports.ResizableMode.Never:
3980
+ default:
3981
+ return false;
3982
+ }
3983
+ }
3984
+ /**
3985
+ * Returns whether this node can be resized diagonally.
3986
+ * @public
3987
+ */
3988
+ getResizableXY() {
3989
+ switch (this.type.resizerXY.mode) {
3990
+ case exports.ResizableMode.OnlyWhenSelected:
3991
+ return this.selected;
3992
+ case exports.ResizableMode.Always:
3993
+ return true;
3994
+ case exports.ResizableMode.Never:
3995
+ default:
3996
+ return false;
3792
3997
  }
3793
- return resizableY;
3794
3998
  }
3795
3999
  /**
3796
4000
  * Get the port of this node which is closest to the given coordinates.
@@ -4529,9 +4733,7 @@ const getBottomPadding = config => {
4529
4733
  } else if (typeof config.padding === 'number') {
4530
4734
  return config.padding;
4531
4735
  } else {
4532
- if (config.padding.length === 0) {
4533
- return DIAGRAM_NODE_TYPE_DEFAULTS.padding;
4534
- } else if (config.padding.length === 1) {
4736
+ if (config.padding.length === 1) {
4535
4737
  return config.padding[0];
4536
4738
  } else if (config.padding.length === 2) {
4537
4739
  return config.padding[0];
@@ -4548,9 +4750,7 @@ const getLeftPadding = config => {
4548
4750
  } else if (typeof config.padding === 'number') {
4549
4751
  return config.padding;
4550
4752
  } else {
4551
- if (config.padding.length === 0) {
4552
- return DIAGRAM_NODE_TYPE_DEFAULTS.padding;
4553
- } else if (config.padding.length === 1) {
4753
+ if (config.padding.length === 1) {
4554
4754
  return config.padding[0];
4555
4755
  } else if (config.padding.length === 2) {
4556
4756
  return config.padding[1];
@@ -4567,9 +4767,7 @@ const getRightPadding = config => {
4567
4767
  } else if (typeof config.padding === 'number') {
4568
4768
  return config.padding;
4569
4769
  } else {
4570
- if (config.padding.length === 0) {
4571
- return DIAGRAM_NODE_TYPE_DEFAULTS.padding;
4572
- } else if (config.padding.length === 1) {
4770
+ if (config.padding.length === 1) {
4573
4771
  return config.padding[0];
4574
4772
  } else if (config.padding.length === 2) {
4575
4773
  return config.padding[1];
@@ -4586,9 +4784,7 @@ const getTopPadding = config => {
4586
4784
  } else if (typeof config.padding === 'number') {
4587
4785
  return config.padding;
4588
4786
  } else {
4589
- if (config.padding.length === 0) {
4590
- return DIAGRAM_NODE_TYPE_DEFAULTS.padding;
4591
- } else if (config.padding.length === 1) {
4787
+ if (config.padding.length === 1) {
4592
4788
  return config.padding[0];
4593
4789
  } else if (config.padding.length === 2) {
4594
4790
  return config.padding[0];
@@ -6808,12 +7004,13 @@ const getRelatedNodeOrItself = element => {
6808
7004
  return element.rootElement instanceof DiagramNode || element.rootElement instanceof DiagramSection || element.rootElement instanceof DiagramPort ? getRelatedNodeOrItself(element.rootElement) : element;
6809
7005
  };
6810
7006
  const needsResizerX = element => {
7007
+ var _a;
6811
7008
  if (element instanceof DiagramNode) {
6812
- return element.type.resizableX !== false;
7009
+ return element.type.resizerX.mode !== exports.ResizableMode.Never;
6813
7010
  }
6814
7011
  if (element instanceof DiagramSection) {
6815
- if (element.type !== undefined) {
6816
- return element.type.resizableX !== false;
7012
+ if (((_a = element.type) === null || _a === void 0 ? void 0 : _a.resizerX) !== undefined) {
7013
+ return element.type.resizerX.mode !== exports.ResizableMode.Never;
6817
7014
  }
6818
7015
  if (element.node !== undefined) {
6819
7016
  return needsResizerX(element.node);
@@ -6822,12 +7019,13 @@ const needsResizerX = element => {
6822
7019
  return false;
6823
7020
  };
6824
7021
  const needsResizerY = element => {
7022
+ var _a;
6825
7023
  if (element instanceof DiagramNode) {
6826
- return element.type.resizableY !== false;
7024
+ return element.type.resizerY.mode !== exports.ResizableMode.Never;
6827
7025
  }
6828
7026
  if (element instanceof DiagramSection) {
6829
- if (element.type !== undefined) {
6830
- return element.type.resizableY !== false;
7027
+ if (((_a = element.type) === null || _a === void 0 ? void 0 : _a.resizerY) !== undefined) {
7028
+ return element.type.resizerY.mode !== exports.ResizableMode.Never;
6831
7029
  }
6832
7030
  if (element.node !== undefined) {
6833
7031
  return needsResizerY(element.node);
@@ -6835,6 +7033,21 @@ const needsResizerY = element => {
6835
7033
  }
6836
7034
  return false;
6837
7035
  };
7036
+ const needsResizerXY = element => {
7037
+ var _a;
7038
+ if (element instanceof DiagramNode) {
7039
+ return element.type.resizerXY.mode !== exports.ResizableMode.Never;
7040
+ }
7041
+ if (element instanceof DiagramSection) {
7042
+ if (((_a = element.type) === null || _a === void 0 ? void 0 : _a.resizerXY) !== undefined) {
7043
+ return element.type.resizerXY.mode !== exports.ResizableMode.Never;
7044
+ }
7045
+ if (element.node !== undefined) {
7046
+ return needsResizerXY(element.node);
7047
+ }
7048
+ }
7049
+ return false;
7050
+ };
6838
7051
  const initializeLook = selection => {
6839
7052
  selection.filter('.shaped-look').append('path');
6840
7053
  selection.filter('.image-look').append('image').attr('preserveAspectRatio', 'none');
@@ -6899,7 +7112,7 @@ const DOTS_GRID_DEFAULTS = Object.assign(Object.assign({}, GRID_DEFAULTS), {
6899
7112
  thickness: 0.05,
6900
7113
  color: 'rgba(0, 0, 0, 0.1)'
6901
7114
  });
6902
- const initializeBackground = (canvas, canvasView, backgroundConfig) => {
7115
+ const initializeBackground = (canvasView, backgroundConfig) => {
6903
7116
  var _a, _b;
6904
7117
  switch ((_a = backgroundConfig === null || backgroundConfig === void 0 ? void 0 : backgroundConfig.style) !== null && _a !== void 0 ? _a : '') {
6905
7118
  case 'image':
@@ -7675,11 +7888,6 @@ class DiagramUserSelection extends DiagramElementSet {
7675
7888
  * @private
7676
7889
  */
7677
7890
  const CONNECTION_PATH_BOX_THICKNESS = 12;
7678
- /**
7679
- * Thickness of the resizer line used to resize nodes and sections on drag, in diagram units.
7680
- * @private
7681
- */
7682
- const RESIZER_THICKNESS = 6;
7683
7891
  /**
7684
7892
  * Maximum number of user actions that can be recorded in the user action stack.
7685
7893
  * @private
@@ -7980,7 +8188,7 @@ class DiagramCanvas {
7980
8188
  }));
7981
8189
  const canvasDefs = canvasView.append('defs');
7982
8190
  const canvasBackground = [];
7983
- canvasBackground.push(initializeBackground(this, canvasView, this.backgroundConfig));
8191
+ canvasBackground.push(initializeBackground(canvasView, this.backgroundConfig).attr('class', 'daga-background'));
7984
8192
  for (let i = 0; i < this.ancillaryGridsConfig.length; ++i) {
7985
8193
  canvasBackground.push(initializeGrid(this, canvasView, canvasDefs, this.ancillaryGridPatternIds[i], this.ancillaryGridsConfig[i]));
7986
8194
  }
@@ -8038,7 +8246,7 @@ class DiagramCanvas {
8038
8246
  }
8039
8247
  getViewCoordinates() {
8040
8248
  var _a, _b, _c;
8041
- const canvasViewBoundingBox = (_c = (_b = (_a = this.selectCanvasView()) === null || _a === void 0 ? void 0 : _a.select('rect')) === null || _b === void 0 ? void 0 : _b.node()) === null || _c === void 0 ? void 0 : _c.getBBox();
8249
+ const canvasViewBoundingBox = (_c = (_b = (_a = this.selectCanvasView()) === null || _a === void 0 ? void 0 : _a.select('.daga-background')) === null || _b === void 0 ? void 0 : _b.node()) === null || _c === void 0 ? void 0 : _c.getBBox();
8042
8250
  /*
8043
8251
  transform the coordinates of the zoomTransform to the coordinates
8044
8252
  needed to point the zoomTransfrom to the center of the screen to
@@ -8090,7 +8298,11 @@ class DiagramCanvas {
8090
8298
  var _a;
8091
8299
  // if there are no nodes, we have nothing to do here
8092
8300
  if (this.model.nodes.length > 0) {
8093
- const canvasViewBoundingBox = (_a = this.selectCanvasView().select('rect').node()) === null || _a === void 0 ? void 0 : _a.getBBox();
8301
+ const canvasViewBoundingBox = (_a = this.selectCanvasView().select('.daga-background').node()) === null || _a === void 0 ? void 0 : _a.getBBox();
8302
+ if (!canvasViewBoundingBox.width || !canvasViewBoundingBox.height) {
8303
+ // prevent errors if the width or height is invalid
8304
+ return;
8305
+ }
8094
8306
  const nonRemovedNodes = (nodeIds === null || nodeIds === void 0 ? void 0 : nodeIds.map(i => this.model.nodes.get(i)).filter(n => !!n)) || this.model.nodes.all();
8095
8307
  const minimumX = Math.min(...nonRemovedNodes.map(n => n.coords[0]));
8096
8308
  const maximumX = Math.max(...nonRemovedNodes.map(n => n.coords[0] + n.width));
@@ -8174,7 +8386,7 @@ class DiagramCanvas {
8174
8386
  updateNodesInView(...ids) {
8175
8387
  let updateSelection = this.selectCanvasElements().selectAll('g.diagram-node').data(this.model.nodes.filter(e => this.priorityThreshold !== undefined ? e.getPriority() >= this.priorityThreshold : true), d => d.id);
8176
8388
  const exitSelection = updateSelection.exit();
8177
- const enterSelection = updateSelection.enter().append('g').attr('id', d => d.id).attr('class', d => `diagram-node${needsResizerX(d) ? ' resizable-x' : ''}${needsResizerY(d) ? ' resizable-y' : ''} ${d.type.defaultLook.lookType}`);
8389
+ const enterSelection = updateSelection.enter().append('g').attr('id', d => d.id).attr('class', d => `diagram-node${needsResizerX(d) ? ' resizable-x' : ''}${needsResizerY(d) ? ' resizable-y' : ''}${needsResizerXY(d) ? ' resizable-xy' : ''} ${d.type.defaultLook.lookType}`);
8178
8390
  if (ids && ids.length > 0) {
8179
8391
  updateSelection = updateSelection.filter(d => ids.includes(d.id));
8180
8392
  }
@@ -8200,65 +8412,210 @@ class DiagramCanvas {
8200
8412
  this.dragging = false;
8201
8413
  return;
8202
8414
  }
8203
- const diagramEvent = new DiagramSecondaryClickEvent(event, d);
8204
- this.diagramEvent$.next(diagramEvent);
8205
- if (!diagramEvent.defaultPrevented && this.canUserPerformAction(exports.DiagramActions.ContextMenu)) {
8206
- event.preventDefault();
8207
- this.userHighlight.focusOn(d);
8208
- this.diagramEvent$.next(new DiagramHighlightedEvent(d));
8209
- this.userSelection.add(d);
8210
- this.diagramEvent$.next(new DiagramSelectionEvent([d], true));
8211
- this.contextMenu.open(event);
8415
+ const diagramEvent = new DiagramSecondaryClickEvent(event, d);
8416
+ this.diagramEvent$.next(diagramEvent);
8417
+ if (!diagramEvent.defaultPrevented && this.canUserPerformAction(exports.DiagramActions.ContextMenu)) {
8418
+ event.preventDefault();
8419
+ this.userHighlight.focusOn(d);
8420
+ this.diagramEvent$.next(new DiagramHighlightedEvent(d));
8421
+ this.userSelection.add(d);
8422
+ this.diagramEvent$.next(new DiagramSelectionEvent([d], true));
8423
+ this.contextMenu.open(event);
8424
+ }
8425
+ }).on(exports.Events.DoubleClick, (event, d) => {
8426
+ const diagramEvent = new DiagramDoubleClickEvent(event, d);
8427
+ this.diagramEvent$.next(diagramEvent);
8428
+ }).call(d3__namespace.drag().filter(event => {
8429
+ this.secondaryButton = isSecondaryButton(event);
8430
+ return true;
8431
+ }).on(exports.DragEvents.Start, (event, d) => {
8432
+ if (this.multipleSelectionOn || this.secondaryButton) {
8433
+ this.startMultipleSelection(event);
8434
+ } else {
8435
+ this.startMovingNode(event, d);
8436
+ }
8437
+ }).on(exports.DragEvents.Drag, (event, d) => {
8438
+ if (this.multipleSelectionOn || this.secondaryButton) {
8439
+ this.continueMultipleSelection(event);
8440
+ } else {
8441
+ this.continueMovingNode(event, d);
8442
+ }
8443
+ }).on(exports.DragEvents.End, (event, d) => {
8444
+ if (this.multipleSelectionOn || this.secondaryButton) {
8445
+ this.finishMultipleSelection(event);
8446
+ } else {
8447
+ this.finishMovingNode(event, d);
8448
+ }
8449
+ this.secondaryButton = false;
8450
+ }));
8451
+ initializeLook(enterSelection);
8452
+ enterSelection.filter('.resizable-x').append('rect').attr('class', 'left-resizer').on(exports.Events.MouseOver, (_event, d) => {
8453
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8454
+ setCursorStyle(exports.CursorStyle.EWResize);
8455
+ }
8456
+ }).on(exports.Events.MouseOut, (_event, d) => {
8457
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8458
+ setCursorStyle();
8459
+ }
8460
+ }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
8461
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8462
+ setCursorStyle(exports.CursorStyle.EWResize);
8463
+ this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchNode, d.id, d.getGeometry(), d.getGeometry());
8464
+ } else {
8465
+ setCursorStyle(exports.CursorStyle.NotAllowed);
8466
+ }
8467
+ }).on(exports.DragEvents.Drag, (event, d) => {
8468
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8469
+ const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8470
+ d.stretch(exports.Side.Left, d.coords[0] - pointerCoords[0]);
8471
+ }
8472
+ }).on(exports.DragEvents.End, (event, d) => {
8473
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchNode) {
8474
+ let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8475
+ if (this.gridConfig.snap) {
8476
+ pointerCoords = this.getClosestGridPoint([pointerCoords[0] - d.type.snapToGridOffset[0], pointerCoords[1] - d.type.snapToGridOffset[1]]);
8477
+ pointerCoords[0] += d.type.snapToGridOffset[0];
8478
+ pointerCoords[1] += d.type.snapToGridOffset[1];
8479
+ }
8480
+ d.stretch(exports.Side.Left, d.coords[0] - pointerCoords[0]);
8481
+ this.currentAction.to = d.getGeometry();
8482
+ this.currentAction.do();
8483
+ this.actionStack.add(this.currentAction);
8484
+ this.currentAction = undefined;
8485
+ }
8486
+ setCursorStyle();
8487
+ }));
8488
+ enterSelection.filter('.resizable-x').append('rect').attr('class', 'right-resizer').on(exports.Events.MouseOver, (_event, d) => {
8489
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8490
+ setCursorStyle(exports.CursorStyle.EWResize);
8491
+ }
8492
+ }).on(exports.Events.MouseOut, (_event, d) => {
8493
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8494
+ setCursorStyle();
8495
+ }
8496
+ }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
8497
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8498
+ setCursorStyle(exports.CursorStyle.EWResize);
8499
+ this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchNode, d.id, d.getGeometry(), d.getGeometry());
8500
+ } else {
8501
+ setCursorStyle(exports.CursorStyle.NotAllowed);
8502
+ }
8503
+ }).on(exports.DragEvents.Drag, (event, d) => {
8504
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8505
+ const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8506
+ d.stretch(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width));
8507
+ }
8508
+ }).on(exports.DragEvents.End, (event, d) => {
8509
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchNode) {
8510
+ let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8511
+ if (this.gridConfig.snap) {
8512
+ pointerCoords = this.getClosestGridPoint([pointerCoords[0] - d.type.snapToGridOffset[2], pointerCoords[1] - d.type.snapToGridOffset[3]]);
8513
+ pointerCoords[0] += d.type.snapToGridOffset[2];
8514
+ pointerCoords[1] += d.type.snapToGridOffset[3];
8515
+ }
8516
+ d.stretch(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width));
8517
+ this.currentAction.to = d.getGeometry();
8518
+ this.currentAction.do();
8519
+ this.actionStack.add(this.currentAction);
8520
+ this.currentAction = undefined;
8521
+ }
8522
+ setCursorStyle();
8523
+ }));
8524
+ enterSelection.filter('.resizable-y').append('rect').attr('class', 'top-resizer').on(exports.Events.MouseOver, (_event, d) => {
8525
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8526
+ setCursorStyle(exports.CursorStyle.NSResize);
8527
+ }
8528
+ }).on(exports.Events.MouseOut, (_event, d) => {
8529
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8530
+ setCursorStyle();
8531
+ }
8532
+ }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
8533
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8534
+ setCursorStyle(exports.CursorStyle.NSResize);
8535
+ this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchNode, d.id, d.getGeometry(), d.getGeometry());
8536
+ } else {
8537
+ setCursorStyle(exports.CursorStyle.NotAllowed);
8538
+ }
8539
+ }).on(exports.DragEvents.Drag, (event, d) => {
8540
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8541
+ const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8542
+ d.stretch(exports.Side.Top, d.coords[1] - pointerCoords[1]);
8543
+ }
8544
+ }).on(exports.DragEvents.End, (event, d) => {
8545
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchNode) {
8546
+ let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8547
+ if (this.gridConfig.snap) {
8548
+ pointerCoords = this.getClosestGridPoint([pointerCoords[0] - d.type.snapToGridOffset[0], pointerCoords[1] - d.type.snapToGridOffset[1]]);
8549
+ pointerCoords[0] += d.type.snapToGridOffset[0];
8550
+ pointerCoords[1] += d.type.snapToGridOffset[1];
8551
+ }
8552
+ d.stretch(exports.Side.Top, d.coords[1] - pointerCoords[1]);
8553
+ this.currentAction.to = d.getGeometry();
8554
+ this.currentAction.do();
8555
+ this.actionStack.add(this.currentAction);
8556
+ this.currentAction = undefined;
8557
+ }
8558
+ setCursorStyle();
8559
+ }));
8560
+ enterSelection.filter('.resizable-y').append('rect').attr('class', 'bottom-resizer').on(exports.Events.MouseOver, (_event, d) => {
8561
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8562
+ setCursorStyle(exports.CursorStyle.NSResize);
8212
8563
  }
8213
- }).on(exports.Events.DoubleClick, (event, d) => {
8214
- const diagramEvent = new DiagramDoubleClickEvent(event, d);
8215
- this.diagramEvent$.next(diagramEvent);
8216
- }).call(d3__namespace.drag().filter(event => {
8217
- this.secondaryButton = isSecondaryButton(event);
8218
- return true;
8219
- }).on(exports.DragEvents.Start, (event, d) => {
8220
- if (this.multipleSelectionOn || this.secondaryButton) {
8221
- this.startMultipleSelection(event);
8564
+ }).on(exports.Events.MouseOut, (_event, d) => {
8565
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8566
+ setCursorStyle();
8567
+ }
8568
+ }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
8569
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8570
+ setCursorStyle(exports.CursorStyle.NSResize);
8571
+ this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchNode, d.id, d.getGeometry(), d.getGeometry());
8222
8572
  } else {
8223
- this.startMovingNode(event, d);
8573
+ setCursorStyle(exports.CursorStyle.NotAllowed);
8224
8574
  }
8225
8575
  }).on(exports.DragEvents.Drag, (event, d) => {
8226
- if (this.multipleSelectionOn || this.secondaryButton) {
8227
- this.continueMultipleSelection(event);
8228
- } else {
8229
- this.continueMovingNode(event, d);
8576
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8577
+ const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8578
+ d.stretch(exports.Side.Bottom, pointerCoords[1] - (d.coords[1] + d.height));
8230
8579
  }
8231
8580
  }).on(exports.DragEvents.End, (event, d) => {
8232
- if (this.multipleSelectionOn || this.secondaryButton) {
8233
- this.finishMultipleSelection(event);
8234
- } else {
8235
- this.finishMovingNode(event, d);
8581
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchNode) {
8582
+ let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8583
+ if (this.gridConfig.snap) {
8584
+ pointerCoords = this.getClosestGridPoint([pointerCoords[0] - d.type.snapToGridOffset[2], pointerCoords[1] - d.type.snapToGridOffset[3]]);
8585
+ pointerCoords[0] += d.type.snapToGridOffset[2];
8586
+ pointerCoords[1] += d.type.snapToGridOffset[3];
8587
+ }
8588
+ d.stretch(exports.Side.Bottom, pointerCoords[1] - (d.coords[1] + d.height));
8589
+ this.currentAction.to = d.getGeometry();
8590
+ this.currentAction.do();
8591
+ this.actionStack.add(this.currentAction);
8592
+ this.currentAction = undefined;
8236
8593
  }
8237
- this.secondaryButton = false;
8594
+ setCursorStyle();
8238
8595
  }));
8239
- initializeLook(enterSelection);
8240
- enterSelection.filter('.resizable-x').append('line').attr('class', 'left-resizer').attr('stroke', 'transparent').attr('stroke-width', RESIZER_THICKNESS).on(exports.Events.MouseOver, (_event, d) => {
8241
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8242
- setCursorStyle(exports.CursorStyle.EWResize);
8596
+ enterSelection.filter('.resizable-xy').append('rect').attr('class', 'top-left-resizer').on(exports.Events.MouseOver, (_event, d) => {
8597
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8598
+ setCursorStyle(exports.CursorStyle.NWSEResize);
8243
8599
  }
8244
8600
  }).on(exports.Events.MouseOut, (_event, d) => {
8245
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8601
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8246
8602
  setCursorStyle();
8247
8603
  }
8248
8604
  }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
8249
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8250
- setCursorStyle(exports.CursorStyle.EWResize);
8605
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8606
+ setCursorStyle(exports.CursorStyle.NWSEResize);
8251
8607
  this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchNode, d.id, d.getGeometry(), d.getGeometry());
8252
8608
  } else {
8253
8609
  setCursorStyle(exports.CursorStyle.NotAllowed);
8254
8610
  }
8255
8611
  }).on(exports.DragEvents.Drag, (event, d) => {
8256
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8612
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8257
8613
  const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8258
8614
  d.stretch(exports.Side.Left, d.coords[0] - pointerCoords[0]);
8615
+ d.stretch(exports.Side.Top, d.coords[1] - pointerCoords[1]);
8259
8616
  }
8260
8617
  }).on(exports.DragEvents.End, (event, d) => {
8261
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchNode) {
8618
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchNode) {
8262
8619
  let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8263
8620
  if (this.gridConfig.snap) {
8264
8621
  pointerCoords = this.getClosestGridPoint([pointerCoords[0] - d.type.snapToGridOffset[0], pointerCoords[1] - d.type.snapToGridOffset[1]]);
@@ -8266,6 +8623,7 @@ class DiagramCanvas {
8266
8623
  pointerCoords[1] += d.type.snapToGridOffset[1];
8267
8624
  }
8268
8625
  d.stretch(exports.Side.Left, d.coords[0] - pointerCoords[0]);
8626
+ d.stretch(exports.Side.Top, d.coords[1] - pointerCoords[1]);
8269
8627
  this.currentAction.to = d.getGeometry();
8270
8628
  this.currentAction.do();
8271
8629
  this.actionStack.add(this.currentAction);
@@ -8273,34 +8631,36 @@ class DiagramCanvas {
8273
8631
  }
8274
8632
  setCursorStyle();
8275
8633
  }));
8276
- enterSelection.filter('.resizable-y').append('line').attr('class', 'top-resizer').attr('stroke', 'transparent').attr('stroke-width', RESIZER_THICKNESS).on(exports.Events.MouseOver, (_event, d) => {
8277
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8278
- setCursorStyle(exports.CursorStyle.NSResize);
8634
+ enterSelection.filter('.resizable-xy').append('rect').attr('class', 'top-right-resizer').on(exports.Events.MouseOver, (_event, d) => {
8635
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8636
+ setCursorStyle(exports.CursorStyle.NESWResize);
8279
8637
  }
8280
8638
  }).on(exports.Events.MouseOut, (_event, d) => {
8281
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8639
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8282
8640
  setCursorStyle();
8283
8641
  }
8284
8642
  }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
8285
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8286
- setCursorStyle(exports.CursorStyle.NSResize);
8643
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8644
+ setCursorStyle(exports.CursorStyle.NESWResize);
8287
8645
  this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchNode, d.id, d.getGeometry(), d.getGeometry());
8288
8646
  } else {
8289
8647
  setCursorStyle(exports.CursorStyle.NotAllowed);
8290
8648
  }
8291
8649
  }).on(exports.DragEvents.Drag, (event, d) => {
8292
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8650
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8293
8651
  const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8652
+ d.stretch(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width));
8294
8653
  d.stretch(exports.Side.Top, d.coords[1] - pointerCoords[1]);
8295
8654
  }
8296
8655
  }).on(exports.DragEvents.End, (event, d) => {
8297
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchNode) {
8656
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchNode) {
8298
8657
  let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8299
8658
  if (this.gridConfig.snap) {
8300
8659
  pointerCoords = this.getClosestGridPoint([pointerCoords[0] - d.type.snapToGridOffset[0], pointerCoords[1] - d.type.snapToGridOffset[1]]);
8301
8660
  pointerCoords[0] += d.type.snapToGridOffset[0];
8302
8661
  pointerCoords[1] += d.type.snapToGridOffset[1];
8303
8662
  }
8663
+ d.stretch(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width));
8304
8664
  d.stretch(exports.Side.Top, d.coords[1] - pointerCoords[1]);
8305
8665
  this.currentAction.to = d.getGeometry();
8306
8666
  this.currentAction.do();
@@ -8309,35 +8669,37 @@ class DiagramCanvas {
8309
8669
  }
8310
8670
  setCursorStyle();
8311
8671
  }));
8312
- enterSelection.filter('.resizable-x').append('line').attr('class', 'right-resizer').attr('stroke', 'transparent').attr('stroke-width', RESIZER_THICKNESS).on(exports.Events.MouseOver, (_event, d) => {
8313
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8314
- setCursorStyle(exports.CursorStyle.EWResize);
8672
+ enterSelection.filter('.resizable-xy').append('rect').attr('class', 'bottom-left-resizer').on(exports.Events.MouseOver, (_event, d) => {
8673
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8674
+ setCursorStyle(exports.CursorStyle.NESWResize);
8315
8675
  }
8316
8676
  }).on(exports.Events.MouseOut, (_event, d) => {
8317
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8677
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8318
8678
  setCursorStyle();
8319
8679
  }
8320
8680
  }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
8321
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8322
- setCursorStyle(exports.CursorStyle.EWResize);
8681
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8682
+ setCursorStyle(exports.CursorStyle.NESWResize);
8323
8683
  this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchNode, d.id, d.getGeometry(), d.getGeometry());
8324
8684
  } else {
8325
8685
  setCursorStyle(exports.CursorStyle.NotAllowed);
8326
8686
  }
8327
8687
  }).on(exports.DragEvents.Drag, (event, d) => {
8328
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed) {
8688
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8329
8689
  const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8330
- d.stretch(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width));
8690
+ d.stretch(exports.Side.Left, d.coords[0] - pointerCoords[0]);
8691
+ d.stretch(exports.Side.Bottom, pointerCoords[1] - (d.coords[1] + d.height));
8331
8692
  }
8332
8693
  }).on(exports.DragEvents.End, (event, d) => {
8333
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableX() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchNode) {
8694
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchNode) {
8334
8695
  let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8335
8696
  if (this.gridConfig.snap) {
8336
- pointerCoords = this.getClosestGridPoint([pointerCoords[0] - d.type.snapToGridOffset[2], pointerCoords[1] - d.type.snapToGridOffset[3]]);
8337
- pointerCoords[0] += d.type.snapToGridOffset[2];
8338
- pointerCoords[1] += d.type.snapToGridOffset[3];
8697
+ pointerCoords = this.getClosestGridPoint([pointerCoords[0] - d.type.snapToGridOffset[0], pointerCoords[1] - d.type.snapToGridOffset[1]]);
8698
+ pointerCoords[0] += d.type.snapToGridOffset[0];
8699
+ pointerCoords[1] += d.type.snapToGridOffset[1];
8339
8700
  }
8340
- d.stretch(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width));
8701
+ d.stretch(exports.Side.Left, d.coords[0] - pointerCoords[0]);
8702
+ d.stretch(exports.Side.Bottom, pointerCoords[1] - (d.coords[1] + d.height));
8341
8703
  this.currentAction.to = d.getGeometry();
8342
8704
  this.currentAction.do();
8343
8705
  this.actionStack.add(this.currentAction);
@@ -8345,34 +8707,36 @@ class DiagramCanvas {
8345
8707
  }
8346
8708
  setCursorStyle();
8347
8709
  }));
8348
- enterSelection.filter('.resizable-y').append('line').attr('class', 'bottom-resizer').attr('stroke', 'transparent').attr('stroke-width', RESIZER_THICKNESS).on(exports.Events.MouseOver, (_event, d) => {
8349
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8350
- setCursorStyle(exports.CursorStyle.NSResize);
8710
+ enterSelection.filter('.resizable-xy').append('rect').attr('class', 'bottom-right-resizer').on(exports.Events.MouseOver, (_event, d) => {
8711
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8712
+ setCursorStyle(exports.CursorStyle.NWSEResize);
8351
8713
  }
8352
8714
  }).on(exports.Events.MouseOut, (_event, d) => {
8353
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8715
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8354
8716
  setCursorStyle();
8355
8717
  }
8356
8718
  }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
8357
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8358
- setCursorStyle(exports.CursorStyle.NSResize);
8719
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8720
+ setCursorStyle(exports.CursorStyle.NWSEResize);
8359
8721
  this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchNode, d.id, d.getGeometry(), d.getGeometry());
8360
8722
  } else {
8361
8723
  setCursorStyle(exports.CursorStyle.NotAllowed);
8362
8724
  }
8363
8725
  }).on(exports.DragEvents.Drag, (event, d) => {
8364
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed) {
8726
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed) {
8365
8727
  const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8728
+ d.stretch(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width));
8366
8729
  d.stretch(exports.Side.Bottom, pointerCoords[1] - (d.coords[1] + d.height));
8367
8730
  }
8368
8731
  }).on(exports.DragEvents.End, (event, d) => {
8369
- if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchNode) {
8732
+ if (this.canUserPerformAction(exports.DiagramActions.StretchNode) && d.getResizableXY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchNode) {
8370
8733
  let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8371
8734
  if (this.gridConfig.snap) {
8372
- pointerCoords = this.getClosestGridPoint([pointerCoords[0] - d.type.snapToGridOffset[2], pointerCoords[1] - d.type.snapToGridOffset[3]]);
8373
- pointerCoords[0] += d.type.snapToGridOffset[2];
8374
- pointerCoords[1] += d.type.snapToGridOffset[3];
8735
+ pointerCoords = this.getClosestGridPoint([pointerCoords[0] - d.type.snapToGridOffset[0], pointerCoords[1] - d.type.snapToGridOffset[1]]);
8736
+ pointerCoords[0] += d.type.snapToGridOffset[0];
8737
+ pointerCoords[1] += d.type.snapToGridOffset[1];
8375
8738
  }
8739
+ d.stretch(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width));
8376
8740
  d.stretch(exports.Side.Bottom, pointerCoords[1] - (d.coords[1] + d.height));
8377
8741
  this.currentAction.to = d.getGeometry();
8378
8742
  this.currentAction.do();
@@ -8383,17 +8747,21 @@ class DiagramCanvas {
8383
8747
  }));
8384
8748
  mergeSelection.attr('transform', d => `translate(${d.coords[0]},${d.coords[1]})`).attr('opacity', d => d.removed ? 0.5 : 1);
8385
8749
  updateLook(mergeSelection);
8386
- mergeSelection.filter('.resizable-x').select('line.left-resizer').style('pointer-events', d => d.getResizableX() ? 'initial' : 'none').attr('x1', RESIZER_THICKNESS / 2).attr('x2', RESIZER_THICKNESS / 2).attr('y1', 0).attr('y2', d => d.height);
8387
- mergeSelection.filter('.resizable-y').select('line.top-resizer').style('pointer-events', d => d.getResizableY() ? 'initial' : 'none').attr('x1', 0).attr('x2', d => d.width).attr('y1', RESIZER_THICKNESS / 2).attr('y2', RESIZER_THICKNESS / 2);
8388
- mergeSelection.filter('.resizable-x').select('line.right-resizer').style('pointer-events', d => d.getResizableX() ? 'initial' : 'none').attr('x1', d => d.width - RESIZER_THICKNESS / 2).attr('x2', d => d.width - RESIZER_THICKNESS / 2).attr('y1', 0).attr('y2', d => d.height);
8389
- mergeSelection.filter('.resizable-y').select('line.bottom-resizer').style('pointer-events', d => d.getResizableY() ? 'initial' : 'none').attr('x1', 0).attr('x2', d => d.width).attr('y1', d => d.height - RESIZER_THICKNESS / 2).attr('y2', d => d.height - RESIZER_THICKNESS / 2);
8750
+ mergeSelection.filter('.resizable-x').select('rect.left-resizer').style('pointer-events', d => d.getResizableX() ? 'initial' : 'none').attr('x', d => -d.getResizerX().outerMargin).attr('y', d => d.getResizerXY().thickness - d.getResizerXY().outerMargin).attr('width', d => d.getResizerX().thickness).attr('height', d => d.height - d.getResizerXY().thickness * 2 + d.getResizerXY().outerMargin * 2).attr('fill', d => d.getResizerX().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerX().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerX().getLook(d).borderThickness || 0);
8751
+ mergeSelection.filter('.resizable-x').select('rect.right-resizer').style('pointer-events', d => d.getResizableX() ? 'initial' : 'none').attr('x', d => d.width - d.getResizerX().thickness + d.getResizerX().outerMargin).attr('y', d => d.getResizerXY().thickness - d.getResizerXY().outerMargin).attr('width', d => d.getResizerX().thickness).attr('height', d => d.height - d.getResizerXY().thickness * 2 + d.getResizerXY().outerMargin * 2).attr('fill', d => d.getResizerX().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerX().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerX().getLook(d).borderThickness || 0);
8752
+ mergeSelection.filter('.resizable-y').select('rect.top-resizer').style('pointer-events', d => d.getResizableY() ? 'initial' : 'none').attr('x', d => d.getResizerXY().thickness - d.getResizerXY().outerMargin).attr('y', d => -d.getResizerY().outerMargin).attr('width', d => d.width - d.getResizerXY().thickness * 2 + d.getResizerXY().outerMargin * 2).attr('height', d => d.getResizerY().thickness).attr('fill', d => d.getResizerY().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerY().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerY().getLook(d).borderThickness || 0);
8753
+ mergeSelection.filter('.resizable-y').select('rect.bottom-resizer').style('pointer-events', d => d.getResizableY() ? 'initial' : 'none').attr('x', d => d.getResizerXY().thickness - d.getResizerXY().outerMargin).attr('y', d => d.height - d.getResizerY().thickness + d.getResizerY().outerMargin).attr('width', d => d.width - d.getResizerXY().thickness * 2 + d.getResizerXY().outerMargin * 2).attr('height', d => d.getResizerY().thickness).attr('fill', d => d.getResizerY().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerY().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerY().getLook(d).borderThickness || 0);
8754
+ mergeSelection.filter('.resizable-xy').select('rect.top-left-resizer').style('pointer-events', d => d.getResizableXY() ? 'initial' : 'none').attr('x', d => -d.getResizerXY().outerMargin).attr('y', d => -d.getResizerXY().outerMargin).attr('width', d => d.getResizerXY().thickness).attr('height', d => d.getResizerXY().thickness).attr('fill', d => d.getResizerXY().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerXY().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerXY().getLook(d).borderThickness || 0);
8755
+ mergeSelection.filter('.resizable-xy').select('rect.top-right-resizer').style('pointer-events', d => d.getResizableXY() ? 'initial' : 'none').attr('x', d => d.width - d.getResizerXY().thickness + d.getResizerXY().outerMargin).attr('y', d => -d.getResizerXY().outerMargin).attr('width', d => d.getResizerXY().thickness).attr('height', d => d.getResizerXY().thickness).attr('fill', d => d.getResizerXY().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerXY().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerXY().getLook(d).borderThickness || 0);
8756
+ mergeSelection.filter('.resizable-xy').select('rect.bottom-left-resizer').style('pointer-events', d => d.getResizableXY() ? 'initial' : 'none').attr('x', d => -d.getResizerXY().outerMargin).attr('y', d => d.height - d.getResizerXY().thickness + d.getResizerXY().outerMargin).attr('width', d => d.getResizerXY().thickness).attr('height', d => d.getResizerXY().thickness).attr('fill', d => d.getResizerXY().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerXY().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerXY().getLook(d).borderThickness || 0);
8757
+ mergeSelection.filter('.resizable-xy').select('rect.bottom-right-resizer').style('pointer-events', d => d.getResizableXY() ? 'initial' : 'none').attr('x', d => d.width - d.getResizerXY().thickness + d.getResizerXY().outerMargin).attr('y', d => d.height - d.getResizerXY().thickness + d.getResizerXY().outerMargin).attr('width', d => d.getResizerXY().thickness).attr('height', d => d.getResizerXY().thickness).attr('fill', d => d.getResizerXY().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerXY().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerXY().getLook(d).borderThickness || 0);
8390
8758
  }
8391
8759
  updateSectionsInView(...ids) {
8392
8760
  let updateSelection = this.selectCanvasElements().selectAll('g.diagram-section').data(this.model.sections.filter(e => this.priorityThreshold !== undefined ? e.getPriority() >= this.priorityThreshold : true), d => d.id);
8393
8761
  const exitSelection = updateSelection.exit();
8394
8762
  const enterSelection = updateSelection.enter().append('g').attr('id', d => d.id).attr('class', d => {
8395
8763
  var _a;
8396
- return `diagram-section${needsResizerX(d) ? ' resizable-x' : ''}${needsResizerY(d) ? ' resizable-y' : ''} ${(_a = d.look) === null || _a === void 0 ? void 0 : _a.lookType}`;
8764
+ return `diagram-section${needsResizerX(d) ? ' resizable-x' : ''}${needsResizerY(d) ? ' resizable-y' : ''}${needsResizerXY(d) ? ' resizable-xy' : ''} ${(_a = d.look) === null || _a === void 0 ? void 0 : _a.lookType}`;
8397
8765
  });
8398
8766
  if (ids && ids.length > 0) {
8399
8767
  updateSelection = updateSelection.filter(d => ids.includes(d.id));
@@ -8474,7 +8842,7 @@ class DiagramCanvas {
8474
8842
  this.secondaryButton = false;
8475
8843
  }));
8476
8844
  initializeLook(enterSelection);
8477
- enterSelection.filter('.resizable-x').append('line').attr('class', 'left-resizer').attr('stroke', 'transparent').attr('stroke-width', RESIZER_THICKNESS).on(exports.Events.MouseOver, (_event, d) => {
8845
+ enterSelection.filter('.resizable-x').append('rect').attr('class', 'left-resizer').on(exports.Events.MouseOver, (_event, d) => {
8478
8846
  if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableX() && !d.removed) {
8479
8847
  setCursorStyle(exports.CursorStyle.EWResize);
8480
8848
  }
@@ -8508,7 +8876,41 @@ class DiagramCanvas {
8508
8876
  }
8509
8877
  setCursorStyle();
8510
8878
  }));
8511
- enterSelection.filter('.resizable-y').append('line').attr('class', 'top-resizer').attr('stroke', 'transparent').attr('stroke-width', RESIZER_THICKNESS).on(exports.Events.MouseOver, (_event, d) => {
8879
+ enterSelection.filter('.resizable-x').append('rect').attr('class', 'right-resizer').on(exports.Events.MouseOver, (_event, d) => {
8880
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableX() && !d.removed) {
8881
+ setCursorStyle(exports.CursorStyle.EWResize);
8882
+ }
8883
+ }).on(exports.Events.MouseOut, (_event, d) => {
8884
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableX() && !d.removed) {
8885
+ setCursorStyle();
8886
+ }
8887
+ }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
8888
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableX() && !d.removed && d.node) {
8889
+ setCursorStyle(exports.CursorStyle.EWResize);
8890
+ this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchSection, d.node.id, d.node.getGeometry(), d.node.getGeometry());
8891
+ } else {
8892
+ setCursorStyle(exports.CursorStyle.NotAllowed);
8893
+ }
8894
+ }).on(exports.DragEvents.Drag, (event, d) => {
8895
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableX() && !d.removed && d.node) {
8896
+ const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8897
+ d.node.stretchSections(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width), d.indexXInNode, d.indexYInNode);
8898
+ }
8899
+ }).on(exports.DragEvents.End, (event, d) => {
8900
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableX() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchSection && d.node) {
8901
+ let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8902
+ if (this.gridConfig.snap) {
8903
+ pointerCoords = this.getClosestGridPoint(pointerCoords);
8904
+ }
8905
+ d.node.stretchSections(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width), d.indexXInNode, d.indexYInNode);
8906
+ this.currentAction.to = d.node.getGeometry();
8907
+ this.currentAction.do();
8908
+ this.actionStack.add(this.currentAction);
8909
+ this.currentAction = undefined;
8910
+ }
8911
+ setCursorStyle();
8912
+ }));
8913
+ enterSelection.filter('.resizable-y').append('rect').attr('class', 'top-resizer').on(exports.Events.MouseOver, (_event, d) => {
8512
8914
  if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableY() && !d.removed) {
8513
8915
  setCursorStyle(exports.CursorStyle.NSResize);
8514
8916
  }
@@ -8542,33 +8944,105 @@ class DiagramCanvas {
8542
8944
  }
8543
8945
  setCursorStyle();
8544
8946
  }));
8545
- enterSelection.filter('.resizable-x').append('line').attr('class', 'right-resizer').attr('stroke', 'transparent').attr('stroke-width', RESIZER_THICKNESS).on(exports.Events.MouseOver, (_event, d) => {
8546
- if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableX() && !d.removed) {
8547
- setCursorStyle(exports.CursorStyle.EWResize);
8947
+ enterSelection.filter('.resizable-y').append('rect').attr('class', 'bottom-resizer').on(exports.Events.MouseOver, (_event, d) => {
8948
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableY() && !d.removed) {
8949
+ setCursorStyle(exports.CursorStyle.NSResize);
8548
8950
  }
8549
8951
  }).on(exports.Events.MouseOut, (_event, d) => {
8550
- if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableX() && !d.removed) {
8952
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableY() && !d.removed) {
8551
8953
  setCursorStyle();
8552
8954
  }
8553
8955
  }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
8554
- if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableX() && !d.removed && d.node) {
8555
- setCursorStyle(exports.CursorStyle.EWResize);
8956
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableY() && !d.removed && d.node) {
8957
+ setCursorStyle(exports.CursorStyle.NSResize);
8556
8958
  this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchSection, d.node.id, d.node.getGeometry(), d.node.getGeometry());
8557
8959
  } else {
8558
8960
  setCursorStyle(exports.CursorStyle.NotAllowed);
8559
8961
  }
8560
8962
  }).on(exports.DragEvents.Drag, (event, d) => {
8561
- if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableX() && !d.removed && d.node) {
8963
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableY() && !d.removed && d.node) {
8964
+ const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8965
+ d.node.stretchSections(exports.Side.Bottom, pointerCoords[1] - (d.coords[1] + d.height), d.indexXInNode, d.indexYInNode);
8966
+ }
8967
+ }).on(exports.DragEvents.End, (event, d) => {
8968
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchSection && d.node) {
8969
+ let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8970
+ if (this.gridConfig.snap) {
8971
+ pointerCoords = this.getClosestGridPoint(pointerCoords);
8972
+ }
8973
+ d.node.stretchSections(exports.Side.Bottom, pointerCoords[1] - (d.coords[1] + d.height), d.indexXInNode, d.indexYInNode);
8974
+ this.currentAction.to = d.node.getGeometry();
8975
+ this.currentAction.do();
8976
+ this.actionStack.add(this.currentAction);
8977
+ this.currentAction = undefined;
8978
+ }
8979
+ setCursorStyle();
8980
+ }));
8981
+ enterSelection.filter('.resizable-xy').append('rect').attr('class', 'top-left-resizer').on(exports.Events.MouseOver, (_event, d) => {
8982
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed) {
8983
+ setCursorStyle(exports.CursorStyle.NWSEResize);
8984
+ }
8985
+ }).on(exports.Events.MouseOut, (_event, d) => {
8986
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed) {
8987
+ setCursorStyle();
8988
+ }
8989
+ }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
8990
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed && d.node) {
8991
+ setCursorStyle(exports.CursorStyle.NWSEResize);
8992
+ this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchSection, d.node.id, d.node.getGeometry(), d.node.getGeometry());
8993
+ } else {
8994
+ setCursorStyle(exports.CursorStyle.NotAllowed);
8995
+ }
8996
+ }).on(exports.DragEvents.Drag, (event, d) => {
8997
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed && d.node) {
8998
+ const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8999
+ d.node.stretchSections(exports.Side.Left, d.coords[0] - pointerCoords[0], d.indexXInNode, d.indexYInNode);
9000
+ d.node.stretchSections(exports.Side.Top, d.coords[1] - pointerCoords[1], d.indexXInNode, d.indexYInNode);
9001
+ }
9002
+ }).on(exports.DragEvents.End, (event, d) => {
9003
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchSection && d.node) {
9004
+ let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
9005
+ if (this.gridConfig.snap) {
9006
+ pointerCoords = this.getClosestGridPoint(pointerCoords);
9007
+ }
9008
+ d.node.stretchSections(exports.Side.Left, d.coords[0] - pointerCoords[0], d.indexXInNode, d.indexYInNode);
9009
+ d.node.stretchSections(exports.Side.Top, d.coords[1] - pointerCoords[1], d.indexXInNode, d.indexYInNode);
9010
+ this.currentAction.to = d.node.getGeometry();
9011
+ this.currentAction.do();
9012
+ this.actionStack.add(this.currentAction);
9013
+ this.currentAction = undefined;
9014
+ }
9015
+ setCursorStyle();
9016
+ }));
9017
+ enterSelection.filter('.resizable-xy').append('rect').attr('class', 'top-right-resizer').on(exports.Events.MouseOver, (_event, d) => {
9018
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed) {
9019
+ setCursorStyle(exports.CursorStyle.NESWResize);
9020
+ }
9021
+ }).on(exports.Events.MouseOut, (_event, d) => {
9022
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed) {
9023
+ setCursorStyle();
9024
+ }
9025
+ }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
9026
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed && d.node) {
9027
+ setCursorStyle(exports.CursorStyle.NESWResize);
9028
+ this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchSection, d.node.id, d.node.getGeometry(), d.node.getGeometry());
9029
+ } else {
9030
+ setCursorStyle(exports.CursorStyle.NotAllowed);
9031
+ }
9032
+ }).on(exports.DragEvents.Drag, (event, d) => {
9033
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed && d.node) {
8562
9034
  const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8563
9035
  d.node.stretchSections(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width), d.indexXInNode, d.indexYInNode);
9036
+ d.node.stretchSections(exports.Side.Top, d.coords[1] - pointerCoords[1], d.indexXInNode, d.indexYInNode);
8564
9037
  }
8565
9038
  }).on(exports.DragEvents.End, (event, d) => {
8566
- if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableX() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchSection && d.node) {
9039
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchSection && d.node) {
8567
9040
  let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8568
9041
  if (this.gridConfig.snap) {
8569
9042
  pointerCoords = this.getClosestGridPoint(pointerCoords);
8570
9043
  }
8571
9044
  d.node.stretchSections(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width), d.indexXInNode, d.indexYInNode);
9045
+ d.node.stretchSections(exports.Side.Top, d.coords[1] - pointerCoords[1], d.indexXInNode, d.indexYInNode);
8572
9046
  this.currentAction.to = d.node.getGeometry();
8573
9047
  this.currentAction.do();
8574
9048
  this.actionStack.add(this.currentAction);
@@ -8576,32 +9050,70 @@ class DiagramCanvas {
8576
9050
  }
8577
9051
  setCursorStyle();
8578
9052
  }));
8579
- enterSelection.filter('.resizable-y').append('line').attr('class', 'bottom-resizer').attr('stroke', 'transparent').attr('stroke-width', RESIZER_THICKNESS).on(exports.Events.MouseOver, (_event, d) => {
8580
- if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableY() && !d.removed) {
8581
- setCursorStyle(exports.CursorStyle.NSResize);
9053
+ enterSelection.filter('.resizable-xy').append('rect').attr('class', 'bottom-left-resizer').on(exports.Events.MouseOver, (_event, d) => {
9054
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed) {
9055
+ setCursorStyle(exports.CursorStyle.NESWResize);
8582
9056
  }
8583
9057
  }).on(exports.Events.MouseOut, (_event, d) => {
8584
- if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableY() && !d.removed) {
9058
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed) {
8585
9059
  setCursorStyle();
8586
9060
  }
8587
9061
  }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
8588
- if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableY() && !d.removed && d.node) {
8589
- setCursorStyle(exports.CursorStyle.NSResize);
9062
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed && d.node) {
9063
+ setCursorStyle(exports.CursorStyle.NESWResize);
8590
9064
  this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchSection, d.node.id, d.node.getGeometry(), d.node.getGeometry());
8591
9065
  } else {
8592
9066
  setCursorStyle(exports.CursorStyle.NotAllowed);
8593
9067
  }
8594
9068
  }).on(exports.DragEvents.Drag, (event, d) => {
8595
- if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableY() && !d.removed && d.node) {
9069
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed && d.node) {
8596
9070
  const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
9071
+ d.node.stretchSections(exports.Side.Left, d.coords[0] - pointerCoords[0], d.indexXInNode, d.indexYInNode);
8597
9072
  d.node.stretchSections(exports.Side.Bottom, pointerCoords[1] - (d.coords[1] + d.height), d.indexXInNode, d.indexYInNode);
8598
9073
  }
8599
9074
  }).on(exports.DragEvents.End, (event, d) => {
8600
- if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchSection && d.node) {
9075
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchSection && d.node) {
9076
+ let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
9077
+ if (this.gridConfig.snap) {
9078
+ pointerCoords = this.getClosestGridPoint(pointerCoords);
9079
+ }
9080
+ d.node.stretchSections(exports.Side.Left, d.coords[0] - pointerCoords[0], d.indexXInNode, d.indexYInNode);
9081
+ d.node.stretchSections(exports.Side.Bottom, pointerCoords[1] - (d.coords[1] + d.height), d.indexXInNode, d.indexYInNode);
9082
+ this.currentAction.to = d.node.getGeometry();
9083
+ this.currentAction.do();
9084
+ this.actionStack.add(this.currentAction);
9085
+ this.currentAction = undefined;
9086
+ }
9087
+ setCursorStyle();
9088
+ }));
9089
+ enterSelection.filter('.resizable-xy').append('rect').attr('class', 'bottom-right-resizer').on(exports.Events.MouseOver, (_event, d) => {
9090
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed) {
9091
+ setCursorStyle(exports.CursorStyle.NWSEResize);
9092
+ }
9093
+ }).on(exports.Events.MouseOut, (_event, d) => {
9094
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed) {
9095
+ setCursorStyle();
9096
+ }
9097
+ }).call(d3__namespace.drag().on(exports.DragEvents.Start, (_event, d) => {
9098
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed && d.node) {
9099
+ setCursorStyle(exports.CursorStyle.NWSEResize);
9100
+ this.currentAction = new SetGeometryAction(this, exports.DiagramActions.StretchSection, d.node.id, d.node.getGeometry(), d.node.getGeometry());
9101
+ } else {
9102
+ setCursorStyle(exports.CursorStyle.NotAllowed);
9103
+ }
9104
+ }).on(exports.DragEvents.Drag, (event, d) => {
9105
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed && d.node) {
9106
+ const pointerCoords = this.getPointerLocationRelativeToCanvas(event);
9107
+ d.node.stretchSections(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width), d.indexXInNode, d.indexYInNode);
9108
+ d.node.stretchSections(exports.Side.Bottom, pointerCoords[1] - (d.coords[1] + d.height), d.indexXInNode, d.indexYInNode);
9109
+ }
9110
+ }).on(exports.DragEvents.End, (event, d) => {
9111
+ if (this.canUserPerformAction(exports.DiagramActions.StretchSection) && d.getResizableXY() && !d.removed && this.currentAction instanceof SetGeometryAction && this.currentAction.intent === exports.DiagramActions.StretchSection && d.node) {
8601
9112
  let pointerCoords = this.getPointerLocationRelativeToCanvas(event);
8602
9113
  if (this.gridConfig.snap) {
8603
9114
  pointerCoords = this.getClosestGridPoint(pointerCoords);
8604
9115
  }
9116
+ d.node.stretchSections(exports.Side.Right, pointerCoords[0] - (d.coords[0] + d.width), d.indexXInNode, d.indexYInNode);
8605
9117
  d.node.stretchSections(exports.Side.Bottom, pointerCoords[1] - (d.coords[1] + d.height), d.indexXInNode, d.indexYInNode);
8606
9118
  this.currentAction.to = d.node.getGeometry();
8607
9119
  this.currentAction.do();
@@ -8612,10 +9124,14 @@ class DiagramCanvas {
8612
9124
  }));
8613
9125
  mergeSelection.attr('transform', d => `translate(${d.coords[0]},${d.coords[1]})`).attr('opacity', d => d.removed ? 0.5 : 1);
8614
9126
  updateLook(mergeSelection);
8615
- mergeSelection.filter('.resizable-x').select('line.left-resizer').style('pointer-events', d => d.getResizableX() ? 'initial' : 'none').attr('x1', RESIZER_THICKNESS / 2).attr('x2', RESIZER_THICKNESS / 2).attr('y1', 0).attr('y2', d => d.height);
8616
- mergeSelection.filter('.resizable-y').select('line.top-resizer').style('pointer-events', d => d.getResizableY() ? 'initial' : 'none').attr('x1', 0).attr('x2', d => d.width).attr('y1', RESIZER_THICKNESS / 2).attr('y2', RESIZER_THICKNESS / 2);
8617
- mergeSelection.filter('.resizable-x').select('line.right-resizer').style('pointer-events', d => d.getResizableX() ? 'initial' : 'none').attr('x1', d => d.width - RESIZER_THICKNESS / 2).attr('x2', d => d.width - RESIZER_THICKNESS / 2).attr('y1', 0).attr('y2', d => d.height);
8618
- mergeSelection.filter('.resizable-y').select('line.bottom-resizer').style('pointer-events', d => d.getResizableY() ? 'initial' : 'none').attr('x1', 0).attr('x2', d => d.width).attr('y1', d => d.height - RESIZER_THICKNESS / 2).attr('y2', d => d.height - RESIZER_THICKNESS / 2);
9127
+ mergeSelection.filter('.resizable-x').select('rect.left-resizer').style('pointer-events', d => d.getResizableX() ? 'initial' : 'none').attr('x', d => -d.getResizerX().outerMargin).attr('y', d => d.getResizerXY().thickness - d.getResizerXY().outerMargin).attr('width', d => d.getResizerX().thickness).attr('height', d => d.height - d.getResizerXY().thickness * 2 + d.getResizerXY().outerMargin * 2).attr('fill', d => d.getResizerX().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerX().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerX().getLook(d).borderThickness || 0);
9128
+ mergeSelection.filter('.resizable-x').select('rect.right-resizer').style('pointer-events', d => d.getResizableX() ? 'initial' : 'none').attr('x', d => d.width - d.getResizerX().thickness + d.getResizerX().outerMargin).attr('y', d => d.getResizerXY().thickness - d.getResizerXY().outerMargin).attr('width', d => d.getResizerX().thickness).attr('height', d => d.height - d.getResizerXY().thickness * 2 + d.getResizerXY().outerMargin * 2).attr('fill', d => d.getResizerX().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerX().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerX().getLook(d).borderThickness || 0);
9129
+ mergeSelection.filter('.resizable-y').select('rect.top-resizer').style('pointer-events', d => d.getResizableY() ? 'initial' : 'none').attr('x', d => d.getResizerXY().thickness - d.getResizerXY().outerMargin).attr('y', d => -d.getResizerY().outerMargin).attr('width', d => d.width - d.getResizerXY().thickness * 2 + d.getResizerXY().outerMargin * 2).attr('height', d => d.getResizerY().thickness).attr('fill', d => d.getResizerY().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerY().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerY().getLook(d).borderThickness || 0);
9130
+ mergeSelection.filter('.resizable-y').select('rect.bottom-resizer').style('pointer-events', d => d.getResizableY() ? 'initial' : 'none').attr('x', d => d.getResizerXY().thickness - d.getResizerXY().outerMargin).attr('y', d => d.height - d.getResizerY().thickness + d.getResizerY().outerMargin).attr('width', d => d.width - d.getResizerXY().thickness * 2 + d.getResizerXY().outerMargin * 2).attr('height', d => d.getResizerY().thickness).attr('fill', d => d.getResizerY().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerY().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerY().getLook(d).borderThickness || 0);
9131
+ mergeSelection.filter('.resizable-xy').select('rect.top-left-resizer').style('pointer-events', d => d.getResizableXY() ? 'initial' : 'none').attr('x', d => -d.getResizerXY().outerMargin).attr('y', d => -d.getResizerXY().outerMargin).attr('width', d => d.getResizerXY().thickness).attr('height', d => d.getResizerXY().thickness).attr('fill', d => d.getResizerXY().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerXY().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerXY().getLook(d).borderThickness || 0);
9132
+ mergeSelection.filter('.resizable-xy').select('rect.top-right-resizer').style('pointer-events', d => d.getResizableXY() ? 'initial' : 'none').attr('x', d => d.width - d.getResizerXY().thickness + d.getResizerXY().outerMargin).attr('y', d => -d.getResizerXY().outerMargin).attr('width', d => d.getResizerXY().thickness).attr('height', d => d.getResizerXY().thickness).attr('fill', d => d.getResizerXY().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerXY().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerXY().getLook(d).borderThickness || 0);
9133
+ mergeSelection.filter('.resizable-xy').select('rect.bottom-left-resizer').style('pointer-events', d => d.getResizableXY() ? 'initial' : 'none').attr('x', d => -d.getResizerXY().outerMargin).attr('y', d => d.height - d.getResizerXY().thickness + d.getResizerXY().outerMargin).attr('width', d => d.getResizerXY().thickness).attr('height', d => d.getResizerXY().thickness).attr('fill', d => d.getResizerXY().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerXY().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerXY().getLook(d).borderThickness || 0);
9134
+ mergeSelection.filter('.resizable-xy').select('rect.bottom-right-resizer').style('pointer-events', d => d.getResizableXY() ? 'initial' : 'none').attr('x', d => d.width - d.getResizerXY().thickness + d.getResizerXY().outerMargin).attr('y', d => d.height - d.getResizerXY().thickness + d.getResizerXY().outerMargin).attr('width', d => d.getResizerXY().thickness).attr('height', d => d.getResizerXY().thickness).attr('fill', d => d.getResizerXY().getLook(d).fillColor || 'transparent').attr('stroke', d => d.getResizerXY().getLook(d).borderColor || 'transparent').attr('stroke-width', d => d.getResizerXY().getLook(d).borderThickness || 0);
8619
9135
  }
8620
9136
  updatePortsInView(...ids) {
8621
9137
  let updateSelection = this.selectCanvasElements().selectAll('g.diagram-port').data(this.model.ports.filter(e => this.priorityThreshold !== undefined ? e.getPriority() >= this.priorityThreshold : true), d => d.id);