lexgui 0.7.15 → 8.1.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.
- package/LICENSE +201 -21
- package/README.md +14 -5
- package/build/components/AlertDialog.d.ts +7 -0
- package/build/components/ArrayInput.d.ts +9 -0
- package/build/components/BaseComponent.d.ts +73 -0
- package/build/components/Button.d.ts +14 -0
- package/build/components/Calendar.d.ts +41 -0
- package/build/components/CalendarRange.d.ts +16 -0
- package/build/components/CanvasCurve.d.ts +10 -0
- package/build/components/CanvasDial.d.ts +11 -0
- package/build/components/CanvasMap2D.d.ts +61 -0
- package/build/components/Card.d.ts +8 -0
- package/build/components/Checkbox.d.ts +8 -0
- package/build/components/Color.d.ts +20 -0
- package/build/components/ColorInput.d.ts +13 -0
- package/build/components/ColorPicker.d.ts +29 -0
- package/build/components/ComboButtons.d.ts +8 -0
- package/build/components/ContextMenu.d.ts +16 -0
- package/build/components/Counter.d.ts +9 -0
- package/build/components/Curve.d.ts +10 -0
- package/build/components/DatePicker.d.ts +13 -0
- package/build/components/Dial.d.ts +10 -0
- package/build/components/Dialog.d.ts +20 -0
- package/build/components/DropdownMenu.d.ts +32 -0
- package/build/components/FileInput.d.ts +8 -0
- package/build/components/Footer.d.ts +14 -0
- package/build/components/Form.d.ts +8 -0
- package/build/components/Layers.d.ts +9 -0
- package/build/components/List.d.ts +9 -0
- package/build/components/Map2D.d.ts +12 -0
- package/build/components/Menubar.d.ts +59 -0
- package/build/components/NodeTree.d.ts +26 -0
- package/build/components/NumberInput.d.ts +9 -0
- package/build/components/OTPInput.d.ts +8 -0
- package/build/components/Pad.d.ts +8 -0
- package/build/components/Pagination.d.ts +26 -0
- package/build/components/PocketDialog.d.ts +11 -0
- package/build/components/Popover.d.ts +20 -0
- package/build/components/Progress.d.ts +8 -0
- package/build/components/RadioGroup.d.ts +8 -0
- package/build/components/RangeInput.d.ts +11 -0
- package/build/components/Rate.d.ts +8 -0
- package/build/components/Select.d.ts +10 -0
- package/build/components/Sheet.d.ts +10 -0
- package/build/components/Sidebar.d.ts +84 -0
- package/build/components/SizeInput.d.ts +8 -0
- package/build/components/Skeleton.d.ts +5 -0
- package/build/components/Spinner.d.ts +9 -0
- package/build/components/TabSections.d.ts +11 -0
- package/build/components/Table.d.ts +34 -0
- package/build/components/Tabs.d.ts +20 -0
- package/build/components/Tags.d.ts +9 -0
- package/build/components/TextArea.d.ts +8 -0
- package/build/components/TextInput.d.ts +11 -0
- package/build/components/Title.d.ts +8 -0
- package/build/components/Toggle.d.ts +8 -0
- package/build/components/Tour.d.ts +36 -0
- package/build/components/Vector.d.ts +9 -0
- package/build/core/Area.d.ts +143 -0
- package/build/core/Branch.d.ts +19 -0
- package/build/core/Core.d.ts +1 -0
- package/build/core/Event.d.ts +26 -0
- package/build/core/Icons.d.ts +4 -0
- package/build/core/Namespace.d.ts +2 -0
- package/build/core/Namespace.js +34 -0
- package/build/core/Namespace.js.map +1 -0
- package/build/core/Panel.d.ts +538 -0
- package/build/core/Utils.d.ts +1 -0
- package/build/core/Vec2.d.ts +21 -0
- package/build/extensions/AssetView.d.ts +136 -0
- package/build/extensions/AssetView.js +1367 -0
- package/build/extensions/AssetView.js.map +1 -0
- package/build/extensions/Audio.d.ts +9 -0
- package/build/extensions/Audio.js +163 -0
- package/build/extensions/Audio.js.map +1 -0
- package/build/extensions/CodeEditor.d.ts +350 -0
- package/build/extensions/CodeEditor.js +5022 -0
- package/build/extensions/CodeEditor.js.map +1 -0
- package/build/extensions/DocMaker.d.ts +27 -0
- package/build/extensions/DocMaker.js +327 -0
- package/build/extensions/DocMaker.js.map +1 -0
- package/build/extensions/GraphEditor.d.ts +276 -0
- package/build/extensions/GraphEditor.js +2770 -0
- package/build/extensions/GraphEditor.js.map +1 -0
- package/build/extensions/ImUi.d.ts +46 -0
- package/build/extensions/ImUi.js +227 -0
- package/build/extensions/ImUi.js.map +1 -0
- package/build/extensions/Timeline.d.ts +670 -0
- package/build/extensions/Timeline.js +3955 -0
- package/build/extensions/Timeline.js.map +1 -0
- package/build/extensions/VideoEditor.d.ts +128 -0
- package/build/extensions/VideoEditor.js +898 -0
- package/build/extensions/VideoEditor.js.map +1 -0
- package/build/extensions/index.d.ts +8 -0
- package/build/extensions/index.js +10 -0
- package/build/extensions/index.js.map +1 -0
- package/build/index.all.d.ts +2 -0
- package/build/index.css.d.ts +4 -0
- package/build/index.d.ts +56 -0
- package/build/lexgui.all.js +28498 -0
- package/build/lexgui.all.js.map +1 -0
- package/build/lexgui.all.min.js +1 -0
- package/build/lexgui.all.module.js +28422 -0
- package/build/lexgui.all.module.js.map +1 -0
- package/build/lexgui.all.module.min.js +1 -0
- package/build/lexgui.css +939 -346
- package/build/lexgui.js +13406 -17286
- package/build/lexgui.js.map +1 -0
- package/build/lexgui.min.css +3 -10
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +12762 -16698
- package/build/lexgui.module.js.map +1 -0
- package/build/lexgui.module.min.js +1 -1
- package/changelog.md +170 -74
- package/demo.js +162 -48
- package/examples/all-components.html +45 -14
- package/examples/asset-view.html +110 -47
- package/examples/code-editor.html +5 -5
- package/examples/dialogs.html +3 -3
- package/examples/editor.html +27 -13
- package/examples/index.html +19 -14
- package/examples/node-graph.html +2 -2
- package/examples/previews/video-editor.png +0 -0
- package/examples/timeline.html +1 -1
- package/examples/video-editor.html +2 -2
- package/package.json +25 -9
- package/build/extensions/audio.js +0 -212
- package/build/extensions/codeeditor.js +0 -6319
- package/build/extensions/docmaker.js +0 -432
- package/build/extensions/imui.js +0 -325
- package/build/extensions/nodegraph.js +0 -3696
- package/build/extensions/timeline.js +0 -4636
- package/build/extensions/videoeditor.js +0 -953
- package/build/lexgui-docs.css +0 -352
package/demo.js
CHANGED
|
@@ -1,74 +1,118 @@
|
|
|
1
1
|
import { LX } from 'lexgui';
|
|
2
|
-
import 'lexgui/extensions/
|
|
3
|
-
import 'lexgui/extensions/timeline.js';
|
|
4
|
-
import 'lexgui/extensions/audio.js';
|
|
2
|
+
import { CodeEditor } from 'lexgui/extensions/CodeEditor.js';
|
|
5
3
|
|
|
6
4
|
window.LX = LX;
|
|
7
5
|
|
|
8
6
|
const area = await LX.init( { layoutMode: "document", rootClass: "wrapper" } );
|
|
9
7
|
const starterTheme = LX.getTheme();
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const mobile = navigator && /Android|iPhone/i.test( navigator.userAgent );
|
|
9
|
+
const localHost = window.location.protocol !== "https:";
|
|
10
|
+
const menubarButtons = [
|
|
11
|
+
{ name: "Docs", callback: () => { window.open("./docs/") } },
|
|
12
|
+
{ name: "Examples", callback: () => { window.open("./examples/") } },
|
|
13
|
+
{ name: "Components", callback: () => { window.open("./docs/?p=components") } },
|
|
14
|
+
{ name: "Colors", callback: () => { window.open("./colors/", "_self") } },
|
|
15
|
+
{ name: "Icons", callback: () => { window.open("./icons/", "_self") } },
|
|
16
|
+
];
|
|
17
|
+
let menubar = null, sheetArea = null;
|
|
18
|
+
|
|
19
|
+
if( mobile )
|
|
12
20
|
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
menubar = area.addMenubar();
|
|
22
|
+
|
|
23
|
+
sheetArea = new LX.Area({ skipAppend: true });
|
|
24
|
+
sheetArea.addSidebar( ( m ) => {
|
|
25
|
+
|
|
26
|
+
m.group( "Menu" );
|
|
18
27
|
|
|
19
|
-
|
|
28
|
+
for( let b of menubarButtons )
|
|
29
|
+
{
|
|
30
|
+
m.add( b.name, { callback: b.callback } );
|
|
31
|
+
}
|
|
20
32
|
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
}, {
|
|
34
|
+
headerTitle: `lexgui.js`,
|
|
35
|
+
headerSubtitle: `v${ LX.version }`,
|
|
36
|
+
headerImage: "./images/favicon.png",
|
|
37
|
+
footerTitle: "jxarco",
|
|
38
|
+
footerSubtitle: "alexroco.30@gmail.com",
|
|
39
|
+
footerImage: "https://avatars.githubusercontent.com/u/25059187?s=400&u=ad8907b748c13e4e1a7cdd3882826acb6a2928b5&v=4",
|
|
40
|
+
collapsed: false,
|
|
41
|
+
collapsable: false,
|
|
42
|
+
displaySelected: false
|
|
23
43
|
} );
|
|
44
|
+
}
|
|
45
|
+
else
|
|
46
|
+
{
|
|
47
|
+
menubar = area.addMenubar( menubarButtons );
|
|
24
48
|
|
|
25
49
|
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 ) }, {
|
|
26
|
-
width: "256px", className: "right", buttonClass: "
|
|
50
|
+
width: "256px", className: "right", buttonClass: "p-4 fg-tertiary bg-primary" }
|
|
27
51
|
);
|
|
28
52
|
menubar.root.appendChild( commandButton.root );
|
|
53
|
+
}
|
|
29
54
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
menubar.setButtonImage("lexgui.js", `images/icon_${ starterTheme }.png`, () => { window.location.href = window.origin + window.location.pathname }, { float: "left"} );
|
|
56
|
+
LX.addSignal( "@on_new_color_scheme", ( el, value ) => {
|
|
57
|
+
menubar.setButtonImage("lexgui.js", `images/icon_${ value }.png` );
|
|
58
|
+
} );
|
|
59
|
+
|
|
60
|
+
menubar.siblingArea.root.style.overflowY = "scroll";
|
|
61
|
+
|
|
62
|
+
menubar.addButtons( [
|
|
63
|
+
{
|
|
64
|
+
title: "Github",
|
|
65
|
+
icon: "Github@solid",
|
|
66
|
+
callback: (event) => window.open( "https://github.com/jxarco/lexgui.js/", "_blank" )
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
title: "Switch Theme",
|
|
70
|
+
icon: starterTheme == "dark" ? "Moon" : "Sun",
|
|
71
|
+
swap: starterTheme == "dark" ? "Sun" : "Moon",
|
|
72
|
+
callback: (value, event) => { LX.switchTheme() }
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
title: "Switch Spacing",
|
|
76
|
+
icon: "AlignVerticalSpaceAround",
|
|
77
|
+
callback: (value, event) => { LX.switchSpacing() }
|
|
78
|
+
}
|
|
79
|
+
], { float: "right" });
|
|
80
|
+
|
|
81
|
+
if( mobile )
|
|
82
|
+
{
|
|
83
|
+
menubar.root.querySelector( ".lexmenubuttons" ).style.marginLeft = "auto";
|
|
84
|
+
|
|
85
|
+
const commandButton = new LX.Button(null, LX.makeIcon( "Menu" ).innerHTML, () => {
|
|
86
|
+
window.__currentSheet = new LX.Sheet("256px", [ sheetArea ] );
|
|
87
|
+
}, { buttonClass: "p-4 bg-none fg-tertiary" } );
|
|
88
|
+
menubar.root.prepend( commandButton.root );
|
|
48
89
|
}
|
|
49
90
|
|
|
50
91
|
// Header
|
|
51
92
|
{
|
|
52
|
-
const header = LX.makeContainer( [ null, "auto" ], "flex flex-col
|
|
53
|
-
<a
|
|
54
|
-
|
|
55
|
-
<p class="font-
|
|
56
|
-
|
|
93
|
+
const header = LX.makeContainer( [ null, "auto" ], "flex flex-col gap-4 pt-8 pb-4 items-center", `
|
|
94
|
+
<a href="docs?p=changelog" class="flex flex-row gap-1 items-center text-sm p-1 px-4 rounded-full fg-primary decoration-none hover:bg-secondary cursor-pointer"><span class="flex bg-accent w-2 h-2 rounded-full"></span>
|
|
95
|
+
New Components: Spinner, Pagination and more${ LX.makeIcon( "ArrowRight", { svgClass: "sm" } ).innerHTML }</a>
|
|
96
|
+
<p class="fg-primary font-medium tracking-tight leading-none text-center text-balance text-5xl xs:text-4xl">Build your Application Interface</p>
|
|
97
|
+
<p class="fg-primary font-light text-xl xs:text-lg text-center text-balance leading-normal max-w-3xl">A modern-style UI kit, inspired by shadcn, built for the web. Pure JavaScript, CSS, zero dependencies. Fully Open Source.</p>
|
|
57
98
|
`, area );
|
|
58
99
|
|
|
59
|
-
const headerButtons = LX.makeContainer( [ "auto", "auto" ], "flex flex-row", ``, header );
|
|
60
|
-
const getStartedButton = new LX.Button( null,
|
|
61
|
-
const componentsButton = new LX.Button( null, "View Components", () => window.open( "./docs/?p=components", "_blank" ), { buttonClass: "tertiary
|
|
100
|
+
const headerButtons = LX.makeContainer( [ "auto", "auto" ], "flex flex-row mt-2", ``, header );
|
|
101
|
+
const getStartedButton = new LX.Button( null, `Get Started <span class="text-lg">${ LX.version }</span>`, () => window.open( "./docs/", "_blank" ), { buttonClass: "contrast" } );
|
|
102
|
+
const componentsButton = new LX.Button( null, "View Components", () => window.open( "./docs/?p=components", "_blank" ), { buttonClass: "tertiary" } );
|
|
62
103
|
headerButtons.appendChild( getStartedButton.root );
|
|
63
104
|
headerButtons.appendChild( componentsButton.root );
|
|
64
105
|
}
|
|
65
106
|
|
|
66
107
|
// Content
|
|
67
108
|
{
|
|
68
|
-
|
|
109
|
+
let tabs = null;
|
|
69
110
|
|
|
70
111
|
// Editor
|
|
112
|
+
if( !mobile )
|
|
71
113
|
{
|
|
114
|
+
tabs = area.addTabs( { parentClass: "p-4", sizes: [ "auto", "auto" ], contentClass: "p-6 pt-0" } );
|
|
115
|
+
|
|
72
116
|
const editorContainer = LX.makeContainer( [ null, "800px" ], "flex flex-col bg-primary border rounded-lg overflow-hidden" );
|
|
73
117
|
tabs.add( "Editor", editorContainer, { selected: true } );
|
|
74
118
|
|
|
@@ -259,7 +303,7 @@ const starterTheme = LX.getTheme();
|
|
|
259
303
|
panel.addText("Text", "LexGUI.js @jxarco", null, {placeholder: "e.g. ColorPicker", icon: "Type"});
|
|
260
304
|
panel.addColor("Font Color", "#303b8d", null);
|
|
261
305
|
panel.addNumber("Font Size", 36, null, { min: 1, max: 48, step: 1, units: "px"});
|
|
262
|
-
panel.addSelect("Font Family", ["Arial", "GeistSans", "Monospace", "CascadiaCode"], "GeistSans");
|
|
306
|
+
panel.addSelect("Font Family", ["Arial", "GeistSans", "Inter", "Monospace", "CascadiaCode"], "GeistSans");
|
|
263
307
|
panel.addRange("Threshold Range", [2, 7], (v) => console.log(v), { min: 0, max: 10, step: 1, className: "accent" });
|
|
264
308
|
panel.addVector2("2D Position", [300, 350], null, { min: 0, max: 1024 });
|
|
265
309
|
const opacityValues = [
|
|
@@ -305,14 +349,81 @@ const starterTheme = LX.getTheme();
|
|
|
305
349
|
}
|
|
306
350
|
}
|
|
307
351
|
|
|
352
|
+
// Examples
|
|
353
|
+
{
|
|
354
|
+
const examplesContainer = LX.makeContainer( [ null, "auto" ], `${ mobile ? "flex flex-col" : "grid grid-cols-4" } gap-3 bg-background rounded-lg p-6 overflow-hidden` );
|
|
355
|
+
|
|
356
|
+
if( tabs )
|
|
357
|
+
{
|
|
358
|
+
tabs.add( "Examples", examplesContainer, { xselected: true } );
|
|
359
|
+
}
|
|
360
|
+
else
|
|
361
|
+
{
|
|
362
|
+
area.attach( examplesContainer );
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
{
|
|
366
|
+
const panel = new LX.Panel( { className: "rounded-lg border p-4 flex flex-col gap-4" } );
|
|
367
|
+
panel.addColor("Background", "#b7a9b1", null);
|
|
368
|
+
panel.addText("Text", "LexGUI.js @jxarco", null, {placeholder: "e.g. ColorPicker", icon: "Type"});
|
|
369
|
+
panel.addColor("Font Color", "#303b8d", null);
|
|
370
|
+
panel.addNumber("Font Size", 36, null, { min: 1, max: 48, step: 1, units: "px"});
|
|
371
|
+
panel.addSelect("Font Family", ["Arial", "GeistSans", "Monospace", "CascadiaCode"], "GeistSans");
|
|
372
|
+
panel.addRange("Threshold Range", [2, 7], (v) => console.log(v), { min: 0, max: 10, step: 1, className: "accent" });
|
|
373
|
+
panel.addVector2("2D Position", [300, 350], null, { min: 0, max: 1024 });
|
|
374
|
+
|
|
375
|
+
examplesContainer.appendChild( panel.root );
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
{
|
|
379
|
+
const panel = new LX.Panel( { className: "p-4 flex flex-col gap-4" } );
|
|
380
|
+
panel.addColor("Background", "#b7a9b1", null);
|
|
381
|
+
panel.addText("Text", "LexGUI.js @jxarco", null, {placeholder: "e.g. ColorPicker", icon: "Type"});
|
|
382
|
+
panel.addColor("Font Color", "#303b8d", null);
|
|
383
|
+
panel.addNumber("Font Size", 36, null, { min: 1, max: 48, step: 1, units: "px"});
|
|
384
|
+
panel.addSelect("Font Family", ["Arial", "GeistSans", "Monospace", "CascadiaCode"], "GeistSans");
|
|
385
|
+
panel.addRange("Threshold Range", [2, 7], (v) => console.log(v), { min: 0, max: 10, step: 1, className: "accent" });
|
|
386
|
+
panel.addVector2("2D Position", [300, 350], null, { min: 0, max: 1024 });
|
|
387
|
+
|
|
388
|
+
examplesContainer.appendChild( panel.root );
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
{
|
|
392
|
+
const panel = new LX.Panel( { className: "p-4 flex flex-col gap-4" } );
|
|
393
|
+
panel.addColor("Background", "#b7a9b1", null);
|
|
394
|
+
panel.addText("Text", "LexGUI.js @jxarco", null, {placeholder: "e.g. ColorPicker", icon: "Type"});
|
|
395
|
+
panel.addColor("Font Color", "#303b8d", null);
|
|
396
|
+
panel.addNumber("Font Size", 36, null, { min: 1, max: 48, step: 1, units: "px"});
|
|
397
|
+
panel.addSelect("Font Family", ["Arial", "GeistSans", "Monospace", "CascadiaCode"], "GeistSans");
|
|
398
|
+
panel.addRange("Threshold Range", [2, 7], (v) => console.log(v), { min: 0, max: 10, step: 1, className: "accent" });
|
|
399
|
+
panel.addVector2("2D Position", [300, 350], null, { min: 0, max: 1024 });
|
|
400
|
+
|
|
401
|
+
examplesContainer.appendChild( panel.root );
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
{
|
|
405
|
+
const panel = new LX.Panel( { className: "p-4 flex flex-col gap-4" } );
|
|
406
|
+
panel.addColor("Background", "#b7a9b1", null);
|
|
407
|
+
panel.addText("Text", "LexGUI.js @jxarco", null, {placeholder: "e.g. ColorPicker", icon: "Type"});
|
|
408
|
+
panel.addColor("Font Color", "#303b8d", null);
|
|
409
|
+
panel.addNumber("Font Size", 36, null, { min: 1, max: 48, step: 1, units: "px"});
|
|
410
|
+
panel.addSelect("Font Family", ["Arial", "GeistSans", "Monospace", "CascadiaCode"], "GeistSans");
|
|
411
|
+
panel.addRange("Threshold Range", [2, 7], (v) => console.log(v), { min: 0, max: 10, step: 1, className: "accent" });
|
|
412
|
+
panel.addVector2("2D Position", [300, 350], null, { min: 0, max: 1024 });
|
|
413
|
+
|
|
414
|
+
examplesContainer.appendChild( panel.root );
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
308
418
|
// Mail
|
|
419
|
+
if( !mobile )
|
|
309
420
|
{
|
|
310
421
|
const mailContainer = LX.makeContainer( [ null, "800px" ], "flex flex-col bg-primary border rounded-lg overflow-hidden" );
|
|
311
|
-
tabs.add( "Mail", mailContainer, { xselected: true, badge: { content: "5", className: "
|
|
422
|
+
tabs.add( "Mail", mailContainer, { xselected: true, badge: { content: "5", className: "sm fg-white bg-error", asChild: true } } );
|
|
312
423
|
|
|
313
424
|
const mailArea = new LX.Area();
|
|
314
425
|
mailContainer.appendChild( mailArea.root );
|
|
315
|
-
const badgeClass = "ml-auto
|
|
426
|
+
const badgeClass = "ml-auto bg-none font-medium";
|
|
316
427
|
|
|
317
428
|
const sidebar = mailArea.addSidebar( m => {
|
|
318
429
|
m.add( "Inbox", { selected: true, icon: "Inbox", content: LX.badge("128", badgeClass, { asElement: true }) } );
|
|
@@ -394,7 +505,7 @@ const starterTheme = LX.getTheme();
|
|
|
394
505
|
msgTags.appendChild( LX.badge( tag, "sm", { asElement: true } ) );
|
|
395
506
|
}
|
|
396
507
|
|
|
397
|
-
|
|
508
|
+
LX.listen( msgContent, "click", function() {
|
|
398
509
|
mailContainer.childNodes.forEach( e => e.classList.remove( "bg-secondary" ) );
|
|
399
510
|
this.classList.add( "bg-secondary" );
|
|
400
511
|
window.__openMail( mail );
|
|
@@ -481,7 +592,7 @@ const starterTheme = LX.getTheme();
|
|
|
481
592
|
LX.toast( "Message sent!", "To:" + mail.email, { timeout: 5000, action: { name: "Undo", callback: ( toast, actionName, event ) => {
|
|
482
593
|
toast.close();
|
|
483
594
|
} } } );
|
|
484
|
-
}, { className: "ml-auto", buttonClass: "contrast
|
|
595
|
+
}, { className: "ml-auto", buttonClass: "contrast" } );
|
|
485
596
|
previewButtons.appendChild( sendButton.root );
|
|
486
597
|
};
|
|
487
598
|
}
|
|
@@ -489,8 +600,9 @@ const starterTheme = LX.getTheme();
|
|
|
489
600
|
}
|
|
490
601
|
|
|
491
602
|
// Tasks
|
|
603
|
+
if( !mobile )
|
|
492
604
|
{
|
|
493
|
-
const tasksContainer = LX.makeContainer( [ null, "auto" ], "col bg-
|
|
605
|
+
const tasksContainer = LX.makeContainer( [ null, "auto" ], "col bg-background border rounded-lg p-6 overflow-hidden" );
|
|
494
606
|
tabs.add( "Tasks", tasksContainer, { xselected: true } );
|
|
495
607
|
|
|
496
608
|
const header = LX.makeContainer( [ null, "auto" ], "col p-4", `
|
|
@@ -516,6 +628,7 @@ const starterTheme = LX.getTheme();
|
|
|
516
628
|
sortable: true,
|
|
517
629
|
toggleColumns: true,
|
|
518
630
|
filter: "Name",
|
|
631
|
+
// tableClass: "bg-primary",
|
|
519
632
|
customFilters: [
|
|
520
633
|
{ name: "Status", options: ["Backlog", "Todo", "In Progress", "Done", "Canceled"] },
|
|
521
634
|
{ name: "Priority", options: ["Low", "Medium", "High"] },
|
|
@@ -541,6 +654,7 @@ const starterTheme = LX.getTheme();
|
|
|
541
654
|
}
|
|
542
655
|
|
|
543
656
|
// Code
|
|
657
|
+
if( !mobile )
|
|
544
658
|
{
|
|
545
659
|
const codeContainer = LX.makeContainer( [ "auto", "800px" ], "flex flex-col border rounded-lg overflow-hidden" );
|
|
546
660
|
tabs.add( "Code", codeContainer );
|
|
@@ -548,7 +662,7 @@ const starterTheme = LX.getTheme();
|
|
|
548
662
|
const codeArea = new LX.Area();
|
|
549
663
|
codeContainer.appendChild( codeArea.root );
|
|
550
664
|
|
|
551
|
-
let editor = new
|
|
665
|
+
let editor = new CodeEditor(codeArea, {
|
|
552
666
|
// allowAddScripts: false,
|
|
553
667
|
// autocomplete: false,
|
|
554
668
|
// disableEdition: true,
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
|
|
26
26
|
<script type="module">
|
|
27
27
|
import { LX } from 'lexgui';
|
|
28
|
-
import 'lexgui/extensions/codeeditor.js';
|
|
29
28
|
|
|
30
29
|
window.LX = LX;
|
|
31
30
|
|
|
32
31
|
// Init library and get main area
|
|
33
32
|
let area = await LX.init();
|
|
34
33
|
|
|
34
|
+
const mobile = navigator && /Android|iPhone/i.test( navigator.userAgent );
|
|
35
35
|
const starterTheme = LX.getTheme();
|
|
36
36
|
const menubar = area.addMenubar( [], { sticky: false } );
|
|
37
37
|
menubar.addButtons([
|
|
@@ -60,13 +60,22 @@
|
|
|
60
60
|
menubar.setButtonImage( "lexgui.js", `../images/icon_small_${ value }.png` );
|
|
61
61
|
} );
|
|
62
62
|
|
|
63
|
-
var
|
|
64
|
-
var [left, center] = middle.split({ sizes: ["50%", null], minimizable: true });
|
|
63
|
+
var panelA, panelB, panelC;
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
if( mobile )
|
|
66
|
+
{
|
|
67
|
+
panelA = panelB = panelC = area.addPanel();
|
|
68
|
+
}
|
|
69
|
+
else
|
|
70
|
+
{
|
|
71
|
+
var [middle, right] = area.split({ sizes: ["70%", "30%"], minimizable: true });
|
|
72
|
+
var [left, center] = middle.split({ sizes: ["50%", null], minimizable: true });
|
|
73
|
+
|
|
74
|
+
// add panels
|
|
75
|
+
panelA = left.addPanel();
|
|
76
|
+
panelB = center.addPanel();
|
|
77
|
+
panelC = right.addPanel();
|
|
78
|
+
}
|
|
70
79
|
|
|
71
80
|
let closedDefault = false;
|
|
72
81
|
|
|
@@ -99,17 +108,25 @@
|
|
|
99
108
|
|
|
100
109
|
const selectValues = ["Godot", "Unity", "Unreal Engine", "Visual Studio", "Visual Studio Code"];
|
|
101
110
|
const selectValuesWithLabels = ["@Engines", "Godot", "Unity", "Unreal Engine", "@Apps", "Visual Studio", "Visual Studio Code"];
|
|
102
|
-
|
|
103
111
|
const loremText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
|
|
104
112
|
|
|
105
113
|
// Test buttons
|
|
106
114
|
{
|
|
107
115
|
const buttonsArea = new LX.Area({ width: "100%", height: "auto" });
|
|
108
|
-
var [buttonsLeft, buttonsRight] = buttonsArea.split({ sizes: ["50%", "50%"] });
|
|
109
116
|
panelA.attach(buttonsArea.root);
|
|
110
117
|
|
|
111
|
-
|
|
112
|
-
|
|
118
|
+
let buttonsLeftPanel, buttonsRightPanel;
|
|
119
|
+
|
|
120
|
+
if( mobile )
|
|
121
|
+
{
|
|
122
|
+
buttonsLeftPanel = buttonsRightPanel = buttonsArea.addPanel();
|
|
123
|
+
}
|
|
124
|
+
else
|
|
125
|
+
{
|
|
126
|
+
var [ buttonsLeft, buttonsRight ] = buttonsArea.split({ sizes: ["50%", "50%"] });
|
|
127
|
+
buttonsLeftPanel = buttonsLeft.addPanel();
|
|
128
|
+
buttonsRightPanel = buttonsRight.addPanel();
|
|
129
|
+
}
|
|
113
130
|
|
|
114
131
|
buttonsLeftPanel.branch("Classic Buttons", { closed: closedDefault });
|
|
115
132
|
buttonsLeftPanel.addButton(null, "Classic", null);
|
|
@@ -168,12 +185,23 @@
|
|
|
168
185
|
buttonsRightPanel.addComboButtons("No Selection Combo", comboValues, { noSelection: true });
|
|
169
186
|
}
|
|
170
187
|
|
|
188
|
+
|
|
189
|
+
|
|
171
190
|
const checkArea = new LX.Area({ width: "100%", height: "auto" });
|
|
172
|
-
var [checkLeft, checkRight] = checkArea.split({ sizes: ["50%", "50%"] });
|
|
173
191
|
panelA.attach(checkArea.root);
|
|
174
192
|
|
|
175
|
-
|
|
176
|
-
|
|
193
|
+
let checkLeftPanel, checkRightPanel;
|
|
194
|
+
|
|
195
|
+
if( mobile )
|
|
196
|
+
{
|
|
197
|
+
checkLeftPanel = checkRightPanel = checkArea.addPanel();
|
|
198
|
+
}
|
|
199
|
+
else
|
|
200
|
+
{
|
|
201
|
+
var [checkLeft, checkRight] = checkArea.split({ sizes: ["50%", "50%"] });
|
|
202
|
+
checkLeftPanel = buttonsLeft.addPanel();
|
|
203
|
+
checkRightPanel = buttonsRight.addPanel();
|
|
204
|
+
}
|
|
177
205
|
|
|
178
206
|
// Test Checkboxes
|
|
179
207
|
{
|
|
@@ -235,6 +263,9 @@
|
|
|
235
263
|
panelB.addNumber("With Units", 12, null, { units: "px" });
|
|
236
264
|
panelB.addNumber("With Slider", 0, null, { min: 1, max: 48, step: 1 });
|
|
237
265
|
panelB.addNumber("Disabled Slider", 0, null, { min: 1, max: 48, step: 1, disabled: true });
|
|
266
|
+
panelB.branch("Counter Inputs", { closed: closedDefault });
|
|
267
|
+
panelB.addCounter("Classic", 0, null, { min: 1, max: 48, step: 1 });
|
|
268
|
+
panelB.addCounter("Disabled", 0, null, { min: 1, max: 48, step: 1, disabled: true });
|
|
238
269
|
panelB.branch("Vector Inputs", { closed: closedDefault });
|
|
239
270
|
panelB.addVector2("Classic Vec2", [0, 0], null);
|
|
240
271
|
panelB.addVector3("Disabled Vec3", [0, 0, 0], null, { disabled: true });
|
package/examples/asset-view.html
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
<script type="module">
|
|
21
21
|
|
|
22
22
|
import { LX } from 'lexgui';
|
|
23
|
-
import 'lexgui/extensions/
|
|
23
|
+
import { CodeEditor } from 'lexgui/extensions/CodeEditor.js';
|
|
24
|
+
import { AssetView } from 'lexgui/extensions/AssetView.js';
|
|
24
25
|
|
|
25
26
|
// Init library and get main area
|
|
26
27
|
let area = await LX.init();
|
|
@@ -44,14 +45,20 @@
|
|
|
44
45
|
canvas.height = bounding.height;
|
|
45
46
|
};
|
|
46
47
|
|
|
47
|
-
let assetView = new
|
|
48
|
+
let assetView = new AssetView({
|
|
48
49
|
// useNativeTitle: true,
|
|
49
50
|
// skipBrowser: true,
|
|
50
51
|
// skipPreview: true,
|
|
51
52
|
// rootPath: "../",
|
|
52
53
|
// onlyFolders: false,
|
|
54
|
+
allowedTypes: {
|
|
55
|
+
"Mesh": { color: "rose-800" },
|
|
56
|
+
"Script": { color: "orange-500" },
|
|
57
|
+
"Clip": { color: "fuchsia-600" },
|
|
58
|
+
"SIGML": { color: "emerald-300" },
|
|
59
|
+
},
|
|
53
60
|
itemContextMenuOptions: [
|
|
54
|
-
{ name: "
|
|
61
|
+
{ name: "Like", callback: ( item ) => { console.log(item) } }
|
|
55
62
|
]
|
|
56
63
|
});
|
|
57
64
|
bottomArea.attach(assetView);
|
|
@@ -77,13 +84,19 @@
|
|
|
77
84
|
{
|
|
78
85
|
id: "Avatar",
|
|
79
86
|
type: "Avatar",
|
|
80
|
-
|
|
87
|
+
metadata: {
|
|
88
|
+
preview: "https://models.readyplayer.me/66e30a18eca8fb70dcadde68.png?background=68,68,245",
|
|
89
|
+
volume: 0.5,
|
|
90
|
+
}
|
|
81
91
|
},
|
|
82
92
|
{
|
|
83
93
|
id: "video-test",
|
|
84
94
|
type: "video",
|
|
85
|
-
|
|
86
|
-
|
|
95
|
+
src: "https://catsl.eelvex.net/static/vid/teacher-video-Ψ.mp4",
|
|
96
|
+
metadata: {
|
|
97
|
+
preview: "https://godotengine.org/assets/press/logo_vertical_color_dark.png",
|
|
98
|
+
volume: 0.5,
|
|
99
|
+
}
|
|
87
100
|
},
|
|
88
101
|
{
|
|
89
102
|
id: "nyan-pyportal.gif",
|
|
@@ -94,13 +107,17 @@
|
|
|
94
107
|
id: "sigml_test.sigml",
|
|
95
108
|
type: "sigml",
|
|
96
109
|
src: "../data/sigml_test.sigml",
|
|
97
|
-
|
|
110
|
+
metadata: {
|
|
111
|
+
lastModified: 1740588312813
|
|
112
|
+
}
|
|
98
113
|
},
|
|
99
114
|
{
|
|
100
115
|
id: "json_sample.json",
|
|
101
116
|
type: "JSON",
|
|
102
117
|
src: "../data/json_sample.json",
|
|
103
|
-
|
|
118
|
+
metadata: {
|
|
119
|
+
lastModified: 1740581312813
|
|
120
|
+
}
|
|
104
121
|
},
|
|
105
122
|
{
|
|
106
123
|
id: "godot",
|
|
@@ -178,53 +195,99 @@
|
|
|
178
195
|
id: "brow_lowerer.png",
|
|
179
196
|
type: "clip",
|
|
180
197
|
src: "../data/brow_lowerer.png",
|
|
181
|
-
|
|
198
|
+
metadata: {
|
|
199
|
+
lastModified: 1740181312813
|
|
200
|
+
}
|
|
182
201
|
}
|
|
183
202
|
];
|
|
184
203
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
else
|
|
191
|
-
console.log(event.item.id + " selected");
|
|
192
|
-
break;
|
|
193
|
-
case LX.AssetViewEvent.ASSET_DBLCLICKED:
|
|
194
|
-
console.log(event.item.id + " double clicked");
|
|
195
|
-
if (!event.item.src || event.item.type == "image") break;
|
|
196
|
-
if (window.dialog) window.dialog.destroy();
|
|
197
|
-
window.dialog = new LX.PocketDialog("Editor", p => {
|
|
198
|
-
const area = new LX.Area();
|
|
199
|
-
p.attach(area);
|
|
200
|
-
let editor = new LX.CodeEditor(area, {
|
|
201
|
-
allowAddScripts: false
|
|
202
|
-
});
|
|
203
|
-
editor.loadFile(event.item.src);
|
|
204
|
-
}, { size: ["40%", "600px"], closable: true });
|
|
205
|
-
break;
|
|
206
|
-
case LX.AssetViewEvent.ENTER_FOLDER:
|
|
207
|
-
console.log("Entering folder: " + event.item.id);
|
|
208
|
-
break;
|
|
209
|
-
case LX.AssetViewEvent.ASSET_DELETED:
|
|
210
|
-
console.log(event.item.id + " deleted");
|
|
211
|
-
break;
|
|
212
|
-
case LX.AssetViewEvent.ASSET_CLONED:
|
|
213
|
-
console.log(event.item.id + " cloned");
|
|
214
|
-
break;
|
|
215
|
-
case LX.AssetViewEvent.ASSET_RENAMED:
|
|
216
|
-
console.log(event.value + " is now called " + event.item.id);
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
});
|
|
204
|
+
// Click events
|
|
205
|
+
{
|
|
206
|
+
assetView.on( "select", ( event, resolve ) => {
|
|
207
|
+
console.log(`${ event.items[ 0 ].id } selected` );
|
|
208
|
+
} );
|
|
220
209
|
|
|
221
|
-
|
|
210
|
+
assetView.on( "dblClick", ( event ) => {
|
|
211
|
+
console.log(`${ event.items[ 0 ].id } dbl clicked` );
|
|
212
|
+
} );
|
|
213
|
+
}
|
|
222
214
|
|
|
223
|
-
|
|
215
|
+
// Folder events
|
|
216
|
+
{
|
|
217
|
+
assetView.on( "enterFolder", ( event ) => {
|
|
218
|
+
console.log(`Entered ${ event.to.id } folder` );
|
|
219
|
+
} );
|
|
220
|
+
|
|
221
|
+
assetView.on( "beforeCreateFolder", ( event, resolve ) => {
|
|
222
|
+
LX.prompt("Perform CreateFolder Action?", "Server Message", () => {
|
|
223
|
+
resolve();
|
|
224
|
+
})
|
|
225
|
+
} );
|
|
226
|
+
|
|
227
|
+
assetView.on( "createFolder", ( event ) => {
|
|
228
|
+
console.log(`${ event.result[ 0 ].id } folder created`);
|
|
229
|
+
} );
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Rename events
|
|
233
|
+
{
|
|
234
|
+
assetView.on( "beforeRename", ( event, resolve ) => {
|
|
235
|
+
LX.prompt("Perform Rename Action?", "Server Message", () => {
|
|
236
|
+
resolve();
|
|
237
|
+
})
|
|
238
|
+
} );
|
|
239
|
+
|
|
240
|
+
assetView.on( "rename", ( event ) => {
|
|
241
|
+
console.log(`${ event.oldName } renamed to ${ event.newName }`);
|
|
242
|
+
} );
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Delete events
|
|
246
|
+
{
|
|
247
|
+
assetView.on( "beforeDelete", ( event, resolve ) => {
|
|
248
|
+
LX.prompt("Perform Delete Action?", "Server Message", () => {
|
|
249
|
+
resolve();
|
|
250
|
+
})
|
|
251
|
+
} );
|
|
224
252
|
|
|
253
|
+
assetView.on( "delete", ( event ) => {
|
|
254
|
+
console.log(event.items[ 0 ].id + " deleted");
|
|
255
|
+
} );
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Clone events
|
|
259
|
+
{
|
|
260
|
+
assetView.on( "beforeClone", ( event, resolve ) => {
|
|
261
|
+
LX.prompt("Perform Clone Action?", "Server Message", (value) => {
|
|
262
|
+
resolve( value );
|
|
263
|
+
})
|
|
264
|
+
} );
|
|
265
|
+
|
|
266
|
+
assetView.on( "clone", ( event, arg1, arg2 ) => {
|
|
267
|
+
console.log(event.items[ 0 ].id + " cloned", arg1, arg2);
|
|
268
|
+
} );
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Move events
|
|
272
|
+
{
|
|
273
|
+
assetView.on( "beforeMove", ( event, resolve ) => {
|
|
274
|
+
LX.prompt("Perform Move Action?", "Server Message", () => {
|
|
275
|
+
resolve();
|
|
276
|
+
})
|
|
277
|
+
} );
|
|
278
|
+
|
|
279
|
+
assetView.on( "move", ( event ) => {
|
|
280
|
+
console.log(`${ event.items[ 0 ].id } moved to ${ event.to.id }` );
|
|
281
|
+
} );
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
assetView.load( assetData );
|
|
285
|
+
|
|
286
|
+
function loop( dt )
|
|
287
|
+
{
|
|
288
|
+
var ctx = canvas.getContext("2d");
|
|
225
289
|
ctx.fillStyle = "#b7a9b1";
|
|
226
290
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
227
|
-
|
|
228
291
|
ctx.font = "48px Monospace";
|
|
229
292
|
ctx.fillStyle = "#ff1999";
|
|
230
293
|
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
<script type="module">
|
|
21
21
|
|
|
22
22
|
import { LX } from 'lexgui';
|
|
23
|
-
import 'lexgui/extensions/codeeditor.js';
|
|
23
|
+
import { CodeEditor } from 'lexgui/extensions/codeeditor.js';
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
CodeEditor.debugScopes = false;
|
|
26
|
+
CodeEditor.debugSymbols = false;
|
|
27
|
+
CodeEditor.debugProcessedLines = false;
|
|
28
28
|
|
|
29
29
|
// init library and get main area
|
|
30
30
|
let area = await LX.init();
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
area = rightArea;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
let editor = new
|
|
54
|
+
let editor = new CodeEditor(area, {
|
|
55
55
|
// allowAddScripts: false,
|
|
56
56
|
// autocomplete: false,
|
|
57
57
|
// disableEdition: true,
|