bpmn-js 17.3.0 → 17.5.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.
@@ -202,6 +202,13 @@ LabelEditingProvider.prototype.activate = function(element) {
202
202
  assign(context, bounds);
203
203
 
204
204
  var options = {};
205
+ var style = context.style || {};
206
+
207
+ // Remove background and border
208
+ assign(style, {
209
+ backgroundColor: null,
210
+ border: null
211
+ });
205
212
 
206
213
  // tasks
207
214
  if (
@@ -223,6 +230,12 @@ LabelEditingProvider.prototype.activate = function(element) {
223
230
  assign(options, {
224
231
  autoResize: true
225
232
  });
233
+
234
+ // keep background and border for external labels
235
+ assign(style, {
236
+ backgroundColor: '#ffffff',
237
+ border: '1px solid #ccc'
238
+ });
226
239
  }
227
240
 
228
241
  // text annotations
@@ -231,10 +244,17 @@ LabelEditingProvider.prototype.activate = function(element) {
231
244
  resizable: true,
232
245
  autoResize: true
233
246
  });
247
+
248
+ // keep background and border for text annotations
249
+ assign(style, {
250
+ backgroundColor: '#ffffff',
251
+ border: '1px solid #ccc'
252
+ });
234
253
  }
235
254
 
236
255
  assign(context, {
237
- options: options
256
+ options: options,
257
+ style: style
238
258
  });
239
259
 
240
260
  return context;
@@ -8,9 +8,8 @@ export default class BpmnUpdater extends CommandInterceptor {
8
8
  * @param eventBus
9
9
  * @param bpmnFactory
10
10
  * @param connectionDocking
11
- * @param translate
12
11
  */
13
- constructor(eventBus: EventBus, bpmnFactory: BpmnFactory, connectionDocking: CroppingConnectionDocking, translate: Translate);
12
+ constructor(eventBus: EventBus, bpmnFactory: BpmnFactory, connectionDocking: CroppingConnectionDocking);
14
13
 
15
14
  /**
16
15
  * @param context
@@ -83,7 +82,6 @@ export default class BpmnUpdater extends CommandInterceptor {
83
82
  type EventBus = import('diagram-js/lib/core/EventBus').default;
84
83
  type BpmnFactory = import('./BpmnFactory').default;
85
84
  type CroppingConnectionDocking = import('diagram-js/lib/layout/CroppingConnectionDocking').default;
86
- export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
87
85
  type Connection = import('../../model/Types').Connection;
88
86
  type Element = import('../../model/Types').Element;
89
87
  type Shape = import('../../model/Types').Shape;
@@ -34,7 +34,6 @@ import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
34
34
  * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
35
35
  * @typedef {import('./BpmnFactory').default} BpmnFactory
36
36
  * @typedef {import('diagram-js/lib/layout/CroppingConnectionDocking').default} CroppingConnectionDocking
37
- * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
38
37
  *
39
38
  * @typedef {import('../../model/Types').Connection} Connection
40
39
  * @typedef {import('../../model/Types').Element} Element
@@ -50,24 +49,20 @@ import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
50
49
  * @param {EventBus} eventBus
51
50
  * @param {BpmnFactory} bpmnFactory
52
51
  * @param {CroppingConnectionDocking} connectionDocking
53
- * @param {Translate} translate
54
52
  */
55
53
  export default function BpmnUpdater(
56
54
  eventBus,
57
55
  bpmnFactory,
58
- connectionDocking,
59
- translate
56
+ connectionDocking
60
57
  ) {
61
58
 
62
59
  CommandInterceptor.call(this, eventBus);
63
60
 
64
61
  this._bpmnFactory = bpmnFactory;
65
- this._translate = translate;
66
62
 
67
63
  var self = this;
68
64
 
69
65
 
70
-
71
66
  // connection cropping //////////////////////
72
67
 
73
68
  // crop connection ends during create/update
@@ -322,8 +317,7 @@ inherits(BpmnUpdater, CommandInterceptor);
322
317
  BpmnUpdater.$inject = [
323
318
  'eventBus',
324
319
  'bpmnFactory',
325
- 'connectionDocking',
326
- 'translate'
320
+ 'connectionDocking'
327
321
  ];
328
322
 
329
323
 
@@ -562,8 +556,7 @@ BpmnUpdater.prototype.getLaneSet = function(container) {
562
556
  */
563
557
  BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent, visualParent) {
564
558
 
565
- var containment,
566
- translate = this._translate;
559
+ var containment;
567
560
 
568
561
  if (businessObject.$parent === newParent) {
569
562
  return;
@@ -668,13 +661,7 @@ BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent,
668
661
  }
669
662
 
670
663
  if (!containment) {
671
- throw new Error(translate(
672
- 'no parent for {element} in {parent}',
673
- {
674
- element: businessObject.id,
675
- parent: newParent.id
676
- }
677
- ));
664
+ throw new Error(`no parent for <${ businessObject.id }> in <${ newParent.id }>`);
678
665
  }
679
666
 
680
667
  var children;
@@ -11,9 +11,8 @@ export default class ElementFactory<T extends import("../../model/Types").Connec
11
11
  /**
12
12
  * @param bpmnFactory
13
13
  * @param moddle
14
- * @param translate
15
14
  */
16
- constructor(bpmnFactory: BpmnFactory, moddle: Moddle, translate: Translate);
15
+ constructor(bpmnFactory: BpmnFactory, moddle: Moddle);
17
16
 
18
17
  /**
19
18
  * Create a label.
@@ -105,7 +104,6 @@ export default class ElementFactory<T extends import("../../model/Types").Connec
105
104
  createParticipantShape(attrs?: boolean | (Partial<Shape> & Partial<BpmnAttributes>)): W;
106
105
  }
107
106
 
108
- export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
109
107
  type Dimensions = import('diagram-js/lib/util/Types').Dimensions;
110
108
  type BpmnFactory = import('./BpmnFactory').default;
111
109
  type BpmnAttributes = import('../../model/Types').BpmnAttributes;
@@ -34,8 +34,6 @@ import {
34
34
  } from '../../util/CompatibilityUtil';
35
35
 
36
36
  /**
37
- * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
38
- *
39
37
  * @typedef {import('diagram-js/lib/util/Types').Dimensions} Dimensions
40
38
  *
41
39
  * @typedef {import('./BpmnFactory').default} BpmnFactory
@@ -62,22 +60,19 @@ import {
62
60
  *
63
61
  * @param {BpmnFactory} bpmnFactory
64
62
  * @param {Moddle} moddle
65
- * @param {Translate} translate
66
63
  */
67
- export default function ElementFactory(bpmnFactory, moddle, translate) {
64
+ export default function ElementFactory(bpmnFactory, moddle) {
68
65
  BaseElementFactory.call(this);
69
66
 
70
67
  this._bpmnFactory = bpmnFactory;
71
68
  this._moddle = moddle;
72
- this._translate = translate;
73
69
  }
74
70
 
75
71
  inherits(ElementFactory, BaseElementFactory);
76
72
 
77
73
  ElementFactory.$inject = [
78
74
  'bpmnFactory',
79
- 'moddle',
80
- 'translate'
75
+ 'moddle'
81
76
  ];
82
77
 
83
78
  ElementFactory.prototype._baseCreate = BaseElementFactory.prototype.create;
@@ -155,17 +150,17 @@ ElementFactory.prototype.create = function(elementType, attrs) {
155
150
  * @return {T}
156
151
  */
157
152
  ElementFactory.prototype.createElement = function(elementType, attrs) {
158
- var size,
159
- translate = this._translate;
160
153
 
161
154
  attrs = assign({}, attrs || {});
162
155
 
156
+ var size;
157
+
163
158
  var businessObject = attrs.businessObject,
164
159
  di = attrs.di;
165
160
 
166
161
  if (!businessObject) {
167
162
  if (!attrs.type) {
168
- throw new Error(translate('no shape type specified'));
163
+ throw new Error('no shape type specified');
169
164
  }
170
165
 
171
166
  businessObject = this._bpmnFactory.create(attrs.type);
@@ -6,12 +6,10 @@ export default class UpdateFlowNodeRefsBehavior extends CommandInterceptor {
6
6
  /**
7
7
  * @param eventBus
8
8
  * @param modeling
9
- * @param translate
10
9
  */
11
- constructor(eventBus: EventBus, modeling: Modeling, translate: Translate);
10
+ constructor(eventBus: EventBus, modeling: Modeling);
12
11
  }
13
12
 
14
13
  type EventBus = import('diagram-js/lib/core/EventBus').default;
15
14
  type Modeling = import('../Modeling').default;
16
- export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
17
15
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
@@ -9,7 +9,6 @@ import {
9
9
  /**
10
10
  * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
11
11
  * @typedef {import('../Modeling').default} Modeling
12
- * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
13
12
  */
14
13
 
15
14
  var LOW_PRIORITY = 500,
@@ -21,9 +20,8 @@ var LOW_PRIORITY = 500,
21
20
  *
22
21
  * @param {EventBus} eventBus
23
22
  * @param {Modeling} modeling
24
- * @param {Translate} translate
25
23
  */
26
- export default function UpdateFlowNodeRefsBehavior(eventBus, modeling, translate) {
24
+ export default function UpdateFlowNodeRefsBehavior(eventBus, modeling) {
27
25
 
28
26
  CommandInterceptor.call(this, eventBus);
29
27
 
@@ -46,7 +44,7 @@ export default function UpdateFlowNodeRefsBehavior(eventBus, modeling, translate
46
44
 
47
45
  function getContext() {
48
46
  if (!context) {
49
- throw new Error(translate('out of bounds release'));
47
+ throw new Error('out of bounds release');
50
48
  }
51
49
 
52
50
  return context;
@@ -55,7 +53,7 @@ export default function UpdateFlowNodeRefsBehavior(eventBus, modeling, translate
55
53
  function releaseContext() {
56
54
 
57
55
  if (!context) {
58
- throw new Error(translate('out of bounds release'));
56
+ throw new Error('out of bounds release');
59
57
  }
60
58
 
61
59
  var triggerUpdate = context.leave();
@@ -127,8 +125,7 @@ export default function UpdateFlowNodeRefsBehavior(eventBus, modeling, translate
127
125
 
128
126
  UpdateFlowNodeRefsBehavior.$inject = [
129
127
  'eventBus',
130
- 'modeling' ,
131
- 'translate'
128
+ 'modeling'
132
129
  ];
133
130
 
134
131
  inherits(UpdateFlowNodeRefsBehavior, CommandInterceptor);
@@ -10,13 +10,11 @@ export default class SplitLaneHandler implements CommandHandler {
10
10
 
11
11
  /**
12
12
  * @param modeling
13
- * @param translate
14
13
  */
15
- constructor(modeling: Modeling, translate: Translate);
14
+ constructor(modeling: Modeling);
16
15
 
17
16
  preExecute(context: any): void;
18
17
  }
19
18
 
20
19
  type CommandHandler = import('diagram-js/lib/command/CommandHandler').default;
21
20
  type Modeling = import('../Modeling').default;
22
- export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
@@ -11,7 +11,6 @@ import {
11
11
  * @typedef {import('diagram-js/lib/command/CommandHandler').default} CommandHandler
12
12
  *
13
13
  * @typedef {import('../Modeling').default} Modeling
14
- * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
15
14
  */
16
15
 
17
16
  /**
@@ -21,23 +20,19 @@ import {
21
20
  * @implements {CommandHandler}
22
21
  *
23
22
  * @param {Modeling} modeling
24
- * @param {Translate} translate
25
23
  */
26
- export default function SplitLaneHandler(modeling, translate) {
24
+ export default function SplitLaneHandler(modeling) {
27
25
  this._modeling = modeling;
28
- this._translate = translate;
29
26
  }
30
27
 
31
28
  SplitLaneHandler.$inject = [
32
- 'modeling',
33
- 'translate'
29
+ 'modeling'
34
30
  ];
35
31
 
36
32
 
37
33
  SplitLaneHandler.prototype.preExecute = function(context) {
38
34
 
39
- var modeling = this._modeling,
40
- translate = this._translate;
35
+ var modeling = this._modeling;
41
36
 
42
37
  var shape = context.shape,
43
38
  newLanesCount = context.count;
@@ -46,7 +41,7 @@ SplitLaneHandler.prototype.preExecute = function(context) {
46
41
  existingLanesCount = childLanes.length;
47
42
 
48
43
  if (existingLanesCount > newLanesCount) {
49
- throw new Error(translate('more than {count} child lanes', { count: newLanesCount }));
44
+ throw new Error(`more than <${newLanesCount}> child lanes`);
50
45
  }
51
46
 
52
47
  var isHorizontalLane = isHorizontal(shape);
@@ -16,11 +16,10 @@ export default class UpdatePropertiesHandler implements CommandHandler {
16
16
  /**
17
17
  * @param elementRegistry
18
18
  * @param moddle
19
- * @param translate
20
19
  * @param modeling
21
20
  * @param textRenderer
22
21
  */
23
- constructor(elementRegistry: ElementRegistry, moddle: Moddle, translate: Translate, modeling: Modeling, textRenderer: TextRenderer);
22
+ constructor(elementRegistry: ElementRegistry, moddle: Moddle, modeling: Modeling, textRenderer: TextRenderer);
24
23
 
25
24
  /**
26
25
  * Update a BPMN element's properties.
@@ -54,7 +53,6 @@ type CommandHandler = import('diagram-js/lib/command/CommandHandler').default;
54
53
  type CommandContext = import('diagram-js/lib/command/CommandStack').CommandContext;
55
54
  type ElementRegistry = import('diagram-js/lib/core/ElementRegistry').default;
56
55
  type Moddle = import('../../../model/Types').Moddle;
57
- export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
58
56
  type Modeling = import('../Modeling').default;
59
57
  type TextRenderer = import('../../../draw/TextRenderer').default;
60
58
  type Element = import('../../../model/Types').Element;
@@ -16,7 +16,6 @@ import {
16
16
  *
17
17
  * @typedef {import('diagram-js/lib/core/ElementRegistry').default} ElementRegistry
18
18
  * @typedef {import('../../../model/Types').Moddle} Moddle
19
- * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
20
19
  * @typedef {import('../Modeling').default} Modeling
21
20
  * @typedef {import('../../../draw/TextRenderer').default} TextRenderer
22
21
  *
@@ -45,17 +44,15 @@ var NULL_DIMENSIONS = {
45
44
  *
46
45
  * @param {ElementRegistry} elementRegistry
47
46
  * @param {Moddle} moddle
48
- * @param {Translate} translate
49
47
  * @param {Modeling} modeling
50
48
  * @param {TextRenderer} textRenderer
51
49
  */
52
50
  export default function UpdatePropertiesHandler(
53
- elementRegistry, moddle, translate,
51
+ elementRegistry, moddle,
54
52
  modeling, textRenderer) {
55
53
 
56
54
  this._elementRegistry = elementRegistry;
57
55
  this._moddle = moddle;
58
- this._translate = translate;
59
56
  this._modeling = modeling;
60
57
  this._textRenderer = textRenderer;
61
58
  }
@@ -63,7 +60,6 @@ export default function UpdatePropertiesHandler(
63
60
  UpdatePropertiesHandler.$inject = [
64
61
  'elementRegistry',
65
62
  'moddle',
66
- 'translate',
67
63
  'modeling',
68
64
  'textRenderer'
69
65
  ];
@@ -84,11 +80,10 @@ UpdatePropertiesHandler.$inject = [
84
80
  UpdatePropertiesHandler.prototype.execute = function(context) {
85
81
 
86
82
  var element = context.element,
87
- changed = [ element ],
88
- translate = this._translate;
83
+ changed = [ element ];
89
84
 
90
85
  if (!element) {
91
- throw new Error(translate('element required'));
86
+ throw new Error('element required');
92
87
  }
93
88
 
94
89
  var elementRegistry = this._elementRegistry,
@@ -6,9 +6,8 @@ export default class BpmnOrderingProvider extends OrderingProvider {
6
6
  /**
7
7
  * @param eventBus
8
8
  * @param canvas
9
- * @param translate
10
9
  */
11
- constructor(eventBus: EventBus, canvas: Canvas, translate: any);
10
+ constructor(eventBus: EventBus, canvas: Canvas);
12
11
  getOrdering: (element: any, newParent: any) => {
13
12
  index: number;
14
13
  parent: any;
@@ -17,5 +16,4 @@ export default class BpmnOrderingProvider extends OrderingProvider {
17
16
 
18
17
  type Canvas = import('diagram-js/lib/core/Canvas').default;
19
18
  type EventBus = import('diagram-js/lib/core/EventBus').default;
20
- export type Translate = any;
21
19
  import OrderingProvider from 'diagram-js/lib/features/ordering/OrderingProvider';
@@ -15,7 +15,6 @@ import {
15
15
  /**
16
16
  * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas
17
17
  * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
18
- * @typedef {import('diagram-js/i18n/translate/translate').default} Translate
19
18
  */
20
19
 
21
20
  /**
@@ -23,9 +22,8 @@ import {
23
22
  *
24
23
  * @param {EventBus} eventBus
25
24
  * @param {Canvas} canvas
26
- * @param {Translate} translate
27
25
  */
28
- export default function BpmnOrderingProvider(eventBus, canvas, translate) {
26
+ export default function BpmnOrderingProvider(eventBus, canvas) {
29
27
 
30
28
  OrderingProvider.call(this, eventBus);
31
29
 
@@ -189,6 +187,6 @@ export default function BpmnOrderingProvider(eventBus, canvas, translate) {
189
187
  };
190
188
  }
191
189
 
192
- BpmnOrderingProvider.$inject = [ 'eventBus', 'canvas', 'translate' ];
190
+ BpmnOrderingProvider.$inject = [ 'eventBus', 'canvas' ];
193
191
 
194
192
  inherits(BpmnOrderingProvider, OrderingProvider);
@@ -1,5 +1,4 @@
1
1
  declare namespace _default {
2
- const __depends__: import("didi").ModuleDeclaration[];
3
2
  const __init__: string[];
4
3
  const bpmnOrderingProvider: (string | typeof BpmnOrderingProvider)[];
5
4
  }
@@ -1,11 +1,6 @@
1
- import translate from 'diagram-js/lib/i18n/translate';
2
-
3
1
  import BpmnOrderingProvider from './BpmnOrderingProvider';
4
2
 
5
3
  export default {
6
- __depends__: [
7
- translate
8
- ],
9
4
  __init__: [ 'bpmnOrderingProvider' ],
10
5
  bpmnOrderingProvider: [ 'type', BpmnOrderingProvider ]
11
6
  };
@@ -10,10 +10,9 @@ export default class BpmnImporter {
10
10
  * @param canvas
11
11
  * @param elementFactory
12
12
  * @param elementRegistry
13
- * @param translate
14
13
  * @param textRenderer
15
14
  */
16
- constructor(eventBus: EventBus, canvas: Canvas, elementFactory: ElementFactory, elementRegistry: ElementRegistry, translate: Function, textRenderer: TextRenderer);
15
+ constructor(eventBus: EventBus, canvas: Canvas, elementFactory: ElementFactory, elementRegistry: ElementRegistry, textRenderer: TextRenderer);
17
16
 
18
17
  /**
19
18
  * Add a BPMN element (semantic) to the canvas making it a child of the
@@ -42,7 +41,6 @@ export default class BpmnImporter {
42
41
  type Canvas = import('diagram-js/lib/core/Canvas').default;
43
42
  type ElementRegistry = import('diagram-js/lib/core/ElementRegistry').default;
44
43
  type EventBus = import('diagram-js/lib/core/EventBus').default;
45
- export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
46
44
  type ElementFactory = import('../features/modeling/ElementFactory').default;
47
45
  type TextRenderer = import('../draw/TextRenderer').default;
48
46
  type Element = import('../model/Types').Element;
@@ -26,7 +26,6 @@ import {
26
26
  * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas
27
27
  * @typedef {import('diagram-js/lib/core/ElementRegistry').default} ElementRegistry
28
28
  * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
29
- * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
30
29
  *
31
30
  * @typedef {import('../features/modeling/ElementFactory').default} ElementFactory
32
31
  * @typedef {import('../draw/TextRenderer').default} TextRenderer
@@ -68,12 +67,10 @@ function getWaypoints(di, source, target) {
68
67
  });
69
68
  }
70
69
 
71
- function notYetDrawn(translate, semantic, refSemantic, property) {
72
- return new Error(translate('element {element} referenced by {referenced}#{property} not yet drawn', {
73
- element: elementToString(refSemantic),
74
- referenced: elementToString(semantic),
75
- property: property
76
- }));
70
+ function notYetDrawn(semantic, refSemantic, property) {
71
+ return new Error(
72
+ `element ${ elementToString(refSemantic) } referenced by ${ elementToString(semantic) }#${ property } not yet drawn`
73
+ );
77
74
  }
78
75
 
79
76
 
@@ -84,18 +81,16 @@ function notYetDrawn(translate, semantic, refSemantic, property) {
84
81
  * @param {Canvas} canvas
85
82
  * @param {ElementFactory} elementFactory
86
83
  * @param {ElementRegistry} elementRegistry
87
- * @param {Function} translate
88
84
  * @param {TextRenderer} textRenderer
89
85
  */
90
86
  export default function BpmnImporter(
91
87
  eventBus, canvas, elementFactory,
92
- elementRegistry, translate, textRenderer) {
88
+ elementRegistry, textRenderer) {
93
89
 
94
90
  this._eventBus = eventBus;
95
91
  this._canvas = canvas;
96
92
  this._elementFactory = elementFactory;
97
93
  this._elementRegistry = elementRegistry;
98
- this._translate = translate;
99
94
  this._textRenderer = textRenderer;
100
95
  }
101
96
 
@@ -104,7 +99,6 @@ BpmnImporter.$inject = [
104
99
  'canvas',
105
100
  'elementFactory',
106
101
  'elementRegistry',
107
- 'translate',
108
102
  'textRenderer'
109
103
  ];
110
104
 
@@ -121,7 +115,6 @@ BpmnImporter.$inject = [
121
115
  */
122
116
  BpmnImporter.prototype.add = function(semantic, di, parentElement) {
123
117
  var element,
124
- translate = this._translate,
125
118
  hidden;
126
119
 
127
120
  var parentIndex;
@@ -207,10 +200,9 @@ BpmnImporter.prototype.add = function(semantic, di, parentElement) {
207
200
 
208
201
  this._canvas.addConnection(element, parentElement, parentIndex);
209
202
  } else {
210
- throw new Error(translate('unknown di {di} for element {semantic}', {
211
- di: elementToString(di),
212
- semantic: elementToString(semantic)
213
- }));
203
+ throw new Error(
204
+ `unknown di ${ elementToString(di) } for element ${ elementToString(semantic) }`
205
+ );
214
206
  }
215
207
 
216
208
  // (optional) LABEL
@@ -218,7 +210,6 @@ BpmnImporter.prototype.add = function(semantic, di, parentElement) {
218
210
  this.addLabel(semantic, di, element);
219
211
  }
220
212
 
221
-
222
213
  this._eventBus.fire('bpmnElement.added', { element: element });
223
214
 
224
215
  return element;
@@ -232,20 +223,19 @@ BpmnImporter.prototype.add = function(semantic, di, parentElement) {
232
223
  * @param {Shape} boundaryElement
233
224
  */
234
225
  BpmnImporter.prototype._attachBoundary = function(boundarySemantic, boundaryElement) {
235
- var translate = this._translate;
236
226
  var hostSemantic = boundarySemantic.attachedToRef;
237
227
 
238
228
  if (!hostSemantic) {
239
- throw new Error(translate('missing {semantic}#attachedToRef', {
240
- semantic: elementToString(boundarySemantic)
241
- }));
229
+ throw new Error(
230
+ `missing ${ elementToString(boundarySemantic) }#attachedToRef`
231
+ );
242
232
  }
243
233
 
244
234
  var host = this._elementRegistry.get(hostSemantic.id),
245
235
  attachers = host && host.attachers;
246
236
 
247
237
  if (!host) {
248
- throw notYetDrawn(translate, boundarySemantic, hostSemantic, 'attachedToRef');
238
+ throw notYetDrawn(boundarySemantic, hostSemantic, 'attachedToRef');
249
239
  }
250
240
 
251
241
  // wire element.host <> host.attachers
@@ -311,8 +301,7 @@ BpmnImporter.prototype._getConnectedElement = function(semantic, side) {
311
301
 
312
302
  var element,
313
303
  refSemantic,
314
- type = semantic.$type,
315
- translate = this._translate;
304
+ type = semantic.$type;
316
305
 
317
306
  refSemantic = semantic[side + 'Ref'];
318
307
 
@@ -335,12 +324,11 @@ BpmnImporter.prototype._getConnectedElement = function(semantic, side) {
335
324
  }
336
325
 
337
326
  if (refSemantic) {
338
- throw notYetDrawn(translate, semantic, refSemantic, side + 'Ref');
327
+ throw notYetDrawn(semantic, refSemantic, side + 'Ref');
339
328
  } else {
340
- throw new Error(translate('{semantic}#{side} Ref not specified', {
341
- semantic: elementToString(semantic),
342
- side: side
343
- }));
329
+ throw new Error(
330
+ `${ elementToString(semantic) }#${ side } Ref not specified`
331
+ );
344
332
  }
345
333
  };
346
334
 
@@ -1,9 +1,8 @@
1
1
  export default class BpmnTreeWalker {
2
2
  /**
3
3
  * @param handler
4
- * @param translate
5
4
  */
6
- constructor(handler: Record<'element' | 'root' | 'error', Function>, translate: Translate);
5
+ constructor(handler: Record<'element' | 'root' | 'error', Function>);
7
6
  registerDi: (di: any) => void;
8
7
  /**
9
8
  * Handle definitions and return the rendered diagram (if any).
@@ -18,5 +17,4 @@ export default class BpmnTreeWalker {
18
17
  handleSubProcess: (subProcess: any, context: any) => void;
19
18
  }
20
19
 
21
- export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
22
20
  type ModdleElement = import('../model/Types').ModdleElement;