lexgui 0.7.6 → 0.7.8
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/build/extensions/codeeditor.js +281 -88
- package/build/extensions/timeline.js +84 -40
- package/build/lexgui.css +16 -16
- package/build/lexgui.js +64 -23
- package/build/lexgui.min.css +2 -2
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +64 -23
- package/build/lexgui.module.min.js +1 -1
- package/changelog.md +44 -1
- package/examples/asset-view.html +1 -1
- package/examples/code-editor.html +1 -1
- package/package.json +1 -1
|
@@ -131,14 +131,52 @@ class Timeline {
|
|
|
131
131
|
}
|
|
132
132
|
this.resize(this.size);
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
/**
|
|
135
|
+
* updates theme (light - dark) based on LX's current theme
|
|
136
|
+
*/
|
|
137
|
+
function updateTheme( ){
|
|
138
|
+
Timeline.BACKGROUND_COLOR = LX.getThemeColor("global-blur-background");
|
|
139
|
+
Timeline.TRACK_COLOR_PRIMARY = LX.getThemeColor("global-color-primary");
|
|
140
|
+
Timeline.TRACK_COLOR_SECONDARY = LX.getThemeColor("global-color-secondary");
|
|
141
|
+
Timeline.TRACK_COLOR_TERCIARY = LX.getThemeColor("global-color-terciary");
|
|
142
|
+
Timeline.TRACK_COLOR_QUATERNARY = LX.getThemeColor("global-color-quaternary");
|
|
143
|
+
Timeline.FONT = LX.getThemeColor("global-font");
|
|
144
|
+
Timeline.FONT_COLOR_PRIMARY = LX.getThemeColor("global-text-primary");
|
|
145
|
+
Timeline.FONT_COLOR_TERTIARY = LX.getThemeColor("global-text-tertiary");
|
|
146
|
+
Timeline.FONT_COLOR_QUATERNARY = LX.getThemeColor("global-text-quaternary");
|
|
147
|
+
|
|
148
|
+
Timeline.KEYFRAME_COLOR = LX.getThemeColor("lxTimeline-keyframe");
|
|
149
|
+
Timeline.KEYFRAME_COLOR_SELECTED = Timeline.KEYFRAME_COLOR_HOVERED = LX.getThemeColor("lxTimeline-keyframe-selected");
|
|
150
|
+
Timeline.KEYFRAME_COLOR_LOCK = LX.getThemeColor("lxTimeline-keyframe-locked");
|
|
151
|
+
Timeline.KEYFRAME_COLOR_EDITED = LX.getThemeColor("lxTimeline-keyframe-edited");
|
|
152
|
+
Timeline.KEYFRAME_COLOR_INACTIVE = LX.getThemeColor("lxTimeline-keyframe-inactive");
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
this.updateTheme = updateTheme.bind(this);
|
|
156
|
+
LX.addSignal( "@on_new_color_scheme", this.updateTheme );
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// makes it ready to be deleted
|
|
160
|
+
clear(){
|
|
161
|
+
if( this.header ){
|
|
162
|
+
this.header.clear();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if( this.leftPanel ){
|
|
166
|
+
this.leftPanel.clear();
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if( this.updateTheme ){
|
|
170
|
+
let signals = LX.signals[ "@on_new_color_scheme" ] ?? [];
|
|
171
|
+
for( let i =0; i < signals.length; ++i ){
|
|
172
|
+
if( signals[i] == this.updateTheme ){
|
|
173
|
+
signals.splice(i, 1);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
140
177
|
}
|
|
141
178
|
|
|
179
|
+
|
|
142
180
|
/**
|
|
143
181
|
* @method updateHeader
|
|
144
182
|
* @param {*}
|
|
@@ -193,7 +231,6 @@ class Timeline {
|
|
|
193
231
|
this.setTime(value);
|
|
194
232
|
}, {
|
|
195
233
|
units: "s",
|
|
196
|
-
signal: "@on_set_time_" + this.uniqueID,
|
|
197
234
|
step: 0.01, min: 0, precision: 3,
|
|
198
235
|
skipSlider: true,
|
|
199
236
|
skipReset: true,
|
|
@@ -205,7 +242,6 @@ class Timeline {
|
|
|
205
242
|
}, {
|
|
206
243
|
units: "s",
|
|
207
244
|
step: 0.01, min: 0,
|
|
208
|
-
signal: "@on_set_duration_" + this.uniqueID,
|
|
209
245
|
skipReset: true,
|
|
210
246
|
nameWidth: "auto"
|
|
211
247
|
});
|
|
@@ -261,7 +297,6 @@ class Timeline {
|
|
|
261
297
|
*/
|
|
262
298
|
updateLeftPanel( ) {
|
|
263
299
|
|
|
264
|
-
const scrollTop = this.trackTreesPanel ? this.trackTreesPanel.root.scrollTop : 0;
|
|
265
300
|
this.leftPanel.clear();
|
|
266
301
|
|
|
267
302
|
const panel = this.leftPanel;
|
|
@@ -326,7 +361,7 @@ class Timeline {
|
|
|
326
361
|
}
|
|
327
362
|
});
|
|
328
363
|
|
|
329
|
-
this.trackTreesPanel.root.scrollTop =
|
|
364
|
+
this.trackTreesPanel.root.scrollTop = this.currentScrollInPixels;
|
|
330
365
|
|
|
331
366
|
if( this.leftPanel.parent.root.classList.contains("hidden") || !this.root.parentElement ){
|
|
332
367
|
return;
|
|
@@ -694,7 +729,7 @@ class Timeline {
|
|
|
694
729
|
this.duration = this.animationClip.duration = v;
|
|
695
730
|
|
|
696
731
|
if(updateHeader) {
|
|
697
|
-
|
|
732
|
+
this.header.components["Duration"].set( +this.duration.toFixed(2), true ); // skipcallback = true
|
|
698
733
|
}
|
|
699
734
|
|
|
700
735
|
if( this.onSetDuration && !skipCallback )
|
|
@@ -703,7 +738,7 @@ class Timeline {
|
|
|
703
738
|
|
|
704
739
|
setTime(time, skipCallback = false ){
|
|
705
740
|
this.currentTime = Math.max(0,Math.min(time,this.duration));
|
|
706
|
-
|
|
741
|
+
this.header.components["Current Time"].set( +this.currentTime.toFixed(2), true ); // skipcallback = true
|
|
707
742
|
|
|
708
743
|
if(this.onSetTime && !skipCallback)
|
|
709
744
|
this.onSetTime(this.currentTime);
|
|
@@ -733,6 +768,41 @@ class Timeline {
|
|
|
733
768
|
this.visualOriginTime += this.currentTime - this.xToTime(xCurrentTime);
|
|
734
769
|
}
|
|
735
770
|
|
|
771
|
+
/**
|
|
772
|
+
* @method setScroll
|
|
773
|
+
* not delta from last state, but full scroll amount.
|
|
774
|
+
* @param {Number} scrollY either pixels or [0,1]
|
|
775
|
+
* @param {Bool} normalized if true, scrollY is in range[0,1] being 1 fully scrolled. Otherwised scrollY represents pixels
|
|
776
|
+
* @returns
|
|
777
|
+
*/
|
|
778
|
+
|
|
779
|
+
setScroll( scrollY, normalized = true ){
|
|
780
|
+
if ( !this.trackTreesPanel ){
|
|
781
|
+
this.currentScroll = 0;
|
|
782
|
+
this.currentScrollInPixels = 0;
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
const r = this.trackTreesPanel.root;
|
|
787
|
+
if (r.scrollHeight > r.clientHeight){
|
|
788
|
+
if ( normalized ){
|
|
789
|
+
this.currentScroll = scrollY;
|
|
790
|
+
this.currentScrollInPixels = scrollY * (r.scrollHeight - r.clientHeight);
|
|
791
|
+
}else{
|
|
792
|
+
this.currentScroll = scrollY / (r.scrollHeight - r.clientHeight);
|
|
793
|
+
this.currentScrollInPixels = scrollY;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
else{
|
|
797
|
+
this.currentScroll = 0;
|
|
798
|
+
this.currentScrollInPixels = 0;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
// automatically calls event.
|
|
802
|
+
this.trackTreesPanel.root.scrollTop = this.currentScrollInPixels;
|
|
803
|
+
|
|
804
|
+
}
|
|
805
|
+
|
|
736
806
|
/**
|
|
737
807
|
* @method processMouse
|
|
738
808
|
* @param {*} e
|
|
@@ -1217,28 +1287,6 @@ class Timeline {
|
|
|
1217
1287
|
this.updateLeftPanel();
|
|
1218
1288
|
}
|
|
1219
1289
|
|
|
1220
|
-
/**
|
|
1221
|
-
* updates theme (light - dark) based on LX's current theme
|
|
1222
|
-
*/
|
|
1223
|
-
updateTheme( ){
|
|
1224
|
-
Timeline.BACKGROUND_COLOR = LX.getThemeColor("global-blur-background");
|
|
1225
|
-
Timeline.TRACK_COLOR_PRIMARY = LX.getThemeColor("global-color-primary");
|
|
1226
|
-
Timeline.TRACK_COLOR_SECONDARY = LX.getThemeColor("global-color-secondary");
|
|
1227
|
-
Timeline.TRACK_COLOR_TERCIARY = LX.getThemeColor("global-color-terciary");
|
|
1228
|
-
Timeline.TRACK_COLOR_QUATERNARY = LX.getThemeColor("global-color-quaternary");
|
|
1229
|
-
Timeline.FONT = LX.getThemeColor("global-font");
|
|
1230
|
-
Timeline.FONT_COLOR_PRIMARY = LX.getThemeColor("global-text-primary");
|
|
1231
|
-
Timeline.FONT_COLOR_TERTIARY = LX.getThemeColor("global-text-tertiary");
|
|
1232
|
-
Timeline.FONT_COLOR_QUATERNARY = LX.getThemeColor("global-text-quaternary");
|
|
1233
|
-
|
|
1234
|
-
Timeline.KEYFRAME_COLOR = LX.getThemeColor("lxTimeline-keyframe");
|
|
1235
|
-
Timeline.KEYFRAME_COLOR_SELECTED = Timeline.KEYFRAME_COLOR_HOVERED = LX.getThemeColor("lxTimeline-keyframe-selected");
|
|
1236
|
-
Timeline.KEYFRAME_COLOR_LOCK = LX.getThemeColor("lxTimeline-keyframe-locked");
|
|
1237
|
-
Timeline.KEYFRAME_COLOR_EDITED = LX.getThemeColor("lxTimeline-keyframe-edited");
|
|
1238
|
-
Timeline.KEYFRAME_COLOR_INACTIVE =LX.getThemeColor("lxTimeline-keyframe-inactive");
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
1290
|
// ----- BASE FUNCTIONS -----
|
|
1243
1291
|
/**
|
|
1244
1292
|
These functions might be overriden by child classes. Nonetheless, they must have the same attributes, at least.
|
|
@@ -1567,9 +1615,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
1567
1615
|
*/
|
|
1568
1616
|
changeSelectedItems( itemsToAdd = null, itemsToRemove = null, skipCallback = false ) {
|
|
1569
1617
|
|
|
1570
|
-
|
|
1571
|
-
this.deselectAllKeyFrames();
|
|
1572
|
-
this.unHoverAll();
|
|
1618
|
+
this.deselectAllElements();
|
|
1573
1619
|
|
|
1574
1620
|
const tracks = this.animationClip.tracks;
|
|
1575
1621
|
const tracksPerGroup = this.animationClip.tracksPerGroup;
|
|
@@ -3219,9 +3265,7 @@ class ClipsTimeline extends Timeline {
|
|
|
3219
3265
|
*/
|
|
3220
3266
|
changeSelectedItems( ) {
|
|
3221
3267
|
|
|
3222
|
-
|
|
3223
|
-
this.deselectAllClips();
|
|
3224
|
-
this.unHoverAll();
|
|
3268
|
+
this.deselectAllElements();
|
|
3225
3269
|
|
|
3226
3270
|
this.selectedItems = this.animationClip.tracks.slice();
|
|
3227
3271
|
|
package/build/lexgui.css
CHANGED
|
@@ -777,7 +777,6 @@ a svg, svg path {
|
|
|
777
777
|
font-size: var(--global-font-size-lg);
|
|
778
778
|
color: var(--global-text-secondary);
|
|
779
779
|
cursor: pointer;
|
|
780
|
-
margin-right: 0.4em;
|
|
781
780
|
-webkit-user-select: none;
|
|
782
781
|
-moz-user-select: none;
|
|
783
782
|
-ms-user-select: none;
|
|
@@ -4615,13 +4614,19 @@ ul.lexassetscontent {
|
|
|
4615
4614
|
overflow: auto;
|
|
4616
4615
|
}
|
|
4617
4616
|
|
|
4618
|
-
.lexassetscontent.
|
|
4617
|
+
.lexassetscontent.compact {
|
|
4619
4618
|
width: 100%;
|
|
4620
4619
|
display: grid;
|
|
4621
4620
|
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
|
4622
4621
|
column-gap: 0.5rem;
|
|
4623
4622
|
}
|
|
4624
4623
|
|
|
4624
|
+
.lexassetscontent.list {
|
|
4625
|
+
width: 100%;
|
|
4626
|
+
display: flex;
|
|
4627
|
+
flex-direction: column;
|
|
4628
|
+
}
|
|
4629
|
+
|
|
4625
4630
|
.lexassetscontent li {
|
|
4626
4631
|
-webkit-text-size-adjust: 100%;
|
|
4627
4632
|
font-size: var(--global-font-size);
|
|
@@ -4671,7 +4676,7 @@ ul.lexassetscontent {
|
|
|
4671
4676
|
opacity: 1;
|
|
4672
4677
|
}
|
|
4673
4678
|
|
|
4674
|
-
.lexassetscontent.list li {
|
|
4679
|
+
.lexassetscontent.list li, .lexassetscontent.compact li {
|
|
4675
4680
|
width: 100%;
|
|
4676
4681
|
height: 1.8em;
|
|
4677
4682
|
border-top: 0px;
|
|
@@ -4756,7 +4761,7 @@ ul.lexassetscontent {
|
|
|
4756
4761
|
z-index: 1;
|
|
4757
4762
|
}
|
|
4758
4763
|
|
|
4759
|
-
.lexassetscontent.list li .lexassettitle {
|
|
4764
|
+
.lexassetscontent.list li .lexassettitle, .lexassetscontent.compact li .lexassettitle {
|
|
4760
4765
|
width: 100%;
|
|
4761
4766
|
height: 100%;
|
|
4762
4767
|
text-align: left;
|
|
@@ -4775,13 +4780,13 @@ ul.lexassetscontent {
|
|
|
4775
4780
|
display: none;
|
|
4776
4781
|
}
|
|
4777
4782
|
|
|
4778
|
-
.lexassetscontent.list li .lexassetinfo {
|
|
4783
|
+
.lexassetscontent.list li .lexassetinfo, .lexassetscontent.compact li .lexassetinfo {
|
|
4779
4784
|
display: block;
|
|
4780
4785
|
right: 6px;
|
|
4781
4786
|
z-index: 1;
|
|
4782
4787
|
}
|
|
4783
4788
|
|
|
4784
|
-
.lexassetscontent.list li:has(.lexcheckbox) .lexassetinfo {
|
|
4789
|
+
.lexassetscontent.list li:has(.lexcheckbox) .lexassetinfo, .lexassetscontent.compact li:has(.lexcheckbox) .lexassetinfo {
|
|
4785
4790
|
display: block;
|
|
4786
4791
|
right: 32px;
|
|
4787
4792
|
z-index: 1;
|
|
@@ -4795,7 +4800,7 @@ ul.lexassetscontent {
|
|
|
4795
4800
|
height: 1.15em;
|
|
4796
4801
|
}
|
|
4797
4802
|
|
|
4798
|
-
.lexassetscontent.list li .lexcheckbox {
|
|
4803
|
+
.lexassetscontent.list li .lexcheckbox, .lexassetscontent.compact li .lexcheckbox {
|
|
4799
4804
|
right: 3px;
|
|
4800
4805
|
top: 3px;
|
|
4801
4806
|
}
|
|
@@ -4820,7 +4825,7 @@ ul.lexassetscontent {
|
|
|
4820
4825
|
transition: all 0.2s;
|
|
4821
4826
|
}
|
|
4822
4827
|
|
|
4823
|
-
.lexassetscontent.list img {
|
|
4828
|
+
.lexassetscontent.list img, .lexassetscontent.compact img {
|
|
4824
4829
|
width: unset;
|
|
4825
4830
|
object-fit: contain;
|
|
4826
4831
|
float: left;
|
|
@@ -4832,7 +4837,7 @@ ul.lexassetscontent {
|
|
|
4832
4837
|
transform: translateY(-6px);
|
|
4833
4838
|
}
|
|
4834
4839
|
|
|
4835
|
-
.lexassetscontent.list li.folder img {
|
|
4840
|
+
.lexassetscontent.list li.folder img, .lexassetscontent.compact li.folder img {
|
|
4836
4841
|
transform: scale(0.9);
|
|
4837
4842
|
}
|
|
4838
4843
|
|
|
@@ -4923,7 +4928,7 @@ ul.lexassetscontent {
|
|
|
4923
4928
|
display: flex;
|
|
4924
4929
|
position: relative;
|
|
4925
4930
|
overflow: inherit;
|
|
4926
|
-
background-color:
|
|
4931
|
+
background-color: var(--global-color-secondary);
|
|
4927
4932
|
}
|
|
4928
4933
|
|
|
4929
4934
|
.codebasearea * {
|
|
@@ -5010,7 +5015,7 @@ ul.lexassetscontent {
|
|
|
5010
5015
|
}
|
|
5011
5016
|
|
|
5012
5017
|
.lexcodetabinfo {
|
|
5013
|
-
background-color:
|
|
5018
|
+
background-color: var(--global-color-secondary);
|
|
5014
5019
|
position: absolute;
|
|
5015
5020
|
z-index: 3;
|
|
5016
5021
|
bottom: 0px;
|
|
@@ -5255,7 +5260,6 @@ ul.lexassetscontent {
|
|
|
5255
5260
|
|
|
5256
5261
|
.lexcodeeditor .searchbox {
|
|
5257
5262
|
background-color: var(--global-color-secondary);
|
|
5258
|
-
/* width: 256px; */
|
|
5259
5263
|
position: absolute;
|
|
5260
5264
|
right: 6px;
|
|
5261
5265
|
top: 26px;
|
|
@@ -5269,10 +5273,6 @@ ul.lexassetscontent {
|
|
|
5269
5273
|
transition: transform 0.2s ease-in, opacity 0.2s ease-in;
|
|
5270
5274
|
}
|
|
5271
5275
|
|
|
5272
|
-
.lexcodeeditor .searchbox.gotoline {
|
|
5273
|
-
width: 124px;
|
|
5274
|
-
}
|
|
5275
|
-
|
|
5276
5276
|
.lexcodeeditor .searchbox.opened {
|
|
5277
5277
|
transform: translateY(0px);
|
|
5278
5278
|
opacity: 1;
|
package/build/lexgui.js
CHANGED
|
@@ -14,7 +14,7 @@ console.warn( 'Script _build/lexgui.js_ is depracated and will be removed soon.
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
const LX = {
|
|
17
|
-
version: "0.7.
|
|
17
|
+
version: "0.7.8",
|
|
18
18
|
ready: false,
|
|
19
19
|
extensions: [], // Store extensions used
|
|
20
20
|
signals: {}, // Events and triggers
|
|
@@ -1246,7 +1246,7 @@ class DropdownMenu {
|
|
|
1246
1246
|
}
|
|
1247
1247
|
|
|
1248
1248
|
const menuItem = document.createElement('div');
|
|
1249
|
-
menuItem.className = "lexdropdownmenuitem" + ( item.name ? "" : " label" ) + ( item.disabled ?? false ? " disabled" : "" ) + ( ` ${ item.className ?? "" }` );
|
|
1249
|
+
menuItem.className = "lexdropdownmenuitem" + ( ( item.name || item.options ) ? "" : " label" ) + ( item.disabled ?? false ? " disabled" : "" ) + ( ` ${ item.className ?? "" }` );
|
|
1250
1250
|
menuItem.dataset["id"] = pKey;
|
|
1251
1251
|
menuItem.innerHTML = `<span>${ key }</span>`;
|
|
1252
1252
|
menuItem.tabIndex = "1";
|
|
@@ -1332,7 +1332,7 @@ class DropdownMenu {
|
|
|
1332
1332
|
else
|
|
1333
1333
|
{
|
|
1334
1334
|
menuItem.addEventListener( "click", () => {
|
|
1335
|
-
const f = item
|
|
1335
|
+
const f = item.callback;
|
|
1336
1336
|
if( f )
|
|
1337
1337
|
{
|
|
1338
1338
|
f.call( this, key, menuItem );
|
|
@@ -1344,7 +1344,11 @@ class DropdownMenu {
|
|
|
1344
1344
|
this._trigger[ radioName ] = key;
|
|
1345
1345
|
}
|
|
1346
1346
|
|
|
1347
|
-
|
|
1347
|
+
// If has options, it's a radio group label, so don't close the menu
|
|
1348
|
+
if( !item.options && ( item.closeOnClick ?? true ) )
|
|
1349
|
+
{
|
|
1350
|
+
this.destroy( true );
|
|
1351
|
+
}
|
|
1348
1352
|
} );
|
|
1349
1353
|
}
|
|
1350
1354
|
|
|
@@ -1382,8 +1386,6 @@ class DropdownMenu {
|
|
|
1382
1386
|
|
|
1383
1387
|
if( item.options )
|
|
1384
1388
|
{
|
|
1385
|
-
this._addSeparator();
|
|
1386
|
-
|
|
1387
1389
|
console.assert( this._trigger[ item.name ] && "An item of the radio group must be selected!" );
|
|
1388
1390
|
this._radioGroup = {
|
|
1389
1391
|
name: item.name,
|
|
@@ -3130,6 +3132,7 @@ class ContextMenu {
|
|
|
3130
3132
|
}
|
|
3131
3133
|
else if( (rect.top + rect.height) > window.innerHeight )
|
|
3132
3134
|
{
|
|
3135
|
+
div.style.marginTop = "";
|
|
3133
3136
|
top = (window.innerHeight - rect.height - margin);
|
|
3134
3137
|
}
|
|
3135
3138
|
}
|
|
@@ -6616,6 +6619,22 @@ Object.assign(LX, {
|
|
|
6616
6619
|
}
|
|
6617
6620
|
});
|
|
6618
6621
|
|
|
6622
|
+
/**
|
|
6623
|
+
* @method formatBytes
|
|
6624
|
+
* @param {Number} bytes
|
|
6625
|
+
**/
|
|
6626
|
+
function formatBytes( bytes )
|
|
6627
|
+
{
|
|
6628
|
+
if( bytes === 0 ) return "0 B";
|
|
6629
|
+
const k = 1024;
|
|
6630
|
+
const sizes = [ "B", "KB", "MB", "GB", "TB" ];
|
|
6631
|
+
const i = Math.floor( Math.log( bytes ) / Math.log( k ) );
|
|
6632
|
+
const value = bytes / Math.pow( k, i );
|
|
6633
|
+
return value.toFixed( 2 ) + " " + sizes[ i ];
|
|
6634
|
+
}
|
|
6635
|
+
|
|
6636
|
+
LX.formatBytes = formatBytes;
|
|
6637
|
+
|
|
6619
6638
|
/**
|
|
6620
6639
|
* @method compareThreshold
|
|
6621
6640
|
* @param {String} url
|
|
@@ -11222,7 +11241,7 @@ class RangeInput extends BaseComponent {
|
|
|
11222
11241
|
container.appendChild( slider );
|
|
11223
11242
|
|
|
11224
11243
|
slider.addEventListener( "input", e => {
|
|
11225
|
-
this.set( isRangeValue ? [ e.target.valueAsNumber, ogValue[ 1 ] ] : e.target.valueAsNumber, false, e );
|
|
11244
|
+
this.set( isRangeValue ? [ Math.min(e.target.valueAsNumber, ogValue[ 1 ]), ogValue[ 1 ] ] : e.target.valueAsNumber, false, e );
|
|
11226
11245
|
}, { passive: false });
|
|
11227
11246
|
|
|
11228
11247
|
// If its a range value, we need to update the slider using the thumbs
|
|
@@ -11288,7 +11307,7 @@ class RangeInput extends BaseComponent {
|
|
|
11288
11307
|
container.appendChild( maxSlider );
|
|
11289
11308
|
|
|
11290
11309
|
maxSlider.addEventListener( "input", e => {
|
|
11291
|
-
ogValue[ 1 ] = +e.target.valueAsNumber;
|
|
11310
|
+
ogValue[ 1 ] = Math.max(value, +e.target.valueAsNumber);
|
|
11292
11311
|
this.set( [ value, ogValue[ 1 ] ], false, e );
|
|
11293
11312
|
}, { passive: false });
|
|
11294
11313
|
}
|
|
@@ -16165,7 +16184,8 @@ LX.AssetViewEvent = AssetViewEvent;
|
|
|
16165
16184
|
class AssetView {
|
|
16166
16185
|
|
|
16167
16186
|
static LAYOUT_GRID = 0;
|
|
16168
|
-
static
|
|
16187
|
+
static LAYOUT_COMPACT = 1;
|
|
16188
|
+
static LAYOUT_LIST = 2;
|
|
16169
16189
|
|
|
16170
16190
|
static CONTENT_SORT_ASC = 0;
|
|
16171
16191
|
static CONTENT_SORT_DESC = 1;
|
|
@@ -16427,7 +16447,9 @@ class AssetView {
|
|
|
16427
16447
|
}
|
|
16428
16448
|
else
|
|
16429
16449
|
{
|
|
16430
|
-
|
|
16450
|
+
area.root.classList.add( "flex", "flex-col" );
|
|
16451
|
+
this.toolsPanel = area.addPanel({ className: 'flex flex-col overflow-hidden', height:"auto" });
|
|
16452
|
+
this.toolsPanel.root.style.flex = "none";
|
|
16431
16453
|
this.contentPanel = area.addPanel({ className: 'lexassetcontentpanel flex flex-col overflow-hidden' });
|
|
16432
16454
|
}
|
|
16433
16455
|
|
|
@@ -16444,7 +16466,8 @@ class AssetView {
|
|
|
16444
16466
|
const _onChangeView = ( value, event ) => {
|
|
16445
16467
|
new LX.DropdownMenu( event.target, [
|
|
16446
16468
|
{ name: "Grid", icon: "LayoutGrid", callback: () => this._setContentLayout( AssetView.LAYOUT_GRID ) },
|
|
16447
|
-
{ name: "
|
|
16469
|
+
{ name: "Compact", icon: "LayoutList", callback: () => this._setContentLayout( AssetView.LAYOUT_COMPACT ) },
|
|
16470
|
+
{ name: "List", icon: "List", callback: () => this._setContentLayout( AssetView.LAYOUT_LIST ) }
|
|
16448
16471
|
], { side: "right", align: "start" });
|
|
16449
16472
|
};
|
|
16450
16473
|
|
|
@@ -16480,9 +16503,11 @@ class AssetView {
|
|
|
16480
16503
|
this.toolsPanel.addText(null, textString, null, {
|
|
16481
16504
|
inputClass: "nobg", disabled: true, signal: "@on_page_change", maxWidth: "16ch" }
|
|
16482
16505
|
);
|
|
16506
|
+
this.toolsPanel.endLine();
|
|
16483
16507
|
|
|
16484
16508
|
if( !this.skipBrowser )
|
|
16485
16509
|
{
|
|
16510
|
+
this.toolsPanel.sameLine();
|
|
16486
16511
|
this.toolsPanel.addComboButtons( null, [
|
|
16487
16512
|
{
|
|
16488
16513
|
value: "Left",
|
|
@@ -16517,9 +16542,9 @@ class AssetView {
|
|
|
16517
16542
|
inputClass: "nobg", disabled: true, signal: "@on_folder_change",
|
|
16518
16543
|
style: { fontWeight: "600", fontSize: "15px" }
|
|
16519
16544
|
});
|
|
16520
|
-
}
|
|
16521
16545
|
|
|
16522
|
-
|
|
16546
|
+
this.toolsPanel.endLine();
|
|
16547
|
+
}
|
|
16523
16548
|
};
|
|
16524
16549
|
|
|
16525
16550
|
this.toolsPanel.refresh();
|
|
@@ -16552,11 +16577,13 @@ class AssetView {
|
|
|
16552
16577
|
_refreshContent( searchValue, filter ) {
|
|
16553
16578
|
|
|
16554
16579
|
const isGridLayout = ( this.layout == AssetView.LAYOUT_GRID ); // default
|
|
16580
|
+
const isCompactLayout = ( this.layout == AssetView.LAYOUT_COMPACT );
|
|
16581
|
+
const isListLayout = ( this.layout == AssetView.LAYOUT_LIST );
|
|
16555
16582
|
|
|
16556
16583
|
this.filter = filter ?? ( this.filter ?? "None" );
|
|
16557
16584
|
this.searchValue = searchValue ?? (this.searchValue ?? "");
|
|
16558
16585
|
this.content.innerHTML = "";
|
|
16559
|
-
this.content.className =
|
|
16586
|
+
this.content.className = `lexassetscontent${ isCompactLayout ? " compact" : ( isListLayout ? " list" : "" ) }`;
|
|
16560
16587
|
let that = this;
|
|
16561
16588
|
|
|
16562
16589
|
const _addItem = function(item) {
|
|
@@ -16570,6 +16597,11 @@ class AssetView {
|
|
|
16570
16597
|
itemEl.tabIndex = -1;
|
|
16571
16598
|
that.content.appendChild( itemEl );
|
|
16572
16599
|
|
|
16600
|
+
if( item.lastModified && !item.lastModifiedDate )
|
|
16601
|
+
{
|
|
16602
|
+
item.lastModifiedDate = that._lastModifiedToStringDate( item.lastModified );
|
|
16603
|
+
}
|
|
16604
|
+
|
|
16573
16605
|
if( !that.useNativeTitle )
|
|
16574
16606
|
{
|
|
16575
16607
|
let desc = document.createElement( 'span' );
|
|
@@ -16691,14 +16723,17 @@ class AssetView {
|
|
|
16691
16723
|
}
|
|
16692
16724
|
}
|
|
16693
16725
|
|
|
16694
|
-
|
|
16726
|
+
// Add item type info
|
|
16727
|
+
let itemInfoHtml = type;
|
|
16728
|
+
|
|
16729
|
+
if( isListLayout )
|
|
16695
16730
|
{
|
|
16696
|
-
|
|
16697
|
-
|
|
16698
|
-
info.innerText = type;
|
|
16699
|
-
itemEl.appendChild(info);
|
|
16731
|
+
if( item.bytesize ) itemInfoHtml += ` | ${ LX.formatBytes( item.bytesize ) }`;
|
|
16732
|
+
if( item.lastModifiedDate ) itemInfoHtml += ` | ${ item.lastModifiedDate }`;
|
|
16700
16733
|
}
|
|
16701
16734
|
|
|
16735
|
+
LX.makeContainer( [ "auto", "auto" ], "lexassetinfo", itemInfoHtml, itemEl );
|
|
16736
|
+
|
|
16702
16737
|
itemEl.addEventListener('click', function( e ) {
|
|
16703
16738
|
e.stopImmediatePropagation();
|
|
16704
16739
|
e.stopPropagation();
|
|
@@ -16840,18 +16875,18 @@ class AssetView {
|
|
|
16840
16875
|
const options = { disabled: true };
|
|
16841
16876
|
|
|
16842
16877
|
this.previewPanel.addText("Filename", file.id, null, options);
|
|
16843
|
-
if( file.
|
|
16878
|
+
if( file.lastModifiedDate ) this.previewPanel.addText("Last Modified", file.lastModifiedDate, null, options);
|
|
16844
16879
|
if( file._path || file.src ) this.previewPanel.addText("URL", file._path ? file._path : file.src, null, options);
|
|
16845
16880
|
this.previewPanel.addText("Path", this.path.join('/'), null, options);
|
|
16846
16881
|
this.previewPanel.addText("Type", file.type, null, options);
|
|
16847
|
-
if( file.bytesize ) this.previewPanel.addText("Size", (file.bytesize
|
|
16882
|
+
if( file.bytesize ) this.previewPanel.addText("Size", LX.formatBytes( file.bytesize ), null, options);
|
|
16848
16883
|
if( file.type == "folder" ) this.previewPanel.addText("Files", file.children ? file.children.length.toString() : "0", null, options);
|
|
16849
16884
|
|
|
16850
16885
|
this.previewPanel.addSeparator();
|
|
16851
16886
|
|
|
16852
16887
|
const previewActions = [...this.previewActions];
|
|
16853
16888
|
|
|
16854
|
-
if( !previewActions.length )
|
|
16889
|
+
if( !previewActions.length && file.type !== "folder" )
|
|
16855
16890
|
{
|
|
16856
16891
|
// By default
|
|
16857
16892
|
previewActions.push({
|
|
@@ -16891,7 +16926,8 @@ class AssetView {
|
|
|
16891
16926
|
"id": file.name,
|
|
16892
16927
|
"src": e.currentTarget.result,
|
|
16893
16928
|
"extension": ext,
|
|
16894
|
-
"lastModified": file.lastModified
|
|
16929
|
+
"lastModified": file.lastModified,
|
|
16930
|
+
"lastModifiedDate": this._lastModifiedToStringDate( file.lastModified )
|
|
16895
16931
|
};
|
|
16896
16932
|
|
|
16897
16933
|
switch(ext)
|
|
@@ -17004,6 +17040,11 @@ class AssetView {
|
|
|
17004
17040
|
|
|
17005
17041
|
this._processData( this.data );
|
|
17006
17042
|
}
|
|
17043
|
+
|
|
17044
|
+
_lastModifiedToStringDate( lm ) {
|
|
17045
|
+
const d = new Date( lm ).toLocaleString();
|
|
17046
|
+
return d.substring( 0, d.indexOf( ',' ) );
|
|
17047
|
+
}
|
|
17007
17048
|
}
|
|
17008
17049
|
|
|
17009
17050
|
LX.AssetView = AssetView;
|