camunda-bpmn-js 4.20.1 → 4.20.2

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.
@@ -6041,7 +6041,7 @@
6041
6041
  Canvas.prototype.viewbox = function(box) {
6042
6042
 
6043
6043
  if (box === undefined && this._cachedViewbox) {
6044
- return this._cachedViewbox;
6044
+ return structuredClone(this._cachedViewbox);
6045
6045
  }
6046
6046
 
6047
6047
  const viewport = this._viewport,
@@ -64796,6 +64796,8 @@
64796
64796
  * @typedef {import('./SearchPadProvider').Token} Token
64797
64797
  */
64798
64798
 
64799
+ var SCROLL_TO_ELEMENT_PADDING = 300;
64800
+
64799
64801
  /**
64800
64802
  * Provides searching infrastructure.
64801
64803
  *
@@ -64806,7 +64808,7 @@
64806
64808
  */
64807
64809
  function SearchPad(canvas, eventBus, selection, translate) {
64808
64810
  this._open = false;
64809
- this._results = [];
64811
+ this._results = {};
64810
64812
  this._eventMaps = [];
64811
64813
 
64812
64814
  this._cachedRootElement = null;
@@ -64960,6 +64962,9 @@
64960
64962
  });
64961
64963
 
64962
64964
  if (!searchResults.length) {
64965
+ this._clearMarkers();
64966
+ this._selection.select(null);
64967
+
64963
64968
  return;
64964
64969
  }
64965
64970
 
@@ -65028,12 +65033,22 @@
65028
65033
  SearchPad.prototype._clearResults = function() {
65029
65034
  clear$1(this._resultsContainer);
65030
65035
 
65031
- this._results = [];
65036
+ this._results = {};
65032
65037
 
65033
65038
  this._eventBus.fire('searchPad.cleared');
65034
65039
  };
65035
65040
 
65036
65041
 
65042
+ /**
65043
+ * Clears all markers.
65044
+ */
65045
+ SearchPad.prototype._clearMarkers = function() {
65046
+ for (var id in this._results) {
65047
+ this._canvas.removeMarker(this._results[id].element, 'djs-search-preselected');
65048
+ }
65049
+ };
65050
+
65051
+
65037
65052
  /**
65038
65053
  * Get currently selected result.
65039
65054
  *
@@ -65150,6 +65165,8 @@
65150
65165
  classes$1(this._canvas.getContainer()).remove('djs-search-open');
65151
65166
  classes$1(this._container).remove('open');
65152
65167
 
65168
+ this._clearMarkers();
65169
+
65153
65170
  this._clearResults();
65154
65171
 
65155
65172
  this._searchInput.value = '';
@@ -65188,6 +65205,8 @@
65188
65205
  return;
65189
65206
  }
65190
65207
 
65208
+ this._clearMarkers();
65209
+
65191
65210
  // removing preselection from current node
65192
65211
  if (selectedNode) {
65193
65212
  classes$1(selectedNode).remove(SearchPad.RESULT_SELECTED_CLASS);
@@ -65198,14 +65217,14 @@
65198
65217
 
65199
65218
  classes$1(node).add(SearchPad.RESULT_SELECTED_CLASS);
65200
65219
 
65201
- this._canvas.zoom(1);
65202
-
65203
65220
  this._canvas.scrollToElement(element, {
65204
- top: 300
65221
+ top: SCROLL_TO_ELEMENT_PADDING
65205
65222
  });
65206
65223
 
65207
65224
  this._selection.select(element);
65208
65225
 
65226
+ this._canvas.addMarker(element, 'djs-search-preselected');
65227
+
65209
65228
  this._eventBus.fire('searchPad.preselected', element);
65210
65229
  };
65211
65230
 
@@ -65224,7 +65243,9 @@
65224
65243
 
65225
65244
  this.close(false);
65226
65245
 
65227
- this._canvas.scrollToElement(element, { top: 400 });
65246
+ this._canvas.scrollToElement(element, {
65247
+ top: SCROLL_TO_ELEMENT_PADDING
65248
+ });
65228
65249
 
65229
65250
  this._selection.select(element);
65230
65251
 
@@ -67211,57 +67232,64 @@
67211
67232
  http://jedwatson.github.io/classnames
67212
67233
  */
67213
67234
 
67214
- (function (module) {
67215
- /* global define */
67235
+ var hasRequiredClassnames;
67236
+
67237
+ function requireClassnames () {
67238
+ if (hasRequiredClassnames) return classnames$1.exports;
67239
+ hasRequiredClassnames = 1;
67240
+ (function (module) {
67241
+ /* global define */
67216
67242
 
67217
- (function () {
67243
+ (function () {
67218
67244
 
67219
- var hasOwn = {}.hasOwnProperty;
67245
+ var hasOwn = {}.hasOwnProperty;
67220
67246
 
67221
- function classNames() {
67222
- var classes = [];
67247
+ function classNames() {
67248
+ var classes = [];
67223
67249
 
67224
- for (var i = 0; i < arguments.length; i++) {
67225
- var arg = arguments[i];
67226
- if (!arg) continue;
67250
+ for (var i = 0; i < arguments.length; i++) {
67251
+ var arg = arguments[i];
67252
+ if (!arg) continue;
67227
67253
 
67228
- var argType = typeof arg;
67254
+ var argType = typeof arg;
67229
67255
 
67230
- if (argType === 'string' || argType === 'number') {
67231
- classes.push(arg);
67232
- } else if (Array.isArray(arg)) {
67233
- if (arg.length) {
67234
- var inner = classNames.apply(null, arg);
67235
- if (inner) {
67236
- classes.push(inner);
67256
+ if (argType === 'string' || argType === 'number') {
67257
+ classes.push(arg);
67258
+ } else if (Array.isArray(arg)) {
67259
+ if (arg.length) {
67260
+ var inner = classNames.apply(null, arg);
67261
+ if (inner) {
67262
+ classes.push(inner);
67263
+ }
67237
67264
  }
67238
- }
67239
- } else if (argType === 'object') {
67240
- if (arg.toString === Object.prototype.toString) {
67241
- for (var key in arg) {
67242
- if (hasOwn.call(arg, key) && arg[key]) {
67243
- classes.push(key);
67265
+ } else if (argType === 'object') {
67266
+ if (arg.toString === Object.prototype.toString) {
67267
+ for (var key in arg) {
67268
+ if (hasOwn.call(arg, key) && arg[key]) {
67269
+ classes.push(key);
67270
+ }
67244
67271
  }
67272
+ } else {
67273
+ classes.push(arg.toString());
67245
67274
  }
67246
- } else {
67247
- classes.push(arg.toString());
67248
67275
  }
67249
67276
  }
67250
- }
67251
67277
 
67252
- return classes.join(' ');
67253
- }
67278
+ return classes.join(' ');
67279
+ }
67254
67280
 
67255
- if (module.exports) {
67256
- classNames.default = classNames;
67257
- module.exports = classNames;
67258
- } else {
67259
- window.classNames = classNames;
67260
- }
67261
- }());
67262
- } (classnames$1));
67281
+ if (module.exports) {
67282
+ classNames.default = classNames;
67283
+ module.exports = classNames;
67284
+ } else {
67285
+ window.classNames = classNames;
67286
+ }
67287
+ }());
67288
+ } (classnames$1));
67289
+ return classnames$1.exports;
67290
+ }
67263
67291
 
67264
- var classnamesExports = classnames$1.exports;
67292
+ var classnamesExports = requireClassnames();
67265
67293
  var classnames = /*@__PURE__*/getDefaultExportFromCjs$1(classnamesExports);
67266
67294
 
67267
67295
  /**
@@ -116827,21 +116855,30 @@
116827
116855
  return unsafeStringify(rnds);
116828
116856
  }
116829
116857
 
116830
- var semverCompare = function cmp (a, b) {
116831
- var pa = a.split('.');
116832
- var pb = b.split('.');
116833
- for (var i = 0; i < 3; i++) {
116834
- var na = Number(pa[i]);
116835
- var nb = Number(pb[i]);
116836
- if (na > nb) return 1;
116837
- if (nb > na) return -1;
116838
- if (!isNaN(na) && isNaN(nb)) return 1;
116839
- if (isNaN(na) && !isNaN(nb)) return -1;
116840
- }
116841
- return 0;
116842
- };
116858
+ var semverCompare$1;
116859
+ var hasRequiredSemverCompare;
116843
116860
 
116844
- var semverCompare$1 = /*@__PURE__*/getDefaultExportFromCjs$1(semverCompare);
116861
+ function requireSemverCompare () {
116862
+ if (hasRequiredSemverCompare) return semverCompare$1;
116863
+ hasRequiredSemverCompare = 1;
116864
+ semverCompare$1 = function cmp (a, b) {
116865
+ var pa = a.split('.');
116866
+ var pb = b.split('.');
116867
+ for (var i = 0; i < 3; i++) {
116868
+ var na = Number(pa[i]);
116869
+ var nb = Number(pb[i]);
116870
+ if (na > nb) return 1;
116871
+ if (nb > na) return -1;
116872
+ if (!isNaN(na) && isNaN(nb)) return 1;
116873
+ if (isNaN(na) && !isNaN(nb)) return -1;
116874
+ }
116875
+ return 0;
116876
+ };
116877
+ return semverCompare$1;
116878
+ }
116879
+
116880
+ var semverCompareExports = requireSemverCompare();
116881
+ var semverCompare = /*@__PURE__*/getDefaultExportFromCjs$1(semverCompareExports);
116845
116882
 
116846
116883
  var version$1 = "0.18.0";
116847
116884
 
@@ -117506,30 +117543,42 @@
117506
117543
  return _validate(object, validateTemplate);
117507
117544
  }
117508
117545
 
117509
- function StaticResolver(cache) {
117510
- this.cache = cache;
117511
- }
117546
+ var staticResolver;
117547
+ var hasRequiredStaticResolver;
117512
117548
 
117549
+ function requireStaticResolver () {
117550
+ if (hasRequiredStaticResolver) return staticResolver;
117551
+ hasRequiredStaticResolver = 1;
117552
+ function StaticResolver(cache) {
117553
+ this.cache = cache;
117554
+ }
117513
117555
 
117514
- StaticResolver.prototype.resolveRule = function(pkg, ruleName) {
117515
- return this.resolve('rule', pkg, ruleName);
117516
- };
117556
+ staticResolver = StaticResolver;
117517
117557
 
117518
- StaticResolver.prototype.resolveConfig = function(pkg, configName) {
117519
- return this.resolve('config', pkg, configName);
117520
- };
117521
117558
 
117522
- StaticResolver.prototype.resolve = function(type, pkg, name) {
117523
- const id = `${pkg}/${name}`;
117559
+ StaticResolver.prototype.resolveRule = function(pkg, ruleName) {
117560
+ return this.resolve('rule', pkg, ruleName);
117561
+ };
117524
117562
 
117525
- const resolved = this.cache[`${type}:${id}`];
117563
+ StaticResolver.prototype.resolveConfig = function(pkg, configName) {
117564
+ return this.resolve('config', pkg, configName);
117565
+ };
117526
117566
 
117527
- if (!resolved) {
117528
- throw new Error(`unknown ${type} <${id}>`);
117529
- }
117567
+ StaticResolver.prototype.resolve = function(type, pkg, name) {
117568
+ const id = `${pkg}/${name}`;
117530
117569
 
117531
- return resolved;
117532
- };
117570
+ const resolved = this.cache[`${type}:${id}`];
117571
+
117572
+ if (!resolved) {
117573
+ throw new Error(`unknown ${type} <${id}>`);
117574
+ }
117575
+
117576
+ return resolved;
117577
+ };
117578
+ return staticResolver;
117579
+ }
117580
+
117581
+ requireStaticResolver();
117533
117582
 
117534
117583
  const isSpecialFeelProperty = property => {
117535
117584
  return ['optional', 'static'].includes(property.feel) && ['Boolean', 'Number'].includes(property.type);
@@ -118184,7 +118233,7 @@
118184
118233
  schemaVersion = template.$schema && getSchemaVersion(template.$schema);
118185
118234
 
118186
118235
  // (1) compatibility
118187
- if (schemaVersion && semverCompare$1(SUPPORTED_SCHEMA_VERSION$1, schemaVersion) < 0) {
118236
+ if (schemaVersion && semverCompare(SUPPORTED_SCHEMA_VERSION$1, schemaVersion) < 0) {
118188
118237
  return this._logError(`unsupported element template schema version <${schemaVersion}>. Your installation only supports up to version <${SUPPORTED_SCHEMA_VERSION$1}>. Please update your installation`, template);
118189
118238
  }
118190
118239
 
@@ -118390,7 +118439,7 @@
118390
118439
  }
118391
118440
 
118392
118441
  // (2) compatibility
118393
- if (schemaVersion && semverCompare$1(SUPPORTED_SCHEMA_VERSION, schemaVersion) < 0) {
118442
+ if (schemaVersion && semverCompare(SUPPORTED_SCHEMA_VERSION, schemaVersion) < 0) {
118394
118443
  return this._logError(`unsupported element template schema version <${schemaVersion}>. Your installation only supports up to version <${SUPPORTED_SCHEMA_VERSION}>. Please update your installation`, template);
118395
118444
  }
118396
118445