lexgui 0.1.28 → 0.1.30
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/build/components/codeeditor.js +18 -24
- package/build/components/nodegraph.js +3246 -397
- package/build/lexgui.css +340 -56
- package/build/lexgui.js +265 -135
- package/build/lexgui.module.js +251 -121
- package/changelog.md +30 -0
- package/examples/index.html +1 -1
- package/examples/node_graph.html +2 -1
- package/examples/previews/code_editor.png +0 -0
- package/examples/previews/dialogs.png +0 -0
- package/examples/previews/node_graph.png +0 -0
- package/package.json +1 -1
|
@@ -6,13 +6,6 @@ if(!LX) {
|
|
|
6
6
|
|
|
7
7
|
LX.components.push( 'CodeEditor' );
|
|
8
8
|
|
|
9
|
-
function flushCss(element) {
|
|
10
|
-
// By reading the offsetHeight property, we are forcing
|
|
11
|
-
// the browser to flush the pending CSS changes (which it
|
|
12
|
-
// does to ensure the value obtained is accurate).
|
|
13
|
-
element.offsetHeight;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
9
|
function swapElements( obj, a, b ) {
|
|
17
10
|
[obj[a], obj[b]] = [obj[b], obj[a]];
|
|
18
11
|
}
|
|
@@ -53,10 +46,6 @@ function indexOfFrom( str, reg, from, reverse ) {
|
|
|
53
46
|
}
|
|
54
47
|
}
|
|
55
48
|
|
|
56
|
-
function deleteElement( el ) {
|
|
57
|
-
if( el ) el.remove();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
49
|
let ASYNC_ENABLED = true;
|
|
61
50
|
|
|
62
51
|
function doAsync( fn, ms ) {
|
|
@@ -174,7 +163,10 @@ class ScrollBar {
|
|
|
174
163
|
|
|
175
164
|
this.root = document.createElement( 'div' );
|
|
176
165
|
this.root.className = "lexcodescrollbar";
|
|
177
|
-
|
|
166
|
+
|
|
167
|
+
if( type & ScrollBar.SCROLLBAR_VERTICAL )
|
|
168
|
+
this.root.classList.add( 'vertical' );
|
|
169
|
+
else if( type & ScrollBar.SCROLLBAR_HORIZONTAL )
|
|
178
170
|
this.root.classList.add( 'horizontal' );
|
|
179
171
|
|
|
180
172
|
this.thumb = document.createElement( 'div' );
|
|
@@ -1286,7 +1278,7 @@ class CodeEditor {
|
|
|
1286
1278
|
get: (v) => { return cursor._position },
|
|
1287
1279
|
set: (v) => {
|
|
1288
1280
|
cursor._position = v;
|
|
1289
|
-
if( cursor.isMain ) this._updateDataInfoPanel( "@cursor-pos", "Col " + v );
|
|
1281
|
+
if( cursor.isMain ) this._updateDataInfoPanel( "@cursor-pos", "Col " + ( v + 1 ) );
|
|
1290
1282
|
}
|
|
1291
1283
|
} );
|
|
1292
1284
|
|
|
@@ -1512,9 +1504,11 @@ class CodeEditor {
|
|
|
1512
1504
|
doAsync( () => {
|
|
1513
1505
|
|
|
1514
1506
|
// Change css a little bit...
|
|
1515
|
-
this.gutter.style.height = "calc(100% -
|
|
1507
|
+
this.gutter.style.height = "calc(100% - 28px)";
|
|
1516
1508
|
this.root.querySelectorAll( '.code' ).forEach( e => e.style.height = "calc(100% - 6px)" );
|
|
1517
1509
|
this.root.querySelector( '.lexareatabscontent' ).style.height = "calc(100% - 23px)";
|
|
1510
|
+
this.base_area.root.querySelector( '.lexcodescrollbar.vertical' ).style.height = "calc(100% - 27px)";
|
|
1511
|
+
this.tabs.area.root.classList.add( 'no-code-info' );
|
|
1518
1512
|
|
|
1519
1513
|
}, 100);
|
|
1520
1514
|
}
|
|
@@ -1952,7 +1946,7 @@ class CodeEditor {
|
|
|
1952
1946
|
if( deltaY >= 0 )
|
|
1953
1947
|
{
|
|
1954
1948
|
while( deltaY < ( cursorSelections.childElementCount - 1 ) )
|
|
1955
|
-
deleteElement( cursorSelections.lastChild );
|
|
1949
|
+
LX.UTILS.deleteElement( cursorSelections.lastChild );
|
|
1956
1950
|
|
|
1957
1951
|
for(let i = fromY; i <= toY; i++){
|
|
1958
1952
|
|
|
@@ -2003,7 +1997,7 @@ class CodeEditor {
|
|
|
2003
1997
|
else // Selection goes up...
|
|
2004
1998
|
{
|
|
2005
1999
|
while( Math.abs( deltaY ) < ( cursorSelections.childElementCount - 1 ) )
|
|
2006
|
-
deleteElement( cursorSelections.firstChild );
|
|
2000
|
+
LX.UTILS.deleteElement( cursorSelections.firstChild );
|
|
2007
2001
|
|
|
2008
2002
|
for( let i = toY; i <= fromY; i++ ){
|
|
2009
2003
|
|
|
@@ -2683,7 +2677,7 @@ class CodeEditor {
|
|
|
2683
2677
|
// Single line
|
|
2684
2678
|
if( !force )
|
|
2685
2679
|
{
|
|
2686
|
-
deleteElement( this.code.childNodes[ local_line_num ] );
|
|
2680
|
+
LX.UTILS.deleteElement( this.code.childNodes[ local_line_num ] );
|
|
2687
2681
|
this.code.insertChildAtIndex( document.createElement( 'pre' ), local_line_num );
|
|
2688
2682
|
}
|
|
2689
2683
|
|
|
@@ -3239,7 +3233,7 @@ class CodeEditor {
|
|
|
3239
3233
|
|
|
3240
3234
|
if( cursor )
|
|
3241
3235
|
{
|
|
3242
|
-
deleteElement( this.selections[ cursor.name ] );
|
|
3236
|
+
LX.UTILS.deleteElement( this.selections[ cursor.name ] );
|
|
3243
3237
|
delete this.selections[ cursor.name ];
|
|
3244
3238
|
delete cursor.selection;
|
|
3245
3239
|
}
|
|
@@ -3247,7 +3241,7 @@ class CodeEditor {
|
|
|
3247
3241
|
{
|
|
3248
3242
|
for( let cursor of this.cursors.children )
|
|
3249
3243
|
{
|
|
3250
|
-
deleteElement( this.selections[ cursor.name ] );
|
|
3244
|
+
LX.UTILS.deleteElement( this.selections[ cursor.name ] );
|
|
3251
3245
|
delete this.selections[ cursor.name ];
|
|
3252
3246
|
delete cursor.selection;
|
|
3253
3247
|
}
|
|
@@ -3436,9 +3430,9 @@ class CodeEditor {
|
|
|
3436
3430
|
|
|
3437
3431
|
removeCursor( cursor ) {
|
|
3438
3432
|
|
|
3439
|
-
deleteElement( this.selections[ cursor.name ] );
|
|
3433
|
+
LX.UTILS.deleteElement( this.selections[ cursor.name ] );
|
|
3440
3434
|
delete this.selections[ cursor.name ];
|
|
3441
|
-
deleteElement( cursor );
|
|
3435
|
+
LX.UTILS.deleteElement( cursor );
|
|
3442
3436
|
}
|
|
3443
3437
|
|
|
3444
3438
|
resetCursorPos( flag, cursor ) {
|
|
@@ -3725,7 +3719,7 @@ class CodeEditor {
|
|
|
3725
3719
|
text.innerText = char;
|
|
3726
3720
|
this.code.appendChild( line );
|
|
3727
3721
|
var rect = text.getBoundingClientRect();
|
|
3728
|
-
deleteElement( line );
|
|
3722
|
+
LX.UTILS.deleteElement( line );
|
|
3729
3723
|
const bb = [ use_floating ? rect.width : Math.floor( rect.width ), use_floating ? rect.height : Math.floor( rect.height ) ];
|
|
3730
3724
|
return get_bb ? bb : bb[ 0 ];
|
|
3731
3725
|
}
|
|
@@ -3988,7 +3982,7 @@ class CodeEditor {
|
|
|
3988
3982
|
|
|
3989
3983
|
else if( this._lastResult )
|
|
3990
3984
|
{
|
|
3991
|
-
deleteElement( this._lastResult.dom );
|
|
3985
|
+
LX.UTILS.deleteElement( this._lastResult.dom );
|
|
3992
3986
|
delete this._lastResult;
|
|
3993
3987
|
}
|
|
3994
3988
|
|
|
@@ -4011,7 +4005,7 @@ class CodeEditor {
|
|
|
4011
4005
|
|
|
4012
4006
|
if( this._lastResult )
|
|
4013
4007
|
{
|
|
4014
|
-
deleteElement( this._lastResult.dom );
|
|
4008
|
+
LX.UTILS.deleteElement( this._lastResult.dom );
|
|
4015
4009
|
cursorData = this._lastResult.pos;
|
|
4016
4010
|
delete this._lastResult;
|
|
4017
4011
|
}
|