lexgui 0.5.11 → 0.6.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.
@@ -23,18 +23,18 @@
23
23
  import { LX } from 'lexgui';
24
24
 
25
25
  // Init library and get main area
26
- let area = LX.init();
26
+ let area = await LX.init();
27
27
 
28
28
  // Split main area
29
29
  let [leftArea, rightArea] = area.split({ sizes: ["20%","80%"], resize: false });
30
30
 
31
31
  leftArea.root.style.borderRight = "2px solid gray";
32
- leftArea.addMenubar( m => {
33
- m.add( "Docs v" + LX.version, (v, name) => {
34
- location.href = "../docs/";
35
- });
36
- m.setButtonIcon("Github", "fa-brands fa-github", () => {window.open("https://github.com/jxarco/lexgui.js/")}, { float: "left" });
37
- });
32
+
33
+ const menubar = leftArea.addMenubar( [
34
+ { name: "Docs v" + LX.version, callback: (v, name) => { location.href = "../docs/"; } }
35
+ ] );
36
+
37
+ menubar.setButtonIcon("Github", "Github", () => {window.open("https://github.com/jxarco/lexgui.js/")}, { float: "left" });
38
38
 
39
39
  const examples = [
40
40
  'All Widgets',
@@ -61,7 +61,7 @@
61
61
  rightArea.addOverlayButtons([
62
62
  {
63
63
  name: "View Source Code",
64
- icon: "fa fa-code",
64
+ icon: "Code",
65
65
  callback: (value, event) => {
66
66
  const tokens = iframe.src.split('/');
67
67
  window.open("https://github.com/jxarco/lexgui.js/blob/master/examples/" + tokens[tokens.length - 1], '_blank')
@@ -23,7 +23,7 @@
23
23
  import 'lexgui/components/nodegraph.js';
24
24
 
25
25
  // init library and get main area
26
- let area = LX.init();
26
+ let area = await LX.init();
27
27
 
28
28
  // split main area
29
29
  var [topArea, bottomArea] = area.split({ type: 'vertical', sizes: ["25%", "75%"] });
@@ -22,7 +22,7 @@
22
22
  import { LX } from 'lexgui';
23
23
 
24
24
  // init library and get main area
25
- let area = LX.init();
25
+ let area = await LX.init();
26
26
 
27
27
  area.root.style.width = "100%";
28
28
  area.root.style.height = "100%";
@@ -39,24 +39,24 @@
39
39
  const actionLogParams = (entryName, event) => { console.log("Action called!", entryName, event) };
40
40
 
41
41
  window.sidebar = area.addSidebar(m => {
42
- m.group("Projects", { icon: "fa fa-plus", callback: (groupName, event) => { console.log(groupName) } });
43
- m.add("Getting Started", { icon: "fa fa-cube", callback: logParams });
44
- m.add("Getting Started/Installation", { icon: "fa fa-cube", callback: logParams });
45
- m.add("Getting Started/Project Structure", { icon: "fa fa-cube", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } });
46
- m.add("Building Your Application", { icon: "fa fa-code", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } });
47
- m.add("Search Blocks", { icon: "fa fa-search", callback: logParams });
48
- m.add("Very loooooooooooooooooooooooong sun", { icon: "fa fa-sun", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } });
42
+ m.group("Projects", { icon: "Plus", callback: (groupName, event) => { console.log(groupName) } });
43
+ m.add("Getting Started", { icon: "Box", callback: logParams });
44
+ m.add("Getting Started/Installation", { icon: "Box", callback: logParams });
45
+ m.add("Getting Started/Project Structure", { icon: "Box", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } });
46
+ m.add("Building Your Application", { icon: "Code", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } });
47
+ m.add("Search Blocks", { icon: "Search", callback: logParams });
48
+ m.add("Very loooooooooooooooooooooooong sun", { icon: "Sun", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } });
49
49
  m.separator();
50
50
  m.group("API Reference");
51
- m.add("Components", { icon: "fa fa-cube", callback: logParams });
52
- m.add("File Conventions", { icon: "fa fa-code", callback: logParams });
53
- m.add("Functions", { icon: "fa fa-search", callback: logParams });
54
- m.add("CLI", { icon: "fa fa-sun", callback: logParams });
51
+ m.add("Components", { icon: "Box", callback: logParams });
52
+ m.add("File Conventions", { icon: "Code", callback: logParams });
53
+ m.add("Functions", { icon: "Search", callback: logParams });
54
+ m.add("CLI", { icon: "Sun", callback: logParams });
55
55
  m.separator();
56
56
  m.group("Architecture");
57
- m.add("Accessibility ", { icon: "fa fa-cube", callback: logParams });
58
- m.add("Fast Refresh", { icon: "fa fa-code", callback: logParams });
59
- m.add("Supported Browsers", { icon: "fa fa-search", callback: logParams });
57
+ m.add("Accessibility ", { icon: "Box", callback: logParams });
58
+ m.add("Fast Refresh", { icon: "Code", callback: logParams });
59
+ m.add("Supported Browsers", { icon: "Search", callback: logParams });
60
60
  m.separator();
61
61
  m.add("Calendar ", { collapsable: 3 });
62
62
  m.add("Personal ", { callback: logParams, type: "checkbox" });
@@ -21,7 +21,7 @@
21
21
  import { Timeline, KeyFramesTimeline, ClipsTimeline, CurvesTimeline } from 'lexgui/components/timeline.js';
22
22
 
23
23
  // init library and get main area
24
- let area = LX.init();
24
+ let area = await LX.init();
25
25
 
26
26
  // split main area
27
27
  var [leftArea, rightArea] = area.split({sizes:["75%","25%"]});
@@ -92,7 +92,7 @@
92
92
 
93
93
  if(mode == types.KEYFRAMES) {
94
94
  let ctx = canvas.getContext("2d");
95
- ctx.fillStyle = LX.getThemeColor("global-selected-light");
95
+ ctx.fillStyle = LX.getThemeColor("global-color-accent");
96
96
  ctx.fillRect(0, 0, canvas.width, canvas.height);
97
97
  ctx.font = panel.getValue('Font Size') + "px Monospace";
98
98
  ctx.fillStyle = panel.getValue('Font Color');
@@ -112,10 +112,10 @@
112
112
 
113
113
  function fillPanel( panel ) {
114
114
  panel.clear();
115
- panel.branch("Canvas", {icon: "fa-solid fa-palette", filter: true});
116
- panel.addColor("Background", LX.getThemeColor("global-selected-light"));
115
+ panel.branch("Canvas", {icon: "Palette", filter: true});
116
+ panel.addColor("Background", LX.getThemeColor("global-color-accent"));
117
117
  panel.addText("Track", trackName, null)
118
- panel.addText("Text", "Lexgui.js @evallsg", null, {placeholder: "e.g. ColorPicker", icon: "fa fa-font"});
118
+ panel.addText("Text", "Lexgui.js @evallsg", null, {placeholder: "e.g. ColorPicker", icon: "Type"});
119
119
  panel.addColor("Font Color", { r: 1, g: 0.1, b: 0.6 }, (value, event) => {
120
120
  console.log("Font Color: ", value);
121
121
  });
@@ -147,7 +147,7 @@
147
147
  return;
148
148
  }
149
149
 
150
- panel.branch(clip.name || "Clip", {icon: "fa-solid fa-clip", filter: true});
150
+ panel.branch(clip.name || "Clip", {filter: true});
151
151
  panel.addNumber("Start", clip.start, (v) => {
152
152
  const diff = v - clip.start;
153
153
  clip.start = v;
@@ -191,12 +191,12 @@
191
191
  panel.addSelect("Animation", ["Anim 1", "Anim 2", "Anim 3"], "Anim 1", ()=> {})
192
192
  },
193
193
  onAfterCreateTopBar: (panel) => {
194
- panel.addButton("autoKeyEnabled", "autoKeyEnable", null, { icon: 'fa fa-wand-magic-sparkles', hideName: true });
195
- panel.addButton("unselectAll", "unselectAll", (value, event) => { kfTimeline.unSelectAllKeyFrames();}, { icon: 'fa-regular fa-rectangle-xmark', hideName: true, callback: (value, event) => { kfTimeline.unSelectAllKeyFrames();} });
194
+ panel.addButton("autoKeyEnabled", "autoKeyEnable", null, { icon: 'WandSparkles', hideName: true });
195
+ panel.addButton("unselectAll", "unselectAll", (value, event) => { kfTimeline.unSelectAllKeyFrames();}, { icon: 'X', hideName: true, callback: (value, event) => { kfTimeline.unSelectAllKeyFrames();} });
196
196
  }
197
197
  });
198
198
 
199
- keyframesPanel.attach(kfTimeline.root);
199
+ keyframesPanel.attach(kfTimeline.mainArea);
200
200
  kfTimeline.setAnimationClip({tracks: [{name: "Font.position", values: [250, 450, 250, 250, 250, 450], times: [0, 0.5, 1.0]}, {name: "Item 1.scale", values: [0,1,0, 0.5], times: [0, 0.1, 0.2, 0.3]}, {name: "Item 2", values: [0,1,0,1], times: [0.1]}, {name: "Item 3.position", values: [0,1,0,0,0,0], times: [0.1, 0.2, 0.3]}, {name: "Item 3.scale", values: [0,1,0], times: [ 0.1, 0.2, 0.3]}], duration: 1});
201
201
  kfTimeline.setSelectedItems(["Font", "Item 2", "Item 3"]);
202
202
  activeTimeline = kfTimeline;
@@ -22,7 +22,7 @@
22
22
  import { LX } from 'lexgui';
23
23
  import { VideoEditor } from 'lexgui/components/videoeditor.js';
24
24
  // init library and get main area
25
- let area = LX.init();
25
+ let area = await LX.init();
26
26
 
27
27
  // split main area
28
28
  let [leftArea, rightArea] = area.split({ sizes: ["75%", "25%"], minimizable: true });
@@ -23,10 +23,9 @@
23
23
  import { VideoEditor } from 'lexgui/components/videoeditor.js';
24
24
 
25
25
  // Init library and get main area
26
- let area = LX.init();
27
- const menubar = area.addMenubar(m => {
28
- m.setButtonImage("Page", "../data/godot_pixelart.png", null, { float: "left" });
29
- });
26
+ let area = await LX.init();
27
+ const menubar = area.addMenubar();
28
+ menubar.setButtonImage("Page", "../data/godot_pixelart.png", null, { float: "left" });
30
29
 
31
30
  // Split main area
32
31
  let [leftArea, rightArea] = area.split({ sizes: ["75%", "25%"], minimizable: true });
@@ -69,7 +68,7 @@
69
68
  videoArea.addOverlayButtons([{
70
69
  selectable: true,
71
70
  selected: true,
72
- icon: "fa-solid fa-info",
71
+ icon: "Info",
73
72
  name: "Properties",
74
73
  callback: (v, e) => {
75
74
  if (area.split_extended) {
@@ -87,7 +86,7 @@
87
86
 
88
87
  videoArea.sections[1].root.resize(["20%", "20%"])
89
88
  }, { width: "100px" })
90
- p.addButton(null, null, (v) => { }, { width: "40px", icon: "fa-solid fa-rotate-left" })
89
+ p.addButton(null, null, (v) => { }, { width: "40px", icon: "RotateLeft" })
91
90
 
92
91
  /* Create right panel */
93
92
  let panel = new LX.Panel({ id: "Properties" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lexgui",
3
- "version": "0.5.11",
3
+ "version": "0.6.0",
4
4
  "description": "JS library to create web graphical user interfaces",
5
5
  "type": "module",
6
6
  "main": "./build/lexgui.js",