lexgui 0.6.12 → 0.7.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/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 +484 -224
- package/build/lexgui.js +1399 -735
- package/build/lexgui.min.css +2 -2
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +1400 -736
- package/build/lexgui.module.min.js +1 -1
- package/changelog.md +72 -21
- package/demo.js +43 -30
- package/examples/{all_widgets.html → all-components.html} +21 -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
|
@@ -4,7 +4,7 @@ if(!LX) {
|
|
|
4
4
|
throw("lexgui.js missing!");
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
LX.
|
|
7
|
+
LX.extensions.push( 'Timeline' );
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @class Timeline
|
|
@@ -103,8 +103,8 @@ class Timeline {
|
|
|
103
103
|
this.selectedItems = []; // [trackInfo, "groupId"], contains the visible items (tracks or groups) of the timeline
|
|
104
104
|
this.leftPanel = left.addPanel( { className: 'lextimelinepanel', width: "100%", height: "100%" } );
|
|
105
105
|
this.trackTreesPanel = null;
|
|
106
|
-
this.
|
|
107
|
-
this.
|
|
106
|
+
this.trackTreesComponent = null;
|
|
107
|
+
this.lastTrackTreesComponentOffset = 0; // this.trackTreesComponent.innerTree.domEl.offsetTop - canvas.offsetTop. Check draw()
|
|
108
108
|
this.updateLeftPanel();
|
|
109
109
|
|
|
110
110
|
if(this.uniqueID != '') {
|
|
@@ -267,8 +267,8 @@ class Timeline {
|
|
|
267
267
|
const panel = this.leftPanel;
|
|
268
268
|
|
|
269
269
|
panel.sameLine( 2 );
|
|
270
|
-
let
|
|
271
|
-
let title =
|
|
270
|
+
let titleComponent = panel.addTitle( "Tracks", { style: { background: "none"}, className: "fg-secondary text-lg px-4"} );
|
|
271
|
+
let title = titleComponent.root;
|
|
272
272
|
|
|
273
273
|
if( !this.disableNewTracks )
|
|
274
274
|
{
|
|
@@ -293,7 +293,7 @@ class Timeline {
|
|
|
293
293
|
{
|
|
294
294
|
treeTracks = this.generateSelectedItemsTreeData();
|
|
295
295
|
}
|
|
296
|
-
this.
|
|
296
|
+
this.trackTreesComponent = p.addTree(null, treeTracks, {filter: false, rename: false, draggable: false, onevent: (e) => {
|
|
297
297
|
switch(e.type) {
|
|
298
298
|
case LX.TreeEvent.NODE_SELECTED:
|
|
299
299
|
if (e.node.trackData){
|
|
@@ -310,8 +310,8 @@ class Timeline {
|
|
|
310
310
|
}
|
|
311
311
|
}});
|
|
312
312
|
// setting a name in the addTree function adds an undesired node
|
|
313
|
-
this.
|
|
314
|
-
p.
|
|
313
|
+
this.trackTreesComponent.name = "tracksTrees";
|
|
314
|
+
p.components[this.trackTreesComponent.name] = this.trackTreesComponent;
|
|
315
315
|
|
|
316
316
|
this.trackTreesPanel = p;
|
|
317
317
|
panel.attach( p.root );
|
|
@@ -376,8 +376,8 @@ class Timeline {
|
|
|
376
376
|
return [];
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
-
const startY = minY - this.
|
|
380
|
-
const endY = maxY - this.
|
|
379
|
+
const startY = minY - this.lastTrackTreesComponentOffset + this.currentScrollInPixels;
|
|
380
|
+
const endY = maxY - this.lastTrackTreesComponentOffset + this.currentScrollInPixels;
|
|
381
381
|
|
|
382
382
|
const startIdx = Math.max( 0, Math.floor( startY / this.trackHeight ) );
|
|
383
383
|
const endIdx = Math.min( elements.length-1, Math.floor( endY / this.trackHeight ) ) + 1;
|
|
@@ -497,7 +497,7 @@ class Timeline {
|
|
|
497
497
|
|
|
498
498
|
// Content
|
|
499
499
|
const topMargin = this.topMargin;
|
|
500
|
-
const treeOffset = this.
|
|
500
|
+
const treeOffset = this.lastTrackTreesComponentOffset;
|
|
501
501
|
const line_height = this.trackHeight;
|
|
502
502
|
|
|
503
503
|
//fill track lines
|
|
@@ -545,12 +545,12 @@ class Timeline {
|
|
|
545
545
|
const w = ctx.canvas.width;
|
|
546
546
|
const h = ctx.canvas.height;
|
|
547
547
|
|
|
548
|
-
const scrollableHeight = this.
|
|
548
|
+
const scrollableHeight = this.trackTreesComponent.root.scrollHeight;
|
|
549
549
|
// tree has gaps of 0.25rem (4px) inbetween entries but not in the beginning nor ending. Move half gap upwards.
|
|
550
|
-
const treeOffset = this.
|
|
550
|
+
const treeOffset = this.lastTrackTreesComponentOffset = this.trackTreesComponent.innerTree.domEl.offsetTop - this.canvas.offsetTop -2;
|
|
551
551
|
|
|
552
552
|
if ( this.trackTreesPanel.root.scrollHeight > 0 ){
|
|
553
|
-
const ul = this.
|
|
553
|
+
const ul = this.trackTreesComponent.innerTree.domEl.children[0];
|
|
554
554
|
this.trackHeight = ul.children.length < 1 ? 25 : ((ul.offsetHeight+4) / ul.children.length);
|
|
555
555
|
}
|
|
556
556
|
|
|
@@ -783,7 +783,7 @@ class Timeline {
|
|
|
783
783
|
}
|
|
784
784
|
|
|
785
785
|
}
|
|
786
|
-
else if( (h-this.topMargin) < this.
|
|
786
|
+
else if( (h-this.topMargin) < this.trackTreesComponent.root.scrollHeight)
|
|
787
787
|
{
|
|
788
788
|
this.trackTreesPanel.root.scrollTop += e.deltaY; // wheel deltaY
|
|
789
789
|
}
|
|
@@ -852,7 +852,7 @@ class Timeline {
|
|
|
852
852
|
this.grabbingTimeBar = true;
|
|
853
853
|
this.setTime(time);
|
|
854
854
|
}
|
|
855
|
-
else if( (h-this.topMargin) < this.
|
|
855
|
+
else if( (h-this.topMargin) < this.trackTreesComponent.root.scrollHeight && x > w - 10 ) { // grabbing scroll bar
|
|
856
856
|
this.grabbing = true;
|
|
857
857
|
this.grabbingScroll = true;
|
|
858
858
|
}
|
|
@@ -972,7 +972,7 @@ class Timeline {
|
|
|
972
972
|
setState(state, skipCallback = false) {
|
|
973
973
|
this.playing = state;
|
|
974
974
|
|
|
975
|
-
this.header.
|
|
975
|
+
this.header.components.playBtn.setState(this.playing, true);
|
|
976
976
|
|
|
977
977
|
if(this.onStateChange && !skipCallback) {
|
|
978
978
|
this.onStateChange(this.playing);
|
|
@@ -988,9 +988,9 @@ class Timeline {
|
|
|
988
988
|
setLoopMode(loopState, skipCallback = false){
|
|
989
989
|
this.loop = loopState;
|
|
990
990
|
if ( this.loop ){
|
|
991
|
-
this.header.
|
|
991
|
+
this.header.components.loopBtn.root.children[0].classList.add("selected");
|
|
992
992
|
}else{
|
|
993
|
-
this.header.
|
|
993
|
+
this.header.components.loopBtn.root.children[0].classList.remove("selected")
|
|
994
994
|
}
|
|
995
995
|
if( this.onChangeLoopMode && !skipCallback ){
|
|
996
996
|
this.onChangeLoopMode( this.loop );
|
|
@@ -1003,7 +1003,7 @@ class Timeline {
|
|
|
1003
1003
|
* If not a track, trackData will be undefined
|
|
1004
1004
|
*/
|
|
1005
1005
|
getVisibleItems(){
|
|
1006
|
-
return this.
|
|
1006
|
+
return this.trackTreesComponent.innerTree.domEl.children[0].children; // children of 'ul'
|
|
1007
1007
|
}
|
|
1008
1008
|
|
|
1009
1009
|
/**
|
|
@@ -1071,7 +1071,7 @@ class Timeline {
|
|
|
1071
1071
|
* Only affects render visualisation
|
|
1072
1072
|
* @method selectTrack
|
|
1073
1073
|
* @param {int} trackIdx
|
|
1074
|
-
* // NOTE: to select a track from outside of the timeline, a this.
|
|
1074
|
+
* // NOTE: to select a track from outside of the timeline, a this.trackTreesComponent.innerTree.select(item) needs to be called.
|
|
1075
1075
|
*/
|
|
1076
1076
|
selectTrack( trackIdx ) {
|
|
1077
1077
|
|
|
@@ -1247,7 +1247,7 @@ class Timeline {
|
|
|
1247
1247
|
|
|
1248
1248
|
|
|
1249
1249
|
/**
|
|
1250
|
-
* This functions uses the selectedItems and generates the data that will feed the LX.Tree
|
|
1250
|
+
* This functions uses the selectedItems and generates the data that will feed the LX.Tree Component.
|
|
1251
1251
|
* This function is used by updateLeftPanel. Some timelines might allow grouping of tracks. Such timelines may overwrite this function
|
|
1252
1252
|
* WARNING: track entries MUST have an attribute of 'trackData' with the track info
|
|
1253
1253
|
* @returns lexgui tree data as expecte for the creation of a tree
|
|
@@ -3402,7 +3402,7 @@ class ClipsTimeline extends Timeline {
|
|
|
3402
3402
|
else if ( this.dragClipMode == "move" && this.lastClipsSelected.length ) { // move clips
|
|
3403
3403
|
//*********** WARNING: RELIES ON SORTED lastClipsSelected ***********
|
|
3404
3404
|
|
|
3405
|
-
const treeOffset = this.
|
|
3405
|
+
const treeOffset = this.lastTrackTreesComponentOffset;
|
|
3406
3406
|
let newTrackClipsMove = Math.floor( (e.localY - treeOffset) / this.trackHeight );
|
|
3407
3407
|
|
|
3408
3408
|
// move clips vertically
|
package/build/lexgui-docs.css
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
@
|
|
2
|
-
@font-face {
|
|
3
|
-
font-family: "GeistSans";
|
|
4
|
-
src: url("https://raw.githubusercontent.com/jxarco/lexgui.js/master/data/GeistSans.ttf");
|
|
5
|
-
}
|
|
1
|
+
@font-face { font-family: "GeistSans"; src: url("https://raw.githubusercontent.com/jxarco/lexgui.js/master/data/GeistSans.ttf"); }
|
|
2
|
+
@font-face { font-family: "CascadiaCode"; src: url("https://raw.githubusercontent.com/jxarco/lexgui.js/master/data/CascadiaCode.ttf"); font-weight: 400; }
|
|
6
3
|
|
|
7
4
|
:root {
|
|
8
5
|
--border-style: 1px solid #444;
|
|
9
6
|
--panel-width: 300px;
|
|
10
7
|
--page-padding: 24px;
|
|
11
|
-
--max-width:
|
|
8
|
+
--max-width: 1100px;
|
|
12
9
|
--icon-size: 20px;
|
|
13
10
|
--stylish-color: light-dark(#fd18a5, #e2c886);
|
|
14
11
|
}
|
|
@@ -17,13 +14,12 @@
|
|
|
17
14
|
font-family: "GeistSans", sans-serif;
|
|
18
15
|
tab-size: 4;
|
|
19
16
|
max-width: var(--max-width);
|
|
20
|
-
width:
|
|
17
|
+
width: 95%;
|
|
21
18
|
height: auto;
|
|
22
19
|
margin: 0 auto;
|
|
23
20
|
padding: var(--page-padding);
|
|
24
21
|
word-break: break-word;
|
|
25
22
|
text-align: justify;
|
|
26
|
-
text-justify: inter-word;
|
|
27
23
|
border-radius: 12px;
|
|
28
24
|
}
|
|
29
25
|
|
|
@@ -105,7 +101,7 @@
|
|
|
105
101
|
}
|
|
106
102
|
|
|
107
103
|
code {
|
|
108
|
-
font-family: "
|
|
104
|
+
font-family: "CascadiaCode", monospace;
|
|
109
105
|
font-size: 14px;
|
|
110
106
|
line-height: calc(var(--line-height) - 1px);
|
|
111
107
|
/* margin: 16px calc(-1 * var(--page-padding)); */
|
|
@@ -173,6 +169,10 @@ code.inline.desc {
|
|
|
173
169
|
--icon-size: 24px;
|
|
174
170
|
}
|
|
175
171
|
|
|
172
|
+
#content {
|
|
173
|
+
width: 100%;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
176
|
#content h1 {
|
|
177
177
|
font-size: 42px;
|
|
178
178
|
line-height: 50px;
|