@logicflow/extension 1.1.11 → 1.2.0-alpha.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.
Files changed (66) hide show
  1. package/cjs/NodeResize/Control/Control.js +8 -8
  2. package/cjs/NodeResize/Control/Util.js +11 -11
  3. package/cjs/bpmn-adapter/index.js +124 -76
  4. package/cjs/bpmn-adapter/json2xml.js +5 -2
  5. package/cjs/bpmn-adapter/xml2json.js +38 -284
  6. package/cjs/components/context-menu/index.js +2 -2
  7. package/cjs/components/menu/index.js +23 -23
  8. package/cjs/components/mini-map/index.js +2 -2
  9. package/cjs/components/selection-select/index.js +5 -5
  10. package/cjs/insert-node-in-polyline/edge.js +4 -4
  11. package/cjs/insert-node-in-polyline/index.js +1 -1
  12. package/cjs/materials/group/GroupNode.js +2 -2
  13. package/cjs/materials/group/index.js +3 -3
  14. package/cjs/tools/auto-layout/index.js +9 -9
  15. package/cjs/turbo-adapter/index.js +2 -2
  16. package/es/NodeResize/Control/Control.d.ts +1 -1
  17. package/es/NodeResize/Control/Control.js +9 -9
  18. package/es/NodeResize/Control/Util.d.ts +3 -3
  19. package/es/NodeResize/Control/Util.js +7 -7
  20. package/es/bpmn-adapter/index.d.ts +41 -33
  21. package/es/bpmn-adapter/index.js +124 -76
  22. package/es/bpmn-adapter/json2xml.js +5 -2
  23. package/es/bpmn-adapter/xml2json.js +38 -284
  24. package/es/components/context-menu/index.js +2 -2
  25. package/es/components/menu/index.js +23 -23
  26. package/es/components/mini-map/index.js +2 -2
  27. package/es/components/selection-select/index.d.ts +1 -1
  28. package/es/components/selection-select/index.js +5 -5
  29. package/es/insert-node-in-polyline/edge.d.ts +3 -3
  30. package/es/insert-node-in-polyline/edge.js +3 -3
  31. package/es/insert-node-in-polyline/index.js +2 -2
  32. package/es/materials/group/GroupNode.d.ts +1 -1
  33. package/es/materials/group/GroupNode.js +2 -2
  34. package/es/materials/group/index.d.ts +1 -1
  35. package/es/materials/group/index.js +3 -3
  36. package/es/tools/auto-layout/index.d.ts +2 -2
  37. package/es/tools/auto-layout/index.js +9 -9
  38. package/es/turbo-adapter/index.js +2 -2
  39. package/lib/AutoLayout.js +1 -1
  40. package/lib/BpmnAdapter.js +1 -1
  41. package/lib/BpmnElement.js +1 -1
  42. package/lib/ContextMenu.js +1 -1
  43. package/lib/Control.js +1 -1
  44. package/lib/CurvedEdge.js +1 -1
  45. package/lib/DndPanel.js +1 -1
  46. package/lib/FlowPath.js +1 -1
  47. package/lib/Group.js +1 -1
  48. package/lib/InsertNodeInPolyline.js +1 -1
  49. package/lib/Menu.js +1 -1
  50. package/lib/MiniMap.js +1 -1
  51. package/lib/NodeResize.js +1 -1
  52. package/lib/RectLabelNode.js +1 -1
  53. package/lib/SelectionSelect.js +1 -1
  54. package/lib/Snapshot.js +1 -1
  55. package/lib/TurboAdapter.js +1 -1
  56. package/lib/lfJson2Xml.js +1 -1
  57. package/lib/lfXml2Json.js +1 -1
  58. package/package.json +2 -2
  59. package/types/NodeResize/Control/Control.d.ts +1 -1
  60. package/types/NodeResize/Control/Util.d.ts +3 -3
  61. package/types/bpmn-adapter/index.d.ts +41 -33
  62. package/types/components/selection-select/index.d.ts +1 -1
  63. package/types/insert-node-in-polyline/edge.d.ts +3 -3
  64. package/types/materials/group/GroupNode.d.ts +1 -1
  65. package/types/materials/group/index.d.ts +1 -1
  66. package/types/tools/auto-layout/index.d.ts +2 -2
@@ -35,26 +35,26 @@ XML.ObjTree.prototype.parseXML = function (xml) {
35
35
  };
36
36
  // method: parseHTTP( url, options, callback )
37
37
  XML.ObjTree.prototype.parseHTTP = function (url, options, callback) {
38
- var myopt = {};
38
+ var myOpt = {};
39
39
  for (var key in options) {
40
- myopt[key] = options[key]; // copy object
40
+ myOpt[key] = options[key]; // copy object
41
41
  }
42
- if (!myopt.method) {
43
- if (typeof (myopt.postBody) == "undefined" &&
44
- typeof (myopt.postbody) == "undefined" &&
45
- typeof (myopt.parameters) == "undefined") {
46
- myopt.method = "get";
42
+ if (!myOpt.method) {
43
+ if (typeof (myOpt.postBody) == "undefined" &&
44
+ typeof (myOpt.postbody) == "undefined" &&
45
+ typeof (myOpt.parameters) == "undefined") {
46
+ myOpt.method = "get";
47
47
  }
48
48
  else {
49
- myopt.method = "post";
49
+ myOpt.method = "post";
50
50
  }
51
51
  }
52
52
  if (callback) {
53
- myopt.asynchronous = true; // async-mode
53
+ myOpt.asynchronous = true; // async-mode
54
54
  var __this = this;
55
55
  var __func = callback;
56
- var __save = myopt.onComplete;
57
- myopt.onComplete = function (trans) {
56
+ var __save = myOpt.onComplete;
57
+ myOpt.onComplete = function (trans) {
58
58
  var tree;
59
59
  if (trans && trans.responseXML && trans.responseXML.documentElement) {
60
60
  tree = __this.parseDOM(trans.responseXML.documentElement);
@@ -65,17 +65,17 @@ XML.ObjTree.prototype.parseHTTP = function (url, options, callback) {
65
65
  };
66
66
  }
67
67
  else {
68
- myopt.asynchronous = false; // sync-mode
68
+ myOpt.asynchronous = false;
69
69
  }
70
70
  var trans;
71
71
  if (typeof (HTTP) != "undefined" && HTTP.Request) {
72
- myopt.uri = url;
73
- var req = new HTTP.Request(myopt); // JSAN
72
+ myOpt.uri = url;
73
+ var req = new HTTP.Request(myOpt);
74
74
  if (req)
75
75
  trans = req.transport;
76
76
  }
77
77
  else if (typeof (Ajax) != "undefined" && Ajax.Request) {
78
- var req = new Ajax.Request(url, myopt); // ptorotype.js
78
+ var req = new Ajax.Request(url, myOpt);
79
79
  if (req)
80
80
  trans = req.transport;
81
81
  }
@@ -85,7 +85,7 @@ XML.ObjTree.prototype.parseHTTP = function (url, options, callback) {
85
85
  return this.parseDOM(trans.responseXML.documentElement);
86
86
  }
87
87
  };
88
- // method: parseDOM( documentroot )
88
+ // method: parseDOM( document root )
89
89
  XML.ObjTree.prototype.parseDOM = function (root) {
90
90
  if (!root)
91
91
  return;
@@ -119,11 +119,11 @@ XML.ObjTree.prototype.parseElement = function (elem) {
119
119
  return; // ignore white spaces
120
120
  return elem.nodeValue;
121
121
  }
122
- var retval;
122
+ var retVal;
123
123
  var cnt = {};
124
124
  // parse attributes
125
125
  if (elem.attributes && elem.attributes.length) {
126
- retval = {};
126
+ retVal = {};
127
127
  for (var i = 0; i < elem.attributes.length; i++) {
128
128
  var key = elem.attributes[i].nodeName;
129
129
  if (typeof (key) != "string")
@@ -135,30 +135,30 @@ XML.ObjTree.prototype.parseElement = function (elem) {
135
135
  if (typeof (cnt[key]) == "undefined")
136
136
  cnt[key] = 0;
137
137
  cnt[key]++;
138
- this.addNode(retval, key, cnt[key], val);
138
+ this.addNode(retVal, key, cnt[key], val);
139
139
  }
140
140
  }
141
141
  // parse child nodes (recursive)
142
142
  if (elem.childNodes && elem.childNodes.length) {
143
- var textonly = true;
144
- if (retval)
145
- textonly = false; // some attributes exists
146
- for (var i = 0; i < elem.childNodes.length && textonly; i++) {
147
- var ntype = elem.childNodes[i].nodeType;
148
- if (ntype == 3 || ntype == 4)
143
+ var textOnly = true;
144
+ if (retVal)
145
+ textOnly = false; // some attributes exists
146
+ for (var i = 0; i < elem.childNodes.length && textOnly; i++) {
147
+ var nType = elem.childNodes[i].nodeType;
148
+ if (nType == 3 || nType == 4)
149
149
  continue;
150
- textonly = false;
150
+ textOnly = false;
151
151
  }
152
- if (textonly) {
153
- if (!retval)
154
- retval = "";
152
+ if (textOnly) {
153
+ if (!retVal)
154
+ retVal = "";
155
155
  for (var i = 0; i < elem.childNodes.length; i++) {
156
- retval += elem.childNodes[i].nodeValue;
156
+ retVal += elem.childNodes[i].nodeValue;
157
157
  }
158
158
  }
159
159
  else {
160
- if (!retval)
161
- retval = {};
160
+ if (!retVal)
161
+ retVal = {};
162
162
  for (var i = 0; i < elem.childNodes.length; i++) {
163
163
  var key = elem.childNodes[i].nodeName;
164
164
  if (typeof (key) != "string")
@@ -169,23 +169,23 @@ XML.ObjTree.prototype.parseElement = function (elem) {
169
169
  if (typeof (cnt[key]) == "undefined")
170
170
  cnt[key] = 0;
171
171
  cnt[key]++;
172
- this.addNode(retval, key, cnt[key], val);
172
+ this.addNode(retVal, key, cnt[key], val);
173
173
  }
174
174
  }
175
175
  }
176
- return retval;
176
+ return retVal;
177
177
  };
178
178
  // method: addNode( hash, key, count, value )
179
- XML.ObjTree.prototype.addNode = function (hash, key, cnts, val) {
179
+ XML.ObjTree.prototype.addNode = function (hash, key, counts, val) {
180
180
  if (this.__force_array[key]) {
181
- if (cnts == 1)
181
+ if (counts == 1)
182
182
  hash[key] = [];
183
183
  hash[key][hash[key].length] = val; // push
184
184
  }
185
- else if (cnts == 1) { // 1st sibling
185
+ else if (counts == 1) { // 1st sibling
186
186
  hash[key] = val;
187
187
  }
188
- else if (cnts == 2) { // 2nd sibling
188
+ else if (counts == 2) { // 2nd sibling
189
189
  hash[key] = [hash[key], val];
190
190
  }
191
191
  else { // 3rd sibling and more
@@ -274,252 +274,6 @@ XML.ObjTree.prototype.scalar_to_xml = function (name, text) {
274
274
  XML.ObjTree.prototype.xml_escape = function (text) {
275
275
  return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
276
276
  };
277
- /*
278
- // ========================================================================
279
-
280
- =head1 NAME
281
-
282
- XML.ObjTree -- XML source code from/to JavaScript object like E4X
283
-
284
- =head1 SYNOPSIS
285
-
286
- var xotree = new XML.ObjTree();
287
- var tree1 = {
288
- root: {
289
- node: "Hello, World!"
290
- }
291
- };
292
- var xml1 = xotree.writeXML( tree1 ); // object tree to XML source
293
- alert( "xml1: "+xml1 );
294
-
295
- var xml2 = '<?xml version="1.0"?><response><error>0</error></response>';
296
- var tree2 = xotree.parseXML( xml2 ); // XML source to object tree
297
- alert( "error: "+tree2.response.error );
298
-
299
- =head1 DESCRIPTION
300
-
301
- XML.ObjTree class is a parser/generater between XML source code
302
- and JavaScript object like E4X, ECMAScript for XML.
303
- This is a JavaScript version of the XML::TreePP module for Perl.
304
- This also works as a wrapper for XMLHTTPRequest and successor to JKL.ParseXML class
305
- when this is used with prototype.js or JSAN's HTTP.Request class.
306
-
307
- =head2 JavaScript object tree format
308
-
309
- A sample XML source:
310
-
311
- <?xml version="1.0" encoding="UTF-8"?>
312
- <family name="Kawasaki">
313
- <father>Yasuhisa</father>
314
- <mother>Chizuko</mother>
315
- <children>
316
- <girl>Shiori</girl>
317
- <boy>Yusuke</boy>
318
- <boy>Kairi</boy>
319
- </children>
320
- </family>
321
-
322
- Its JavaScript object tree like JSON/E4X:
323
-
324
- {
325
- 'family': {
326
- '-name': 'Kawasaki',
327
- 'father': 'Yasuhisa',
328
- 'mother': 'Chizuko',
329
- 'children': {
330
- 'girl': 'Shiori'
331
- 'boy': [
332
- 'Yusuke',
333
- 'Kairi'
334
- ]
335
- }
336
- }
337
- };
338
-
339
- Each elements are parsed into objects:
340
-
341
- tree.family.father; # the father's given name.
342
-
343
- Prefix '-' is inserted before every attributes' name.
344
-
345
- tree.family["-name"]; # this family's family name
346
-
347
- A array is used because this family has two boys.
348
-
349
- tree.family.children.boy[0]; # first boy's name
350
- tree.family.children.boy[1]; # second boy's name
351
- tree.family.children.girl; # (girl has no other sisiters)
352
-
353
- =head1 METHODS
354
-
355
- =head2 xotree = new XML.ObjTree()
356
-
357
- This constructor method returns a new XML.ObjTree object.
358
-
359
- =head2 xotree.force_array = [ "rdf:li", "item", "-xmlns" ];
360
-
361
- This property allows you to specify a list of element names
362
- which should always be forced into an array representation.
363
- The default value is null, it means that context of the elements
364
- will determine to make array or to keep it scalar.
365
-
366
- =head2 xotree.attr_prefix = '@';
367
-
368
- This property allows you to specify a prefix character which is
369
- inserted before each attribute names.
370
- Instead of default prefix '-', E4X-style prefix '@' is also available.
371
- The default character is '-'.
372
- Or set '@' to access attribute values like E4X, ECMAScript for XML.
373
- The length of attr_prefix must be just one character and not be empty.
374
-
375
- =head2 tree = xotree.parseXML( xmlsrc );
376
-
377
- This method loads an XML document using the supplied string
378
- and returns its JavaScript object converted.
379
-
380
- =head2 tree = xotree.parseDOM( domnode );
381
-
382
- This method parses a DOM tree (ex. responseXML.documentElement)
383
- and returns its JavaScript object converted.
384
-
385
- =head2 tree = xotree.parseHTTP( url, options );
386
-
387
- This method loads a XML file from remote web server
388
- and returns its JavaScript object converted.
389
- XMLHTTPRequest's synchronous mode is always used.
390
- This mode blocks the process until the response is completed.
391
-
392
- First argument is a XML file's URL
393
- which must exist in the same domain as parent HTML file's.
394
- Cross-domain loading is not available for security reasons.
395
-
396
- Second argument is options' object which can contains some parameters:
397
- method, postBody, parameters, onLoading, etc.
398
-
399
- This method requires JSAN's L<HTTP.Request> class or prototype.js's Ajax.Request class.
400
-
401
- =head2 xotree.parseHTTP( url, options, callback );
402
-
403
- If a callback function is set as third argument,
404
- XMLHTTPRequest's asynchronous mode is used.
405
-
406
- This mode calls a callback function with XML file's JavaScript object converted
407
- after the response is completed.
408
-
409
- =head2 xmlsrc = xotree.writeXML( tree );
410
-
411
- This method parses a JavaScript object tree
412
- and returns its XML source generated.
413
-
414
- =head1 EXAMPLES
415
-
416
- =head2 Text node and attributes
417
-
418
- If a element has both of a text node and attributes
419
- or both of a text node and other child nodes,
420
- text node's value is moved to a special node named "#text".
421
-
422
- var xotree = new XML.ObjTree();
423
- var xmlsrc = '<span class="author">Kawasaki Yusuke</span>';
424
- var tree = xotree.parseXML( xmlsrc );
425
- var class = tree.span["-class"]; # attribute
426
- var name = tree.span["#text"]; # text node
427
-
428
- =head2 parseHTTP() method with HTTP-GET and sync-mode
429
-
430
- HTTP/Request.js or prototype.js must be loaded before calling this method.
431
-
432
- var xotree = new XML.ObjTree();
433
- var url = "http://example.com/index.html";
434
- var tree = xotree.parseHTTP( url );
435
- xotree.attr_prefix = '@'; // E4X-style
436
- alert( tree.html["@lang"] );
437
-
438
- This code shows C<lang=""> attribute from a X-HTML source code.
439
-
440
- =head2 parseHTTP() method with HTTP-POST and async-mode
441
-
442
- Third argument is a callback function which is called on onComplete.
443
-
444
- var xotree = new XML.ObjTree();
445
- var url = "http://example.com/mt-tb.cgi";
446
- var opts = {
447
- postBody: "title=...&excerpt=...&url=...&blog_name=..."
448
- };
449
- var func = function ( tree ) {
450
- alert( tree.response.error );
451
- };
452
- xotree.parseHTTP( url, opts, func );
453
-
454
- This code send a trackback ping and shows its response code.
455
-
456
- =head2 Simple RSS reader
457
-
458
- This is a RSS reader which loads RDF file and displays all items.
459
-
460
- var xotree = new XML.ObjTree();
461
- xotree.force_array = [ "rdf:li", "item" ];
462
- var url = "http://example.com/news-rdf.xml";
463
- var func = function( tree ) {
464
- var elem = document.getElementById("rss_here");
465
- for( var i=0; i<tree["rdf:RDF"].item.length; i++ ) {
466
- var divtag = document.createElement( "div" );
467
- var atag = document.createElement( "a" );
468
- atag.href = tree["rdf:RDF"].item[i].link;
469
- var title = tree["rdf:RDF"].item[i].title;
470
- var tnode = document.createTextNode( title );
471
- atag.appendChild( tnode );
472
- divtag.appendChild( atag );
473
- elem.appendChild( divtag );
474
- }
475
- };
476
- xotree.parseHTTP( url, {}, func );
477
-
478
- =head2 XML-RPC using writeXML, prototype.js and parseDOM
479
-
480
- If you wish to use prototype.js's Ajax.Request class by yourself:
481
-
482
- var xotree = new XML.ObjTree();
483
- var reqtree = {
484
- methodCall: {
485
- methodName: "weblogUpdates.ping",
486
- params: {
487
- param: [
488
- { value: "Kawa.net xp top page" }, // 1st param
489
- { value: "http://www.kawa.net/" } // 2nd param
490
- ]
491
- }
492
- }
493
- };
494
- var reqxml = xotree.writeXML( reqtree ); // JS-Object to XML code
495
- var url = "http://example.com/xmlrpc";
496
- var func = function( req ) {
497
- var resdom = req.responseXML.documentElement;
498
- xotree.force_array = [ "member" ];
499
- var restree = xotree.parseDOM( resdom ); // XML-DOM to JS-Object
500
- alert( restree.methodResponse.params.param.value.struct.member[0].value.string );
501
- };
502
- var opt = {
503
- method: "post",
504
- postBody: reqxml,
505
- asynchronous: true,
506
- onComplete: func
507
- };
508
- new Ajax.Request( url, opt );
509
-
510
- =head1 AUTHOR
511
-
512
- Yusuke Kawasaki http://www.kawa.net/
513
- =head1 COPYRIGHT AND LICENSE
514
-
515
- Copyright (c) 2005-2006 Yusuke Kawasaki. All rights reserved.
516
- This program is free software; you can redistribute it and/or
517
- modify it under the Artistic license. Or whatever license I choose,
518
- which I will do instead of keeping this documentation like it is.
519
-
520
- =cut
521
- // ========================================================================
522
- */
523
277
  var lfXml2Json = function (xmlData) {
524
278
  return new XML.ObjTree().parseXML(xmlData);
525
279
  };
@@ -174,8 +174,8 @@ var ContextMenu = /** @class */ (function () {
174
174
  var leftTopY = y - node.y / 2 - 20;
175
175
  var rightBottomX = node.x + nodeModel.width + NEXT_X_DISTANCE;
176
176
  var rightBottomY = y + node.y / 2 + 20;
177
- var exsitElements = this.lf.getAreaElement([leftTopX, leftTopY], [rightBottomX, rightBottomY]);
178
- if (exsitElements.length) {
177
+ var existElements = this.lf.getAreaElement([leftTopX, leftTopY], [rightBottomX, rightBottomY]);
178
+ if (existElements.length) {
179
179
  y = y + NEXT_Y_DISTANCE;
180
180
  this.addNode(node, y);
181
181
  return;
@@ -18,10 +18,10 @@ var __spread = (this && this.__spread) || function () {
18
18
  for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
19
19
  return ar;
20
20
  };
21
- var DefalutNodeMenuKey = 'lf:defaultNodeMenu';
22
- var DefalutEdgeMenuKey = 'lf:defaultEdgeMenu';
23
- var DefalutGraphMenuKey = 'lf:defaultGraphMenu';
24
- var DefalutSelectionMenuKey = 'lf:defaultSelectionMenu';
21
+ var DefaultNodeMenuKey = 'lf:defaultNodeMenu';
22
+ var DefaultEdgeMenuKey = 'lf:defaultEdgeMenu';
23
+ var DefaultGraphMenuKey = 'lf:defaultGraphMenu';
24
+ var DefaultSelectionMenuKey = 'lf:defaultSelectionMenu';
25
25
  var Menu = /** @class */ (function () {
26
26
  function Menu(_a) {
27
27
  var _this = this;
@@ -45,7 +45,7 @@ var Menu = /** @class */ (function () {
45
45
  */
46
46
  Menu.prototype.init = function () {
47
47
  var _this = this;
48
- var defalutNodeMenu = [
48
+ var defaultNodeMenu = [
49
49
  {
50
50
  text: '删除',
51
51
  callback: function (node) {
@@ -65,7 +65,7 @@ var Menu = /** @class */ (function () {
65
65
  },
66
66
  },
67
67
  ];
68
- this.menuTypeMap.set(DefalutNodeMenuKey, defalutNodeMenu);
68
+ this.menuTypeMap.set(DefaultNodeMenuKey, defaultNodeMenu);
69
69
  var defaultEdgeMenu = [
70
70
  {
71
71
  text: '删除',
@@ -80,9 +80,9 @@ var Menu = /** @class */ (function () {
80
80
  },
81
81
  },
82
82
  ];
83
- this.menuTypeMap.set(DefalutEdgeMenuKey, defaultEdgeMenu);
84
- this.menuTypeMap.set(DefalutGraphMenuKey, []);
85
- var DefalutSelectionMenu = [
83
+ this.menuTypeMap.set(DefaultEdgeMenuKey, defaultEdgeMenu);
84
+ this.menuTypeMap.set(DefaultGraphMenuKey, []);
85
+ var DefaultSelectionMenu = [
86
86
  {
87
87
  text: '删除',
88
88
  callback: function (elements) {
@@ -92,7 +92,7 @@ var Menu = /** @class */ (function () {
92
92
  },
93
93
  },
94
94
  ];
95
- this.menuTypeMap.set(DefalutSelectionMenuKey, DefalutSelectionMenu);
95
+ this.menuTypeMap.set(DefaultSelectionMenuKey, DefaultSelectionMenu);
96
96
  };
97
97
  Menu.prototype.render = function (lf, container) {
98
98
  var _this = this;
@@ -139,7 +139,7 @@ var Menu = /** @class */ (function () {
139
139
  menuList = typeMenus;
140
140
  }
141
141
  else { // 最后取全局默认
142
- menuList = _this.menuTypeMap.get(DefalutNodeMenuKey);
142
+ menuList = _this.menuTypeMap.get(DefaultNodeMenuKey);
143
143
  }
144
144
  _this.__currentData = data;
145
145
  _this.showMenu(x, y, menuList);
@@ -159,20 +159,20 @@ var Menu = /** @class */ (function () {
159
159
  menuList = typeMenus;
160
160
  }
161
161
  else { // 最后取全局默认
162
- menuList = _this.menuTypeMap.get(DefalutEdgeMenuKey);
162
+ menuList = _this.menuTypeMap.get(DefaultEdgeMenuKey);
163
163
  }
164
164
  _this.__currentData = data;
165
165
  _this.showMenu(x, y, menuList);
166
166
  });
167
167
  this.lf.on('blank:contextmenu', function (_a) {
168
168
  var position = _a.position;
169
- var menuList = _this.menuTypeMap.get(DefalutGraphMenuKey);
169
+ var menuList = _this.menuTypeMap.get(DefaultGraphMenuKey);
170
170
  var _b = position.domOverlayPosition, x = _b.x, y = _b.y;
171
171
  _this.showMenu(x, y, menuList);
172
172
  });
173
173
  this.lf.on('selection:contextmenu', function (_a) {
174
174
  var data = _a.data, position = _a.position;
175
- var menuList = _this.menuTypeMap.get(DefalutSelectionMenuKey);
175
+ var menuList = _this.menuTypeMap.get(DefaultSelectionMenuKey);
176
176
  var _b = position.domOverlayPosition, x = _b.x, y = _b.y;
177
177
  _this.__currentData = data;
178
178
  _this.showMenu(x, y, menuList);
@@ -253,13 +253,13 @@ var Menu = /** @class */ (function () {
253
253
  }
254
254
  // node
255
255
  config.nodeMenu !== undefined
256
- && this.menuTypeMap.set(DefalutNodeMenuKey, config.nodeMenu ? config.nodeMenu : []);
256
+ && this.menuTypeMap.set(DefaultNodeMenuKey, config.nodeMenu ? config.nodeMenu : []);
257
257
  // edge
258
258
  config.edgeMenu !== undefined
259
- && this.menuTypeMap.set(DefalutEdgeMenuKey, config.edgeMenu ? config.edgeMenu : []);
259
+ && this.menuTypeMap.set(DefaultEdgeMenuKey, config.edgeMenu ? config.edgeMenu : []);
260
260
  // graph
261
261
  config.graphMenu !== undefined
262
- && this.menuTypeMap.set(DefalutGraphMenuKey, config.graphMenu ? config.graphMenu : []);
262
+ && this.menuTypeMap.set(DefaultGraphMenuKey, config.graphMenu ? config.graphMenu : []);
263
263
  };
264
264
  // 在默认菜单后面追加菜单项
265
265
  Menu.prototype.addMenuConfig = function (config) {
@@ -268,16 +268,16 @@ var Menu = /** @class */ (function () {
268
268
  }
269
269
  // 追加项时,只支持数组类型,对false不做操作
270
270
  if (Array.isArray(config.nodeMenu)) {
271
- var menuList = this.menuTypeMap.get(DefalutNodeMenuKey);
272
- this.menuTypeMap.set(DefalutNodeMenuKey, menuList.concat(config.nodeMenu));
271
+ var menuList = this.menuTypeMap.get(DefaultNodeMenuKey);
272
+ this.menuTypeMap.set(DefaultNodeMenuKey, menuList.concat(config.nodeMenu));
273
273
  }
274
274
  if (Array.isArray(config.edgeMenu)) {
275
- var menuList = this.menuTypeMap.get(DefalutEdgeMenuKey);
276
- this.menuTypeMap.set(DefalutEdgeMenuKey, menuList.concat(config.edgeMenu));
275
+ var menuList = this.menuTypeMap.get(DefaultEdgeMenuKey);
276
+ this.menuTypeMap.set(DefaultEdgeMenuKey, menuList.concat(config.edgeMenu));
277
277
  }
278
278
  if (Array.isArray(config.graphMenu)) {
279
- var menuList = this.menuTypeMap.get(DefalutGraphMenuKey);
280
- this.menuTypeMap.set(DefalutGraphMenuKey, menuList.concat(config.graphMenu));
279
+ var menuList = this.menuTypeMap.get(DefaultGraphMenuKey);
280
+ this.menuTypeMap.set(DefaultGraphMenuKey, menuList.concat(config.graphMenu));
281
281
  }
282
282
  };
283
283
  /**
@@ -167,11 +167,11 @@ var MiniMap = /** @class */ (function () {
167
167
  nodes.forEach(function (_a) {
168
168
  var x = _a.x, y = _a.y, _b = _a.width, width = _b === void 0 ? 200 : _b, _c = _a.height, height = _c === void 0 ? 200 : _c;
169
169
  var nodeLeft = x - width / 2;
170
- var noderight = x + width / 2;
170
+ var nodeRight = x + width / 2;
171
171
  var nodeTop = y - height / 2;
172
172
  var nodeBottom = y + height / 2;
173
173
  left = nodeLeft < left ? nodeLeft : left;
174
- right = noderight > right ? noderight : right;
174
+ right = nodeRight > right ? nodeRight : right;
175
175
  top = nodeTop < top ? nodeTop : top;
176
176
  bottom = nodeBottom > bottom ? nodeBottom : bottom;
177
177
  });
@@ -12,7 +12,7 @@ declare class SelectionSelect {
12
12
  y: number;
13
13
  };
14
14
  __disabled: boolean;
15
- isDefalutStopMoveGraph: boolean;
15
+ isDefaultStopMoveGraph: boolean;
16
16
  isWholeNode: boolean;
17
17
  isWholeEdge: boolean;
18
18
  static pluginName: string;
@@ -3,7 +3,7 @@ var SelectionSelect = /** @class */ (function () {
3
3
  var _this = this;
4
4
  var lf = _a.lf;
5
5
  this.__disabled = false;
6
- this.isDefalutStopMoveGraph = false;
6
+ this.isDefaultStopMoveGraph = false;
7
7
  this.isWholeNode = true;
8
8
  this.isWholeEdge = true;
9
9
  this.__draw = function (ev) {
@@ -47,9 +47,9 @@ var SelectionSelect = /** @class */ (function () {
47
47
  _this.lf.emit('selection:selected', elements);
48
48
  };
49
49
  this.lf = lf;
50
- // 初始化isDefalutStopMoveGraph取值
50
+ // 初始化isDefaultStopMoveGraph取值
51
51
  var stopMoveGraph = lf.getEditConfig().stopMoveGraph;
52
- this.isDefalutStopMoveGraph = stopMoveGraph;
52
+ this.isDefaultStopMoveGraph = stopMoveGraph;
53
53
  lf.openSelectionSelect = function () {
54
54
  _this.openSelectionSelect();
55
55
  };
@@ -97,7 +97,7 @@ var SelectionSelect = /** @class */ (function () {
97
97
  SelectionSelect.prototype.openSelectionSelect = function () {
98
98
  var stopMoveGraph = this.lf.getEditConfig().stopMoveGraph;
99
99
  if (!stopMoveGraph) {
100
- this.isDefalutStopMoveGraph = false;
100
+ this.isDefaultStopMoveGraph = false;
101
101
  this.lf.updateEditConfig({
102
102
  stopMoveGraph: true,
103
103
  });
@@ -108,7 +108,7 @@ var SelectionSelect = /** @class */ (function () {
108
108
  * 关闭选区
109
109
  */
110
110
  SelectionSelect.prototype.closeSelectionSelect = function () {
111
- if (!this.isDefalutStopMoveGraph) {
111
+ if (!this.isDefaultStopMoveGraph) {
112
112
  this.lf.updateEditConfig({
113
113
  stopMoveGraph: false,
114
114
  });
@@ -1,6 +1,6 @@
1
1
  import { Point, PolylineEdgeModel, BaseNodeModel } from '@logicflow/core';
2
2
  export declare const isInSegment: (point: any, start: any, end: any) => boolean;
3
- export declare const corssPointInSegement: (node: BaseNodeModel, start: Point, end: Point) => {
3
+ export declare const crossPointInSegment: (node: BaseNodeModel, start: Point, end: Point) => {
4
4
  startCrossPoint: {
5
5
  x: number;
6
6
  y: number;
@@ -10,12 +10,12 @@ export declare const corssPointInSegement: (node: BaseNodeModel, start: Point, e
10
10
  y: number;
11
11
  };
12
12
  };
13
- interface SegementCross {
13
+ interface SegmentCross {
14
14
  crossIndex: number;
15
15
  crossPoints: {
16
16
  startCrossPoint: Point;
17
17
  endCrossPoint: Point;
18
18
  };
19
19
  }
20
- export declare const isNodeInSegement: (node: BaseNodeModel, polyline: PolylineEdgeModel) => SegementCross;
20
+ export declare const isNodeInSegment: (node: BaseNodeModel, polyline: PolylineEdgeModel) => SegmentCross;
21
21
  export {};
@@ -42,7 +42,7 @@ var segmentDirection = function (start, end) {
42
42
  return direction;
43
43
  };
44
44
  // 节点是够在线段内,求出节点与线段的交点
45
- export var corssPointInSegement = function (node, start, end) {
45
+ export var crossPointInSegment = function (node, start, end) {
46
46
  var bBox = getNodeBBox(node);
47
47
  var direction = segmentDirection(start, end);
48
48
  var maxX = Math.max(start.x, end.x);
@@ -83,12 +83,12 @@ export var corssPointInSegement = function (node, start, end) {
83
83
  };
84
84
  // 节点是否在线段内
85
85
  // eslint-disable-next-line max-len
86
- export var isNodeInSegement = function (node, polyline) {
86
+ export var isNodeInSegment = function (node, polyline) {
87
87
  var x = node.x, y = node.y;
88
88
  var pointsList = polyline.pointsList;
89
89
  for (var i = 0; i < pointsList.length - 1; i++) {
90
90
  if (isInSegment({ x: x, y: y }, pointsList[i], pointsList[i + 1])) {
91
- var bBoxCross = corssPointInSegement(node, pointsList[i], pointsList[i + 1]);
91
+ var bBoxCross = crossPointInSegment(node, pointsList[i], pointsList[i + 1]);
92
92
  if (bBoxCross) {
93
93
  return {
94
94
  crossIndex: i + 1,
@@ -18,7 +18,7 @@ var __spread = (this && this.__spread) || function () {
18
18
  for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
19
19
  return ar;
20
20
  };
21
- import { isNodeInSegement } from './edge';
21
+ import { isNodeInSegment } from './edge';
22
22
  var InsertNodeInPolyline = /** @class */ (function () {
23
23
  function InsertNodeInPolyline(_a) {
24
24
  var lf = _a.lf;
@@ -59,7 +59,7 @@ var InsertNodeInPolyline = /** @class */ (function () {
59
59
  var nodeModel = this._lf.getNodeModelById(nodeData.id);
60
60
  for (var i = 0; i < edges.length; i++) {
61
61
  // eslint-disable-next-line max-len
62
- var _a = isNodeInSegement(nodeModel, edges[i]), crossIndex = _a.crossIndex, crossPoints = _a.crossPoints;
62
+ var _a = isNodeInSegment(nodeModel, edges[i]), crossIndex = _a.crossIndex, crossPoints = _a.crossPoints;
63
63
  if (crossIndex >= 0) {
64
64
  var _b = edges[i], sourceNodeId = _b.sourceNodeId, targetNodeId = _b.targetNodeId, id = _b.id, type = _b.type, pointsList = _b.pointsList;
65
65
  this._lf.addEdge({