lexgui 8.3.2 → 8.4.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/build/components/BaseComponent.d.ts +4 -2
- package/build/components/Empty.d.ts +8 -0
- package/build/core/Namespace.js +1 -1
- package/build/core/Namespace.js.map +1 -1
- package/build/core/Panel.d.ts +14 -7
- package/build/extensions/AssetView.d.ts +3 -2
- package/build/extensions/AssetView.js +37 -19
- package/build/extensions/AssetView.js.map +1 -1
- package/build/extensions/CodeEditor.d.ts +11 -2
- package/build/extensions/CodeEditor.js +214 -40
- package/build/extensions/CodeEditor.js.map +1 -1
- package/build/lexgui.all.js +420 -77
- package/build/lexgui.all.js.map +1 -1
- package/build/lexgui.all.min.js +1 -1
- package/build/lexgui.all.module.js +420 -77
- package/build/lexgui.all.module.js.map +1 -1
- package/build/lexgui.all.module.min.js +1 -1
- package/build/lexgui.css +38 -2
- package/build/lexgui.js +383 -58
- package/build/lexgui.js.map +1 -1
- package/build/lexgui.min.css +1 -1
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +383 -58
- package/build/lexgui.module.js.map +1 -1
- package/build/lexgui.module.min.js +1 -1
- package/changelog.md +28 -1
- package/examples/all-components.html +1 -0
- package/examples/asset-view.html +7 -33
- package/examples/code-editor.html +8 -0
- package/package.json +1 -1
|
@@ -39,7 +39,9 @@ export declare enum ComponentType {
|
|
|
39
39
|
MAP2D = 37,
|
|
40
40
|
LABEL = 39,
|
|
41
41
|
BLANK = 40,
|
|
42
|
-
RATE = 41
|
|
42
|
+
RATE = 41,
|
|
43
|
+
EMPTY = 42,
|
|
44
|
+
DESCRIPTION = 43
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* @class BaseComponent
|
|
@@ -56,7 +58,7 @@ export declare class BaseComponent {
|
|
|
56
58
|
onGetValue?: () => any;
|
|
57
59
|
onAllowPaste?: (b: boolean) => boolean;
|
|
58
60
|
onResize: (r?: any) => void;
|
|
59
|
-
onSetDisabled?: (disabled
|
|
61
|
+
onSetDisabled?: (disabled: boolean) => void;
|
|
60
62
|
_initialValue: any;
|
|
61
63
|
static NO_CONTEXT_TYPES: ComponentType[];
|
|
62
64
|
constructor(type: ComponentType, name?: string | null | undefined, value?: any, options?: any);
|
package/build/core/Namespace.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Namespace.js","sources":["../../src/core/Namespace.ts"],"sourcesContent":["// Namespace.ts @jxarco\r\n\r\n/**\r\n * Main namespace\r\n * @namespace LX\r\n */\r\n\r\nconst g = globalThis as any;\r\n\r\n// Update global namespace if not present (Loading module)\r\n// Extension scripts rely on LX being globally available\r\nlet LX: any = g.LX;\r\n\r\nif ( !LX )\r\n{\r\n LX = {\r\n version: '8.
|
|
1
|
+
{"version":3,"file":"Namespace.js","sources":["../../src/core/Namespace.ts"],"sourcesContent":["// Namespace.ts @jxarco\r\n\r\n/**\r\n * Main namespace\r\n * @namespace LX\r\n */\r\n\r\nconst g = globalThis as any;\r\n\r\n// Update global namespace if not present (Loading module)\r\n// Extension scripts rely on LX being globally available\r\nlet LX: any = g.LX;\r\n\r\nif ( !LX )\r\n{\r\n LX = {\r\n version: '8.4.1',\r\n ready: false,\r\n extensions: [], // Store extensions used\r\n extraCommandbarEntries: [], // User specific entries for command bar\r\n signals: {}, // Events and triggers\r\n activeDraggable: null, // Watch for the current active draggable\r\n\r\n spacingMode: 'default',\r\n layoutMode: 'app',\r\n\r\n MOUSE_LEFT_CLICK: 0,\r\n MOUSE_MIDDLE_CLICK: 1,\r\n MOUSE_RIGHT_CLICK: 2,\r\n\r\n MOUSE_DOUBLE_CLICK: 2,\r\n MOUSE_TRIPLE_CLICK: 3,\r\n\r\n CURVE_MOVEOUT_CLAMP: 0,\r\n CURVE_MOVEOUT_DELETE: 1,\r\n\r\n DRAGGABLE_Z_INDEX: 101\r\n };\r\n\r\n g.LX = LX;\r\n}\r\n\r\nexport { LX };\r\n"],"names":[],"mappings":";AAAA;AAEA;;;AAGG;AAEH,MAAM,CAAC,GAAG,UAAiB;AAE3B;AACA;AACA,IAAI,EAAE,GAAQ,CAAC,CAAC;AAEhB,IAAK,CAAC,EAAE,EACR;AACI,IAAA,EAAE,GAAG;AACD,QAAA,OAAO,EAAE,OAAO;AAChB,QAAA,KAAK,EAAE,KAAK;QACZ,UAAU,EAAE,EAAE;QACd,sBAAsB,EAAE,EAAE;QAC1B,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,IAAI;AAErB,QAAA,WAAW,EAAE,SAAS;AACtB,QAAA,UAAU,EAAE,KAAK;AAEjB,QAAA,gBAAgB,EAAE,CAAC;AACnB,QAAA,kBAAkB,EAAE,CAAC;AACrB,QAAA,iBAAiB,EAAE,CAAC;AAEpB,QAAA,kBAAkB,EAAE,CAAC;AACrB,QAAA,kBAAkB,EAAE,CAAC;AAErB,QAAA,mBAAmB,EAAE,CAAC;AACtB,QAAA,oBAAoB,EAAE,CAAC;AAEvB,QAAA,iBAAiB,EAAE;KACtB;AAED,IAAA,CAAC,CAAC,EAAE,GAAG,EAAE;AACb;;;;"}
|
package/build/core/Panel.d.ts
CHANGED
|
@@ -139,6 +139,12 @@ export declare class Panel {
|
|
|
139
139
|
* @param {Object} options Text options
|
|
140
140
|
*/
|
|
141
141
|
addLabel(value: string, options?: any): any;
|
|
142
|
+
/**
|
|
143
|
+
* @method addDescription
|
|
144
|
+
* @param {String} value Information string
|
|
145
|
+
* @param {Object} options Text options
|
|
146
|
+
*/
|
|
147
|
+
addDescription(value: string, options?: any): any;
|
|
142
148
|
/**
|
|
143
149
|
* @method addButton
|
|
144
150
|
* @param {String} name Component name
|
|
@@ -171,15 +177,16 @@ export declare class Panel {
|
|
|
171
177
|
addComboButtons(name: string, values: any[], options?: any): any;
|
|
172
178
|
/**
|
|
173
179
|
* @method addCard
|
|
174
|
-
* @param {String} name
|
|
175
|
-
* @param {Object} options
|
|
176
|
-
* text: Card text
|
|
177
|
-
* link: Card link
|
|
178
|
-
* title: Card dom title
|
|
179
|
-
* src: url of the image
|
|
180
|
-
* callback (Function): function to call on click
|
|
180
|
+
* @param {String} name
|
|
181
|
+
* @param {Object} options
|
|
181
182
|
*/
|
|
182
183
|
addCard(name: string, options?: any): any;
|
|
184
|
+
/**
|
|
185
|
+
* @method addEmpty
|
|
186
|
+
* @param {String} name
|
|
187
|
+
* @param {Object} options
|
|
188
|
+
*/
|
|
189
|
+
addEmpty(name: string, options?: any): any;
|
|
183
190
|
/**
|
|
184
191
|
* @method addForm
|
|
185
192
|
* @param {String} name Component name
|
|
@@ -3,7 +3,7 @@ declare const Area: any;
|
|
|
3
3
|
declare const Panel: any;
|
|
4
4
|
declare const NodeTree: any;
|
|
5
5
|
declare const Tree: any;
|
|
6
|
-
export type AssetViewAction = 'select' | 'dbl_click' | 'check' | 'clone' | 'move' | 'delete' | 'rename' | 'enter_folder' | 'create-folder' | 'refresh-content' | 'node-drag';
|
|
6
|
+
export type AssetViewAction = 'select' | 'dbl_click' | 'check' | 'clone' | 'move' | 'delete' | 'rename' | 'enter_folder' | 'create-folder' | 'refresh-content' | 'node-drag' | 'enter-folder';
|
|
7
7
|
export interface AssetViewItem {
|
|
8
8
|
id: string;
|
|
9
9
|
type: string;
|
|
@@ -116,7 +116,8 @@ export declare class AssetView {
|
|
|
116
116
|
_previewAsset(file: AssetViewItem): void;
|
|
117
117
|
_processDrop(e: DragEvent): void;
|
|
118
118
|
_sortData(sortBy?: string, sortMode?: number): void;
|
|
119
|
-
|
|
119
|
+
_requestEnterFolder(folderItem: AssetViewItem | undefined, storeCurrent?: boolean): void;
|
|
120
|
+
_enterFolder(folderItem: AssetViewItem | undefined, storeCurrent: boolean, mustRefresh: boolean): void;
|
|
120
121
|
_removeItemFromParent(item: AssetViewItem): boolean;
|
|
121
122
|
_requestDeleteItem(items: AssetViewItem[]): void;
|
|
122
123
|
_deleteItem(item: AssetViewItem): void;
|
|
@@ -314,7 +314,7 @@ class AssetView {
|
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
else if (isFolder) {
|
|
317
|
-
that.
|
|
317
|
+
that._requestEnterFolder(item);
|
|
318
318
|
return;
|
|
319
319
|
}
|
|
320
320
|
const onSelect = that._callbacks['select'];
|
|
@@ -532,17 +532,17 @@ class AssetView {
|
|
|
532
532
|
if (!this.prevData.length || !this.currentFolder)
|
|
533
533
|
return;
|
|
534
534
|
this.nextData.push(this.currentFolder);
|
|
535
|
-
this._enterFolder(this.prevData.pop(), false);
|
|
535
|
+
this._enterFolder(this.prevData.pop(), false, true);
|
|
536
536
|
}, { buttonClass: 'ghost', title: 'Go Back', tooltip: true, icon: 'ArrowLeft' });
|
|
537
537
|
panel.addButton(null, 'GoForwardButton', () => {
|
|
538
538
|
if (!this.nextData.length || !this.currentFolder)
|
|
539
539
|
return;
|
|
540
|
-
this._enterFolder(this.nextData.pop());
|
|
540
|
+
this._enterFolder(this.nextData.pop(), false, true);
|
|
541
541
|
}, { buttonClass: 'ghost', title: 'Go Forward', tooltip: true, icon: 'ArrowRight' });
|
|
542
542
|
panel.addButton(null, 'GoUpButton', () => {
|
|
543
543
|
const parentFolder = this.currentFolder?.parent;
|
|
544
544
|
if (parentFolder)
|
|
545
|
-
this._enterFolder(parentFolder);
|
|
545
|
+
this._enterFolder(parentFolder, false, true);
|
|
546
546
|
}, { buttonClass: 'ghost', title: 'Go Upper Folder', tooltip: true, icon: 'ArrowUp' });
|
|
547
547
|
panel.addButton(null, 'RefreshButton', () => {
|
|
548
548
|
this._refreshContent(undefined, undefined, true);
|
|
@@ -582,7 +582,7 @@ class AssetView {
|
|
|
582
582
|
this._updatePath();
|
|
583
583
|
}
|
|
584
584
|
else {
|
|
585
|
-
this.
|
|
585
|
+
this._requestEnterFolder(node.type === 'folder' ? node : node.parent);
|
|
586
586
|
this._previewAsset(node);
|
|
587
587
|
if (node.type !== 'folder') {
|
|
588
588
|
this.content.querySelectorAll('.lexassetitem').forEach((i) => i.classList.remove('selected'));
|
|
@@ -954,12 +954,41 @@ class AssetView {
|
|
|
954
954
|
this.toolsPanel.refresh();
|
|
955
955
|
this._refreshContent();
|
|
956
956
|
}
|
|
957
|
-
|
|
957
|
+
_requestEnterFolder(folderItem, storeCurrent = true) {
|
|
958
|
+
if (!folderItem) {
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
const onBeforeEnterFolder = this._callbacks['beforeEnterFolder'];
|
|
962
|
+
const onEnterFolder = this._callbacks['enterFolder'];
|
|
963
|
+
const resolve = (...args) => {
|
|
964
|
+
const child = this.currentData[0];
|
|
965
|
+
const sameFolder = child?.parent?.metadata?.uid === folderItem.metadata?.uid;
|
|
966
|
+
const mustRefresh = args[0] || !sameFolder;
|
|
967
|
+
this._enterFolder(folderItem, storeCurrent, mustRefresh);
|
|
968
|
+
const event = {
|
|
969
|
+
type: 'enter-folder',
|
|
970
|
+
to: folderItem,
|
|
971
|
+
userInitiated: true
|
|
972
|
+
};
|
|
973
|
+
if (onEnterFolder)
|
|
974
|
+
onEnterFolder(event, ...args);
|
|
975
|
+
};
|
|
976
|
+
if (onBeforeEnterFolder) {
|
|
977
|
+
const event = {
|
|
978
|
+
type: 'enter-folder',
|
|
979
|
+
to: folderItem,
|
|
980
|
+
userInitiated: true
|
|
981
|
+
};
|
|
982
|
+
onBeforeEnterFolder(event, resolve);
|
|
983
|
+
}
|
|
984
|
+
else {
|
|
985
|
+
resolve();
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
_enterFolder(folderItem, storeCurrent, mustRefresh) {
|
|
958
989
|
if (!folderItem) {
|
|
959
990
|
return;
|
|
960
991
|
}
|
|
961
|
-
const child = this.currentData[0];
|
|
962
|
-
const sameFolder = child?.parent?.metadata?.uid === folderItem.metadata?.uid;
|
|
963
992
|
if (storeCurrent) {
|
|
964
993
|
this.prevData.push(this.currentFolder ?? {
|
|
965
994
|
id: '/',
|
|
@@ -968,17 +997,6 @@ class AssetView {
|
|
|
968
997
|
metadata: {}
|
|
969
998
|
});
|
|
970
999
|
}
|
|
971
|
-
let mustRefresh = !sameFolder;
|
|
972
|
-
const onEnterFolder = this._callbacks['enterFolder'];
|
|
973
|
-
if (onEnterFolder !== undefined) {
|
|
974
|
-
const event = {
|
|
975
|
-
type: 'enter_folder',
|
|
976
|
-
to: folderItem,
|
|
977
|
-
userInitiated: true
|
|
978
|
-
};
|
|
979
|
-
const r = await onEnterFolder(event);
|
|
980
|
-
mustRefresh = mustRefresh || r;
|
|
981
|
-
}
|
|
982
1000
|
// Update this after the event since the user might have added or modified the data
|
|
983
1001
|
this.currentFolder = folderItem;
|
|
984
1002
|
this.currentData = this.currentFolder?.children ?? [];
|