lexgui 0.7.2 → 0.7.4
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 +1821 -965
- package/build/extensions/videoeditor.js +17 -6
- package/build/lexgui.css +26 -34
- package/build/lexgui.js +15 -3
- package/build/lexgui.min.css +1 -1
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +15 -3
- package/build/lexgui.module.min.js +1 -1
- package/changelog.md +23 -1
- package/examples/code-editor.html +33 -19
- package/examples/video-editor.html +2 -1
- package/examples/video-editor2.html +5 -4
- package/package.json +1 -1
|
@@ -325,7 +325,15 @@ class VideoEditor {
|
|
|
325
325
|
|
|
326
326
|
this.mainArea = area;
|
|
327
327
|
|
|
328
|
-
let
|
|
328
|
+
let videoArea = null;
|
|
329
|
+
let controlsArea = null;
|
|
330
|
+
if(options.controlsArea) {
|
|
331
|
+
videoArea = area;
|
|
332
|
+
controlsArea = options.controlsArea;
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
[videoArea, controlsArea] = area.split({ type: 'vertical', sizes: ["85%", null], minimizable: false, resize: false });
|
|
336
|
+
}
|
|
329
337
|
controlsArea.root.classList.add('lexconstrolsarea');
|
|
330
338
|
|
|
331
339
|
this.cropArea = document.createElement("div");
|
|
@@ -347,6 +355,7 @@ class VideoEditor {
|
|
|
347
355
|
this.video.src = options.src;
|
|
348
356
|
this._loadVideo(options);
|
|
349
357
|
}
|
|
358
|
+
|
|
350
359
|
if(options.videoArea) {
|
|
351
360
|
options.videoArea.root.classList.add("lexvideoeditor");
|
|
352
361
|
options.videoArea.attach(this.cropArea);
|
|
@@ -396,7 +405,7 @@ class VideoEditor {
|
|
|
396
405
|
this.controlsPanelLeft.refresh();
|
|
397
406
|
}, { width: '40px', icon: (this.playing ? 'Pause@solid' : 'Play@solid'), className: "justify-center"});
|
|
398
407
|
|
|
399
|
-
this.controlsPanelLeft.addLabel(this.startTimeString, {width:
|
|
408
|
+
this.controlsPanelLeft.addLabel(this.startTimeString, {width: 100});
|
|
400
409
|
this.controlsPanelLeft.endLine();
|
|
401
410
|
|
|
402
411
|
let availableWidth = leftArea.root.clientWidth - controlsLeft.root.clientWidth;
|
|
@@ -411,7 +420,7 @@ class VideoEditor {
|
|
|
411
420
|
this.controlsPanelRight = new LX.Panel({className: 'lexcontrolspanel'});
|
|
412
421
|
this.controlsPanelRight.refresh = () => {
|
|
413
422
|
this.controlsPanelRight.clear();
|
|
414
|
-
this.controlsPanelRight.addLabel(this.endTimeString, {width:
|
|
423
|
+
this.controlsPanelRight.addLabel(this.endTimeString, {width: 100});
|
|
415
424
|
}
|
|
416
425
|
this.controlsPanelRight.refresh();
|
|
417
426
|
controlsRight.root.style.minWidth = 'fit-content';
|
|
@@ -464,13 +473,15 @@ class VideoEditor {
|
|
|
464
473
|
this.timebar.resize([availableWidth, v.height]);
|
|
465
474
|
}
|
|
466
475
|
|
|
476
|
+
const parent = controlsArea.parentElement ? controlsArea.parentElement : controlsArea.root.parentElement;
|
|
477
|
+
|
|
467
478
|
// Add canvas event listeneres
|
|
468
|
-
|
|
479
|
+
parent.addEventListener( "mousedown", (event) => {
|
|
469
480
|
if(this.controls) {
|
|
470
481
|
this.timebar.onMouseDown(event);
|
|
471
482
|
}
|
|
472
483
|
});
|
|
473
|
-
|
|
484
|
+
parent.addEventListener( "mouseup", (event) => {
|
|
474
485
|
if(this.controls) {
|
|
475
486
|
this.timebar.onMouseUp(event);
|
|
476
487
|
}
|
|
@@ -484,7 +495,7 @@ class VideoEditor {
|
|
|
484
495
|
this.isResizing = false;
|
|
485
496
|
|
|
486
497
|
});
|
|
487
|
-
|
|
498
|
+
parent.addEventListener( "mousemove", (event) => {
|
|
488
499
|
if(this.controls) {
|
|
489
500
|
this.timebar.onMouseMove(event);
|
|
490
501
|
}
|
package/build/lexgui.css
CHANGED
|
@@ -4923,6 +4923,7 @@ ul.lexassetscontent {
|
|
|
4923
4923
|
display: flex;
|
|
4924
4924
|
position: relative;
|
|
4925
4925
|
overflow: inherit;
|
|
4926
|
+
background-color: light-dark(var(--global-color-secondary), var(--global-medium-background));
|
|
4926
4927
|
}
|
|
4927
4928
|
|
|
4928
4929
|
.codebasearea * {
|
|
@@ -4997,6 +4998,7 @@ ul.lexassetscontent {
|
|
|
4997
4998
|
-moz-user-select: none;
|
|
4998
4999
|
-ms-user-select: none;
|
|
4999
5000
|
user-select: none;
|
|
5001
|
+
background-color: inherit;
|
|
5000
5002
|
}
|
|
5001
5003
|
|
|
5002
5004
|
.lexcodeeditor .lexareatabscontent {
|
|
@@ -5014,37 +5016,23 @@ ul.lexassetscontent {
|
|
|
5014
5016
|
|
|
5015
5017
|
.lexcodegutter {
|
|
5016
5018
|
width: 48px;
|
|
5017
|
-
|
|
5018
|
-
background-color: light-dark(var(--global-color-secondary), var(--global-medium-background));
|
|
5019
|
-
margin-top: 31px;
|
|
5019
|
+
background-color: inherit;
|
|
5020
5020
|
overflow: hidden;
|
|
5021
5021
|
position: absolute;
|
|
5022
5022
|
top: 0;
|
|
5023
5023
|
}
|
|
5024
5024
|
|
|
5025
|
-
.lexcodeeditor .
|
|
5026
|
-
|
|
5027
|
-
background-color:
|
|
5025
|
+
.lexcodeeditor .lexcodearea {
|
|
5026
|
+
width: 100%;
|
|
5027
|
+
background-color: inherit;
|
|
5028
5028
|
overflow: scroll;
|
|
5029
5029
|
}
|
|
5030
5030
|
|
|
5031
|
-
.lexcodeeditor .
|
|
5032
|
-
height: calc(100% - 28px) !important;
|
|
5033
|
-
}
|
|
5034
|
-
|
|
5035
|
-
.lexcodeeditor .codetabsarea::-webkit-scrollbar {
|
|
5031
|
+
.lexcodeeditor .lexcodearea::-webkit-scrollbar {
|
|
5036
5032
|
display: none;
|
|
5037
5033
|
}
|
|
5038
5034
|
|
|
5039
|
-
.lexcodeeditor .
|
|
5040
|
-
width: 100% !important;
|
|
5041
|
-
}
|
|
5042
|
-
|
|
5043
|
-
.lexcodeeditor .codetabsarea.with-hscrollbar {
|
|
5044
|
-
height: calc(100% - 72px) !important;
|
|
5045
|
-
}
|
|
5046
|
-
|
|
5047
|
-
.lexcodeeditor .codetabsarea.dragging {
|
|
5035
|
+
.lexcodeeditor .lexcodearea.dragging {
|
|
5048
5036
|
background-color: var(--global-color-secondary);
|
|
5049
5037
|
}
|
|
5050
5038
|
|
|
@@ -5109,6 +5097,10 @@ ul.lexassetscontent {
|
|
|
5109
5097
|
background-color: #db21212f !important;
|
|
5110
5098
|
}
|
|
5111
5099
|
|
|
5100
|
+
.lexcodeeditor pre.debug {
|
|
5101
|
+
background-color: #fffb002f !important;
|
|
5102
|
+
}
|
|
5103
|
+
|
|
5112
5104
|
.lexcodeeditor.disabled .lexareatab {
|
|
5113
5105
|
cursor: default;
|
|
5114
5106
|
}
|
|
@@ -5143,6 +5135,10 @@ ul.lexassetscontent {
|
|
|
5143
5135
|
z-index: 1;
|
|
5144
5136
|
}
|
|
5145
5137
|
|
|
5138
|
+
.lexcodeeditor pre.active-line .line-gutter {
|
|
5139
|
+
color: var(--global-text-primary);
|
|
5140
|
+
}
|
|
5141
|
+
|
|
5146
5142
|
.lexcodeeditor.no-gutter pre .line-gutter {
|
|
5147
5143
|
opacity: 0;
|
|
5148
5144
|
}
|
|
@@ -5188,31 +5184,21 @@ ul.lexassetscontent {
|
|
|
5188
5184
|
|
|
5189
5185
|
.lexcodescrollbar {
|
|
5190
5186
|
width: 10px;
|
|
5191
|
-
height: calc(100% - 62px);
|
|
5192
5187
|
position: absolute;
|
|
5193
5188
|
background-color: transparent;
|
|
5194
5189
|
box-sizing: border-box;
|
|
5195
5190
|
margin: 0;
|
|
5196
5191
|
padding: 0;
|
|
5197
|
-
margin-top: 31px;
|
|
5198
5192
|
z-index: 1 !important;
|
|
5199
5193
|
right: 0px;
|
|
5200
5194
|
pointer-events: none;
|
|
5201
5195
|
}
|
|
5202
5196
|
|
|
5203
5197
|
.lexcodescrollbar.horizontal {
|
|
5204
|
-
width: calc(100% -
|
|
5198
|
+
width: calc(100% - 48px);
|
|
5205
5199
|
height: 10px;
|
|
5206
|
-
bottom: 47px;
|
|
5207
|
-
right: 10px;
|
|
5208
|
-
}
|
|
5209
|
-
|
|
5210
|
-
.codebasearea:has(.codetabsarea.no-code-info) .lexcodescrollbar.horizontal {
|
|
5211
5200
|
bottom: 0px;
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
.lexcodescrollbar.scrollbar-unused {
|
|
5215
|
-
display: none;
|
|
5201
|
+
left: 48px; /* gutter offset */
|
|
5216
5202
|
}
|
|
5217
5203
|
|
|
5218
5204
|
.lexcodescrollbar div {
|
|
@@ -5334,6 +5320,10 @@ ul.lexassetscontent {
|
|
|
5334
5320
|
background-color: var(--global-color-accent);
|
|
5335
5321
|
}
|
|
5336
5322
|
|
|
5323
|
+
.lexcodeeditor .autocomplete pre.selected svg {
|
|
5324
|
+
color: white !important;
|
|
5325
|
+
}
|
|
5326
|
+
|
|
5337
5327
|
.lexcodeeditor .autocomplete pre span {
|
|
5338
5328
|
cursor: inherit;
|
|
5339
5329
|
}
|
|
@@ -5419,6 +5409,7 @@ ul.lexassetscontent {
|
|
|
5419
5409
|
.cm-mtd.wgsl { color: #dfe093; } /* method */
|
|
5420
5410
|
.cm-sym.wgsl { color: #f9cb20; } /* symbol */
|
|
5421
5411
|
.cm-ppc.wgsl { color: #99caf1; } /* preprocessor */
|
|
5412
|
+
.cm-bln.wgsl { color: #bebebe; } /* builtin */
|
|
5422
5413
|
|
|
5423
5414
|
.cm-sym.rust { color: #e7ded2; } /* symbol */
|
|
5424
5415
|
.cm-mtd.rust { color: #e0cc68 } /* method */
|
|
@@ -5437,8 +5428,9 @@ ul.lexassetscontent {
|
|
|
5437
5428
|
.cm-bln.markdown { color: #a1d2f0; } /* builtin */
|
|
5438
5429
|
|
|
5439
5430
|
.cm-sym.php { color: #cf6dcf; } /* symbol */
|
|
5440
|
-
.cm-mtd.php { color: #
|
|
5441
|
-
.cm-bln.php { color: #
|
|
5431
|
+
.cm-mtd.php { color: #ddce80 } /* method */
|
|
5432
|
+
.cm-bln.php { color: #ddce80; } /* builtin */
|
|
5433
|
+
.cm-var.php { color: #88bde9; } /* variable */
|
|
5442
5434
|
|
|
5443
5435
|
:root[data-theme="light"] .lexcodeeditor pre.active-line {
|
|
5444
5436
|
background-color: #e4e0e0ab;
|
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.4",
|
|
18
18
|
ready: false,
|
|
19
19
|
extensions: [], // Store extensions used
|
|
20
20
|
signals: {}, // Events and triggers
|
|
@@ -382,7 +382,7 @@ function _createCommandbar( root )
|
|
|
382
382
|
const instances = LX.CodeEditor.getInstances();
|
|
383
383
|
if( !instances.length || !instances[ 0 ].area.root.offsetHeight ) return;
|
|
384
384
|
|
|
385
|
-
const languages =
|
|
385
|
+
const languages = LX.CodeEditor.languages;
|
|
386
386
|
|
|
387
387
|
for( let l of Object.keys( languages ) )
|
|
388
388
|
{
|
|
@@ -1281,7 +1281,7 @@ class DropdownMenu {
|
|
|
1281
1281
|
}
|
|
1282
1282
|
else if( item.icon )
|
|
1283
1283
|
{
|
|
1284
|
-
const icon = LX.makeIcon( item.icon, { svgClass: disabled ? "fg-tertiary" : item.className } );
|
|
1284
|
+
const icon = LX.makeIcon( item.icon, { svgClass: disabled ? "fg-tertiary" : item.svgClass ?? item.className } );
|
|
1285
1285
|
menuItem.prepend( icon );
|
|
1286
1286
|
}
|
|
1287
1287
|
else if( item.checked == undefined && applyIconPadding ) // no checkbox, no icon, apply padding if there's checkbox or icon in other items
|
|
@@ -4555,6 +4555,7 @@ Element.prototype.ignore = function( eventName, callbackName ) {
|
|
|
4555
4555
|
|
|
4556
4556
|
const RAW_ICONS = {
|
|
4557
4557
|
// Internals
|
|
4558
|
+
"Abc": [24, 24, [], "regular", "M17 15q-.425 0-.712-.288T16 14v-4q0-.425.288-.712T17 9h3q.425 0 .713.288T21 10v1h-1.5v-.5h-2v3h2V13H21v1q0 .425-.288.713T20 15zm-7.5 0V9h4q.425 0 .713.288T14.5 10v1q0 .425-.288.713T13.5 12q.425 0 .713.288T14.5 13v1q0 .425-.288.713T13.5 15zm1.5-3.75h2v-.75h-2zm0 2.25h2v-.75h-2zM3 15v-5q0-.425.288-.712T4 9h3q.425 0 .713.288T8 10v5H6.5v-1.5h-2V15zm1.5-3h2v-1.5h-2z"],
|
|
4558
4559
|
"Clone": [512, 512, [], "regular", "M64 464l224 0c8.8 0 16-7.2 16-16l0-64 48 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64l64 0 0 48-64 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zM224 304l224 0c8.8 0 16-7.2 16-16l0-224c0-8.8-7.2-16-16-16L224 48c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zm-64-16l0-224c0-35.3 28.7-64 64-64L448 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-224 0c-35.3 0-64-28.7-64-64z"],
|
|
4559
4560
|
"IdBadge": [384, 512, [], "regular", "M256 48l0 16c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-16L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-384c0-8.8-7.2-16-16-16l-64 0zM0 64C0 28.7 28.7 0 64 0L320 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM160 320l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16L96 416c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z"],
|
|
4560
4561
|
"Paste": [512, 512, [], "regular", "M104.6 48L64 48C28.7 48 0 76.7 0 112L0 384c0 35.3 28.7 64 64 64l96 0 0-48-96 0c-8.8 0-16-7.2-16-16l0-272c0-8.8 7.2-16 16-16l16 0c0 17.7 14.3 32 32 32l72.4 0C202 108.4 227.6 96 256 96l62 0c-7.1-27.6-32.2-48-62-48l-40.6 0C211.6 20.9 188.2 0 160 0s-51.6 20.9-55.4 48zM144 56a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM448 464l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L464 243.9 464 448c0 8.8-7.2 16-16 16zM256 512l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9l-67.9-67.9c-9-9-21.2-14.1-33.9-14.1L256 128c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64z"],
|
|
@@ -4825,6 +4826,17 @@ function toTitleCase( str )
|
|
|
4825
4826
|
|
|
4826
4827
|
LX.toTitleCase = toTitleCase;
|
|
4827
4828
|
|
|
4829
|
+
/**
|
|
4830
|
+
* @method toKebabCase
|
|
4831
|
+
* @param {String} str
|
|
4832
|
+
*/
|
|
4833
|
+
function toKebabCase( str )
|
|
4834
|
+
{
|
|
4835
|
+
return str.replace( /[A-Z]/g, m => "-" + m.toLowerCase() );
|
|
4836
|
+
}
|
|
4837
|
+
|
|
4838
|
+
LX.toKebabCase = toKebabCase;
|
|
4839
|
+
|
|
4828
4840
|
/**
|
|
4829
4841
|
* @method getSupportedDOMName
|
|
4830
4842
|
* @description Convert a text string to a valid DOM name
|