lexgui 8.2.3 → 8.2.5

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.
Files changed (36) hide show
  1. package/build/components/BaseComponent.d.ts +75 -75
  2. package/build/components/Form.d.ts +14 -14
  3. package/build/components/NodeTree.d.ts +51 -51
  4. package/build/components/TextInput.d.ts +13 -13
  5. package/build/core/Namespace.js +1 -1
  6. package/build/core/Namespace.js.map +1 -1
  7. package/build/extensions/AssetView.d.ts +138 -137
  8. package/build/extensions/AssetView.js +57 -29
  9. package/build/extensions/AssetView.js.map +1 -1
  10. package/build/extensions/Audio.js +163 -163
  11. package/build/extensions/CodeEditor.d.ts +5 -0
  12. package/build/extensions/CodeEditor.js +5088 -5054
  13. package/build/extensions/CodeEditor.js.map +1 -1
  14. package/build/extensions/DocMaker.d.ts +1 -1
  15. package/build/extensions/DocMaker.js +14 -5
  16. package/build/extensions/DocMaker.js.map +1 -1
  17. package/build/lexgui.all.js +219 -101
  18. package/build/lexgui.all.js.map +1 -1
  19. package/build/lexgui.all.min.js +1 -1
  20. package/build/lexgui.all.module.js +219 -101
  21. package/build/lexgui.all.module.js.map +1 -1
  22. package/build/lexgui.all.module.min.js +1 -1
  23. package/build/lexgui.css +7466 -7475
  24. package/build/lexgui.js +83 -36
  25. package/build/lexgui.js.map +1 -1
  26. package/build/lexgui.min.css +1 -1
  27. package/build/lexgui.min.js +1 -1
  28. package/build/lexgui.module.js +83 -36
  29. package/build/lexgui.module.js.map +1 -1
  30. package/build/lexgui.module.min.js +1 -1
  31. package/changelog.md +28 -1
  32. package/demo.js +4 -1
  33. package/examples/asset-view.html +29 -2
  34. package/examples/code-editor.html +7 -1
  35. package/examples/editor.html +1 -1
  36. package/package.json +2 -1
@@ -1,75 +1,75 @@
1
- export declare enum ComponentType {
2
- NONE = 0,
3
- TEXT = 1,
4
- TEXTAREA = 2,
5
- BUTTON = 3,
6
- SELECT = 4,
7
- CHECKBOX = 5,
8
- TOGGLE = 6,
9
- RADIO = 7,
10
- BUTTONS = 8,
11
- COLOR = 9,
12
- RANGE = 10,
13
- NUMBER = 11,
14
- TITLE = 12,
15
- VECTOR = 13,
16
- TREE = 14,
17
- PROGRESS = 15,
18
- FILE = 16,
19
- LAYERS = 17,
20
- ARRAY = 18,
21
- LIST = 19,
22
- TAGS = 20,
23
- CURVE = 21,
24
- CARD = 22,
25
- IMAGE = 23,
26
- CONTENT = 24,
27
- CUSTOM = 25,
28
- SEPARATOR = 26,
29
- KNOB = 27,
30
- SIZE = 28,
31
- OTP = 29,
32
- PAD = 30,
33
- FORM = 31,
34
- DIAL = 32,
35
- COUNTER = 33,
36
- TABLE = 34,
37
- TABS = 35,
38
- DATE = 36,
39
- MAP2D = 37,
40
- LABEL = 39,
41
- BLANK = 40,
42
- RATE = 41
43
- }
44
- /**
45
- * @class BaseComponent
46
- */
47
- export declare class BaseComponent {
48
- type: ComponentType;
49
- name: string | null | undefined;
50
- customName?: string;
51
- options: any;
52
- root: any;
53
- customIdx: number;
54
- disabled: boolean;
55
- onSetValue?: (v: any, b?: boolean, e?: any) => void;
56
- onGetValue?: () => any;
57
- onAllowPaste?: (b: boolean) => boolean;
58
- onResize: (r?: any) => void;
59
- onSetDisabled?: (disabled?: boolean) => void;
60
- _initialValue: any;
61
- static NO_CONTEXT_TYPES: ComponentType[];
62
- constructor(type: ComponentType, name?: string | null | undefined, value?: any, options?: any);
63
- static _dispatchEvent(element: any, type: any, data?: any, bubbles?: any, cancelable?: any): void;
64
- _addResetProperty(container: any, callback: any): any;
65
- _canPaste(): boolean;
66
- _trigger(event: any, callback: any, scope?: any): void;
67
- value(): any;
68
- set(value: any, skipCallback?: boolean, event?: any): void;
69
- oncontextmenu(e: any): void;
70
- copy(): void;
71
- paste(): void;
72
- typeName(): string | undefined;
73
- setDisabled(disabled: boolean): void;
74
- refresh(value?: any): void;
75
- }
1
+ export declare enum ComponentType {
2
+ NONE = 0,
3
+ TEXT = 1,
4
+ TEXTAREA = 2,
5
+ BUTTON = 3,
6
+ SELECT = 4,
7
+ CHECKBOX = 5,
8
+ TOGGLE = 6,
9
+ RADIO = 7,
10
+ BUTTONS = 8,
11
+ COLOR = 9,
12
+ RANGE = 10,
13
+ NUMBER = 11,
14
+ TITLE = 12,
15
+ VECTOR = 13,
16
+ TREE = 14,
17
+ PROGRESS = 15,
18
+ FILE = 16,
19
+ LAYERS = 17,
20
+ ARRAY = 18,
21
+ LIST = 19,
22
+ TAGS = 20,
23
+ CURVE = 21,
24
+ CARD = 22,
25
+ IMAGE = 23,
26
+ CONTENT = 24,
27
+ CUSTOM = 25,
28
+ SEPARATOR = 26,
29
+ KNOB = 27,
30
+ SIZE = 28,
31
+ OTP = 29,
32
+ PAD = 30,
33
+ FORM = 31,
34
+ DIAL = 32,
35
+ COUNTER = 33,
36
+ TABLE = 34,
37
+ TABS = 35,
38
+ DATE = 36,
39
+ MAP2D = 37,
40
+ LABEL = 39,
41
+ BLANK = 40,
42
+ RATE = 41
43
+ }
44
+ /**
45
+ * @class BaseComponent
46
+ */
47
+ export declare class BaseComponent {
48
+ type: ComponentType;
49
+ name: string | null | undefined;
50
+ customName?: string;
51
+ options: any;
52
+ root: any;
53
+ customIdx: number;
54
+ disabled: boolean;
55
+ onSetValue?: (v: any, b?: boolean, e?: any) => void;
56
+ onGetValue?: () => any;
57
+ onAllowPaste?: (b: boolean) => boolean;
58
+ onResize: (r?: any) => void;
59
+ onSetDisabled?: (disabled?: boolean) => void;
60
+ _initialValue: any;
61
+ static NO_CONTEXT_TYPES: ComponentType[];
62
+ constructor(type: ComponentType, name?: string | null | undefined, value?: any, options?: any);
63
+ static _dispatchEvent(element: any, type: any, data?: any, bubbles?: any, cancelable?: any): void;
64
+ _addResetProperty(container: any, callback: any): any;
65
+ _canPaste(): boolean;
66
+ _trigger(event: any, callback: any, scope?: any): void;
67
+ value(): any;
68
+ set(value: any, skipCallback?: boolean, event?: any): void;
69
+ oncontextmenu(e: any): void;
70
+ copy(): void;
71
+ paste(): void;
72
+ typeName(): string | undefined;
73
+ setDisabled(disabled: boolean): void;
74
+ refresh(value?: any): void;
75
+ }
@@ -1,14 +1,14 @@
1
- import { BaseComponent } from './BaseComponent';
2
- import { Button } from './Button';
3
- /**
4
- * @class Form
5
- * @description Form Component
6
- */
7
- export declare class Form extends BaseComponent {
8
- data: any;
9
- formData: any;
10
- primaryButton: Button | undefined;
11
- constructor(name: string, data: any, callback: any, options?: any);
12
- submit(): void;
13
- syncInputs(): void;
14
- }
1
+ import { BaseComponent } from './BaseComponent';
2
+ import { Button } from './Button';
3
+ /**
4
+ * @class Form
5
+ * @description Form Component
6
+ */
7
+ export declare class Form extends BaseComponent {
8
+ data: any;
9
+ formData: any;
10
+ primaryButton: Button | undefined;
11
+ constructor(name: string, data: any, callback: any, options?: any);
12
+ submit(): void;
13
+ syncInputs(): void;
14
+ }
@@ -1,51 +1,51 @@
1
- import { BaseComponent } from './BaseComponent';
2
- export type NodeTreeAction = 'select' | 'dbl_click' | 'move' | 'delete' | 'rename' | 'visibility' | 'caret' | 'context_menu';
3
- export interface NodeTreeEvent {
4
- type: NodeTreeAction;
5
- domEvent?: Event;
6
- items?: any[];
7
- result?: any[];
8
- from?: any;
9
- to?: any;
10
- where?: any;
11
- oldName?: string;
12
- newName?: string;
13
- search?: any[];
14
- userInitiated: boolean;
15
- }
16
- /**
17
- * Signature for cancelable events.
18
- * `resolve()` MUST be called by the user to perform the UI action
19
- */
20
- export type NodeTreeEventCallback = (event: NodeTreeEvent, resolve?: (...args: any[]) => void) => boolean | void | Promise<void>;
21
- /**
22
- * @class NodeTree
23
- */
24
- export declare class NodeTree {
25
- domEl: any;
26
- data: any;
27
- options: any;
28
- selected: any[];
29
- _forceClose: boolean;
30
- _callbacks: Record<string, NodeTreeEventCallback>;
31
- constructor(domEl: any, data: any, options?: any);
32
- _createItem(parent: any, node: any, level?: number, selectedId?: string): void;
33
- refresh(newData?: any, selectedId?: string): void;
34
- frefresh(id: string): void;
35
- select(id: string): void;
36
- deleteNodes(nodes: any[]): any[];
37
- deleteNode(node: any): boolean;
38
- }
39
- /**
40
- * @class Tree
41
- * @description Tree Component
42
- */
43
- export declare class Tree extends BaseComponent {
44
- innerTree: NodeTree;
45
- constructor(name: string, data: any, options?: any);
46
- /**
47
- * @method on
48
- * @description Stores an event callback for the desired action
49
- */
50
- on(eventName: string, callback: NodeTreeEventCallback): void;
51
- }
1
+ import { BaseComponent } from './BaseComponent';
2
+ export type NodeTreeAction = 'select' | 'dbl_click' | 'move' | 'delete' | 'rename' | 'visibility' | 'caret' | 'context_menu';
3
+ export interface NodeTreeEvent {
4
+ type: NodeTreeAction;
5
+ domEvent?: Event;
6
+ items?: any[];
7
+ result?: any[];
8
+ from?: any;
9
+ to?: any;
10
+ where?: any;
11
+ oldName?: string;
12
+ newName?: string;
13
+ search?: any[];
14
+ userInitiated: boolean;
15
+ }
16
+ /**
17
+ * Signature for cancelable events.
18
+ * `resolve()` MUST be called by the user to perform the UI action
19
+ */
20
+ export type NodeTreeEventCallback = (event: NodeTreeEvent, resolve?: (...args: any[]) => void) => boolean | void | Promise<void>;
21
+ /**
22
+ * @class NodeTree
23
+ */
24
+ export declare class NodeTree {
25
+ domEl: any;
26
+ data: any;
27
+ options: any;
28
+ selected: any[];
29
+ _forceClose: boolean;
30
+ _callbacks: Record<string, NodeTreeEventCallback>;
31
+ constructor(domEl: any, data: any, options?: any);
32
+ _createItem(parent: any, node: any, level?: number, selectedId?: string): void;
33
+ refresh(newData?: any, selectedId?: string): void;
34
+ frefresh(id: string): void;
35
+ select(id?: string, path?: string[]): void;
36
+ deleteNodes(nodes: any[]): any[];
37
+ deleteNode(node: any): boolean;
38
+ }
39
+ /**
40
+ * @class Tree
41
+ * @description Tree Component
42
+ */
43
+ export declare class Tree extends BaseComponent {
44
+ innerTree: NodeTree;
45
+ constructor(name: string, data: any, options?: any);
46
+ /**
47
+ * @method on
48
+ * @description Stores an event callback for the desired action
49
+ */
50
+ on(eventName: string, callback: NodeTreeEventCallback): void;
51
+ }
@@ -1,13 +1,13 @@
1
- import { BaseComponent } from './BaseComponent';
2
- /**
3
- * @class TextInput
4
- * @description TextInput Component
5
- */
6
- export declare class TextInput extends BaseComponent {
7
- valid: (s: string, m?: string) => boolean;
8
- input: HTMLInputElement | HTMLAnchorElement;
9
- _triggerEvent: Event | undefined;
10
- _lastValueTriggered?: any;
11
- constructor(name: string | null, value?: string, callback?: any, options?: any);
12
- syncFromDOM(skipCallback?: boolean): void;
13
- }
1
+ import { BaseComponent } from './BaseComponent';
2
+ /**
3
+ * @class TextInput
4
+ * @description TextInput Component
5
+ */
6
+ export declare class TextInput extends BaseComponent {
7
+ valid: (s: string, m?: string) => boolean;
8
+ input: HTMLInputElement | HTMLAnchorElement;
9
+ _triggerEvent: Event | undefined;
10
+ _lastValueTriggered?: any;
11
+ constructor(name: string | null, value?: string, callback?: any, options?: any);
12
+ syncFromDOM(skipCallback?: boolean): void;
13
+ }
@@ -10,7 +10,7 @@ const g = globalThis;
10
10
  let LX = g.LX;
11
11
  if (!LX) {
12
12
  LX = {
13
- version: '8.2.3',
13
+ version: '8.2.5',
14
14
  ready: false,
15
15
  extensions: [], // Store extensions used
16
16
  extraCommandbarEntries: [], // User specific entries for command bar
@@ -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.2.3',\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;;;;"}
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.2.5',\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;;;;"}
@@ -1,137 +1,138 @@
1
- import { LX } from '../core/Namespace';
2
- declare const Area: any;
3
- declare const Panel: any;
4
- declare const NodeTree: any;
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';
7
- export interface AssetViewItem {
8
- id: string;
9
- type: string;
10
- children: AssetViewItem[];
11
- parent?: AssetViewItem;
12
- path?: string;
13
- src?: string;
14
- dir?: AssetViewItem[];
15
- domEl?: HTMLElement;
16
- metadata: any;
17
- }
18
- interface AssetViewEvent {
19
- type: AssetViewAction;
20
- items?: AssetViewItem[];
21
- result?: AssetViewItem[];
22
- from?: AssetViewItem;
23
- to?: AssetViewItem;
24
- where?: AssetViewItem;
25
- oldName?: string;
26
- newName?: string;
27
- search?: any[];
28
- userInitiated: boolean;
29
- }
30
- /**
31
- * Signature for cancelable events.
32
- * `resolve()` MUST be called by the user to perform the UI action
33
- */
34
- export type AssetViewEventCallback = (event: AssetViewEvent, resolve?: (...args: any[]) => void) => boolean | void | Promise<void>;
35
- /**
36
- * @class AssetView
37
- * @description Asset container with Tree for file system
38
- */
39
- export declare class AssetView {
40
- static LAYOUT_GRID: number;
41
- static LAYOUT_COMPACT: number;
42
- static LAYOUT_LIST: number;
43
- static CONTENT_SORT_ASC: number;
44
- static CONTENT_SORT_DESC: number;
45
- root: HTMLElement;
46
- area: typeof Area | null;
47
- content: HTMLElement;
48
- leftPanel: typeof Panel | null;
49
- toolsPanel: any;
50
- contentPanel: any;
51
- previewPanel: any;
52
- tree: typeof NodeTree | null;
53
- prevData: AssetViewItem[];
54
- nextData: AssetViewItem[];
55
- data: AssetViewItem[];
56
- currentData: AssetViewItem[];
57
- currentFolder: AssetViewItem | undefined;
58
- rootItem: AssetViewItem;
59
- path: string[];
60
- rootPath: string;
61
- selectedItem: AssetViewItem | undefined;
62
- allowedTypes: any;
63
- searchValue: string;
64
- filter: string;
65
- gridScale: number;
66
- layout: number;
67
- sortMode: number;
68
- skipBrowser: boolean;
69
- skipPreview: boolean;
70
- useNativeTitle: boolean;
71
- onlyFolders: boolean;
72
- allowMultipleSelection: boolean;
73
- previewActions: any[];
74
- contextMenu: any[];
75
- itemContextMenuOptions: any;
76
- private _assetsPerPage;
77
- get assetsPerPage(): any;
78
- set assetsPerPage(v: any);
79
- _callbacks: Record<string, AssetViewEventCallback>;
80
- _lastSortBy: string;
81
- _paginator: typeof LX.Pagination | undefined;
82
- _scriptCodeDialog: typeof LX.Dialog | undefined;
83
- _moveItemDialog: typeof LX.Dialog | undefined;
84
- _movingItem: AssetViewItem | undefined;
85
- constructor(options?: any);
86
- /**
87
- * @method on
88
- * @description Stores an event callback for the desired action
89
- */
90
- on(eventName: string, callback: AssetViewEventCallback): void;
91
- /**
92
- * @method load
93
- * @description Loads and processes the input data
94
- */
95
- load(data: any): void;
96
- /**
97
- * @method addItem
98
- * @description Creates an item DOM element
99
- */
100
- addItem(item: AssetViewItem, childIndex: number | undefined, updateTree?: boolean): HTMLLIElement;
101
- /**
102
- * @method clear
103
- * @description Creates all AssetView container panels
104
- */
105
- clear(): void;
106
- _processData(data: any, parent?: AssetViewItem): void;
107
- _updatePath(): void;
108
- _createNavigationBar(panel: typeof Panel): void;
109
- _createTreePanel(area: typeof Area): void;
110
- _subscribeTreeEvents(tree: typeof Tree): void;
111
- _setContentLayout(layoutMode: number): void;
112
- _createContentPanel(area: typeof Area): void;
113
- _makeNameFilterFn(searchValue: string): (name: string) => boolean;
114
- _refreshContent(searchValue?: string, filter?: string, userInitiated?: boolean): void;
115
- _previewAsset(file: AssetViewItem): void;
116
- _processDrop(e: DragEvent): void;
117
- _sortData(sortBy?: string, sortMode?: number): void;
118
- _enterFolder(folderItem: AssetViewItem | undefined, storeCurrent?: boolean): Promise<void>;
119
- _removeItemFromParent(item: AssetViewItem): boolean;
120
- _requestDeleteItem(item: AssetViewItem): void;
121
- _deleteItem(item: AssetViewItem): void;
122
- _requestMoveItemToFolder(item: AssetViewItem, folder: AssetViewItem): void;
123
- _moveItemToFolder(item: AssetViewItem, folder: AssetViewItem): void;
124
- _moveItem(item: AssetViewItem, defaultFolder?: AssetViewItem | AssetViewItem[]): void;
125
- _requestCloneItem(item: AssetViewItem): false | undefined;
126
- _cloneItem(item: AssetViewItem): AssetViewItem;
127
- _getClonedName(originalName: string, siblings: any[]): string;
128
- _requestRenameItem(item: AssetViewItem, newName: string, treeEvent?: boolean): void;
129
- _renameItem(item: AssetViewItem, newName: string, data?: AssetViewItem[]): void;
130
- _renameItemPopover(item: AssetViewItem): void;
131
- _requestCreateFolder(folder?: AssetViewItem): void;
132
- _createFolder(folder?: AssetViewItem, newFolderName?: string): AssetViewItem;
133
- _openScriptInEditor(script: any): void;
134
- _setAssetsPerPage(n: number): void;
135
- _lastModifiedToStringDate(lm: number): string;
136
- }
137
- export {};
1
+ import { LX } from '../core/Namespace';
2
+ declare const Area: any;
3
+ declare const Panel: any;
4
+ declare const NodeTree: any;
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';
7
+ export interface AssetViewItem {
8
+ id: string;
9
+ type: string;
10
+ children: AssetViewItem[];
11
+ parent?: AssetViewItem;
12
+ path?: string;
13
+ src?: string;
14
+ dir?: AssetViewItem[];
15
+ domEl?: HTMLElement;
16
+ metadata: any;
17
+ }
18
+ interface AssetViewEvent {
19
+ type: AssetViewAction;
20
+ items?: AssetViewItem[];
21
+ result?: AssetViewItem[];
22
+ from?: AssetViewItem;
23
+ to?: AssetViewItem;
24
+ where?: AssetViewItem;
25
+ oldName?: string;
26
+ newName?: string;
27
+ search?: any[];
28
+ userInitiated: boolean;
29
+ }
30
+ /**
31
+ * Signature for cancelable events.
32
+ * `resolve()` MUST be called by the user to perform the UI action
33
+ */
34
+ export type AssetViewEventCallback = (event: AssetViewEvent, resolve?: (...args: any[]) => void) => boolean | void | Promise<void>;
35
+ /**
36
+ * @class AssetView
37
+ * @description Asset container with Tree for file system
38
+ */
39
+ export declare class AssetView {
40
+ static LAYOUT_GRID: number;
41
+ static LAYOUT_COMPACT: number;
42
+ static LAYOUT_LIST: number;
43
+ static CONTENT_SORT_ASC: number;
44
+ static CONTENT_SORT_DESC: number;
45
+ root: HTMLElement;
46
+ area: typeof Area | null;
47
+ content: HTMLElement;
48
+ leftPanel: typeof Panel | null;
49
+ toolsPanel: any;
50
+ contentPanel: any;
51
+ previewPanel: any;
52
+ tree: typeof NodeTree | null;
53
+ prevData: AssetViewItem[];
54
+ nextData: AssetViewItem[];
55
+ data: AssetViewItem[];
56
+ currentData: AssetViewItem[];
57
+ currentFolder: AssetViewItem | undefined;
58
+ rootItem: AssetViewItem;
59
+ path: string[];
60
+ rootPath: string;
61
+ selectedItems: AssetViewItem[];
62
+ allowedTypes: any;
63
+ searchValue: string;
64
+ filter: string;
65
+ gridScale: number;
66
+ layout: number;
67
+ sortMode: number;
68
+ skipBrowser: boolean;
69
+ skipPreview: boolean;
70
+ useNativeTitle: boolean;
71
+ onlyFolders: boolean;
72
+ allowMultipleSelection: boolean;
73
+ allowItemCheck: boolean;
74
+ previewActions: any[];
75
+ contextMenu: any[];
76
+ itemContextMenuOptions: any;
77
+ private _assetsPerPage;
78
+ get assetsPerPage(): any;
79
+ set assetsPerPage(v: any);
80
+ _callbacks: Record<string, AssetViewEventCallback>;
81
+ _lastSortBy: string;
82
+ _paginator: typeof LX.Pagination | undefined;
83
+ _scriptCodeDialog: typeof LX.Dialog | undefined;
84
+ _moveItemDialog: typeof LX.Dialog | undefined;
85
+ _movingItem: AssetViewItem | undefined;
86
+ constructor(options?: any);
87
+ /**
88
+ * @method on
89
+ * @description Stores an event callback for the desired action
90
+ */
91
+ on(eventName: string, callback: AssetViewEventCallback): void;
92
+ /**
93
+ * @method load
94
+ * @description Loads and processes the input data
95
+ */
96
+ load(data: any): void;
97
+ /**
98
+ * @method addItem
99
+ * @description Creates an item DOM element
100
+ */
101
+ addItem(item: AssetViewItem, childIndex: number | undefined, updateTree?: boolean): HTMLLIElement;
102
+ /**
103
+ * @method clear
104
+ * @description Creates all AssetView container panels
105
+ */
106
+ clear(): void;
107
+ _processData(data: any, parent?: AssetViewItem): void;
108
+ _updatePath(): void;
109
+ _createNavigationBar(panel: typeof Panel): void;
110
+ _createTreePanel(area: typeof Area): void;
111
+ _subscribeTreeEvents(tree: typeof Tree): void;
112
+ _setContentLayout(layoutMode: number): void;
113
+ _createContentPanel(area: typeof Area): void;
114
+ _makeNameFilterFn(searchValue: string): (name: string) => boolean;
115
+ _refreshContent(searchValue?: string, filter?: string, userInitiated?: boolean): void;
116
+ _previewAsset(file: AssetViewItem): void;
117
+ _processDrop(e: DragEvent): void;
118
+ _sortData(sortBy?: string, sortMode?: number): void;
119
+ _enterFolder(folderItem: AssetViewItem | undefined, storeCurrent?: boolean): Promise<void>;
120
+ _removeItemFromParent(item: AssetViewItem): boolean;
121
+ _requestDeleteItem(items: AssetViewItem[]): void;
122
+ _deleteItem(item: AssetViewItem): void;
123
+ _requestMoveItemToFolder(item: AssetViewItem, folder: AssetViewItem): void;
124
+ _moveItemToFolder(item: AssetViewItem, folder: AssetViewItem): void;
125
+ _moveItem(item: AssetViewItem, defaultFolder?: AssetViewItem | AssetViewItem[]): void;
126
+ _requestCloneItem(item: AssetViewItem): false | undefined;
127
+ _cloneItem(item: AssetViewItem): AssetViewItem;
128
+ _getClonedName(originalName: string, siblings: any[]): string;
129
+ _requestRenameItem(item: AssetViewItem, newName: string, treeEvent?: boolean): void;
130
+ _renameItem(item: AssetViewItem, newName: string, data?: AssetViewItem[]): void;
131
+ _renameItemPopover(item: AssetViewItem): void;
132
+ _requestCreateFolder(folder?: AssetViewItem): void;
133
+ _createFolder(folder?: AssetViewItem, newFolderName?: string): AssetViewItem;
134
+ _openScriptInEditor(script: any): void;
135
+ _setAssetsPerPage(n: number): void;
136
+ _lastModifiedToStringDate(lm: number): string;
137
+ }
138
+ export {};