@babsey/code-graph 0.4.1 → 0.4.2
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/dist/code-graph.js +734 -694
- package/dist/code-graph.umd.cjs +6 -6
- package/package.json +1 -1
package/dist/code-graph.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import ce from "mustache";
|
|
2
|
-
import { reactive as te, defineComponent as F, createElementBlock as b, openBlock as p, toDisplayString as
|
|
2
|
+
import { reactive as te, defineComponent as F, createElementBlock as b, openBlock as p, toDisplayString as P, markRaw as Y, computed as A, createElementVNode as m, withDirectives as ke, vModelText as xe, createStaticVNode as fe, toRef as $e, ref as B, createVNode as G, unref as O, mergeModels as He, useModel as Nt, resolveComponent as qe, createCommentVNode as L, onMounted as Se, onBeforeUnmount as Je, watch as Qe, createBlock as H, withCtx as ee, normalizeProps as Et, guardReactiveProps as Tt, renderSlot as q, mergeProps as Ot, onUpdated as Ze, normalizeStyle as Ae, normalizeClass as oe, withModifiers as ue, Fragment as U, createTextVNode as et, withKeys as Oe, renderList as ae, nextTick as Mt, resolveDynamicComponent as Be, inject as $t, Transition as St, shallowReadonly as At } from "vue";
|
|
3
3
|
import { v4 as re } from "uuid";
|
|
4
|
-
import { AbstractNode as
|
|
5
|
-
import { NodeInterfaceType as
|
|
6
|
-
import { allowMultipleConnections as de, BaseEngine as
|
|
7
|
-
import { displayInSidebar as
|
|
8
|
-
import
|
|
9
|
-
import { SequentialHook as
|
|
10
|
-
import { usePointer as
|
|
4
|
+
import { AbstractNode as Gt, NodeInterface as J, Graph as Rt, getGraphNodeTypeString as tt, GraphTemplate as jt, GRAPH_NODE_TYPE_PREFIX as Lt, GRAPH_INPUT_NODE_TYPE as Pt, GRAPH_OUTPUT_NODE_TYPE as Vt, Editor as Ht } from "@baklavajs/core";
|
|
5
|
+
import { NodeInterfaceType as ie, BaklavaInterfaceTypes as Bt, setType as V } from "@baklavajs/interface-types";
|
|
6
|
+
import { allowMultipleConnections as de, BaseEngine as zt, sortTopologically as Ut, applyResult as nt } from "@baklavajs/engine";
|
|
7
|
+
import { displayInSidebar as ot, CheckboxInterfaceComponent as Dt, useGraph as Ge, IntegerInterfaceComponent as Ft, TextInputInterfaceComponent as st, NumberInterfaceComponent as Yt, SelectInterfaceComponent as Wt, SliderInterfaceComponent as Kt, TextareaInputInterfaceComponent as Xt, Commands as ne, DEFAULT_TOOLBAR_COMMANDS as qt, BaklavaEditor as Jt, Components as Me, useViewModel as me, useTemporaryConnection as Qt, useTransform as Zt, useNodeCategories as en, TextInputInterface as at, DEFAULT_SETTINGS as tn, useCommandHandler as nn, useHistory as on, useClipboard as sn, registerDeleteNodesCommand as an, registerSaveSubgraphCommand as rn, registerSwitchToMainGraphCommand as ln, registerSidebarCommands as un, registerZoomToFitCommands as dn, setViewNodeProperties as cn } from "@baklavajs/renderer-vue";
|
|
8
|
+
import pn from "toposort";
|
|
9
|
+
import { SequentialHook as ze } from "@baklavajs/events";
|
|
10
|
+
import { usePointer as hn } from "@vueuse/core";
|
|
11
11
|
ce.escape = (n) => n;
|
|
12
|
-
class
|
|
12
|
+
class rt extends Gt {
|
|
13
13
|
codeTemplate;
|
|
14
14
|
isCodeNode = !0;
|
|
15
15
|
mask = null;
|
|
@@ -26,9 +26,9 @@ class lt extends St {
|
|
|
26
26
|
modules: [],
|
|
27
27
|
props: null,
|
|
28
28
|
script: "",
|
|
29
|
-
variableName: "
|
|
29
|
+
variableName: ""
|
|
30
30
|
}), this.codeTemplate = function() {
|
|
31
|
-
return `${this.name}(${
|
|
31
|
+
return `${this.name}(${fn(this.codeNodeInputs).join(", ")})`;
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
get code() {
|
|
@@ -122,14 +122,14 @@ class lt extends St {
|
|
|
122
122
|
let s = [];
|
|
123
123
|
if (t !== "outputs" && this.inputs[e]) {
|
|
124
124
|
const o = this.graph.connections.filter(
|
|
125
|
-
(
|
|
126
|
-
).map((
|
|
125
|
+
(a) => a.to.id === this.inputs[e]?.id || a.from.id === this.inputs[e]?.id
|
|
126
|
+
).map((a) => a.from.nodeId);
|
|
127
127
|
o && (s = s.concat(o));
|
|
128
128
|
}
|
|
129
129
|
if (t !== "inputs" && this.outputs[e]) {
|
|
130
130
|
const o = this.graph.connections.filter(
|
|
131
|
-
(
|
|
132
|
-
).map((
|
|
131
|
+
(a) => a.from.id === this.outputs[e]?.id || a.from.id === this.outputs[e]?.id
|
|
132
|
+
).map((a) => a.to.nodeId);
|
|
133
133
|
o && (s = s.concat(o));
|
|
134
134
|
}
|
|
135
135
|
return !s || s.length == 0 ? [] : s.map((o) => this.graph.findNodeById(o));
|
|
@@ -182,8 +182,18 @@ class lt extends St {
|
|
|
182
182
|
updateProps(e) {
|
|
183
183
|
this.state.props = e;
|
|
184
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* Update input values
|
|
187
|
+
* @param props values for inputs
|
|
188
|
+
*/
|
|
189
|
+
updateInputValues(e) {
|
|
190
|
+
const t = Object.keys(this.inputs);
|
|
191
|
+
Object.keys(e).forEach((s) => {
|
|
192
|
+
!t.includes(s) || !this.inputs[s] || (this.inputs[s].value = e[s], this.inputs[s].setHidden(!1));
|
|
193
|
+
});
|
|
194
|
+
}
|
|
185
195
|
}
|
|
186
|
-
class Re extends
|
|
196
|
+
class Re extends rt {
|
|
187
197
|
/**
|
|
188
198
|
* The default implementation does nothing.
|
|
189
199
|
* Overwrite this method to do calculation.
|
|
@@ -196,41 +206,67 @@ class Re extends lt {
|
|
|
196
206
|
return this.lockCode || (s._code = this.renderCode({ inputs: e, ...t })), this.updateOutputValues(s), s;
|
|
197
207
|
};
|
|
198
208
|
load(e) {
|
|
199
|
-
super.load(e),
|
|
209
|
+
super.load(e), it(this.graph, e);
|
|
200
210
|
}
|
|
201
211
|
save() {
|
|
202
212
|
const e = super.save();
|
|
203
|
-
return
|
|
213
|
+
return mn(this.graph, e), e;
|
|
204
214
|
}
|
|
205
215
|
}
|
|
206
|
-
const
|
|
216
|
+
const fn = (n, e = !0) => {
|
|
207
217
|
const t = [], s = Object.keys(n);
|
|
208
218
|
return s.forEach((o) => {
|
|
209
219
|
if (n[o]?.hidden) return;
|
|
210
220
|
const i = e && t.length < s.indexOf(o) ? `${o}=` : "";
|
|
211
221
|
t.push(`${i}{{ inputs.${o} }}`);
|
|
212
222
|
}), t;
|
|
213
|
-
},
|
|
223
|
+
}, it = (n, e) => {
|
|
214
224
|
if (!n) return;
|
|
215
225
|
const t = n.findNodeById(e.id);
|
|
216
226
|
if (!t || t.subgraph) return;
|
|
217
227
|
const s = t;
|
|
218
|
-
s.state && (s.state.integrated = e.integrated, s.state.modules = e.modules, s.state.props = e.props), Object.entries(e.inputs).forEach(([o,
|
|
219
|
-
o !== "_code" && s.inputs[o] && (s.inputs[o].hidden =
|
|
220
|
-
}), Object.entries(e.outputs).forEach(([o,
|
|
221
|
-
o !== "_code" && s.outputs[o] && (s.outputs[o].hidden =
|
|
228
|
+
s.state && (s.state.integrated = e.integrated, s.state.modules = e.modules, s.state.props = e.props), Object.entries(e.inputs).forEach(([o, a]) => {
|
|
229
|
+
o !== "_code" && s.inputs[o] && (s.inputs[o].hidden = a.hidden);
|
|
230
|
+
}), Object.entries(e.outputs).forEach(([o, a]) => {
|
|
231
|
+
o !== "_code" && s.outputs[o] && (s.outputs[o].hidden = a.hidden);
|
|
222
232
|
});
|
|
223
|
-
},
|
|
233
|
+
}, mn = (n, e) => {
|
|
224
234
|
if (!n) return;
|
|
225
235
|
const t = n.findNodeById(e.id);
|
|
226
236
|
if (!t || t.subgraph) return;
|
|
227
237
|
const s = t;
|
|
228
|
-
s.state && (e.integrated = s.state.integrated, e.modules = s.state.modules), Object.entries(e.inputs).forEach(([o,
|
|
229
|
-
o !== "_code" && s.inputs[o]
|
|
230
|
-
|
|
231
|
-
|
|
238
|
+
s.state && (e.integrated = s.state.integrated, e.modules = s.state.modules), Object.entries(e.inputs).forEach(([o, a]) => {
|
|
239
|
+
if (o !== "_code" && s.inputs[o]) {
|
|
240
|
+
const i = s.inputs[o];
|
|
241
|
+
a.hidden = i.hidden, i.component?.__name && (a.component = i.component.__name);
|
|
242
|
+
}
|
|
243
|
+
}), Object.entries(e.outputs).forEach(([o, a]) => {
|
|
244
|
+
o !== "_code" && s.outputs[o] && (a.hidden = s.outputs[o].hidden);
|
|
232
245
|
});
|
|
233
|
-
},
|
|
246
|
+
}, vn = (n, e) => {
|
|
247
|
+
switch (n) {
|
|
248
|
+
case "CheckBoxInterface":
|
|
249
|
+
return new yn(e.id, e.value);
|
|
250
|
+
case "IntegerInterface":
|
|
251
|
+
return new ht(
|
|
252
|
+
e.id,
|
|
253
|
+
e.value,
|
|
254
|
+
e.min,
|
|
255
|
+
e.max
|
|
256
|
+
);
|
|
257
|
+
case "NumberInterface":
|
|
258
|
+
return new Cn(
|
|
259
|
+
e.id,
|
|
260
|
+
e.value,
|
|
261
|
+
e.min,
|
|
262
|
+
e.max
|
|
263
|
+
);
|
|
264
|
+
case "SelectInterface":
|
|
265
|
+
return new wn(e.id, e.value, e.items);
|
|
266
|
+
default:
|
|
267
|
+
return new ft(e.id, e.value);
|
|
268
|
+
}
|
|
269
|
+
}, gn = ["title"], je = /* @__PURE__ */ F({
|
|
234
270
|
__name: "CodeNodeInterface",
|
|
235
271
|
props: {
|
|
236
272
|
intf: {}
|
|
@@ -238,7 +274,7 @@ const hn = (n, e = !0) => {
|
|
|
238
274
|
setup(n) {
|
|
239
275
|
return (e, t) => (p(), b("div", {
|
|
240
276
|
title: n.intf.value
|
|
241
|
-
},
|
|
277
|
+
}, P(n.intf.name), 9, gn));
|
|
242
278
|
}
|
|
243
279
|
});
|
|
244
280
|
class D extends J {
|
|
@@ -247,7 +283,7 @@ class D extends J {
|
|
|
247
283
|
state;
|
|
248
284
|
type = null;
|
|
249
285
|
constructor(e, t) {
|
|
250
|
-
super(e, t), this.setComponent(
|
|
286
|
+
super(e, t), this.setComponent(Y(je)), this.state = te({
|
|
251
287
|
optional: !1
|
|
252
288
|
});
|
|
253
289
|
}
|
|
@@ -264,7 +300,7 @@ class D extends J {
|
|
|
264
300
|
}
|
|
265
301
|
class ve extends D {
|
|
266
302
|
constructor(e = "", t) {
|
|
267
|
-
super(e, t), this.setComponent(
|
|
303
|
+
super(e, t), this.setComponent(Y(je)), this.use(ot, !0);
|
|
268
304
|
}
|
|
269
305
|
get value() {
|
|
270
306
|
return super.value;
|
|
@@ -273,20 +309,20 @@ class ve extends D {
|
|
|
273
309
|
super.value = e, this.name !== "_code" && this.setHidden(!1);
|
|
274
310
|
}
|
|
275
311
|
}
|
|
276
|
-
const
|
|
277
|
-
new
|
|
312
|
+
const lt = new ie("boolean"), bn = new ie("dict"), ut = new ie("list"), K = new ie("node"), dt = new ie("number"), ct = new ie("string"), pt = new ie("tuple"), la = (n) => {
|
|
313
|
+
new Bt(n.editor, { viewPlugin: n }).addTypes(lt, bn, ut, K, dt, ct, pt);
|
|
278
314
|
};
|
|
279
|
-
class
|
|
315
|
+
class yn extends ve {
|
|
280
316
|
constructor(e, t) {
|
|
281
|
-
super(e, t), this.setComponent(
|
|
317
|
+
super(e, t), this.setComponent(Y(Dt)), this.use(V, lt);
|
|
282
318
|
}
|
|
283
319
|
getValue = () => this.value ? "True" : "False";
|
|
284
320
|
}
|
|
285
|
-
class
|
|
321
|
+
class _n extends D {
|
|
286
322
|
isCodeNodeOutput = !0;
|
|
287
323
|
suffix = "";
|
|
288
324
|
constructor(e = "", t = "") {
|
|
289
|
-
super(e, ""), this.suffix = t, this.setComponent(
|
|
325
|
+
super(e, ""), this.suffix = t, this.setComponent(Y(je));
|
|
290
326
|
}
|
|
291
327
|
get codeValue() {
|
|
292
328
|
return this.node?.outputs._code.value ?? "";
|
|
@@ -296,46 +332,46 @@ class gn extends D {
|
|
|
296
332
|
return e.value.findNodeById(this.nodeId);
|
|
297
333
|
}
|
|
298
334
|
}
|
|
299
|
-
class
|
|
335
|
+
class Le extends ve {
|
|
300
336
|
min;
|
|
301
337
|
max;
|
|
302
338
|
constructor(e, t, s, o) {
|
|
303
|
-
super(e, t), this.min = s, this.max = o, this.use(V,
|
|
339
|
+
super(e, t), this.min = s, this.max = o, this.use(V, dt);
|
|
304
340
|
}
|
|
305
341
|
validate(e) {
|
|
306
342
|
return (this.min === void 0 || e >= this.min) && (this.max === void 0 || e <= this.max);
|
|
307
343
|
}
|
|
308
344
|
}
|
|
309
|
-
class
|
|
310
|
-
component =
|
|
345
|
+
class ht extends Le {
|
|
346
|
+
component = Y(Ft);
|
|
311
347
|
validate(e) {
|
|
312
348
|
return Number.isInteger(e) && super.validate(e);
|
|
313
349
|
}
|
|
314
350
|
}
|
|
315
|
-
class
|
|
351
|
+
class ua extends ve {
|
|
316
352
|
constructor(e = "", t = "") {
|
|
317
|
-
super(e, t), this.setComponent(
|
|
353
|
+
super(e, t), this.setComponent(Y(st)), this.use(V, ut);
|
|
318
354
|
}
|
|
319
355
|
getValue = () => `[${this.value}]`;
|
|
320
356
|
}
|
|
321
|
-
class
|
|
322
|
-
component =
|
|
357
|
+
class Cn extends Le {
|
|
358
|
+
component = Y(Yt);
|
|
323
359
|
}
|
|
324
|
-
class
|
|
360
|
+
class Pe extends ve {
|
|
325
361
|
constructor(e, t) {
|
|
326
|
-
super(e, t), this.use(V,
|
|
362
|
+
super(e, t), this.use(V, ct);
|
|
327
363
|
}
|
|
328
364
|
getValue = () => `"${this.value}"`;
|
|
329
365
|
}
|
|
330
|
-
class
|
|
331
|
-
component =
|
|
366
|
+
class wn extends Pe {
|
|
367
|
+
component = Y(Wt);
|
|
332
368
|
items;
|
|
333
369
|
constructor(e, t, s) {
|
|
334
370
|
super(e, t), this.items = s;
|
|
335
371
|
}
|
|
336
372
|
}
|
|
337
|
-
class
|
|
338
|
-
component =
|
|
373
|
+
class da extends Le {
|
|
374
|
+
component = Y(Kt);
|
|
339
375
|
min;
|
|
340
376
|
max;
|
|
341
377
|
constructor(e, t, s, o) {
|
|
@@ -343,7 +379,7 @@ class ur extends Be {
|
|
|
343
379
|
}
|
|
344
380
|
getValue = () => `${Math.round(this.value * 1e3) / 1e3}`;
|
|
345
381
|
}
|
|
346
|
-
const
|
|
382
|
+
const kn = F({
|
|
347
383
|
props: {
|
|
348
384
|
intf: {
|
|
349
385
|
type: Object,
|
|
@@ -356,47 +392,47 @@ const bn = F({
|
|
|
356
392
|
},
|
|
357
393
|
emits: ["update:modelValue"],
|
|
358
394
|
setup(n, { emit: e }) {
|
|
359
|
-
return { v:
|
|
395
|
+
return { v: A({
|
|
360
396
|
get: () => n.modelValue,
|
|
361
397
|
set: (s) => {
|
|
362
398
|
e("update:modelValue", s);
|
|
363
399
|
}
|
|
364
400
|
}) };
|
|
365
401
|
}
|
|
366
|
-
}),
|
|
402
|
+
}), R = (n, e) => {
|
|
367
403
|
const t = n.__vccOpts || n;
|
|
368
404
|
for (const [s, o] of e)
|
|
369
405
|
t[s] = o;
|
|
370
406
|
return t;
|
|
371
|
-
},
|
|
372
|
-
function
|
|
373
|
-
return p(), b("div",
|
|
374
|
-
m("label",
|
|
407
|
+
}, xn = { style: { position: "relative" } }, In = { style: { "font-size": "12px", padding: "0 6px", position: "absolute", top: "-8px", "background-color": "var(--baklava-node-color-background)" } }, Nn = ["placeholder", "title"];
|
|
408
|
+
function En(n, e, t, s, o, a) {
|
|
409
|
+
return p(), b("div", xn, [
|
|
410
|
+
m("label", In, P(n.intf.name), 1),
|
|
375
411
|
ke(m("input", {
|
|
376
412
|
"onUpdate:modelValue": e[0] || (e[0] = (i) => n.v = i),
|
|
377
413
|
type: "text",
|
|
378
414
|
class: "baklava-input",
|
|
379
415
|
placeholder: n.intf.name,
|
|
380
416
|
title: n.intf.name
|
|
381
|
-
}, null, 8,
|
|
417
|
+
}, null, 8, Nn), [
|
|
382
418
|
[xe, n.v]
|
|
383
419
|
])
|
|
384
420
|
]);
|
|
385
421
|
}
|
|
386
|
-
const
|
|
387
|
-
class
|
|
388
|
-
component =
|
|
422
|
+
const Tn = /* @__PURE__ */ R(kn, [["render", En]]);
|
|
423
|
+
class ft extends Pe {
|
|
424
|
+
component = Y(Tn);
|
|
389
425
|
}
|
|
390
|
-
class
|
|
391
|
-
component =
|
|
426
|
+
class ca extends Pe {
|
|
427
|
+
component = Y(Xt);
|
|
392
428
|
}
|
|
393
|
-
class
|
|
429
|
+
class pa extends ve {
|
|
394
430
|
constructor(e = "", t = "") {
|
|
395
|
-
super(e, t), this.setComponent(
|
|
431
|
+
super(e, t), this.setComponent(Y(st)), this.use(V, pt);
|
|
396
432
|
}
|
|
397
433
|
getValue = () => `(${this.value})`;
|
|
398
434
|
}
|
|
399
|
-
function
|
|
435
|
+
function ha(n) {
|
|
400
436
|
return class extends Re {
|
|
401
437
|
type = n.type;
|
|
402
438
|
inputs = {};
|
|
@@ -404,10 +440,10 @@ function hr(n) {
|
|
|
404
440
|
constructor() {
|
|
405
441
|
super(), this._title = n.title ?? n.type, this.executeFactory("input", n.inputs), this.executeFactory("output", n.outputs), n.calculate && (this.calculate = (e, t) => n.calculate.call(this, { inputs: e, ...t })), n.onCreate?.call(this), this.name = n.name ?? n.type, this.updateModules(n.modules), n.variableName != null && (this.state.variableName = n.variableName), n.codeTemplate && (this.codeTemplate = n.codeTemplate), this.addInput(
|
|
406
442
|
"_code",
|
|
407
|
-
new D("", []).use(V,
|
|
443
|
+
new D("_code", []).use(V, K).use(de).setHidden(!0)
|
|
408
444
|
), this.addOutput(
|
|
409
445
|
"_code",
|
|
410
|
-
new D("", []).use(V,
|
|
446
|
+
new D("_code", []).use(V, K).use(de).setHidden(!0)
|
|
411
447
|
);
|
|
412
448
|
}
|
|
413
449
|
onPlaced() {
|
|
@@ -433,10 +469,10 @@ function hr(n) {
|
|
|
433
469
|
}
|
|
434
470
|
};
|
|
435
471
|
}
|
|
436
|
-
class
|
|
472
|
+
class On extends Re {
|
|
437
473
|
}
|
|
438
|
-
function
|
|
439
|
-
return class extends
|
|
474
|
+
function fa(n) {
|
|
475
|
+
return class extends On {
|
|
440
476
|
type = n.type;
|
|
441
477
|
inputs = {};
|
|
442
478
|
outputs = {};
|
|
@@ -446,10 +482,10 @@ function fr(n) {
|
|
|
446
482
|
constructor() {
|
|
447
483
|
super(), this._title = n.title ?? n.type, this.executeFactory("input", n.inputs), this.executeFactory("output", n.outputs), n.calculate && (this.calculate = (e, t) => n.calculate?.call(this, e, t)), n.onCreate?.call(this), this.name = n.name ?? n.type, this.updateModules(n.modules), n.codeTemplate && (this.codeTemplate = n.codeTemplate), n.variableName && (this.state.variableName = n.variableName), this.addInput(
|
|
448
484
|
"_code",
|
|
449
|
-
new D("", []).use(V,
|
|
485
|
+
new D("_code", []).use(V, K).use(de).setHidden(!0)
|
|
450
486
|
), this.addOutput(
|
|
451
487
|
"_code",
|
|
452
|
-
new D("", []).use(V,
|
|
488
|
+
new D("_code", []).use(V, K).use(de).setHidden(!0)
|
|
453
489
|
), this.staticInputKeys.push("_code"), this.staticOutputKeys.push("_code");
|
|
454
490
|
}
|
|
455
491
|
onPlaced() {
|
|
@@ -477,23 +513,23 @@ function fr(n) {
|
|
|
477
513
|
this.outputs[t].load(e.outputs[t]), this.outputs[t].nodeId = this.id, t !== "_code" && (this.outputs[t].hidden = e.outputs[t].hidden);
|
|
478
514
|
this.preventUpdate = !1, this.onUpdate(), this.preventUpdate = !0;
|
|
479
515
|
for (const t of Object.keys(e.inputs))
|
|
480
|
-
if (!this.staticInputKeys.includes(t)) {
|
|
516
|
+
if (!(this.staticInputKeys.includes(t) || !e.inputs[t])) {
|
|
481
517
|
if (!this.inputs[t]) {
|
|
482
|
-
const s = e.inputs[t].value;
|
|
483
|
-
let
|
|
484
|
-
|
|
518
|
+
const s = e.inputs[t], o = s.value;
|
|
519
|
+
let a;
|
|
520
|
+
s.component ? a = vn(s.component, { ...s, id: t }) : typeof o == "number" ? a = new ht(t, o) : a = new ft(t, JSON.stringify(o)), a.use(ot, !0), a.setOptional(s.optional ?? !1), a.setHidden(s.hidden ?? !1), this.addInput(t, a);
|
|
485
521
|
}
|
|
486
522
|
this.inputs[t] && (this.inputs[t].load(e.inputs[t]), this.inputs[t].nodeId = this.id);
|
|
487
523
|
}
|
|
488
524
|
for (const t of Object.keys(e.outputs))
|
|
489
|
-
if (!this.staticOutputKeys.includes(t)) {
|
|
525
|
+
if (!(this.staticOutputKeys.includes(t) || !e.outputs[t])) {
|
|
490
526
|
if (!this.outputs[t]) {
|
|
491
|
-
const s = new
|
|
527
|
+
const s = new _n(t);
|
|
492
528
|
this.addOutput(t, s);
|
|
493
529
|
}
|
|
494
530
|
this.outputs[t] && (this.outputs[t].load(e.outputs[t]), this.outputs[t].nodeId = this.id);
|
|
495
531
|
}
|
|
496
|
-
|
|
532
|
+
it(this.graph, e), this.preventUpdate = !1, this.events.loaded.emit(this);
|
|
497
533
|
}
|
|
498
534
|
onUpdate() {
|
|
499
535
|
if (this.preventUpdate) return;
|
|
@@ -508,13 +544,13 @@ function fr(n) {
|
|
|
508
544
|
return s;
|
|
509
545
|
}
|
|
510
546
|
updateInterfaces(e, t, s) {
|
|
511
|
-
const o = e === "input" ? this.staticInputKeys : this.staticOutputKeys,
|
|
512
|
-
for (const i of Object.keys(
|
|
547
|
+
const o = e === "input" ? this.staticInputKeys : this.staticOutputKeys, a = e === "input" ? this.inputs : this.outputs;
|
|
548
|
+
for (const i of Object.keys(a))
|
|
513
549
|
o.includes(i) || t[i] && !s.includes(i) || (e === "input" ? this.removeInput(i) : this.removeOutput(i));
|
|
514
550
|
for (const i of Object.keys(t)) {
|
|
515
|
-
if (
|
|
516
|
-
const
|
|
517
|
-
e === "input" ? this.addInput(i,
|
|
551
|
+
if (a[i]) continue;
|
|
552
|
+
const r = t[i]();
|
|
553
|
+
e === "input" ? this.addInput(i, r) : this.addOutput(i, r);
|
|
518
554
|
}
|
|
519
555
|
}
|
|
520
556
|
updateProps(e) {
|
|
@@ -529,7 +565,7 @@ function fr(n) {
|
|
|
529
565
|
};
|
|
530
566
|
}
|
|
531
567
|
ce.escape = (n) => n;
|
|
532
|
-
class
|
|
568
|
+
class Ve {
|
|
533
569
|
_id;
|
|
534
570
|
_state;
|
|
535
571
|
viewModel;
|
|
@@ -596,25 +632,26 @@ class ze {
|
|
|
596
632
|
}
|
|
597
633
|
/**
|
|
598
634
|
* Render code script.
|
|
635
|
+
* @param data data for render template.
|
|
599
636
|
*/
|
|
600
637
|
renderCode(e) {
|
|
601
|
-
this.state.script = ce.render(this.state.template || "", e);
|
|
638
|
+
this.state.script = ce.render(this.state.template || "", e ?? {});
|
|
602
639
|
}
|
|
603
640
|
}
|
|
604
|
-
class
|
|
641
|
+
class ma extends Ve {
|
|
605
642
|
constructor() {
|
|
606
643
|
super(), this.loadTemplate(import("./python-CKuCd7tg.js"));
|
|
607
644
|
}
|
|
608
645
|
}
|
|
609
|
-
class
|
|
646
|
+
class va extends Ve {
|
|
610
647
|
constructor() {
|
|
611
648
|
super(), this.loadTemplate(import("./javascript-DK1c6Ap1.js"));
|
|
612
649
|
}
|
|
613
650
|
}
|
|
614
|
-
const
|
|
651
|
+
const ga = (n) => {
|
|
615
652
|
n.allowMultipleConnections = !0;
|
|
616
653
|
};
|
|
617
|
-
class
|
|
654
|
+
class Mn extends zt {
|
|
618
655
|
order = /* @__PURE__ */ new Map();
|
|
619
656
|
constructor(e) {
|
|
620
657
|
super(e);
|
|
@@ -623,32 +660,32 @@ class In extends Bt {
|
|
|
623
660
|
super.start(), this.recalculateOrder = !0, this.calculateWithoutData();
|
|
624
661
|
}
|
|
625
662
|
async runGraph(e, t, s) {
|
|
626
|
-
this.order.has(e.id) || this.order.set(e.id,
|
|
627
|
-
const { calculationOrder: o, connectionsFromNode:
|
|
628
|
-
for (const
|
|
663
|
+
this.order.has(e.id) || this.order.set(e.id, Ut(e));
|
|
664
|
+
const { calculationOrder: o, connectionsFromNode: a } = this.order.get(e.id), i = /* @__PURE__ */ new Map();
|
|
665
|
+
for (const r of o) {
|
|
629
666
|
const l = {};
|
|
630
|
-
Object.entries(
|
|
667
|
+
Object.entries(r.inputs).forEach(([f, C]) => {
|
|
631
668
|
l[f] = this.getInterfaceValue(t, C.id);
|
|
632
|
-
}),
|
|
669
|
+
}), r.isCodeNode && (r.updateCodeTemplate(), r.updateOutputNames()), this.events.beforeNodeCalculation.emit({ inputValues: l, node: r });
|
|
633
670
|
let d;
|
|
634
|
-
if (
|
|
635
|
-
if (d = await
|
|
671
|
+
if (r.calculate) {
|
|
672
|
+
if (d = await r.calculate(l, { globalValues: s, engine: this }), a.has(r))
|
|
636
673
|
for (const [f, C] of Object.entries(d))
|
|
637
|
-
this.hooks.transferData.execute(d[f], C),
|
|
674
|
+
this.hooks.transferData.execute(d[f], C), a.get(r).forEach((h) => t.set(h.to.id, C));
|
|
638
675
|
} else {
|
|
639
676
|
d = {};
|
|
640
|
-
for (const [f, C] of Object.entries(
|
|
677
|
+
for (const [f, C] of Object.entries(r.outputs))
|
|
641
678
|
d[f] = this.getInterfaceValue(t, C.id);
|
|
642
679
|
}
|
|
643
|
-
this.events.afterNodeCalculation.emit({ outputValues: d, node:
|
|
644
|
-
const C = Object.entries(
|
|
680
|
+
this.events.afterNodeCalculation.emit({ outputValues: d, node: r }), i.set(r.id, new Map(Object.entries(d))), a.has(r) && a.get(r).forEach((f) => {
|
|
681
|
+
const C = Object.entries(r.outputs).find(([, N]) => N.id === f.from.id)?.[0];
|
|
645
682
|
if (!C)
|
|
646
683
|
throw new Error(
|
|
647
684
|
`Could not find key for interface ${f.from.id}
|
|
648
685
|
This is likely an internal issue. Please report it on GitHub.`
|
|
649
686
|
);
|
|
650
687
|
const h = this.hooks.transferData.execute(d[C], f);
|
|
651
|
-
f.to.allowMultipleConnections ? t.has(f.to.id) ? t.get(f.to.id).push(h) : t.set(f.to.id, [h]) : t.set(f.to.id, h);
|
|
688
|
+
C !== "_code" && (f.to.allowMultipleConnections ? t.has(f.to.id) ? t.get(f.to.id).push(h) : t.set(f.to.id, [h]) : t.set(f.to.id, h));
|
|
652
689
|
});
|
|
653
690
|
}
|
|
654
691
|
return i;
|
|
@@ -680,7 +717,7 @@ This is likely an internal issue. Please report it on GitHub.`
|
|
|
680
717
|
return e.get(t);
|
|
681
718
|
}
|
|
682
719
|
}
|
|
683
|
-
const
|
|
720
|
+
const $n = {}, Sn = {
|
|
684
721
|
xmlns: "http://www.w3.org/2000/svg",
|
|
685
722
|
width: "24",
|
|
686
723
|
height: "24",
|
|
@@ -692,8 +729,8 @@ const Nn = {}, En = {
|
|
|
692
729
|
"stroke-linejoin": "round",
|
|
693
730
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
694
731
|
};
|
|
695
|
-
function
|
|
696
|
-
return p(), b("svg",
|
|
732
|
+
function An(n, e) {
|
|
733
|
+
return p(), b("svg", Sn, [...e[0] || (e[0] = [
|
|
697
734
|
m("path", {
|
|
698
735
|
stroke: "none",
|
|
699
736
|
d: "M0 0h24v24H0z",
|
|
@@ -702,7 +739,7 @@ function Tn(n, e) {
|
|
|
702
739
|
m("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
703
740
|
])]);
|
|
704
741
|
}
|
|
705
|
-
const
|
|
742
|
+
const Gn = /* @__PURE__ */ R($n, [["render", An]]), Rn = {}, jn = {
|
|
706
743
|
xmlns: "http://www.w3.org/2000/svg",
|
|
707
744
|
width: "24",
|
|
708
745
|
height: "24",
|
|
@@ -714,8 +751,8 @@ const On = /* @__PURE__ */ A(Nn, [["render", Tn]]), $n = {}, Mn = {
|
|
|
714
751
|
"stroke-linejoin": "round",
|
|
715
752
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-code-variable"
|
|
716
753
|
};
|
|
717
|
-
function
|
|
718
|
-
return p(), b("svg",
|
|
754
|
+
function Ln(n, e) {
|
|
755
|
+
return p(), b("svg", jn, [...e[0] || (e[0] = [
|
|
719
756
|
m("path", {
|
|
720
757
|
stroke: "none",
|
|
721
758
|
d: "M0 0h24v24H0z",
|
|
@@ -724,7 +761,7 @@ function Sn(n, e) {
|
|
|
724
761
|
m("path", { d: "M4 8m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" }, null, -1)
|
|
725
762
|
])]);
|
|
726
763
|
}
|
|
727
|
-
const Pn = /* @__PURE__ */
|
|
764
|
+
const Pn = /* @__PURE__ */ R(Rn, [["render", Ln]]), Vn = {}, Hn = {
|
|
728
765
|
xmlns: "http://www.w3.org/2000/svg",
|
|
729
766
|
width: "24",
|
|
730
767
|
height: "24",
|
|
@@ -736,8 +773,8 @@ const Pn = /* @__PURE__ */ A($n, [["render", Sn]]), Gn = {}, An = {
|
|
|
736
773
|
"stroke-linejoin": "round",
|
|
737
774
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-copy"
|
|
738
775
|
};
|
|
739
|
-
function
|
|
740
|
-
return p(), b("svg",
|
|
776
|
+
function Bn(n, e) {
|
|
777
|
+
return p(), b("svg", Hn, [...e[0] || (e[0] = [
|
|
741
778
|
m("path", {
|
|
742
779
|
stroke: "none",
|
|
743
780
|
d: "M0 0h24v24H0z",
|
|
@@ -747,7 +784,7 @@ function Rn(n, e) {
|
|
|
747
784
|
m("path", { d: "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" }, null, -1)
|
|
748
785
|
])]);
|
|
749
786
|
}
|
|
750
|
-
const
|
|
787
|
+
const zn = /* @__PURE__ */ R(Vn, [["render", Bn]]), Un = {}, Dn = {
|
|
751
788
|
xmlns: "http://www.w3.org/2000/svg",
|
|
752
789
|
width: "24",
|
|
753
790
|
height: "24",
|
|
@@ -759,8 +796,8 @@ const jn = /* @__PURE__ */ A(Gn, [["render", Rn]]), Ln = {}, Vn = {
|
|
|
759
796
|
"stroke-linejoin": "round",
|
|
760
797
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-dots-vertical"
|
|
761
798
|
};
|
|
762
|
-
function
|
|
763
|
-
return p(), b("svg",
|
|
799
|
+
function Fn(n, e) {
|
|
800
|
+
return p(), b("svg", Dn, [...e[0] || (e[0] = [
|
|
764
801
|
m("path", {
|
|
765
802
|
stroke: "none",
|
|
766
803
|
d: "M0 0h24v24H0z",
|
|
@@ -771,7 +808,7 @@ function Bn(n, e) {
|
|
|
771
808
|
m("path", { d: "M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1)
|
|
772
809
|
])]);
|
|
773
810
|
}
|
|
774
|
-
const
|
|
811
|
+
const Yn = /* @__PURE__ */ R(Un, [["render", Fn]]), Wn = {}, Kn = {
|
|
775
812
|
xmlns: "http://www.w3.org/2000/svg",
|
|
776
813
|
width: "24",
|
|
777
814
|
height: "24",
|
|
@@ -779,8 +816,8 @@ const Hn = /* @__PURE__ */ A(Ln, [["render", Bn]]), zn = {}, Un = {
|
|
|
779
816
|
fill: "currentColor",
|
|
780
817
|
class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-collapse"
|
|
781
818
|
};
|
|
782
|
-
function
|
|
783
|
-
return p(), b("svg",
|
|
819
|
+
function Xn(n, e) {
|
|
820
|
+
return p(), b("svg", Kn, [...e[0] || (e[0] = [
|
|
784
821
|
m("path", {
|
|
785
822
|
stroke: "none",
|
|
786
823
|
d: "M0 0h24v24H0z",
|
|
@@ -789,7 +826,7 @@ function Dn(n, e) {
|
|
|
789
826
|
m("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-2.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z" }, null, -1)
|
|
790
827
|
])]);
|
|
791
828
|
}
|
|
792
|
-
const
|
|
829
|
+
const qn = /* @__PURE__ */ R(Wn, [["render", Xn]]), Jn = {}, Qn = {
|
|
793
830
|
xmlns: "http://www.w3.org/2000/svg",
|
|
794
831
|
width: "24",
|
|
795
832
|
height: "24",
|
|
@@ -797,8 +834,8 @@ const Fn = /* @__PURE__ */ A(zn, [["render", Dn]]), Wn = {}, Yn = {
|
|
|
797
834
|
fill: "currentColor",
|
|
798
835
|
class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-expand"
|
|
799
836
|
};
|
|
800
|
-
function
|
|
801
|
-
return p(), b("svg",
|
|
837
|
+
function Zn(n, e) {
|
|
838
|
+
return p(), b("svg", Qn, [...e[0] || (e[0] = [
|
|
802
839
|
m("path", {
|
|
803
840
|
stroke: "none",
|
|
804
841
|
d: "M0 0h24v24H0z",
|
|
@@ -807,7 +844,7 @@ function Xn(n, e) {
|
|
|
807
844
|
m("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-4.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z" }, null, -1)
|
|
808
845
|
])]);
|
|
809
846
|
}
|
|
810
|
-
const
|
|
847
|
+
const eo = /* @__PURE__ */ R(Jn, [["render", Zn]]), to = {}, no = {
|
|
811
848
|
xmlns: "http://www.w3.org/2000/svg",
|
|
812
849
|
width: "24",
|
|
813
850
|
height: "24",
|
|
@@ -815,8 +852,8 @@ const Kn = /* @__PURE__ */ A(Wn, [["render", Xn]]), qn = {}, Jn = {
|
|
|
815
852
|
fill: "currentColor",
|
|
816
853
|
class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right"
|
|
817
854
|
};
|
|
818
|
-
function
|
|
819
|
-
return p(), b("svg",
|
|
855
|
+
function oo(n, e) {
|
|
856
|
+
return p(), b("svg", no, [...e[0] || (e[0] = [
|
|
820
857
|
m("path", {
|
|
821
858
|
stroke: "none",
|
|
822
859
|
d: "M0 0h24v24H0z",
|
|
@@ -825,7 +862,7 @@ function Qn(n, e) {
|
|
|
825
862
|
m("path", { d: "M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm8 -16h-8a1 1 0 0 0 -1 1v12a1 1 0 0 0 1 1h8z" }, null, -1)
|
|
826
863
|
])]);
|
|
827
864
|
}
|
|
828
|
-
const
|
|
865
|
+
const so = /* @__PURE__ */ R(to, [["render", oo]]), ao = {}, ro = {
|
|
829
866
|
xmlns: "http://www.w3.org/2000/svg",
|
|
830
867
|
width: "24",
|
|
831
868
|
height: "24",
|
|
@@ -833,8 +870,8 @@ const Zn = /* @__PURE__ */ A(qn, [["render", Qn]]), eo = {}, to = {
|
|
|
833
870
|
fill: "currentColor",
|
|
834
871
|
class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-collapse"
|
|
835
872
|
};
|
|
836
|
-
function
|
|
837
|
-
return p(), b("svg",
|
|
873
|
+
function io(n, e) {
|
|
874
|
+
return p(), b("svg", ro, [...e[0] || (e[0] = [
|
|
838
875
|
m("path", {
|
|
839
876
|
stroke: "none",
|
|
840
877
|
d: "M0 0h24v24H0z",
|
|
@@ -843,7 +880,7 @@ function no(n, e) {
|
|
|
843
880
|
m("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-5.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z" }, null, -1)
|
|
844
881
|
])]);
|
|
845
882
|
}
|
|
846
|
-
const
|
|
883
|
+
const lo = /* @__PURE__ */ R(ao, [["render", io]]), uo = {}, co = {
|
|
847
884
|
xmlns: "http://www.w3.org/2000/svg",
|
|
848
885
|
width: "24",
|
|
849
886
|
height: "24",
|
|
@@ -851,8 +888,8 @@ const oo = /* @__PURE__ */ A(eo, [["render", no]]), so = {}, ro = {
|
|
|
851
888
|
fill: "currentColor",
|
|
852
889
|
class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-expand"
|
|
853
890
|
};
|
|
854
|
-
function
|
|
855
|
-
return p(), b("svg",
|
|
891
|
+
function po(n, e) {
|
|
892
|
+
return p(), b("svg", co, [...e[0] || (e[0] = [
|
|
856
893
|
m("path", {
|
|
857
894
|
stroke: "none",
|
|
858
895
|
d: "M0 0h24v24H0z",
|
|
@@ -861,7 +898,7 @@ function ao(n, e) {
|
|
|
861
898
|
m("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-3.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z" }, null, -1)
|
|
862
899
|
])]);
|
|
863
900
|
}
|
|
864
|
-
const
|
|
901
|
+
const ho = /* @__PURE__ */ R(uo, [["render", po]]), fo = {}, mo = {
|
|
865
902
|
xmlns: "http://www.w3.org/2000/svg",
|
|
866
903
|
width: "24",
|
|
867
904
|
height: "24",
|
|
@@ -873,12 +910,12 @@ const io = /* @__PURE__ */ A(so, [["render", ao]]), lo = {}, uo = {
|
|
|
873
910
|
"stroke-linejoin": "round",
|
|
874
911
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-lock-code"
|
|
875
912
|
};
|
|
876
|
-
function
|
|
877
|
-
return p(), b("svg",
|
|
913
|
+
function vo(n, e) {
|
|
914
|
+
return p(), b("svg", mo, [...e[0] || (e[0] = [
|
|
878
915
|
fe('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M11.5 21h-4.5a2 2 0 0 1 -2 -2v-6a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2"></path><path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M8 11v-4a4 4 0 1 1 8 0v4"></path><path d="M20 21l2 -2l-2 -2"></path><path d="M17 17l-2 2l2 2"></path>', 6)
|
|
879
916
|
])]);
|
|
880
917
|
}
|
|
881
|
-
const
|
|
918
|
+
const mt = /* @__PURE__ */ R(fo, [["render", vo]]), go = {}, bo = {
|
|
882
919
|
xmlns: "http://www.w3.org/2000/svg",
|
|
883
920
|
width: "24",
|
|
884
921
|
height: "24",
|
|
@@ -890,8 +927,8 @@ const ht = /* @__PURE__ */ A(lo, [["render", co]]), po = {}, ho = {
|
|
|
890
927
|
"stroke-linejoin": "round",
|
|
891
928
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-player-play"
|
|
892
929
|
};
|
|
893
|
-
function
|
|
894
|
-
return p(), b("svg",
|
|
930
|
+
function yo(n, e) {
|
|
931
|
+
return p(), b("svg", bo, [...e[0] || (e[0] = [
|
|
895
932
|
m("path", {
|
|
896
933
|
stroke: "none",
|
|
897
934
|
d: "M0 0h24v24H0z",
|
|
@@ -900,7 +937,7 @@ function fo(n, e) {
|
|
|
900
937
|
m("path", { d: "M7 4v16l13 -8z" }, null, -1)
|
|
901
938
|
])]);
|
|
902
939
|
}
|
|
903
|
-
const
|
|
940
|
+
const _o = /* @__PURE__ */ R(go, [["render", yo]]), Co = {}, wo = {
|
|
904
941
|
xmlns: "http://www.w3.org/2000/svg",
|
|
905
942
|
width: "24",
|
|
906
943
|
height: "24",
|
|
@@ -912,8 +949,8 @@ const mo = /* @__PURE__ */ A(po, [["render", fo]]), vo = {}, go = {
|
|
|
912
949
|
"stroke-linejoin": "round",
|
|
913
950
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-plus"
|
|
914
951
|
};
|
|
915
|
-
function
|
|
916
|
-
return p(), b("svg",
|
|
952
|
+
function ko(n, e) {
|
|
953
|
+
return p(), b("svg", wo, [...e[0] || (e[0] = [
|
|
917
954
|
m("path", {
|
|
918
955
|
stroke: "none",
|
|
919
956
|
d: "M0 0h24v24H0z",
|
|
@@ -923,7 +960,7 @@ function bo(n, e) {
|
|
|
923
960
|
m("path", { d: "M5 12l14 0" }, null, -1)
|
|
924
961
|
])]);
|
|
925
962
|
}
|
|
926
|
-
const
|
|
963
|
+
const xo = /* @__PURE__ */ R(Co, [["render", ko]]), Io = {}, No = {
|
|
927
964
|
xmlns: "http://www.w3.org/2000/svg",
|
|
928
965
|
width: "24",
|
|
929
966
|
height: "24",
|
|
@@ -935,12 +972,12 @@ const yo = /* @__PURE__ */ A(vo, [["render", bo]]), _o = {}, Co = {
|
|
|
935
972
|
"stroke-linejoin": "round",
|
|
936
973
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema"
|
|
937
974
|
};
|
|
938
|
-
function
|
|
939
|
-
return p(), b("svg",
|
|
975
|
+
function Eo(n, e) {
|
|
976
|
+
return p(), b("svg", No, [...e[0] || (e[0] = [
|
|
940
977
|
fe('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M5 2h5v4h-5z"></path><path d="M15 10h5v4h-5z"></path><path d="M5 18h5v4h-5z"></path><path d="M5 10h5v4h-5z"></path><path d="M10 12h5"></path><path d="M7.5 6v4"></path><path d="M7.5 14v4"></path>', 8)
|
|
941
978
|
])]);
|
|
942
979
|
}
|
|
943
|
-
const
|
|
980
|
+
const To = /* @__PURE__ */ R(Io, [["render", Eo]]), Oo = {}, Mo = {
|
|
944
981
|
xmlns: "http://www.w3.org/2000/svg",
|
|
945
982
|
width: "24",
|
|
946
983
|
height: "24",
|
|
@@ -952,12 +989,12 @@ const ko = /* @__PURE__ */ A(_o, [["render", wo]]), xo = {}, Io = {
|
|
|
952
989
|
"stroke-linejoin": "round",
|
|
953
990
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema-off"
|
|
954
991
|
};
|
|
955
|
-
function
|
|
956
|
-
return p(), b("svg",
|
|
992
|
+
function $o(n, e) {
|
|
993
|
+
return p(), b("svg", Mo, [...e[0] || (e[0] = [
|
|
957
994
|
fe('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 2h4v4m-4 0h-1v-1"></path><path d="M15 11v-1h5v4h-2"></path><path d="M5 18h5v4h-5z"></path><path d="M5 10h5v4h-5z"></path><path d="M10 12h2"></path><path d="M7.5 7.5v2.5"></path><path d="M7.5 14v4"></path><path d="M3 3l18 18"></path>', 9)
|
|
958
995
|
])]);
|
|
959
996
|
}
|
|
960
|
-
const
|
|
997
|
+
const So = /* @__PURE__ */ R(Oo, [["render", $o]]), Ao = {}, Go = {
|
|
961
998
|
xmlns: "http://www.w3.org/2000/svg",
|
|
962
999
|
width: "24",
|
|
963
1000
|
height: "24",
|
|
@@ -969,12 +1006,12 @@ const Eo = /* @__PURE__ */ A(xo, [["render", No]]), To = {}, Oo = {
|
|
|
969
1006
|
"stroke-linejoin": "round",
|
|
970
1007
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-transition-bottom"
|
|
971
1008
|
};
|
|
972
|
-
function
|
|
973
|
-
return p(), b("svg",
|
|
1009
|
+
function Ro(n, e) {
|
|
1010
|
+
return p(), b("svg", Go, [...e[0] || (e[0] = [
|
|
974
1011
|
fe('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M21 18a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3"></path><path d="M3 3m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z"></path><path d="M12 9v8"></path><path d="M9 14l3 3l3 -3"></path>', 5)
|
|
975
1012
|
])]);
|
|
976
1013
|
}
|
|
977
|
-
const
|
|
1014
|
+
const jo = /* @__PURE__ */ R(Ao, [["render", Ro]]), Lo = {}, Po = {
|
|
978
1015
|
xmlns: "http://www.w3.org/2000/svg",
|
|
979
1016
|
width: "24",
|
|
980
1017
|
height: "24",
|
|
@@ -986,12 +1023,12 @@ const Mo = /* @__PURE__ */ A(To, [["render", $o]]), So = {}, Po = {
|
|
|
986
1023
|
"stroke-linejoin": "round",
|
|
987
1024
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-trash-off"
|
|
988
1025
|
};
|
|
989
|
-
function
|
|
1026
|
+
function Vo(n, e) {
|
|
990
1027
|
return p(), b("svg", Po, [...e[0] || (e[0] = [
|
|
991
1028
|
fe('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 3l18 18"></path><path d="M4 7h3m4 0h9"></path><path d="M10 11l0 6"></path><path d="M14 14l0 3"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l.077 -.923"></path><path d="M18.384 14.373l.616 -7.373"></path><path d="M9 5v-1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>', 8)
|
|
992
1029
|
])]);
|
|
993
1030
|
}
|
|
994
|
-
const
|
|
1031
|
+
const Ho = /* @__PURE__ */ R(Lo, [["render", Vo]]), Bo = {}, zo = {
|
|
995
1032
|
xmlns: "http://www.w3.org/2000/svg",
|
|
996
1033
|
width: "24",
|
|
997
1034
|
height: "24",
|
|
@@ -1003,8 +1040,8 @@ const Ao = /* @__PURE__ */ A(So, [["render", Go]]), Ro = {}, jo = {
|
|
|
1003
1040
|
"stroke-linejoin": "round",
|
|
1004
1041
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
1005
1042
|
};
|
|
1006
|
-
function
|
|
1007
|
-
return p(), b("svg",
|
|
1043
|
+
function Uo(n, e) {
|
|
1044
|
+
return p(), b("svg", zo, [...e[0] || (e[0] = [
|
|
1008
1045
|
m("path", {
|
|
1009
1046
|
stroke: "none",
|
|
1010
1047
|
d: "M0 0h24v24H0z",
|
|
@@ -1014,55 +1051,57 @@ function Lo(n, e) {
|
|
|
1014
1051
|
m("path", { d: "M6 6l12 12" }, null, -1)
|
|
1015
1052
|
])]);
|
|
1016
1053
|
}
|
|
1017
|
-
const
|
|
1054
|
+
const Do = /* @__PURE__ */ R(Bo, [["render", Uo]]), vt = "CLEAR_ALL", gt = "RUN_ENGINE", bt = "TOGGLE_MINIMAP", yt = "TOGGLE_PALETTE", Fo = (n, e, t) => {
|
|
1018
1055
|
const s = t.zoomToFit.paddingLeft;
|
|
1019
|
-
e.registerCommand(
|
|
1056
|
+
e.registerCommand(yt, {
|
|
1020
1057
|
execute: () => {
|
|
1021
1058
|
t.palette.enabled = !t.palette.enabled, t.zoomToFit.paddingLeft = t.palette.enabled ? s : 50;
|
|
1022
1059
|
},
|
|
1023
1060
|
canExecute: () => !0
|
|
1024
|
-
}), e.registerCommand(ft, {
|
|
1025
|
-
execute: () => n.value.clear(),
|
|
1026
|
-
canExecute: () => n.value.nodes.length > 0
|
|
1027
1061
|
}), e.registerCommand(vt, {
|
|
1062
|
+
execute: () => {
|
|
1063
|
+
e.executeCommand(ne.CLEAR_CLIPBOARD_COMMAND), e.executeCommand(ne.CLEAR_HISTORY_COMMAND), n.value.clear(), n.value.editor.code.clear();
|
|
1064
|
+
},
|
|
1065
|
+
canExecute: () => n.value.nodes.length > 0
|
|
1066
|
+
}), e.registerCommand(bt, {
|
|
1028
1067
|
execute: () => t.enableMinimap = !t.enableMinimap,
|
|
1029
1068
|
canExecute: () => n.value.nodes.length > 1
|
|
1030
1069
|
});
|
|
1031
|
-
},
|
|
1070
|
+
}, Yo = (n) => {
|
|
1032
1071
|
const e = {
|
|
1033
|
-
command:
|
|
1072
|
+
command: gt,
|
|
1034
1073
|
title: "Run",
|
|
1035
1074
|
// Tooltip text
|
|
1036
|
-
icon:
|
|
1075
|
+
icon: A(() => _o)
|
|
1037
1076
|
}, t = {
|
|
1038
|
-
command:
|
|
1077
|
+
command: yt,
|
|
1039
1078
|
title: "Toggle palette",
|
|
1040
1079
|
// Tooltip text
|
|
1041
|
-
icon:
|
|
1080
|
+
icon: A(() => n.palette.enabled ? qn : eo)
|
|
1042
1081
|
}, s = {
|
|
1043
|
-
command:
|
|
1082
|
+
command: vt,
|
|
1044
1083
|
title: "Clear all",
|
|
1045
1084
|
// Tooltip text
|
|
1046
|
-
icon:
|
|
1085
|
+
icon: A(() => Ho)
|
|
1047
1086
|
}, o = {
|
|
1048
|
-
command:
|
|
1087
|
+
command: bt,
|
|
1049
1088
|
title: "Toggle minimap",
|
|
1050
1089
|
// Tooltip text
|
|
1051
|
-
icon:
|
|
1090
|
+
icon: A(() => n.enableMinimap ? So : To)
|
|
1052
1091
|
};
|
|
1053
|
-
n.toolbar.commands = [t, e, ...
|
|
1054
|
-
},
|
|
1055
|
-
|
|
1056
|
-
execute: () =>
|
|
1057
|
-
canExecute: () =>
|
|
1092
|
+
n.toolbar.commands = [t, e, ...qt, s, o];
|
|
1093
|
+
}, Wo = (n, e, t) => {
|
|
1094
|
+
t.registerCommand(gt, {
|
|
1095
|
+
execute: () => e.runOnce(null),
|
|
1096
|
+
canExecute: () => n.nodes.length > 0
|
|
1058
1097
|
});
|
|
1059
1098
|
};
|
|
1060
|
-
function
|
|
1099
|
+
function Ko(n) {
|
|
1061
1100
|
const e = Symbol("CodeEngineToken");
|
|
1062
|
-
n.engine = new
|
|
1063
|
-
n.engine?.pause(), n.displayedGraph.clear(), n.editor.load(t), n.commandHandler.executeCommand(
|
|
1101
|
+
n.engine = new Mn(n.editor), Wo(n.editor.graph, n.engine, n.commandHandler), n.loadEditor = (t) => {
|
|
1102
|
+
n.engine?.pause(), n.displayedGraph.clear(), n.editor.load(t), n.commandHandler.executeCommand(ne.CLEAR_CLIPBOARD_COMMAND), n.commandHandler.executeCommand(ne.CLEAR_HISTORY_COMMAND), n.engine?.resume(), n.engine?.runOnce(null);
|
|
1064
1103
|
}, n.newGraph = () => {
|
|
1065
|
-
n.engine?.pause(), n.displayedGraph.clear(), n.commandHandler.executeCommand(
|
|
1104
|
+
n.engine?.pause(), n.displayedGraph.clear(), n.commandHandler.executeCommand(ne.CLEAR_CLIPBOARD_COMMAND), n.commandHandler.executeCommand(ne.CLEAR_HISTORY_COMMAND), n.displayedGraph.id = re(), n.engine?.resume(), n.engine?.runOnce(null);
|
|
1066
1105
|
}, n.subscribe = () => {
|
|
1067
1106
|
n.displayedGraph.events.addConnection.subscribe(e, (t) => {
|
|
1068
1107
|
const s = n.displayedGraph.findNodeById(t.to.nodeId);
|
|
@@ -1077,7 +1116,7 @@ function Uo(n) {
|
|
|
1077
1116
|
}), n.engine?.events.beforeRun.subscribe(e, () => {
|
|
1078
1117
|
n.engine?.pause(), n.displayedGraph.sortNodes(), n.engine?.resume();
|
|
1079
1118
|
}), n.engine?.events.afterRun.subscribe(e, (t) => {
|
|
1080
|
-
n.engine?.pause(),
|
|
1119
|
+
n.engine?.pause(), nt(t, n.editor), n.code.state.lockCode || n.code.renderCode({
|
|
1081
1120
|
nodes: n.editor.graph.scriptedCodeNodes,
|
|
1082
1121
|
modules: n.editor.code.modules
|
|
1083
1122
|
}), n.engine?.resume();
|
|
@@ -1086,7 +1125,7 @@ function Uo(n) {
|
|
|
1086
1125
|
n.displayedGraph.events.addConnection.unsubscribe(e), n.displayedGraph.events.removeConnection.unsubscribe(e), n.engine?.events.beforeRun.unsubscribe(e), n.engine?.events.afterRun.unsubscribe(e);
|
|
1087
1126
|
};
|
|
1088
1127
|
}
|
|
1089
|
-
class Ie extends
|
|
1128
|
+
class Ie extends Rt {
|
|
1090
1129
|
code = null;
|
|
1091
1130
|
editor;
|
|
1092
1131
|
_state = te({
|
|
@@ -1097,7 +1136,7 @@ class Ie extends Pt {
|
|
|
1097
1136
|
super(e, t), this.editor = e, this.template = t, e.code && (this.code = e.code);
|
|
1098
1137
|
}
|
|
1099
1138
|
get codeNodes() {
|
|
1100
|
-
return
|
|
1139
|
+
return _t(this);
|
|
1101
1140
|
}
|
|
1102
1141
|
get connections() {
|
|
1103
1142
|
return super.connections;
|
|
@@ -1207,31 +1246,31 @@ class Ie extends Pt {
|
|
|
1207
1246
|
try {
|
|
1208
1247
|
let e = this.nodeIds;
|
|
1209
1248
|
const t = this.connections.filter(
|
|
1210
|
-
(
|
|
1211
|
-
).map((
|
|
1212
|
-
e.reverse(), e =
|
|
1213
|
-
const s = this.nodes.map((
|
|
1249
|
+
(a) => e.includes(a.to.nodeId) && e.includes(a.from.nodeId)
|
|
1250
|
+
).map((a) => [a.to.nodeId, a.from.nodeId]);
|
|
1251
|
+
e.reverse(), e = pn.array(e, t), e.reverse();
|
|
1252
|
+
const s = this.nodes.map((a) => a.id).filter((a) => !e.includes(a));
|
|
1214
1253
|
e = [...e, ...s];
|
|
1215
|
-
const o = e.map((
|
|
1254
|
+
const o = e.map((a) => this.findNodeById(a));
|
|
1216
1255
|
o && (this.nodes = o);
|
|
1217
1256
|
} catch {
|
|
1218
1257
|
console.warn("Failed to sort nodes.");
|
|
1219
1258
|
}
|
|
1220
1259
|
}
|
|
1221
1260
|
}
|
|
1222
|
-
const
|
|
1261
|
+
const _t = (n) => {
|
|
1223
1262
|
const e = [];
|
|
1224
1263
|
return n.nodes.length === 0 || n.nodes.forEach((t) => {
|
|
1225
|
-
t && (t.hasOwnProperty("subgraph") ? e.push(...
|
|
1264
|
+
t && (t.hasOwnProperty("subgraph") ? e.push(..._t(t.subgraph)) : t.hasOwnProperty("isCodeNode") && e.push(t));
|
|
1226
1265
|
}), e;
|
|
1227
|
-
},
|
|
1266
|
+
}, ba = (n = 0, e = 100) => ({
|
|
1228
1267
|
x: n * 420,
|
|
1229
1268
|
y: e
|
|
1230
|
-
}),
|
|
1269
|
+
}), ya = (n) => {
|
|
1231
1270
|
const e = { ...n.position };
|
|
1232
1271
|
return e.x -= 440, e.y += 50, e;
|
|
1233
|
-
},
|
|
1234
|
-
class
|
|
1272
|
+
}, Ue = "__baklava_SubgraphInputNode", De = "__baklava_SubgraphOutputNode";
|
|
1273
|
+
class Ct extends Re {
|
|
1235
1274
|
graphInterfaceId;
|
|
1236
1275
|
constructor() {
|
|
1237
1276
|
super(), this.graphInterfaceId = re();
|
|
@@ -1251,11 +1290,11 @@ class yt extends Re {
|
|
|
1251
1290
|
update() {
|
|
1252
1291
|
}
|
|
1253
1292
|
}
|
|
1254
|
-
class
|
|
1293
|
+
class wt extends Ct {
|
|
1255
1294
|
static isGraphInputNode(e) {
|
|
1256
|
-
return e.type ===
|
|
1295
|
+
return e.type === Ue;
|
|
1257
1296
|
}
|
|
1258
|
-
type =
|
|
1297
|
+
type = Ue;
|
|
1259
1298
|
inputs = {
|
|
1260
1299
|
name: new J("Name", "Input")
|
|
1261
1300
|
};
|
|
@@ -1263,11 +1302,11 @@ class _t extends yt {
|
|
|
1263
1302
|
placeholder: new J("Value", void 0)
|
|
1264
1303
|
};
|
|
1265
1304
|
}
|
|
1266
|
-
class
|
|
1305
|
+
class kt extends Ct {
|
|
1267
1306
|
static isGraphOutputNode(e) {
|
|
1268
|
-
return e.type ===
|
|
1307
|
+
return e.type === De;
|
|
1269
1308
|
}
|
|
1270
|
-
type =
|
|
1309
|
+
type = De;
|
|
1271
1310
|
inputs = {
|
|
1272
1311
|
name: new J("Name", "Output"),
|
|
1273
1312
|
placeholder: new J("Value", void 0)
|
|
@@ -1279,7 +1318,7 @@ class Ct extends yt {
|
|
|
1279
1318
|
output: e
|
|
1280
1319
|
});
|
|
1281
1320
|
}
|
|
1282
|
-
const
|
|
1321
|
+
const Xo = [
|
|
1283
1322
|
"component",
|
|
1284
1323
|
"connectionCount",
|
|
1285
1324
|
"events",
|
|
@@ -1294,9 +1333,9 @@ const Do = [
|
|
|
1294
1333
|
"templateId",
|
|
1295
1334
|
"value"
|
|
1296
1335
|
];
|
|
1297
|
-
function
|
|
1298
|
-
return class extends
|
|
1299
|
-
type =
|
|
1336
|
+
function qo(n) {
|
|
1337
|
+
return class extends rt {
|
|
1338
|
+
type = tt(n);
|
|
1300
1339
|
get title() {
|
|
1301
1340
|
return this._title;
|
|
1302
1341
|
}
|
|
@@ -1318,18 +1357,18 @@ function Fo(n) {
|
|
|
1318
1357
|
if (!s.engine || typeof s.engine != "object")
|
|
1319
1358
|
throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);
|
|
1320
1359
|
const o = s.engine.getInputValues(this.subgraph);
|
|
1321
|
-
for (const
|
|
1322
|
-
o.set(
|
|
1323
|
-
const
|
|
1360
|
+
for (const r of this.subgraph.inputs)
|
|
1361
|
+
o.set(r.nodeInterfaceId, t[r.id]);
|
|
1362
|
+
const a = await s.engine.runGraph(
|
|
1324
1363
|
this.subgraph,
|
|
1325
1364
|
o,
|
|
1326
1365
|
s.globalValues
|
|
1327
1366
|
);
|
|
1328
|
-
s.engine.pause(),
|
|
1367
|
+
s.engine.pause(), nt(a, s.engine.editor), s.engine.resume();
|
|
1329
1368
|
const i = {};
|
|
1330
|
-
for (const
|
|
1331
|
-
i[
|
|
1332
|
-
return i._calculationResults =
|
|
1369
|
+
for (const r of this.subgraph.outputs)
|
|
1370
|
+
i[r.id] = a.get(r.nodeId)?.get("output");
|
|
1371
|
+
return i._calculationResults = a, this.lockCode || (i._code = this.renderCode({ inputs: t, ...s.globalValues })), this.updateOutputValues(i), i;
|
|
1333
1372
|
};
|
|
1334
1373
|
load(t) {
|
|
1335
1374
|
if (!this.subgraph) throw new Error("Cannot load a graph node without a graph");
|
|
@@ -1373,10 +1412,10 @@ function Fo(n) {
|
|
|
1373
1412
|
this.subgraph.outputs.some((s) => s.id === t) || this.removeOutput(t);
|
|
1374
1413
|
this.addInput(
|
|
1375
1414
|
"_code",
|
|
1376
|
-
new D("", []).use(V,
|
|
1415
|
+
new D("_code", []).use(V, K).use(de).setHidden(!0)
|
|
1377
1416
|
), this.addOutput(
|
|
1378
1417
|
"_code",
|
|
1379
|
-
new D("", []).use(V,
|
|
1418
|
+
new D("_code", []).use(V, K).use(de).setHidden(!0)
|
|
1380
1419
|
), this.addOutput("_calculationResults", new J("_calculationResults", void 0).setHidden(!0));
|
|
1381
1420
|
}
|
|
1382
1421
|
/**
|
|
@@ -1387,29 +1426,29 @@ function Fo(n) {
|
|
|
1387
1426
|
createProxyInterface(t, s) {
|
|
1388
1427
|
const o = new D(t.name, void 0);
|
|
1389
1428
|
return new Proxy(o, {
|
|
1390
|
-
get: (
|
|
1391
|
-
if (
|
|
1392
|
-
return Reflect.get(
|
|
1393
|
-
let
|
|
1394
|
-
s ?
|
|
1395
|
-
(C) =>
|
|
1396
|
-
)?.outputs.placeholder.id :
|
|
1397
|
-
(C) =>
|
|
1429
|
+
get: (a, i) => {
|
|
1430
|
+
if (Xo.includes(i) || i in a || typeof i == "string" && i.startsWith("__v_"))
|
|
1431
|
+
return Reflect.get(a, i);
|
|
1432
|
+
let r;
|
|
1433
|
+
s ? r = this.subgraph?.nodes.find(
|
|
1434
|
+
(C) => wt.isGraphInputNode(C) && C.graphInterfaceId === t.id
|
|
1435
|
+
)?.outputs.placeholder.id : r = this.subgraph?.nodes.find(
|
|
1436
|
+
(C) => kt.isGraphOutputNode(C) && C.graphInterfaceId === t.id
|
|
1398
1437
|
)?.inputs.placeholder.id;
|
|
1399
|
-
const l = this.subgraph?.connections.find((f) =>
|
|
1438
|
+
const l = this.subgraph?.connections.find((f) => r === (s ? f.from : f.to)?.id), d = s ? l?.to : l?.from;
|
|
1400
1439
|
if (d) return Reflect.get(d, i);
|
|
1401
1440
|
}
|
|
1402
1441
|
});
|
|
1403
1442
|
}
|
|
1404
1443
|
};
|
|
1405
1444
|
}
|
|
1406
|
-
function
|
|
1445
|
+
function Jo(n, e) {
|
|
1407
1446
|
return Object.fromEntries(Object.entries(n).filter(e));
|
|
1408
1447
|
}
|
|
1409
|
-
function
|
|
1448
|
+
function Qo(n, e) {
|
|
1410
1449
|
return Object.fromEntries(Object.entries(n).map(([t, s]) => [t, e(s)]));
|
|
1411
1450
|
}
|
|
1412
|
-
class Ne extends
|
|
1451
|
+
class Ne extends jt {
|
|
1413
1452
|
/** Create a new GraphTemplate from the nodes and connections inside the graph instance */
|
|
1414
1453
|
static fromGraph(e, t) {
|
|
1415
1454
|
return new Ne(e.save(), t);
|
|
@@ -1432,16 +1471,16 @@ class Ne extends Gt {
|
|
|
1432
1471
|
const N = t.get(h);
|
|
1433
1472
|
if (!N) throw new Error(`Unable to create graph from template: Could not map old id ${h} to new id`);
|
|
1434
1473
|
return N;
|
|
1435
|
-
},
|
|
1474
|
+
}, a = (h) => Qo(h, (N) => ({
|
|
1436
1475
|
id: s(N.id),
|
|
1437
1476
|
templateId: N.id,
|
|
1438
1477
|
value: N.value
|
|
1439
1478
|
})), i = this.nodes.map((h) => ({
|
|
1440
1479
|
...h,
|
|
1441
1480
|
id: s(h.id),
|
|
1442
|
-
inputs:
|
|
1443
|
-
outputs:
|
|
1444
|
-
})),
|
|
1481
|
+
inputs: a(h.inputs),
|
|
1482
|
+
outputs: a(h.outputs)
|
|
1483
|
+
})), r = this.connections.map((h) => ({
|
|
1445
1484
|
id: s(h.id),
|
|
1446
1485
|
from: o(h.from),
|
|
1447
1486
|
to: o(h.to)
|
|
@@ -1458,18 +1497,18 @@ class Ne extends Gt {
|
|
|
1458
1497
|
})), f = {
|
|
1459
1498
|
id: re(),
|
|
1460
1499
|
nodes: i,
|
|
1461
|
-
connections:
|
|
1500
|
+
connections: r,
|
|
1462
1501
|
inputs: l,
|
|
1463
1502
|
outputs: d
|
|
1464
1503
|
};
|
|
1465
1504
|
return e || (e = new Ie(this.editor)), e.load(f).forEach((h) => console.warn(h)), e.template = this, e;
|
|
1466
1505
|
}
|
|
1467
1506
|
}
|
|
1468
|
-
const
|
|
1469
|
-
function
|
|
1507
|
+
const Zo = (n) => !(n instanceof Ie);
|
|
1508
|
+
function es(n, e) {
|
|
1470
1509
|
return { switchGraph: (s) => {
|
|
1471
1510
|
let o;
|
|
1472
|
-
if (
|
|
1511
|
+
if (Zo(s))
|
|
1473
1512
|
o = new Ie(n.value), s.createGraph(o);
|
|
1474
1513
|
else {
|
|
1475
1514
|
if (s !== n.value.graph)
|
|
@@ -1481,16 +1520,16 @@ function Ko(n, e) {
|
|
|
1481
1520
|
e.value && e.value !== n.value.graph && e.value.destroy(), o.panning = o.panning ?? s.panning ?? { x: 0, y: 0 }, o.scaling = o.scaling ?? s.scaling ?? 1, o.selectedNodes = o.selectedNodes ?? [], o.sidebar = o.sidebar ?? { visible: !1, nodeId: "", optionName: "" }, e.value = o, o.code?.engine?.runOnce(null);
|
|
1482
1521
|
} };
|
|
1483
1522
|
}
|
|
1484
|
-
function
|
|
1523
|
+
function ts(n) {
|
|
1485
1524
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
1486
1525
|
}
|
|
1487
1526
|
var we = { exports: {} };
|
|
1488
|
-
var
|
|
1489
|
-
function
|
|
1490
|
-
return
|
|
1527
|
+
var ns = we.exports, Fe;
|
|
1528
|
+
function os() {
|
|
1529
|
+
return Fe || (Fe = 1, (function(n, e) {
|
|
1491
1530
|
(function(s, o) {
|
|
1492
1531
|
n.exports = o();
|
|
1493
|
-
})(
|
|
1532
|
+
})(ns, function() {
|
|
1494
1533
|
return (
|
|
1495
1534
|
/******/
|
|
1496
1535
|
(function() {
|
|
@@ -1498,16 +1537,16 @@ function Qo() {
|
|
|
1498
1537
|
/***/
|
|
1499
1538
|
686: (
|
|
1500
1539
|
/***/
|
|
1501
|
-
(function(
|
|
1502
|
-
|
|
1540
|
+
(function(a, i, r) {
|
|
1541
|
+
r.d(i, {
|
|
1503
1542
|
default: function() {
|
|
1504
1543
|
return (
|
|
1505
1544
|
/* binding */
|
|
1506
|
-
|
|
1545
|
+
M
|
|
1507
1546
|
);
|
|
1508
1547
|
}
|
|
1509
1548
|
});
|
|
1510
|
-
var l =
|
|
1549
|
+
var l = r(279), d = /* @__PURE__ */ r.n(l), f = r(370), C = /* @__PURE__ */ r.n(f), h = r(817), N = /* @__PURE__ */ r.n(h);
|
|
1511
1550
|
function v(g) {
|
|
1512
1551
|
try {
|
|
1513
1552
|
return document.execCommand(g);
|
|
@@ -1525,7 +1564,7 @@ function Qo() {
|
|
|
1525
1564
|
var x = window.pageYOffset || document.documentElement.scrollTop;
|
|
1526
1565
|
return _.style.top = "".concat(x, "px"), _.setAttribute("readonly", ""), _.value = g, _;
|
|
1527
1566
|
}
|
|
1528
|
-
var
|
|
1567
|
+
var $ = function(c, _) {
|
|
1529
1568
|
var x = y(c);
|
|
1530
1569
|
_.container.appendChild(x);
|
|
1531
1570
|
var I = N()(x);
|
|
@@ -1534,7 +1573,7 @@ function Qo() {
|
|
|
1534
1573
|
var _ = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
1535
1574
|
container: document.body
|
|
1536
1575
|
}, x = "";
|
|
1537
|
-
return typeof c == "string" ? x =
|
|
1576
|
+
return typeof c == "string" ? x = $(c, _) : c instanceof HTMLInputElement && !["text", "search", "url", "tel", "password"].includes(c?.type) ? x = $(c.value, _) : (x = N()(c), v("copy")), x;
|
|
1538
1577
|
}, S = T;
|
|
1539
1578
|
function Q(g) {
|
|
1540
1579
|
"@babel/helpers - typeof";
|
|
@@ -1545,7 +1584,7 @@ function Qo() {
|
|
|
1545
1584
|
}, Q(g);
|
|
1546
1585
|
}
|
|
1547
1586
|
var Z = function() {
|
|
1548
|
-
var c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ = c.action, x = _ === void 0 ? "copy" : _, I = c.container, E = c.target,
|
|
1587
|
+
var c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ = c.action, x = _ === void 0 ? "copy" : _, I = c.container, E = c.target, W = c.text;
|
|
1549
1588
|
if (x !== "copy" && x !== "cut")
|
|
1550
1589
|
throw new Error('Invalid "action" value, use either "copy" or "cut"');
|
|
1551
1590
|
if (E !== void 0)
|
|
@@ -1556,8 +1595,8 @@ function Qo() {
|
|
|
1556
1595
|
throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);
|
|
1557
1596
|
} else
|
|
1558
1597
|
throw new Error('Invalid "target" value, use a valid Element');
|
|
1559
|
-
if (
|
|
1560
|
-
return S(
|
|
1598
|
+
if (W)
|
|
1599
|
+
return S(W, {
|
|
1561
1600
|
container: I
|
|
1562
1601
|
});
|
|
1563
1602
|
if (E)
|
|
@@ -1565,26 +1604,26 @@ function Qo() {
|
|
|
1565
1604
|
container: I
|
|
1566
1605
|
});
|
|
1567
1606
|
}, pe = Z;
|
|
1568
|
-
function
|
|
1607
|
+
function X(g) {
|
|
1569
1608
|
"@babel/helpers - typeof";
|
|
1570
|
-
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ?
|
|
1609
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? X = function(_) {
|
|
1571
1610
|
return typeof _;
|
|
1572
|
-
} :
|
|
1611
|
+
} : X = function(_) {
|
|
1573
1612
|
return _ && typeof Symbol == "function" && _.constructor === Symbol && _ !== Symbol.prototype ? "symbol" : typeof _;
|
|
1574
|
-
},
|
|
1613
|
+
}, X(g);
|
|
1575
1614
|
}
|
|
1576
1615
|
function k(g, c) {
|
|
1577
1616
|
if (!(g instanceof c))
|
|
1578
1617
|
throw new TypeError("Cannot call a class as a function");
|
|
1579
1618
|
}
|
|
1580
|
-
function
|
|
1619
|
+
function j(g, c) {
|
|
1581
1620
|
for (var _ = 0; _ < c.length; _++) {
|
|
1582
1621
|
var x = c[_];
|
|
1583
1622
|
x.enumerable = x.enumerable || !1, x.configurable = !0, "value" in x && (x.writable = !0), Object.defineProperty(g, x.key, x);
|
|
1584
1623
|
}
|
|
1585
1624
|
}
|
|
1586
1625
|
function z(g, c, _) {
|
|
1587
|
-
return c &&
|
|
1626
|
+
return c && j(g.prototype, c), _ && j(g, _), g;
|
|
1588
1627
|
}
|
|
1589
1628
|
function ge(g, c) {
|
|
1590
1629
|
if (typeof c != "function" && c !== null)
|
|
@@ -1599,9 +1638,9 @@ function Qo() {
|
|
|
1599
1638
|
function Ee(g) {
|
|
1600
1639
|
var c = Te();
|
|
1601
1640
|
return function() {
|
|
1602
|
-
var x =
|
|
1641
|
+
var x = se(g), I;
|
|
1603
1642
|
if (c) {
|
|
1604
|
-
var E =
|
|
1643
|
+
var E = se(this).constructor;
|
|
1605
1644
|
I = Reflect.construct(x, arguments, E);
|
|
1606
1645
|
} else
|
|
1607
1646
|
I = x.apply(this, arguments);
|
|
@@ -1609,7 +1648,7 @@ function Qo() {
|
|
|
1609
1648
|
};
|
|
1610
1649
|
}
|
|
1611
1650
|
function be(g, c) {
|
|
1612
|
-
return c && (
|
|
1651
|
+
return c && (X(c) === "object" || typeof c == "function") ? c : ye(g);
|
|
1613
1652
|
}
|
|
1614
1653
|
function ye(g) {
|
|
1615
1654
|
if (g === void 0)
|
|
@@ -1626,12 +1665,12 @@ function Qo() {
|
|
|
1626
1665
|
return !1;
|
|
1627
1666
|
}
|
|
1628
1667
|
}
|
|
1629
|
-
function
|
|
1630
|
-
return
|
|
1668
|
+
function se(g) {
|
|
1669
|
+
return se = Object.setPrototypeOf ? Object.getPrototypeOf : function(_) {
|
|
1631
1670
|
return _.__proto__ || Object.getPrototypeOf(_);
|
|
1632
|
-
},
|
|
1671
|
+
}, se(g);
|
|
1633
1672
|
}
|
|
1634
|
-
function
|
|
1673
|
+
function le(g, c) {
|
|
1635
1674
|
var _ = "data-clipboard-".concat(g);
|
|
1636
1675
|
if (c.hasAttribute(_))
|
|
1637
1676
|
return c.getAttribute(_);
|
|
@@ -1647,7 +1686,7 @@ function Qo() {
|
|
|
1647
1686
|
key: "resolveOptions",
|
|
1648
1687
|
value: function() {
|
|
1649
1688
|
var I = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1650
|
-
this.action = typeof I.action == "function" ? I.action : this.defaultAction, this.target = typeof I.target == "function" ? I.target : this.defaultTarget, this.text = typeof I.text == "function" ? I.text : this.defaultText, this.container =
|
|
1689
|
+
this.action = typeof I.action == "function" ? I.action : this.defaultAction, this.target = typeof I.target == "function" ? I.target : this.defaultTarget, this.text = typeof I.text == "function" ? I.text : this.defaultText, this.container = X(I.container) === "object" ? I.container : document.body;
|
|
1651
1690
|
}
|
|
1652
1691
|
/**
|
|
1653
1692
|
* Adds a click event listener to the passed trigger.
|
|
@@ -1657,8 +1696,8 @@ function Qo() {
|
|
|
1657
1696
|
key: "listenClick",
|
|
1658
1697
|
value: function(I) {
|
|
1659
1698
|
var E = this;
|
|
1660
|
-
this.listener = C()(I, "click", function(
|
|
1661
|
-
return E.onClick(
|
|
1699
|
+
this.listener = C()(I, "click", function(W) {
|
|
1700
|
+
return E.onClick(W);
|
|
1662
1701
|
});
|
|
1663
1702
|
}
|
|
1664
1703
|
/**
|
|
@@ -1668,14 +1707,14 @@ function Qo() {
|
|
|
1668
1707
|
}, {
|
|
1669
1708
|
key: "onClick",
|
|
1670
1709
|
value: function(I) {
|
|
1671
|
-
var E = I.delegateTarget || I.currentTarget,
|
|
1672
|
-
action:
|
|
1710
|
+
var E = I.delegateTarget || I.currentTarget, W = this.action(E) || "copy", Ce = pe({
|
|
1711
|
+
action: W,
|
|
1673
1712
|
container: this.container,
|
|
1674
1713
|
target: this.target(E),
|
|
1675
1714
|
text: this.text(E)
|
|
1676
1715
|
});
|
|
1677
1716
|
this.emit(Ce ? "success" : "error", {
|
|
1678
|
-
action:
|
|
1717
|
+
action: W,
|
|
1679
1718
|
text: Ce,
|
|
1680
1719
|
trigger: E,
|
|
1681
1720
|
clearSelection: function() {
|
|
@@ -1690,7 +1729,7 @@ function Qo() {
|
|
|
1690
1729
|
}, {
|
|
1691
1730
|
key: "defaultAction",
|
|
1692
1731
|
value: function(I) {
|
|
1693
|
-
return
|
|
1732
|
+
return le("action", I);
|
|
1694
1733
|
}
|
|
1695
1734
|
/**
|
|
1696
1735
|
* Default `target` lookup function.
|
|
@@ -1699,7 +1738,7 @@ function Qo() {
|
|
|
1699
1738
|
}, {
|
|
1700
1739
|
key: "defaultTarget",
|
|
1701
1740
|
value: function(I) {
|
|
1702
|
-
var E =
|
|
1741
|
+
var E = le("target", I);
|
|
1703
1742
|
if (E)
|
|
1704
1743
|
return document.querySelector(E);
|
|
1705
1744
|
}
|
|
@@ -1716,7 +1755,7 @@ function Qo() {
|
|
|
1716
1755
|
* @param {Element} trigger
|
|
1717
1756
|
*/
|
|
1718
1757
|
value: function(I) {
|
|
1719
|
-
return
|
|
1758
|
+
return le("text", I);
|
|
1720
1759
|
}
|
|
1721
1760
|
/**
|
|
1722
1761
|
* Destroy lifecycle.
|
|
@@ -1752,23 +1791,23 @@ function Qo() {
|
|
|
1752
1791
|
}, {
|
|
1753
1792
|
key: "isSupported",
|
|
1754
1793
|
value: function() {
|
|
1755
|
-
var I = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ["copy", "cut"], E = typeof I == "string" ? [I] : I,
|
|
1794
|
+
var I = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ["copy", "cut"], E = typeof I == "string" ? [I] : I, W = !!document.queryCommandSupported;
|
|
1756
1795
|
return E.forEach(function(Ce) {
|
|
1757
|
-
|
|
1758
|
-
}),
|
|
1796
|
+
W = W && !!document.queryCommandSupported(Ce);
|
|
1797
|
+
}), W;
|
|
1759
1798
|
}
|
|
1760
1799
|
}]), _;
|
|
1761
|
-
})(d()),
|
|
1800
|
+
})(d()), M = _e;
|
|
1762
1801
|
})
|
|
1763
1802
|
),
|
|
1764
1803
|
/***/
|
|
1765
1804
|
828: (
|
|
1766
1805
|
/***/
|
|
1767
|
-
(function(
|
|
1806
|
+
(function(a) {
|
|
1768
1807
|
var i = 9;
|
|
1769
1808
|
if (typeof Element < "u" && !Element.prototype.matches) {
|
|
1770
|
-
var
|
|
1771
|
-
|
|
1809
|
+
var r = Element.prototype;
|
|
1810
|
+
r.matches = r.matchesSelector || r.mozMatchesSelector || r.msMatchesSelector || r.oMatchesSelector || r.webkitMatchesSelector;
|
|
1772
1811
|
}
|
|
1773
1812
|
function l(d, f) {
|
|
1774
1813
|
for (; d && d.nodeType !== i; ) {
|
|
@@ -1777,14 +1816,14 @@ function Qo() {
|
|
|
1777
1816
|
d = d.parentNode;
|
|
1778
1817
|
}
|
|
1779
1818
|
}
|
|
1780
|
-
|
|
1819
|
+
a.exports = l;
|
|
1781
1820
|
})
|
|
1782
1821
|
),
|
|
1783
1822
|
/***/
|
|
1784
1823
|
438: (
|
|
1785
1824
|
/***/
|
|
1786
|
-
(function(
|
|
1787
|
-
var l =
|
|
1825
|
+
(function(a, i, r) {
|
|
1826
|
+
var l = r(828);
|
|
1788
1827
|
function d(h, N, v, w, u) {
|
|
1789
1828
|
var y = C.apply(this, arguments);
|
|
1790
1829
|
return h.addEventListener(v, y, u), {
|
|
@@ -1803,22 +1842,22 @@ function Qo() {
|
|
|
1803
1842
|
u.delegateTarget = l(u.target, N), u.delegateTarget && w.call(h, u);
|
|
1804
1843
|
};
|
|
1805
1844
|
}
|
|
1806
|
-
|
|
1845
|
+
a.exports = f;
|
|
1807
1846
|
})
|
|
1808
1847
|
),
|
|
1809
1848
|
/***/
|
|
1810
1849
|
879: (
|
|
1811
1850
|
/***/
|
|
1812
|
-
(function(
|
|
1813
|
-
i.node = function(
|
|
1814
|
-
return
|
|
1815
|
-
}, i.nodeList = function(
|
|
1816
|
-
var l = Object.prototype.toString.call(
|
|
1817
|
-
return
|
|
1818
|
-
}, i.string = function(
|
|
1819
|
-
return typeof
|
|
1820
|
-
}, i.fn = function(
|
|
1821
|
-
var l = Object.prototype.toString.call(
|
|
1851
|
+
(function(a, i) {
|
|
1852
|
+
i.node = function(r) {
|
|
1853
|
+
return r !== void 0 && r instanceof HTMLElement && r.nodeType === 1;
|
|
1854
|
+
}, i.nodeList = function(r) {
|
|
1855
|
+
var l = Object.prototype.toString.call(r);
|
|
1856
|
+
return r !== void 0 && (l === "[object NodeList]" || l === "[object HTMLCollection]") && "length" in r && (r.length === 0 || i.node(r[0]));
|
|
1857
|
+
}, i.string = function(r) {
|
|
1858
|
+
return typeof r == "string" || r instanceof String;
|
|
1859
|
+
}, i.fn = function(r) {
|
|
1860
|
+
var l = Object.prototype.toString.call(r);
|
|
1822
1861
|
return l === "[object Function]";
|
|
1823
1862
|
};
|
|
1824
1863
|
})
|
|
@@ -1826,8 +1865,8 @@ function Qo() {
|
|
|
1826
1865
|
/***/
|
|
1827
1866
|
370: (
|
|
1828
1867
|
/***/
|
|
1829
|
-
(function(
|
|
1830
|
-
var l =
|
|
1868
|
+
(function(a, i, r) {
|
|
1869
|
+
var l = r(879), d = r(438);
|
|
1831
1870
|
function f(v, w, u) {
|
|
1832
1871
|
if (!v && !w && !u)
|
|
1833
1872
|
throw new Error("Missing required arguments");
|
|
@@ -1864,73 +1903,73 @@ function Qo() {
|
|
|
1864
1903
|
function N(v, w, u) {
|
|
1865
1904
|
return d(document.body, v, w, u);
|
|
1866
1905
|
}
|
|
1867
|
-
|
|
1906
|
+
a.exports = f;
|
|
1868
1907
|
})
|
|
1869
1908
|
),
|
|
1870
1909
|
/***/
|
|
1871
1910
|
817: (
|
|
1872
1911
|
/***/
|
|
1873
|
-
(function(
|
|
1874
|
-
function i(
|
|
1912
|
+
(function(a) {
|
|
1913
|
+
function i(r) {
|
|
1875
1914
|
var l;
|
|
1876
|
-
if (
|
|
1877
|
-
|
|
1878
|
-
else if (
|
|
1879
|
-
var d =
|
|
1880
|
-
d ||
|
|
1915
|
+
if (r.nodeName === "SELECT")
|
|
1916
|
+
r.focus(), l = r.value;
|
|
1917
|
+
else if (r.nodeName === "INPUT" || r.nodeName === "TEXTAREA") {
|
|
1918
|
+
var d = r.hasAttribute("readonly");
|
|
1919
|
+
d || r.setAttribute("readonly", ""), r.select(), r.setSelectionRange(0, r.value.length), d || r.removeAttribute("readonly"), l = r.value;
|
|
1881
1920
|
} else {
|
|
1882
|
-
|
|
1921
|
+
r.hasAttribute("contenteditable") && r.focus();
|
|
1883
1922
|
var f = window.getSelection(), C = document.createRange();
|
|
1884
|
-
C.selectNodeContents(
|
|
1923
|
+
C.selectNodeContents(r), f.removeAllRanges(), f.addRange(C), l = f.toString();
|
|
1885
1924
|
}
|
|
1886
1925
|
return l;
|
|
1887
1926
|
}
|
|
1888
|
-
|
|
1927
|
+
a.exports = i;
|
|
1889
1928
|
})
|
|
1890
1929
|
),
|
|
1891
1930
|
/***/
|
|
1892
1931
|
279: (
|
|
1893
1932
|
/***/
|
|
1894
|
-
(function(
|
|
1933
|
+
(function(a) {
|
|
1895
1934
|
function i() {
|
|
1896
1935
|
}
|
|
1897
1936
|
i.prototype = {
|
|
1898
|
-
on: function(
|
|
1937
|
+
on: function(r, l, d) {
|
|
1899
1938
|
var f = this.e || (this.e = {});
|
|
1900
|
-
return (f[
|
|
1939
|
+
return (f[r] || (f[r] = [])).push({
|
|
1901
1940
|
fn: l,
|
|
1902
1941
|
ctx: d
|
|
1903
1942
|
}), this;
|
|
1904
1943
|
},
|
|
1905
|
-
once: function(
|
|
1944
|
+
once: function(r, l, d) {
|
|
1906
1945
|
var f = this;
|
|
1907
1946
|
function C() {
|
|
1908
|
-
f.off(
|
|
1947
|
+
f.off(r, C), l.apply(d, arguments);
|
|
1909
1948
|
}
|
|
1910
|
-
return C._ = l, this.on(
|
|
1949
|
+
return C._ = l, this.on(r, C, d);
|
|
1911
1950
|
},
|
|
1912
|
-
emit: function(
|
|
1913
|
-
var l = [].slice.call(arguments, 1), d = ((this.e || (this.e = {}))[
|
|
1951
|
+
emit: function(r) {
|
|
1952
|
+
var l = [].slice.call(arguments, 1), d = ((this.e || (this.e = {}))[r] || []).slice(), f = 0, C = d.length;
|
|
1914
1953
|
for (f; f < C; f++)
|
|
1915
1954
|
d[f].fn.apply(d[f].ctx, l);
|
|
1916
1955
|
return this;
|
|
1917
1956
|
},
|
|
1918
|
-
off: function(
|
|
1919
|
-
var d = this.e || (this.e = {}), f = d[
|
|
1957
|
+
off: function(r, l) {
|
|
1958
|
+
var d = this.e || (this.e = {}), f = d[r], C = [];
|
|
1920
1959
|
if (f && l)
|
|
1921
1960
|
for (var h = 0, N = f.length; h < N; h++)
|
|
1922
1961
|
f[h].fn !== l && f[h].fn._ !== l && C.push(f[h]);
|
|
1923
|
-
return C.length ? d[
|
|
1962
|
+
return C.length ? d[r] = C : delete d[r], this;
|
|
1924
1963
|
}
|
|
1925
|
-
},
|
|
1964
|
+
}, a.exports = i, a.exports.TinyEmitter = i;
|
|
1926
1965
|
})
|
|
1927
1966
|
)
|
|
1928
1967
|
/******/
|
|
1929
1968
|
}, s = {};
|
|
1930
|
-
function o(
|
|
1931
|
-
if (s[
|
|
1932
|
-
return s[
|
|
1933
|
-
var i = s[
|
|
1969
|
+
function o(a) {
|
|
1970
|
+
if (s[a])
|
|
1971
|
+
return s[a].exports;
|
|
1972
|
+
var i = s[a] = {
|
|
1934
1973
|
/******/
|
|
1935
1974
|
// no module.id needed
|
|
1936
1975
|
/******/
|
|
@@ -1939,31 +1978,31 @@ function Qo() {
|
|
|
1939
1978
|
exports: {}
|
|
1940
1979
|
/******/
|
|
1941
1980
|
};
|
|
1942
|
-
return t[
|
|
1981
|
+
return t[a](i, i.exports, o), i.exports;
|
|
1943
1982
|
}
|
|
1944
1983
|
return (function() {
|
|
1945
|
-
o.n = function(
|
|
1946
|
-
var i =
|
|
1984
|
+
o.n = function(a) {
|
|
1985
|
+
var i = a && a.__esModule ? (
|
|
1947
1986
|
/******/
|
|
1948
1987
|
function() {
|
|
1949
|
-
return
|
|
1988
|
+
return a.default;
|
|
1950
1989
|
}
|
|
1951
1990
|
) : (
|
|
1952
1991
|
/******/
|
|
1953
1992
|
function() {
|
|
1954
|
-
return
|
|
1993
|
+
return a;
|
|
1955
1994
|
}
|
|
1956
1995
|
);
|
|
1957
1996
|
return o.d(i, { a: i }), i;
|
|
1958
1997
|
};
|
|
1959
1998
|
})(), (function() {
|
|
1960
|
-
o.d = function(
|
|
1961
|
-
for (var
|
|
1962
|
-
o.o(i,
|
|
1999
|
+
o.d = function(a, i) {
|
|
2000
|
+
for (var r in i)
|
|
2001
|
+
o.o(i, r) && !o.o(a, r) && Object.defineProperty(a, r, { enumerable: !0, get: i[r] });
|
|
1963
2002
|
};
|
|
1964
2003
|
})(), (function() {
|
|
1965
|
-
o.o = function(
|
|
1966
|
-
return Object.prototype.hasOwnProperty.call(
|
|
2004
|
+
o.o = function(a, i) {
|
|
2005
|
+
return Object.prototype.hasOwnProperty.call(a, i);
|
|
1967
2006
|
};
|
|
1968
2007
|
})(), o(686);
|
|
1969
2008
|
})().default
|
|
@@ -1971,75 +2010,75 @@ function Qo() {
|
|
|
1971
2010
|
});
|
|
1972
2011
|
})(we)), we.exports;
|
|
1973
2012
|
}
|
|
1974
|
-
var
|
|
1975
|
-
const
|
|
2013
|
+
var ss = os();
|
|
2014
|
+
const as = /* @__PURE__ */ ts(ss), rs = (n) => ({
|
|
1976
2015
|
toClipboard(e, t) {
|
|
1977
2016
|
return new Promise((s, o) => {
|
|
1978
|
-
const
|
|
2017
|
+
const a = document.createElement("button"), i = new as(a, {
|
|
1979
2018
|
text: () => e,
|
|
1980
2019
|
action: () => "copy",
|
|
1981
2020
|
container: t !== void 0 ? t : document.body
|
|
1982
2021
|
});
|
|
1983
|
-
i.on("success", (
|
|
1984
|
-
i.destroy(), s(
|
|
1985
|
-
}), i.on("error", (
|
|
1986
|
-
i.destroy(), o(
|
|
1987
|
-
}), document.body.appendChild(
|
|
2022
|
+
i.on("success", (r) => {
|
|
2023
|
+
i.destroy(), s(r);
|
|
2024
|
+
}), i.on("error", (r) => {
|
|
2025
|
+
i.destroy(), o(r);
|
|
2026
|
+
}), document.body.appendChild(a), a.click(), document.body.removeChild(a);
|
|
1988
2027
|
});
|
|
1989
2028
|
}
|
|
1990
|
-
}),
|
|
2029
|
+
}), is = {
|
|
1991
2030
|
key: 0,
|
|
1992
2031
|
class: "baklava-button"
|
|
1993
|
-
},
|
|
2032
|
+
}, ls = /* @__PURE__ */ F({
|
|
1994
2033
|
__name: "CopyToClipboard",
|
|
1995
2034
|
props: { text: String },
|
|
1996
2035
|
setup(n) {
|
|
1997
|
-
const { toClipboard: e } =
|
|
2036
|
+
const { toClipboard: e } = rs(), s = $e(n, "text"), o = B(!1), a = async () => {
|
|
1998
2037
|
try {
|
|
1999
2038
|
await e(s.value), o.value = !0, setTimeout(() => o.value = !1, 1500), console.log("Copied to clipboard");
|
|
2000
2039
|
} catch (i) {
|
|
2001
2040
|
console.error(i);
|
|
2002
2041
|
}
|
|
2003
2042
|
};
|
|
2004
|
-
return (i,
|
|
2005
|
-
o.value ? (p(), b("button",
|
|
2006
|
-
G(O(
|
|
2043
|
+
return (i, r) => (p(), b("div", null, [
|
|
2044
|
+
o.value ? (p(), b("button", is, [
|
|
2045
|
+
G(O(Gn))
|
|
2007
2046
|
])) : (p(), b("button", {
|
|
2008
2047
|
key: 1,
|
|
2009
|
-
onClick:
|
|
2048
|
+
onClick: a,
|
|
2010
2049
|
class: "baklava-button"
|
|
2011
2050
|
}, [
|
|
2012
|
-
G(O(
|
|
2051
|
+
G(O(zn))
|
|
2013
2052
|
]))
|
|
2014
2053
|
]));
|
|
2015
2054
|
}
|
|
2016
|
-
}),
|
|
2055
|
+
}), us = { class: "code-editor" }, ds = { class: "code-buttons" }, Ca = /* @__PURE__ */ F({
|
|
2017
2056
|
__name: "CodeEditor",
|
|
2018
|
-
props: /* @__PURE__ */
|
|
2057
|
+
props: /* @__PURE__ */ He({
|
|
2019
2058
|
locked: { type: Boolean },
|
|
2020
2059
|
extensions: {}
|
|
2021
2060
|
}, {
|
|
2022
2061
|
modelValue: { required: !0, type: String },
|
|
2023
2062
|
modelModifiers: {}
|
|
2024
2063
|
}),
|
|
2025
|
-
emits: /* @__PURE__ */
|
|
2064
|
+
emits: /* @__PURE__ */ He(["update:locked"], ["update:modelValue"]),
|
|
2026
2065
|
setup(n, { emit: e }) {
|
|
2027
|
-
const t =
|
|
2028
|
-
return (
|
|
2029
|
-
const
|
|
2030
|
-
return p(), b("div",
|
|
2031
|
-
m("div",
|
|
2066
|
+
const t = Nt(n, "modelValue"), s = e, o = (a) => s("update:locked", a);
|
|
2067
|
+
return (a, i) => {
|
|
2068
|
+
const r = qe("codemirror");
|
|
2069
|
+
return p(), b("div", us, [
|
|
2070
|
+
m("div", ds, [
|
|
2032
2071
|
n.locked ? (p(), b("button", {
|
|
2033
2072
|
key: 0,
|
|
2034
2073
|
class: "baklava-button",
|
|
2035
2074
|
title: "The code is locked.",
|
|
2036
2075
|
onClick: i[0] || (i[0] = (l) => o(!1))
|
|
2037
2076
|
}, [
|
|
2038
|
-
G(O(
|
|
2039
|
-
])) :
|
|
2040
|
-
G(
|
|
2077
|
+
G(O(mt))
|
|
2078
|
+
])) : L("", !0),
|
|
2079
|
+
G(ls, { text: n.modelValue }, null, 8, ["text"])
|
|
2041
2080
|
]),
|
|
2042
|
-
G(
|
|
2081
|
+
G(r, {
|
|
2043
2082
|
modelValue: t.value,
|
|
2044
2083
|
"onUpdate:modelValue": i[1] || (i[1] = (l) => t.value = l),
|
|
2045
2084
|
extensions: n.extensions,
|
|
@@ -2050,32 +2089,32 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2050
2089
|
]);
|
|
2051
2090
|
};
|
|
2052
2091
|
}
|
|
2053
|
-
}),
|
|
2092
|
+
}), wa = /* @__PURE__ */ F({
|
|
2054
2093
|
__name: "CodeGraphEditor",
|
|
2055
2094
|
props: {
|
|
2056
2095
|
viewModel: {}
|
|
2057
2096
|
},
|
|
2058
2097
|
setup(n) {
|
|
2059
|
-
const t =
|
|
2098
|
+
const t = $e(n, "viewModel"), s = (o) => o.events.update.emit(null);
|
|
2060
2099
|
return Se(() => {
|
|
2061
2100
|
t.value.subscribe && t.value.subscribe(), t.value.engine?.start();
|
|
2062
|
-
}),
|
|
2101
|
+
}), Je(() => {
|
|
2063
2102
|
t.value.unsubscribe && t.value.unsubscribe(), t.value.engine?.stop();
|
|
2064
|
-
}),
|
|
2065
|
-
|
|
2066
|
-
}), (o,
|
|
2103
|
+
}), Qe(t, (o, a) => {
|
|
2104
|
+
a && a.unsubscribe(), o && o.subscribe();
|
|
2105
|
+
}), (o, a) => (p(), H(O(Jt), { viewModel: t.value }, {
|
|
2067
2106
|
palette: ee(() => [
|
|
2068
|
-
G(O(
|
|
2107
|
+
G(O(Hs))
|
|
2069
2108
|
]),
|
|
2070
2109
|
node: ee((i) => [
|
|
2071
|
-
G(O(
|
|
2072
|
-
onUpdate: (
|
|
2110
|
+
G(O(ws), Ot(i, {
|
|
2111
|
+
onUpdate: (r) => s(i.node)
|
|
2073
2112
|
}), null, 16, ["onUpdate"])
|
|
2074
2113
|
]),
|
|
2075
2114
|
sidebar: ee((i) => [
|
|
2076
|
-
G(O(
|
|
2077
|
-
codeEditor: ee(({ node:
|
|
2078
|
-
q(o.$slots, "sidebarCodeEditor", { node:
|
|
2115
|
+
G(O(Rs), Et(Tt(i)), {
|
|
2116
|
+
codeEditor: ee(({ node: r }) => [
|
|
2117
|
+
q(o.$slots, "sidebarCodeEditor", { node: r })
|
|
2079
2118
|
]),
|
|
2080
2119
|
_: 3
|
|
2081
2120
|
}, 16)
|
|
@@ -2083,27 +2122,27 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2083
2122
|
_: 3
|
|
2084
2123
|
}, 8, ["viewModel"]));
|
|
2085
2124
|
}
|
|
2086
|
-
}),
|
|
2125
|
+
}), cs = { class: "code-graph-info" }, ka = /* @__PURE__ */ F({
|
|
2087
2126
|
__name: "CodeGraphInfo",
|
|
2088
2127
|
props: {
|
|
2089
2128
|
viewModel: {}
|
|
2090
2129
|
},
|
|
2091
2130
|
setup(n) {
|
|
2092
|
-
return (e, t) => (p(), b("div",
|
|
2093
|
-
m("div", null, "Editor graph: " +
|
|
2094
|
-
m("div", null, "Displayed graph: " +
|
|
2095
|
-
m("div", null, "Graphs: " +
|
|
2096
|
-
m("div", null, "Graph templates: " +
|
|
2097
|
-
m("div", null, "Engine status: " +
|
|
2131
|
+
return (e, t) => (p(), b("div", cs, [
|
|
2132
|
+
m("div", null, "Editor graph: " + P(n.viewModel.editor.graph.shortId), 1),
|
|
2133
|
+
m("div", null, "Displayed graph: " + P(n.viewModel.displayedGraph.shortId), 1),
|
|
2134
|
+
m("div", null, "Graphs: " + P(n.viewModel.editor.graphIds), 1),
|
|
2135
|
+
m("div", null, "Graph templates: " + P(n.viewModel.editor.graphTemplateIds), 1),
|
|
2136
|
+
m("div", null, "Engine status: " + P(n.viewModel.engine?.status), 1)
|
|
2098
2137
|
]));
|
|
2099
2138
|
}
|
|
2100
|
-
}),
|
|
2139
|
+
}), ps = ["id", "data-node-type"], hs = {
|
|
2101
2140
|
class: "__title-label",
|
|
2102
2141
|
style: { "flex-grow": "1" }
|
|
2103
|
-
},
|
|
2142
|
+
}, fs = { key: 0 }, ms = {
|
|
2104
2143
|
class: "__menu",
|
|
2105
2144
|
style: { display: "flex" }
|
|
2106
|
-
},
|
|
2145
|
+
}, vs = { class: "__outputs" }, gs = { key: 0 }, bs = ["id", "title"], ys = { class: "__inputs" }, _s = { key: 0 }, Cs = ["id", "title"], ws = /* @__PURE__ */ F({
|
|
2107
2146
|
__name: "CodeGraphNode",
|
|
2108
2147
|
props: {
|
|
2109
2148
|
node: {},
|
|
@@ -2112,43 +2151,43 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2112
2151
|
},
|
|
2113
2152
|
emits: ["select", "start-drag", "update"],
|
|
2114
2153
|
setup(n, { emit: e }) {
|
|
2115
|
-
const t =
|
|
2154
|
+
const t = Me.ContextMenu, s = Me.NodeInterface, o = n, a = A(() => o.node), i = e, { viewModel: r } = me(), { graph: l, switchGraph: d } = Ge(), f = B(null), C = B(!1), h = B(""), N = B(null), v = B(!1);
|
|
2116
2155
|
let w = 0, u = 0;
|
|
2117
|
-
const y =
|
|
2118
|
-
const
|
|
2156
|
+
const y = B(!1), $ = A(() => {
|
|
2157
|
+
const M = [
|
|
2119
2158
|
{ value: "edit", label: "Edit" },
|
|
2120
2159
|
{ value: "rename", label: "Rename" },
|
|
2121
2160
|
{ value: "delete", label: "Delete" }
|
|
2122
2161
|
];
|
|
2123
|
-
return o.node.type.startsWith(
|
|
2124
|
-
}), T =
|
|
2162
|
+
return o.node.type.startsWith(Lt) && M.push({ value: "editSubgraph", label: "Edit Subgraph" }), M;
|
|
2163
|
+
}), T = A(() => ({
|
|
2125
2164
|
"--selected": o.selected,
|
|
2126
2165
|
"--dragging": o.dragging,
|
|
2127
2166
|
"--two-column": !!o.node.twoColumn,
|
|
2128
|
-
"--hidden":
|
|
2129
|
-
})), S =
|
|
2130
|
-
"--reverse-y": o.node.reverseY ??
|
|
2131
|
-
})), Q =
|
|
2167
|
+
"--hidden": a.value.state?.hidden
|
|
2168
|
+
})), S = A(() => ({
|
|
2169
|
+
"--reverse-y": o.node.reverseY ?? r.value.settings.nodes.reverseY
|
|
2170
|
+
})), Q = A(() => ({
|
|
2132
2171
|
top: `${o.node.position?.y ?? 0}px`,
|
|
2133
2172
|
left: `${o.node.position?.x ?? 0}px`,
|
|
2134
|
-
"--width": `${o.node.width ??
|
|
2135
|
-
})), Z =
|
|
2173
|
+
"--width": `${o.node.width ?? r.value.settings.nodes.defaultWidth}px`
|
|
2174
|
+
})), Z = A(() => Object.values(o.node.inputs).filter((M) => !M.hidden)), pe = A(() => Object.values(o.node.outputs).filter((M) => !M.hidden)), X = () => {
|
|
2136
2175
|
i("select");
|
|
2137
|
-
}, k = (
|
|
2138
|
-
o.selected ||
|
|
2139
|
-
},
|
|
2176
|
+
}, k = (M) => {
|
|
2177
|
+
o.selected || X(), i("start-drag", M);
|
|
2178
|
+
}, j = () => {
|
|
2140
2179
|
y.value = !0;
|
|
2141
2180
|
}, z = () => {
|
|
2142
|
-
const
|
|
2143
|
-
|
|
2181
|
+
const M = r.value.displayedGraph.sidebar;
|
|
2182
|
+
M.nodeId = "", M.visible = !1;
|
|
2144
2183
|
}, ge = () => {
|
|
2145
|
-
const
|
|
2146
|
-
|
|
2184
|
+
const M = r.value.displayedGraph.sidebar;
|
|
2185
|
+
M.nodeId = o.node.id, M.visible = !0;
|
|
2147
2186
|
}, he = () => {
|
|
2148
|
-
const
|
|
2149
|
-
|
|
2150
|
-
}, Ee = async (
|
|
2151
|
-
switch (
|
|
2187
|
+
const M = r.value.displayedGraph.sidebar;
|
|
2188
|
+
M.nodeId = o.node.id;
|
|
2189
|
+
}, Ee = async (M) => {
|
|
2190
|
+
switch (M) {
|
|
2152
2191
|
case "edit":
|
|
2153
2192
|
ge();
|
|
2154
2193
|
break;
|
|
@@ -2156,59 +2195,59 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2156
2195
|
l.value.removeNode(o.node);
|
|
2157
2196
|
break;
|
|
2158
2197
|
case "rename":
|
|
2159
|
-
h.value = o.node.title, C.value = !0, await
|
|
2198
|
+
h.value = o.node.title, C.value = !0, await Mt(), N.value?.focus();
|
|
2160
2199
|
break;
|
|
2161
2200
|
case "editSubgraph":
|
|
2162
2201
|
d(o.node.template);
|
|
2163
2202
|
break;
|
|
2164
2203
|
}
|
|
2165
2204
|
}, be = () => {
|
|
2166
|
-
|
|
2205
|
+
a.value.title = h.value, C.value = !1;
|
|
2167
2206
|
}, ye = () => {
|
|
2168
|
-
f.value &&
|
|
2169
|
-
}, Te = (
|
|
2170
|
-
v.value = !0, w = o.node.width, u =
|
|
2171
|
-
},
|
|
2172
|
-
|
|
2173
|
-
},
|
|
2207
|
+
f.value && r.value.hooks.renderNode.execute({ node: o.node, el: f.value });
|
|
2208
|
+
}, Te = (M) => {
|
|
2209
|
+
v.value = !0, w = o.node.width, u = M.clientX, M.preventDefault();
|
|
2210
|
+
}, se = (M) => {
|
|
2211
|
+
a.value.state && (a.value.state.integrated = M, i("update"));
|
|
2212
|
+
}, le = (M) => {
|
|
2174
2213
|
if (!v.value) return;
|
|
2175
|
-
const g =
|
|
2176
|
-
|
|
2214
|
+
const g = M.clientX - u, c = w + g / l.value.scaling, _ = r.value.settings.nodes.minWidth, x = r.value.settings.nodes.maxWidth;
|
|
2215
|
+
a.value.width = Math.max(_, Math.min(x, c));
|
|
2177
2216
|
}, _e = () => {
|
|
2178
2217
|
v.value = !1;
|
|
2179
2218
|
};
|
|
2180
2219
|
return Se(() => {
|
|
2181
|
-
ye(), window.addEventListener("mousemove",
|
|
2182
|
-
}),
|
|
2183
|
-
window.removeEventListener("mousemove",
|
|
2184
|
-
}), (
|
|
2185
|
-
id:
|
|
2220
|
+
ye(), window.addEventListener("mousemove", le), window.addEventListener("mouseup", _e);
|
|
2221
|
+
}), Ze(ye), Je(() => {
|
|
2222
|
+
window.removeEventListener("mousemove", le), window.removeEventListener("mouseup", _e);
|
|
2223
|
+
}), (M, g) => (p(), b("div", {
|
|
2224
|
+
id: a.value.id,
|
|
2186
2225
|
ref_key: "el",
|
|
2187
2226
|
ref: f,
|
|
2188
|
-
class:
|
|
2189
|
-
"data-node-type":
|
|
2190
|
-
style:
|
|
2191
|
-
onPointerdown:
|
|
2227
|
+
class: oe([T.value, "baklava-node"]),
|
|
2228
|
+
"data-node-type": a.value.type,
|
|
2229
|
+
style: Ae(Q.value),
|
|
2230
|
+
onPointerdown: X
|
|
2192
2231
|
}, [
|
|
2193
|
-
O(
|
|
2232
|
+
O(r).settings.nodes.resizable ? (p(), b("div", {
|
|
2194
2233
|
key: 0,
|
|
2195
2234
|
class: "__resize-handle",
|
|
2196
2235
|
onMousedown: Te
|
|
2197
|
-
}, null, 32)) :
|
|
2236
|
+
}, null, 32)) : L("", !0),
|
|
2198
2237
|
m("div", {
|
|
2199
2238
|
class: "__title",
|
|
2200
|
-
onPointerdown:
|
|
2201
|
-
onContextmenu:
|
|
2239
|
+
onPointerdown: ue(k, ["self", "stop"]),
|
|
2240
|
+
onContextmenu: ue(j, ["prevent"])
|
|
2202
2241
|
}, [
|
|
2203
|
-
|
|
2242
|
+
a.value.inputs._code ? (p(), H(O(Ye), {
|
|
2204
2243
|
key: 0,
|
|
2205
|
-
node:
|
|
2206
|
-
intf:
|
|
2207
|
-
title:
|
|
2244
|
+
node: a.value,
|
|
2245
|
+
intf: a.value.inputs._code,
|
|
2246
|
+
title: a.value.inputs._code.value,
|
|
2208
2247
|
class: "--input",
|
|
2209
2248
|
"data-interface-type": "node",
|
|
2210
2249
|
style: { "flex-grow": "0" }
|
|
2211
|
-
}, null, 8, ["node", "intf", "title"])) :
|
|
2250
|
+
}, null, 8, ["node", "intf", "title"])) : L("", !0),
|
|
2212
2251
|
C.value ? ke((p(), b("input", {
|
|
2213
2252
|
key: 2,
|
|
2214
2253
|
ref_key: "renameInputEl",
|
|
@@ -2223,75 +2262,75 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2223
2262
|
}, null, 544)), [
|
|
2224
2263
|
[xe, h.value]
|
|
2225
2264
|
]) : (p(), b(U, { key: 1 }, [
|
|
2226
|
-
m("div",
|
|
2227
|
-
|
|
2228
|
-
|
|
2265
|
+
m("div", hs, [
|
|
2266
|
+
a.value.idx > -1 ? (p(), b("span", fs, P(a.value.idx + 1) + " > ", 1)) : L("", !0),
|
|
2267
|
+
et(P(a.value.title), 1)
|
|
2229
2268
|
]),
|
|
2230
|
-
m("div",
|
|
2231
|
-
|
|
2232
|
-
|
|
2269
|
+
m("div", ms, [
|
|
2270
|
+
a.value.isCodeNode ? (p(), b(U, { key: 0 }, [
|
|
2271
|
+
a.value.state.lockCode ? (p(), H(O(mt), {
|
|
2233
2272
|
key: 0,
|
|
2234
2273
|
class: "--clickable mx-1",
|
|
2235
|
-
onClick: g[0] || (g[0] = (c) =>
|
|
2236
|
-
})) :
|
|
2237
|
-
|
|
2274
|
+
onClick: g[0] || (g[0] = (c) => a.value.lockCode = !1)
|
|
2275
|
+
})) : L("", !0),
|
|
2276
|
+
a.value.state.integrated ? (p(), H(O(Pn), {
|
|
2238
2277
|
key: 1,
|
|
2239
2278
|
class: "--clickable mx-1",
|
|
2240
|
-
onClick: g[1] || (g[1] = (c) =>
|
|
2241
|
-
})) : (p(),
|
|
2279
|
+
onClick: g[1] || (g[1] = (c) => se(!1))
|
|
2280
|
+
})) : (p(), H(O(jo), {
|
|
2242
2281
|
key: 2,
|
|
2243
2282
|
class: "--clickable mx-1",
|
|
2244
|
-
onClick: g[2] || (g[2] = (c) =>
|
|
2283
|
+
onClick: g[2] || (g[2] = (c) => se(!0))
|
|
2245
2284
|
})),
|
|
2246
|
-
!O(
|
|
2285
|
+
!O(r).displayedGraph.sidebar.visible && O(r).displayedGraph.sidebar.nodeId !== a.value.id ? (p(), H(O(ho), {
|
|
2247
2286
|
key: 3,
|
|
2248
2287
|
class: "--clickable mx-1",
|
|
2249
2288
|
onClick: ge
|
|
2250
|
-
})) : O(
|
|
2289
|
+
})) : O(r).displayedGraph.sidebar.visible && O(r).displayedGraph.sidebar.nodeId !== a.value.id ? (p(), H(O(so), {
|
|
2251
2290
|
key: 4,
|
|
2252
2291
|
class: "--clickable mx-1",
|
|
2253
2292
|
onClick: he
|
|
2254
|
-
})) : (p(),
|
|
2293
|
+
})) : (p(), H(O(lo), {
|
|
2255
2294
|
key: 5,
|
|
2256
2295
|
class: "--clickable mx-1",
|
|
2257
2296
|
onClick: z
|
|
2258
2297
|
}))
|
|
2259
|
-
], 64)) :
|
|
2260
|
-
G(O(
|
|
2298
|
+
], 64)) : L("", !0),
|
|
2299
|
+
G(O(Yn), {
|
|
2261
2300
|
class: "--clickable mx-1",
|
|
2262
|
-
onClick:
|
|
2301
|
+
onClick: j
|
|
2263
2302
|
}),
|
|
2264
2303
|
G(O(t), {
|
|
2265
2304
|
modelValue: y.value,
|
|
2266
2305
|
"onUpdate:modelValue": g[3] || (g[3] = (c) => y.value = c),
|
|
2267
2306
|
x: 0,
|
|
2268
2307
|
y: 0,
|
|
2269
|
-
items:
|
|
2308
|
+
items: $.value,
|
|
2270
2309
|
onClick: Ee
|
|
2271
2310
|
}, null, 8, ["modelValue", "items"])
|
|
2272
2311
|
])
|
|
2273
2312
|
], 64)),
|
|
2274
|
-
|
|
2313
|
+
a.value.outputs._code ? (p(), H(O(Ye), {
|
|
2275
2314
|
key: 3,
|
|
2276
|
-
node:
|
|
2277
|
-
intf:
|
|
2315
|
+
node: a.value,
|
|
2316
|
+
intf: a.value.outputs._code,
|
|
2278
2317
|
class: "--output",
|
|
2279
|
-
title:
|
|
2318
|
+
title: a.value.outputs._code.value,
|
|
2280
2319
|
"data-interface-type": "node"
|
|
2281
|
-
}, null, 8, ["node", "intf", "title"])) :
|
|
2320
|
+
}, null, 8, ["node", "intf", "title"])) : L("", !0)
|
|
2282
2321
|
], 32),
|
|
2283
2322
|
m("div", {
|
|
2284
|
-
class:
|
|
2285
|
-
onKeydown: g[5] || (g[5] = Oe(
|
|
2323
|
+
class: oe(["__content", S.value]),
|
|
2324
|
+
onKeydown: g[5] || (g[5] = Oe(ue(() => {
|
|
2286
2325
|
}, ["stop"]), ["delete"])),
|
|
2287
|
-
onContextmenu: g[6] || (g[6] =
|
|
2326
|
+
onContextmenu: g[6] || (g[6] = ue(() => {
|
|
2288
2327
|
}, ["prevent"]))
|
|
2289
2328
|
}, [
|
|
2290
|
-
m("div",
|
|
2291
|
-
(p(!0), b(U, null,
|
|
2329
|
+
m("div", vs, [
|
|
2330
|
+
(p(!0), b(U, null, ae(pe.value, (c) => (p(), b(U, {
|
|
2292
2331
|
key: c.id
|
|
2293
2332
|
}, [
|
|
2294
|
-
|
|
2333
|
+
a.value.state?.hidden ? (p(), b("div", gs, [
|
|
2295
2334
|
c.port ? (p(), b("div", {
|
|
2296
2335
|
key: 0,
|
|
2297
2336
|
id: c.id,
|
|
@@ -2299,26 +2338,26 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2299
2338
|
class: "baklava-node-interface --output --connected"
|
|
2300
2339
|
}, [...g[7] || (g[7] = [
|
|
2301
2340
|
m("div", { class: "__port" }, null, -1)
|
|
2302
|
-
])], 8,
|
|
2303
|
-
])) : q(
|
|
2341
|
+
])], 8, bs)) : L("", !0)
|
|
2342
|
+
])) : q(M.$slots, "nodeInterface", {
|
|
2304
2343
|
key: 1,
|
|
2305
2344
|
type: "output",
|
|
2306
|
-
node:
|
|
2345
|
+
node: a.value,
|
|
2307
2346
|
intf: c
|
|
2308
2347
|
}, () => [
|
|
2309
2348
|
G(O(s), {
|
|
2310
|
-
node:
|
|
2349
|
+
node: a.value,
|
|
2311
2350
|
intf: c,
|
|
2312
2351
|
title: c.value
|
|
2313
2352
|
}, null, 8, ["node", "intf", "title"])
|
|
2314
2353
|
])
|
|
2315
2354
|
], 64))), 128))
|
|
2316
2355
|
]),
|
|
2317
|
-
m("div",
|
|
2318
|
-
(p(!0), b(U, null,
|
|
2356
|
+
m("div", ys, [
|
|
2357
|
+
(p(!0), b(U, null, ae(Z.value, (c) => (p(), b(U, {
|
|
2319
2358
|
key: c.id
|
|
2320
2359
|
}, [
|
|
2321
|
-
|
|
2360
|
+
a.value.state?.hidden ? (p(), b("div", _s, [
|
|
2322
2361
|
c.port ? (p(), b("div", {
|
|
2323
2362
|
key: 0,
|
|
2324
2363
|
id: c.id,
|
|
@@ -2326,15 +2365,15 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2326
2365
|
class: "baklava-node-interface --input --connected"
|
|
2327
2366
|
}, [...g[8] || (g[8] = [
|
|
2328
2367
|
m("div", { class: "__port" }, null, -1)
|
|
2329
|
-
])], 8,
|
|
2330
|
-
])) : q(
|
|
2368
|
+
])], 8, Cs)) : L("", !0)
|
|
2369
|
+
])) : q(M.$slots, "nodeInterface", {
|
|
2331
2370
|
key: 1,
|
|
2332
|
-
node:
|
|
2371
|
+
node: a.value,
|
|
2333
2372
|
intf: c,
|
|
2334
2373
|
type: "input"
|
|
2335
2374
|
}, () => [
|
|
2336
2375
|
G(O(s), {
|
|
2337
|
-
node:
|
|
2376
|
+
node: a.value,
|
|
2338
2377
|
intf: c,
|
|
2339
2378
|
title: c.value
|
|
2340
2379
|
}, null, 8, ["node", "intf", "title"])
|
|
@@ -2342,45 +2381,45 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2342
2381
|
], 64))), 128))
|
|
2343
2382
|
])
|
|
2344
2383
|
], 34)
|
|
2345
|
-
], 46,
|
|
2384
|
+
], 46, ps));
|
|
2346
2385
|
}
|
|
2347
|
-
}),
|
|
2386
|
+
}), ks = ["id"], xs = { class: "align-middle" }, Ye = /* @__PURE__ */ F({
|
|
2348
2387
|
__name: "CodeGraphNodeInterface",
|
|
2349
2388
|
props: {
|
|
2350
2389
|
node: {},
|
|
2351
2390
|
intf: {}
|
|
2352
2391
|
},
|
|
2353
2392
|
setup(n) {
|
|
2354
|
-
const e = n, { viewModel: t } = me(), { hoveredOver: s, temporaryConnection: o } =
|
|
2393
|
+
const e = n, { viewModel: t } = me(), { hoveredOver: s, temporaryConnection: o } = Qt(), a = B(null), i = A(() => e.intf.connectionCount > 0), r = A(() => ({
|
|
2355
2394
|
"--connected": i.value
|
|
2356
2395
|
})), l = () => {
|
|
2357
2396
|
s(e.intf);
|
|
2358
2397
|
}, d = () => {
|
|
2359
2398
|
s(void 0);
|
|
2360
2399
|
}, f = () => {
|
|
2361
|
-
|
|
2400
|
+
a.value && t.value.hooks.renderInterface.execute({ intf: e.intf, el: a.value });
|
|
2362
2401
|
};
|
|
2363
|
-
return Se(f),
|
|
2402
|
+
return Se(f), Ze(f), (C, h) => (p(), b("div", {
|
|
2364
2403
|
id: n.intf.id,
|
|
2365
2404
|
ref_key: "el",
|
|
2366
|
-
ref:
|
|
2367
|
-
class:
|
|
2405
|
+
ref: a,
|
|
2406
|
+
class: oe(["baklava-node-interface", r.value])
|
|
2368
2407
|
}, [
|
|
2369
2408
|
n.intf.port ? (p(), b("div", {
|
|
2370
2409
|
key: 0,
|
|
2371
|
-
class:
|
|
2410
|
+
class: oe(["__port", { "--selected": O(o)?.from === n.intf }]),
|
|
2372
2411
|
onPointerover: l,
|
|
2373
2412
|
onPointerout: d
|
|
2374
|
-
}, null, 34)) :
|
|
2375
|
-
m("span",
|
|
2413
|
+
}, null, 34)) : L("", !0),
|
|
2414
|
+
m("span", xs, [
|
|
2376
2415
|
q(C.$slots, "default")
|
|
2377
2416
|
])
|
|
2378
|
-
], 10,
|
|
2417
|
+
], 10, ks));
|
|
2379
2418
|
}
|
|
2380
|
-
}),
|
|
2419
|
+
}), Is = ["title"], Ns = {
|
|
2381
2420
|
key: 0,
|
|
2382
2421
|
class: "__label"
|
|
2383
|
-
},
|
|
2422
|
+
}, We = /* @__PURE__ */ F({
|
|
2384
2423
|
__name: "SidebarCheckbox",
|
|
2385
2424
|
props: {
|
|
2386
2425
|
disabled: { type: Boolean },
|
|
@@ -2392,9 +2431,9 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2392
2431
|
setup(n, { emit: e }) {
|
|
2393
2432
|
const t = e;
|
|
2394
2433
|
return (s, o) => (p(), b("div", {
|
|
2395
|
-
class:
|
|
2434
|
+
class: oe(["baklava-checkbox", { "--checked": n.inversed ? !n.modelValue : n.modelValue, "--disabled": n.disabled }]),
|
|
2396
2435
|
title: n.name,
|
|
2397
|
-
onClick: o[0] || (o[0] = (
|
|
2436
|
+
onClick: o[0] || (o[0] = (a) => t("update:modelValue", !n.modelValue))
|
|
2398
2437
|
}, [
|
|
2399
2438
|
o[1] || (o[1] = m("div", { class: "__checkmark-container" }, [
|
|
2400
2439
|
m("svg", {
|
|
@@ -2410,28 +2449,28 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2410
2449
|
})
|
|
2411
2450
|
])
|
|
2412
2451
|
], -1)),
|
|
2413
|
-
n.name ? (p(), b("div",
|
|
2414
|
-
], 10,
|
|
2452
|
+
n.name ? (p(), b("div", Ns, P(n.name), 1)) : L("", !0)
|
|
2453
|
+
], 10, Is));
|
|
2415
2454
|
}
|
|
2416
|
-
}),
|
|
2455
|
+
}), Es = { class: "__header" }, Ts = { class: "__node-name" }, Os = { class: "__interfaces" }, Ms = { class: "__inputs" }, $s = { style: { display: "flex" } }, Ss = { class: "__outputs" }, As = {
|
|
2417
2456
|
key: 0,
|
|
2418
2457
|
class: "__interface"
|
|
2419
|
-
},
|
|
2458
|
+
}, Gs = { style: { display: "flex" } }, Rs = /* @__PURE__ */ F({
|
|
2420
2459
|
__name: "CodeGraphSidebar",
|
|
2421
2460
|
setup(n) {
|
|
2422
|
-
const { viewModel: e } = me(), { graph: t } = Ge(), s =
|
|
2423
|
-
let i = 0,
|
|
2424
|
-
const l =
|
|
2461
|
+
const { viewModel: e } = me(), { graph: t } = Ge(), s = B(null), o = $e(e.value.settings.sidebar, "width"), a = A(() => e.value.settings.sidebar.resizable);
|
|
2462
|
+
let i = 0, r = 0;
|
|
2463
|
+
const l = A(() => {
|
|
2425
2464
|
const y = t.value.sidebar.nodeId;
|
|
2426
|
-
return t.value.nodes.find((
|
|
2427
|
-
}), d =
|
|
2465
|
+
return t.value.nodes.find(($) => $.id === y);
|
|
2466
|
+
}), d = A(() => l.value), f = A(() => ({
|
|
2428
2467
|
width: `${o.value}px`
|
|
2429
|
-
})), C =
|
|
2468
|
+
})), C = A(() => d.value ? Object.values(d.value.inputs).filter((y) => y.displayInSidebar && y.component) : []), h = A(() => d.value ? Object.values(d.value.outputs).filter((y) => y.displayInSidebar && y.component) : []), N = () => {
|
|
2430
2469
|
t.value.sidebar.visible = !1;
|
|
2431
2470
|
}, v = () => {
|
|
2432
2471
|
l.value?.events.update.emit(null);
|
|
2433
2472
|
}, w = (y) => {
|
|
2434
|
-
i = o.value,
|
|
2473
|
+
i = o.value, r = y.clientX, window.addEventListener("mousemove", u), window.addEventListener(
|
|
2435
2474
|
"mouseup",
|
|
2436
2475
|
() => {
|
|
2437
2476
|
window.removeEventListener("mousemove", u);
|
|
@@ -2439,50 +2478,50 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2439
2478
|
{ once: !0 }
|
|
2440
2479
|
);
|
|
2441
2480
|
}, u = (y) => {
|
|
2442
|
-
const
|
|
2481
|
+
const $ = s.value?.parentElement?.getBoundingClientRect().width ?? 500, T = y.clientX - r;
|
|
2443
2482
|
let S = i - T;
|
|
2444
|
-
S < 300 ? S = 300 : S > 0.9 *
|
|
2483
|
+
S < 300 ? S = 300 : S > 0.9 * $ && (S = 0.9 * $), o.value = S;
|
|
2445
2484
|
};
|
|
2446
|
-
return (y,
|
|
2447
|
-
class:
|
|
2448
|
-
style:
|
|
2485
|
+
return (y, $) => (p(), b("div", {
|
|
2486
|
+
class: oe([{ "--open": O(t).sidebar.visible }, "baklava-sidebar"]),
|
|
2487
|
+
style: Ae(f.value),
|
|
2449
2488
|
ref_key: "el",
|
|
2450
2489
|
ref: s
|
|
2451
2490
|
}, [
|
|
2452
|
-
|
|
2491
|
+
a.value ? (p(), b("div", {
|
|
2453
2492
|
key: 0,
|
|
2454
2493
|
class: "__resizer",
|
|
2455
2494
|
onMousedown: w
|
|
2456
|
-
}, null, 32)) :
|
|
2495
|
+
}, null, 32)) : L("", !0),
|
|
2457
2496
|
l.value ? (p(), b(U, { key: 1 }, [
|
|
2458
|
-
m("div",
|
|
2497
|
+
m("div", Es, [
|
|
2459
2498
|
m("button", {
|
|
2460
2499
|
tabindex: "-1",
|
|
2461
2500
|
class: "__close",
|
|
2462
2501
|
onClick: N
|
|
2463
2502
|
}, "×"),
|
|
2464
|
-
m("div",
|
|
2465
|
-
m("b", null,
|
|
2503
|
+
m("div", Ts, [
|
|
2504
|
+
m("b", null, P(l.value.title), 1)
|
|
2466
2505
|
])
|
|
2467
2506
|
]),
|
|
2468
|
-
m("div",
|
|
2469
|
-
m("div",
|
|
2470
|
-
(p(!0), b(U, null,
|
|
2507
|
+
m("div", Os, [
|
|
2508
|
+
m("div", Ms, [
|
|
2509
|
+
(p(!0), b(U, null, ae(C.value, (T) => (p(), b("div", {
|
|
2471
2510
|
key: T.id,
|
|
2472
2511
|
class: "__interface"
|
|
2473
2512
|
}, [
|
|
2474
|
-
m("div",
|
|
2475
|
-
G(
|
|
2513
|
+
m("div", $s, [
|
|
2514
|
+
G(We, {
|
|
2476
2515
|
modelValue: T.hidden,
|
|
2477
2516
|
"onUpdate:modelValue": [
|
|
2478
2517
|
(S) => T.hidden = S,
|
|
2479
|
-
|
|
2518
|
+
$[0] || ($[0] = () => l.value?.events.update.emit(null))
|
|
2480
2519
|
],
|
|
2481
2520
|
disabled: !T.optional,
|
|
2482
2521
|
inversed: "",
|
|
2483
2522
|
style: { "padding-right": "8px" }
|
|
2484
2523
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"]),
|
|
2485
|
-
(p(),
|
|
2524
|
+
(p(), H(Be(T.component), {
|
|
2486
2525
|
modelValue: T.value,
|
|
2487
2526
|
"onUpdate:modelValue": (S) => T.value = S,
|
|
2488
2527
|
node: l.value,
|
|
@@ -2492,11 +2531,11 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2492
2531
|
])
|
|
2493
2532
|
]))), 128))
|
|
2494
2533
|
]),
|
|
2495
|
-
m("div",
|
|
2496
|
-
d.value && d.value.state ? (p(), b("div",
|
|
2497
|
-
|
|
2534
|
+
m("div", Ss, [
|
|
2535
|
+
d.value && d.value.state ? (p(), b("div", As, [
|
|
2536
|
+
$[3] || ($[3] = m("label", null, "Variable name", -1)),
|
|
2498
2537
|
ke(m("input", {
|
|
2499
|
-
"onUpdate:modelValue":
|
|
2538
|
+
"onUpdate:modelValue": $[1] || ($[1] = (T) => d.value.state.variableName = T),
|
|
2500
2539
|
type: "text",
|
|
2501
2540
|
class: "baklava-input",
|
|
2502
2541
|
title: "Variable name",
|
|
@@ -2505,23 +2544,23 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2505
2544
|
}, null, 544), [
|
|
2506
2545
|
[xe, d.value.state.variableName]
|
|
2507
2546
|
])
|
|
2508
|
-
])) :
|
|
2509
|
-
(p(!0), b(U, null,
|
|
2547
|
+
])) : L("", !0),
|
|
2548
|
+
(p(!0), b(U, null, ae(h.value, (T) => (p(), b("div", {
|
|
2510
2549
|
key: T.id,
|
|
2511
2550
|
class: "__interface"
|
|
2512
2551
|
}, [
|
|
2513
|
-
m("div",
|
|
2514
|
-
G(
|
|
2552
|
+
m("div", Gs, [
|
|
2553
|
+
G(We, {
|
|
2515
2554
|
modelValue: T.hidden,
|
|
2516
2555
|
"onUpdate:modelValue": [
|
|
2517
2556
|
(S) => T.hidden = S,
|
|
2518
|
-
|
|
2557
|
+
$[2] || ($[2] = () => l.value?.events.update.emit(null))
|
|
2519
2558
|
],
|
|
2520
2559
|
disabled: !T.optional,
|
|
2521
2560
|
inversed: "",
|
|
2522
2561
|
style: { "padding-right": "8px" }
|
|
2523
2562
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"]),
|
|
2524
|
-
(p(),
|
|
2563
|
+
(p(), H(Be(T.component), {
|
|
2525
2564
|
modelValue: T.value,
|
|
2526
2565
|
"onUpdate:modelValue": (S) => T.value = S,
|
|
2527
2566
|
node: l.value,
|
|
@@ -2533,31 +2572,31 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2533
2572
|
])
|
|
2534
2573
|
]),
|
|
2535
2574
|
q(y.$slots, "codeEditor", { node: l.value })
|
|
2536
|
-
], 64)) :
|
|
2575
|
+
], 64)) : L("", !0)
|
|
2537
2576
|
], 6));
|
|
2538
2577
|
}
|
|
2539
|
-
}),
|
|
2578
|
+
}), js = {
|
|
2540
2579
|
class: "baklava-node --palette",
|
|
2541
2580
|
style: { "margin-top": "-20px", "margin-bottom": "20px" }
|
|
2542
|
-
},
|
|
2581
|
+
}, Ls = {
|
|
2543
2582
|
key: 0,
|
|
2544
2583
|
style: { display: "flex", "justify-content": "space-between" }
|
|
2545
|
-
}, Ps = ["onClick"],
|
|
2584
|
+
}, Ps = ["onClick"], Vs = {
|
|
2546
2585
|
key: 0,
|
|
2547
2586
|
style: { margin: "auto 0", "font-size": "12px" }
|
|
2548
|
-
},
|
|
2587
|
+
}, Hs = /* @__PURE__ */ F({
|
|
2549
2588
|
__name: "CodeNodePalette",
|
|
2550
2589
|
setup(n) {
|
|
2551
|
-
const e =
|
|
2590
|
+
const e = Me.PaletteEntry, { viewModel: t } = me(), { x: s, y: o } = hn(), { transform: a } = Zt(), i = en(t), r = $t("editorEl"), l = B(""), d = B(null), f = () => l.value ? i.value.filter(
|
|
2552
2591
|
(v) => v.name.toLowerCase().includes(l.value.toLowerCase()) || Object.values(v.nodeTypes).some(
|
|
2553
2592
|
(w) => w.title.toLowerCase().includes(l.value.toLowerCase())
|
|
2554
2593
|
)
|
|
2555
|
-
) : i.value, C = (v) => l.value ?
|
|
2594
|
+
) : i.value, C = (v) => l.value ? Jo(v, (w) => {
|
|
2556
2595
|
const u = w[1];
|
|
2557
2596
|
return u.category.includes(l.value.toLowerCase()) || u.title?.toLowerCase().includes(l.value.toLowerCase());
|
|
2558
|
-
}) : v, h =
|
|
2559
|
-
if (!d.value || !
|
|
2560
|
-
const { left: v, top: w } =
|
|
2597
|
+
}) : v, h = A(() => {
|
|
2598
|
+
if (!d.value || !r?.value) return {};
|
|
2599
|
+
const { left: v, top: w } = r.value.getBoundingClientRect();
|
|
2561
2600
|
return {
|
|
2562
2601
|
top: `${o.value - w}px`,
|
|
2563
2602
|
left: `${s.value - v}px`
|
|
@@ -2570,18 +2609,18 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2570
2609
|
const u = () => {
|
|
2571
2610
|
const y = te(new w.type());
|
|
2572
2611
|
t.value.displayedGraph.addNode(y);
|
|
2573
|
-
const
|
|
2612
|
+
const $ = r.value.getBoundingClientRect(), [T, S] = a(s.value - $.left, o.value - $.top);
|
|
2574
2613
|
y.position.x = T, y.position.y = S, d.value = null, document.removeEventListener("pointerup", u);
|
|
2575
2614
|
};
|
|
2576
2615
|
document.addEventListener("pointerup", u);
|
|
2577
2616
|
};
|
|
2578
2617
|
return (v, w) => (p(), b(U, null, [
|
|
2579
2618
|
m("div", {
|
|
2580
|
-
class:
|
|
2581
|
-
onContextmenu: w[1] || (w[1] =
|
|
2619
|
+
class: oe([{ "--open": O(t).settings.palette.enabled }, "baklava-node-palette"]),
|
|
2620
|
+
onContextmenu: w[1] || (w[1] = ue(() => {
|
|
2582
2621
|
}, ["stop", "prevent"]))
|
|
2583
2622
|
}, [
|
|
2584
|
-
m("div",
|
|
2623
|
+
m("div", js, [
|
|
2585
2624
|
ke(m("input", {
|
|
2586
2625
|
"onUpdate:modelValue": w[0] || (w[0] = (u) => l.value = u),
|
|
2587
2626
|
type: "text",
|
|
@@ -2592,58 +2631,58 @@ const es = /* @__PURE__ */ qo(Zo), ts = (n) => ({
|
|
|
2592
2631
|
[xe, l.value]
|
|
2593
2632
|
])
|
|
2594
2633
|
]),
|
|
2595
|
-
(p(!0), b(U, null,
|
|
2634
|
+
(p(!0), b(U, null, ae(f(), (u) => (p(), b("section", {
|
|
2596
2635
|
key: u.name
|
|
2597
2636
|
}, [
|
|
2598
|
-
u.name !== "default" ? (p(), b("h3",
|
|
2637
|
+
u.name !== "default" ? (p(), b("h3", Ls, [
|
|
2599
2638
|
m("div", {
|
|
2600
2639
|
onClick: (y) => l.value = u.name,
|
|
2601
2640
|
style: { cursor: "pointer" }
|
|
2602
|
-
},
|
|
2603
|
-
Object.keys(C(u.nodeTypes)).length < Object.values(u.nodeTypes).length ? (p(), b("div",
|
|
2604
|
-
])) :
|
|
2605
|
-
(p(!0), b(U, null,
|
|
2606
|
-
key:
|
|
2607
|
-
type:
|
|
2641
|
+
}, P(u.name), 9, Ps),
|
|
2642
|
+
Object.keys(C(u.nodeTypes)).length < Object.values(u.nodeTypes).length ? (p(), b("div", Vs, " ( " + P(Object.keys(C(u.nodeTypes)).length) + " / " + P(Object.values(u.nodeTypes).length) + " ) ", 1)) : L("", !0)
|
|
2643
|
+
])) : L("", !0),
|
|
2644
|
+
(p(!0), b(U, null, ae(C(u.nodeTypes), (y, $) => (p(), H(O(e), {
|
|
2645
|
+
key: $,
|
|
2646
|
+
type: $,
|
|
2608
2647
|
title: y.title,
|
|
2609
|
-
onPointerdown: (T) => N(
|
|
2648
|
+
onPointerdown: (T) => N($, y)
|
|
2610
2649
|
}, null, 8, ["type", "title", "onPointerdown"]))), 128))
|
|
2611
2650
|
]))), 128))
|
|
2612
2651
|
], 34),
|
|
2613
|
-
G(
|
|
2652
|
+
G(St, { name: "fade" }, {
|
|
2614
2653
|
default: ee(() => [
|
|
2615
2654
|
d.value ? (p(), b("div", {
|
|
2616
2655
|
key: 0,
|
|
2617
2656
|
class: "baklava-dragged-node",
|
|
2618
|
-
style:
|
|
2657
|
+
style: Ae(h.value)
|
|
2619
2658
|
}, [
|
|
2620
2659
|
G(O(e), {
|
|
2621
2660
|
type: d.value.type,
|
|
2622
2661
|
title: d.value.nodeInformation.title
|
|
2623
2662
|
}, null, 8, ["type", "title"])
|
|
2624
|
-
], 4)) :
|
|
2663
|
+
], 4)) : L("", !0)
|
|
2625
2664
|
]),
|
|
2626
2665
|
_: 1
|
|
2627
2666
|
})
|
|
2628
2667
|
], 64));
|
|
2629
2668
|
}
|
|
2630
|
-
}),
|
|
2631
|
-
function
|
|
2632
|
-
const t =
|
|
2633
|
-
return p(),
|
|
2669
|
+
}), Bs = {}, zs = { class: "prependIcon" }, Us = { class: "appendIcon" };
|
|
2670
|
+
function Ds(n, e) {
|
|
2671
|
+
const t = qe("router-link");
|
|
2672
|
+
return p(), H(t, { class: "navItem" }, {
|
|
2634
2673
|
default: ee(() => [
|
|
2635
|
-
m("span",
|
|
2674
|
+
m("span", zs, [
|
|
2636
2675
|
q(n.$slots, "prependIcon")
|
|
2637
2676
|
]),
|
|
2638
2677
|
q(n.$slots, "default"),
|
|
2639
|
-
m("span",
|
|
2678
|
+
m("span", Us, [
|
|
2640
2679
|
q(n.$slots, "appendIcon")
|
|
2641
2680
|
])
|
|
2642
2681
|
]),
|
|
2643
2682
|
_: 3
|
|
2644
2683
|
});
|
|
2645
2684
|
}
|
|
2646
|
-
const
|
|
2685
|
+
const Ke = /* @__PURE__ */ R(Bs, [["render", Ds]]), Fs = { class: "navbar" }, Ys = ["onClick"], xa = /* @__PURE__ */ F({
|
|
2647
2686
|
__name: "NavBar",
|
|
2648
2687
|
props: {
|
|
2649
2688
|
viewModel: {},
|
|
@@ -2655,33 +2694,33 @@ const Je = /* @__PURE__ */ A(Rs, [["render", Vs]]), Bs = { class: "navbar" }, Hs
|
|
|
2655
2694
|
const t = e, s = (o) => {
|
|
2656
2695
|
t("click:remove", o);
|
|
2657
2696
|
};
|
|
2658
|
-
return (o,
|
|
2697
|
+
return (o, a) => (p(), b("nav", Fs, [
|
|
2659
2698
|
q(o.$slots, "prepend"),
|
|
2660
|
-
(p(!0), b(U, null,
|
|
2699
|
+
(p(!0), b(U, null, ae(n.editorStates, (i) => (p(), H(Ke, {
|
|
2661
2700
|
key: i.graph.id,
|
|
2662
|
-
class:
|
|
2701
|
+
class: oe({ active: i.graph.id === n.viewModel.displayedGraph.id }),
|
|
2663
2702
|
to: { name: n.routes?.edit ?? "edit", params: { editorId: i.graph.id } }
|
|
2664
2703
|
}, {
|
|
2665
2704
|
appendIcon: ee(() => [
|
|
2666
2705
|
m("button", {
|
|
2667
2706
|
class: "remove",
|
|
2668
|
-
onClick:
|
|
2707
|
+
onClick: ue((r) => s(i.graph.id), ["prevent"])
|
|
2669
2708
|
}, [
|
|
2670
|
-
G(O(
|
|
2671
|
-
], 8,
|
|
2709
|
+
G(O(Do))
|
|
2710
|
+
], 8, Ys)
|
|
2672
2711
|
]),
|
|
2673
2712
|
default: ee(() => [
|
|
2674
|
-
|
|
2713
|
+
et(P(i.graph.id.slice(0, 6)) + " ", 1)
|
|
2675
2714
|
]),
|
|
2676
2715
|
_: 2
|
|
2677
2716
|
}, 1032, ["class", "to"]))), 128)),
|
|
2678
2717
|
q(o.$slots, "append", {}, () => [
|
|
2679
|
-
G(
|
|
2718
|
+
G(Ke, {
|
|
2680
2719
|
to: { name: n.routes?.new ?? "new" },
|
|
2681
2720
|
class: "navItem"
|
|
2682
2721
|
}, {
|
|
2683
2722
|
default: ee(() => [
|
|
2684
|
-
G(O(
|
|
2723
|
+
G(O(xo), { class: "plus" })
|
|
2685
2724
|
]),
|
|
2686
2725
|
_: 1
|
|
2687
2726
|
}, 8, ["to"])
|
|
@@ -2689,35 +2728,35 @@ const Je = /* @__PURE__ */ A(Rs, [["render", Vs]]), Bs = { class: "navbar" }, Hs
|
|
|
2689
2728
|
]));
|
|
2690
2729
|
}
|
|
2691
2730
|
});
|
|
2692
|
-
class
|
|
2731
|
+
class xt extends wt {
|
|
2693
2732
|
_title = "Subgraph Input";
|
|
2694
2733
|
inputs = {
|
|
2695
|
-
_code: new D("", "").use(V,
|
|
2696
|
-
name: new
|
|
2734
|
+
_code: new D("_code", "").use(V, K).setHidden(!0),
|
|
2735
|
+
name: new at("Name", "Input").setPort(!1)
|
|
2697
2736
|
};
|
|
2698
2737
|
outputs = {
|
|
2699
|
-
_code: new D("", "").use(V,
|
|
2738
|
+
_code: new D("_code", "").use(V, K).setHidden(!0),
|
|
2700
2739
|
placeholder: new J("Connection", void 0)
|
|
2701
2740
|
};
|
|
2702
2741
|
}
|
|
2703
|
-
class
|
|
2742
|
+
class It extends kt {
|
|
2704
2743
|
_title = "Subgraph Output";
|
|
2705
2744
|
inputs = {
|
|
2706
|
-
_code: new D("", "").use(V,
|
|
2707
|
-
name: new
|
|
2745
|
+
_code: new D("_code", "").use(V, K).setHidden(!0),
|
|
2746
|
+
name: new at("Name", "Output").setPort(!1),
|
|
2708
2747
|
placeholder: new J("Connection", void 0)
|
|
2709
2748
|
};
|
|
2710
2749
|
outputs = {
|
|
2711
|
-
_code: new D("", "").use(V,
|
|
2750
|
+
_code: new D("_code", "").use(V, K).setHidden(!0),
|
|
2712
2751
|
output: new J("Output", void 0).setHidden(!0)
|
|
2713
2752
|
};
|
|
2714
2753
|
}
|
|
2715
|
-
const
|
|
2716
|
-
function
|
|
2717
|
-
const s = () => n.value.selectedNodes.filter((
|
|
2718
|
-
const { viewModel:
|
|
2754
|
+
const Ws = "CREATE_SUBGRAPH", Xe = [Pt, Vt];
|
|
2755
|
+
function Ks(n, e, t) {
|
|
2756
|
+
const s = () => n.value.selectedNodes.filter((a) => !Xe.includes(a.type)).length > 0, o = () => {
|
|
2757
|
+
const { viewModel: a } = me(), i = n.value, r = n.value.editor;
|
|
2719
2758
|
if (i.selectedNodes.length === 0) return;
|
|
2720
|
-
const l = i.selectedNodes.filter((k) => !
|
|
2759
|
+
const l = i.selectedNodes.filter((k) => !Xe.includes(k.type)), d = l.flatMap((k) => Object.values(k.inputs)), f = l.flatMap((k) => Object.values(k.outputs)), C = i.connections.filter(
|
|
2721
2760
|
(k) => !f.includes(k.from) && d.includes(k.to)
|
|
2722
2761
|
), h = i.connections.filter(
|
|
2723
2762
|
(k) => f.includes(k.from) && !d.includes(k.to)
|
|
@@ -2727,20 +2766,20 @@ function Us(n, e, t) {
|
|
|
2727
2766
|
id: k.id,
|
|
2728
2767
|
from: k.from.id,
|
|
2729
2768
|
to: k.to.id
|
|
2730
|
-
})), u = /* @__PURE__ */ new Map(), { xLeft: y, xRight:
|
|
2731
|
-
for (const [k,
|
|
2732
|
-
const z = new
|
|
2733
|
-
z.inputs.name.value =
|
|
2769
|
+
})), u = /* @__PURE__ */ new Map(), { xLeft: y, xRight: $, yTop: T } = Xs(l);
|
|
2770
|
+
for (const [k, j] of C.entries()) {
|
|
2771
|
+
const z = new xt();
|
|
2772
|
+
z.inputs.name.value = j.to.name, v.push({
|
|
2734
2773
|
...z.save(),
|
|
2735
|
-
position: { x:
|
|
2736
|
-
}), w.push({ id: re(), from: z.outputs.placeholder.id, to:
|
|
2774
|
+
position: { x: $ - a.value.settings.nodes.defaultWidth - 100, y: T + k * 200 }
|
|
2775
|
+
}), w.push({ id: re(), from: z.outputs.placeholder.id, to: j.to.id }), u.set(j.to.id, z.graphInterfaceId);
|
|
2737
2776
|
}
|
|
2738
|
-
for (const [k,
|
|
2739
|
-
const z = new
|
|
2740
|
-
z.inputs.name.value =
|
|
2777
|
+
for (const [k, j] of h.entries()) {
|
|
2778
|
+
const z = new It();
|
|
2779
|
+
z.inputs.name.value = j.from.name, v.push({
|
|
2741
2780
|
...z.save(),
|
|
2742
2781
|
position: { x: y + 100, y: T + k * 200 }
|
|
2743
|
-
}), w.push({ id: re(), from:
|
|
2782
|
+
}), w.push({ id: re(), from: j.from.id, to: z.inputs.placeholder.id }), u.set(j.from.id, z.graphInterfaceId);
|
|
2744
2783
|
}
|
|
2745
2784
|
const S = te(
|
|
2746
2785
|
new Ne(
|
|
@@ -2751,45 +2790,45 @@ function Us(n, e, t) {
|
|
|
2751
2790
|
inputs: [],
|
|
2752
2791
|
outputs: []
|
|
2753
2792
|
},
|
|
2754
|
-
|
|
2793
|
+
r
|
|
2755
2794
|
)
|
|
2756
2795
|
);
|
|
2757
|
-
|
|
2758
|
-
const Q =
|
|
2796
|
+
r.addGraphTemplate(S);
|
|
2797
|
+
const Q = r.nodeTypes.get(tt(S));
|
|
2759
2798
|
if (!Q) throw new Error("Unable to create subgraph: Could not find corresponding graph node type");
|
|
2760
2799
|
i.activeTransactions++;
|
|
2761
2800
|
const Z = te(new Q.type());
|
|
2762
2801
|
i.addNode(Z);
|
|
2763
2802
|
const pe = Math.round(
|
|
2764
|
-
l.map((k) => k.position.x).reduce((k,
|
|
2765
|
-
),
|
|
2766
|
-
l.map((k) => k.position.y).reduce((k,
|
|
2803
|
+
l.map((k) => k.position.x).reduce((k, j) => k + j, 0) / l.length
|
|
2804
|
+
), X = Math.round(
|
|
2805
|
+
l.map((k) => k.position.y).reduce((k, j) => k + j, 0) / l.length
|
|
2767
2806
|
);
|
|
2768
|
-
Z.position.x = pe, Z.position.y =
|
|
2807
|
+
Z.position.x = pe, Z.position.y = X, C.forEach((k) => {
|
|
2769
2808
|
i.removeConnection(k), i.addConnection(k.from, Z.inputs[u.get(k.to.id)]);
|
|
2770
2809
|
}), h.forEach((k) => {
|
|
2771
2810
|
i.removeConnection(k), i.addConnection(Z.outputs[u.get(k.from.id)], k.to);
|
|
2772
|
-
}), l.forEach((k) => i.removeNode(k)), i.activeTransactions--, e.canExecuteCommand(
|
|
2811
|
+
}), l.forEach((k) => i.removeNode(k)), i.activeTransactions--, e.canExecuteCommand(ne.SAVE_SUBGRAPH_COMMAND) && e.executeCommand(ne.SAVE_SUBGRAPH_COMMAND), t(S), n.value.panning = { ...i.panning }, n.value.scaling = i.scaling;
|
|
2773
2812
|
};
|
|
2774
|
-
e.registerCommand(
|
|
2813
|
+
e.registerCommand(Ws, {
|
|
2775
2814
|
canExecute: s,
|
|
2776
2815
|
execute: o
|
|
2777
2816
|
});
|
|
2778
2817
|
}
|
|
2779
|
-
function
|
|
2780
|
-
const e = n.reduce((o,
|
|
2781
|
-
const i =
|
|
2818
|
+
function Xs(n) {
|
|
2819
|
+
const e = n.reduce((o, a) => {
|
|
2820
|
+
const i = a.position.x;
|
|
2782
2821
|
return i < o ? i : o;
|
|
2783
|
-
}, 1 / 0), t = n.reduce((o,
|
|
2784
|
-
const i =
|
|
2822
|
+
}, 1 / 0), t = n.reduce((o, a) => {
|
|
2823
|
+
const i = a.position.y;
|
|
2785
2824
|
return i < o ? i : o;
|
|
2786
2825
|
}, 1 / 0);
|
|
2787
|
-
return { xLeft: n.reduce((o,
|
|
2788
|
-
const i =
|
|
2826
|
+
return { xLeft: n.reduce((o, a) => {
|
|
2827
|
+
const i = a.position.x + a.width;
|
|
2789
2828
|
return i > o ? i : o;
|
|
2790
2829
|
}, -1 / 0), xRight: e, yTop: t };
|
|
2791
2830
|
}
|
|
2792
|
-
class
|
|
2831
|
+
class qs extends Ht {
|
|
2793
2832
|
code;
|
|
2794
2833
|
graph;
|
|
2795
2834
|
constructor(e) {
|
|
@@ -2810,7 +2849,7 @@ class Fs extends Lt {
|
|
|
2810
2849
|
addGraphTemplate(e) {
|
|
2811
2850
|
if (this.events.beforeAddGraphTemplate.emit(e).prevented) return;
|
|
2812
2851
|
this._graphTemplates.push(e), this.graphTemplateEvents.addTarget(e.events), this.graphTemplateHooks.addTarget(e.hooks);
|
|
2813
|
-
const t =
|
|
2852
|
+
const t = qo(e);
|
|
2814
2853
|
this.registerNodeType(t, { category: "Subgraphs", title: e.name }), this.events.addGraphTemplate.emit(e);
|
|
2815
2854
|
}
|
|
2816
2855
|
/**
|
|
@@ -2841,123 +2880,124 @@ class Fs extends Lt {
|
|
|
2841
2880
|
this.code.state.modules[e] = t;
|
|
2842
2881
|
}
|
|
2843
2882
|
}
|
|
2844
|
-
function
|
|
2845
|
-
const e =
|
|
2883
|
+
function Ia(n) {
|
|
2884
|
+
const e = B(n?.code ?? new Ve()), t = B(n?.existingEditor ?? new qs(e.value)), s = Symbol("ViewModelToken"), o = B(null), a = At(o), { switchGraph: i } = es(t, o), r = A(() => a.value && a.value !== t.value.graph), l = te(tn());
|
|
2846
2885
|
l.nodes.defaultWidth = 400;
|
|
2847
|
-
const d =
|
|
2886
|
+
const d = nn(), f = on(a, d), C = sn(a, t, d), h = {
|
|
2848
2887
|
/** Called whenever a node is rendered */
|
|
2849
|
-
renderNode: new
|
|
2888
|
+
renderNode: new ze(null),
|
|
2850
2889
|
/** Called whenever an interface is rendered */
|
|
2851
|
-
renderInterface: new
|
|
2890
|
+
renderInterface: new ze(null)
|
|
2852
2891
|
}, N = te({
|
|
2853
2892
|
clipboard: C,
|
|
2854
2893
|
code: e,
|
|
2855
2894
|
commandHandler: d,
|
|
2856
|
-
displayedGraph:
|
|
2895
|
+
displayedGraph: a,
|
|
2857
2896
|
editor: t,
|
|
2858
2897
|
history: f,
|
|
2859
2898
|
hooks: h,
|
|
2860
|
-
isSubgraph:
|
|
2899
|
+
isSubgraph: r,
|
|
2861
2900
|
settings: l,
|
|
2862
2901
|
switchGraph: i
|
|
2863
2902
|
});
|
|
2864
|
-
return e.value.registerViewModel(N),
|
|
2903
|
+
return e.value.registerViewModel(N), Ko(N), an(a, d), Ks(a, d, i), rn(a, d), ln(a, d, i), un(a, d), dn(a, d, l), Fo(a, d, l), Yo(l), Qe(
|
|
2865
2904
|
t,
|
|
2866
2905
|
(v, w) => {
|
|
2867
2906
|
w && (w.events.registerGraph.unsubscribe(s), w.graphEvents.beforeAddNode.unsubscribe(s), v.nodeHooks.beforeLoad.unsubscribe(s), v.nodeHooks.afterSave.unsubscribe(s), v.graphTemplateHooks.beforeLoad.unsubscribe(s), v.graphTemplateHooks.afterSave.unsubscribe(s), v.graph.hooks.load.unsubscribe(s), v.graph.hooks.save.unsubscribe(s)), v && (v.nodeHooks.beforeLoad.subscribe(s, (u, y) => (y.position = u.position ?? { x: 0, y: 0 }, y.width = u.width ?? l.nodes.defaultWidth, y.twoColumn = u.twoColumn ?? !1, u)), v.nodeHooks.afterSave.subscribe(s, (u, y) => (u.position = y.position, u.width = y.width, u.twoColumn = y.twoColumn, u)), v.graphTemplateHooks.beforeLoad.subscribe(s, (u, y) => (y.panning = u.panning, y.scaling = u.scaling, u)), v.graphTemplateHooks.afterSave.subscribe(s, (u, y) => (u.panning = y.panning, u.scaling = y.scaling, u)), v.graph.hooks.load.subscribe(s, (u, y) => (y.panning = u.panning, y.scaling = u.scaling, u)), v.graph.hooks.save.subscribe(s, (u, y) => (u.panning = y.panning, u.scaling = y.scaling, u)), v.graphEvents.beforeAddNode.subscribe(
|
|
2868
2907
|
s,
|
|
2869
|
-
(u) =>
|
|
2870
|
-
), t.value.registerNodeType(
|
|
2908
|
+
(u) => cn(u, { defaultWidth: l.nodes.defaultWidth })
|
|
2909
|
+
), t.value.registerNodeType(xt, { category: "Subgraphs" }), t.value.registerNodeType(It, { category: "Subgraphs" }), i(v.graph));
|
|
2871
2910
|
},
|
|
2872
2911
|
{ immediate: !0 }
|
|
2873
2912
|
), N;
|
|
2874
2913
|
}
|
|
2875
2914
|
export {
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2915
|
+
rt as AbstractCodeNode,
|
|
2916
|
+
vt as CLEAR_ALL_COMMAND,
|
|
2917
|
+
Ws as CREATE_SUBGRAPH_COMMAND,
|
|
2918
|
+
Gn as Check,
|
|
2919
|
+
yn as CheckboxInterface,
|
|
2920
|
+
Ve as Code,
|
|
2921
|
+
Ca as CodeEditor,
|
|
2922
|
+
Mn as CodeEngine,
|
|
2884
2923
|
Ie as CodeGraph,
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2924
|
+
wa as CodeGraphEditor,
|
|
2925
|
+
ka as CodeGraphInfo,
|
|
2926
|
+
wt as CodeGraphInputNode,
|
|
2927
|
+
ws as CodeGraphNode,
|
|
2928
|
+
Ye as CodeGraphNodeInterface,
|
|
2929
|
+
kt as CodeGraphOutputNode,
|
|
2930
|
+
Rs as CodeGraphSidebar,
|
|
2892
2931
|
Ne as CodeGraphTemplate,
|
|
2893
2932
|
Re as CodeNode,
|
|
2894
2933
|
ve as CodeNodeInputInterface,
|
|
2895
2934
|
D as CodeNodeInterface,
|
|
2896
2935
|
je as CodeNodeInterfaceComponent,
|
|
2897
|
-
|
|
2898
|
-
|
|
2936
|
+
_n as CodeNodeOutputInterface,
|
|
2937
|
+
Hs as CodeNodePalette,
|
|
2899
2938
|
Pn as CodeVariable,
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
ut as
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2939
|
+
zn as Copy,
|
|
2940
|
+
ls as CopyToClipboard,
|
|
2941
|
+
Yn as DotsVertical,
|
|
2942
|
+
On as DynamicCodeNode,
|
|
2943
|
+
Ue as GRAPH_INPUT_NODE_TYPE,
|
|
2944
|
+
De as GRAPH_OUTPUT_NODE_TYPE,
|
|
2945
|
+
ht as IntegerInterface,
|
|
2946
|
+
va as JavascriptCode,
|
|
2947
|
+
qn as LayoutSidebarLeftCollapse,
|
|
2948
|
+
eo as LayoutSidebarLeftExpand,
|
|
2949
|
+
so as LayoutSidebarRight,
|
|
2950
|
+
lo as LayoutSidebarRightCollapse,
|
|
2951
|
+
ho as LayoutSidebarRightExpand,
|
|
2952
|
+
ua as ListInputInterface,
|
|
2953
|
+
mt as LockCode,
|
|
2954
|
+
xa as NavBar,
|
|
2955
|
+
Ke as NavItem,
|
|
2956
|
+
Cn as NumberInterface,
|
|
2957
|
+
_o as PlayerPlay,
|
|
2958
|
+
xo as Plus,
|
|
2959
|
+
ma as PythonCode,
|
|
2960
|
+
gt as RUN_ENGINE_COMMAND,
|
|
2961
|
+
To as Schema,
|
|
2962
|
+
So as SchemaOff,
|
|
2963
|
+
wn as SelectInterface,
|
|
2964
|
+
We as SidebarCheckbox,
|
|
2965
|
+
da as SliderInterface,
|
|
2966
|
+
xt as SubgraphInputNode,
|
|
2967
|
+
It as SubgraphOutputNode,
|
|
2968
|
+
bt as TOGGLE_MINIMAP_COMMAND,
|
|
2969
|
+
yt as TOGGLE_PALETTE_COMMAND,
|
|
2970
|
+
ft as TextInputInterface,
|
|
2971
|
+
Tn as TextInputInterfaceComponent,
|
|
2972
|
+
ca as TextareaInputInterface,
|
|
2973
|
+
jo as TransitionBottom,
|
|
2974
|
+
Ho as TrashOff,
|
|
2975
|
+
pa as TupleInputInterface,
|
|
2976
|
+
Do as X,
|
|
2977
|
+
la as addDefaultInterfaceTypes,
|
|
2978
|
+
ga as allowMultipleConnections,
|
|
2979
|
+
lt as booleanType,
|
|
2980
|
+
qo as createCodeGraphNodeType,
|
|
2981
|
+
vn as createInterface,
|
|
2982
|
+
ha as defineCodeNode,
|
|
2983
|
+
fa as defineDynamicCodeNode,
|
|
2984
|
+
bn as dictType,
|
|
2985
|
+
fn as formatInputs,
|
|
2986
|
+
_t as getCodeNodes,
|
|
2987
|
+
ba as getPositionAtColumn,
|
|
2988
|
+
ya as getPositionBeforeNode,
|
|
2989
|
+
ut as listType,
|
|
2990
|
+
it as loadNodeState,
|
|
2991
|
+
K as nodeType,
|
|
2992
|
+
dt as numberType,
|
|
2993
|
+
Ko as registerCodeEngine,
|
|
2994
|
+
Ks as registerCreateSubgraphCommand,
|
|
2995
|
+
Fo as registerCustomCommands,
|
|
2996
|
+
Wo as registerRunEngineCommands,
|
|
2997
|
+
mn as saveNodeState,
|
|
2998
|
+
ct as stringType,
|
|
2959
2999
|
pt as tupleType,
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
3000
|
+
Yo as updateToolbarItems,
|
|
3001
|
+
Ia as useCodeGraph,
|
|
3002
|
+
es as useSwitchCodeGraph
|
|
2963
3003
|
};
|