lexgui 0.6.12 → 0.7.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 +14 -9
- package/build/{components → extensions}/audio.js +11 -11
- package/build/{components → extensions}/codeeditor.js +95 -63
- package/build/{components → extensions}/docmaker.js +10 -3
- package/build/{components → extensions}/imui.js +19 -12
- package/build/{components → extensions}/nodegraph.js +1 -1
- package/build/{components → extensions}/timeline.js +23 -23
- package/build/{components → extensions}/videoeditor.js +1 -1
- package/build/lexgui-docs.css +9 -9
- package/build/lexgui.css +500 -226
- package/build/lexgui.js +1562 -772
- package/build/lexgui.min.css +8 -2
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +1563 -773
- package/build/lexgui.module.min.js +1 -1
- package/changelog.md +81 -21
- package/demo.js +45 -31
- package/examples/{all_widgets.html → all-components.html} +22 -4
- package/examples/{area_tabs.html → area-tabs.html} +3 -3
- package/examples/{asset_view.html → asset-view.html} +3 -3
- package/examples/{code_editor.html → code-editor.html} +4 -4
- package/examples/dialogs.html +3 -3
- package/examples/editor.html +27 -18
- package/examples/{immediate_ui.html → immediate-ui.html} +3 -3
- package/examples/index.html +8 -8
- package/examples/{node_graph.html → node-graph.html} +3 -3
- package/examples/previews/all-components.png +0 -0
- package/examples/previews/area-tabs.png +0 -0
- package/examples/previews/asset-view.png +0 -0
- package/examples/previews/code-editor.png +0 -0
- package/examples/previews/dialogs.png +0 -0
- package/examples/previews/editor.png +0 -0
- package/examples/previews/node-graph.png +0 -0
- package/examples/previews/side-bar.png +0 -0
- package/examples/previews/timeline.png +0 -0
- package/examples/{side_bar.html → side-bar.html} +3 -3
- package/examples/timeline.html +4 -4
- package/examples/{video_editor.html → video-editor.html} +3 -3
- package/examples/{video_editor2.html → video-editor2.html} +3 -3
- package/package.json +2 -2
- package/examples/previews/all_widgets.png +0 -0
- package/examples/previews/area_tabs.png +0 -0
- package/examples/previews/asset_view.png +0 -0
- package/examples/previews/code_editor.png +0 -0
- package/examples/previews/node_graph.png +0 -0
- package/examples/previews/side_bar.png +0 -0
package/changelog.md
CHANGED
|
@@ -2,7 +2,66 @@
|
|
|
2
2
|
|
|
3
3
|
## dev
|
|
4
4
|
|
|
5
|
-
## 0.
|
|
5
|
+
## 0.7.1 (master)
|
|
6
|
+
|
|
7
|
+
Added support for selecting custom Min, Max range in RangeInput component.
|
|
8
|
+
Added value labels to RangeInput component.
|
|
9
|
+
`LX.asTooltip` Updates:
|
|
10
|
+
- Now supports `options.offsetX`, `options.offsetY` and `options.callback`.
|
|
11
|
+
- Change content and offsets dynamically using `trigger.dataset["tooltipContent" | "tooltipOffsetX" | "tooltipOffsetY"]`.
|
|
12
|
+
Fixed Popovers using `options.reference`.
|
|
13
|
+
|
|
14
|
+
## 0.7.0
|
|
15
|
+
|
|
16
|
+
General/Utils:
|
|
17
|
+
- "Components" have been renamed to "Extensions".
|
|
18
|
+
- Every elements, widget, etc. is now a "Component".
|
|
19
|
+
- Added support for `LX.toCamelCase` and `LX.toTitleCase`.
|
|
20
|
+
- Polished CSS.
|
|
21
|
+
- Changed LexGUI brand icons.
|
|
22
|
+
- Unified code fonts. Using now CascadiaCode (https://github.com/microsoft/cascadia-code).
|
|
23
|
+
|
|
24
|
+
New Components:
|
|
25
|
+
- Skeleton Component (Feedback)
|
|
26
|
+
- Breadcrumb Component (Navigation)
|
|
27
|
+
- Rate Component (Data Input)
|
|
28
|
+
|
|
29
|
+
New "default" | "compact" layout spacing:
|
|
30
|
+
- `options.spacingMode` in LX.init
|
|
31
|
+
- `LX.setSpacingMode` and `LX.switchSpacing`
|
|
32
|
+
|
|
33
|
+
Component Updates:
|
|
34
|
+
- Badges:
|
|
35
|
+
- Added `options.parent` to use them as notification indicators inside an element
|
|
36
|
+
- Added `options.chip` to use as notification indicators alone
|
|
37
|
+
- Added `options.callback` option on click.
|
|
38
|
+
- Toast:
|
|
39
|
+
- Allow creation at left, center and right + top/bottom using `options.position`.
|
|
40
|
+
- Sidebar:
|
|
41
|
+
- Added subitem option `options.content` to match main items.
|
|
42
|
+
- Added entry option `options.skipSelection` to avoid selections even with `displaySelected`.
|
|
43
|
+
- Support swap icons in entries.
|
|
44
|
+
- Fixed subentry selection.
|
|
45
|
+
- Dropdowns:
|
|
46
|
+
- Support radio button groups.
|
|
47
|
+
- AssetView:
|
|
48
|
+
- Improved toolbar with Dropdowns. Now refreshes icons on change sort and layout modes.
|
|
49
|
+
- Table:
|
|
50
|
+
- Added support for Calendar Date filter in Table Component.
|
|
51
|
+
- Other Bugfixes:
|
|
52
|
+
- Fixed Select Component above placement on filter.
|
|
53
|
+
- FIxed CodeEditor 'End' horizontal scrolling.
|
|
54
|
+
- Fixed CodeEditor CSS harcoded Tab height.
|
|
55
|
+
- Fixed dropdown, popovers, etc within modal backdrop.
|
|
56
|
+
- Fixed minor issue with CalendarRange when selecting >1 months apart.
|
|
57
|
+
|
|
58
|
+
Improved Documentation:
|
|
59
|
+
- Added AssetView, CodeSnippet and other small components (badge, sheet, toast, etc.).
|
|
60
|
+
- Added Docmaker and Video Editor extension docs.
|
|
61
|
+
- Added addition version to elements in sidebar.
|
|
62
|
+
- Added Changelog section.
|
|
63
|
+
|
|
64
|
+
## 0.6.12
|
|
6
65
|
|
|
7
66
|
Widgets:
|
|
8
67
|
- Button Widget now supports `options.mustConfirm` to confirm the trigger with custom options.
|
|
@@ -122,10 +181,10 @@ Added `hover:scale` CSS selectors.
|
|
|
122
181
|
## 0.6.5
|
|
123
182
|
|
|
124
183
|
Timeline:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
184
|
+
- Refactored undo-redo.
|
|
185
|
+
- ClipsTimeline: added an argument on `addClip` to start search at a particular track.
|
|
186
|
+
- Documentation updated.
|
|
187
|
+
- Minor fixes.
|
|
129
188
|
|
|
130
189
|
Use sidebar inside Sheet element on mobile.
|
|
131
190
|
Removed LX.UTILS. Moved methods to global namespace `LX`.
|
|
@@ -134,11 +193,11 @@ Minor fixes in example demos.
|
|
|
134
193
|
## 0.6.4
|
|
135
194
|
|
|
136
195
|
Timeline:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
196
|
+
- Paste refactor.
|
|
197
|
+
- `onUpdateTrack` now expects an array of track indices as argument.
|
|
198
|
+
- Added root.
|
|
199
|
+
- Added documentation.
|
|
200
|
+
- Fixed example.
|
|
142
201
|
|
|
143
202
|
Widgets:
|
|
144
203
|
- Centered Map2D initial position.
|
|
@@ -190,9 +249,6 @@ Improved robustness of `LX.getSupportedDOMName`.
|
|
|
190
249
|
|
|
191
250
|
`LX.init` now has to called using `await`.
|
|
192
251
|
Use Dropdowns elements in menubar.
|
|
193
|
-
Remove legacy:
|
|
194
|
-
- Removed `options.selected` in ComboButtons Widget.
|
|
195
|
-
- Removed FA icons.
|
|
196
252
|
Added LucideIcons as main icon provider.
|
|
197
253
|
`LX.makeIcon`: Support for solid variants in supported icons (also using `iconName@variant`).
|
|
198
254
|
`LX.registerIcon`: Support for classes and attributes for svg and path elements.
|
|
@@ -205,14 +261,18 @@ Added support for right sidebar.
|
|
|
205
261
|
Restyled Number Widget units to avoid layout trashing when recomputing units span location.
|
|
206
262
|
|
|
207
263
|
CodeEditor:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
264
|
+
- Remove language images and use SVG instead.
|
|
265
|
+
- Scrolling fixes.
|
|
266
|
+
- Fixed minor css issues.
|
|
267
|
+
|
|
268
|
+
Remove legacy:
|
|
269
|
+
- Removed `options.selected` in ComboButtons Widget.
|
|
270
|
+
- Removed FA icons.
|
|
211
271
|
|
|
212
272
|
Docs updated:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
273
|
+
- Added interactive code examples for widgets.
|
|
274
|
+
- Improved widget list parameters and options.
|
|
275
|
+
- Added live examples for sidebar and menubar.
|
|
216
276
|
|
|
217
277
|
## 0.5.11
|
|
218
278
|
|
|
@@ -560,8 +620,8 @@ Minor bug fixes.
|
|
|
560
620
|
Timeline: Fixed timeline signals and added callbacks
|
|
561
621
|
|
|
562
622
|
Number/Vector widgets:
|
|
563
|
-
|
|
564
|
-
|
|
623
|
+
- Support for onPress&onRelease for catching mouse events.
|
|
624
|
+
- Added `setLimits` for min, max, step parameters.
|
|
565
625
|
|
|
566
626
|
Added Size Widget (N dimension number widget).
|
|
567
627
|
Minor bug fixes.
|
package/demo.js
CHANGED
|
@@ -1,53 +1,66 @@
|
|
|
1
1
|
import { LX } from 'lexgui';
|
|
2
|
-
import 'lexgui/
|
|
3
|
-
import 'lexgui/
|
|
4
|
-
import 'lexgui/
|
|
2
|
+
import 'lexgui/extensions/codeeditor.js';
|
|
3
|
+
import 'lexgui/extensions/timeline.js';
|
|
4
|
+
import 'lexgui/extensions/audio.js';
|
|
5
5
|
|
|
6
6
|
window.LX = LX;
|
|
7
7
|
|
|
8
8
|
const area = await LX.init( { layoutMode: "document", rootClass: "wrapper" } );
|
|
9
|
+
const starterTheme = LX.getTheme();
|
|
9
10
|
|
|
10
11
|
// Menubar
|
|
11
12
|
{
|
|
12
13
|
const menubar = area.addMenubar( [
|
|
13
14
|
{ name: "Docs", callback: () => { window.open("./docs/") } },
|
|
15
|
+
{ name: "Components", callback: () => { window.open("./docs/?p=components") } },
|
|
14
16
|
{ name: "Examples", callback: () => { window.open("./examples/") } },
|
|
15
17
|
] );
|
|
16
18
|
|
|
17
|
-
menubar.setButtonImage("lexgui.js",
|
|
19
|
+
menubar.setButtonImage("lexgui.js", `images/icon_${ starterTheme }.png`, () => { window.open("https://jxarco.github.io/lexgui.js/") }, { float: "left"} );
|
|
20
|
+
|
|
21
|
+
LX.addSignal( "@on_new_color_scheme", ( el, value ) => {
|
|
22
|
+
menubar.setButtonImage("lexgui.js", `images/icon_${ value }.png` );
|
|
23
|
+
} );
|
|
18
24
|
|
|
19
25
|
const commandButton = new LX.Button(null, `Search command...<span class="ml-auto">${ LX.makeKbd( ["Ctrl", "Space"], false, "bg-tertiary border px-1 rounded" ).innerHTML }</span>`, () => { LX.setCommandbarState( true ) }, {
|
|
20
26
|
width: "256px", className: "right", buttonClass: "border fg-tertiary bg-secondary" }
|
|
21
27
|
);
|
|
22
28
|
menubar.root.appendChild( commandButton.root );
|
|
23
29
|
|
|
24
|
-
const starterTheme = LX.getTheme();
|
|
25
|
-
|
|
26
30
|
menubar.addButtons( [
|
|
27
31
|
{
|
|
28
32
|
title: "Github",
|
|
29
33
|
icon: "Github@solid",
|
|
30
|
-
callback: (event) =>
|
|
31
|
-
window.open( "https://github.com/jxarco/lexgui.js/", "_blank" );
|
|
32
|
-
}
|
|
34
|
+
callback: (event) => window.open( "https://github.com/jxarco/lexgui.js/", "_blank" )
|
|
33
35
|
},
|
|
34
36
|
{
|
|
35
37
|
title: "Switch Theme",
|
|
36
38
|
icon: starterTheme == "dark" ? "Moon" : "Sun",
|
|
37
39
|
swap: starterTheme == "dark" ? "Sun" : "Moon",
|
|
38
40
|
callback: (value, event) => { LX.switchTheme() }
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: "Switch Spacing",
|
|
44
|
+
icon: "AlignVerticalSpaceAround",
|
|
45
|
+
callback: (value, event) => { LX.switchSpacing() }
|
|
39
46
|
}
|
|
40
47
|
], { float: "right" });
|
|
41
48
|
}
|
|
42
49
|
|
|
43
50
|
// Header
|
|
44
51
|
{
|
|
45
|
-
const header = LX.makeContainer( [ null, "auto" ], "flex flex-col border-top border-bottom gap-2 px-
|
|
52
|
+
const header = LX.makeContainer( [ null, "auto" ], "flex flex-col border-top border-bottom gap-2 px-10 py-8", `
|
|
46
53
|
<a>Get started with LexGUI.js <span class="text-sm fg-secondary">${ LX.version }</span></a>
|
|
47
54
|
<h1>Build your application interface</h1>
|
|
48
|
-
<p class="font-light" style="max-width:32rem">A set of beautifully-designed, accessible
|
|
55
|
+
<p class="font-light" style="max-width:32rem">A set of beautifully-designed, accessible components.
|
|
49
56
|
No complex frameworks. Pure JavaScript and CSS. Open Source.</p>
|
|
50
57
|
`, area );
|
|
58
|
+
|
|
59
|
+
const headerButtons = LX.makeContainer( [ "auto", "auto" ], "flex flex-row", ``, header );
|
|
60
|
+
const getStartedButton = new LX.Button( null, "Get Started", () => window.open( "./docs/", "_blank" ), { buttonClass: "contrast p-1 px-3" } );
|
|
61
|
+
const componentsButton = new LX.Button( null, "View Components", () => window.open( "./docs/?p=components", "_blank" ), { buttonClass: "tertiary p-1 px-3" } );
|
|
62
|
+
headerButtons.appendChild( getStartedButton.root );
|
|
63
|
+
headerButtons.appendChild( componentsButton.root );
|
|
51
64
|
}
|
|
52
65
|
|
|
53
66
|
// Content
|
|
@@ -107,7 +120,7 @@ const area = await LX.init( { layoutMode: "document", rootClass: "wrapper" } );
|
|
|
107
120
|
},
|
|
108
121
|
{
|
|
109
122
|
title: "Side Panel",
|
|
110
|
-
content: "This panel contains various
|
|
123
|
+
content: "This panel contains various components and settings for your application.",
|
|
111
124
|
reference: sidePanel.root,
|
|
112
125
|
side: "left",
|
|
113
126
|
align: "start"
|
|
@@ -240,13 +253,14 @@ const area = await LX.init( { layoutMode: "document", rootClass: "wrapper" } );
|
|
|
240
253
|
}
|
|
241
254
|
});
|
|
242
255
|
|
|
243
|
-
// add
|
|
256
|
+
// add components to panel branch
|
|
244
257
|
panel.branch("Canvas", { icon: "Palette", filter: true });
|
|
245
258
|
panel.addColor("Background", "#b7a9b1", null);
|
|
246
259
|
panel.addText("Text", "LexGUI.js @jxarco", null, {placeholder: "e.g. ColorPicker", icon: "Type"});
|
|
247
260
|
panel.addColor("Font Color", "#303b8d", null);
|
|
248
261
|
panel.addNumber("Font Size", 36, null, { min: 1, max: 48, step: 1, units: "px"});
|
|
249
|
-
panel.addSelect("Font Family", ["Arial", "GeistSans", "Monospace", "
|
|
262
|
+
panel.addSelect("Font Family", ["Arial", "GeistSans", "Monospace", "CascadiaCode"], "GeistSans");
|
|
263
|
+
panel.addRange("Threshold Range", [2, 7], (v) => console.log(v), { min: 0, max: 10, step: 1, className: "accent" });
|
|
250
264
|
panel.addVector2("2D Position", [300, 350], null, { min: 0, max: 1024 });
|
|
251
265
|
const opacityValues = [
|
|
252
266
|
[0.2, 0.3146875],
|
|
@@ -294,7 +308,7 @@ const area = await LX.init( { layoutMode: "document", rootClass: "wrapper" } );
|
|
|
294
308
|
// Mail
|
|
295
309
|
{
|
|
296
310
|
const mailContainer = LX.makeContainer( [ null, "800px" ], "flex flex-col bg-primary border rounded-lg overflow-hidden" );
|
|
297
|
-
tabs.add( "Mail", mailContainer, { xselected: true } );
|
|
311
|
+
tabs.add( "Mail", mailContainer, { xselected: true, badge: { content: "5", className: "xs fg-white bg-error", asChild: true } } );
|
|
298
312
|
|
|
299
313
|
const mailArea = new LX.Area();
|
|
300
314
|
mailContainer.appendChild( mailArea.root );
|
|
@@ -317,7 +331,7 @@ const area = await LX.init( { layoutMode: "document", rootClass: "wrapper" } );
|
|
|
317
331
|
className: "border-right",
|
|
318
332
|
headerTitle: "jxarco",
|
|
319
333
|
headerSubtitle: "alexroco.30@gmail.com",
|
|
320
|
-
headerImage: "
|
|
334
|
+
headerImage: "images/favicon.png",
|
|
321
335
|
skipFooter: true,
|
|
322
336
|
displaySelected: true,
|
|
323
337
|
onHeaderPressed: (e, element) => { }
|
|
@@ -441,7 +455,7 @@ const area = await LX.init( { layoutMode: "document", rootClass: "wrapper" } );
|
|
|
441
455
|
const avatarContainer = LX.makeContainer( [ "40px", "40px" ], "bg-tertiary rounded-full content-center", "", mailPreviewInfo );
|
|
442
456
|
|
|
443
457
|
const mailNames = mail.name.split( ' ' );
|
|
444
|
-
const avatarIcon = LX.makeContainer( [ "auto", "auto" ], "font-medium
|
|
458
|
+
const avatarIcon = LX.makeContainer( [ "auto", "auto" ], "font-medium self-center", mailNames[ 0 ][ 0 ] + mailNames[ 1 ][ 0 ], avatarContainer );
|
|
445
459
|
|
|
446
460
|
const senderData = LX.makeContainer( [ "auto", "auto" ], "flex flex-col gap-0.5", `
|
|
447
461
|
<div class="text-md font-semibold">${ mail.name }</div>
|
|
@@ -484,18 +498,18 @@ const area = await LX.init( { layoutMode: "document", rootClass: "wrapper" } );
|
|
|
484
498
|
<p class="fg-tertiary">Here's a list of your tasks for this month!</p>
|
|
485
499
|
`, tasksContainer );
|
|
486
500
|
|
|
487
|
-
const
|
|
488
|
-
head: [ "Name", "Status", "Priority", "ID" ],
|
|
501
|
+
const tableComponent = new LX.Table(null, {
|
|
502
|
+
head: [ "Name", "Status", "Priority", "Date", "ID" ],
|
|
489
503
|
body: [
|
|
490
|
-
[ "Alice", "In Progress", "High", 1 ],
|
|
491
|
-
[ "Bob", "Backlog", "Medium", 2 ],
|
|
492
|
-
[ "Prince", "Canceled", "Low", 3 ],
|
|
493
|
-
[ "Sean", "Done", "High", 4 ],
|
|
494
|
-
[ "Carter", "In Progress", "Medium", 5 ],
|
|
495
|
-
[ "James", "Backlog", "Low", 6 ],
|
|
496
|
-
[ "Mickey", "Todo", "Low", 7 ],
|
|
497
|
-
[ "Charlie", "Canceled", "Low", 8 ],
|
|
498
|
-
[ "Potato", "Todo", "High", 9 ]
|
|
504
|
+
[ "Alice", "In Progress", "High", "20/06/2025", 1 ],
|
|
505
|
+
[ "Bob", "Backlog", "Medium", "11/04/2025", 2 ],
|
|
506
|
+
[ "Prince", "Canceled", "Low", "13/05/2025", 3 ],
|
|
507
|
+
[ "Sean", "Done", "High", "28/07/2025", 4 ],
|
|
508
|
+
[ "Carter", "In Progress", "Medium", "20/03/2025", 5 ],
|
|
509
|
+
[ "James", "Backlog", "Low", "10/02/2025", 6 ],
|
|
510
|
+
[ "Mickey", "Todo", "Low", "08/01/2025", 7 ],
|
|
511
|
+
[ "Charlie", "Canceled", "Low", "23/05/2025", 8 ],
|
|
512
|
+
[ "Potato", "Todo", "High", "15/07/2025", 9 ]
|
|
499
513
|
]
|
|
500
514
|
}, {
|
|
501
515
|
selectable: true,
|
|
@@ -506,6 +520,7 @@ const area = await LX.init( { layoutMode: "document", rootClass: "wrapper" } );
|
|
|
506
520
|
{ name: "Status", options: ["Backlog", "Todo", "In Progress", "Done", "Canceled"] },
|
|
507
521
|
{ name: "Priority", options: ["Low", "Medium", "High"] },
|
|
508
522
|
{ name: "ID", type: "range", min: 0, max: 9, step: 1, units: "hr" },
|
|
523
|
+
{ name: "Date", type: "date", xdefault: ["23/07/2025", "29/07/2025"] },
|
|
509
524
|
],
|
|
510
525
|
rowActions: [
|
|
511
526
|
{ icon: "Edit", title: "Edit Row" },
|
|
@@ -522,7 +537,7 @@ const area = await LX.init( { layoutMode: "document", rootClass: "wrapper" } );
|
|
|
522
537
|
]
|
|
523
538
|
}
|
|
524
539
|
});
|
|
525
|
-
tasksContainer.appendChild(
|
|
540
|
+
tasksContainer.appendChild( tableComponent.root );
|
|
526
541
|
}
|
|
527
542
|
|
|
528
543
|
// Code
|
|
@@ -560,8 +575,7 @@ const area = await LX.init( { layoutMode: "document", rootClass: "wrapper" } );
|
|
|
560
575
|
{
|
|
561
576
|
title: "LexGUI",
|
|
562
577
|
items: [
|
|
563
|
-
{ title: "
|
|
564
|
-
{ title: "Source code", link: "https://github.com/jxarco/lexgui.js/" }
|
|
578
|
+
{ title: "Source code on Github", link: "https://github.com/jxarco/lexgui.js/" }
|
|
565
579
|
]
|
|
566
580
|
},
|
|
567
581
|
{
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
7
7
|
<title>LexGUI demo</title>
|
|
8
8
|
<link rel="stylesheet" href="../build/lexgui.css">
|
|
9
|
-
<link rel="icon" href="../images/
|
|
9
|
+
<link rel="icon" href="../images/favicon.png">
|
|
10
10
|
|
|
11
11
|
<script type="importmap">
|
|
12
12
|
{
|
|
13
13
|
"imports": {
|
|
14
14
|
"lexgui": "../build/lexgui.module.js",
|
|
15
|
-
"lexgui/
|
|
15
|
+
"lexgui/extensions/": "../build/extensions/"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
</script>
|
|
@@ -25,13 +25,14 @@
|
|
|
25
25
|
|
|
26
26
|
<script type="module">
|
|
27
27
|
import { LX } from 'lexgui';
|
|
28
|
-
import 'lexgui/
|
|
28
|
+
import 'lexgui/extensions/codeeditor.js';
|
|
29
29
|
|
|
30
30
|
window.LX = LX;
|
|
31
31
|
|
|
32
32
|
// Init library and get main area
|
|
33
33
|
let area = await LX.init();
|
|
34
34
|
|
|
35
|
+
const starterTheme = LX.getTheme();
|
|
35
36
|
const menubar = area.addMenubar( [], { sticky: false } );
|
|
36
37
|
menubar.addButtons([
|
|
37
38
|
{
|
|
@@ -44,11 +45,20 @@
|
|
|
44
45
|
icon: "Moon",
|
|
45
46
|
swap: "Sun",
|
|
46
47
|
callback: (swapValue) => { LX.setTheme(swapValue ? "light" : "dark") }
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
title: "Switch Spacing",
|
|
51
|
+
icon: "AlignVerticalSpaceAround",
|
|
52
|
+
callback: (value, event) => { LX.switchSpacing() }
|
|
47
53
|
}
|
|
48
54
|
]);
|
|
49
55
|
|
|
50
56
|
menubar.setButtonIcon("Github", "Github", () => { window.open("https://github.com/jxarco/lexgui.js/") })
|
|
51
|
-
menubar.setButtonImage("lexgui.js",
|
|
57
|
+
menubar.setButtonImage("lexgui.js", `../images/icon_small_${ starterTheme }.png`, () => { window.open("https://jxarco.github.io/lexgui.js/") }, { float: "left" } );
|
|
58
|
+
|
|
59
|
+
LX.addSignal( "@on_new_color_scheme", ( el, value ) => {
|
|
60
|
+
menubar.setButtonImage( "lexgui.js", `../images/icon_small_${ value }.png` );
|
|
61
|
+
} );
|
|
52
62
|
|
|
53
63
|
var [middle, right] = area.split({ sizes: ["70%", "30%"], minimizable: true });
|
|
54
64
|
var [left, center] = middle.split({ sizes: ["50%", null], minimizable: true });
|
|
@@ -252,6 +262,7 @@
|
|
|
252
262
|
panelB.addRange("Warning", 2, null, { min: 0, max: 10, step: 1, className: "warning" });
|
|
253
263
|
panelB.addRange("Inverted", 22, null, { min: 20, max: 48, step: 1, left: true });
|
|
254
264
|
panelB.addRange("NoFill", 10, null, { min: 1, max: 48, step: 1, fill: false });
|
|
265
|
+
panelB.addRange("With Range", [2, 6], null, { min: 1, max: 10, step: 1 });
|
|
255
266
|
panelB.addRange("Disabled", 29, null, { min: 1, max: 48, step: 1, disabled: true });
|
|
256
267
|
panelB.branch("Select Inputs", { closed: closedDefault });
|
|
257
268
|
panelB.addSelect("Classic", selectValues, "Unity", null);
|
|
@@ -268,6 +279,13 @@
|
|
|
268
279
|
panelB.addFile("Disabled", null, { disabled: true });
|
|
269
280
|
}
|
|
270
281
|
|
|
282
|
+
// Rate
|
|
283
|
+
{
|
|
284
|
+
panelC.branch("Rate", { closed: closedDefault });
|
|
285
|
+
panelC.addRate("Basic Rate", 2, null);
|
|
286
|
+
panelC.addRate("Rate With Halfs", 4.5, null, { allowHalf: true });
|
|
287
|
+
}
|
|
288
|
+
|
|
271
289
|
// DatePicker
|
|
272
290
|
{
|
|
273
291
|
panelC.branch("Date Picker", { closed: closedDefault });
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
7
7
|
<title>LexGUI Area Tabs Demo</title>
|
|
8
8
|
<link rel="stylesheet" href="../build/lexgui.css">
|
|
9
|
-
<link rel="icon" href="../images/
|
|
9
|
+
<link rel="icon" href="../images/favicon.png">
|
|
10
10
|
<script type="importmap">
|
|
11
11
|
{
|
|
12
12
|
"imports": {
|
|
13
13
|
"lexgui": "../build/lexgui.module.js",
|
|
14
|
-
"lexgui/
|
|
14
|
+
"lexgui/extensions/": "../build/extensions/"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
</script>
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
|
|
65
65
|
var ctx = canvas.getContext("2d");
|
|
66
66
|
|
|
67
|
-
// Get values from panel
|
|
67
|
+
// Get values from panel components (e.g. color value)
|
|
68
68
|
ctx.fillStyle = panelA.getValue('Background');
|
|
69
69
|
|
|
70
70
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
6
6
|
<title>LexGUI AssetView Demo</title>
|
|
7
7
|
<link rel="stylesheet" href="../build/lexgui.css">
|
|
8
|
-
<link rel="icon" href="../images/
|
|
8
|
+
<link rel="icon" href="../images/favicon.png">
|
|
9
9
|
<script type="importmap">
|
|
10
10
|
{
|
|
11
11
|
"imports": {
|
|
12
12
|
"lexgui": "../build/lexgui.module.js",
|
|
13
|
-
"lexgui/
|
|
13
|
+
"lexgui/extensions/": "../build/extensions/"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
</script>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<script type="module">
|
|
21
21
|
|
|
22
22
|
import { LX } from 'lexgui';
|
|
23
|
-
import 'lexgui/
|
|
23
|
+
import 'lexgui/extensions/codeeditor.js';
|
|
24
24
|
|
|
25
25
|
// Init library and get main area
|
|
26
26
|
let area = await LX.init();
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
6
6
|
<title>LexGUI Code Editor Demo</title>
|
|
7
7
|
<link rel="stylesheet" href="../build/lexgui.css">
|
|
8
|
-
<link rel="icon" href="../images/
|
|
8
|
+
<link rel="icon" href="../images/favicon.png">
|
|
9
9
|
<script type="importmap">
|
|
10
10
|
{
|
|
11
11
|
"imports": {
|
|
12
12
|
"lexgui": "../build/lexgui.module.js",
|
|
13
|
-
"lexgui/
|
|
13
|
+
"lexgui/extensions/": "../build/extensions/"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
</script>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<script type="module">
|
|
21
21
|
|
|
22
22
|
import { LX } from 'lexgui';
|
|
23
|
-
import 'lexgui/
|
|
23
|
+
import 'lexgui/extensions/codeeditor.js';
|
|
24
24
|
|
|
25
25
|
// init library and get main area
|
|
26
26
|
let area = await LX.init();
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
editor.loadFile("../data/rust_sample.rs");
|
|
65
65
|
editor.loadFile("../data/animation.bml", { language: "JSON" });
|
|
66
66
|
editor.loadFile("../data/CMakeLists.txt", { language: "CMake" });
|
|
67
|
-
editor.loadFile("../localhost.bat");
|
|
67
|
+
editor.loadFile("../data/localhost.bat");
|
|
68
68
|
editor.loadFile("../index.html");
|
|
69
69
|
|
|
70
70
|
if (!fileExplorer) {
|
package/examples/dialogs.html
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
6
6
|
<title>LexGUI Dialogs Demo</title>
|
|
7
7
|
<link rel="stylesheet" href="../build/lexgui.css">
|
|
8
|
-
<link rel="icon" href="../images/
|
|
8
|
+
<link rel="icon" href="../images/favicon.png">
|
|
9
9
|
<script type="importmap">
|
|
10
10
|
{
|
|
11
11
|
"imports": {
|
|
12
12
|
"lexgui": "../build/lexgui.module.js",
|
|
13
|
-
"lexgui/
|
|
13
|
+
"lexgui/extensions/": "../build/extensions/"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
</script>
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
|
|
98
98
|
var ctx = canvas.getContext("2d");
|
|
99
99
|
|
|
100
|
-
// Get values from panel
|
|
100
|
+
// Get values from panel component (e.g. color value)
|
|
101
101
|
ctx.fillStyle = pocketDialog.panel.getValue('Background');
|
|
102
102
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
103
103
|
|
package/examples/editor.html
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
7
7
|
<title>LexGUI Editor demo</title>
|
|
8
8
|
<link rel="stylesheet" href="../build/lexgui.css">
|
|
9
|
-
<link rel="icon" href="../images/
|
|
9
|
+
<link rel="icon" href="../images/favicon.png">
|
|
10
10
|
|
|
11
11
|
<script type="importmap">
|
|
12
12
|
{
|
|
13
13
|
"imports": {
|
|
14
14
|
"lexgui": "../build/lexgui.module.js",
|
|
15
|
-
"lexgui/
|
|
15
|
+
"lexgui/extensions/": "../build/extensions/"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
</script>
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
<script type="module">
|
|
27
27
|
|
|
28
28
|
import { LX } from 'lexgui';
|
|
29
|
-
import 'lexgui/
|
|
30
|
-
import 'lexgui/
|
|
31
|
-
import 'lexgui/
|
|
29
|
+
import 'lexgui/extensions/codeeditor.js';
|
|
30
|
+
import 'lexgui/extensions/timeline.js';
|
|
31
|
+
import 'lexgui/extensions/audio.js';
|
|
32
32
|
|
|
33
33
|
window.LX = LX;
|
|
34
34
|
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
{ name: "GLTF", kbd: "G" }
|
|
122
122
|
]
|
|
123
123
|
},
|
|
124
|
-
{ name: "
|
|
124
|
+
{ name: "Download", icon: "Download" }
|
|
125
125
|
]
|
|
126
126
|
},
|
|
127
127
|
{
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
{
|
|
131
131
|
name: "Settings", icon: "Settings2", callback: () => {
|
|
132
132
|
const dialog = new LX.Dialog("Settings", p => {
|
|
133
|
-
p.addText("A Text", "Testing first
|
|
133
|
+
p.addText("A Text", "Testing first Component");
|
|
134
134
|
p.sameLine(3);
|
|
135
135
|
p.addLabel("Buttons:");
|
|
136
136
|
p.addButton(null, "Click me", () => {
|
|
@@ -234,11 +234,20 @@
|
|
|
234
234
|
icon: starterTheme == "dark" ? "Moon" : "Sun",
|
|
235
235
|
swap: starterTheme == "dark" ? "Sun" : "Moon",
|
|
236
236
|
callback: (value, event) => { LX.switchTheme() }
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
title: "Switch Spacing",
|
|
240
|
+
icon: "AlignVerticalSpaceAround",
|
|
241
|
+
callback: (value, event) => { LX.switchSpacing() }
|
|
237
242
|
}
|
|
238
243
|
]);
|
|
239
244
|
|
|
240
245
|
menubar.setButtonIcon("Github", "Github@solid", () => { window.open("https://github.com/jxarco/lexgui.js/") })
|
|
241
|
-
menubar.setButtonImage("lexgui.js",
|
|
246
|
+
menubar.setButtonImage("lexgui.js", `../images/icon_small_${ starterTheme }.png`, () => { window.open("https://jxarco.github.io/lexgui.js/") }, { float: "left" } );
|
|
247
|
+
|
|
248
|
+
LX.addSignal( "@on_new_color_scheme", ( el, value ) => {
|
|
249
|
+
menubar.setButtonImage( "lexgui.js", `../images/icon_small_${ value }.png` );
|
|
250
|
+
} );
|
|
242
251
|
|
|
243
252
|
// split main area
|
|
244
253
|
var [left, right] = area.split({ sizes: ["70%", "30%"], minimizable: true });
|
|
@@ -522,7 +531,7 @@
|
|
|
522
531
|
|
|
523
532
|
var ctx = canvas.getContext("2d");
|
|
524
533
|
|
|
525
|
-
// Get values from panel
|
|
534
|
+
// Get values from panel components (e.g. color value)
|
|
526
535
|
ctx.fillStyle = sidePanel.getValue('Background');
|
|
527
536
|
|
|
528
537
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
@@ -657,7 +666,7 @@
|
|
|
657
666
|
}
|
|
658
667
|
});
|
|
659
668
|
|
|
660
|
-
// add
|
|
669
|
+
// add components to panel branch
|
|
661
670
|
panel.branch("Canvas", { icon: "Palette", filter: true });
|
|
662
671
|
panel.addColor("Background", "#b7a9b1", (value, event) => {
|
|
663
672
|
console.log(value);
|
|
@@ -837,9 +846,9 @@
|
|
|
837
846
|
}
|
|
838
847
|
], { vertical: false /*, showNames: true */ });
|
|
839
848
|
|
|
840
|
-
panel.addText(null, "
|
|
849
|
+
panel.addText(null, "Component below are out the tabs", null, { disabled: true })
|
|
841
850
|
|
|
842
|
-
// update panel values uising
|
|
851
|
+
// update panel values uising component name
|
|
843
852
|
panel.addNumber("HeadRoll Value", 0, (value, event) => {
|
|
844
853
|
panel.setValue('HeadRoll', value);
|
|
845
854
|
}, { min: -1, max: 1, step: 0.1 });
|
|
@@ -882,9 +891,9 @@
|
|
|
882
891
|
]);
|
|
883
892
|
|
|
884
893
|
/************** */
|
|
885
|
-
// Custom
|
|
894
|
+
// Custom Component
|
|
886
895
|
|
|
887
|
-
LX.
|
|
896
|
+
LX.ADD_CUSTOM_COMPONENT("Shader", {
|
|
888
897
|
icon: "Box",
|
|
889
898
|
default: {
|
|
890
899
|
position: [0, 0],
|
|
@@ -911,9 +920,9 @@
|
|
|
911
920
|
|
|
912
921
|
function fillBottomPanel(panel) {
|
|
913
922
|
|
|
914
|
-
// add
|
|
923
|
+
// add components to panel branch
|
|
915
924
|
panel.branch("Information", { icon: "Info" });
|
|
916
|
-
window.
|
|
925
|
+
window.tableComponent = panel.addTable("A Table", {
|
|
917
926
|
head: ["Name", "Status", "Priority", "ID"],
|
|
918
927
|
body: [
|
|
919
928
|
["Alice", "In Progress", "High", 1],
|
|
@@ -946,7 +955,7 @@
|
|
|
946
955
|
{
|
|
947
956
|
name: "Export", callback: (a) => {
|
|
948
957
|
tableData.body[index][0] = "Alex";
|
|
949
|
-
|
|
958
|
+
tableComponent.refresh();
|
|
950
959
|
}
|
|
951
960
|
},
|
|
952
961
|
{ name: "Make a copy", callback: (a) => console.log(a) },
|
|
@@ -1103,7 +1112,7 @@
|
|
|
1103
1112
|
break;
|
|
1104
1113
|
}
|
|
1105
1114
|
})
|
|
1106
|
-
}, { title: 'Lexemes', close: true, minimize: false, size: ["80%"], scroll: true, resizable: true, draggable: true });
|
|
1115
|
+
}, { modal: true, title: 'Lexemes', close: true, minimize: false, size: ["80%"], scroll: true, resizable: true, draggable: true });
|
|
1107
1116
|
}
|
|
1108
1117
|
|
|
1109
1118
|
</script>
|