lexgui 0.5.11 → 0.6.1
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/README.md +1 -1
- package/build/components/codeeditor.js +89 -40
- package/build/components/nodegraph.js +32 -23
- package/build/components/timeline.js +5 -5
- package/build/components/videoeditor.js +1 -1
- package/build/lexgui.css +185 -395
- package/build/lexgui.js +966 -1030
- package/build/lexgui.min.css +1 -1
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +966 -1030
- package/build/lexgui.module.min.js +1 -1
- package/changelog.md +41 -1
- package/demo.js +103 -88
- package/examples/all_widgets.html +37 -38
- package/examples/area_tabs.html +5 -5
- package/examples/asset_view.html +1 -1
- package/examples/code_editor.html +1 -1
- package/examples/dialogs.html +4 -4
- package/examples/immediate_ui.html +1 -1
- package/examples/index.html +8 -8
- package/examples/node_graph.html +1 -1
- package/examples/side_bar.html +15 -15
- package/examples/timeline.html +9 -9
- package/examples/video_editor.html +1 -1
- package/examples/video_editor2.html +5 -6
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -2,7 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
## dev
|
|
4
4
|
|
|
5
|
-
## 0.
|
|
5
|
+
## 0.6.1 (master)
|
|
6
|
+
|
|
7
|
+
Widgets:
|
|
8
|
+
- Support back `options.selected` in ComboButtons Widget as `ValueType|Array<ValueType>`.
|
|
9
|
+
- Fixed Drag icon in Number/Vector widgets modifying layout.
|
|
10
|
+
|
|
11
|
+
Fixed some issues when resizing initially hidden Areas.
|
|
12
|
+
Fixed Dropdown issue sometimes opening all submenus on open Menubar entries.
|
|
13
|
+
Fixed Dropdown creation crash when no input items.
|
|
14
|
+
Fixed AssetView content on max height and scroll.
|
|
15
|
+
Improved robustness of `LX.getSupportedDOMName`.
|
|
16
|
+
|
|
17
|
+
## 0.6.0
|
|
18
|
+
|
|
19
|
+
`LX.init` now has to called using `await`.
|
|
20
|
+
Use Dropdowns elements in menubar.
|
|
21
|
+
Remove legacy:
|
|
22
|
+
- Removed `options.selected` in ComboButtons Widget.
|
|
23
|
+
- Removed FA icons.
|
|
24
|
+
Added LucideIcons as main icon provider.
|
|
25
|
+
`LX.makeIcon`: Support for solid variants in supported icons (also using `iconName@variant`).
|
|
26
|
+
`LX.registerIcon`: Support for classes and attributes for svg and path elements.
|
|
27
|
+
Refactor `strictViewport` to `layoutMode` (app|document) in `LX.init`.
|
|
28
|
+
Added support for Sheet element (hiding dialog at the window sides).
|
|
29
|
+
Support disabling layer (zindex) update in `LX.makeDraggable` using `options.updateLayers`.
|
|
30
|
+
Fixed minor issues with some Nodegraph elements.
|
|
31
|
+
Added `className` to `LX.sameLine(numberOfWidgets, class)` to allow customization when using `numberOfWidgets`.
|
|
32
|
+
Added support for right sidebar.
|
|
33
|
+
Restyled Number Widget units to avoid layout trashing when recomputing units span location.
|
|
34
|
+
|
|
35
|
+
CodeEditor:
|
|
36
|
+
- Remove language images and use SVG instead.
|
|
37
|
+
- Scrolling fixes.
|
|
38
|
+
- Fixed minor css issues.
|
|
39
|
+
|
|
40
|
+
Docs updated:
|
|
41
|
+
- Added interactive code examples for widgets.
|
|
42
|
+
- Improved widget list parameters and options.
|
|
43
|
+
- Added live examples for sidebar and menubar.
|
|
44
|
+
|
|
45
|
+
## 0.5.11
|
|
6
46
|
|
|
7
47
|
Widgets:
|
|
8
48
|
- Form: Add more custom options. Fixed issue using a String as Form field.
|
package/demo.js
CHANGED
|
@@ -5,39 +5,39 @@ import 'lexgui/components/audio.js';
|
|
|
5
5
|
|
|
6
6
|
window.LX = LX;
|
|
7
7
|
|
|
8
|
-
const area = LX.init( {
|
|
8
|
+
const area = await LX.init( { layoutMode: "document", rootClass: "wrapper" } );
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
// Menubar
|
|
11
12
|
{
|
|
12
|
-
area.addMenubar(
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const menubar = area.addMenubar( [
|
|
14
|
+
{ name: "Docs", icon: "search", kbd: "F1", callback: () => { window.open("./docs/") } }
|
|
15
|
+
] );
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
menubar.setButtonImage("lexgui.js", "images/icon.png", () => {window.open("https://jxarco.github.io/lexgui.js/")}, {float: "left"})
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const commandButton = new LX.Button(null, "Search command...", () => { LX.setCommandbarState( true ) }, {
|
|
20
|
+
width: "256px", className: "right", buttonClass: "border left fg-tertiary bg-secondary" }
|
|
21
|
+
);
|
|
22
|
+
menubar.root.appendChild( commandButton.root );
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
const starterTheme = LX.getTheme();
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
title: "Switch Theme",
|
|
35
|
-
icon: starterTheme == "dark" ? "fa-solid fa-moon" : "fa-solid fa-sun",
|
|
36
|
-
swap: starterTheme == "dark" ? "fa-solid fa-sun" : "fa-solid fa-moon",
|
|
37
|
-
callback: (value, event) => { LX.switchTheme() }
|
|
26
|
+
menubar.addButtons( [
|
|
27
|
+
{
|
|
28
|
+
title: "Github",
|
|
29
|
+
icon: "Github@solid",
|
|
30
|
+
callback: (event) => {
|
|
31
|
+
window.open( "https://github.com/jxarco/lexgui.js/", "_blank" );
|
|
38
32
|
}
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: "Switch Theme",
|
|
36
|
+
icon: starterTheme == "dark" ? "Moon" : "Sun",
|
|
37
|
+
swap: starterTheme == "dark" ? "Sun" : "Moon",
|
|
38
|
+
callback: (value, event) => { LX.switchTheme() }
|
|
39
|
+
}
|
|
40
|
+
], { float: "right" });
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// Header
|
|
@@ -62,34 +62,49 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
62
62
|
const editorArea = new LX.Area({ className: "rounded-lg" });
|
|
63
63
|
editorContainer.appendChild( editorArea.root );
|
|
64
64
|
|
|
65
|
-
editorArea.addMenubar(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
65
|
+
const menubar = editorArea.addMenubar( [
|
|
66
|
+
{ name: "Scene", submenu: [
|
|
67
|
+
{ name: "New Scene" },
|
|
68
|
+
{ name: "Open Scene", icon: "FolderOpen", kbd: "S" },
|
|
69
|
+
{ name: "Open Recent", icon: "File", submenu: [
|
|
70
|
+
{ name: "hello.scene" },
|
|
71
|
+
{ name: "goodbye.scene" }
|
|
72
|
+
] }
|
|
73
|
+
] },
|
|
74
|
+
{ name: "Project", submenu: [
|
|
75
|
+
{ name: "Project Settings", disabled: true },
|
|
76
|
+
null,
|
|
77
|
+
{ name: "Export", submenu: [
|
|
78
|
+
{ name: "DAE", icon: "Frame", kbd: "D" },
|
|
79
|
+
{ name: "GLTF", kbd: "G" }
|
|
80
|
+
] },
|
|
81
|
+
{ name: "Export", icon: "Download" }
|
|
82
|
+
] },
|
|
83
|
+
{ name: "Editor", submenu: [
|
|
84
|
+
{ name: "Autosave", checked: true, icon: "Save" },
|
|
85
|
+
{ name: "Settings", icon: "Settings2" },
|
|
86
|
+
] },
|
|
87
|
+
{ name: "Account", submenu: [
|
|
88
|
+
{ name: "Login", icon: "User" },
|
|
89
|
+
] },
|
|
90
|
+
{ name: "Help", submenu: [
|
|
91
|
+
{ name: "Search Help", icon: "Search", kbd: "F1" },
|
|
92
|
+
{ name: "Support LexGUI", icon: "Heart" },
|
|
93
|
+
] },
|
|
94
|
+
], { sticky: false });
|
|
95
|
+
|
|
96
|
+
menubar.addButtons( [
|
|
97
|
+
{
|
|
98
|
+
title: "Play",
|
|
99
|
+
icon: "Play@solid",
|
|
100
|
+
swap: "Stop@solid"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
title: "Pause",
|
|
104
|
+
icon: "Pause@solid",
|
|
105
|
+
disabled: true
|
|
106
|
+
}
|
|
107
|
+
]);
|
|
93
108
|
|
|
94
109
|
// split main area
|
|
95
110
|
const [ left, right ] = editorArea.split({ sizes:["70%","30%"], minimizable: true });
|
|
@@ -110,13 +125,13 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
110
125
|
left.onresize = resizeCanvas;
|
|
111
126
|
left.addOverlayButtons( [
|
|
112
127
|
[
|
|
113
|
-
{ name: "Select", icon: "
|
|
114
|
-
{ name: "Move", icon: "
|
|
115
|
-
{ name: "Rotate", icon: "
|
|
128
|
+
{ name: "Select", icon: "MousePointer", selectable: true },
|
|
129
|
+
{ name: "Move", icon: "Move", selectable: true },
|
|
130
|
+
{ name: "Rotate", icon: "RotateRight", selectable: true }
|
|
116
131
|
],
|
|
117
132
|
{ name: "Lit", options: ["Lit", "Unlit", "Wireframe"] },
|
|
118
133
|
[
|
|
119
|
-
{ name: "Enable Snap", icon: "
|
|
134
|
+
{ name: "Enable Snap", icon: "Frame", selectable: true },
|
|
120
135
|
{ name: 10, options: [10, 100, 1000] }
|
|
121
136
|
]
|
|
122
137
|
], { float: "htc" } );
|
|
@@ -153,12 +168,12 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
153
168
|
'children': [
|
|
154
169
|
{
|
|
155
170
|
'id': 'node_1_1',
|
|
156
|
-
'icon': '
|
|
171
|
+
'icon': 'Box',
|
|
157
172
|
'children': [],
|
|
158
173
|
'actions': [
|
|
159
174
|
{
|
|
160
175
|
'name': 'Open script',
|
|
161
|
-
'icon': '
|
|
176
|
+
'icon': 'Script'
|
|
162
177
|
}
|
|
163
178
|
]
|
|
164
179
|
}
|
|
@@ -166,7 +181,7 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
166
181
|
},
|
|
167
182
|
{
|
|
168
183
|
'id': 'node_2',
|
|
169
|
-
'icon': '
|
|
184
|
+
'icon': 'CirclePlay',
|
|
170
185
|
'children': []
|
|
171
186
|
}
|
|
172
187
|
]
|
|
@@ -176,11 +191,11 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
176
191
|
const treeIcons = [
|
|
177
192
|
{
|
|
178
193
|
'name':'Add node',
|
|
179
|
-
'icon': '
|
|
194
|
+
'icon': 'Plus'
|
|
180
195
|
},
|
|
181
196
|
{
|
|
182
197
|
'name':'Instantiate scene',
|
|
183
|
-
'icon': '
|
|
198
|
+
'icon': 'Link'
|
|
184
199
|
}
|
|
185
200
|
];
|
|
186
201
|
|
|
@@ -199,9 +214,9 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
199
214
|
});
|
|
200
215
|
|
|
201
216
|
// add widgets to panel branch
|
|
202
|
-
panel.branch("Canvas", {icon: "
|
|
217
|
+
panel.branch("Canvas", { icon: "Palette", filter: true });
|
|
203
218
|
panel.addColor("Background", "#b7a9b1", null);
|
|
204
|
-
panel.addText("Text", "LexGUI.js @jxarco", null, {placeholder: "e.g. ColorPicker", icon: "
|
|
219
|
+
panel.addText("Text", "LexGUI.js @jxarco", null, {placeholder: "e.g. ColorPicker", icon: "Type"});
|
|
205
220
|
panel.addColor("Font Color", "#303b8d", null);
|
|
206
221
|
panel.addNumber("Font Size", 36, null, { min: 1, max: 48, step: 1, units: "px"});
|
|
207
222
|
panel.addSelect("Font Family", ["Arial", "GeistSans", "Monospace", "Ubuntu"], "GeistSans");
|
|
@@ -216,7 +231,7 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
216
231
|
panel.addSize("Resolution", [1280, 720], null, { units: "p", precision: 0 });
|
|
217
232
|
panel.merge();
|
|
218
233
|
|
|
219
|
-
panel.branch("Node", { icon: "
|
|
234
|
+
panel.branch("Node", { icon: "Box" });
|
|
220
235
|
panel.addText("Name", "node_1");
|
|
221
236
|
panel.addCheckbox("Visibility", true, null, { className: "accent" });
|
|
222
237
|
panel.addLayers("Layers", 10, null);
|
|
@@ -240,18 +255,18 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
240
255
|
const badgeClass = "ml-auto no-bg font-medium";
|
|
241
256
|
|
|
242
257
|
const sidebar = mailArea.addSidebar( m => {
|
|
243
|
-
m.add( "Inbox", { selected: true, icon: "
|
|
244
|
-
m.add( "Drafts", { icon: "
|
|
245
|
-
m.add( "Sent", { icon: "
|
|
246
|
-
m.add( "Junk", { icon: "
|
|
247
|
-
m.add( "Trash", { icon: "
|
|
248
|
-
m.add( "Archive", { icon: "
|
|
258
|
+
m.add( "Inbox", { selected: true, icon: "Inbox", content: LX.badge("128", badgeClass, { asElement: true }) } );
|
|
259
|
+
m.add( "Drafts", { icon: "File", content: LX.badge("9", badgeClass, { asElement: true }) } );
|
|
260
|
+
m.add( "Sent", { icon: "PaperPlane" } );
|
|
261
|
+
m.add( "Junk", { icon: "ArchiveX", content: LX.badge("23", badgeClass, { asElement: true }) } );
|
|
262
|
+
m.add( "Trash", { icon: "Trash3" } );
|
|
263
|
+
m.add( "Archive", { icon: "Archive" } );
|
|
249
264
|
m.separator();
|
|
250
|
-
m.add( "Social", { icon: "
|
|
251
|
-
m.add( "Updates", { icon: "
|
|
252
|
-
m.add( "Forums", { icon: "
|
|
253
|
-
m.add( "Shopping ", { icon: "
|
|
254
|
-
m.add( "Promotions", { icon: "
|
|
265
|
+
m.add( "Social", { icon: "User", content: LX.badge("972", badgeClass, { asElement: true }) } );
|
|
266
|
+
m.add( "Updates", { icon: "Info", content: LX.badge("342", badgeClass, { asElement: true }) } );
|
|
267
|
+
m.add( "Forums", { icon: "MessagesCircle", content: LX.badge("96", badgeClass, { asElement: true }) } );
|
|
268
|
+
m.add( "Shopping ", { icon: "ShoppingCart" } );
|
|
269
|
+
m.add( "Promotions", { icon: "Flag", content: LX.badge("21", badgeClass, { asElement: true }) } );
|
|
255
270
|
}, {
|
|
256
271
|
className: "border-right",
|
|
257
272
|
headerTitle: "jxarco",
|
|
@@ -281,7 +296,7 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
281
296
|
{
|
|
282
297
|
const allMailFilter = LX.makeContainer( [ "100%", "50px" ], "flex p-2", "", container );
|
|
283
298
|
const filterInput = new LX.TextInput(null, "", null,
|
|
284
|
-
{ inputClass: "outline", width: "100%", icon: "
|
|
299
|
+
{ inputClass: "outline", width: "100%", icon: "Search", placeholder: "Search..." }
|
|
285
300
|
);
|
|
286
301
|
allMailFilter.appendChild( filterInput.root );
|
|
287
302
|
}
|
|
@@ -348,15 +363,15 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
348
363
|
{
|
|
349
364
|
const mailPreviewHeader = LX.makeContainer( [ "100%", "59.59px" ], "flex flex-row border-bottom p-1", "", right );
|
|
350
365
|
|
|
351
|
-
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Archive", tooltip: true, buttonClass: "bg-none", icon: "
|
|
352
|
-
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Move to junk", tooltip: true, buttonClass: "bg-none", icon: "
|
|
353
|
-
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Move to trash", tooltip: true, buttonClass: "bg-none", icon: "
|
|
366
|
+
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Archive", tooltip: true, buttonClass: "bg-none", icon: "Archive" } ).root );
|
|
367
|
+
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Move to junk", tooltip: true, buttonClass: "bg-none", icon: "ArchiveX" } ).root );
|
|
368
|
+
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Move to trash", tooltip: true, buttonClass: "bg-none", icon: "Trash3" } ).root );
|
|
354
369
|
mailPreviewHeader.appendChild( LX.makeContainer( [ "1px", "35%" ], "border-right self-center ml-2 mr-2" ) );
|
|
355
|
-
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Snooze", tooltip: true, buttonClass: "bg-none", icon: "
|
|
370
|
+
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Snooze", tooltip: true, buttonClass: "bg-none", icon: "Clock" } ).root );
|
|
356
371
|
|
|
357
|
-
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Reply", tooltip: true, buttonClass: "bg-none", className: "ml-auto", icon: "
|
|
358
|
-
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Reply all", tooltip: true, buttonClass: "bg-none", icon: "
|
|
359
|
-
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Forward", tooltip: true, buttonClass: "bg-none", icon: "
|
|
372
|
+
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Reply", tooltip: true, buttonClass: "bg-none", className: "ml-auto", icon: "Reply" } ).root );
|
|
373
|
+
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Reply all", tooltip: true, buttonClass: "bg-none", icon: "ReplyAll" } ).root );
|
|
374
|
+
mailPreviewHeader.appendChild( new LX.Button( null, "", null, { title: "Forward", tooltip: true, buttonClass: "bg-none", icon: "Forward" } ).root );
|
|
360
375
|
mailPreviewHeader.appendChild( LX.makeContainer( [ "1px", "35%" ], "border-right self-center ml-2 mr-2" ) );
|
|
361
376
|
mailPreviewHeader.appendChild( new LX.Button( null, "", (value, event) => {
|
|
362
377
|
new LX.DropdownMenu( event.target, [
|
|
@@ -365,7 +380,7 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
365
380
|
{ name: "Add label" },
|
|
366
381
|
{ name: "Mute thread" }
|
|
367
382
|
], { side: "bottom", align: "end" });
|
|
368
|
-
}, { buttonClass: "bg-none", icon: "
|
|
383
|
+
}, { buttonClass: "bg-none", icon: "EllipsisVertical" } ).root );
|
|
369
384
|
}
|
|
370
385
|
|
|
371
386
|
// Prewiew Info
|
|
@@ -446,7 +461,7 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
446
461
|
{ name: "Priority", options: ["Low", "Medium", "High"] },
|
|
447
462
|
],
|
|
448
463
|
rowActions: [
|
|
449
|
-
{ icon: "
|
|
464
|
+
{ icon: "Edit", title: "Edit Row" },
|
|
450
465
|
"delete",
|
|
451
466
|
"menu"
|
|
452
467
|
],
|
|
@@ -517,8 +532,8 @@ const area = LX.init( { strictViewport: false, rootClass: "wrapper" } );
|
|
|
517
532
|
],
|
|
518
533
|
credits: `2019-${ new Date().getUTCFullYear() } Alex Rodríguez and contributors. Website source code on GitHub.`,
|
|
519
534
|
socials: [
|
|
520
|
-
{ title: "Github", link: "https://github.com/jxarco/lexgui.js/", icon:
|
|
521
|
-
{ title: "Discord", link: "https://discord.gg/vwqVrMZBXv", icon:
|
|
535
|
+
{ title: "Github", link: "https://github.com/jxarco/lexgui.js/", icon: "Github" },
|
|
536
|
+
{ title: "Discord", link: "https://discord.gg/vwqVrMZBXv", icon: "Discord" }
|
|
522
537
|
]
|
|
523
538
|
} );
|
|
524
539
|
}
|
|
@@ -30,26 +30,25 @@
|
|
|
30
30
|
window.LX = LX;
|
|
31
31
|
|
|
32
32
|
// Init library and get main area
|
|
33
|
-
let area = LX.init();
|
|
34
|
-
|
|
35
|
-
area.addMenubar(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, { sticky: false });
|
|
33
|
+
let area = await LX.init();
|
|
34
|
+
|
|
35
|
+
const menubar = area.addMenubar( [], { sticky: false } );
|
|
36
|
+
menubar.addButtons([
|
|
37
|
+
{
|
|
38
|
+
title: "Toggle Sections",
|
|
39
|
+
icon: "Eye",
|
|
40
|
+
callback: (swapValue) => { closedDefault = !closedDefault; fillPanels(); }
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: "Change Theme",
|
|
44
|
+
icon: "Moon",
|
|
45
|
+
swap: "Sun",
|
|
46
|
+
callback: (swapValue) => { LX.setTheme(swapValue ? "light" : "dark") }
|
|
47
|
+
}
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
menubar.setButtonIcon("Github", "Github", () => { window.open("https://github.com/jxarco/lexgui.js/") })
|
|
51
|
+
menubar.setButtonImage("lexgui.js", "../images/icon.png", () => { window.open("https://jxarco.github.io/lexgui.js/") }, { float: "left" })
|
|
53
52
|
|
|
54
53
|
var [middle, right] = area.split({ sizes: ["70%", "30%"], minimizable: true });
|
|
55
54
|
var [left, center] = middle.split({ sizes: ["50%", null], minimizable: true });
|
|
@@ -72,9 +71,9 @@
|
|
|
72
71
|
panelC.root.innerHTML = "";
|
|
73
72
|
|
|
74
73
|
const comboValues = [
|
|
75
|
-
{ value: 'left', selected: true, icon: '
|
|
76
|
-
{ value: 'center', icon: '
|
|
77
|
-
{ value: 'right', icon: '
|
|
74
|
+
{ value: 'left', selected: true, icon: 'AlignLeft' },
|
|
75
|
+
{ value: 'center', icon: 'AlignCenter' },
|
|
76
|
+
{ value: 'right', icon: 'AlignRight' }
|
|
78
77
|
];
|
|
79
78
|
|
|
80
79
|
const selectValues = ["Godot", "Unity", "Unreal Engine", "Visual Studio", "Visual Studio Code"];
|
|
@@ -108,19 +107,19 @@
|
|
|
108
107
|
buttonsLeftPanel.addButton(null, "Warning", null, { disabled: true, buttonClass: "warning" });
|
|
109
108
|
buttonsLeftPanel.addButton(null, "Error", null, { disabled: true, buttonClass: "error" });
|
|
110
109
|
buttonsLeftPanel.branch("Advanced Buttons", { closed: closedDefault });
|
|
111
|
-
buttonsLeftPanel.addButton("Icon Button", "Not used", null, { icon: "
|
|
110
|
+
buttonsLeftPanel.addButton("Icon Button", "Not used", null, { icon: "Skull" });
|
|
112
111
|
buttonsLeftPanel.sameLine();
|
|
113
112
|
buttonsLeftPanel.addLabel("Customized Inline Buttons");
|
|
114
|
-
buttonsLeftPanel.addButton(null, "Not used", null, { icon: "
|
|
115
|
-
buttonsLeftPanel.addButton(null, "Not used", null, { icon: "
|
|
116
|
-
buttonsLeftPanel.addButton(null, "Not used", null, { icon: "
|
|
113
|
+
buttonsLeftPanel.addButton(null, "Not used", null, { icon: "Skull", buttonClass: "bg-none" });
|
|
114
|
+
buttonsLeftPanel.addButton(null, "Not used", null, { icon: "Box", buttonClass: "bg-primary" });
|
|
115
|
+
buttonsLeftPanel.addButton(null, "Not used", null, { icon: "Grid3x3", buttonClass: "bg-tertiary fg-tertiary" });
|
|
117
116
|
buttonsLeftPanel.endLine("justify-start");
|
|
118
117
|
buttonsLeftPanel.sameLine();
|
|
119
118
|
buttonsLeftPanel.addLabel("Swap Buttons");
|
|
120
|
-
buttonsLeftPanel.addButton(null, "Not used", null, { icon: "
|
|
121
|
-
buttonsLeftPanel.addButton(null, "Not used", null, { icon: "
|
|
119
|
+
buttonsLeftPanel.addButton(null, "Not used", null, { icon: "Moon", swap: "Sun", buttonClass: "bg-none" });
|
|
120
|
+
buttonsLeftPanel.addButton(null, "Not used", null, { icon: "Eye", swap: "EyeOff" });
|
|
122
121
|
buttonsLeftPanel.endLine("justify-start");
|
|
123
|
-
buttonsLeftPanel.addButton(null, LX.makeIcon("
|
|
122
|
+
buttonsLeftPanel.addButton(null, LX.makeIcon("CirclePlus").innerHTML + "Button with Inlined Icon", null);
|
|
124
123
|
buttonsLeftPanel.addButton(null, "With a Badge" + LX.badge("+99", "accent sm"));
|
|
125
124
|
buttonsRightPanel.branch("Outline Buttons", { closed: closedDefault });
|
|
126
125
|
buttonsRightPanel.addButton(null, "Classic Outline", null, { buttonClass: "outline" });
|
|
@@ -265,12 +264,12 @@
|
|
|
265
264
|
'children': [
|
|
266
265
|
{
|
|
267
266
|
'id': 'node_1_1',
|
|
268
|
-
'icon': '
|
|
267
|
+
'icon': 'Box',
|
|
269
268
|
'children': [],
|
|
270
269
|
'actions': [
|
|
271
270
|
{
|
|
272
271
|
'name': 'Open script',
|
|
273
|
-
'icon': '
|
|
272
|
+
'icon': 'Script',
|
|
274
273
|
'callback': function (node) {
|
|
275
274
|
console.log(node.id + ": Script opened!")
|
|
276
275
|
}
|
|
@@ -281,7 +280,7 @@
|
|
|
281
280
|
},
|
|
282
281
|
{
|
|
283
282
|
'id': 'node_2',
|
|
284
|
-
'icon': '
|
|
283
|
+
'icon': 'CirclePlay',
|
|
285
284
|
'children': []
|
|
286
285
|
},
|
|
287
286
|
{
|
|
@@ -289,12 +288,12 @@
|
|
|
289
288
|
'children': [
|
|
290
289
|
{
|
|
291
290
|
'id': 'node_3_1',
|
|
292
|
-
'icon': '
|
|
291
|
+
'icon': 'Box',
|
|
293
292
|
'children': []
|
|
294
293
|
},
|
|
295
294
|
{
|
|
296
295
|
'id': 'node_3_2',
|
|
297
|
-
'icon': '
|
|
296
|
+
'icon': 'Box',
|
|
298
297
|
'children': []
|
|
299
298
|
}
|
|
300
299
|
]
|
|
@@ -306,12 +305,12 @@
|
|
|
306
305
|
const treeIcons = [
|
|
307
306
|
{
|
|
308
307
|
'name': 'Add node',
|
|
309
|
-
'icon': '
|
|
308
|
+
'icon': 'Plus',
|
|
310
309
|
'callback': () => { console.log("Node added!") }
|
|
311
310
|
},
|
|
312
311
|
{
|
|
313
312
|
'name': 'Instantiate scene',
|
|
314
|
-
'icon': '
|
|
313
|
+
'icon': 'Link',
|
|
315
314
|
'callback': () => { console.log("Scene instantiated!") }
|
|
316
315
|
}
|
|
317
316
|
];
|
|
@@ -357,7 +356,7 @@
|
|
|
357
356
|
{ name: "Priority", options: ["Low", "Medium", "High"] },
|
|
358
357
|
],
|
|
359
358
|
rowActions: [
|
|
360
|
-
{ icon: "
|
|
359
|
+
{ icon: "Edit", title: "Edit Row" },
|
|
361
360
|
"delete",
|
|
362
361
|
"menu"
|
|
363
362
|
],
|
package/examples/area_tabs.html
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
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
|
var [leftArea, rightArea] = area.split({ sizes: ["75%", "25%"] });
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
// **** **** **** **** **** **** **** **** **** **** **** ****
|
|
85
85
|
|
|
86
86
|
function fillPanelA(panel) {
|
|
87
|
-
panel.branch("Canvas", { icon: "
|
|
87
|
+
panel.branch("Canvas", { icon: "Palette", filter: true });
|
|
88
88
|
panel.addColor("Background", "#b7a9b1");
|
|
89
|
-
panel.addText("Text", "Lexgui.js @jxarco", null, { placeholder: "e.g. ColorPicker", icon: "
|
|
89
|
+
panel.addText("Text", "Lexgui.js @jxarco", null, { placeholder: "e.g. ColorPicker", icon: "Type" });
|
|
90
90
|
panel.addColor("Font Color", { r: 1, g: 0.1, b: 0.6 }, (value, event) => {
|
|
91
91
|
console.log("Font Color: ", value);
|
|
92
92
|
});
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
function fillPanelB(panel) {
|
|
103
|
-
panel.branch("Settings", { icon: "
|
|
103
|
+
panel.branch("Settings", { icon: "Palette", filter: true });
|
|
104
104
|
panel.addTitle("Configuration (Im a title)");
|
|
105
105
|
panel.addCheckbox("Toggle me", true, (value, event) => {
|
|
106
106
|
console.log(value);
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
function fillPanelC(panel) {
|
|
118
|
-
panel.branch("Some Branch", { icon: "
|
|
118
|
+
panel.branch("Some Branch", { icon: "Palette", filter: true });
|
|
119
119
|
panel.addTitle("C title");
|
|
120
120
|
panel.addToggle("A cool Toggle", true, (value, event) => {
|
|
121
121
|
console.log(value);
|
package/examples/asset_view.html
CHANGED
package/examples/dialogs.html
CHANGED
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
import { LX } from 'lexgui';
|
|
23
23
|
|
|
24
24
|
// Init library and get main area
|
|
25
|
-
let area = LX.init({ skip_default_area: true });
|
|
25
|
+
let area = await LX.init({ skip_default_area: true });
|
|
26
26
|
|
|
27
27
|
LX.popup("Hello! I'm a popup dialog :)", null, { position: ["45%", "20%"] })
|
|
28
28
|
|
|
29
29
|
const pocketDialog = new LX.PocketDialog("Load Settings", p => {
|
|
30
30
|
p.branch("Canvas");
|
|
31
31
|
p.addColor("Background", "#b7a9b1");
|
|
32
|
-
p.addText("Text", "Pocket Dialog Lexgui.js @jxarco", null, { placeholder: "e.g. ColorPicker", icon: "
|
|
32
|
+
p.addText("Text", "Pocket Dialog Lexgui.js @jxarco", null, { placeholder: "e.g. ColorPicker", icon: "Type" });
|
|
33
33
|
p.addColor("Font Color", { r: 1, g: 0.1, b: 0.6 }, (value, event) => {
|
|
34
34
|
console.log("Font Color: ", value);
|
|
35
35
|
});
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
const dialogClosable = new LX.Dialog("Closable Dialog", p => {
|
|
50
50
|
p.branch("Canvas");
|
|
51
51
|
p.addColor("Background", "#b7a9b1");
|
|
52
|
-
p.addText("Text", "Dialog Lexgui.js @jxarco", null, { placeholder: "e.g. ColorPicker", icon: "
|
|
52
|
+
p.addText("Text", "Dialog Lexgui.js @jxarco", null, { placeholder: "e.g. ColorPicker", icon: "Type" });
|
|
53
53
|
p.addColor("Font Color", { r: 1, g: 0.1, b: 0.6 }, (value, event) => {
|
|
54
54
|
console.log("Font Color: ", value);
|
|
55
55
|
});
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
const draggablePocketDialog = new LX.PocketDialog("Draggable PocketDialog", p => {
|
|
69
69
|
p.branch("Canvas");
|
|
70
70
|
p.addColor("Background", "#b7a9b1");
|
|
71
|
-
p.addText("Text", "Pocket Dialog Lexgui.js @jxarco", null, { placeholder: "e.g. ColorPicker", icon: "
|
|
71
|
+
p.addText("Text", "Pocket Dialog Lexgui.js @jxarco", null, { placeholder: "e.g. ColorPicker", icon: "Type" });
|
|
72
72
|
p.addSelect("Best Engine", ["Godot", "Unity", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Pepe"], "Godot", (value, event) => {
|
|
73
73
|
console.log(value);
|
|
74
74
|
}, { filter: true });
|