lexgui 0.6.3 → 0.6.5

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.
@@ -2097,7 +2097,7 @@ class CodeEditor {
2097
2097
  if( deltaY >= 0 )
2098
2098
  {
2099
2099
  while( deltaY < ( cursorSelections.childElementCount - 1 ) )
2100
- LX.UTILS.deleteElement( cursorSelections.lastChild );
2100
+ LX.deleteElement( cursorSelections.lastChild );
2101
2101
 
2102
2102
  for(let i = fromY; i <= toY; i++){
2103
2103
 
@@ -2148,7 +2148,7 @@ class CodeEditor {
2148
2148
  else // Selection goes up...
2149
2149
  {
2150
2150
  while( Math.abs( deltaY ) < ( cursorSelections.childElementCount - 1 ) )
2151
- LX.UTILS.deleteElement( cursorSelections.firstChild );
2151
+ LX.deleteElement( cursorSelections.firstChild );
2152
2152
 
2153
2153
  for( let i = toY; i <= fromY; i++ ){
2154
2154
 
@@ -2837,7 +2837,7 @@ class CodeEditor {
2837
2837
  // Single line
2838
2838
  if( !force )
2839
2839
  {
2840
- LX.UTILS.deleteElement( this.code.childNodes[ local_line_num ] );
2840
+ LX.deleteElement( this.code.childNodes[ local_line_num ] );
2841
2841
  this.code.insertChildAtIndex( document.createElement( 'pre' ), local_line_num );
2842
2842
  }
2843
2843
 
@@ -3470,7 +3470,7 @@ class CodeEditor {
3470
3470
 
3471
3471
  if( cursor )
3472
3472
  {
3473
- LX.UTILS.deleteElement( this.selections[ cursor.name ] );
3473
+ LX.deleteElement( this.selections[ cursor.name ] );
3474
3474
  delete this.selections[ cursor.name ];
3475
3475
  delete cursor.selection;
3476
3476
  }
@@ -3478,7 +3478,7 @@ class CodeEditor {
3478
3478
  {
3479
3479
  for( let cursor of this.cursors.children )
3480
3480
  {
3481
- LX.UTILS.deleteElement( this.selections[ cursor.name ] );
3481
+ LX.deleteElement( this.selections[ cursor.name ] );
3482
3482
  delete this.selections[ cursor.name ];
3483
3483
  delete cursor.selection;
3484
3484
  }
@@ -3667,9 +3667,9 @@ class CodeEditor {
3667
3667
 
3668
3668
  removeCursor( cursor ) {
3669
3669
 
3670
- LX.UTILS.deleteElement( this.selections[ cursor.name ] );
3670
+ LX.deleteElement( this.selections[ cursor.name ] );
3671
3671
  delete this.selections[ cursor.name ];
3672
- LX.UTILS.deleteElement( cursor );
3672
+ LX.deleteElement( cursor );
3673
3673
  }
3674
3674
 
3675
3675
  resetCursorPos( flag, cursor ) {
@@ -3962,7 +3962,7 @@ class CodeEditor {
3962
3962
  line.appendChild( text );
3963
3963
  text.innerText = char;
3964
3964
  var rect = text.getBoundingClientRect();
3965
- LX.UTILS.deleteElement( parentContainer );
3965
+ LX.deleteElement( parentContainer );
3966
3966
  const bb = [ use_floating ? rect.width : Math.floor( rect.width ), use_floating ? rect.height : Math.floor( rect.height ) ];
3967
3967
  return get_bb ? bb : bb[ 0 ];
3968
3968
  }
@@ -4238,7 +4238,7 @@ class CodeEditor {
4238
4238
 
4239
4239
  else if( this._lastResult )
4240
4240
  {
4241
- LX.UTILS.deleteElement( this._lastResult.dom );
4241
+ LX.deleteElement( this._lastResult.dom );
4242
4242
  delete this._lastResult;
4243
4243
  }
4244
4244
 
@@ -4261,7 +4261,7 @@ class CodeEditor {
4261
4261
 
4262
4262
  if( this._lastResult )
4263
4263
  {
4264
- LX.UTILS.deleteElement( this._lastResult.dom );
4264
+ LX.deleteElement( this._lastResult.dom );
4265
4265
  cursorData = this._lastResult.pos;
4266
4266
  delete this._lastResult;
4267
4267
  }
@@ -393,7 +393,7 @@ class GraphEditor {
393
393
 
394
394
  this.clear();
395
395
 
396
- graph.id = graph.id ?? graph.constructor.name + '-' + LX.UTILS.uidGenerator();
396
+ graph.id = graph.id ?? graph.constructor.name + '-' + LX.guidGenerator();
397
397
 
398
398
  this.graphs[ graph.id ] = graph;
399
399
 
@@ -730,7 +730,7 @@ class GraphEditor {
730
730
  // {
731
731
  // var panel = new LX.Panel();
732
732
 
733
- // p.signal = "@" + LX.UTILS.uidGenerator() + node.title;
733
+ // p.signal = "@" + LX.guidGenerator() + node.title;
734
734
 
735
735
  // switch( p.type )
736
736
  // {
@@ -862,7 +862,7 @@ class GraphEditor {
862
862
 
863
863
  this._addNodeIOEvents( nodeContainer );
864
864
 
865
- const id = node.id ?? node.title.toLowerCase().replaceAll( /\s/g, '-' ) + '-' + LX.UTILS.uidGenerator();
865
+ const id = node.id ?? node.title.toLowerCase().replaceAll( /\s/g, '-' ) + '-' + LX.guidGenerator();
866
866
  this.nodes[ id ] = { data: node, dom: nodeContainer };
867
867
 
868
868
  node.id = id;
@@ -1035,7 +1035,7 @@ class GraphEditor {
1035
1035
  if( !this._onLink( e ) )
1036
1036
  {
1037
1037
  // Delete entire SVG if not a successful connection..
1038
- LX.UTILS.deleteElement( this._generatingLink.path ? this._generatingLink.path.parentElement : null );
1038
+ LX.deleteElement( this._generatingLink.path ? this._generatingLink.path.parentElement : null );
1039
1039
  }
1040
1040
 
1041
1041
  delete this._generatingLink;
@@ -1272,7 +1272,7 @@ class GraphEditor {
1272
1272
  return;
1273
1273
  }
1274
1274
 
1275
- LX.UTILS.deleteElement( el );
1275
+ LX.deleteElement( el );
1276
1276
 
1277
1277
  // Delete from the editor
1278
1278
 
@@ -1302,7 +1302,7 @@ class GraphEditor {
1302
1302
  {
1303
1303
  var link = this.currentGraph.links[ key ][ i ];
1304
1304
 
1305
- LX.UTILS.deleteElement( link.path.parentElement );
1305
+ LX.deleteElement( link.path.parentElement );
1306
1306
 
1307
1307
  const targetNodeId = targetIsInput ? link.inputNode : link.outputNode;
1308
1308
 
@@ -1344,7 +1344,7 @@ class GraphEditor {
1344
1344
  _deleteGroup( groupId ) {
1345
1345
 
1346
1346
  const dom = this.groups[ groupId ];
1347
- LX.UTILS.deleteElement( dom );
1347
+ LX.deleteElement( dom );
1348
1348
 
1349
1349
  // Delete from the editor
1350
1350
 
@@ -1428,7 +1428,7 @@ class GraphEditor {
1428
1428
  var links = this._getLinks( targetId, nodeId );
1429
1429
 
1430
1430
  var linkIdx = links.findIndex( i => ( i.inputIdx == srcIndex && i.outputIdx == targetIndex ) );
1431
- LX.UTILS.deleteElement( links[ linkIdx ].path.parentElement );
1431
+ LX.deleteElement( links[ linkIdx ].path.parentElement );
1432
1432
  links.splice( linkIdx, 1 );
1433
1433
 
1434
1434
  // Input has no longer any connected link
@@ -1478,7 +1478,7 @@ class GraphEditor {
1478
1478
  var links = this._getLinks( nodeId, targetId );
1479
1479
 
1480
1480
  var linkIdx = links.findIndex( i => ( i.inputIdx == targetIndex && i.outputIdx == srcIndex ) );
1481
- LX.UTILS.deleteElement( links[ linkIdx ].path.parentElement );
1481
+ LX.deleteElement( links[ linkIdx ].path.parentElement );
1482
1482
  links.splice( linkIdx, 1 );
1483
1483
 
1484
1484
  // Remove a connection from the output connections
@@ -1674,7 +1674,7 @@ class GraphEditor {
1674
1674
  const linkInfo = Object.assign( { }, this._generatingLink );
1675
1675
 
1676
1676
  // Delete old link
1677
- LX.UTILS.deleteElement( this._generatingLink.path ? this._generatingLink.path.parentElement : null );
1677
+ LX.deleteElement( this._generatingLink.path ? this._generatingLink.path.parentElement : null );
1678
1678
  delete this._generatingLink;
1679
1679
 
1680
1680
  // Open contextmenu to auto-connect something..
@@ -1688,7 +1688,7 @@ class GraphEditor {
1688
1688
 
1689
1689
  this._selectNodesInBox( this._boxSelecting, this._mousePosition, e.altKey );
1690
1690
 
1691
- LX.UTILS.deleteElement( this._currentBoxSelectionSVG );
1691
+ LX.deleteElement( this._currentBoxSelectionSVG );
1692
1692
 
1693
1693
  delete this._currentBoxSelectionSVG;
1694
1694
  delete this._boxSelecting;
@@ -2526,7 +2526,7 @@ class GraphEditor {
2526
2526
  return;
2527
2527
  }
2528
2528
 
2529
- const group_id = bb ? bb.id : "group-" + LX.UTILS.uidGenerator();
2529
+ const group_id = bb ? bb.id : "group-" + LX.guidGenerator();
2530
2530
 
2531
2531
  let groupDOM = document.createElement( 'div' );
2532
2532
  groupDOM.id = group_id;
@@ -2761,13 +2761,13 @@ class GraphEditor {
2761
2761
  nameDom.innerText = name;
2762
2762
 
2763
2763
  // Change name in sidebar
2764
- const graphNameKey = this.currentGraph.name.replace( /\s/g, '' ).replaceAll( '.', '' );
2765
- const sidebarItem = this._sidebar.items.find( v => v.name === graphNameKey );
2764
+ const sidebarItem = this._sidebar.items.find( v => v.name === this.currentGraph.name );
2766
2765
  if( sidebarItem )
2767
2766
  {
2768
- sidebarItem.name = newNameKey;
2767
+ const oldName = sidebarItem.name;
2768
+ sidebarItem.name = name;
2769
2769
  sidebarItem.dom.id = newNameKey;
2770
- sidebarItem.dom.innerHTML = sidebarItem.dom.innerHTML.replace( sidebarItem.dom.innerText, name );
2770
+ sidebarItem.dom.innerHTML = sidebarItem.dom.innerHTML.replace( oldName, name );
2771
2771
  }
2772
2772
 
2773
2773
  // Change registered nodes function