lexgui 0.7.15 → 8.1.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/LICENSE +201 -21
- package/README.md +14 -5
- package/build/components/AlertDialog.d.ts +7 -0
- package/build/components/ArrayInput.d.ts +9 -0
- package/build/components/BaseComponent.d.ts +73 -0
- package/build/components/Button.d.ts +14 -0
- package/build/components/Calendar.d.ts +41 -0
- package/build/components/CalendarRange.d.ts +16 -0
- package/build/components/CanvasCurve.d.ts +10 -0
- package/build/components/CanvasDial.d.ts +11 -0
- package/build/components/CanvasMap2D.d.ts +61 -0
- package/build/components/Card.d.ts +8 -0
- package/build/components/Checkbox.d.ts +8 -0
- package/build/components/Color.d.ts +20 -0
- package/build/components/ColorInput.d.ts +13 -0
- package/build/components/ColorPicker.d.ts +29 -0
- package/build/components/ComboButtons.d.ts +8 -0
- package/build/components/ContextMenu.d.ts +16 -0
- package/build/components/Counter.d.ts +9 -0
- package/build/components/Curve.d.ts +10 -0
- package/build/components/DatePicker.d.ts +13 -0
- package/build/components/Dial.d.ts +10 -0
- package/build/components/Dialog.d.ts +20 -0
- package/build/components/DropdownMenu.d.ts +32 -0
- package/build/components/FileInput.d.ts +8 -0
- package/build/components/Footer.d.ts +14 -0
- package/build/components/Form.d.ts +8 -0
- package/build/components/Layers.d.ts +9 -0
- package/build/components/List.d.ts +9 -0
- package/build/components/Map2D.d.ts +12 -0
- package/build/components/Menubar.d.ts +59 -0
- package/build/components/NodeTree.d.ts +26 -0
- package/build/components/NumberInput.d.ts +9 -0
- package/build/components/OTPInput.d.ts +8 -0
- package/build/components/Pad.d.ts +8 -0
- package/build/components/Pagination.d.ts +26 -0
- package/build/components/PocketDialog.d.ts +11 -0
- package/build/components/Popover.d.ts +20 -0
- package/build/components/Progress.d.ts +8 -0
- package/build/components/RadioGroup.d.ts +8 -0
- package/build/components/RangeInput.d.ts +11 -0
- package/build/components/Rate.d.ts +8 -0
- package/build/components/Select.d.ts +10 -0
- package/build/components/Sheet.d.ts +10 -0
- package/build/components/Sidebar.d.ts +84 -0
- package/build/components/SizeInput.d.ts +8 -0
- package/build/components/Skeleton.d.ts +5 -0
- package/build/components/Spinner.d.ts +9 -0
- package/build/components/TabSections.d.ts +11 -0
- package/build/components/Table.d.ts +34 -0
- package/build/components/Tabs.d.ts +20 -0
- package/build/components/Tags.d.ts +9 -0
- package/build/components/TextArea.d.ts +8 -0
- package/build/components/TextInput.d.ts +11 -0
- package/build/components/Title.d.ts +8 -0
- package/build/components/Toggle.d.ts +8 -0
- package/build/components/Tour.d.ts +36 -0
- package/build/components/Vector.d.ts +9 -0
- package/build/core/Area.d.ts +143 -0
- package/build/core/Branch.d.ts +19 -0
- package/build/core/Core.d.ts +1 -0
- package/build/core/Event.d.ts +26 -0
- package/build/core/Icons.d.ts +4 -0
- package/build/core/Namespace.d.ts +2 -0
- package/build/core/Namespace.js +34 -0
- package/build/core/Namespace.js.map +1 -0
- package/build/core/Panel.d.ts +538 -0
- package/build/core/Utils.d.ts +1 -0
- package/build/core/Vec2.d.ts +21 -0
- package/build/extensions/AssetView.d.ts +136 -0
- package/build/extensions/AssetView.js +1367 -0
- package/build/extensions/AssetView.js.map +1 -0
- package/build/extensions/Audio.d.ts +9 -0
- package/build/extensions/Audio.js +163 -0
- package/build/extensions/Audio.js.map +1 -0
- package/build/extensions/CodeEditor.d.ts +350 -0
- package/build/extensions/CodeEditor.js +5022 -0
- package/build/extensions/CodeEditor.js.map +1 -0
- package/build/extensions/DocMaker.d.ts +27 -0
- package/build/extensions/DocMaker.js +327 -0
- package/build/extensions/DocMaker.js.map +1 -0
- package/build/extensions/GraphEditor.d.ts +276 -0
- package/build/extensions/GraphEditor.js +2770 -0
- package/build/extensions/GraphEditor.js.map +1 -0
- package/build/extensions/ImUi.d.ts +46 -0
- package/build/extensions/ImUi.js +227 -0
- package/build/extensions/ImUi.js.map +1 -0
- package/build/extensions/Timeline.d.ts +670 -0
- package/build/extensions/Timeline.js +3955 -0
- package/build/extensions/Timeline.js.map +1 -0
- package/build/extensions/VideoEditor.d.ts +128 -0
- package/build/extensions/VideoEditor.js +898 -0
- package/build/extensions/VideoEditor.js.map +1 -0
- package/build/extensions/index.d.ts +8 -0
- package/build/extensions/index.js +10 -0
- package/build/extensions/index.js.map +1 -0
- package/build/index.all.d.ts +2 -0
- package/build/index.css.d.ts +4 -0
- package/build/index.d.ts +56 -0
- package/build/lexgui.all.js +28498 -0
- package/build/lexgui.all.js.map +1 -0
- package/build/lexgui.all.min.js +1 -0
- package/build/lexgui.all.module.js +28422 -0
- package/build/lexgui.all.module.js.map +1 -0
- package/build/lexgui.all.module.min.js +1 -0
- package/build/lexgui.css +939 -346
- package/build/lexgui.js +13406 -17286
- package/build/lexgui.js.map +1 -0
- package/build/lexgui.min.css +3 -10
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +12762 -16698
- package/build/lexgui.module.js.map +1 -0
- package/build/lexgui.module.min.js +1 -1
- package/changelog.md +170 -74
- package/demo.js +162 -48
- package/examples/all-components.html +45 -14
- package/examples/asset-view.html +110 -47
- package/examples/code-editor.html +5 -5
- package/examples/dialogs.html +3 -3
- package/examples/editor.html +27 -13
- package/examples/index.html +19 -14
- package/examples/node-graph.html +2 -2
- package/examples/previews/video-editor.png +0 -0
- package/examples/timeline.html +1 -1
- package/examples/video-editor.html +2 -2
- package/package.json +25 -9
- package/build/extensions/audio.js +0 -212
- package/build/extensions/codeeditor.js +0 -6319
- package/build/extensions/docmaker.js +0 -432
- package/build/extensions/imui.js +0 -325
- package/build/extensions/nodegraph.js +0 -3696
- package/build/extensions/timeline.js +0 -4636
- package/build/extensions/videoeditor.js +0 -953
- package/build/lexgui-docs.css +0 -352
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
declare const vec2: any;
|
|
2
|
+
declare const Area: any;
|
|
3
|
+
declare const Sidebar: any;
|
|
4
|
+
declare const PocketDialog: any;
|
|
5
|
+
export declare class BoundingBox {
|
|
6
|
+
origin: typeof vec2;
|
|
7
|
+
size: typeof vec2;
|
|
8
|
+
constructor(o: typeof vec2, s: typeof vec2);
|
|
9
|
+
merge(bb: BoundingBox): void;
|
|
10
|
+
inside(bb: BoundingBox, full?: boolean): boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @class GraphEditor
|
|
14
|
+
*/
|
|
15
|
+
export declare class GraphEditor {
|
|
16
|
+
static __instances: GraphEditor[];
|
|
17
|
+
static MIN_SCALE: number;
|
|
18
|
+
static MAX_SCALE: number;
|
|
19
|
+
static EVENT_MOUSEMOVE: number;
|
|
20
|
+
static EVENT_MOUSEWHEEL: number;
|
|
21
|
+
static LAST_GROUP_ID: number;
|
|
22
|
+
static LAST_FUNCTION_ID: number;
|
|
23
|
+
static STOPPED: number;
|
|
24
|
+
static RUNNING: number;
|
|
25
|
+
static NODE_IO_INPUT: number;
|
|
26
|
+
static NODE_IO_OUTPUT: number;
|
|
27
|
+
static NODE_TYPES: Record<string, GraphNode>;
|
|
28
|
+
static onCustomNodeRegistered: (s: string, n: GraphNode) => void;
|
|
29
|
+
static onNodeTypeReplaced: (s: string, n: GraphNode, p: GraphNode) => void;
|
|
30
|
+
root: HTMLElement;
|
|
31
|
+
area: typeof Area;
|
|
32
|
+
propertiesDialog: typeof PocketDialog;
|
|
33
|
+
currentGraph: Graph | null;
|
|
34
|
+
keys: any;
|
|
35
|
+
graphs: Record<string, any>;
|
|
36
|
+
nodes: Record<string, any>;
|
|
37
|
+
variables: Record<string, any>;
|
|
38
|
+
groups: any;
|
|
39
|
+
supportedCastTypes: any;
|
|
40
|
+
selectedNodes: any[];
|
|
41
|
+
main: string;
|
|
42
|
+
mustStop: boolean;
|
|
43
|
+
state: number;
|
|
44
|
+
isFocused: boolean;
|
|
45
|
+
_graphContainer: HTMLElement;
|
|
46
|
+
_sidebarDom: HTMLElement;
|
|
47
|
+
_sidebarActive: boolean;
|
|
48
|
+
_sidebar: typeof Sidebar;
|
|
49
|
+
_domLinks: HTMLElement;
|
|
50
|
+
_domNodes: HTMLElement;
|
|
51
|
+
_mousePosition: typeof vec2;
|
|
52
|
+
_deltaMousePosition: typeof vec2;
|
|
53
|
+
_snappedDeltaMousePosition: typeof vec2;
|
|
54
|
+
_lastMousePosition: typeof vec2;
|
|
55
|
+
_lastSnappedMousePosition: typeof vec2;
|
|
56
|
+
_generatingLink: any;
|
|
57
|
+
_snapToGrid: boolean;
|
|
58
|
+
_snapValue: number;
|
|
59
|
+
_nodeBackgroundOpacity: number;
|
|
60
|
+
_patternSizeF: number;
|
|
61
|
+
_patternSize: typeof vec2;
|
|
62
|
+
_circlePatternSize: number;
|
|
63
|
+
_circlePatternColor: string;
|
|
64
|
+
_background: SVGSVGElement | undefined;
|
|
65
|
+
_undoSteps: any[];
|
|
66
|
+
_redoSteps: any[];
|
|
67
|
+
_clipboardData: any;
|
|
68
|
+
_lastMouseDown: number;
|
|
69
|
+
_boxSelecting: any;
|
|
70
|
+
_boxSelectRemoving: any;
|
|
71
|
+
_currentBoxSelectionSVG: SVGSVGElement | undefined;
|
|
72
|
+
constructor(area: typeof Area, options?: any);
|
|
73
|
+
static getInstances(): GraphEditor[];
|
|
74
|
+
/**
|
|
75
|
+
* Register a node class so it can be listed when the user wants to create a new one
|
|
76
|
+
* @method registerCustomNode
|
|
77
|
+
* @param {String} type: name of the node and path
|
|
78
|
+
* @param {Class} baseClass class containing the structure of the custom node
|
|
79
|
+
*/
|
|
80
|
+
static registerCustomNode(type: string, baseClass: any): void;
|
|
81
|
+
/**
|
|
82
|
+
* Create a node of a given type with a name. The node is not attached to any graph yet.
|
|
83
|
+
* @method createNode
|
|
84
|
+
* @param {String} type full name of the node class. p.e. "math/sin"
|
|
85
|
+
* @param {String} title a name to distinguish from other nodes
|
|
86
|
+
* @param {Object} options Store node options
|
|
87
|
+
*/
|
|
88
|
+
static addNode(type: string, title?: string, options?: any): any;
|
|
89
|
+
/**
|
|
90
|
+
* @method setGraph
|
|
91
|
+
* @param {Graph} graph
|
|
92
|
+
*/
|
|
93
|
+
setGraph(graph: Graph): void;
|
|
94
|
+
/**
|
|
95
|
+
* @method loadGraph
|
|
96
|
+
* @param {String} url
|
|
97
|
+
* @param {Function} callback Function to call once the graph is loaded
|
|
98
|
+
*/
|
|
99
|
+
loadGraph(url: string, callback?: (g: Graph) => void): void;
|
|
100
|
+
/**
|
|
101
|
+
* @method addGraph
|
|
102
|
+
* @param {Object} o Options to configure the graph
|
|
103
|
+
*/
|
|
104
|
+
addGraph(o?: any): Graph;
|
|
105
|
+
/**
|
|
106
|
+
* @method addGraphFunction
|
|
107
|
+
* @param {Object} o Options to configure the graph
|
|
108
|
+
*/
|
|
109
|
+
addGraphFunction(o?: any): GraphFunction;
|
|
110
|
+
/**
|
|
111
|
+
* @method clear
|
|
112
|
+
*/
|
|
113
|
+
clear(): void;
|
|
114
|
+
setVariable(name: string, value: any): void;
|
|
115
|
+
getVariable(name: string): any;
|
|
116
|
+
propagateEventToAllNodes(eventName: string, params?: any): void;
|
|
117
|
+
/**
|
|
118
|
+
* @method addCastType
|
|
119
|
+
* @param {String} type: Type to cast
|
|
120
|
+
* @param {String} targetType: Types to be casted from original type
|
|
121
|
+
* @param {Function} fn: Function to know how to cast
|
|
122
|
+
*/
|
|
123
|
+
addCastType(type: string, targetType: string, fn: any): void;
|
|
124
|
+
/**
|
|
125
|
+
* @method unSelectAll
|
|
126
|
+
*/
|
|
127
|
+
unSelectAll(keepPropDialog?: boolean): void;
|
|
128
|
+
_createNodeDOM(node: any): HTMLDivElement;
|
|
129
|
+
_updateNodeDOMIOs(dom: HTMLElement, node: GraphNode): void;
|
|
130
|
+
_addNodeIOEvents(nodeContainer: HTMLElement): void;
|
|
131
|
+
_getAllDOMNodes(includeGroups?: boolean, exclude?: HTMLElement): ChildNode[];
|
|
132
|
+
_onMoveNodes(target: HTMLElement): void;
|
|
133
|
+
_onDragNode(target: HTMLElement, e: DragEvent): void;
|
|
134
|
+
_onMoveGroup(target: any): void;
|
|
135
|
+
_onDragGroup(target: any): void;
|
|
136
|
+
_selectNode(dom: HTMLElement, multiSelection?: boolean, forceOrder?: boolean): void;
|
|
137
|
+
_unSelectNode(dom: HTMLElement): void;
|
|
138
|
+
_translateNode(dom: any, deltaTranslation: typeof vec2, updateBasePosition?: boolean): void;
|
|
139
|
+
_deleteNode(nodeId: string): void;
|
|
140
|
+
_deleteGroup(groupId: string): void;
|
|
141
|
+
_cloneNode(nodeId: string, graphId?: string, position?: typeof vec2): void;
|
|
142
|
+
_cloneNodes(): void;
|
|
143
|
+
_getNodePosition(dom: HTMLElement): any;
|
|
144
|
+
_getNodeDOMElement(nodeId: string): any;
|
|
145
|
+
_getLinks(nodeSrcId: string, nodeDstId: string): any;
|
|
146
|
+
_deleteLinks(nodeId: string, io: any): void;
|
|
147
|
+
_processFocus(active?: boolean): void;
|
|
148
|
+
_processKeyDown(e: KeyboardEvent): void;
|
|
149
|
+
_processKeyUp(e: KeyboardEvent): void;
|
|
150
|
+
_processMouse(e: any): void;
|
|
151
|
+
_processClick(e: MouseEvent): void;
|
|
152
|
+
_processBackgroundClick(e: MouseEvent): void;
|
|
153
|
+
_processMouseDown(e: MouseEvent): void;
|
|
154
|
+
_processMouseUp(e: MouseEvent): void;
|
|
155
|
+
_processMouseMove(e: MouseEvent): void;
|
|
156
|
+
_processWheel(e: WheelEvent): void;
|
|
157
|
+
_processContextMenu(e: any, autoConnect?: any): void;
|
|
158
|
+
/**
|
|
159
|
+
* @method start
|
|
160
|
+
*/
|
|
161
|
+
start(): void;
|
|
162
|
+
/**
|
|
163
|
+
* @method stop
|
|
164
|
+
*/
|
|
165
|
+
stop(): void;
|
|
166
|
+
/**
|
|
167
|
+
* @method _frame
|
|
168
|
+
*/
|
|
169
|
+
_frame(): void;
|
|
170
|
+
_generatePattern(): void;
|
|
171
|
+
_updatePattern(): void;
|
|
172
|
+
_getPatternPosition(renderPosition: typeof vec2): any;
|
|
173
|
+
_getRenderPosition(patternPosition: typeof vec2): any;
|
|
174
|
+
_onLink(e: any): true | undefined;
|
|
175
|
+
_updatePreviewLink(e: any, endIO?: any): any;
|
|
176
|
+
_createLink(link: any): void;
|
|
177
|
+
_createLinkPath(path: any, startPos: typeof vec2, endPos: typeof vec2, color?: any, exactEnd?: boolean): void;
|
|
178
|
+
_updateNodeLinks(nodeId: string): void;
|
|
179
|
+
_drawBoxSelection(e: MouseEvent): void;
|
|
180
|
+
_getNonVisibleNodes(): GraphNode[];
|
|
181
|
+
_selectNodesInBox(lt: typeof vec2, rb: typeof vec2, remove?: boolean): void;
|
|
182
|
+
_deleteSelection(e?: any): void;
|
|
183
|
+
_getBoundingFromGroup(groupDOM: HTMLElement): BoundingBox;
|
|
184
|
+
_getBoundingFromNodes(nodeIds: string[]): BoundingBox | null;
|
|
185
|
+
/**
|
|
186
|
+
* @method _createGroup
|
|
187
|
+
* @description Creates a node group from the bounding box of the selected nodes
|
|
188
|
+
* @returns JSON data from the serialized graph
|
|
189
|
+
*/
|
|
190
|
+
_createGroup(bb?: BoundingBox): HTMLDivElement | undefined;
|
|
191
|
+
_addUndoStep(deleteRedo?: boolean): void;
|
|
192
|
+
_doUndo(): void;
|
|
193
|
+
_addRedoStep(): void;
|
|
194
|
+
_doRedo(): void;
|
|
195
|
+
_togglePropertiesDialog(force?: boolean): void;
|
|
196
|
+
_setSnappingValue(value: number): void;
|
|
197
|
+
_toggleSnapping(): void;
|
|
198
|
+
_onSidebarCreate(e: Event): void;
|
|
199
|
+
_showRenameGraphDialog(): void;
|
|
200
|
+
_updateGraphName(name: string): void;
|
|
201
|
+
_addGlobalActions(): void;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* @class Graph
|
|
205
|
+
*/
|
|
206
|
+
declare class Graph {
|
|
207
|
+
name: string;
|
|
208
|
+
type: string;
|
|
209
|
+
id: string;
|
|
210
|
+
editor: GraphEditor | undefined;
|
|
211
|
+
nodes: GraphNode[];
|
|
212
|
+
groups: any[];
|
|
213
|
+
variables: any;
|
|
214
|
+
links: any;
|
|
215
|
+
scale: number;
|
|
216
|
+
translation: typeof vec2;
|
|
217
|
+
_executionNodes: string[];
|
|
218
|
+
constructor(name?: string, options?: any);
|
|
219
|
+
configure(o: any): void;
|
|
220
|
+
/**
|
|
221
|
+
* @method getNodeById
|
|
222
|
+
*/
|
|
223
|
+
getNodeById(id: string): GraphNode | undefined;
|
|
224
|
+
/**
|
|
225
|
+
* @method _runStep
|
|
226
|
+
*/
|
|
227
|
+
_runStep(mainId: string): void;
|
|
228
|
+
/**
|
|
229
|
+
* @method serialize
|
|
230
|
+
* @param {Boolean} prettify
|
|
231
|
+
* @returns JSON data from the serialized graph
|
|
232
|
+
*/
|
|
233
|
+
serialize(prettify?: boolean): any;
|
|
234
|
+
/**
|
|
235
|
+
* @method export
|
|
236
|
+
*/
|
|
237
|
+
export(): void;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* @class GraphNode
|
|
241
|
+
*/
|
|
242
|
+
export declare class GraphNode {
|
|
243
|
+
static title: string;
|
|
244
|
+
static blockDelete: boolean;
|
|
245
|
+
static blockAdd: boolean;
|
|
246
|
+
static description: string;
|
|
247
|
+
id: string;
|
|
248
|
+
type: string;
|
|
249
|
+
title: string;
|
|
250
|
+
inputs: any[];
|
|
251
|
+
outputs: any[];
|
|
252
|
+
properties: any[];
|
|
253
|
+
position: typeof vec2;
|
|
254
|
+
size: typeof vec2;
|
|
255
|
+
color: any;
|
|
256
|
+
editor: GraphEditor | undefined;
|
|
257
|
+
graphID: string | undefined;
|
|
258
|
+
constructor();
|
|
259
|
+
_hasOutputsConnected(): boolean;
|
|
260
|
+
onExecute(): void;
|
|
261
|
+
execute(): void;
|
|
262
|
+
addInput(name: string | null, type: string): void;
|
|
263
|
+
addOutput(name: string | null, type: string): void;
|
|
264
|
+
addProperty(name: string | null, type: string, value: any, selectOptions?: any): void;
|
|
265
|
+
getInput(index: number): any;
|
|
266
|
+
setOutput(index: number, data: any): void;
|
|
267
|
+
serialize(): any;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* @class GraphFunction
|
|
271
|
+
*/
|
|
272
|
+
declare class GraphFunction extends Graph {
|
|
273
|
+
constructor(name?: string, options?: any);
|
|
274
|
+
getOutputData(inputValue: any): any;
|
|
275
|
+
}
|
|
276
|
+
export {};
|