lexgui 0.1.46 → 0.4.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.
@@ -34,9 +34,6 @@
34
34
 
35
35
  leftArea.root.style.borderRight = "2px solid gray";
36
36
  leftArea.addMenubar( m => {
37
- m.add( "Examples", () => {
38
- location.href = "../examples/";
39
- });
40
37
  m.add( "Docs v" + LX.version, (v, name) => {
41
38
  location.href = "../docs/";
42
39
  });
Binary file
@@ -18,7 +18,6 @@
18
18
  <script type="module">
19
19
 
20
20
  import { LX } from 'lexgui';
21
- import 'lexgui/components/codeeditor.js';
22
21
 
23
22
  // init library and get main area
24
23
  let area = LX.init();
@@ -34,17 +33,44 @@
34
33
  el.style.display = 'block';
35
34
  }
36
35
 
37
- area.addSidebar( m => {
38
- m.add( "Scene", { icon: "fa fa-cube", callback: () => { codeArea.hide(); show( canvas ); } } );
39
- m.add( "Code", { icon: "fa fa-code", callback: () => { hide( canvas ); codeArea.show(); } } );
40
-
41
- m.add( "Search", { icon: "fa fa-search", bottom: true, callback: () => { } } );
36
+ const logParams = (entryName, value, event) => { console.log(entryName, value, event) };
37
+ const actionLogParams = (entryName, event) => { console.log("Action called!", entryName, event) };
38
+
39
+ window.sidebar = area.addSidebar( m => {
40
+ m.group( "Projects", { icon: "fa fa-plus", callback: (groupName, event) => { console.log(groupName) }} );
41
+ m.add( "Getting Started", { icon: "fa fa-cube", callback: logParams } );
42
+ m.add( "Getting Started/Installation", { icon: "fa fa-cube", callback: logParams } );
43
+ m.add( "Getting Started/Project Structure", { icon: "fa fa-cube", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } } );
44
+ m.add( "Building Your Application", { icon: "fa fa-code", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } } );
45
+ m.add( "Search Blocks", { icon: "fa fa-search", callback: logParams } );
46
+ m.add( "Very loooooooooooooooooooooooong sun", { icon: "fa fa-sun",callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } } );
47
+ m.separator();
48
+ m.group( "API Reference" );
49
+ m.add( "Components", { icon: "fa fa-cube", callback: logParams } );
50
+ m.add( "File Conventions", { icon: "fa fa-code", callback: logParams } );
51
+ m.add( "Functions", { icon: "fa fa-search",callback: logParams } );
52
+ m.add( "CLI", { icon: "fa fa-sun",callback: logParams } );
53
+ m.separator();
54
+ m.group( "Architecture" );
55
+ m.add( "Accessibility ", { icon: "fa fa-cube", callback: logParams } );
56
+ m.add( "Fast Refresh", { icon: "fa fa-code", callback: logParams } );
57
+ m.add( "Supported Browsers", { icon: "fa fa-search",callback: logParams } );
58
+ m.separator();
59
+ m.add( "Calendar ", { collapsable: 3 } );
60
+ m.add( "Personal ", { callback: logParams, type: "checkbox" } );
61
+ m.add( "Work", { callback: logParams, type: "checkbox", value: true } );
62
+ m.add( "Family", { callback: logParams, type: "checkbox" } );
63
+ }, {
64
+ headerTitle: "jxarco",
65
+ headerSubtitle: "alexroco.30@gmail.com",
66
+ headerImage: "https://raw.githubusercontent.com/jxarco/lexgui.js/refs/heads/master/images/icon.png",
67
+ footerTitle: "jxarco",
68
+ footerSubtitle: "alexroco.30@gmail.com",
69
+ footerImage: "https://avatars.githubusercontent.com/u/25059187?s=400&u=ad8907b748c13e4e1a7cdd3882826acb6a2928b5&v=4",
70
+ onHeaderPressed: (e) => { console.log( "onHeaderPressed" ) },
71
+ onFooterPressed: (e) => { console.log( "onFooterPressed" ) }
42
72
  });
43
73
 
44
- let codeArea = new LX.Area( { width: "100%", height: "100%" } );
45
- let editor = new LX.CodeEditor( codeArea );
46
- editor.loadFile( "../data/js_sample.js" );
47
-
48
74
  // add canvas to left upper part
49
75
  var canvas = document.createElement('canvas');
50
76
  canvas.id = "mycanvas";
@@ -53,8 +79,14 @@
53
79
  canvas.style.width = "100%";
54
80
  canvas.style.height = "100%";
55
81
 
82
+ area = sidebar.siblingArea;
83
+
84
+ area.onresize = ( bounding ) => {
85
+ canvas.width = bounding.width;
86
+ canvas.height = bounding.height;
87
+ };;
88
+
56
89
  area.attach( canvas );
57
- area.attach( codeArea );
58
90
 
59
91
  function loop(dt) {
60
92
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lexgui",
3
- "version": "0.1.46",
3
+ "version": "0.4.0",
4
4
  "description": "JS library to create web graphical user interfaces",
5
5
  "type": "module",
6
6
  "main": "./build/lexgui.js",