lexgui 0.1.16 → 0.1.18

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/lexgui.css CHANGED
@@ -9,7 +9,7 @@
9
9
  --global-color-primary: #232323;
10
10
  --global-color-secondary: #343434;
11
11
  --global-color-terciary: #444;
12
- --global-branch-darker: #28282a;
12
+ --global-branch-darker: #252525;
13
13
  --branch-title-background: #2e3338;
14
14
  --branch-title-inactive-background: #42484e;
15
15
  --global-button-color: #4e4e4e;
@@ -21,6 +21,9 @@
21
21
  --transition-time: 1000;
22
22
  }
23
23
 
24
+ /* Some global colors */
25
+ .orange { color: orange }
26
+
24
27
  ::-webkit-scrollbar {
25
28
  height: 3px;
26
29
  width: 4px;
@@ -2002,6 +2005,7 @@ meter::-webkit-meter-even-less-good-value {
2002
2005
  -ms-user-select: none; /* IE 10+ */
2003
2006
  user-select: none; /* Standard syntax */
2004
2007
  transition: 0.2s;
2008
+ line-height: 16px;
2005
2009
  }
2006
2010
 
2007
2011
  .lexareatabs.row {
@@ -2692,6 +2696,19 @@ ul.lexassetscontent {
2692
2696
  padding: 0px;
2693
2697
  }
2694
2698
 
2699
+ .codebasearea .lexareatab i {
2700
+ font-size: 10px;
2701
+ margin-right: 4px;
2702
+ vertical-align: middle;
2703
+ }
2704
+
2705
+ .codebasearea .lexareatab img {
2706
+ width: 12px;
2707
+ height: 12px;
2708
+ margin-right: 4px;
2709
+ vertical-align: middle;
2710
+ }
2711
+
2695
2712
  .lexcodeeditor ::-webkit-scrollbar {
2696
2713
  width: 6px;
2697
2714
  height: 6px;
@@ -2729,40 +2746,26 @@ ul.lexassetscontent {
2729
2746
  }
2730
2747
 
2731
2748
  .lexcodegutter {
2732
- width: 32px;
2733
- height: calc(100% - 70px);
2749
+ width: 48px;
2750
+ height: calc(100% - 62px);
2734
2751
  background-color: var(--global-branch-darker);
2735
- margin-top: 24px;
2736
- text-align: center;
2752
+ margin-top: 26px;
2737
2753
  overflow: hidden;
2738
- -webkit-user-select: none; /* Safari 3.1+ */
2739
- -moz-user-select: none; /* Firefox 2+ */
2740
- -ms-user-select: none; /* IE 10+ */
2741
- user-select: none; /* Standard syntax */
2742
- font-family: 'Inconsolata', monospace;
2743
- }
2744
-
2745
- .lexcodegutter span {
2746
- width: 100%;
2747
- display: block;
2748
- height: 16px;
2749
- margin-top: 4px;
2750
- font-size: 13px;
2751
- color: #888;
2752
- text-align-last: auto;
2753
- line-height: 22px;
2754
+ position: absolute;
2754
2755
  }
2755
2756
 
2756
2757
  .lexcodeeditor .codetabsarea {
2758
+ height: calc( 100% - 60px ) !important;
2757
2759
  background-color: var(--global-branch-darker);
2760
+ overflow: scroll;
2758
2761
  }
2759
2762
 
2760
- .lexcodeeditor .codetabsarea.with-vscrollbar {
2761
- width: calc( 100% - 10px ) !important;
2763
+ .lexcodeeditor .codetabsarea::-webkit-scrollbar {
2764
+ display: none;
2762
2765
  }
2763
2766
 
2764
- .lexcodeeditor .codetabsarea.with-hscrollbar {
2765
- height: calc( 100% - 40px ) !important;
2767
+ .lexcodeeditor .codetabsarea.with-vscrollbar {
2768
+ width: calc( 100% - 10px ) !important;
2766
2769
  }
2767
2770
 
2768
2771
  .lexcodeeditor .codetabsarea.dragging {
@@ -2772,8 +2775,8 @@ ul.lexassetscontent {
2772
2775
  .lexcodeeditor .code {
2773
2776
  cursor: text;
2774
2777
  font-size: 16px;
2775
- overflow: hidden;
2776
2778
  padding-right: 6px;
2779
+ position: relative;
2777
2780
  }
2778
2781
 
2779
2782
  .codechar {
@@ -2790,14 +2793,13 @@ ul.lexassetscontent {
2790
2793
  -webkit-text-size-adjust: 100%;
2791
2794
  cursor: text;
2792
2795
  box-sizing: border-box;
2793
- padding: 0 4px;
2794
2796
  border-radius: 0;
2795
2797
  border-width: 0;
2796
2798
  background: transparent;
2797
2799
  font-family: 'Inconsolata', monospace;
2798
2800
  font-size: inherit;
2799
2801
  font-weight: bold;
2800
- margin: 4px 0px;
2802
+ margin: 0px 0px;
2801
2803
  white-space: pre;
2802
2804
  word-wrap: normal;
2803
2805
  line-height: inherit;
@@ -2805,9 +2807,12 @@ ul.lexassetscontent {
2805
2807
  position: relative;
2806
2808
  overflow: visible;
2807
2809
  -webkit-tap-highlight-color: transparent;
2808
- z-index: 0 !important;
2810
+ height: 20px;
2809
2811
  pointer-events: none;
2810
- height: 16px;
2812
+ }
2813
+
2814
+ .lexcodeeditor pre.active-line {
2815
+ background-color: var(--global-blur-background);
2811
2816
  }
2812
2817
 
2813
2818
  .lexcodeeditor span {
@@ -2822,7 +2827,22 @@ ul.lexassetscontent {
2822
2827
  box-sizing: border-box;
2823
2828
  display: inline-block;
2824
2829
  height: 16px;
2825
- vertical-align: top;
2830
+ }
2831
+
2832
+ pre .line-gutter {
2833
+ color: #888;
2834
+ width: 48px;
2835
+ height: 20px;
2836
+ font-size: 14px;
2837
+ line-height: 20px;
2838
+ text-align: center;
2839
+ -webkit-user-select: none; /* Safari 3.1+ */
2840
+ -moz-user-select: none; /* Firefox 2+ */
2841
+ -ms-user-select: none; /* IE 10+ */
2842
+ user-select: none; /* Standard syntax */
2843
+ position: sticky;
2844
+ left: 0;
2845
+ z-index: 1;
2826
2846
  }
2827
2847
 
2828
2848
  .lexcodeeditor .cursors, .lexcodeeditor .selections {
@@ -2836,7 +2856,6 @@ ul.lexassetscontent {
2836
2856
  margin: 0;
2837
2857
  padding: 0;
2838
2858
  position: relative;
2839
- z-index: 3;
2840
2859
  pointer-events: none;
2841
2860
  }
2842
2861
 
@@ -2860,35 +2879,28 @@ ul.lexassetscontent {
2860
2879
  z-index: 0 !important;
2861
2880
  left: 0px;
2862
2881
  top: 0px;
2863
- height: 18px;
2882
+ height: 20px;
2864
2883
  }
2865
2884
 
2866
2885
  .lexcodescrollbar {
2886
+ width: 10px;
2887
+ height: calc(100% - 62px);
2867
2888
  position: absolute;
2868
- background-color: var(--global-branch-darker);
2869
- filter: brightness(0.9);
2889
+ background-color: transparent;
2870
2890
  box-sizing: border-box;
2871
2891
  margin: 0;
2872
2892
  padding: 0;
2873
2893
  margin-top: 26px;
2874
2894
  z-index: 1 !important;
2875
2895
  right: 0px;
2876
- width: 10px;
2877
- height: calc(100% - 62px);
2896
+ pointer-events: none;
2878
2897
  }
2879
2898
 
2880
2899
  .lexcodescrollbar.horizontal {
2881
- position: absolute;
2882
- background-color: var(--global-branch-darker);
2883
- filter: brightness(0.9);
2884
- box-sizing: border-box;
2885
- margin: 0;
2886
- padding: 0;
2887
- z-index: 1 !important;
2900
+ width: calc( 100% - 58px );
2901
+ height: 10px;
2888
2902
  bottom: 36px;
2889
2903
  right: 10px;
2890
- width: calc( 100% - 40px );
2891
- height: 10px;
2892
2904
  }
2893
2905
 
2894
2906
  .lexcodescrollbar.scrollbar-unused {
@@ -2896,7 +2908,7 @@ ul.lexassetscontent {
2896
2908
  }
2897
2909
 
2898
2910
  .lexcodescrollbar div { /* thumb */
2899
- background-color: #bbbbbb57 !important;
2911
+ background-color: #bbbbbb3d !important;
2900
2912
  box-sizing: border-box;
2901
2913
  margin: 0;
2902
2914
  padding: 0;
@@ -2907,6 +2919,7 @@ ul.lexassetscontent {
2907
2919
  width: 10px;
2908
2920
  height: 10px;
2909
2921
  transition: linear 0.1s background-color;
2922
+ pointer-events: all;
2910
2923
  }
2911
2924
 
2912
2925
  .lexcodescrollbar div:hover { /* thumb */
@@ -2962,7 +2975,7 @@ ul.lexassetscontent {
2962
2975
  margin: 0;
2963
2976
  pointer-events: unset;
2964
2977
  cursor: default;
2965
- height: 18px;
2978
+ height: 22px;
2966
2979
  }
2967
2980
 
2968
2981
  .lexcodeeditor .autocomplete pre a {
@@ -3074,9 +3087,10 @@ ul.lexassetscontent {
3074
3087
  .cm-sym.batch { color: #dfd85e; } /* symbol */
3075
3088
  .cm-mtd.batch { color: inherit } /* method */
3076
3089
 
3077
- /* plain color */
3078
- .cm-str.plaintext, .cm-kwd.plaintext, .cm-com.plaintext, .cm-typ.plaintext, .cm-std.plaintext,
3079
- .cm-bln.plaintext, .cm-dec.plaintext, .cm-sym.plaintext, .cm-mtd.plaintext { color: inherit; }
3090
+ .cm-str.html { color: #ca7d59; } /* string */
3091
+ .cm-kwd.html { color: #2194ce; } /* keyword */
3092
+ .cm-bln.html { color: #b4d7ec; } /* builtin */
3093
+ .cm-sym.html { color: #929292; } /* symbol */
3080
3094
 
3081
3095
 
3082
3096
  /* Node Graph */
package/build/lexgui.js CHANGED
@@ -12,7 +12,7 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
12
12
  */
13
13
 
14
14
  var LX = global.LX = {
15
- version: "0.1.16",
15
+ version: "0.1.18",
16
16
  ready: false,
17
17
  components: [], // specific pre-build components
18
18
  signals: {} // events and triggers
@@ -1541,11 +1541,23 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
1541
1541
  contentEl.style.display = isSelected ? "block" : "none";
1542
1542
  contentEl.classList.add("lextabcontent");
1543
1543
 
1544
+ // Process icon
1545
+ if( options.icon )
1546
+ {
1547
+ if( options.icon.includes( 'fa-' ) ) // It's fontawesome icon...
1548
+ options.icon = "<i class='" + options.icon + "'></i>";
1549
+ else // an image..
1550
+ {
1551
+ const rootPath = "https://raw.githubusercontent.com/jxarco/lexgui.js/master/";
1552
+ options.icon = "<img src='" + ( rootPath + options.icon ) + "'>";
1553
+ }
1554
+ }
1555
+
1544
1556
  // Create tab
1545
1557
  let tabEl = document.createElement('span');
1546
1558
  tabEl.dataset["name"] = name;
1547
1559
  tabEl.className = "lexareatab" + (isSelected ? " selected" : "");
1548
- tabEl.innerHTML = name;
1560
+ tabEl.innerHTML = (options.icon ?? "") + name;
1549
1561
  tabEl.id = name.replace(/\s/g, '') + Tabs.TAB_ID++;
1550
1562
  tabEl.title = options.title;
1551
1563
  tabEl.selected = isSelected ?? false;
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  var LX = {
11
- version: "0.1.16",
11
+ version: "0.1.18",
12
12
  ready: false,
13
13
  components: [], // specific pre-build components
14
14
  signals: {} // events and triggers
@@ -1537,11 +1537,23 @@ class Tabs {
1537
1537
  contentEl.style.display = isSelected ? "block" : "none";
1538
1538
  contentEl.classList.add("lextabcontent");
1539
1539
 
1540
+ // Process icon
1541
+ if( options.icon )
1542
+ {
1543
+ if( options.icon.includes( 'fa-' ) ) // It's fontawesome icon...
1544
+ options.icon = "<i class='" + options.icon + "'></i>";
1545
+ else // an image..
1546
+ {
1547
+ const rootPath = "https://raw.githubusercontent.com/jxarco/lexgui.js/master/";
1548
+ options.icon = "<img src='" + ( rootPath + options.icon ) + "'>";
1549
+ }
1550
+ }
1551
+
1540
1552
  // Create tab
1541
1553
  let tabEl = document.createElement('span');
1542
1554
  tabEl.dataset["name"] = name;
1543
1555
  tabEl.className = "lexareatab" + (isSelected ? " selected" : "");
1544
- tabEl.innerHTML = name;
1556
+ tabEl.innerHTML = (options.icon ?? "") + name;
1545
1557
  tabEl.id = name.replace(/\s/g, '') + Tabs.TAB_ID++;
1546
1558
  tabEl.title = options.title;
1547
1559
  tabEl.selected = isSelected ?? false;
package/demo.js CHANGED
@@ -487,7 +487,7 @@ function fillPanel( panel ) {
487
487
  panel.sameLine(2);
488
488
  panel.addFile("Img1", data => { console.log(data) }, {} );
489
489
  panel.addFile("Img2", data => { console.log(data) }, {} );
490
- panel.addDropdown("Best Engine", ["Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot","Godot", "Unity", "Unreal Engine"], "Unity", (value, event) => {
490
+ panel.addDropdown("Best Engine", ["Godot", "Unity", "Unreal Engine"], "Unity", (value, event) => {
491
491
  console.log(value);
492
492
  });
493
493
 
@@ -47,20 +47,8 @@
47
47
  // disable_edition: true
48
48
  });
49
49
 
50
- // editor.loadFile( "../data/test.json" );
51
- // editor.loadFile( "../data/style.css" );
52
- // editor.loadFile( "../data/script.js" );
53
- // editor.loadFile( "../data/engine.cpp" );
54
50
  editor.loadFile( "../demo.js" );
55
51
 
56
- // var button = document.createElement('button');
57
- // button.value = "CLICK ME";
58
- // button.style.width = "100px";
59
- // button.style.height = "100px";
60
- // button.style.position = "absolute";
61
- // button.onclick = editor.processLines.bind(editor);
62
- // document.body.appendChild( button );
63
-
64
52
  var ctx = canvas.getContext("2d");
65
53
  ctx.fillStyle = "#b7a9b1";
66
54
  ctx.font = "48px Monospace";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lexgui",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "JS library to create web graphical user interfaces",
5
5
  "type": "module",
6
6
  "main": "./build/lexgui.js",