bpmn-js 17.0.1 → 17.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v17.0.1
2
+ * bpmn-js - bpmn-modeler v17.1.0
3
3
  *
4
4
  * Copyright (c) 2014-present, camunda Services GmbH
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Source Code: https://github.com/bpmn-io/bpmn-js
10
10
  *
11
- * Date: 2024-02-15
11
+ * Date: 2024-03-18
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -51357,36 +51357,41 @@
51357
51357
  throw new Error(translate('more than {count} child lanes', { count: newLanesCount }));
51358
51358
  }
51359
51359
 
51360
- var newLanesHeight = Math.round(shape.height / newLanesCount);
51360
+ var isHorizontalLane = isHorizontal$3(shape);
51361
+
51362
+ var laneBaseSize = isHorizontalLane ? shape.height : shape.width;
51363
+ var newLanesSize = Math.round(laneBaseSize / newLanesCount);
51361
51364
 
51362
- // Iterate from top to bottom in child lane order,
51365
+ // Iterate from first to last in child lane order,
51363
51366
  // resizing existing lanes and creating new ones
51364
51367
  // so that they split the parent proportionally.
51365
51368
  //
51366
- // Due to rounding related errors, the bottom lane
51369
+ // Due to rounding related errors, the last lane
51367
51370
  // needs to take up all the remaining space.
51368
- var laneY,
51369
- laneHeight,
51371
+ var laneSize,
51370
51372
  laneBounds,
51371
51373
  newLaneAttrs,
51372
51374
  idx;
51373
51375
 
51374
51376
  for (idx = 0; idx < newLanesCount; idx++) {
51375
51377
 
51376
- laneY = shape.y + idx * newLanesHeight;
51377
-
51378
- // if bottom lane
51378
+ // if last lane
51379
51379
  if (idx === newLanesCount - 1) {
51380
- laneHeight = shape.height - (newLanesHeight * idx);
51380
+ laneSize = laneBaseSize - (newLanesSize * idx);
51381
51381
  } else {
51382
- laneHeight = newLanesHeight;
51382
+ laneSize = newLanesSize;
51383
51383
  }
51384
51384
 
51385
- laneBounds = {
51385
+ laneBounds = isHorizontalLane ? {
51386
51386
  x: shape.x + LANE_INDENTATION,
51387
- y: laneY,
51387
+ y: shape.y + idx * newLanesSize,
51388
51388
  width: shape.width - LANE_INDENTATION,
51389
- height: laneHeight
51389
+ height: laneSize
51390
+ } : {
51391
+ x: shape.x + idx * newLanesSize,
51392
+ y: shape.y + LANE_INDENTATION,
51393
+ width: laneSize,
51394
+ height: shape.height - LANE_INDENTATION
51390
51395
  };
51391
51396
 
51392
51397
  if (idx < existingLanesCount) {
@@ -51397,7 +51402,8 @@
51397
51402
 
51398
51403
  // create a new lane at position
51399
51404
  newLaneAttrs = {
51400
- type: 'bpmn:Lane'
51405
+ type: 'bpmn:Lane',
51406
+ isHorizontal: isHorizontalLane
51401
51407
  };
51402
51408
 
51403
51409
  modeling.createShape(newLaneAttrs, laneBounds, shape);
@@ -56348,7 +56354,7 @@
56348
56354
 
56349
56355
  if (childLanes.length < 2) {
56350
56356
 
56351
- if (element.height >= 120) {
56357
+ if (isHorizontal$3(element) ? element.height >= 120 : element.width >= 120) {
56352
56358
  assign$1(actions, {
56353
56359
  'lane-divide-two': {
56354
56360
  group: 'lane-divide',
@@ -56361,7 +56367,7 @@
56361
56367
  });
56362
56368
  }
56363
56369
 
56364
- if (element.height >= 180) {
56370
+ if (isHorizontal$3(element) ? element.height >= 180 : element.width >= 180) {
56365
56371
  assign$1(actions, {
56366
56372
  'lane-divide-three': {
56367
56373
  group: 'lane-divide',
@@ -58503,10 +58509,15 @@
58503
58509
  });
58504
58510
 
58505
58511
  // add label hit
58506
- this._interactionEvents.createBoxHit(gfx, 'all', {
58512
+ var box = isHorizontal$3(element) ? {
58507
58513
  width: LABEL_WIDTH,
58508
58514
  height: element.height
58509
- });
58515
+ } : {
58516
+ width: element.width,
58517
+ height: LABEL_HEIGHT
58518
+ };
58519
+
58520
+ this._interactionEvents.createBoxHit(gfx, 'all', box);
58510
58521
 
58511
58522
  // indicate that we created a hit
58512
58523
  return true;