@codebolt/litegraph 0.0.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/LICENSE +19 -0
- package/README.md +161 -0
- package/dist/CanvasPointer.d.ts +120 -0
- package/dist/ContextMenu.d.ts +41 -0
- package/dist/CurveEditor.d.ts +18 -0
- package/dist/DragAndScale.d.ts +67 -0
- package/dist/LGraph.d.ts +407 -0
- package/dist/LGraphBadge.d.ts +33 -0
- package/dist/LGraphButton.d.ts +27 -0
- package/dist/LGraphCanvas.d.ts +772 -0
- package/dist/LGraphGroup.d.ts +81 -0
- package/dist/LGraphIcon.d.ts +22 -0
- package/dist/LGraphNode.d.ts +883 -0
- package/dist/LLink.d.ts +194 -0
- package/dist/LiteGraphGlobal.d.ts +360 -0
- package/dist/MapProxyHandler.d.ts +13 -0
- package/dist/Reroute.d.ts +185 -0
- package/dist/canvas/FloatingRenderLink.d.ts +55 -0
- package/dist/canvas/InputIndicators.d.ts +45 -0
- package/dist/canvas/LinkConnector.d.ts +165 -0
- package/dist/canvas/MovingInputLink.d.ts +34 -0
- package/dist/canvas/MovingLinkBase.d.ts +55 -0
- package/dist/canvas/MovingOutputLink.d.ts +30 -0
- package/dist/canvas/RenderLink.d.ts +39 -0
- package/dist/canvas/ToInputFromIoNodeLink.d.ts +37 -0
- package/dist/canvas/ToInputRenderLink.d.ts +35 -0
- package/dist/canvas/ToOutputFromIoNodeLink.d.ts +33 -0
- package/dist/canvas/ToOutputFromRerouteLink.d.ts +15 -0
- package/dist/canvas/ToOutputRenderLink.d.ts +32 -0
- package/dist/canvas/measureSlots.d.ts +22 -0
- package/dist/constants.d.ts +9 -0
- package/dist/css/litegraph.css +638 -0
- package/dist/draw.d.ts +65 -0
- package/dist/infrastructure/ConstrainedSize.d.ts +27 -0
- package/dist/infrastructure/CustomEventTarget.d.ts +72 -0
- package/dist/infrastructure/InvalidLinkError.d.ts +3 -0
- package/dist/infrastructure/LGraphCanvasEventMap.d.ts +41 -0
- package/dist/infrastructure/LGraphEventMap.d.ts +43 -0
- package/dist/infrastructure/LinkConnectorEventMap.d.ts +47 -0
- package/dist/infrastructure/NullGraphError.d.ts +3 -0
- package/dist/infrastructure/Rectangle.d.ts +163 -0
- package/dist/infrastructure/RecursionError.d.ts +6 -0
- package/dist/infrastructure/SlotIndexError.d.ts +3 -0
- package/dist/infrastructure/SubgraphEventMap.d.ts +49 -0
- package/dist/infrastructure/SubgraphInputEventMap.d.ts +13 -0
- package/dist/interfaces.d.ts +388 -0
- package/dist/litegraph.d.ts +95 -0
- package/dist/litegraph.es.js +17613 -0
- package/dist/litegraph.es.js.map +1 -0
- package/dist/litegraph.umd.js +3 -0
- package/dist/litegraph.umd.js.map +1 -0
- package/dist/measure.d.ts +168 -0
- package/dist/node/NodeInputSlot.d.ts +20 -0
- package/dist/node/NodeOutputSlot.d.ts +18 -0
- package/dist/node/NodeSlot.d.ts +35 -0
- package/dist/node/SlotBase.d.ts +27 -0
- package/dist/node/slotUtils.d.ts +17 -0
- package/dist/polyfills.d.ts +1 -0
- package/dist/strings.d.ts +22 -0
- package/dist/subgraph/EmptySubgraphInput.d.ts +15 -0
- package/dist/subgraph/EmptySubgraphOutput.d.ts +15 -0
- package/dist/subgraph/ExecutableNodeDTO.d.ts +96 -0
- package/dist/subgraph/Subgraph.d.ts +65 -0
- package/dist/subgraph/SubgraphIONodeBase.d.ts +80 -0
- package/dist/subgraph/SubgraphInput.d.ts +47 -0
- package/dist/subgraph/SubgraphInputNode.d.ts +33 -0
- package/dist/subgraph/SubgraphNode.d.ts +73 -0
- package/dist/subgraph/SubgraphOutput.d.ts +30 -0
- package/dist/subgraph/SubgraphOutputNode.d.ts +31 -0
- package/dist/subgraph/SubgraphSlotBase.d.ts +61 -0
- package/dist/subgraph/subgraphUtils.d.ts +77 -0
- package/dist/types/NodeLike.d.ts +7 -0
- package/dist/types/events.d.ts +64 -0
- package/dist/types/globalEnums.d.ts +130 -0
- package/dist/types/serialisation.d.ts +198 -0
- package/dist/types/utility.d.ts +11 -0
- package/dist/types/widgets.d.ts +209 -0
- package/dist/utils/arrange.d.ts +22 -0
- package/dist/utils/collections.d.ts +38 -0
- package/dist/utils/feedback.d.ts +7 -0
- package/dist/utils/object.d.ts +1 -0
- package/dist/utils/spaceDistribution.d.ts +11 -0
- package/dist/utils/textUtils.d.ts +9 -0
- package/dist/utils/type.d.ts +14 -0
- package/dist/utils/uuid.d.ts +13 -0
- package/dist/utils/widget.d.ts +7 -0
- package/dist/widgets/BaseSteppedWidget.d.ts +34 -0
- package/dist/widgets/BaseWidget.d.ts +125 -0
- package/dist/widgets/BooleanWidget.d.ts +9 -0
- package/dist/widgets/ButtonWidget.d.ts +16 -0
- package/dist/widgets/ComboWidget.d.ts +17 -0
- package/dist/widgets/KnobWidget.d.ts +20 -0
- package/dist/widgets/LegacyWidget.d.ts +14 -0
- package/dist/widgets/NumberWidget.d.ts +18 -0
- package/dist/widgets/SliderWidget.d.ts +20 -0
- package/dist/widgets/TextWidget.d.ts +13 -0
- package/dist/widgets/widgetMap.d.ts +50 -0
- package/package.json +76 -0
|
@@ -0,0 +1,638 @@
|
|
|
1
|
+
/* this CSS contains only the basic CSS needed to run the app and use it */
|
|
2
|
+
|
|
3
|
+
.lgraphcanvas {
|
|
4
|
+
/*cursor: crosshair;*/
|
|
5
|
+
user-select: none;
|
|
6
|
+
-moz-user-select: none;
|
|
7
|
+
-webkit-user-select: none;
|
|
8
|
+
outline: none;
|
|
9
|
+
font-family: Tahoma, sans-serif;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.lgraphcanvas * {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.litegraph.litecontextmenu {
|
|
17
|
+
font-family: Tahoma, sans-serif;
|
|
18
|
+
position: fixed;
|
|
19
|
+
top: 100px;
|
|
20
|
+
left: 100px;
|
|
21
|
+
min-width: 100px;
|
|
22
|
+
color: #aaf;
|
|
23
|
+
padding: 0;
|
|
24
|
+
box-shadow: 0 0 10px black !important;
|
|
25
|
+
background-color: #2e2e2e !important;
|
|
26
|
+
z-index: 10;
|
|
27
|
+
max-height: -webkit-fill-available;
|
|
28
|
+
overflow-y: auto;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Enable scrolling overflow in Firefox */
|
|
32
|
+
@supports not (max-height: -webkit-fill-available) {
|
|
33
|
+
.litegraph.litecontextmenu {
|
|
34
|
+
max-height: 80vh;
|
|
35
|
+
overflow-y: scroll;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.litegraph.litecontextmenu.dark {
|
|
40
|
+
background-color: #000 !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.litegraph.litecontextmenu .litemenu-title img {
|
|
44
|
+
margin-top: 2px;
|
|
45
|
+
margin-left: 2px;
|
|
46
|
+
margin-right: 4px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.litegraph.litecontextmenu .litemenu-entry {
|
|
50
|
+
margin: 2px;
|
|
51
|
+
padding: 2px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.litegraph.litecontextmenu .litemenu-entry.submenu {
|
|
55
|
+
background-color: #2e2e2e !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.litegraph.litecontextmenu.dark .litemenu-entry.submenu {
|
|
59
|
+
background-color: #000 !important;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.litegraph .litemenubar ul {
|
|
63
|
+
font-family: Tahoma, sans-serif;
|
|
64
|
+
margin: 0;
|
|
65
|
+
padding: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.litegraph .litemenubar li {
|
|
69
|
+
font-size: 14px;
|
|
70
|
+
color: #999;
|
|
71
|
+
display: inline-block;
|
|
72
|
+
min-width: 50px;
|
|
73
|
+
padding-left: 10px;
|
|
74
|
+
padding-right: 10px;
|
|
75
|
+
user-select: none;
|
|
76
|
+
-moz-user-select: none;
|
|
77
|
+
-webkit-user-select: none;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.litegraph .litemenubar li:hover {
|
|
82
|
+
background-color: #777;
|
|
83
|
+
color: #eee;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.litegraph .litegraph .litemenubar-panel {
|
|
87
|
+
position: absolute;
|
|
88
|
+
top: 5px;
|
|
89
|
+
left: 5px;
|
|
90
|
+
min-width: 100px;
|
|
91
|
+
background-color: #444;
|
|
92
|
+
box-shadow: 0 0 3px black;
|
|
93
|
+
padding: 4px;
|
|
94
|
+
border-bottom: 2px solid #aaf;
|
|
95
|
+
z-index: 10;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.litegraph .litemenu-entry,
|
|
99
|
+
.litemenu-title {
|
|
100
|
+
font-size: 12px;
|
|
101
|
+
color: #aaa;
|
|
102
|
+
padding: 0 0 0 4px;
|
|
103
|
+
margin: 2px;
|
|
104
|
+
padding-left: 2px;
|
|
105
|
+
-moz-user-select: none;
|
|
106
|
+
-webkit-user-select: none;
|
|
107
|
+
user-select: none;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.litegraph .litemenu-entry .icon {
|
|
112
|
+
display: inline-block;
|
|
113
|
+
width: 12px;
|
|
114
|
+
height: 12px;
|
|
115
|
+
margin: 2px;
|
|
116
|
+
vertical-align: top;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.litegraph .litemenu-entry.checked .icon {
|
|
120
|
+
background-color: #aaf;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.litegraph .litemenu-entry .more {
|
|
124
|
+
float: right;
|
|
125
|
+
padding-right: 5px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.litegraph .litemenu-entry.disabled {
|
|
129
|
+
opacity: 0.5;
|
|
130
|
+
cursor: default;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.litegraph .litemenu-entry.separator {
|
|
134
|
+
display: block;
|
|
135
|
+
border-top: 1px solid #333;
|
|
136
|
+
border-bottom: 1px solid #666;
|
|
137
|
+
width: 100%;
|
|
138
|
+
height: 0px;
|
|
139
|
+
margin: 3px 0 2px 0;
|
|
140
|
+
background-color: transparent;
|
|
141
|
+
padding: 0 !important;
|
|
142
|
+
cursor: default !important;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.litegraph .litemenu-entry.has_submenu {
|
|
146
|
+
border-right: 2px solid cyan;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.litegraph .litemenu-title {
|
|
150
|
+
color: #dde;
|
|
151
|
+
background-color: #111;
|
|
152
|
+
margin: 0;
|
|
153
|
+
padding: 2px;
|
|
154
|
+
cursor: default;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.litegraph .litemenu-entry:hover:not(.disabled):not(.separator) {
|
|
158
|
+
background-color: #444 !important;
|
|
159
|
+
color: #eee;
|
|
160
|
+
transition: all 0.2s;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.litegraph .litemenu-entry .property_name {
|
|
164
|
+
display: inline-block;
|
|
165
|
+
text-align: left;
|
|
166
|
+
min-width: 80px;
|
|
167
|
+
min-height: 1.2em;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.litegraph .litemenu-entry .property_value {
|
|
171
|
+
display: inline-block;
|
|
172
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
173
|
+
text-align: right;
|
|
174
|
+
min-width: 80px;
|
|
175
|
+
min-height: 1.2em;
|
|
176
|
+
vertical-align: middle;
|
|
177
|
+
padding-right: 10px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.litegraph.litesearchbox {
|
|
181
|
+
font-family: Tahoma, sans-serif;
|
|
182
|
+
position: absolute;
|
|
183
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
184
|
+
padding-top: 4px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.litegraph.litesearchbox input,
|
|
188
|
+
.litegraph.litesearchbox select {
|
|
189
|
+
margin-top: 3px;
|
|
190
|
+
min-width: 60px;
|
|
191
|
+
min-height: 1.5em;
|
|
192
|
+
background-color: black;
|
|
193
|
+
border: 0;
|
|
194
|
+
color: white;
|
|
195
|
+
padding-left: 10px;
|
|
196
|
+
margin-right: 5px;
|
|
197
|
+
max-width: 300px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.litegraph.litesearchbox .name {
|
|
201
|
+
display: inline-block;
|
|
202
|
+
min-width: 60px;
|
|
203
|
+
min-height: 1.5em;
|
|
204
|
+
padding-left: 10px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.litegraph.litesearchbox .helper {
|
|
208
|
+
overflow: auto;
|
|
209
|
+
max-height: 200px;
|
|
210
|
+
margin-top: 2px;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.litegraph.lite-search-item {
|
|
214
|
+
font-family: Tahoma, sans-serif;
|
|
215
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
216
|
+
color: white;
|
|
217
|
+
padding-top: 2px;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.litegraph.lite-search-item.not_in_filter {
|
|
221
|
+
/*background-color: rgba(50, 50, 50, 0.5);*/
|
|
222
|
+
/*color: #999;*/
|
|
223
|
+
color: #b99;
|
|
224
|
+
font-style: italic;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.litegraph.lite-search-item.generic_type {
|
|
228
|
+
/*background-color: rgba(50, 50, 50, 0.5);*/
|
|
229
|
+
/*color: #DD9;*/
|
|
230
|
+
color: #999;
|
|
231
|
+
font-style: italic;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.litegraph.lite-search-item:hover,
|
|
235
|
+
.litegraph.lite-search-item.selected {
|
|
236
|
+
cursor: pointer;
|
|
237
|
+
background-color: white;
|
|
238
|
+
color: black;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.litegraph.lite-search-item-type {
|
|
242
|
+
display: inline-block;
|
|
243
|
+
background: rgba(0, 0, 0, 0.2);
|
|
244
|
+
margin-left: 5px;
|
|
245
|
+
font-size: 14px;
|
|
246
|
+
padding: 2px 5px;
|
|
247
|
+
position: relative;
|
|
248
|
+
top: -2px;
|
|
249
|
+
opacity: 0.8;
|
|
250
|
+
border-radius: 4px;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* DIALOGs ******/
|
|
254
|
+
|
|
255
|
+
.litegraph .dialog {
|
|
256
|
+
position: absolute;
|
|
257
|
+
top: 50%;
|
|
258
|
+
left: 50%;
|
|
259
|
+
margin-top: -150px;
|
|
260
|
+
margin-left: -200px;
|
|
261
|
+
|
|
262
|
+
background-color: #2a2a2a;
|
|
263
|
+
|
|
264
|
+
min-width: 400px;
|
|
265
|
+
min-height: 200px;
|
|
266
|
+
box-shadow: 0 0 4px #111;
|
|
267
|
+
border-radius: 6px;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.litegraph .dialog.settings {
|
|
271
|
+
left: 10px;
|
|
272
|
+
top: 10px;
|
|
273
|
+
height: calc(100% - 20px);
|
|
274
|
+
margin: auto;
|
|
275
|
+
max-width: 50%;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.litegraph .dialog.centered {
|
|
279
|
+
top: 50px;
|
|
280
|
+
left: 50%;
|
|
281
|
+
position: absolute;
|
|
282
|
+
transform: translateX(-50%);
|
|
283
|
+
min-width: 600px;
|
|
284
|
+
min-height: 300px;
|
|
285
|
+
height: calc(100% - 100px);
|
|
286
|
+
margin: auto;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.litegraph .dialog .close {
|
|
290
|
+
float: right;
|
|
291
|
+
margin: 4px;
|
|
292
|
+
margin-right: 10px;
|
|
293
|
+
cursor: pointer;
|
|
294
|
+
font-size: 1.4em;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.litegraph .dialog .close:hover {
|
|
298
|
+
color: white;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.litegraph .dialog .dialog-header {
|
|
302
|
+
color: #aaa;
|
|
303
|
+
border-bottom: 1px solid #161616;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.litegraph .dialog .dialog-header {
|
|
307
|
+
height: 40px;
|
|
308
|
+
}
|
|
309
|
+
.litegraph .dialog .dialog-footer {
|
|
310
|
+
height: 50px;
|
|
311
|
+
padding: 10px;
|
|
312
|
+
margin: 0;
|
|
313
|
+
border-top: 1px solid #1a1a1a;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.litegraph .dialog .dialog-header .dialog-title {
|
|
317
|
+
font: 20px "Arial";
|
|
318
|
+
margin: 4px;
|
|
319
|
+
padding: 4px 10px;
|
|
320
|
+
display: inline-block;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.litegraph .dialog .dialog-content,
|
|
324
|
+
.litegraph .dialog .dialog-alt-content {
|
|
325
|
+
height: calc(100% - 90px);
|
|
326
|
+
width: 100%;
|
|
327
|
+
min-height: 100px;
|
|
328
|
+
display: inline-block;
|
|
329
|
+
color: #aaa;
|
|
330
|
+
/*background-color: black;*/
|
|
331
|
+
overflow: auto;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.litegraph .dialog .dialog-content h3 {
|
|
335
|
+
margin: 10px;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.litegraph .dialog .dialog-content .connections {
|
|
339
|
+
flex-direction: row;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.litegraph .dialog .dialog-content .connections .connections_side {
|
|
343
|
+
width: calc(50% - 5px);
|
|
344
|
+
min-height: 100px;
|
|
345
|
+
background-color: black;
|
|
346
|
+
display: flex;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.litegraph .dialog .node_type {
|
|
350
|
+
font-size: 1.2em;
|
|
351
|
+
display: block;
|
|
352
|
+
margin: 10px;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.litegraph .dialog .node_desc {
|
|
356
|
+
opacity: 0.5;
|
|
357
|
+
display: block;
|
|
358
|
+
margin: 10px;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.litegraph .dialog .separator {
|
|
362
|
+
display: block;
|
|
363
|
+
width: calc(100% - 4px);
|
|
364
|
+
height: 1px;
|
|
365
|
+
border-top: 1px solid #000;
|
|
366
|
+
border-bottom: 1px solid #333;
|
|
367
|
+
margin: 10px 2px;
|
|
368
|
+
padding: 0;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.litegraph .dialog .property {
|
|
372
|
+
margin-bottom: 2px;
|
|
373
|
+
padding: 4px;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.litegraph .dialog .property:hover {
|
|
377
|
+
background: #545454;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.litegraph .dialog .property_name {
|
|
381
|
+
color: #737373;
|
|
382
|
+
display: inline-block;
|
|
383
|
+
text-align: left;
|
|
384
|
+
vertical-align: top;
|
|
385
|
+
width: 160px;
|
|
386
|
+
padding-left: 4px;
|
|
387
|
+
overflow: hidden;
|
|
388
|
+
margin-right: 6px;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.litegraph .dialog .property:hover .property_name {
|
|
392
|
+
color: white;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.litegraph .dialog .property_value {
|
|
396
|
+
display: inline-block;
|
|
397
|
+
text-align: right;
|
|
398
|
+
color: #aaa;
|
|
399
|
+
background-color: #1a1a1a;
|
|
400
|
+
/*width: calc( 100% - 122px );*/
|
|
401
|
+
max-width: calc(100% - 162px);
|
|
402
|
+
min-width: 200px;
|
|
403
|
+
max-height: 300px;
|
|
404
|
+
min-height: 20px;
|
|
405
|
+
padding: 4px;
|
|
406
|
+
padding-right: 12px;
|
|
407
|
+
overflow: hidden;
|
|
408
|
+
cursor: pointer;
|
|
409
|
+
border-radius: 3px;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.litegraph .dialog .property_value:hover {
|
|
413
|
+
color: white;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.litegraph .dialog .property.boolean .property_value {
|
|
417
|
+
padding-right: 30px;
|
|
418
|
+
color: #a88;
|
|
419
|
+
/*width: auto;
|
|
420
|
+
float: right;*/
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.litegraph .dialog .property.boolean.bool-on .property_name {
|
|
424
|
+
color: #8a8;
|
|
425
|
+
}
|
|
426
|
+
.litegraph .dialog .property.boolean.bool-on .property_value {
|
|
427
|
+
color: #8a8;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.litegraph .dialog .btn {
|
|
431
|
+
border: 0;
|
|
432
|
+
border-radius: 4px;
|
|
433
|
+
padding: 4px 20px;
|
|
434
|
+
margin-left: 0px;
|
|
435
|
+
background-color: #060606;
|
|
436
|
+
color: #8e8e8e;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.litegraph .dialog .btn:hover {
|
|
440
|
+
background-color: #111;
|
|
441
|
+
color: #fff;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.litegraph .dialog .btn.delete:hover {
|
|
445
|
+
background-color: #f33;
|
|
446
|
+
color: black;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.litegraph .bullet_icon {
|
|
450
|
+
margin-left: 10px;
|
|
451
|
+
border-radius: 10px;
|
|
452
|
+
width: 12px;
|
|
453
|
+
height: 12px;
|
|
454
|
+
background-color: #666;
|
|
455
|
+
display: inline-block;
|
|
456
|
+
margin-top: 2px;
|
|
457
|
+
margin-right: 4px;
|
|
458
|
+
transition: background-color 0.1s ease 0s;
|
|
459
|
+
-moz-transition: background-color 0.1s ease 0s;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.litegraph .bullet_icon:hover {
|
|
463
|
+
background-color: #698;
|
|
464
|
+
cursor: pointer;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/* OLD */
|
|
468
|
+
|
|
469
|
+
.graphcontextmenu {
|
|
470
|
+
padding: 4px;
|
|
471
|
+
min-width: 100px;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.graphcontextmenu-title {
|
|
475
|
+
color: #dde;
|
|
476
|
+
background-color: #222;
|
|
477
|
+
margin: 0;
|
|
478
|
+
padding: 2px;
|
|
479
|
+
cursor: default;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.graphmenu-entry {
|
|
483
|
+
box-sizing: border-box;
|
|
484
|
+
margin: 2px;
|
|
485
|
+
padding-left: 20px;
|
|
486
|
+
user-select: none;
|
|
487
|
+
-moz-user-select: none;
|
|
488
|
+
-webkit-user-select: none;
|
|
489
|
+
transition: all linear 0.3s;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.graphmenu-entry.event,
|
|
493
|
+
.litemenu-entry.event {
|
|
494
|
+
border-left: 8px solid orange;
|
|
495
|
+
padding-left: 12px;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.graphmenu-entry.disabled {
|
|
499
|
+
opacity: 0.3;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.graphmenu-entry.submenu {
|
|
503
|
+
border-right: 2px solid #eee;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.graphmenu-entry:hover {
|
|
507
|
+
background-color: #555;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.graphmenu-entry.separator {
|
|
511
|
+
background-color: #111;
|
|
512
|
+
border-bottom: 1px solid #666;
|
|
513
|
+
height: 1px;
|
|
514
|
+
width: calc(100% - 20px);
|
|
515
|
+
-moz-width: calc(100% - 20px);
|
|
516
|
+
-webkit-width: calc(100% - 20px);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.graphmenu-entry .property_name {
|
|
520
|
+
display: inline-block;
|
|
521
|
+
text-align: left;
|
|
522
|
+
min-width: 80px;
|
|
523
|
+
min-height: 1.2em;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.graphmenu-entry .property_value,
|
|
527
|
+
.litemenu-entry .property_value {
|
|
528
|
+
display: inline-block;
|
|
529
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
530
|
+
text-align: right;
|
|
531
|
+
min-width: 80px;
|
|
532
|
+
min-height: 1.2em;
|
|
533
|
+
vertical-align: middle;
|
|
534
|
+
padding-right: 10px;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.graphdialog {
|
|
538
|
+
position: absolute;
|
|
539
|
+
top: 10px;
|
|
540
|
+
left: 10px;
|
|
541
|
+
min-height: 2em;
|
|
542
|
+
background-color: #333;
|
|
543
|
+
font-size: 1.2em;
|
|
544
|
+
box-shadow: 0 0 10px black !important;
|
|
545
|
+
z-index: 10;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.graphdialog.rounded {
|
|
549
|
+
border-radius: 12px;
|
|
550
|
+
padding-right: 2px;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.graphdialog .name {
|
|
554
|
+
display: inline-block;
|
|
555
|
+
min-width: 60px;
|
|
556
|
+
min-height: 1.5em;
|
|
557
|
+
padding-left: 10px;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.graphdialog input,
|
|
561
|
+
.graphdialog textarea,
|
|
562
|
+
.graphdialog select {
|
|
563
|
+
margin: 3px;
|
|
564
|
+
min-width: 60px;
|
|
565
|
+
min-height: 1.5em;
|
|
566
|
+
background-color: black;
|
|
567
|
+
border: 0;
|
|
568
|
+
color: white;
|
|
569
|
+
padding-left: 10px;
|
|
570
|
+
outline: none;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.graphdialog textarea {
|
|
574
|
+
min-height: 150px;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.graphdialog button {
|
|
578
|
+
margin-top: 3px;
|
|
579
|
+
vertical-align: top;
|
|
580
|
+
background-color: #999;
|
|
581
|
+
border: 0;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.graphdialog button.rounded,
|
|
585
|
+
.graphdialog input.rounded {
|
|
586
|
+
border-radius: 0 12px 12px 0;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.graphdialog .helper {
|
|
590
|
+
overflow: auto;
|
|
591
|
+
max-height: 200px;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.graphdialog .help-item {
|
|
595
|
+
padding-left: 10px;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.graphdialog .help-item:hover,
|
|
599
|
+
.graphdialog .help-item.selected {
|
|
600
|
+
cursor: pointer;
|
|
601
|
+
background-color: white;
|
|
602
|
+
color: black;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.litegraph .dialog {
|
|
606
|
+
min-height: 0;
|
|
607
|
+
}
|
|
608
|
+
.litegraph .dialog .dialog-content {
|
|
609
|
+
display: block;
|
|
610
|
+
}
|
|
611
|
+
.litegraph .graphdialog {
|
|
612
|
+
display: flex;
|
|
613
|
+
align-items: center;
|
|
614
|
+
border-radius: 20px;
|
|
615
|
+
padding: 4px 10px;
|
|
616
|
+
position: fixed;
|
|
617
|
+
}
|
|
618
|
+
.litegraph .graphdialog .name {
|
|
619
|
+
padding: 0;
|
|
620
|
+
min-height: 0;
|
|
621
|
+
font-size: 16px;
|
|
622
|
+
vertical-align: middle;
|
|
623
|
+
}
|
|
624
|
+
.litegraph .graphdialog .value {
|
|
625
|
+
font-size: 16px;
|
|
626
|
+
min-height: 0;
|
|
627
|
+
margin: 0 10px;
|
|
628
|
+
padding: 2px 5px;
|
|
629
|
+
}
|
|
630
|
+
.litegraph .graphdialog input[type="checkbox"] {
|
|
631
|
+
width: 16px;
|
|
632
|
+
height: 16px;
|
|
633
|
+
}
|
|
634
|
+
.litegraph .graphdialog button {
|
|
635
|
+
padding: 4px 18px;
|
|
636
|
+
border-radius: 20px;
|
|
637
|
+
cursor: pointer;
|
|
638
|
+
}
|
package/dist/draw.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Rectangle } from './infrastructure/Rectangle';
|
|
2
|
+
import { CanvasColour, Rect } from './interfaces';
|
|
3
|
+
import { RenderShape, TitleMode } from './types/globalEnums';
|
|
4
|
+
export declare enum SlotType {
|
|
5
|
+
Array = "array",
|
|
6
|
+
Event = -1
|
|
7
|
+
}
|
|
8
|
+
/** @see RenderShape */
|
|
9
|
+
export declare enum SlotShape {
|
|
10
|
+
Box = 1,
|
|
11
|
+
Arrow = 5,
|
|
12
|
+
Grid = 6,
|
|
13
|
+
Circle = 3,
|
|
14
|
+
HollowCircle = 7
|
|
15
|
+
}
|
|
16
|
+
/** @see LinkDirection */
|
|
17
|
+
export declare enum SlotDirection {
|
|
18
|
+
Up = 1,
|
|
19
|
+
Right = 4,
|
|
20
|
+
Down = 2,
|
|
21
|
+
Left = 3
|
|
22
|
+
}
|
|
23
|
+
export declare enum LabelPosition {
|
|
24
|
+
Left = "left",
|
|
25
|
+
Right = "right"
|
|
26
|
+
}
|
|
27
|
+
export interface IDrawBoundingOptions {
|
|
28
|
+
/** The shape to render */
|
|
29
|
+
shape?: RenderShape;
|
|
30
|
+
/** The radius of the rounded corners for {@link RenderShape.ROUND} and {@link RenderShape.CARD} */
|
|
31
|
+
round_radius?: number;
|
|
32
|
+
/** Shape will extend above the Y-axis 0 by this amount @deprecated This is node-specific: it should be removed entirely, and behaviour defined by the caller more explicitly */
|
|
33
|
+
title_height?: number;
|
|
34
|
+
/** @deprecated This is node-specific: it should be removed entirely, and behaviour defined by the caller more explicitly */
|
|
35
|
+
title_mode?: TitleMode;
|
|
36
|
+
/** The color that should be drawn */
|
|
37
|
+
color?: CanvasColour;
|
|
38
|
+
/** The distance between the edge of the {@link area} and the middle of the line */
|
|
39
|
+
padding?: number;
|
|
40
|
+
/** @deprecated This is node-specific: it should be removed entirely, and behaviour defined by the caller more explicitly */
|
|
41
|
+
collapsed?: boolean;
|
|
42
|
+
/** Thickness of the line drawn (`lineWidth`) */
|
|
43
|
+
lineWidth?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface IDrawTextInAreaOptions {
|
|
46
|
+
/** The canvas to draw the text on. */
|
|
47
|
+
ctx: CanvasRenderingContext2D;
|
|
48
|
+
/** The text to draw. */
|
|
49
|
+
text: string;
|
|
50
|
+
/** The area the text will be drawn in. */
|
|
51
|
+
area: Rectangle;
|
|
52
|
+
/** The alignment of the text. */
|
|
53
|
+
align?: "left" | "right" | "center";
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Draws only the path of a shape on the canvas, without filling.
|
|
57
|
+
* Used to draw indicators for node status, e.g. "selected".
|
|
58
|
+
* @param ctx The 2D context to draw on
|
|
59
|
+
* @param area The position and size of the shape to render
|
|
60
|
+
*/
|
|
61
|
+
export declare function strokeShape(ctx: CanvasRenderingContext2D, area: Rect, { shape, round_radius, title_height, title_mode, color, padding, collapsed, lineWidth: thickness, }?: IDrawBoundingOptions): void;
|
|
62
|
+
/**
|
|
63
|
+
* Draws text within an area, truncating it and adding an ellipsis if necessary.
|
|
64
|
+
*/
|
|
65
|
+
export declare function drawTextInArea({ ctx, text, area, align }: IDrawTextInAreaOptions): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReadOnlyRect, ReadOnlySize, Size } from '../interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* Basic width and height, with min/max constraints.
|
|
4
|
+
*
|
|
5
|
+
* - The {@link width} and {@link height} properties are readonly
|
|
6
|
+
* - Size is set via {@link desiredWidth} and {@link desiredHeight} properties
|
|
7
|
+
* - Width and height are then updated, clamped to min/max values
|
|
8
|
+
*/
|
|
9
|
+
export declare class ConstrainedSize {
|
|
10
|
+
#private;
|
|
11
|
+
minWidth: number;
|
|
12
|
+
minHeight: number;
|
|
13
|
+
maxWidth: number;
|
|
14
|
+
maxHeight: number;
|
|
15
|
+
get width(): number;
|
|
16
|
+
get height(): number;
|
|
17
|
+
get desiredWidth(): number;
|
|
18
|
+
set desiredWidth(value: number);
|
|
19
|
+
get desiredHeight(): number;
|
|
20
|
+
set desiredHeight(value: number);
|
|
21
|
+
constructor(width: number, height: number);
|
|
22
|
+
static fromSize(size: ReadOnlySize): ConstrainedSize;
|
|
23
|
+
static fromRect(rect: ReadOnlyRect): ConstrainedSize;
|
|
24
|
+
setSize(size: ReadOnlySize): void;
|
|
25
|
+
setValues(width: number, height: number): void;
|
|
26
|
+
toSize(): Size;
|
|
27
|
+
}
|