bpmn-js 13.2.1 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/bpmn-font/css/bpmn.css +1 -0
- package/dist/assets/bpmn-js.css +1 -0
- package/dist/bpmn-modeler.development.js +517 -598
- package/dist/bpmn-modeler.production.min.js +38 -38
- package/dist/bpmn-navigated-viewer.development.js +30 -148
- package/dist/bpmn-navigated-viewer.production.min.js +5 -5
- package/dist/bpmn-viewer.development.js +30 -148
- package/dist/bpmn-viewer.production.min.js +5 -5
- package/lib/BaseViewer.d.ts +125 -5
- package/lib/BaseViewer.js +1 -68
- package/lib/Modeler.d.ts +9 -1
- package/lib/Modeler.js +2 -6
- package/lib/features/context-pad/ContextPadProvider.js +9 -3
- package/lib/features/copy-paste/BpmnCopyPaste.js +1 -1
- package/lib/features/modeling/behavior/EventBasedGatewayBehavior.js +11 -5
- package/lib/features/modeling/behavior/index.js +0 -3
- package/lib/features/modeling/index.js +0 -2
- package/lib/features/{modeling/behavior → modeling-feedback}/ModelingFeedback.js +1 -1
- package/lib/features/modeling-feedback/index.d.ts +7 -0
- package/lib/features/modeling-feedback/index.js +13 -0
- package/lib/features/space-tool/BpmnSpaceTool.js +23 -4
- package/lib/util/CompatibilityUtil.d.ts +0 -14
- package/lib/util/CompatibilityUtil.js +1 -58
- package/package.json +9 -10
- /package/lib/features/{modeling/behavior → modeling-feedback}/ModelingFeedback.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* bpmn-js - bpmn-modeler
|
|
2
|
+
* bpmn-js - bpmn-modeler v14.0.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: 2023-
|
|
11
|
+
* Date: 2023-08-30
|
|
12
12
|
*/
|
|
13
13
|
(function (global, factory) {
|
|
14
14
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
|
|
19
19
|
function e$3(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}));}
|
|
20
20
|
|
|
21
|
-
function createCommonjsModule(fn
|
|
22
|
-
|
|
21
|
+
function createCommonjsModule(fn) {
|
|
22
|
+
var module = { exports: {} };
|
|
23
|
+
return fn(module, module.exports), module.exports;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
var hat_1 = createCommonjsModule(function (module) {
|
|
@@ -87,22 +88,25 @@
|
|
|
87
88
|
};
|
|
88
89
|
});
|
|
89
90
|
|
|
91
|
+
/**
|
|
92
|
+
* @typedef { [ number, number ] | [ number, number, number ] } Seed
|
|
93
|
+
*/
|
|
94
|
+
|
|
90
95
|
/**
|
|
91
96
|
* Create a new id generator / cache instance.
|
|
92
97
|
*
|
|
93
98
|
* You may optionally provide a seed that is used internally.
|
|
94
99
|
*
|
|
95
|
-
* @param {Seed} seed
|
|
100
|
+
* @param {Seed} [seed]
|
|
96
101
|
*/
|
|
97
|
-
|
|
98
102
|
function Ids(seed) {
|
|
99
103
|
if (!(this instanceof Ids)) {
|
|
100
104
|
return new Ids(seed);
|
|
101
105
|
}
|
|
102
|
-
|
|
103
106
|
seed = seed || [128, 36, 1];
|
|
104
107
|
this._seed = seed.length ? hat_1.rack(seed[0], seed[1], seed[2]) : seed;
|
|
105
108
|
}
|
|
109
|
+
|
|
106
110
|
/**
|
|
107
111
|
* Generate a next id.
|
|
108
112
|
*
|
|
@@ -110,10 +114,10 @@
|
|
|
110
114
|
*
|
|
111
115
|
* @return {String} id
|
|
112
116
|
*/
|
|
113
|
-
|
|
114
117
|
Ids.prototype.next = function (element) {
|
|
115
118
|
return this._seed(element || true);
|
|
116
119
|
};
|
|
120
|
+
|
|
117
121
|
/**
|
|
118
122
|
* Generate a next id with a given prefix.
|
|
119
123
|
*
|
|
@@ -121,61 +125,54 @@
|
|
|
121
125
|
*
|
|
122
126
|
* @return {String} id
|
|
123
127
|
*/
|
|
124
|
-
|
|
125
|
-
|
|
126
128
|
Ids.prototype.nextPrefixed = function (prefix, element) {
|
|
127
129
|
var id;
|
|
128
|
-
|
|
129
130
|
do {
|
|
130
131
|
id = prefix + this.next(true);
|
|
131
|
-
} while (this.assigned(id));
|
|
132
|
-
|
|
132
|
+
} while (this.assigned(id));
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
// claim {prefix}{random}
|
|
135
|
+
this.claim(id, element);
|
|
135
136
|
|
|
137
|
+
// return
|
|
136
138
|
return id;
|
|
137
139
|
};
|
|
140
|
+
|
|
138
141
|
/**
|
|
139
142
|
* Manually claim an existing id.
|
|
140
143
|
*
|
|
141
144
|
* @param {String} id
|
|
142
145
|
* @param {String} [element] element the id is claimed by
|
|
143
146
|
*/
|
|
144
|
-
|
|
145
|
-
|
|
146
147
|
Ids.prototype.claim = function (id, element) {
|
|
147
148
|
this._seed.set(id, element || true);
|
|
148
149
|
};
|
|
150
|
+
|
|
149
151
|
/**
|
|
150
152
|
* Returns true if the given id has already been assigned.
|
|
151
153
|
*
|
|
152
154
|
* @param {String} id
|
|
153
155
|
* @return {Boolean}
|
|
154
156
|
*/
|
|
155
|
-
|
|
156
|
-
|
|
157
157
|
Ids.prototype.assigned = function (id) {
|
|
158
158
|
return this._seed.get(id) || false;
|
|
159
159
|
};
|
|
160
|
+
|
|
160
161
|
/**
|
|
161
162
|
* Unclaim an id.
|
|
162
163
|
*
|
|
163
164
|
* @param {String} id the id to unclaim
|
|
164
165
|
*/
|
|
165
|
-
|
|
166
|
-
|
|
167
166
|
Ids.prototype.unclaim = function (id) {
|
|
168
167
|
delete this._seed.hats[id];
|
|
169
168
|
};
|
|
169
|
+
|
|
170
170
|
/**
|
|
171
171
|
* Clear all claimed ids.
|
|
172
172
|
*/
|
|
173
|
-
|
|
174
|
-
|
|
175
173
|
Ids.prototype.clear = function () {
|
|
176
174
|
var hats = this._seed.hats,
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
id;
|
|
179
176
|
for (id in hats) {
|
|
180
177
|
this.unclaim(id);
|
|
181
178
|
}
|
|
@@ -5076,9 +5073,9 @@
|
|
|
5076
5073
|
|
|
5077
5074
|
const viewport = this._viewport = createGroup(svg, 'viewport');
|
|
5078
5075
|
|
|
5079
|
-
// debounce canvas.viewbox.changed events
|
|
5080
|
-
//
|
|
5081
|
-
if (config.deferUpdate
|
|
5076
|
+
// debounce canvas.viewbox.changed events when deferUpdate is set
|
|
5077
|
+
// to help with potential performance issues
|
|
5078
|
+
if (config.deferUpdate) {
|
|
5082
5079
|
this._viewboxChanged = debounce(bind$2(this._viewboxChanged, this), 300);
|
|
5083
5080
|
}
|
|
5084
5081
|
|
|
@@ -6102,6 +6099,11 @@
|
|
|
6102
6099
|
this.setRootElement(rootElement);
|
|
6103
6100
|
}
|
|
6104
6101
|
|
|
6102
|
+
// element is rootElement, do not change viewport
|
|
6103
|
+
if (rootElement === element) {
|
|
6104
|
+
return;
|
|
6105
|
+
}
|
|
6106
|
+
|
|
6105
6107
|
if (!padding) {
|
|
6106
6108
|
padding = {};
|
|
6107
6109
|
}
|
|
@@ -13203,7 +13205,6 @@
|
|
|
13203
13205
|
{
|
|
13204
13206
|
name: "target",
|
|
13205
13207
|
type: "LinkEventDefinition",
|
|
13206
|
-
isAttr: true,
|
|
13207
13208
|
isReference: true
|
|
13208
13209
|
},
|
|
13209
13210
|
{
|
|
@@ -16042,62 +16043,6 @@
|
|
|
16042
16043
|
* @typedef {import('../model/Types').ModdleElement} ModdleElement
|
|
16043
16044
|
*/
|
|
16044
16045
|
|
|
16045
|
-
// TODO(nikku): remove with future bpmn-js version
|
|
16046
|
-
|
|
16047
|
-
/**
|
|
16048
|
-
* Wraps APIs to check:
|
|
16049
|
-
*
|
|
16050
|
-
* 1) If a callback is passed -> Warn users about callback deprecation.
|
|
16051
|
-
* 2) If Promise class is implemented in current environment.
|
|
16052
|
-
*
|
|
16053
|
-
* @private
|
|
16054
|
-
*
|
|
16055
|
-
* @param {Function} api
|
|
16056
|
-
*
|
|
16057
|
-
* @return {Function}
|
|
16058
|
-
*/
|
|
16059
|
-
function wrapForCompatibility(api) {
|
|
16060
|
-
|
|
16061
|
-
return function() {
|
|
16062
|
-
|
|
16063
|
-
if (!window.Promise) {
|
|
16064
|
-
throw new Error('Promises is not supported in this environment. Please polyfill Promise.');
|
|
16065
|
-
}
|
|
16066
|
-
|
|
16067
|
-
var argLen = arguments.length;
|
|
16068
|
-
if (argLen >= 1 && isFunction(arguments[argLen - 1])) {
|
|
16069
|
-
|
|
16070
|
-
var callback = arguments[argLen - 1];
|
|
16071
|
-
|
|
16072
|
-
console.warn(new Error(
|
|
16073
|
-
'Passing callbacks to ' + api.name + ' is deprecated and will be removed in a future major release. ' +
|
|
16074
|
-
'Please switch to promises: https://bpmn.io/l/moving-to-promises.html'
|
|
16075
|
-
));
|
|
16076
|
-
|
|
16077
|
-
var argsWithoutCallback = Array.prototype.slice.call(arguments, 0, -1);
|
|
16078
|
-
|
|
16079
|
-
api.apply(this, argsWithoutCallback).then(function(result) {
|
|
16080
|
-
|
|
16081
|
-
var firstKey = Object.keys(result)[0];
|
|
16082
|
-
|
|
16083
|
-
// The APIs we are wrapping all resolve a single item depending on the API.
|
|
16084
|
-
// For instance, importXML resolves { warnings } and saveXML returns { xml }.
|
|
16085
|
-
// That's why we can call the callback with the first item of result.
|
|
16086
|
-
return callback(null, result[firstKey]);
|
|
16087
|
-
|
|
16088
|
-
// Passing a second paramter instead of catch because we don't want to
|
|
16089
|
-
// catch errors thrown by callback().
|
|
16090
|
-
}, function(err) {
|
|
16091
|
-
|
|
16092
|
-
return callback(err, err.warnings);
|
|
16093
|
-
});
|
|
16094
|
-
} else {
|
|
16095
|
-
|
|
16096
|
-
return api.apply(this, arguments);
|
|
16097
|
-
}
|
|
16098
|
-
};
|
|
16099
|
-
}
|
|
16100
|
-
|
|
16101
16046
|
|
|
16102
16047
|
// TODO(nikku): remove with future bpmn-js version
|
|
16103
16048
|
|
|
@@ -17095,28 +17040,7 @@
|
|
|
17095
17040
|
const self = this;
|
|
17096
17041
|
|
|
17097
17042
|
function ParseCompleteEvent(data) {
|
|
17098
|
-
|
|
17099
|
-
const event = self.get('eventBus').createEvent(data);
|
|
17100
|
-
|
|
17101
|
-
// TODO(nikku): remove with future bpmn-js version
|
|
17102
|
-
Object.defineProperty(event, 'context', {
|
|
17103
|
-
enumerable: true,
|
|
17104
|
-
get: function() {
|
|
17105
|
-
|
|
17106
|
-
console.warn(new Error(
|
|
17107
|
-
'import.parse.complete <context> is deprecated ' +
|
|
17108
|
-
'and will be removed in future library versions'
|
|
17109
|
-
));
|
|
17110
|
-
|
|
17111
|
-
return {
|
|
17112
|
-
warnings: data.warnings,
|
|
17113
|
-
references: data.references,
|
|
17114
|
-
elementsById: data.elementsById
|
|
17115
|
-
};
|
|
17116
|
-
}
|
|
17117
|
-
});
|
|
17118
|
-
|
|
17119
|
-
return event;
|
|
17043
|
+
return self.get('eventBus').createEvent(data);
|
|
17120
17044
|
}
|
|
17121
17045
|
|
|
17122
17046
|
let aggregatedWarnings = [];
|
|
@@ -17194,8 +17118,6 @@
|
|
|
17194
17118
|
}
|
|
17195
17119
|
};
|
|
17196
17120
|
|
|
17197
|
-
BaseViewer.prototype.importXML = wrapForCompatibility(BaseViewer.prototype.importXML);
|
|
17198
|
-
|
|
17199
17121
|
|
|
17200
17122
|
/**
|
|
17201
17123
|
* Import parsed definitions and render a BPMN 2.0 diagram.
|
|
@@ -17226,8 +17148,6 @@
|
|
|
17226
17148
|
return { warnings: result.warnings };
|
|
17227
17149
|
};
|
|
17228
17150
|
|
|
17229
|
-
BaseViewer.prototype.importDefinitions = wrapForCompatibility(BaseViewer.prototype.importDefinitions);
|
|
17230
|
-
|
|
17231
17151
|
|
|
17232
17152
|
/**
|
|
17233
17153
|
* Open diagram of previously imported XML.
|
|
@@ -17289,8 +17209,6 @@
|
|
|
17289
17209
|
return { warnings };
|
|
17290
17210
|
};
|
|
17291
17211
|
|
|
17292
|
-
BaseViewer.prototype.open = wrapForCompatibility(BaseViewer.prototype.open);
|
|
17293
|
-
|
|
17294
17212
|
/**
|
|
17295
17213
|
* Export the currently displayed BPMN 2.0 diagram as
|
|
17296
17214
|
* a BPMN 2.0 XML document.
|
|
@@ -17365,8 +17283,6 @@
|
|
|
17365
17283
|
return result;
|
|
17366
17284
|
};
|
|
17367
17285
|
|
|
17368
|
-
BaseViewer.prototype.saveXML = wrapForCompatibility(BaseViewer.prototype.saveXML);
|
|
17369
|
-
|
|
17370
17286
|
|
|
17371
17287
|
/**
|
|
17372
17288
|
* Export the currently displayed BPMN 2.0 diagram as
|
|
@@ -17434,40 +17350,6 @@
|
|
|
17434
17350
|
return { svg };
|
|
17435
17351
|
};
|
|
17436
17352
|
|
|
17437
|
-
BaseViewer.prototype.saveSVG = wrapForCompatibility(BaseViewer.prototype.saveSVG);
|
|
17438
|
-
|
|
17439
|
-
/**
|
|
17440
|
-
* Get a named diagram service.
|
|
17441
|
-
*
|
|
17442
|
-
* @example
|
|
17443
|
-
*
|
|
17444
|
-
* const elementRegistry = viewer.get('elementRegistry');
|
|
17445
|
-
* const startEventShape = elementRegistry.get('StartEvent_1');
|
|
17446
|
-
*
|
|
17447
|
-
* @param {string} name
|
|
17448
|
-
*
|
|
17449
|
-
* @return {Object} diagram service instance
|
|
17450
|
-
*
|
|
17451
|
-
* @method BaseViewer#get
|
|
17452
|
-
*/
|
|
17453
|
-
|
|
17454
|
-
/**
|
|
17455
|
-
* Invoke a function in the context of this viewer.
|
|
17456
|
-
*
|
|
17457
|
-
* @example
|
|
17458
|
-
*
|
|
17459
|
-
* viewer.invoke(function(elementRegistry) {
|
|
17460
|
-
* const startEventShape = elementRegistry.get('StartEvent_1');
|
|
17461
|
-
* });
|
|
17462
|
-
*
|
|
17463
|
-
* @param {Function} fn to be invoked
|
|
17464
|
-
*
|
|
17465
|
-
* @return {Object} the functions return value
|
|
17466
|
-
*
|
|
17467
|
-
* @method BaseViewer#invoke
|
|
17468
|
-
*/
|
|
17469
|
-
|
|
17470
|
-
|
|
17471
17353
|
BaseViewer.prototype._setDefinitions = function(definitions) {
|
|
17472
17354
|
this._definitions = definitions;
|
|
17473
17355
|
};
|
|
@@ -38090,7 +37972,7 @@
|
|
|
38090
37972
|
property = reference.property;
|
|
38091
37973
|
|
|
38092
37974
|
if (key === descriptor.id) {
|
|
38093
|
-
element
|
|
37975
|
+
element.set(property, businessObject);
|
|
38094
37976
|
|
|
38095
37977
|
array.push(descriptor.id);
|
|
38096
37978
|
}
|
|
@@ -41298,7 +41180,8 @@
|
|
|
41298
41180
|
assign$1(actions, {
|
|
41299
41181
|
'append.text-annotation': appendAction(
|
|
41300
41182
|
'bpmn:TextAnnotation',
|
|
41301
|
-
'bpmn-icon-text-annotation'
|
|
41183
|
+
'bpmn-icon-text-annotation',
|
|
41184
|
+
translate('Append TextAnnotation')
|
|
41302
41185
|
)
|
|
41303
41186
|
});
|
|
41304
41187
|
}
|
|
@@ -41314,7 +41197,8 @@
|
|
|
41314
41197
|
assign$1(actions, {
|
|
41315
41198
|
'append.text-annotation': appendAction(
|
|
41316
41199
|
'bpmn:TextAnnotation',
|
|
41317
|
-
'bpmn-icon-text-annotation'
|
|
41200
|
+
'bpmn-icon-text-annotation',
|
|
41201
|
+
translate('Append TextAnnotation')
|
|
41318
41202
|
),
|
|
41319
41203
|
|
|
41320
41204
|
'connect': {
|
|
@@ -41365,7 +41249,11 @@
|
|
|
41365
41249
|
|
|
41366
41250
|
if (is$1(businessObject, 'bpmn:Group')) {
|
|
41367
41251
|
assign$1(actions, {
|
|
41368
|
-
'append.text-annotation': appendAction(
|
|
41252
|
+
'append.text-annotation': appendAction(
|
|
41253
|
+
'bpmn:TextAnnotation',
|
|
41254
|
+
'bpmn-icon-text-annotation',
|
|
41255
|
+
translate('Append TextAnnotation')
|
|
41256
|
+
)
|
|
41369
41257
|
});
|
|
41370
41258
|
}
|
|
41371
41259
|
|
|
@@ -44546,7 +44434,7 @@
|
|
|
44546
44434
|
// internal labels for tasks and collapsed call activities,
|
|
44547
44435
|
// sub processes and participants
|
|
44548
44436
|
if (isAny(element, [ 'bpmn:Task', 'bpmn:CallActivity' ]) ||
|
|
44549
|
-
isCollapsedPool(element) ||
|
|
44437
|
+
isCollapsedPool$1(element) ||
|
|
44550
44438
|
isCollapsedSubProcess(element)) {
|
|
44551
44439
|
|
|
44552
44440
|
assign$1(bounds, {
|
|
@@ -44696,7 +44584,7 @@
|
|
|
44696
44584
|
return is$1(element, 'bpmn:SubProcess') && isExpanded(element);
|
|
44697
44585
|
}
|
|
44698
44586
|
|
|
44699
|
-
function isCollapsedPool(element) {
|
|
44587
|
+
function isCollapsedPool$1(element) {
|
|
44700
44588
|
return is$1(element, 'bpmn:Participant') && !isExpanded(element);
|
|
44701
44589
|
}
|
|
44702
44590
|
|
|
@@ -46486,12 +46374,18 @@
|
|
|
46486
46374
|
var sequenceFlows = [];
|
|
46487
46375
|
|
|
46488
46376
|
if (is$1(source, 'bpmn:EventBasedGateway')) {
|
|
46489
|
-
sequenceFlows = target.incoming
|
|
46377
|
+
sequenceFlows = target.incoming
|
|
46378
|
+
.filter(flow =>
|
|
46379
|
+
flow !== connection &&
|
|
46380
|
+
isSequenceFlow(flow)
|
|
46381
|
+
);
|
|
46490
46382
|
} else {
|
|
46491
|
-
sequenceFlows = target.incoming
|
|
46492
|
-
|
|
46493
|
-
|
|
46494
|
-
|
|
46383
|
+
sequenceFlows = target.incoming
|
|
46384
|
+
.filter(flow =>
|
|
46385
|
+
flow !== connection &&
|
|
46386
|
+
isSequenceFlow(flow) &&
|
|
46387
|
+
is$1(flow.source, 'bpmn:EventBasedGateway')
|
|
46388
|
+
);
|
|
46495
46389
|
}
|
|
46496
46390
|
|
|
46497
46391
|
sequenceFlows.forEach(function(sequenceFlow) {
|
|
@@ -48515,51 +48409,6 @@
|
|
|
48515
48409
|
};
|
|
48516
48410
|
}
|
|
48517
48411
|
|
|
48518
|
-
/**
|
|
48519
|
-
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
48520
|
-
* @typedef {import('diagram-js/lib/features/tooltips/Tooltips').default} Tooltips
|
|
48521
|
-
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
|
|
48522
|
-
*/
|
|
48523
|
-
|
|
48524
|
-
var COLLAB_ERR_MSG = 'flow elements must be children of pools/participants';
|
|
48525
|
-
|
|
48526
|
-
/**
|
|
48527
|
-
* @param {EventBus} eventBus
|
|
48528
|
-
* @param {Tooltips} tooltips
|
|
48529
|
-
* @param {Translate} translate
|
|
48530
|
-
*/
|
|
48531
|
-
function ModelingFeedback(eventBus, tooltips, translate) {
|
|
48532
|
-
|
|
48533
|
-
function showError(position, message, timeout) {
|
|
48534
|
-
tooltips.add({
|
|
48535
|
-
position: {
|
|
48536
|
-
x: position.x + 5,
|
|
48537
|
-
y: position.y + 5
|
|
48538
|
-
},
|
|
48539
|
-
type: 'error',
|
|
48540
|
-
timeout: timeout || 2000,
|
|
48541
|
-
html: '<div>' + message + '</div>'
|
|
48542
|
-
});
|
|
48543
|
-
}
|
|
48544
|
-
|
|
48545
|
-
eventBus.on([ 'shape.move.rejected', 'create.rejected' ], function(event) {
|
|
48546
|
-
var context = event.context,
|
|
48547
|
-
shape = context.shape,
|
|
48548
|
-
target = context.target;
|
|
48549
|
-
|
|
48550
|
-
if (is$1(target, 'bpmn:Collaboration') && is$1(shape, 'bpmn:FlowNode')) {
|
|
48551
|
-
showError(event, translate(COLLAB_ERR_MSG));
|
|
48552
|
-
}
|
|
48553
|
-
});
|
|
48554
|
-
|
|
48555
|
-
}
|
|
48556
|
-
|
|
48557
|
-
ModelingFeedback.$inject = [
|
|
48558
|
-
'eventBus',
|
|
48559
|
-
'tooltips',
|
|
48560
|
-
'translate'
|
|
48561
|
-
];
|
|
48562
|
-
|
|
48563
48412
|
/**
|
|
48564
48413
|
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
48565
48414
|
* @typedef {import('../Modeling').default} Modeling
|
|
@@ -50748,7 +50597,6 @@
|
|
|
50748
50597
|
'labelBehavior',
|
|
50749
50598
|
'layoutConnectionBehavior',
|
|
50750
50599
|
'messageFlowBehavior',
|
|
50751
|
-
'modelingFeedback',
|
|
50752
50600
|
'removeElementBehavior',
|
|
50753
50601
|
'removeEmbeddedLabelBoundsBehavior',
|
|
50754
50602
|
'removeParticipantBehavior',
|
|
@@ -50787,7 +50635,6 @@
|
|
|
50787
50635
|
labelBehavior: [ 'type', LabelBehavior ],
|
|
50788
50636
|
layoutConnectionBehavior: [ 'type', LayoutConnectionBehavior ],
|
|
50789
50637
|
messageFlowBehavior: [ 'type', MessageFlowBehavior ],
|
|
50790
|
-
modelingFeedback: [ 'type', ModelingFeedback ],
|
|
50791
50638
|
removeElementBehavior: [ 'type', RemoveElementBehavior ],
|
|
50792
50639
|
removeEmbeddedLabelBoundsBehavior: [ 'type', RemoveEmbeddedLabelBoundsBehavior ],
|
|
50793
50640
|
removeParticipantBehavior: [ 'type', RemoveParticipantBehavior ],
|
|
@@ -53507,14 +53354,33 @@
|
|
|
53507
53354
|
BpmnSpaceTool.prototype.calculateAdjustments = function(elements, axis, delta, start) {
|
|
53508
53355
|
var adjustments = SpaceTool.prototype.calculateAdjustments.call(this, elements, axis, delta, start);
|
|
53509
53356
|
|
|
53510
|
-
// do not resize
|
|
53357
|
+
// do not resize:
|
|
53358
|
+
//
|
|
53359
|
+
// * text annotations (horizontally/vertically)
|
|
53360
|
+
// * empty pools (vertically)
|
|
53511
53361
|
adjustments.resizingShapes = adjustments.resizingShapes.filter(function(shape) {
|
|
53512
|
-
|
|
53362
|
+
|
|
53363
|
+
if (is$1(shape, 'bpmn:TextAnnotation')) {
|
|
53364
|
+
return false;
|
|
53365
|
+
}
|
|
53366
|
+
|
|
53367
|
+
if (axis === 'y' && isCollapsedPool(shape)) {
|
|
53368
|
+
return false;
|
|
53369
|
+
}
|
|
53370
|
+
|
|
53371
|
+
return true;
|
|
53513
53372
|
});
|
|
53514
53373
|
|
|
53515
53374
|
return adjustments;
|
|
53516
53375
|
};
|
|
53517
53376
|
|
|
53377
|
+
|
|
53378
|
+
// helpers ///////////
|
|
53379
|
+
|
|
53380
|
+
function isCollapsedPool(shape) {
|
|
53381
|
+
return is$1(shape, 'bpmn:Participant') && !getBusinessObject(shape).processRef;
|
|
53382
|
+
}
|
|
53383
|
+
|
|
53518
53384
|
var SpaceToolModule = {
|
|
53519
53385
|
__depends__: [ SpaceToolModule$1 ],
|
|
53520
53386
|
spaceTool: [ 'type', BpmnSpaceTool ]
|
|
@@ -54078,393 +53944,6 @@
|
|
|
54078
53944
|
commandStack: [ 'type', CommandStack ]
|
|
54079
53945
|
};
|
|
54080
53946
|
|
|
54081
|
-
/**
|
|
54082
|
-
* @typedef {import('../../core/Canvas').default} Canvas
|
|
54083
|
-
* @typedef {import('../../core/EventBus').default} EventBus
|
|
54084
|
-
*
|
|
54085
|
-
* @typedef {import('../../util/Types').RectTRBL} RectTRBL
|
|
54086
|
-
*
|
|
54087
|
-
* @typedef { {
|
|
54088
|
-
* html: string | HTMLElement;
|
|
54089
|
-
* position: RectTRBL;
|
|
54090
|
-
* show?: {
|
|
54091
|
-
* minZoom?: number;
|
|
54092
|
-
* maxZoom?: number;
|
|
54093
|
-
* };
|
|
54094
|
-
* timeout?: number;
|
|
54095
|
-
* } } Tooltip
|
|
54096
|
-
*/
|
|
54097
|
-
|
|
54098
|
-
// document wide unique tooltip ids
|
|
54099
|
-
var ids = new IdGenerator('tt');
|
|
54100
|
-
|
|
54101
|
-
|
|
54102
|
-
function createRoot(parentNode) {
|
|
54103
|
-
var root = domify$1(
|
|
54104
|
-
'<div class="djs-tooltip-container" />'
|
|
54105
|
-
);
|
|
54106
|
-
|
|
54107
|
-
assign(root, {
|
|
54108
|
-
position: 'absolute',
|
|
54109
|
-
width: '0',
|
|
54110
|
-
height: '0'
|
|
54111
|
-
});
|
|
54112
|
-
|
|
54113
|
-
parentNode.insertBefore(root, parentNode.firstChild);
|
|
54114
|
-
|
|
54115
|
-
return root;
|
|
54116
|
-
}
|
|
54117
|
-
|
|
54118
|
-
|
|
54119
|
-
function setPosition(el, x, y) {
|
|
54120
|
-
assign(el, { left: x + 'px', top: y + 'px' });
|
|
54121
|
-
}
|
|
54122
|
-
|
|
54123
|
-
function setVisible(el, visible) {
|
|
54124
|
-
el.style.display = visible === false ? 'none' : '';
|
|
54125
|
-
}
|
|
54126
|
-
|
|
54127
|
-
|
|
54128
|
-
var tooltipClass = 'djs-tooltip',
|
|
54129
|
-
tooltipSelector = '.' + tooltipClass;
|
|
54130
|
-
|
|
54131
|
-
/**
|
|
54132
|
-
* A service that allows users to render tool tips on the diagram.
|
|
54133
|
-
*
|
|
54134
|
-
* The tooltip service will take care of updating the tooltip positioning
|
|
54135
|
-
* during navigation + zooming.
|
|
54136
|
-
*
|
|
54137
|
-
* @example
|
|
54138
|
-
*
|
|
54139
|
-
* ```javascript
|
|
54140
|
-
*
|
|
54141
|
-
* // add a pink badge on the top left of the shape
|
|
54142
|
-
* tooltips.add({
|
|
54143
|
-
* position: {
|
|
54144
|
-
* x: 50,
|
|
54145
|
-
* y: 100
|
|
54146
|
-
* },
|
|
54147
|
-
* html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>'
|
|
54148
|
-
* });
|
|
54149
|
-
*
|
|
54150
|
-
* // or with optional life span
|
|
54151
|
-
* tooltips.add({
|
|
54152
|
-
* position: {
|
|
54153
|
-
* top: -5,
|
|
54154
|
-
* left: -5
|
|
54155
|
-
* },
|
|
54156
|
-
* html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>',
|
|
54157
|
-
* ttl: 2000
|
|
54158
|
-
* });
|
|
54159
|
-
*
|
|
54160
|
-
* // remove a tool tip
|
|
54161
|
-
* var id = tooltips.add(...);
|
|
54162
|
-
*
|
|
54163
|
-
* tooltips.remove(id);
|
|
54164
|
-
* ```
|
|
54165
|
-
*
|
|
54166
|
-
* @param {EventBus} eventBus
|
|
54167
|
-
* @param {Canvas} canvas
|
|
54168
|
-
*/
|
|
54169
|
-
function Tooltips(eventBus, canvas) {
|
|
54170
|
-
|
|
54171
|
-
this._eventBus = eventBus;
|
|
54172
|
-
this._canvas = canvas;
|
|
54173
|
-
|
|
54174
|
-
this._ids = ids;
|
|
54175
|
-
|
|
54176
|
-
this._tooltipDefaults = {
|
|
54177
|
-
show: {
|
|
54178
|
-
minZoom: 0.7,
|
|
54179
|
-
maxZoom: 5.0
|
|
54180
|
-
}
|
|
54181
|
-
};
|
|
54182
|
-
|
|
54183
|
-
/**
|
|
54184
|
-
* @type {Record<string, Tooltip>}
|
|
54185
|
-
*/
|
|
54186
|
-
this._tooltips = {};
|
|
54187
|
-
|
|
54188
|
-
// root html element for all tooltips
|
|
54189
|
-
this._tooltipRoot = createRoot(canvas.getContainer());
|
|
54190
|
-
|
|
54191
|
-
|
|
54192
|
-
var self = this;
|
|
54193
|
-
|
|
54194
|
-
delegate.bind(this._tooltipRoot, tooltipSelector, 'mousedown', function(event) {
|
|
54195
|
-
event.stopPropagation();
|
|
54196
|
-
});
|
|
54197
|
-
|
|
54198
|
-
delegate.bind(this._tooltipRoot, tooltipSelector, 'mouseover', function(event) {
|
|
54199
|
-
self.trigger('mouseover', event);
|
|
54200
|
-
});
|
|
54201
|
-
|
|
54202
|
-
delegate.bind(this._tooltipRoot, tooltipSelector, 'mouseout', function(event) {
|
|
54203
|
-
self.trigger('mouseout', event);
|
|
54204
|
-
});
|
|
54205
|
-
|
|
54206
|
-
this._init();
|
|
54207
|
-
}
|
|
54208
|
-
|
|
54209
|
-
|
|
54210
|
-
Tooltips.$inject = [ 'eventBus', 'canvas' ];
|
|
54211
|
-
|
|
54212
|
-
|
|
54213
|
-
/**
|
|
54214
|
-
* Adds an HTML tooltip to the diagram.
|
|
54215
|
-
*
|
|
54216
|
-
* @param {Tooltip} tooltip
|
|
54217
|
-
*
|
|
54218
|
-
* @return {string} ID of the tooltip.
|
|
54219
|
-
*/
|
|
54220
|
-
Tooltips.prototype.add = function(tooltip) {
|
|
54221
|
-
|
|
54222
|
-
if (!tooltip.position) {
|
|
54223
|
-
throw new Error('must specifiy tooltip position');
|
|
54224
|
-
}
|
|
54225
|
-
|
|
54226
|
-
if (!tooltip.html) {
|
|
54227
|
-
throw new Error('must specifiy tooltip html');
|
|
54228
|
-
}
|
|
54229
|
-
|
|
54230
|
-
var id = this._ids.next();
|
|
54231
|
-
|
|
54232
|
-
tooltip = assign$1({}, this._tooltipDefaults, tooltip, {
|
|
54233
|
-
id: id
|
|
54234
|
-
});
|
|
54235
|
-
|
|
54236
|
-
this._addTooltip(tooltip);
|
|
54237
|
-
|
|
54238
|
-
if (tooltip.timeout) {
|
|
54239
|
-
this.setTimeout(tooltip);
|
|
54240
|
-
}
|
|
54241
|
-
|
|
54242
|
-
return id;
|
|
54243
|
-
};
|
|
54244
|
-
|
|
54245
|
-
/**
|
|
54246
|
-
* @param {string} action
|
|
54247
|
-
* @param {Event} event
|
|
54248
|
-
*/
|
|
54249
|
-
Tooltips.prototype.trigger = function(action, event) {
|
|
54250
|
-
|
|
54251
|
-
var node = event.delegateTarget || event.target;
|
|
54252
|
-
|
|
54253
|
-
var tooltip = this.get(attr$1(node, 'data-tooltip-id'));
|
|
54254
|
-
|
|
54255
|
-
if (!tooltip) {
|
|
54256
|
-
return;
|
|
54257
|
-
}
|
|
54258
|
-
|
|
54259
|
-
if (action === 'mouseover' && tooltip.timeout) {
|
|
54260
|
-
this.clearTimeout(tooltip);
|
|
54261
|
-
}
|
|
54262
|
-
|
|
54263
|
-
if (action === 'mouseout' && tooltip.timeout) {
|
|
54264
|
-
|
|
54265
|
-
// cut timeout after mouse out
|
|
54266
|
-
tooltip.timeout = 1000;
|
|
54267
|
-
|
|
54268
|
-
this.setTimeout(tooltip);
|
|
54269
|
-
}
|
|
54270
|
-
};
|
|
54271
|
-
|
|
54272
|
-
/**
|
|
54273
|
-
* Get tooltip with given ID.
|
|
54274
|
-
*
|
|
54275
|
-
* @param {Tooltip|string} id
|
|
54276
|
-
*
|
|
54277
|
-
* @return {Tooltip|undefined}
|
|
54278
|
-
*/
|
|
54279
|
-
Tooltips.prototype.get = function(id) {
|
|
54280
|
-
|
|
54281
|
-
if (typeof id !== 'string') {
|
|
54282
|
-
id = id.id;
|
|
54283
|
-
}
|
|
54284
|
-
|
|
54285
|
-
return this._tooltips[id];
|
|
54286
|
-
};
|
|
54287
|
-
|
|
54288
|
-
/**
|
|
54289
|
-
* @param {Tooltip} tooltip
|
|
54290
|
-
*/
|
|
54291
|
-
Tooltips.prototype.clearTimeout = function(tooltip) {
|
|
54292
|
-
|
|
54293
|
-
tooltip = this.get(tooltip);
|
|
54294
|
-
|
|
54295
|
-
if (!tooltip) {
|
|
54296
|
-
return;
|
|
54297
|
-
}
|
|
54298
|
-
|
|
54299
|
-
var removeTimer = tooltip.removeTimer;
|
|
54300
|
-
|
|
54301
|
-
if (removeTimer) {
|
|
54302
|
-
clearTimeout(removeTimer);
|
|
54303
|
-
tooltip.removeTimer = null;
|
|
54304
|
-
}
|
|
54305
|
-
};
|
|
54306
|
-
|
|
54307
|
-
/**
|
|
54308
|
-
* @param {Tooltip} tooltip
|
|
54309
|
-
*/
|
|
54310
|
-
Tooltips.prototype.setTimeout = function(tooltip) {
|
|
54311
|
-
|
|
54312
|
-
tooltip = this.get(tooltip);
|
|
54313
|
-
|
|
54314
|
-
if (!tooltip) {
|
|
54315
|
-
return;
|
|
54316
|
-
}
|
|
54317
|
-
|
|
54318
|
-
this.clearTimeout(tooltip);
|
|
54319
|
-
|
|
54320
|
-
var self = this;
|
|
54321
|
-
|
|
54322
|
-
tooltip.removeTimer = setTimeout(function() {
|
|
54323
|
-
self.remove(tooltip);
|
|
54324
|
-
}, tooltip.timeout);
|
|
54325
|
-
};
|
|
54326
|
-
|
|
54327
|
-
/**
|
|
54328
|
-
* Remove tooltip with given ID.
|
|
54329
|
-
*
|
|
54330
|
-
* @param {string | Tooltip} id
|
|
54331
|
-
*/
|
|
54332
|
-
Tooltips.prototype.remove = function(id) {
|
|
54333
|
-
|
|
54334
|
-
var tooltip = this.get(id);
|
|
54335
|
-
|
|
54336
|
-
if (tooltip) {
|
|
54337
|
-
remove$2(tooltip.html);
|
|
54338
|
-
remove$2(tooltip.htmlContainer);
|
|
54339
|
-
|
|
54340
|
-
delete tooltip.htmlContainer;
|
|
54341
|
-
|
|
54342
|
-
delete this._tooltips[tooltip.id];
|
|
54343
|
-
}
|
|
54344
|
-
};
|
|
54345
|
-
|
|
54346
|
-
|
|
54347
|
-
Tooltips.prototype.show = function() {
|
|
54348
|
-
setVisible(this._tooltipRoot);
|
|
54349
|
-
};
|
|
54350
|
-
|
|
54351
|
-
|
|
54352
|
-
Tooltips.prototype.hide = function() {
|
|
54353
|
-
setVisible(this._tooltipRoot, false);
|
|
54354
|
-
};
|
|
54355
|
-
|
|
54356
|
-
|
|
54357
|
-
Tooltips.prototype._updateRoot = function(viewbox) {
|
|
54358
|
-
var a = viewbox.scale || 1;
|
|
54359
|
-
var d = viewbox.scale || 1;
|
|
54360
|
-
|
|
54361
|
-
var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
|
|
54362
|
-
|
|
54363
|
-
this._tooltipRoot.style.transform = matrix;
|
|
54364
|
-
this._tooltipRoot.style['-ms-transform'] = matrix;
|
|
54365
|
-
};
|
|
54366
|
-
|
|
54367
|
-
|
|
54368
|
-
Tooltips.prototype._addTooltip = function(tooltip) {
|
|
54369
|
-
|
|
54370
|
-
var id = tooltip.id,
|
|
54371
|
-
html = tooltip.html,
|
|
54372
|
-
htmlContainer,
|
|
54373
|
-
tooltipRoot = this._tooltipRoot;
|
|
54374
|
-
|
|
54375
|
-
// unwrap jquery (for those who need it)
|
|
54376
|
-
if (html.get && html.constructor.prototype.jquery) {
|
|
54377
|
-
html = html.get(0);
|
|
54378
|
-
}
|
|
54379
|
-
|
|
54380
|
-
// create proper html elements from
|
|
54381
|
-
// tooltip HTML strings
|
|
54382
|
-
if (isString(html)) {
|
|
54383
|
-
html = domify$1(html);
|
|
54384
|
-
}
|
|
54385
|
-
|
|
54386
|
-
htmlContainer = domify$1('<div data-tooltip-id="' + id + '" class="' + tooltipClass + '">');
|
|
54387
|
-
assign(htmlContainer, { position: 'absolute' });
|
|
54388
|
-
|
|
54389
|
-
htmlContainer.appendChild(html);
|
|
54390
|
-
|
|
54391
|
-
if (tooltip.type) {
|
|
54392
|
-
classes$1(htmlContainer).add('djs-tooltip-' + tooltip.type);
|
|
54393
|
-
}
|
|
54394
|
-
|
|
54395
|
-
if (tooltip.className) {
|
|
54396
|
-
classes$1(htmlContainer).add(tooltip.className);
|
|
54397
|
-
}
|
|
54398
|
-
|
|
54399
|
-
tooltip.htmlContainer = htmlContainer;
|
|
54400
|
-
|
|
54401
|
-
tooltipRoot.appendChild(htmlContainer);
|
|
54402
|
-
|
|
54403
|
-
this._tooltips[id] = tooltip;
|
|
54404
|
-
|
|
54405
|
-
this._updateTooltip(tooltip);
|
|
54406
|
-
};
|
|
54407
|
-
|
|
54408
|
-
|
|
54409
|
-
Tooltips.prototype._updateTooltip = function(tooltip) {
|
|
54410
|
-
|
|
54411
|
-
var position = tooltip.position,
|
|
54412
|
-
htmlContainer = tooltip.htmlContainer;
|
|
54413
|
-
|
|
54414
|
-
// update overlay html based on tooltip x, y
|
|
54415
|
-
|
|
54416
|
-
setPosition(htmlContainer, position.x, position.y);
|
|
54417
|
-
};
|
|
54418
|
-
|
|
54419
|
-
|
|
54420
|
-
Tooltips.prototype._updateTooltipVisibilty = function(viewbox) {
|
|
54421
|
-
|
|
54422
|
-
forEach$1(this._tooltips, function(tooltip) {
|
|
54423
|
-
var show = tooltip.show,
|
|
54424
|
-
htmlContainer = tooltip.htmlContainer,
|
|
54425
|
-
visible = true;
|
|
54426
|
-
|
|
54427
|
-
if (show) {
|
|
54428
|
-
if (show.minZoom > viewbox.scale ||
|
|
54429
|
-
show.maxZoom < viewbox.scale) {
|
|
54430
|
-
visible = false;
|
|
54431
|
-
}
|
|
54432
|
-
|
|
54433
|
-
setVisible(htmlContainer, visible);
|
|
54434
|
-
}
|
|
54435
|
-
});
|
|
54436
|
-
};
|
|
54437
|
-
|
|
54438
|
-
Tooltips.prototype._init = function() {
|
|
54439
|
-
|
|
54440
|
-
var self = this;
|
|
54441
|
-
|
|
54442
|
-
// scroll/zoom integration
|
|
54443
|
-
|
|
54444
|
-
function updateViewbox(viewbox) {
|
|
54445
|
-
self._updateRoot(viewbox);
|
|
54446
|
-
self._updateTooltipVisibilty(viewbox);
|
|
54447
|
-
|
|
54448
|
-
self.show();
|
|
54449
|
-
}
|
|
54450
|
-
|
|
54451
|
-
this._eventBus.on('canvas.viewbox.changing', function(event) {
|
|
54452
|
-
self.hide();
|
|
54453
|
-
});
|
|
54454
|
-
|
|
54455
|
-
this._eventBus.on('canvas.viewbox.changed', function(event) {
|
|
54456
|
-
updateViewbox(event.viewbox);
|
|
54457
|
-
});
|
|
54458
|
-
};
|
|
54459
|
-
|
|
54460
|
-
/**
|
|
54461
|
-
* @type { import('didi').ModuleDeclaration }
|
|
54462
|
-
*/
|
|
54463
|
-
var TooltipsModule = {
|
|
54464
|
-
__init__: [ 'tooltips' ],
|
|
54465
|
-
tooltips: [ 'type', Tooltips ]
|
|
54466
|
-
};
|
|
54467
|
-
|
|
54468
53947
|
/**
|
|
54469
53948
|
* Remove from the beginning of a collection until it is empty.
|
|
54470
53949
|
*
|
|
@@ -61984,7 +61463,6 @@
|
|
|
61984
61463
|
OrderingModule,
|
|
61985
61464
|
ReplaceModule,
|
|
61986
61465
|
CommandModule,
|
|
61987
|
-
TooltipsModule,
|
|
61988
61466
|
LabelSupportModule,
|
|
61989
61467
|
AttachSupportModule,
|
|
61990
61468
|
SelectionModule,
|
|
@@ -61999,6 +61477,448 @@
|
|
|
61999
61477
|
connectionDocking: [ 'type', CroppingConnectionDocking ]
|
|
62000
61478
|
};
|
|
62001
61479
|
|
|
61480
|
+
/**
|
|
61481
|
+
* @typedef {import('../../core/Canvas').default} Canvas
|
|
61482
|
+
* @typedef {import('../../core/EventBus').default} EventBus
|
|
61483
|
+
*
|
|
61484
|
+
* @typedef {import('../../util/Types').RectTRBL} RectTRBL
|
|
61485
|
+
*
|
|
61486
|
+
* @typedef { {
|
|
61487
|
+
* html: string | HTMLElement;
|
|
61488
|
+
* position: RectTRBL;
|
|
61489
|
+
* show?: {
|
|
61490
|
+
* minZoom?: number;
|
|
61491
|
+
* maxZoom?: number;
|
|
61492
|
+
* };
|
|
61493
|
+
* timeout?: number;
|
|
61494
|
+
* } } Tooltip
|
|
61495
|
+
*/
|
|
61496
|
+
|
|
61497
|
+
// document wide unique tooltip ids
|
|
61498
|
+
var ids = new IdGenerator('tt');
|
|
61499
|
+
|
|
61500
|
+
|
|
61501
|
+
function createRoot(parentNode) {
|
|
61502
|
+
var root = domify$1(
|
|
61503
|
+
'<div class="djs-tooltip-container" />'
|
|
61504
|
+
);
|
|
61505
|
+
|
|
61506
|
+
assign(root, {
|
|
61507
|
+
position: 'absolute',
|
|
61508
|
+
width: '0',
|
|
61509
|
+
height: '0'
|
|
61510
|
+
});
|
|
61511
|
+
|
|
61512
|
+
parentNode.insertBefore(root, parentNode.firstChild);
|
|
61513
|
+
|
|
61514
|
+
return root;
|
|
61515
|
+
}
|
|
61516
|
+
|
|
61517
|
+
|
|
61518
|
+
function setPosition(el, x, y) {
|
|
61519
|
+
assign(el, { left: x + 'px', top: y + 'px' });
|
|
61520
|
+
}
|
|
61521
|
+
|
|
61522
|
+
function setVisible(el, visible) {
|
|
61523
|
+
el.style.display = visible === false ? 'none' : '';
|
|
61524
|
+
}
|
|
61525
|
+
|
|
61526
|
+
|
|
61527
|
+
var tooltipClass = 'djs-tooltip',
|
|
61528
|
+
tooltipSelector = '.' + tooltipClass;
|
|
61529
|
+
|
|
61530
|
+
/**
|
|
61531
|
+
* A service that allows users to render tool tips on the diagram.
|
|
61532
|
+
*
|
|
61533
|
+
* The tooltip service will take care of updating the tooltip positioning
|
|
61534
|
+
* during navigation + zooming.
|
|
61535
|
+
*
|
|
61536
|
+
* @example
|
|
61537
|
+
*
|
|
61538
|
+
* ```javascript
|
|
61539
|
+
*
|
|
61540
|
+
* // add a pink badge on the top left of the shape
|
|
61541
|
+
* tooltips.add({
|
|
61542
|
+
* position: {
|
|
61543
|
+
* x: 50,
|
|
61544
|
+
* y: 100
|
|
61545
|
+
* },
|
|
61546
|
+
* html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>'
|
|
61547
|
+
* });
|
|
61548
|
+
*
|
|
61549
|
+
* // or with optional life span
|
|
61550
|
+
* tooltips.add({
|
|
61551
|
+
* position: {
|
|
61552
|
+
* top: -5,
|
|
61553
|
+
* left: -5
|
|
61554
|
+
* },
|
|
61555
|
+
* html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>',
|
|
61556
|
+
* ttl: 2000
|
|
61557
|
+
* });
|
|
61558
|
+
*
|
|
61559
|
+
* // remove a tool tip
|
|
61560
|
+
* var id = tooltips.add(...);
|
|
61561
|
+
*
|
|
61562
|
+
* tooltips.remove(id);
|
|
61563
|
+
* ```
|
|
61564
|
+
*
|
|
61565
|
+
* @param {EventBus} eventBus
|
|
61566
|
+
* @param {Canvas} canvas
|
|
61567
|
+
*/
|
|
61568
|
+
function Tooltips(eventBus, canvas) {
|
|
61569
|
+
|
|
61570
|
+
this._eventBus = eventBus;
|
|
61571
|
+
this._canvas = canvas;
|
|
61572
|
+
|
|
61573
|
+
this._ids = ids;
|
|
61574
|
+
|
|
61575
|
+
this._tooltipDefaults = {
|
|
61576
|
+
show: {
|
|
61577
|
+
minZoom: 0.7,
|
|
61578
|
+
maxZoom: 5.0
|
|
61579
|
+
}
|
|
61580
|
+
};
|
|
61581
|
+
|
|
61582
|
+
/**
|
|
61583
|
+
* @type {Record<string, Tooltip>}
|
|
61584
|
+
*/
|
|
61585
|
+
this._tooltips = {};
|
|
61586
|
+
|
|
61587
|
+
// root html element for all tooltips
|
|
61588
|
+
this._tooltipRoot = createRoot(canvas.getContainer());
|
|
61589
|
+
|
|
61590
|
+
|
|
61591
|
+
var self = this;
|
|
61592
|
+
|
|
61593
|
+
delegate.bind(this._tooltipRoot, tooltipSelector, 'mousedown', function(event) {
|
|
61594
|
+
event.stopPropagation();
|
|
61595
|
+
});
|
|
61596
|
+
|
|
61597
|
+
delegate.bind(this._tooltipRoot, tooltipSelector, 'mouseover', function(event) {
|
|
61598
|
+
self.trigger('mouseover', event);
|
|
61599
|
+
});
|
|
61600
|
+
|
|
61601
|
+
delegate.bind(this._tooltipRoot, tooltipSelector, 'mouseout', function(event) {
|
|
61602
|
+
self.trigger('mouseout', event);
|
|
61603
|
+
});
|
|
61604
|
+
|
|
61605
|
+
this._init();
|
|
61606
|
+
}
|
|
61607
|
+
|
|
61608
|
+
|
|
61609
|
+
Tooltips.$inject = [ 'eventBus', 'canvas' ];
|
|
61610
|
+
|
|
61611
|
+
|
|
61612
|
+
/**
|
|
61613
|
+
* Adds an HTML tooltip to the diagram.
|
|
61614
|
+
*
|
|
61615
|
+
* @param {Tooltip} tooltip
|
|
61616
|
+
*
|
|
61617
|
+
* @return {string} ID of the tooltip.
|
|
61618
|
+
*/
|
|
61619
|
+
Tooltips.prototype.add = function(tooltip) {
|
|
61620
|
+
|
|
61621
|
+
if (!tooltip.position) {
|
|
61622
|
+
throw new Error('must specifiy tooltip position');
|
|
61623
|
+
}
|
|
61624
|
+
|
|
61625
|
+
if (!tooltip.html) {
|
|
61626
|
+
throw new Error('must specifiy tooltip html');
|
|
61627
|
+
}
|
|
61628
|
+
|
|
61629
|
+
var id = this._ids.next();
|
|
61630
|
+
|
|
61631
|
+
tooltip = assign$1({}, this._tooltipDefaults, tooltip, {
|
|
61632
|
+
id: id
|
|
61633
|
+
});
|
|
61634
|
+
|
|
61635
|
+
this._addTooltip(tooltip);
|
|
61636
|
+
|
|
61637
|
+
if (tooltip.timeout) {
|
|
61638
|
+
this.setTimeout(tooltip);
|
|
61639
|
+
}
|
|
61640
|
+
|
|
61641
|
+
return id;
|
|
61642
|
+
};
|
|
61643
|
+
|
|
61644
|
+
/**
|
|
61645
|
+
* @param {string} action
|
|
61646
|
+
* @param {Event} event
|
|
61647
|
+
*/
|
|
61648
|
+
Tooltips.prototype.trigger = function(action, event) {
|
|
61649
|
+
|
|
61650
|
+
var node = event.delegateTarget || event.target;
|
|
61651
|
+
|
|
61652
|
+
var tooltip = this.get(attr$1(node, 'data-tooltip-id'));
|
|
61653
|
+
|
|
61654
|
+
if (!tooltip) {
|
|
61655
|
+
return;
|
|
61656
|
+
}
|
|
61657
|
+
|
|
61658
|
+
if (action === 'mouseover' && tooltip.timeout) {
|
|
61659
|
+
this.clearTimeout(tooltip);
|
|
61660
|
+
}
|
|
61661
|
+
|
|
61662
|
+
if (action === 'mouseout' && tooltip.timeout) {
|
|
61663
|
+
|
|
61664
|
+
// cut timeout after mouse out
|
|
61665
|
+
tooltip.timeout = 1000;
|
|
61666
|
+
|
|
61667
|
+
this.setTimeout(tooltip);
|
|
61668
|
+
}
|
|
61669
|
+
};
|
|
61670
|
+
|
|
61671
|
+
/**
|
|
61672
|
+
* Get tooltip with given ID.
|
|
61673
|
+
*
|
|
61674
|
+
* @param {Tooltip|string} id
|
|
61675
|
+
*
|
|
61676
|
+
* @return {Tooltip|undefined}
|
|
61677
|
+
*/
|
|
61678
|
+
Tooltips.prototype.get = function(id) {
|
|
61679
|
+
|
|
61680
|
+
if (typeof id !== 'string') {
|
|
61681
|
+
id = id.id;
|
|
61682
|
+
}
|
|
61683
|
+
|
|
61684
|
+
return this._tooltips[id];
|
|
61685
|
+
};
|
|
61686
|
+
|
|
61687
|
+
/**
|
|
61688
|
+
* @param {Tooltip} tooltip
|
|
61689
|
+
*/
|
|
61690
|
+
Tooltips.prototype.clearTimeout = function(tooltip) {
|
|
61691
|
+
|
|
61692
|
+
tooltip = this.get(tooltip);
|
|
61693
|
+
|
|
61694
|
+
if (!tooltip) {
|
|
61695
|
+
return;
|
|
61696
|
+
}
|
|
61697
|
+
|
|
61698
|
+
var removeTimer = tooltip.removeTimer;
|
|
61699
|
+
|
|
61700
|
+
if (removeTimer) {
|
|
61701
|
+
clearTimeout(removeTimer);
|
|
61702
|
+
tooltip.removeTimer = null;
|
|
61703
|
+
}
|
|
61704
|
+
};
|
|
61705
|
+
|
|
61706
|
+
/**
|
|
61707
|
+
* @param {Tooltip} tooltip
|
|
61708
|
+
*/
|
|
61709
|
+
Tooltips.prototype.setTimeout = function(tooltip) {
|
|
61710
|
+
|
|
61711
|
+
tooltip = this.get(tooltip);
|
|
61712
|
+
|
|
61713
|
+
if (!tooltip) {
|
|
61714
|
+
return;
|
|
61715
|
+
}
|
|
61716
|
+
|
|
61717
|
+
this.clearTimeout(tooltip);
|
|
61718
|
+
|
|
61719
|
+
var self = this;
|
|
61720
|
+
|
|
61721
|
+
tooltip.removeTimer = setTimeout(function() {
|
|
61722
|
+
self.remove(tooltip);
|
|
61723
|
+
}, tooltip.timeout);
|
|
61724
|
+
};
|
|
61725
|
+
|
|
61726
|
+
/**
|
|
61727
|
+
* Remove tooltip with given ID.
|
|
61728
|
+
*
|
|
61729
|
+
* @param {string | Tooltip} id
|
|
61730
|
+
*/
|
|
61731
|
+
Tooltips.prototype.remove = function(id) {
|
|
61732
|
+
|
|
61733
|
+
var tooltip = this.get(id);
|
|
61734
|
+
|
|
61735
|
+
if (tooltip) {
|
|
61736
|
+
remove$2(tooltip.html);
|
|
61737
|
+
remove$2(tooltip.htmlContainer);
|
|
61738
|
+
|
|
61739
|
+
delete tooltip.htmlContainer;
|
|
61740
|
+
|
|
61741
|
+
delete this._tooltips[tooltip.id];
|
|
61742
|
+
}
|
|
61743
|
+
};
|
|
61744
|
+
|
|
61745
|
+
|
|
61746
|
+
Tooltips.prototype.show = function() {
|
|
61747
|
+
setVisible(this._tooltipRoot);
|
|
61748
|
+
};
|
|
61749
|
+
|
|
61750
|
+
|
|
61751
|
+
Tooltips.prototype.hide = function() {
|
|
61752
|
+
setVisible(this._tooltipRoot, false);
|
|
61753
|
+
};
|
|
61754
|
+
|
|
61755
|
+
|
|
61756
|
+
Tooltips.prototype._updateRoot = function(viewbox) {
|
|
61757
|
+
var a = viewbox.scale || 1;
|
|
61758
|
+
var d = viewbox.scale || 1;
|
|
61759
|
+
|
|
61760
|
+
var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
|
|
61761
|
+
|
|
61762
|
+
this._tooltipRoot.style.transform = matrix;
|
|
61763
|
+
this._tooltipRoot.style['-ms-transform'] = matrix;
|
|
61764
|
+
};
|
|
61765
|
+
|
|
61766
|
+
|
|
61767
|
+
Tooltips.prototype._addTooltip = function(tooltip) {
|
|
61768
|
+
|
|
61769
|
+
var id = tooltip.id,
|
|
61770
|
+
html = tooltip.html,
|
|
61771
|
+
htmlContainer,
|
|
61772
|
+
tooltipRoot = this._tooltipRoot;
|
|
61773
|
+
|
|
61774
|
+
// unwrap jquery (for those who need it)
|
|
61775
|
+
if (html.get && html.constructor.prototype.jquery) {
|
|
61776
|
+
html = html.get(0);
|
|
61777
|
+
}
|
|
61778
|
+
|
|
61779
|
+
// create proper html elements from
|
|
61780
|
+
// tooltip HTML strings
|
|
61781
|
+
if (isString(html)) {
|
|
61782
|
+
html = domify$1(html);
|
|
61783
|
+
}
|
|
61784
|
+
|
|
61785
|
+
htmlContainer = domify$1('<div data-tooltip-id="' + id + '" class="' + tooltipClass + '">');
|
|
61786
|
+
assign(htmlContainer, { position: 'absolute' });
|
|
61787
|
+
|
|
61788
|
+
htmlContainer.appendChild(html);
|
|
61789
|
+
|
|
61790
|
+
if (tooltip.type) {
|
|
61791
|
+
classes$1(htmlContainer).add('djs-tooltip-' + tooltip.type);
|
|
61792
|
+
}
|
|
61793
|
+
|
|
61794
|
+
if (tooltip.className) {
|
|
61795
|
+
classes$1(htmlContainer).add(tooltip.className);
|
|
61796
|
+
}
|
|
61797
|
+
|
|
61798
|
+
tooltip.htmlContainer = htmlContainer;
|
|
61799
|
+
|
|
61800
|
+
tooltipRoot.appendChild(htmlContainer);
|
|
61801
|
+
|
|
61802
|
+
this._tooltips[id] = tooltip;
|
|
61803
|
+
|
|
61804
|
+
this._updateTooltip(tooltip);
|
|
61805
|
+
};
|
|
61806
|
+
|
|
61807
|
+
|
|
61808
|
+
Tooltips.prototype._updateTooltip = function(tooltip) {
|
|
61809
|
+
|
|
61810
|
+
var position = tooltip.position,
|
|
61811
|
+
htmlContainer = tooltip.htmlContainer;
|
|
61812
|
+
|
|
61813
|
+
// update overlay html based on tooltip x, y
|
|
61814
|
+
|
|
61815
|
+
setPosition(htmlContainer, position.x, position.y);
|
|
61816
|
+
};
|
|
61817
|
+
|
|
61818
|
+
|
|
61819
|
+
Tooltips.prototype._updateTooltipVisibilty = function(viewbox) {
|
|
61820
|
+
|
|
61821
|
+
forEach$1(this._tooltips, function(tooltip) {
|
|
61822
|
+
var show = tooltip.show,
|
|
61823
|
+
htmlContainer = tooltip.htmlContainer,
|
|
61824
|
+
visible = true;
|
|
61825
|
+
|
|
61826
|
+
if (show) {
|
|
61827
|
+
if (show.minZoom > viewbox.scale ||
|
|
61828
|
+
show.maxZoom < viewbox.scale) {
|
|
61829
|
+
visible = false;
|
|
61830
|
+
}
|
|
61831
|
+
|
|
61832
|
+
setVisible(htmlContainer, visible);
|
|
61833
|
+
}
|
|
61834
|
+
});
|
|
61835
|
+
};
|
|
61836
|
+
|
|
61837
|
+
Tooltips.prototype._init = function() {
|
|
61838
|
+
|
|
61839
|
+
var self = this;
|
|
61840
|
+
|
|
61841
|
+
// scroll/zoom integration
|
|
61842
|
+
|
|
61843
|
+
function updateViewbox(viewbox) {
|
|
61844
|
+
self._updateRoot(viewbox);
|
|
61845
|
+
self._updateTooltipVisibilty(viewbox);
|
|
61846
|
+
|
|
61847
|
+
self.show();
|
|
61848
|
+
}
|
|
61849
|
+
|
|
61850
|
+
this._eventBus.on('canvas.viewbox.changing', function(event) {
|
|
61851
|
+
self.hide();
|
|
61852
|
+
});
|
|
61853
|
+
|
|
61854
|
+
this._eventBus.on('canvas.viewbox.changed', function(event) {
|
|
61855
|
+
updateViewbox(event.viewbox);
|
|
61856
|
+
});
|
|
61857
|
+
};
|
|
61858
|
+
|
|
61859
|
+
/**
|
|
61860
|
+
* @type { import('didi').ModuleDeclaration }
|
|
61861
|
+
*/
|
|
61862
|
+
var TooltipsModule = {
|
|
61863
|
+
__init__: [ 'tooltips' ],
|
|
61864
|
+
tooltips: [ 'type', Tooltips ]
|
|
61865
|
+
};
|
|
61866
|
+
|
|
61867
|
+
/**
|
|
61868
|
+
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
61869
|
+
* @typedef {import('diagram-js/lib/features/tooltips/Tooltips').default} Tooltips
|
|
61870
|
+
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
|
|
61871
|
+
*/
|
|
61872
|
+
|
|
61873
|
+
var COLLAB_ERR_MSG = 'flow elements must be children of pools/participants';
|
|
61874
|
+
|
|
61875
|
+
/**
|
|
61876
|
+
* @param {EventBus} eventBus
|
|
61877
|
+
* @param {Tooltips} tooltips
|
|
61878
|
+
* @param {Translate} translate
|
|
61879
|
+
*/
|
|
61880
|
+
function ModelingFeedback(eventBus, tooltips, translate) {
|
|
61881
|
+
|
|
61882
|
+
function showError(position, message, timeout) {
|
|
61883
|
+
tooltips.add({
|
|
61884
|
+
position: {
|
|
61885
|
+
x: position.x + 5,
|
|
61886
|
+
y: position.y + 5
|
|
61887
|
+
},
|
|
61888
|
+
type: 'error',
|
|
61889
|
+
timeout: timeout || 2000,
|
|
61890
|
+
html: '<div>' + message + '</div>'
|
|
61891
|
+
});
|
|
61892
|
+
}
|
|
61893
|
+
|
|
61894
|
+
eventBus.on([ 'shape.move.rejected', 'create.rejected' ], function(event) {
|
|
61895
|
+
var context = event.context,
|
|
61896
|
+
shape = context.shape,
|
|
61897
|
+
target = context.target;
|
|
61898
|
+
|
|
61899
|
+
if (is$1(target, 'bpmn:Collaboration') && is$1(shape, 'bpmn:FlowNode')) {
|
|
61900
|
+
showError(event, translate(COLLAB_ERR_MSG));
|
|
61901
|
+
}
|
|
61902
|
+
});
|
|
61903
|
+
|
|
61904
|
+
}
|
|
61905
|
+
|
|
61906
|
+
ModelingFeedback.$inject = [
|
|
61907
|
+
'eventBus',
|
|
61908
|
+
'tooltips',
|
|
61909
|
+
'translate'
|
|
61910
|
+
];
|
|
61911
|
+
|
|
61912
|
+
var ModelingFeedbackModule = {
|
|
61913
|
+
__depends__: [
|
|
61914
|
+
TooltipsModule
|
|
61915
|
+
],
|
|
61916
|
+
__init__: [
|
|
61917
|
+
'modelingFeedback'
|
|
61918
|
+
],
|
|
61919
|
+
modelingFeedback: [ 'type', ModelingFeedback ]
|
|
61920
|
+
};
|
|
61921
|
+
|
|
62002
61922
|
/**
|
|
62003
61923
|
* @typedef {import('../../core/Types').ElementLike} Element
|
|
62004
61924
|
* @typedef {import('../../core/Types').ShapeLike} Shape
|
|
@@ -66011,8 +65931,6 @@
|
|
|
66011
65931
|
return this.importXML(initialDiagram);
|
|
66012
65932
|
};
|
|
66013
65933
|
|
|
66014
|
-
Modeler.prototype.createDiagram = wrapForCompatibility(Modeler.prototype.createDiagram);
|
|
66015
|
-
|
|
66016
65934
|
|
|
66017
65935
|
Modeler.prototype._interactionModules = [
|
|
66018
65936
|
|
|
@@ -66044,6 +65962,7 @@
|
|
|
66044
65962
|
KeyboardMoveSelectionModule,
|
|
66045
65963
|
LabelEditingModule,
|
|
66046
65964
|
ModelingModule,
|
|
65965
|
+
ModelingFeedbackModule,
|
|
66047
65966
|
MoveModule,
|
|
66048
65967
|
PaletteModule,
|
|
66049
65968
|
ReplacePreviewModule,
|