lexgui 0.1.42 → 0.1.44

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/changelog.md CHANGED
@@ -1,10 +1,35 @@
1
1
  # lexgui.js changelog
2
2
 
3
- ## 0.1.43 (dev)
3
+ ## 0.1.45 (dev)
4
4
 
5
+ ## 0.1.44 (master)
5
6
 
7
+ VideoEditor:
8
+ - Support cropping video area.
6
9
 
7
- ## 0.1.42 (master)
10
+ Added new `Toggle` Widget (same usage as Checkbox).
11
+ Adding support for inline HTML badges `LX.badge(text)`.
12
+ Checkbox, Progressbar, FileInput css updated.
13
+ Improved Form widget.
14
+ Begin support for light-scheme appearance.
15
+ Fix ContextMenu position when scroll > 0.
16
+ Minor bug fixes.
17
+ Docs Updated.
18
+
19
+ ## 0.1.43
20
+
21
+ CodeEditor:
22
+ - Support C and CMake highlight.
23
+ - Support C/C++ header files highlighting.
24
+
25
+ Support `options.skipRoot` on LX.init.
26
+ Support lock aspect ratio in Panel.addSize
27
+ Improved CSS for overlay buttons `Area.addOverlayButtons`.
28
+ Docs Updated. Add interactive widget examples.
29
+ Minor CSS general changes.
30
+ Minor bug fixes.
31
+
32
+ ## 0.1.42
8
33
 
9
34
  AssetView:
10
35
  - Support custom element title on hover for Content layout mode `options.useNativeTitle`
package/demo.js CHANGED
@@ -81,12 +81,8 @@ area.addMenubar( m => {
81
81
 
82
82
  }, { size: ["30%", null], float: "right", draggable: false});
83
83
  }} );
84
- m.add( "Editor/Open AssetView", { icon: "fa-solid fa-rect", callback: () => {
85
- createAssetDialog();
86
- }} );
87
- m.add( "Help/Search Help", { icon: "fa-solid fa-magnifying-glass", short: "F1", callback: () => { window.open("./docs/") }});
88
- m.add( "Help/Support LexGUI/Please", { icon: "fa-solid fa-heart" } );
89
- m.add( "Help/Support LexGUI/Do it" );
84
+ m.add( "Editor/Open AssetView", { icon: "fa-solid fa-rect", callback: () => { createAssetDialog(); }} );
85
+ m.add( "Account/Login", { icon: "fa-solid fa-user", callback: () => { createLoginForm(); }} );
90
86
  m.add( "Timeline/Shortcuts", { disabled: true });
91
87
  m.add( "Timeline/Shortcuts/Play-Pause", { short: "SPACE" });
92
88
  m.add( "Timeline/Shortcuts/Zoom", { short: "Wheel" });
@@ -100,6 +96,9 @@ area.addMenubar( m => {
100
96
  m.add( "Timeline/Shortcuts/Key Selection/Single", { short: "Left Click" });
101
97
  m.add( "Timeline/Shortcuts/Key Selection/Multiple", { short: "Hold LSHIFT" });
102
98
  m.add( "Timeline/Shortcuts/Key Selection/Box", { short: "Hold LSHIFT+Drag" });
99
+ m.add( "Help/Search Help", { icon: "fa-solid fa-magnifying-glass", short: "F1", callback: () => { window.open("./docs/") }});
100
+ m.add( "Help/Support LexGUI/Please", { icon: "fa-solid fa-heart" } );
101
+ m.add( "Help/Support LexGUI/Do it" );
103
102
  m.addButtons( [
104
103
  {
105
104
  title: "Play",
@@ -129,6 +128,12 @@ area.addMenubar( m => {
129
128
  // split main area
130
129
  var [left, right] = area.split({ sizes:["80%","20%"], minimizable: true });
131
130
 
131
+ // left.addSidebar( m => {
132
+ // m.add( "Scene", { icon: "fa fa-cube", callback: () => { } } );
133
+ // m.add( "Code", { icon: "fa fa-code", callback: () => { } } );
134
+ // m.add( "Search", { icon: "fa fa-search", bottom: true, callback: () => { } } );
135
+ // });
136
+
132
137
  // split left area
133
138
  var [up, bottom] = left.split({ type: 'vertical', sizes:["50%", null], minimizable: true });
134
139
 
@@ -474,15 +479,19 @@ function fillPanel( panel ) {
474
479
 
475
480
  // add widgets to panel branch
476
481
  panel.branch("Preferences", {icon: "fa-solid fa-gear"});
477
- panel.addButton(null, "Click me, Im Full Width...");
482
+ panel.addButton(null, "Show Notifications" + LX.badge("+99", "accent sm"));
478
483
  panel.addText("Text", "Warning text", null, { warning: true });
479
- panel.sameLine(2);
480
- panel.addFile("Img1", data => { console.log(data) }, {} );
481
- panel.addFile("Img2", data => { console.log(data) }, {} );
484
+ panel.addCheckbox("Check me, Please", false, (value, event) => {
485
+ console.log(value);
486
+ }, { className: "secondary" });
487
+ panel.addToggle("Toggle me, Please", false, (value, event) => {
488
+ console.log(value);
489
+ }, { className: "accent" });
490
+ panel.addFile("I'm a File Input", data => { console.log(data) }, { disabled: true } );
482
491
  panel.addDropdown("Best Engine", ["Godot", "Unity", "Unreal Engine"], "Unity", (value, event) => {
483
492
  console.log(value);
484
493
  });
485
- panel.addDropdown("Best Logo", [{value:"Godot", src: "https://godotengine.org/assets/press/logo_vertical_color_light.webp"}, {value: "Unity", src: "https://logos-world.net/wp-content/uploads/2023/01/Unity-Logo.png"}, {value:"Unreal Engine", src: "https://cdn2.unrealengine.com/ue-logo-stacked-unreal-engine-w-677x545-fac11de0943f.png"}], "Godot", (value, event) => {
494
+ panel.addDropdown("Best Logo", [{value:"Godot", src: "https://godotengine.org/assets/press/logo_vertical_color_light.png"}, {value: "Unity", src: "https://logos-world.net/wp-content/uploads/2023/01/Unity-Logo.png"}, {value:"Unreal Engine", src: "https://cdn2.unrealengine.com/ue-logo-stacked-unreal-engine-w-677x545-fac11de0943f.png"}], "Godot", (value, event) => {
486
495
  console.log(value);
487
496
  }, {filter: true});
488
497
 
@@ -540,12 +549,7 @@ function fillPanel( panel ) {
540
549
  }, { padSize: "100px", min: -1, max: 2 });
541
550
  panel.addSize("Screen Res", [1280, 720], (value, event) => {
542
551
  console.log(value);
543
- }, { units: "p" });
544
-
545
- const formData = { username: "", password: { value: "", type: "password" } };
546
- panel.addForm("Test form", formData, (value, event) => {
547
- console.log(value);
548
- }, { actionName: "Login" });
552
+ }, { units: "p", precision: 0 });
549
553
 
550
554
  // another branch
551
555
  panel.branch("Canvas", {icon: "fa-solid fa-palette", filter: true});
@@ -625,7 +629,7 @@ function fillRightBottomPanel( panel, tab ) {
625
629
  panel.addNumber("HeadRoll Value", 0, (value, event) => {
626
630
  panel.setValue('HeadRoll', value);
627
631
  }, { min: -1, max: 1, step: 0.1 });
628
- panel.addProgress("HeadRoll", 0, { min: -1, max: 1, showValue: true, editable: true, callback: (value, event) => {
632
+ panel.addProgress("HeadRoll", 0, { min: -1, max: 1, low: -0.25, high: 0.25, optimum: 0.75, showValue: true, editable: true, callback: (value, event) => {
629
633
  panel.setValue('HeadRoll Value', value);
630
634
  } });
631
635
  }
@@ -665,24 +669,24 @@ function fillRightBottomPanel( panel, tab ) {
665
669
  /************** */
666
670
  // Custom Widget
667
671
 
668
- LX.ADD_CUSTOM_WIDGET( 'Shader', {
669
- // icon: "fa-dice-d6",
672
+ LX.ADD_CUSTOM_WIDGET( "Shader", {
673
+ icon: "fa-cube",
670
674
  default: {
671
- 'position': [0, 0],
672
- 'velocity': [0, 0, 0],
673
- 'color': [0, 0, 0, 0],
674
- 'hex_color': '#000',
675
- 'high_res': false
675
+ position: [0, 0],
676
+ velocity: [0, 0, 0],
677
+ color: [0, 0, 0, 0],
678
+ hexColor: "#000",
679
+ highRes: false
676
680
  }
677
681
  });
678
682
 
679
683
  const shaderInstance = {
680
- 'hex_color': '#f5f505',
681
- 'high_res': true
684
+ 'hexColor': "#f5f505",
685
+ 'highRes': true
682
686
  };
683
687
 
684
- panel.addShader( "PBR Shader", shaderInstance, (instance) => { console.log(instance) } );
685
- panel.addShader( "Empty", null );
688
+ panel.addShader( "A Shader", shaderInstance, (instance) => { console.log(instance) } );
689
+ panel.addShader( "Empty Instance", null );
686
690
 
687
691
  /************** */
688
692
  }
@@ -701,9 +705,9 @@ function fillBottomPanel( panel ) {
701
705
  panel.addTextArea("Notes", "", (value, event) => {
702
706
  console.log(value);
703
707
  }, { placeholder: 'Some notes...' });
704
- panel.addKnob("A Small Knob", 4, 0, 200, value => { console.log( value ) }, { size: 'sm', disabled: true });
708
+ panel.addKnob("A Small but disabled Knob", 4, 0, 200, value => { console.log( value ) }, { size: 'sm', disabled: true });
705
709
  panel.addKnob("A Knob", 4, 0, 200, value => { console.log( value ) } );
706
- panel.addKnob("A Big Knob", 4, 0, 200, value => { console.log( value ) }, { size: 'bg', snap: 4 });
710
+ panel.addKnob("A Big Knob with Snap", 4, 0, 200, value => { console.log( value ) }, { size: 'bg', snap: 4 });
707
711
  panel.addButton("Apply", "Add button to branch", (value, event) => {
708
712
  const branch = panel.getBranch("Information");
709
713
  panel.queue( branch.content );
@@ -716,6 +720,35 @@ function fillBottomPanel( panel ) {
716
720
  panel.merge();
717
721
  }
718
722
 
723
+ function createLoginForm() {
724
+
725
+ let dialog = new LX.Dialog('Login', panel => {
726
+
727
+ const formData = {
728
+ Username: {
729
+ value: "",
730
+ placeholder: "Enter username",
731
+ icon: "fa fa-user"
732
+ },
733
+ Password: {
734
+ value: "",
735
+ type: "password",
736
+ placeholder: "Enter password",
737
+ icon: "fa fa-key"
738
+ }
739
+ };
740
+
741
+ panel.addForm("Test form", formData, (value, event) => {
742
+ console.log(value);
743
+ }, { actionName: "Login" });
744
+
745
+ panel.addLabel( "Or", { float: 'center' } );
746
+
747
+ panel.addButton( null, "Sign up", ( value, event ) => { });
748
+
749
+ }, { close: true, minimize: false, size: ["25%"], scroll: true, resizable: true, draggable: true });
750
+ }
751
+
719
752
  function createAssetDialog() {
720
753
 
721
754
  let dialog = new LX.Dialog('Non Manual Features lexemes', (p) => {
@@ -782,7 +815,6 @@ function createAssetDialog() {
782
815
  }
783
816
  })
784
817
  },{ title:'Lexemes', close: true, minimize: false, size: ["80%"], scroll: true, resizable: true, draggable: true });
785
-
786
-
787
818
  }
788
- LX.popup("Hello! I'm a popup :)", null, {position: ["50px", "100px"]})
819
+
820
+ LX.popup("Hello! I'm a popup :)", null, {position: ["50px", "100px"]});
@@ -160,7 +160,7 @@
160
160
  const area = new LX.Area();
161
161
  p.attach( area );
162
162
  let editor = new LX.CodeEditor(area, {
163
- allow_add_scripts: false
163
+ allowAddScripts: false
164
164
  });
165
165
  editor.loadFile( event.item.src );
166
166
  }, { size: ["40%", "600px"], closable: true });
@@ -56,10 +56,13 @@
56
56
  editor.loadFile( "../data/json_sample.json" );
57
57
  editor.loadFile( "../data/css_sample.css" );
58
58
  editor.loadFile( "../data/cpp_sample.cpp" );
59
+ editor.loadFile( "../data/cpp_header_sample.hpp" );
60
+ editor.loadFile( "../data/c_sample.c" );
59
61
  editor.loadFile( "../data/xml_sample.xml" );
60
62
  editor.loadFile( "../data/python_sample.py" );
61
63
  editor.loadFile( "../data/rust_sample.rs" );
62
64
  editor.loadFile( "../data/animation.bml", { language: "JSON" } );
65
+ editor.loadFile( "../data/CMakeLists.txt", { language: "CMake" } );
63
66
  editor.loadFile( "../localhost.bat" );
64
67
  editor.loadFile( "../index.html" );
65
68
 
Binary file
Binary file
@@ -60,12 +60,12 @@
60
60
 
61
61
  var ctx = canvas.getContext("2d");
62
62
 
63
- ctx.fillStyle = "#def698";
63
+ ctx.fillStyle = "#b7a9b1";
64
64
 
65
65
  ctx.fillRect(0, 0, canvas.width, canvas.height);
66
66
  ctx.font = "44px Monospace";
67
67
 
68
- ctx.fillStyle = "#f13523";
68
+ ctx.fillStyle = "#ff1999";
69
69
 
70
70
  const text = "lexgui @jxarco";
71
71
  const pos2D = [200, 200];
@@ -31,7 +31,7 @@
31
31
  video.src = "../data/video.mp4";
32
32
  videoArea.attach(video);
33
33
 
34
- const videoEditor = new LX.VideoEditor(leftArea, {videoArea, video})
34
+ const videoEditor = new LX.VideoEditor(leftArea, {videoArea, video, crop: true})
35
35
 
36
36
  const canvas = document.createElement('canvas');
37
37
  canvas.width = video.clientWidth;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lexgui",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "description": "JS library to create web graphical user interfaces",
5
5
  "type": "module",
6
6
  "main": "./build/lexgui.js",