bpmn-js 18.24.0 → 18.25.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 v18.24.0
2
+ * bpmn-js - bpmn-modeler v18.25.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: 2026-08-11
11
+ * Date: 2026-08-19
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -50254,6 +50254,182 @@
50254
50254
  return label.get('bounds');
50255
50255
  }
50256
50256
 
50257
+ /**
50258
+ * @typedef {import('diagram-js/lib/util/Types').Dimensions} Dimensions
50259
+ *
50260
+ * @typedef {import('../model/Types').Element} Element
50261
+ * @typedef {import('../model/Types').ModdleElement} ModdleElement
50262
+ */
50263
+
50264
+ /**
50265
+ * Default size of elements without an explicit default.
50266
+ *
50267
+ * @type {Dimensions}
50268
+ */
50269
+ const DEFAULT_SIZE = { width: 100, height: 80 };
50270
+
50271
+ /**
50272
+ * @type {Dimensions}
50273
+ */
50274
+ const DEFAULT_TASK_SIZE = { width: 100, height: 80 };
50275
+
50276
+ /**
50277
+ * @type {Dimensions}
50278
+ */
50279
+ const DEFAULT_GATEWAY_SIZE = { width: 50, height: 50 };
50280
+
50281
+ /**
50282
+ * @type {Dimensions}
50283
+ */
50284
+ const DEFAULT_EVENT_SIZE = { width: 36, height: 36 };
50285
+
50286
+ /**
50287
+ * @type {Dimensions}
50288
+ */
50289
+ const DEFAULT_SUB_PROCESS_SIZE = { width: 350, height: 200 };
50290
+
50291
+ /**
50292
+ * @type {Dimensions}
50293
+ */
50294
+ const DEFAULT_COLLAPSED_SUB_PROCESS_SIZE = { width: 100, height: 80 };
50295
+
50296
+ /**
50297
+ * @type {Dimensions}
50298
+ */
50299
+ const DEFAULT_PARTICIPANT_SIZE = { width: 600, height: 250 };
50300
+
50301
+ /**
50302
+ * @type {Dimensions}
50303
+ */
50304
+ const DEFAULT_VERTICAL_PARTICIPANT_SIZE = { width: 250, height: 600 };
50305
+
50306
+ /**
50307
+ * @type {Dimensions}
50308
+ */
50309
+ const DEFAULT_COLLAPSED_PARTICIPANT_SIZE = { width: 400, height: 60 };
50310
+
50311
+ /**
50312
+ * @type {Dimensions}
50313
+ */
50314
+ const DEFAULT_VERTICAL_COLLAPSED_PARTICIPANT_SIZE = { width: 60, height: 400 };
50315
+
50316
+ /**
50317
+ * @type {Dimensions}
50318
+ */
50319
+ const DEFAULT_LANE_SIZE = { width: 400, height: 100 };
50320
+
50321
+ /**
50322
+ * @type {Dimensions}
50323
+ */
50324
+ const DEFAULT_DATA_OBJECT_REFERENCE_SIZE = { width: 36, height: 50 };
50325
+
50326
+ /**
50327
+ * @type {Dimensions}
50328
+ */
50329
+ const DEFAULT_DATA_STORE_REFERENCE_SIZE = { width: 50, height: 50 };
50330
+
50331
+ /**
50332
+ * @type {Dimensions}
50333
+ */
50334
+ const DEFAULT_TEXT_ANNOTATION_SIZE = { width: 100, height: 40 };
50335
+
50336
+ /**
50337
+ * @type {Dimensions}
50338
+ */
50339
+ const DEFAULT_GROUP_SIZE = { width: 300, height: 300 };
50340
+
50341
+
50342
+ /**
50343
+ * Get the default size of a BPMN element.
50344
+ *
50345
+ * Elements without an explicit default, e.g. `bpmn:CallActivity`, fall back to
50346
+ * `DEFAULT_SIZE`.
50347
+ *
50348
+ * @overlord
50349
+ * @param {Element} element The element.
50350
+ * @param {ModdleElement} [di] The DI; defaults to the DI of the element.
50351
+ *
50352
+ * @return {Dimensions} Default width and height of the element.
50353
+ */
50354
+
50355
+ /**
50356
+ * Get the default size of a BPMN element.
50357
+ *
50358
+ * Elements without an explicit default, e.g. `bpmn:CallActivity`, fall back to
50359
+ * `DEFAULT_SIZE`.
50360
+ *
50361
+ * @param {ModdleElement} element The element.
50362
+ * @param {ModdleElement} di The DI.
50363
+ *
50364
+ * @return {Dimensions} Default width and height of the element.
50365
+ */
50366
+ function getDefaultSize(element, di) {
50367
+
50368
+ const bo = getBusinessObject(element);
50369
+
50370
+ di = di || getDi(element);
50371
+
50372
+ if (is(bo, 'bpmn:SubProcess')) {
50373
+ if (isExpanded(bo, di)) {
50374
+ return { ...DEFAULT_SUB_PROCESS_SIZE };
50375
+ } else {
50376
+ return { ...DEFAULT_COLLAPSED_SUB_PROCESS_SIZE };
50377
+ }
50378
+ }
50379
+
50380
+ if (is(bo, 'bpmn:Task')) {
50381
+ return { ...DEFAULT_TASK_SIZE };
50382
+ }
50383
+
50384
+ if (is(bo, 'bpmn:Gateway')) {
50385
+ return { ...DEFAULT_GATEWAY_SIZE };
50386
+ }
50387
+
50388
+ if (is(bo, 'bpmn:Event')) {
50389
+ return { ...DEFAULT_EVENT_SIZE };
50390
+ }
50391
+
50392
+ if (is(bo, 'bpmn:Participant')) {
50393
+ const isHorizontalPool = !di || di.isHorizontal === undefined || di.isHorizontal === true;
50394
+
50395
+ if (isExpanded(bo, di)) {
50396
+ if (isHorizontalPool) {
50397
+ return { ...DEFAULT_PARTICIPANT_SIZE };
50398
+ }
50399
+
50400
+ return { ...DEFAULT_VERTICAL_PARTICIPANT_SIZE };
50401
+ } else {
50402
+ if (isHorizontalPool) {
50403
+ return { ...DEFAULT_COLLAPSED_PARTICIPANT_SIZE };
50404
+ }
50405
+
50406
+ return { ...DEFAULT_VERTICAL_COLLAPSED_PARTICIPANT_SIZE };
50407
+ }
50408
+ }
50409
+
50410
+ if (is(bo, 'bpmn:Lane')) {
50411
+ return { ...DEFAULT_LANE_SIZE };
50412
+ }
50413
+
50414
+ if (is(bo, 'bpmn:DataObjectReference')) {
50415
+ return { ...DEFAULT_DATA_OBJECT_REFERENCE_SIZE };
50416
+ }
50417
+
50418
+ if (is(bo, 'bpmn:DataStoreReference')) {
50419
+ return { ...DEFAULT_DATA_STORE_REFERENCE_SIZE };
50420
+ }
50421
+
50422
+ if (is(bo, 'bpmn:TextAnnotation')) {
50423
+ return { ...DEFAULT_TEXT_ANNOTATION_SIZE };
50424
+ }
50425
+
50426
+ if (is(bo, 'bpmn:Group')) {
50427
+ return { ...DEFAULT_GROUP_SIZE };
50428
+ }
50429
+
50430
+ return { ...DEFAULT_SIZE };
50431
+ }
50432
+
50257
50433
  /**
50258
50434
  * @typedef {import('diagram-js/lib/util/Types').Dimensions} Dimensions
50259
50435
  *
@@ -50483,71 +50659,12 @@
50483
50659
  * Get the default size of a diagram element.
50484
50660
  *
50485
50661
  * @param {Element} element The element.
50486
- * @param {ModdleElement} di The DI.
50662
+ * @param {ModdleElement} [di] The DI.
50487
50663
  *
50488
50664
  * @return {Dimensions} Default width and height of the element.
50489
50665
  */
50490
50666
  ElementFactory.prototype.getDefaultSize = function(element, di) {
50491
-
50492
- var bo = getBusinessObject(element);
50493
- di = di || getDi(element);
50494
-
50495
- if (is(bo, 'bpmn:SubProcess')) {
50496
- if (isExpanded(bo, di)) {
50497
- return { width: 350, height: 200 };
50498
- } else {
50499
- return { width: 100, height: 80 };
50500
- }
50501
- }
50502
-
50503
- if (is(bo, 'bpmn:Task')) {
50504
- return { width: 100, height: 80 };
50505
- }
50506
-
50507
- if (is(bo, 'bpmn:Gateway')) {
50508
- return { width: 50, height: 50 };
50509
- }
50510
-
50511
- if (is(bo, 'bpmn:Event')) {
50512
- return { width: 36, height: 36 };
50513
- }
50514
-
50515
- if (is(bo, 'bpmn:Participant')) {
50516
- var isHorizontalPool = di.isHorizontal === undefined || di.isHorizontal === true;
50517
- if (isExpanded(bo, di)) {
50518
- if (isHorizontalPool) {
50519
- return { width: 600, height: 250 };
50520
- }
50521
- return { width: 250, height: 600 };
50522
- } else {
50523
- if (isHorizontalPool) {
50524
- return { width: 400, height: 60 };
50525
- }
50526
- return { width: 60, height: 400 };
50527
- }
50528
- }
50529
-
50530
- if (is(bo, 'bpmn:Lane')) {
50531
- return { width: 400, height: 100 };
50532
- }
50533
-
50534
- if (is(bo, 'bpmn:DataObjectReference')) {
50535
- return { width: 36, height: 50 };
50536
- }
50537
-
50538
- if (is(bo, 'bpmn:DataStoreReference')) {
50539
- return { width: 50, height: 50 };
50540
- }
50541
-
50542
- if (is(bo, 'bpmn:TextAnnotation')) {
50543
- return { width: 100, height: 40 };
50544
- }
50545
-
50546
- if (is(bo, 'bpmn:Group')) {
50547
- return { width: 300, height: 300 };
50548
- }
50549
-
50550
- return { width: 100, height: 80 };
50667
+ return getDefaultSize(element, di);
50551
50668
  };
50552
50669
 
50553
50670