@babsey/code-graph 0.0.16 → 0.0.17
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.css +1 -1
- package/dist/code-graph.js +563 -502
- package/dist/code-graph.umd.cjs +1 -1
- package/dist/code.d.ts +2 -0
- package/dist/codeNode/codeNode.d.ts +4 -2
- package/dist/codeNode/defineCodeNode.d.ts +1 -0
- package/dist/codeNode/dynamicCodeNode.d.ts +1 -0
- package/dist/codeNodeInterfaces/baseStringInterface.d.ts +1 -0
- package/dist/codeNodeInterfaces/checkbox/checkboxInterface.d.ts +1 -0
- package/dist/codeNodeInterfaces/codeNode/codeNodeInterface.d.ts +1 -0
- package/dist/codeNodeInterfaces/index.d.ts +2 -0
- package/dist/codeNodeInterfaces/integer/integerInterface.d.ts +0 -2
- package/dist/codeNodeInterfaces/listInput/listInputInterface.d.ts +5 -0
- package/dist/codeNodeInterfaces/select/selectInterface.d.ts +0 -2
- package/dist/codeNodeInterfaces/slider/sliderInterface.d.ts +1 -2
- package/dist/codeNodeInterfaces/textInput/textInputInterface.d.ts +0 -2
- package/dist/codeNodeInterfaces/textareaInput/textareaInputInterface.d.ts +0 -2
- package/dist/codeNodeInterfaces/tupleInput/tupleInputInterface.d.ts +5 -0
- package/dist/components/node/CodeGraphNode.vue.d.ts +4 -4
- package/dist/icons/DotsVertical.vue.d.ts +2 -0
- package/dist/icons/TransitionBottom.vue.d.ts +2 -0
- package/dist/icons/index.d.ts +3 -1
- package/dist/interfaceTypes/default.d.ts +1 -0
- package/package.json +2 -1
- /package/dist/icons/{VerticalDots.vue.d.ts → CodeVariable.vue.d.ts} +0 -0
package/dist/code-graph.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import { AbstractNode as
|
|
2
|
-
import { CheckboxInterfaceComponent as
|
|
1
|
+
import { AbstractNode as Ae, sortTopologically as Ce, NodeInterface as Fe, displayInSidebar as Ie, NodeInterfaceType as G, BaklavaInterfaceTypes as We, CheckboxInterfaceComponent as Xe, setType as E, IntegerInterfaceComponent as Je, TextInputInterfaceComponent as se, NumberInterfaceComponent as Ye, SelectInterfaceComponent as qe, SliderInterfaceComponent as Qe, TextareaInputInterfaceComponent as Ke, allowMultipleConnections as Y, IntegerInterface as Ze, TextInputInterface as et, useViewModel as F, useTemporaryConnection as tt, Components as we, useGraph as ne, GRAPH_NODE_TYPE_PREFIX as K, useTransform as st, useNodeCategories as nt, BaklavaEditor as ot, DEFAULT_TOOLBAR_COMMANDS as at, useBaklava as it, DependencyEngine as rt, applyResult as lt } from "baklavajs";
|
|
2
|
+
import { CheckboxInterfaceComponent as In, NumberInterfaceComponent as Nn } from "baklavajs";
|
|
3
3
|
import q from "mustache";
|
|
4
|
-
import { reactive as
|
|
5
|
-
import
|
|
6
|
-
import { v4 as
|
|
7
|
-
import { usePointer as
|
|
4
|
+
import { reactive as R, defineComponent as L, createElementBlock as r, openBlock as i, toDisplayString as B, markRaw as M, ref as T, computed as _, onMounted as oe, onUpdated as Ne, normalizeClass as U, createCommentVNode as I, createElementVNode as l, unref as y, renderSlot as Z, createStaticVNode as Q, onBeforeUnmount as dt, normalizeStyle as ae, withModifiers as P, createBlock as S, withDirectives as ie, Fragment as z, createTextVNode as ut, createVNode as V, withKeys as ee, vModelText as re, renderList as H, nextTick as ct, toRef as Me, resolveDynamicComponent as pt, inject as ht, Transition as vt, withCtx as J, onUnmounted as mt, normalizeProps as ft, guardReactiveProps as gt, mergeProps as bt } from "vue";
|
|
5
|
+
import yt from "toposort";
|
|
6
|
+
import { v4 as _t } from "uuid";
|
|
7
|
+
import { usePointer as wt } from "@vueuse/core";
|
|
8
8
|
q.escape = (s) => s;
|
|
9
|
-
class
|
|
9
|
+
class kt extends Ae {
|
|
10
10
|
state;
|
|
11
11
|
code;
|
|
12
12
|
isCodeNode = !0;
|
|
13
|
-
|
|
13
|
+
name = "";
|
|
14
|
+
codeTemplate;
|
|
14
15
|
inputs = {};
|
|
15
16
|
outputs = {};
|
|
16
17
|
constructor() {
|
|
17
|
-
super(), this.initializeIo(), this.width = 400, this.twoColumn = !0, this.state =
|
|
18
|
+
super(), this.initializeIo(), this.width = 400, this.twoColumn = !0, this.state = R({
|
|
18
19
|
codeTemplate: "",
|
|
19
20
|
hidden: !1,
|
|
20
21
|
integrated: !1,
|
|
21
22
|
modules: [],
|
|
22
23
|
script: "",
|
|
23
24
|
variableName: ""
|
|
24
|
-
})
|
|
25
|
+
}), this.codeTemplate = function() {
|
|
26
|
+
return `${this.name}(${xt(this.codeNodeInputs).join(", ")})`;
|
|
27
|
+
};
|
|
25
28
|
}
|
|
26
29
|
get codeNodeInputs() {
|
|
27
30
|
return Object.fromEntries(Object.entries(this.inputs).filter(([e, t]) => t.type != "node"));
|
|
@@ -73,33 +76,49 @@ class _t extends De {
|
|
|
73
76
|
* Render code of this node.
|
|
74
77
|
*/
|
|
75
78
|
renderCode() {
|
|
76
|
-
this.state.codeTemplate = this.codeTemplate.call(this);
|
|
77
79
|
const e = {};
|
|
78
80
|
Object.keys(this.inputs).forEach((n) => {
|
|
79
81
|
if (n === "_node") return;
|
|
80
|
-
const o = this.inputs[n]
|
|
81
|
-
o && o.state && (e[n] = o.state.script.length > 0 ? o.state.script :
|
|
82
|
+
const o = this.inputs[n];
|
|
83
|
+
o && o.state && (e[n] = o.state.script.length > 0 ? o.state.script : o.getValue());
|
|
82
84
|
});
|
|
83
85
|
const t = {};
|
|
84
86
|
Object.keys(this.outputs).forEach((n) => {
|
|
85
87
|
if (n === "_node") return;
|
|
86
|
-
const o = this.outputs[n]
|
|
87
|
-
o && o.state && (t[n] =
|
|
88
|
+
const o = this.outputs[n];
|
|
89
|
+
o && o.state && (t[n] = o.getValue());
|
|
88
90
|
}), this.state.script = q.render(this.state.codeTemplate, { inputs: e, outputs: t }), this.outputs.code && (this.outputs.code.state.script = this.state.script);
|
|
89
91
|
}
|
|
90
|
-
|
|
92
|
+
resetInputInterfaceScript() {
|
|
93
|
+
Object.values(this.inputs).forEach((e) => e.state.script = "");
|
|
94
|
+
}
|
|
95
|
+
updateCodeTemplate() {
|
|
96
|
+
this.state.codeTemplate = this.codeTemplate.call(this);
|
|
97
|
+
}
|
|
98
|
+
updateConnectedInputInterfaces() {
|
|
91
99
|
if (!this.graph) return;
|
|
92
100
|
const { connectionsFromNode: e } = Ce(this.graph);
|
|
93
|
-
e.has(this)
|
|
94
|
-
|
|
95
|
-
|
|
101
|
+
if (!e.has(this)) return;
|
|
102
|
+
const t = e.get(this);
|
|
103
|
+
t && t.forEach((n) => {
|
|
104
|
+
if (!n.from.isCodeNode || !n.to.isCodeNode) return;
|
|
105
|
+
const o = this.graph?.findNodeById(n.from.nodeId);
|
|
106
|
+
if (o)
|
|
107
|
+
if (o.renderCode(), n.to.allowMultipleConnections)
|
|
108
|
+
if (n.to.state.script.startsWith("[") && n.to.state.script.endsWith("]")) {
|
|
109
|
+
const a = JSON.parse(n.to.state.script);
|
|
110
|
+
n.to.state.script = JSON.stringify([...a, n.from.script]);
|
|
111
|
+
} else
|
|
112
|
+
n.to.state.script += n.from.script;
|
|
113
|
+
else
|
|
114
|
+
n.to.state.script = n.from.script;
|
|
96
115
|
});
|
|
97
116
|
}
|
|
98
117
|
updateOutputVariableName() {
|
|
99
|
-
this.outputs.code && (this.outputs.code.name = this.variableName);
|
|
118
|
+
this.outputs.code && (this.outputs.code.name = this.state.integrated ? "" : this.variableName);
|
|
100
119
|
}
|
|
101
120
|
}
|
|
102
|
-
class
|
|
121
|
+
class $e extends kt {
|
|
103
122
|
/**
|
|
104
123
|
* The default implementation does nothing.
|
|
105
124
|
* Overwrite this method to do calculation.
|
|
@@ -113,7 +132,7 @@ class Me extends _t {
|
|
|
113
132
|
}
|
|
114
133
|
save() {
|
|
115
134
|
const e = super.save();
|
|
116
|
-
return
|
|
135
|
+
return Ct(this.graph, e), e;
|
|
117
136
|
}
|
|
118
137
|
updateModules(e) {
|
|
119
138
|
if (e)
|
|
@@ -124,7 +143,7 @@ class Me extends _t {
|
|
|
124
143
|
}
|
|
125
144
|
}
|
|
126
145
|
}
|
|
127
|
-
const
|
|
146
|
+
const xt = (s) => {
|
|
128
147
|
const e = [], t = Object.keys(s);
|
|
129
148
|
return t.forEach((n) => {
|
|
130
149
|
if (s[n]?.hidden) return;
|
|
@@ -141,7 +160,7 @@ const Ys = (s) => {
|
|
|
141
160
|
}), Object.entries(e.outputs).forEach(([o, a]) => {
|
|
142
161
|
o !== "_node" && n.outputs[o] && (n.outputs[o].hidden = a.hidden);
|
|
143
162
|
});
|
|
144
|
-
},
|
|
163
|
+
}, Ct = (s, e) => {
|
|
145
164
|
if (!s) return;
|
|
146
165
|
const t = s.findNodeById(e.id);
|
|
147
166
|
if (!t || t.subgraph) return;
|
|
@@ -151,24 +170,7 @@ const Ys = (s) => {
|
|
|
151
170
|
}), Object.entries(e.outputs).forEach(([o, a]) => {
|
|
152
171
|
o !== "_node" && n.outputs[o] && (a.hidden = n.outputs[o].hidden);
|
|
153
172
|
});
|
|
154
|
-
},
|
|
155
|
-
let e;
|
|
156
|
-
if (s.value == null) return "None";
|
|
157
|
-
switch (s.type) {
|
|
158
|
-
case "boolean":
|
|
159
|
-
e = s.value ? "True" : "False";
|
|
160
|
-
break;
|
|
161
|
-
case "string":
|
|
162
|
-
e = `'${s.value}'`;
|
|
163
|
-
break;
|
|
164
|
-
case void 0:
|
|
165
|
-
e = "None";
|
|
166
|
-
break;
|
|
167
|
-
default:
|
|
168
|
-
e = `${s.value}`;
|
|
169
|
-
}
|
|
170
|
-
return e;
|
|
171
|
-
}, xt = ["title"], ie = /* @__PURE__ */ j({
|
|
173
|
+
}, It = ["title"], le = /* @__PURE__ */ L({
|
|
172
174
|
__name: "CodeNodeInterface",
|
|
173
175
|
props: {
|
|
174
176
|
intf: {}
|
|
@@ -176,16 +178,16 @@ const Ys = (s) => {
|
|
|
176
178
|
setup(s) {
|
|
177
179
|
return (e, t) => (i(), r("div", {
|
|
178
180
|
title: s.intf.state?.script
|
|
179
|
-
},
|
|
181
|
+
}, B(s.intf.name), 9, It));
|
|
180
182
|
}
|
|
181
183
|
});
|
|
182
|
-
class
|
|
184
|
+
class D extends Fe {
|
|
183
185
|
isCodeNode = !0;
|
|
184
186
|
code;
|
|
185
187
|
state;
|
|
186
188
|
type = null;
|
|
187
189
|
constructor(e, t) {
|
|
188
|
-
super(e, t), this.setComponent(
|
|
190
|
+
super(e, t), this.setComponent(M(le)), this.state = R({
|
|
189
191
|
optional: !1,
|
|
190
192
|
script: ""
|
|
191
193
|
});
|
|
@@ -196,13 +198,14 @@ class R extends Pe {
|
|
|
196
198
|
get shortId() {
|
|
197
199
|
return this.id.slice(0, 6);
|
|
198
200
|
}
|
|
201
|
+
getValue = () => `${this.value ?? "None"}`;
|
|
199
202
|
}
|
|
200
|
-
const
|
|
201
|
-
s.state.optional = e, s.setHidden(
|
|
203
|
+
const on = (s, e) => {
|
|
204
|
+
s.state.optional = e, s.setHidden(e);
|
|
202
205
|
};
|
|
203
|
-
class
|
|
206
|
+
class W extends D {
|
|
204
207
|
constructor(e = "", t) {
|
|
205
|
-
super(e, t), this.setComponent(
|
|
208
|
+
super(e, t), this.setComponent(M(le)), this.use(Ie, !0);
|
|
206
209
|
}
|
|
207
210
|
get value() {
|
|
208
211
|
return super.value;
|
|
@@ -211,80 +214,95 @@ class re extends R {
|
|
|
211
214
|
super.value = e, this.name !== "_node" && this.setHidden(!1);
|
|
212
215
|
}
|
|
213
216
|
}
|
|
214
|
-
const
|
|
215
|
-
new
|
|
217
|
+
const Te = new G("boolean"), Nt = new G("dict"), Ee = new G("list"), A = new G("node"), de = new G("number"), ue = new G("string"), Se = new G("tuple"), an = (s) => {
|
|
218
|
+
new We(s.editor, { viewPlugin: s }).addTypes(Te, Nt, Ee, A, de, ue, Se);
|
|
216
219
|
};
|
|
217
|
-
class
|
|
220
|
+
class rn extends W {
|
|
218
221
|
constructor(e, t) {
|
|
219
|
-
super(e, t), this.setComponent(
|
|
222
|
+
super(e, t), this.setComponent(M(Xe)), this.use(E, Te);
|
|
220
223
|
}
|
|
224
|
+
getValue = () => this.value ? "True" : "False";
|
|
221
225
|
}
|
|
222
|
-
class
|
|
226
|
+
class Mt extends D {
|
|
223
227
|
isCodeNodeOutput = !0;
|
|
224
228
|
constructor(e = "", t = "") {
|
|
225
|
-
super(e, t), this.setComponent(
|
|
229
|
+
super(e, t), this.setComponent(M(le));
|
|
226
230
|
}
|
|
227
231
|
get script() {
|
|
228
232
|
return this.name.length > 0 ? this.name : this.state.script;
|
|
229
233
|
}
|
|
230
234
|
}
|
|
231
|
-
class
|
|
235
|
+
class ce extends W {
|
|
232
236
|
min;
|
|
233
237
|
max;
|
|
234
238
|
constructor(e, t, n, o) {
|
|
235
|
-
super(e, t), this.min = n, this.max = o, this.use(
|
|
239
|
+
super(e, t), this.min = n, this.max = o, this.use(E, de);
|
|
236
240
|
}
|
|
237
241
|
validate(e) {
|
|
238
242
|
return (this.min === void 0 || e >= this.min) && (this.max === void 0 || e <= this.max);
|
|
239
243
|
}
|
|
240
244
|
}
|
|
241
|
-
class
|
|
242
|
-
component =
|
|
245
|
+
class ln extends ce {
|
|
246
|
+
component = M(Je);
|
|
243
247
|
validate(e) {
|
|
244
248
|
return Number.isInteger(e) && super.validate(e);
|
|
245
249
|
}
|
|
246
250
|
}
|
|
247
|
-
class
|
|
248
|
-
|
|
251
|
+
class dn extends W {
|
|
252
|
+
constructor(e = "", t = "") {
|
|
253
|
+
super(e, t), this.setComponent(M(se)), this.use(E, Ee);
|
|
254
|
+
}
|
|
255
|
+
getValue = () => `[${this.value}]`;
|
|
256
|
+
}
|
|
257
|
+
class un extends ce {
|
|
258
|
+
component = M(Ye);
|
|
249
259
|
}
|
|
250
|
-
class
|
|
260
|
+
class pe extends W {
|
|
251
261
|
constructor(e, t) {
|
|
252
|
-
super(e, t), this.use(
|
|
262
|
+
super(e, t), this.use(E, ue);
|
|
253
263
|
}
|
|
264
|
+
getValue = () => `'${this.value}'`;
|
|
254
265
|
}
|
|
255
|
-
class
|
|
256
|
-
component =
|
|
266
|
+
class cn extends pe {
|
|
267
|
+
component = M(qe);
|
|
257
268
|
items;
|
|
258
269
|
constructor(e, t, n) {
|
|
259
270
|
super(e, t), this.items = n;
|
|
260
271
|
}
|
|
261
272
|
}
|
|
262
|
-
class
|
|
263
|
-
component =
|
|
273
|
+
class pn extends ce {
|
|
274
|
+
component = M(Qe);
|
|
264
275
|
min;
|
|
265
276
|
max;
|
|
266
277
|
constructor(e, t, n, o) {
|
|
267
278
|
super(e, t, n, o), this.min = n, this.max = o;
|
|
268
279
|
}
|
|
280
|
+
getValue = () => `${Math.round(this.value * 1e3) / 1e3}`;
|
|
269
281
|
}
|
|
270
|
-
class
|
|
271
|
-
component =
|
|
282
|
+
class hn extends pe {
|
|
283
|
+
component = M(se);
|
|
272
284
|
}
|
|
273
|
-
class
|
|
274
|
-
component =
|
|
285
|
+
class vn extends pe {
|
|
286
|
+
component = M(Ke);
|
|
275
287
|
}
|
|
276
|
-
|
|
277
|
-
|
|
288
|
+
class mn extends W {
|
|
289
|
+
constructor(e = "", t = "") {
|
|
290
|
+
super(e, t), this.setComponent(M(se)), this.use(E, Se);
|
|
291
|
+
}
|
|
292
|
+
getValue = () => `(${this.value})`;
|
|
293
|
+
}
|
|
294
|
+
function fn(s) {
|
|
295
|
+
return class extends $e {
|
|
278
296
|
type = s.type;
|
|
279
297
|
inputs = {};
|
|
280
298
|
outputs = {};
|
|
281
299
|
constructor() {
|
|
282
|
-
super(), this._title = s.title ?? s.type, this.updateModules(s.modules), s.variableName && (this.state.variableName = s.variableName), s.codeTemplate && (this.codeTemplate = s.codeTemplate), this.addInput(
|
|
300
|
+
super(), this._title = s.title ?? s.type, this.name = s.name ?? s.type, this.updateModules(s.modules), s.variableName && (this.state.variableName = s.variableName), s.codeTemplate && (this.codeTemplate = s.codeTemplate), this.addInput(
|
|
283
301
|
"_node",
|
|
284
|
-
new
|
|
302
|
+
new D("", []).use(E, A).use(Y).setHidden(!0)
|
|
285
303
|
), this.addOutput(
|
|
286
304
|
"_node",
|
|
287
|
-
new
|
|
305
|
+
new D("", []).use(E, A).use(Y).setHidden(!0)
|
|
288
306
|
), this.executeFactory("input", s.inputs), this.executeFactory("output", s.outputs), s.onCreate?.call(this);
|
|
289
307
|
}
|
|
290
308
|
// public calculate = definition.calculate
|
|
@@ -310,7 +328,7 @@ function on(s) {
|
|
|
310
328
|
}
|
|
311
329
|
};
|
|
312
330
|
}
|
|
313
|
-
class
|
|
331
|
+
class $t extends $e {
|
|
314
332
|
/**
|
|
315
333
|
* The default implementation does nothing.
|
|
316
334
|
* Overwrite this method to do calculation.
|
|
@@ -320,8 +338,8 @@ class It extends Me {
|
|
|
320
338
|
*/
|
|
321
339
|
calculate;
|
|
322
340
|
}
|
|
323
|
-
function
|
|
324
|
-
return class extends
|
|
341
|
+
function gn(s) {
|
|
342
|
+
return class extends $t {
|
|
325
343
|
type = s.type;
|
|
326
344
|
inputs = {};
|
|
327
345
|
outputs = {};
|
|
@@ -330,12 +348,12 @@ function an(s) {
|
|
|
330
348
|
staticInputKeys = Object.keys(s.inputs ?? {});
|
|
331
349
|
staticOutputKeys = Object.keys(s.outputs ?? {});
|
|
332
350
|
constructor() {
|
|
333
|
-
super(), this._title = s.title ?? s.type, this.updateModules(s.modules), s.codeTemplate && (this.codeTemplate = s.codeTemplate), s.variableName && (this.state.variableName = s.variableName), this.addInput(
|
|
351
|
+
super(), this._title = s.title ?? s.type, this.name = s.name ?? s.type, this.updateModules(s.modules), s.codeTemplate && (this.codeTemplate = s.codeTemplate), s.variableName && (this.state.variableName = s.variableName), this.addInput(
|
|
334
352
|
"_node",
|
|
335
|
-
new
|
|
353
|
+
new D("", []).use(E, A).use(Y).setHidden(!0)
|
|
336
354
|
), this.addOutput(
|
|
337
355
|
"_node",
|
|
338
|
-
new
|
|
356
|
+
new D("", []).use(E, A).use(Y).setHidden(!0)
|
|
339
357
|
), this.staticInputKeys.push("_node"), this.staticOutputKeys.push("_node"), this.executeFactory("input", s.inputs), this.executeFactory("output", s.outputs), s.onCreate?.call(this);
|
|
340
358
|
}
|
|
341
359
|
onPlaced() {
|
|
@@ -361,14 +379,14 @@ function an(s) {
|
|
|
361
379
|
if (!this.inputs[t]) {
|
|
362
380
|
const n = e.inputs[t].value;
|
|
363
381
|
let o;
|
|
364
|
-
typeof n == "number" ? o = new
|
|
382
|
+
typeof n == "number" ? o = new Ze(t, n).use(E, de) : o = new et(t, JSON.stringify(n)).use(E, ue), o.use(Ie, !0), this.addInput(t, o);
|
|
365
383
|
}
|
|
366
384
|
this.inputs[t] && (this.inputs[t].load(e.inputs[t]), this.inputs[t].nodeId = this.id);
|
|
367
385
|
}
|
|
368
386
|
for (const t of Object.keys(e.outputs))
|
|
369
387
|
if (!this.staticOutputKeys.includes(t)) {
|
|
370
388
|
if (!this.outputs[t]) {
|
|
371
|
-
const n = new
|
|
389
|
+
const n = new Mt(t);
|
|
372
390
|
this.addOutput(t, n);
|
|
373
391
|
}
|
|
374
392
|
this.outputs[t] && (this.outputs[t].load(e.outputs[t]), this.outputs[t].nodeId = this.id);
|
|
@@ -389,12 +407,12 @@ function an(s) {
|
|
|
389
407
|
}
|
|
390
408
|
updateInterfaces(e, t, n) {
|
|
391
409
|
const o = e === "input" ? this.staticInputKeys : this.staticOutputKeys, a = e === "input" ? this.inputs : this.outputs;
|
|
392
|
-
for (const
|
|
393
|
-
o.includes(
|
|
394
|
-
for (const
|
|
395
|
-
if (a[
|
|
396
|
-
const
|
|
397
|
-
e === "input" ? this.addInput(
|
|
410
|
+
for (const d of Object.keys(a))
|
|
411
|
+
o.includes(d) || t[d] && !n.includes(d) || (e === "input" ? this.removeInput(d) : this.removeOutput(d));
|
|
412
|
+
for (const d of Object.keys(t)) {
|
|
413
|
+
if (a[d]) continue;
|
|
414
|
+
const u = t[d]();
|
|
415
|
+
e === "input" ? this.addInput(d, u) : this.addOutput(d, u);
|
|
398
416
|
}
|
|
399
417
|
}
|
|
400
418
|
executeFactory(e, t) {
|
|
@@ -406,12 +424,12 @@ function an(s) {
|
|
|
406
424
|
};
|
|
407
425
|
}
|
|
408
426
|
q.escape = (s) => s;
|
|
409
|
-
class
|
|
427
|
+
class Ot {
|
|
410
428
|
_id;
|
|
411
429
|
_viewModel;
|
|
412
430
|
_state;
|
|
413
431
|
constructor(e) {
|
|
414
|
-
this._id =
|
|
432
|
+
this._id = _t(), this._viewModel = e, this._state = R({
|
|
415
433
|
autosort: !1,
|
|
416
434
|
modules: {},
|
|
417
435
|
script: "",
|
|
@@ -420,7 +438,7 @@ class Mt {
|
|
|
420
438
|
});
|
|
421
439
|
}
|
|
422
440
|
get codeNodes() {
|
|
423
|
-
return
|
|
441
|
+
return te(this.graph);
|
|
424
442
|
}
|
|
425
443
|
get connections() {
|
|
426
444
|
return this.graph.connections;
|
|
@@ -450,8 +468,8 @@ class Mt {
|
|
|
450
468
|
this.graph._nodes = e;
|
|
451
469
|
}
|
|
452
470
|
get scriptedCodeNodes() {
|
|
453
|
-
return
|
|
454
|
-
(e) => e.state?.
|
|
471
|
+
return te(this.graph).filter(
|
|
472
|
+
(e) => !e.state?.integrated
|
|
455
473
|
);
|
|
456
474
|
}
|
|
457
475
|
get shortId() {
|
|
@@ -558,6 +576,9 @@ class Mt {
|
|
|
558
576
|
renderCode() {
|
|
559
577
|
this.state.script = q.render(this.state.template || "", this);
|
|
560
578
|
}
|
|
579
|
+
resetInputInterfaceScript() {
|
|
580
|
+
this.codeNodes.forEach((e) => e.resetInputInterfaceScript());
|
|
581
|
+
}
|
|
561
582
|
/**
|
|
562
583
|
* Save code graph.
|
|
563
584
|
* @returns graph state
|
|
@@ -574,10 +595,10 @@ class Mt {
|
|
|
574
595
|
saveNodeStates(e) {
|
|
575
596
|
e.forEach((t, n) => {
|
|
576
597
|
const o = this.nodes[n];
|
|
577
|
-
Object.entries(t.inputs).forEach(([a,
|
|
578
|
-
t.inputs && o.inputs[a] && (
|
|
579
|
-
}), Object.entries(t.outputs).forEach(([a,
|
|
580
|
-
t.outputs && o.outputs[a] && (
|
|
598
|
+
Object.entries(t.inputs).forEach(([a, d]) => {
|
|
599
|
+
t.inputs && o.inputs[a] && (d.hidden = o.inputs[a].hidden);
|
|
600
|
+
}), Object.entries(t.outputs).forEach(([a, d]) => {
|
|
601
|
+
t.outputs && o.outputs[a] && (d.hidden = o.outputs[a].hidden);
|
|
581
602
|
});
|
|
582
603
|
});
|
|
583
604
|
}
|
|
@@ -592,7 +613,7 @@ class Mt {
|
|
|
592
613
|
a.from.nodeId
|
|
593
614
|
]);
|
|
594
615
|
let t = [...this.nodeIds];
|
|
595
|
-
t.reverse(), t =
|
|
616
|
+
t.reverse(), t = yt.array(t, e), t.reverse();
|
|
596
617
|
const n = this.graph.nodes.map((a) => a.id).filter((a) => !t.includes(a));
|
|
597
618
|
t = t.concat(n);
|
|
598
619
|
const o = t.map((a) => this.findNodeById(a));
|
|
@@ -601,22 +622,25 @@ class Mt {
|
|
|
601
622
|
console.warn("Failed to sort nodes.");
|
|
602
623
|
}
|
|
603
624
|
}
|
|
625
|
+
updateCodeTemplates() {
|
|
626
|
+
this.codeNodes.forEach((e) => e.updateCodeTemplate());
|
|
627
|
+
}
|
|
604
628
|
updateOutputVariableNames() {
|
|
605
629
|
this.codeNodes.forEach((e) => e.updateOutputVariableName());
|
|
606
630
|
}
|
|
607
631
|
}
|
|
608
|
-
const
|
|
632
|
+
const te = (s) => {
|
|
609
633
|
let e = [];
|
|
610
634
|
return s.nodes.forEach((t) => {
|
|
611
|
-
t.subgraph ? e = e.concat(
|
|
635
|
+
t.subgraph ? e = e.concat(te(t.subgraph)) : t.isCodeNode && e.push(t);
|
|
612
636
|
}), e;
|
|
613
|
-
},
|
|
637
|
+
}, bn = (s = 0, e = 100) => ({
|
|
614
638
|
x: s * 420,
|
|
615
639
|
y: e
|
|
616
|
-
}),
|
|
640
|
+
}), yn = (s) => {
|
|
617
641
|
const e = { ...s.position };
|
|
618
642
|
return e.x -= 400, e.y += 50, e;
|
|
619
|
-
},
|
|
643
|
+
}, _n = (s) => {
|
|
620
644
|
const { calculationOrder: e, connectionsFromNode: t } = Ce(s);
|
|
621
645
|
e.forEach((n) => {
|
|
622
646
|
if (!n.isCodeNode) return;
|
|
@@ -625,45 +649,91 @@ const Z = (s) => {
|
|
|
625
649
|
a.to.state && a.from.script && (a.to.state.script = a.from.script);
|
|
626
650
|
});
|
|
627
651
|
});
|
|
628
|
-
},
|
|
652
|
+
}, Tt = ["id"], Et = { class: "align-middle" }, ke = /* @__PURE__ */ L({
|
|
629
653
|
__name: "CodeGraphNodeInterface",
|
|
630
654
|
props: {
|
|
631
655
|
node: {},
|
|
632
656
|
intf: {}
|
|
633
657
|
},
|
|
634
658
|
setup(s) {
|
|
635
|
-
const e = s, { viewModel: t } = F(), { hoveredOver: n, temporaryConnection: o } =
|
|
636
|
-
"--connected":
|
|
637
|
-
})),
|
|
659
|
+
const e = s, { viewModel: t } = F(), { hoveredOver: n, temporaryConnection: o } = tt(), a = T(null), d = _(() => e.intf.connectionCount > 0), u = _(() => ({
|
|
660
|
+
"--connected": d.value
|
|
661
|
+
})), m = () => {
|
|
638
662
|
n(e.intf);
|
|
639
|
-
},
|
|
663
|
+
}, w = () => {
|
|
640
664
|
n(void 0);
|
|
641
|
-
},
|
|
665
|
+
}, k = () => {
|
|
642
666
|
a.value && t.value.hooks.renderInterface.execute({ intf: e.intf, el: a.value });
|
|
643
667
|
};
|
|
644
|
-
return
|
|
668
|
+
return oe(k), Ne(k), (O, j) => (i(), r("div", {
|
|
645
669
|
id: s.intf.id,
|
|
646
670
|
ref_key: "el",
|
|
647
671
|
ref: a,
|
|
648
|
-
class: U(["baklava-node-interface",
|
|
672
|
+
class: U(["baklava-node-interface", u.value])
|
|
649
673
|
}, [
|
|
650
674
|
s.intf.port ? (i(), r("div", {
|
|
651
675
|
key: 0,
|
|
652
|
-
class: U(["__port", { "--selected":
|
|
653
|
-
onPointerover:
|
|
654
|
-
onPointerout:
|
|
655
|
-
}, null, 34)) :
|
|
656
|
-
|
|
657
|
-
|
|
676
|
+
class: U(["__port", { "--selected": y(o)?.from === s.intf }]),
|
|
677
|
+
onPointerover: m,
|
|
678
|
+
onPointerout: w
|
|
679
|
+
}, null, 34)) : I("", !0),
|
|
680
|
+
l("span", Et, [
|
|
681
|
+
Z(O.$slots, "default")
|
|
658
682
|
])
|
|
659
|
-
], 10,
|
|
683
|
+
], 10, Tt));
|
|
660
684
|
}
|
|
661
|
-
}),
|
|
685
|
+
}), $ = (s, e) => {
|
|
662
686
|
const t = s.__vccOpts || s;
|
|
663
687
|
for (const [n, o] of e)
|
|
664
688
|
t[n] = o;
|
|
665
689
|
return t;
|
|
666
|
-
},
|
|
690
|
+
}, St = {}, zt = {
|
|
691
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
692
|
+
width: "24",
|
|
693
|
+
height: "24",
|
|
694
|
+
viewBox: "0 0 24 24",
|
|
695
|
+
fill: "none",
|
|
696
|
+
stroke: "currentColor",
|
|
697
|
+
"stroke-width": "2",
|
|
698
|
+
"stroke-linecap": "round",
|
|
699
|
+
"stroke-linejoin": "round",
|
|
700
|
+
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-code-variable"
|
|
701
|
+
};
|
|
702
|
+
function Vt(s, e) {
|
|
703
|
+
return i(), r("svg", zt, [...e[0] || (e[0] = [
|
|
704
|
+
l("path", {
|
|
705
|
+
stroke: "none",
|
|
706
|
+
d: "M0 0h24v24H0z",
|
|
707
|
+
fill: "none"
|
|
708
|
+
}, null, -1),
|
|
709
|
+
l("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)
|
|
710
|
+
])]);
|
|
711
|
+
}
|
|
712
|
+
const Bt = /* @__PURE__ */ $(St, [["render", Vt]]), jt = {}, Lt = {
|
|
713
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
714
|
+
width: "24",
|
|
715
|
+
height: "24",
|
|
716
|
+
viewBox: "0 0 24 24",
|
|
717
|
+
fill: "none",
|
|
718
|
+
stroke: "currentColor",
|
|
719
|
+
"stroke-width": "2",
|
|
720
|
+
"stroke-linecap": "round",
|
|
721
|
+
"stroke-linejoin": "round",
|
|
722
|
+
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-dots-vertical"
|
|
723
|
+
};
|
|
724
|
+
function Ut(s, e) {
|
|
725
|
+
return i(), r("svg", Lt, [...e[0] || (e[0] = [
|
|
726
|
+
l("path", {
|
|
727
|
+
stroke: "none",
|
|
728
|
+
d: "M0 0h24v24H0z",
|
|
729
|
+
fill: "none"
|
|
730
|
+
}, null, -1),
|
|
731
|
+
l("path", { d: "M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1),
|
|
732
|
+
l("path", { d: "M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1),
|
|
733
|
+
l("path", { d: "M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1)
|
|
734
|
+
])]);
|
|
735
|
+
}
|
|
736
|
+
const Gt = /* @__PURE__ */ $(jt, [["render", Ut]]), Rt = {}, Dt = {
|
|
667
737
|
xmlns: "http://www.w3.org/2000/svg",
|
|
668
738
|
width: "24",
|
|
669
739
|
height: "24",
|
|
@@ -671,17 +741,17 @@ const Z = (s) => {
|
|
|
671
741
|
fill: "currentColor",
|
|
672
742
|
class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-collapse"
|
|
673
743
|
};
|
|
674
|
-
function
|
|
675
|
-
return i(), r("svg",
|
|
676
|
-
|
|
744
|
+
function Pt(s, e) {
|
|
745
|
+
return i(), r("svg", Dt, [...e[0] || (e[0] = [
|
|
746
|
+
l("path", {
|
|
677
747
|
stroke: "none",
|
|
678
748
|
d: "M0 0h24v24H0z",
|
|
679
749
|
fill: "none"
|
|
680
750
|
}, null, -1),
|
|
681
|
-
|
|
751
|
+
l("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)
|
|
682
752
|
])]);
|
|
683
753
|
}
|
|
684
|
-
const
|
|
754
|
+
const Ht = /* @__PURE__ */ $(Rt, [["render", Pt]]), At = {}, Ft = {
|
|
685
755
|
xmlns: "http://www.w3.org/2000/svg",
|
|
686
756
|
width: "24",
|
|
687
757
|
height: "24",
|
|
@@ -689,17 +759,17 @@ const zt = /* @__PURE__ */ z(Tt, [["render", St]]), Bt = {}, Lt = {
|
|
|
689
759
|
fill: "currentColor",
|
|
690
760
|
class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-expand"
|
|
691
761
|
};
|
|
692
|
-
function
|
|
693
|
-
return i(), r("svg",
|
|
694
|
-
|
|
762
|
+
function Wt(s, e) {
|
|
763
|
+
return i(), r("svg", Ft, [...e[0] || (e[0] = [
|
|
764
|
+
l("path", {
|
|
695
765
|
stroke: "none",
|
|
696
766
|
d: "M0 0h24v24H0z",
|
|
697
767
|
fill: "none"
|
|
698
768
|
}, null, -1),
|
|
699
|
-
|
|
769
|
+
l("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)
|
|
700
770
|
])]);
|
|
701
771
|
}
|
|
702
|
-
const
|
|
772
|
+
const Xt = /* @__PURE__ */ $(At, [["render", Wt]]), Jt = {}, Yt = {
|
|
703
773
|
xmlns: "http://www.w3.org/2000/svg",
|
|
704
774
|
width: "24",
|
|
705
775
|
height: "24",
|
|
@@ -707,17 +777,17 @@ const jt = /* @__PURE__ */ z(Bt, [["render", Vt]]), Ut = {}, Gt = {
|
|
|
707
777
|
fill: "currentColor",
|
|
708
778
|
class: "balkava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right"
|
|
709
779
|
};
|
|
710
|
-
function
|
|
711
|
-
return i(), r("svg",
|
|
712
|
-
|
|
780
|
+
function qt(s, e) {
|
|
781
|
+
return i(), r("svg", Yt, [...e[0] || (e[0] = [
|
|
782
|
+
l("path", {
|
|
713
783
|
stroke: "none",
|
|
714
784
|
d: "M0 0h24v24H0z",
|
|
715
785
|
fill: "none"
|
|
716
786
|
}, null, -1),
|
|
717
|
-
|
|
787
|
+
l("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)
|
|
718
788
|
])]);
|
|
719
789
|
}
|
|
720
|
-
const
|
|
790
|
+
const Qt = /* @__PURE__ */ $(Jt, [["render", qt]]), Kt = {}, Zt = {
|
|
721
791
|
xmlns: "http://www.w3.org/2000/svg",
|
|
722
792
|
width: "24",
|
|
723
793
|
height: "24",
|
|
@@ -725,17 +795,17 @@ const Dt = /* @__PURE__ */ z(Ut, [["render", Rt]]), Pt = {}, Ht = {
|
|
|
725
795
|
fill: "currentColor",
|
|
726
796
|
class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-collapse"
|
|
727
797
|
};
|
|
728
|
-
function
|
|
729
|
-
return i(), r("svg",
|
|
730
|
-
|
|
798
|
+
function es(s, e) {
|
|
799
|
+
return i(), r("svg", Zt, [...e[0] || (e[0] = [
|
|
800
|
+
l("path", {
|
|
731
801
|
stroke: "none",
|
|
732
802
|
d: "M0 0h24v24H0z",
|
|
733
803
|
fill: "none"
|
|
734
804
|
}, null, -1),
|
|
735
|
-
|
|
805
|
+
l("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)
|
|
736
806
|
])]);
|
|
737
807
|
}
|
|
738
|
-
const
|
|
808
|
+
const ts = /* @__PURE__ */ $(Kt, [["render", es]]), ss = {}, ns = {
|
|
739
809
|
xmlns: "http://www.w3.org/2000/svg",
|
|
740
810
|
width: "24",
|
|
741
811
|
height: "24",
|
|
@@ -743,19 +813,18 @@ const Ft = /* @__PURE__ */ z(Pt, [["render", At]]), Wt = {}, Xt = {
|
|
|
743
813
|
fill: "currentColor",
|
|
744
814
|
class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-expand"
|
|
745
815
|
};
|
|
746
|
-
function
|
|
747
|
-
return i(), r("svg",
|
|
748
|
-
|
|
816
|
+
function os(s, e) {
|
|
817
|
+
return i(), r("svg", ns, [...e[0] || (e[0] = [
|
|
818
|
+
l("path", {
|
|
749
819
|
stroke: "none",
|
|
750
820
|
d: "M0 0h24v24H0z",
|
|
751
821
|
fill: "none"
|
|
752
822
|
}, null, -1),
|
|
753
|
-
|
|
823
|
+
l("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)
|
|
754
824
|
])]);
|
|
755
825
|
}
|
|
756
|
-
const
|
|
826
|
+
const as = /* @__PURE__ */ $(ss, [["render", os]]), is = {}, rs = {
|
|
757
827
|
xmlns: "http://www.w3.org/2000/svg",
|
|
758
|
-
class: "baklava-icon",
|
|
759
828
|
width: "24",
|
|
760
829
|
height: "24",
|
|
761
830
|
viewBox: "0 0 24 24",
|
|
@@ -763,16 +832,16 @@ const qt = /* @__PURE__ */ z(Wt, [["render", Yt]]), Jt = {}, Qt = {
|
|
|
763
832
|
stroke: "currentColor",
|
|
764
833
|
"stroke-width": "2",
|
|
765
834
|
"stroke-linecap": "round",
|
|
766
|
-
"stroke-linejoin": "round"
|
|
835
|
+
"stroke-linejoin": "round",
|
|
836
|
+
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema"
|
|
767
837
|
};
|
|
768
|
-
function
|
|
769
|
-
return i(), r("svg",
|
|
770
|
-
|
|
838
|
+
function ls(s, e) {
|
|
839
|
+
return i(), r("svg", rs, [...e[0] || (e[0] = [
|
|
840
|
+
Q('<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)
|
|
771
841
|
])]);
|
|
772
842
|
}
|
|
773
|
-
const
|
|
843
|
+
const ds = /* @__PURE__ */ $(is, [["render", ls]]), us = {}, cs = {
|
|
774
844
|
xmlns: "http://www.w3.org/2000/svg",
|
|
775
|
-
class: "baklava-icon",
|
|
776
845
|
width: "24",
|
|
777
846
|
height: "24",
|
|
778
847
|
viewBox: "0 0 24 24",
|
|
@@ -780,16 +849,16 @@ const Zt = /* @__PURE__ */ z(Jt, [["render", Kt]]), es = {}, ts = {
|
|
|
780
849
|
stroke: "currentColor",
|
|
781
850
|
"stroke-width": "2",
|
|
782
851
|
"stroke-linecap": "round",
|
|
783
|
-
"stroke-linejoin": "round"
|
|
852
|
+
"stroke-linejoin": "round",
|
|
853
|
+
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema-off"
|
|
784
854
|
};
|
|
785
|
-
function
|
|
786
|
-
return i(), r("svg",
|
|
787
|
-
|
|
855
|
+
function ps(s, e) {
|
|
856
|
+
return i(), r("svg", cs, [...e[0] || (e[0] = [
|
|
857
|
+
Q('<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)
|
|
788
858
|
])]);
|
|
789
859
|
}
|
|
790
|
-
const
|
|
860
|
+
const hs = /* @__PURE__ */ $(us, [["render", ps]]), vs = {}, ms = {
|
|
791
861
|
xmlns: "http://www.w3.org/2000/svg",
|
|
792
|
-
class: "baklava-icon",
|
|
793
862
|
width: "24",
|
|
794
863
|
height: "24",
|
|
795
864
|
viewBox: "0 0 24 24",
|
|
@@ -797,56 +866,38 @@ const ns = /* @__PURE__ */ z(es, [["render", ss]]), os = {}, as = {
|
|
|
797
866
|
stroke: "currentColor",
|
|
798
867
|
"stroke-width": "2",
|
|
799
868
|
"stroke-linecap": "round",
|
|
800
|
-
"stroke-linejoin": "round"
|
|
869
|
+
"stroke-linejoin": "round",
|
|
870
|
+
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-transition-bottom"
|
|
801
871
|
};
|
|
802
|
-
function
|
|
803
|
-
return i(), r("svg",
|
|
804
|
-
|
|
872
|
+
function fs(s, e) {
|
|
873
|
+
return i(), r("svg", ms, [...e[0] || (e[0] = [
|
|
874
|
+
Q('<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)
|
|
805
875
|
])]);
|
|
806
876
|
}
|
|
807
|
-
const
|
|
877
|
+
const gs = /* @__PURE__ */ $(vs, [["render", fs]]), bs = {}, ys = {
|
|
808
878
|
xmlns: "http://www.w3.org/2000/svg",
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
height: "16",
|
|
879
|
+
width: "24",
|
|
880
|
+
height: "24",
|
|
812
881
|
viewBox: "0 0 24 24",
|
|
813
|
-
"stroke-width": "2",
|
|
814
|
-
stroke: "currentColor",
|
|
815
882
|
fill: "none",
|
|
883
|
+
stroke: "currentColor",
|
|
884
|
+
"stroke-width": "2",
|
|
816
885
|
"stroke-linecap": "round",
|
|
817
|
-
"stroke-linejoin": "round"
|
|
886
|
+
"stroke-linejoin": "round",
|
|
887
|
+
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-trash-off"
|
|
818
888
|
};
|
|
819
|
-
function
|
|
820
|
-
return i(), r("svg",
|
|
821
|
-
|
|
822
|
-
stroke: "none",
|
|
823
|
-
d: "M0 0h24v24H0z",
|
|
824
|
-
fill: "none"
|
|
825
|
-
}, null, -1),
|
|
826
|
-
d("circle", {
|
|
827
|
-
cx: "12",
|
|
828
|
-
cy: "12",
|
|
829
|
-
r: "1"
|
|
830
|
-
}, null, -1),
|
|
831
|
-
d("circle", {
|
|
832
|
-
cx: "12",
|
|
833
|
-
cy: "19",
|
|
834
|
-
r: "1"
|
|
835
|
-
}, null, -1),
|
|
836
|
-
d("circle", {
|
|
837
|
-
cx: "12",
|
|
838
|
-
cy: "5",
|
|
839
|
-
r: "1"
|
|
840
|
-
}, null, -1)
|
|
889
|
+
function _s(s, e) {
|
|
890
|
+
return i(), r("svg", ys, [...e[0] || (e[0] = [
|
|
891
|
+
Q('<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)
|
|
841
892
|
])]);
|
|
842
893
|
}
|
|
843
|
-
const
|
|
894
|
+
const ws = /* @__PURE__ */ $(bs, [["render", _s]]), ks = ["id", "data-node-type"], xs = {
|
|
844
895
|
class: "__title-label",
|
|
845
896
|
style: { "flex-grow": "1" }
|
|
846
|
-
},
|
|
897
|
+
}, Cs = { key: 0 }, Is = {
|
|
847
898
|
class: "__menu",
|
|
848
899
|
style: { display: "flex" }
|
|
849
|
-
},
|
|
900
|
+
}, Ns = { class: "__outputs" }, Ms = { key: 0 }, $s = ["id", "title"], Os = { class: "__inputs" }, Ts = { key: 0 }, Es = ["id", "title"], Ss = /* @__PURE__ */ L({
|
|
850
901
|
__name: "CodeGraphNode",
|
|
851
902
|
props: {
|
|
852
903
|
node: {},
|
|
@@ -855,223 +906,235 @@ const cs = /* @__PURE__ */ z(ds, [["render", us]]), ps = ["id", "data-node-type"
|
|
|
855
906
|
},
|
|
856
907
|
emits: ["select", "start-drag", "update"],
|
|
857
908
|
setup(s, { emit: e }) {
|
|
858
|
-
const t =
|
|
859
|
-
let
|
|
860
|
-
const
|
|
909
|
+
const t = we.ContextMenu, n = we.NodeInterface, o = s, a = _(() => o.node), d = e, { viewModel: u } = F(), { graph: m, switchGraph: w } = ne(), k = T(null), O = T(!1), j = T(""), x = T(null), f = T(!1);
|
|
910
|
+
let g = 0, v = 0;
|
|
911
|
+
const h = T(!1), C = _(() => {
|
|
861
912
|
const c = [
|
|
862
913
|
{ value: "edit", label: "Edit" },
|
|
863
914
|
{ value: "rename", label: "Rename" },
|
|
864
915
|
{ value: "delete", label: "Delete" }
|
|
865
916
|
];
|
|
866
|
-
return o.node.type.startsWith(
|
|
867
|
-
}),
|
|
917
|
+
return o.node.type.startsWith(K) && c.push({ value: "editSubgraph", label: "Edit Subgraph" }), c;
|
|
918
|
+
}), N = _(() => ({
|
|
868
919
|
"--selected": o.selected,
|
|
869
920
|
"--dragging": o.dragging,
|
|
870
921
|
"--two-column": !!o.node.twoColumn,
|
|
871
922
|
"--hidden": a.value.state?.hidden
|
|
872
|
-
})),
|
|
873
|
-
"--reverse-y": o.node.reverseY ??
|
|
874
|
-
})),
|
|
923
|
+
})), ze = _(() => ({
|
|
924
|
+
"--reverse-y": o.node.reverseY ?? u.value.settings.nodes.reverseY
|
|
925
|
+
})), Ve = _(() => ({
|
|
875
926
|
top: `${o.node.position?.y ?? 0}px`,
|
|
876
927
|
left: `${o.node.position?.x ?? 0}px`,
|
|
877
|
-
"--width": `${o.node.width ??
|
|
878
|
-
})),
|
|
879
|
-
|
|
880
|
-
},
|
|
881
|
-
o.selected ||
|
|
882
|
-
}, he = () => {
|
|
883
|
-
p.value = !0;
|
|
884
|
-
}, Le = () => {
|
|
885
|
-
const c = l.value.displayedGraph.sidebar;
|
|
886
|
-
c.nodeId = "", c.visible = !1;
|
|
928
|
+
"--width": `${o.node.width ?? u.value.settings.nodes.defaultWidth}px`
|
|
929
|
+
})), Be = _(() => Object.values(o.node.inputs).filter((c) => !c.hidden)), je = _(() => Object.values(o.node.outputs).filter((c) => !c.hidden)), he = () => {
|
|
930
|
+
d("select");
|
|
931
|
+
}, Le = (c) => {
|
|
932
|
+
o.selected || he(), d("start-drag", c);
|
|
887
933
|
}, ve = () => {
|
|
888
|
-
|
|
934
|
+
h.value = !0;
|
|
935
|
+
}, Ue = () => {
|
|
936
|
+
const c = u.value.displayedGraph.sidebar;
|
|
937
|
+
c.nodeId = "", c.visible = !1;
|
|
938
|
+
}, me = () => {
|
|
939
|
+
const c = u.value.displayedGraph.sidebar;
|
|
889
940
|
c.nodeId = o.node.id, c.visible = !0;
|
|
890
|
-
},
|
|
891
|
-
const c =
|
|
941
|
+
}, Ge = () => {
|
|
942
|
+
const c = u.value.displayedGraph.sidebar;
|
|
892
943
|
c.nodeId = o.node.id;
|
|
893
|
-
},
|
|
944
|
+
}, Re = async (c) => {
|
|
894
945
|
switch (c) {
|
|
895
946
|
case "edit":
|
|
896
|
-
|
|
947
|
+
me();
|
|
897
948
|
break;
|
|
898
949
|
case "delete":
|
|
899
|
-
|
|
950
|
+
m.value.removeNode(o.node);
|
|
900
951
|
break;
|
|
901
952
|
case "rename":
|
|
902
|
-
|
|
953
|
+
j.value = o.node.title, O.value = !0, await ct(), x.value?.focus();
|
|
903
954
|
break;
|
|
904
955
|
case "editSubgraph":
|
|
905
|
-
|
|
956
|
+
w(o.node.template);
|
|
906
957
|
break;
|
|
907
958
|
}
|
|
908
|
-
}, me = () => {
|
|
909
|
-
o.node.title = B.value, M.value = !1;
|
|
910
959
|
}, fe = () => {
|
|
911
|
-
|
|
912
|
-
},
|
|
913
|
-
|
|
914
|
-
},
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
},
|
|
919
|
-
|
|
960
|
+
o.node.title = j.value, O.value = !1;
|
|
961
|
+
}, ge = () => {
|
|
962
|
+
k.value && u.value.hooks.renderNode.execute({ node: o.node, el: k.value });
|
|
963
|
+
}, De = (c) => {
|
|
964
|
+
f.value = !0, g = o.node.width, v = c.clientX, c.preventDefault();
|
|
965
|
+
}, be = (c) => {
|
|
966
|
+
a.value.state && (a.value.state.integrated = c, d("update"));
|
|
967
|
+
}, ye = (c) => {
|
|
968
|
+
if (!f.value) return;
|
|
969
|
+
const b = c.clientX - v, p = g + b / m.value.scaling, Pe = u.value.settings.nodes.minWidth, He = u.value.settings.nodes.maxWidth;
|
|
970
|
+
o.node.width = Math.max(Pe, Math.min(He, p));
|
|
971
|
+
}, _e = () => {
|
|
972
|
+
f.value = !1;
|
|
920
973
|
};
|
|
921
|
-
return
|
|
922
|
-
|
|
923
|
-
}), Ne(
|
|
924
|
-
window.removeEventListener("mousemove",
|
|
925
|
-
}), (c,
|
|
974
|
+
return oe(() => {
|
|
975
|
+
ge(), window.addEventListener("mousemove", ye), window.addEventListener("mouseup", _e);
|
|
976
|
+
}), Ne(ge), dt(() => {
|
|
977
|
+
window.removeEventListener("mousemove", ye), window.removeEventListener("mouseup", _e);
|
|
978
|
+
}), (c, b) => (i(), r("div", {
|
|
926
979
|
id: a.value.id,
|
|
927
980
|
ref_key: "el",
|
|
928
|
-
ref:
|
|
929
|
-
class: U([
|
|
981
|
+
ref: k,
|
|
982
|
+
class: U([N.value, "baklava-node"]),
|
|
930
983
|
"data-node-type": a.value.type,
|
|
931
|
-
style:
|
|
932
|
-
onPointerdown:
|
|
984
|
+
style: ae(Ve.value),
|
|
985
|
+
onPointerdown: he
|
|
933
986
|
}, [
|
|
934
|
-
|
|
987
|
+
y(u).settings.nodes.resizable ? (i(), r("div", {
|
|
935
988
|
key: 0,
|
|
936
989
|
class: "__resize-handle",
|
|
937
|
-
onMousedown:
|
|
938
|
-
}, null, 32)) :
|
|
939
|
-
|
|
990
|
+
onMousedown: De
|
|
991
|
+
}, null, 32)) : I("", !0),
|
|
992
|
+
l("div", {
|
|
940
993
|
class: "__title",
|
|
941
|
-
onPointerdown: P(
|
|
942
|
-
onContextmenu: P(
|
|
994
|
+
onPointerdown: P(Le, ["self", "stop"]),
|
|
995
|
+
onContextmenu: P(ve, ["prevent"])
|
|
943
996
|
}, [
|
|
944
|
-
a.value.inputs._node ? (i(),
|
|
997
|
+
a.value.inputs._node ? (i(), S(ke, {
|
|
945
998
|
key: 0,
|
|
946
999
|
node: a.value,
|
|
947
1000
|
intf: a.value.inputs._node,
|
|
948
1001
|
class: "--input",
|
|
949
1002
|
"data-interface-type": "node",
|
|
950
1003
|
style: { "flex-grow": "0" }
|
|
951
|
-
}, null, 8, ["node", "intf"])) :
|
|
952
|
-
|
|
1004
|
+
}, null, 8, ["node", "intf"])) : I("", !0),
|
|
1005
|
+
O.value ? ie((i(), r("input", {
|
|
953
1006
|
key: 2,
|
|
954
1007
|
ref_key: "renameInputEl",
|
|
955
|
-
ref:
|
|
956
|
-
"onUpdate:modelValue":
|
|
1008
|
+
ref: x,
|
|
1009
|
+
"onUpdate:modelValue": b[3] || (b[3] = (p) => j.value = p),
|
|
957
1010
|
class: "baklava-input",
|
|
958
1011
|
placeholder: "Node Name",
|
|
959
1012
|
style: { "flex-grow": "1" },
|
|
960
1013
|
type: "text",
|
|
961
|
-
onBlur:
|
|
962
|
-
onKeydown:
|
|
1014
|
+
onBlur: fe,
|
|
1015
|
+
onKeydown: ee(fe, ["enter"])
|
|
963
1016
|
}, null, 544)), [
|
|
964
|
-
[
|
|
965
|
-
]) : (i(), r(
|
|
966
|
-
|
|
967
|
-
a.value.idx > -1 ? (i(), r("span",
|
|
968
|
-
|
|
1017
|
+
[re, j.value]
|
|
1018
|
+
]) : (i(), r(z, { key: 1 }, [
|
|
1019
|
+
l("div", xs, [
|
|
1020
|
+
a.value.idx > -1 ? (i(), r("span", Cs, B(a.value.idx + 1) + " - ", 1)) : I("", !0),
|
|
1021
|
+
ut(B(a.value.title) + " (" + B(a.value.shortId) + ") ", 1)
|
|
969
1022
|
]),
|
|
970
|
-
|
|
971
|
-
a.value.subgraph ?
|
|
972
|
-
|
|
1023
|
+
l("div", Is, [
|
|
1024
|
+
a.value.subgraph ? I("", !0) : (i(), r(z, { key: 0 }, [
|
|
1025
|
+
a.value.state.integrated ? (i(), S(y(Bt), {
|
|
973
1026
|
key: 0,
|
|
974
1027
|
class: "--clickable mx-1",
|
|
975
|
-
onClick:
|
|
976
|
-
})) :
|
|
1028
|
+
onClick: b[0] || (b[0] = (p) => be(!1))
|
|
1029
|
+
})) : (i(), S(y(gs), {
|
|
977
1030
|
key: 1,
|
|
978
1031
|
class: "--clickable mx-1",
|
|
979
|
-
onClick:
|
|
980
|
-
}))
|
|
1032
|
+
onClick: b[1] || (b[1] = (p) => be(!0))
|
|
1033
|
+
})),
|
|
1034
|
+
!y(u).displayedGraph.sidebar.visible && y(u).displayedGraph.sidebar.nodeId !== a.value.id ? (i(), S(y(as), {
|
|
981
1035
|
key: 2,
|
|
982
1036
|
class: "--clickable mx-1",
|
|
983
|
-
onClick:
|
|
1037
|
+
onClick: me
|
|
1038
|
+
})) : y(u).displayedGraph.sidebar.visible && y(u).displayedGraph.sidebar.nodeId !== a.value.id ? (i(), S(y(Qt), {
|
|
1039
|
+
key: 3,
|
|
1040
|
+
class: "--clickable mx-1",
|
|
1041
|
+
onClick: Ge
|
|
1042
|
+
})) : (i(), S(y(ts), {
|
|
1043
|
+
key: 4,
|
|
1044
|
+
class: "--clickable mx-1",
|
|
1045
|
+
onClick: Ue
|
|
984
1046
|
}))
|
|
985
1047
|
], 64)),
|
|
986
|
-
|
|
1048
|
+
V(y(Gt), {
|
|
987
1049
|
class: "--clickable mx-1",
|
|
988
|
-
onClick:
|
|
1050
|
+
onClick: ve
|
|
989
1051
|
}),
|
|
990
|
-
|
|
991
|
-
modelValue:
|
|
992
|
-
"onUpdate:modelValue":
|
|
1052
|
+
V(y(t), {
|
|
1053
|
+
modelValue: h.value,
|
|
1054
|
+
"onUpdate:modelValue": b[2] || (b[2] = (p) => h.value = p),
|
|
993
1055
|
x: 0,
|
|
994
1056
|
y: 0,
|
|
995
|
-
items:
|
|
996
|
-
onClick:
|
|
1057
|
+
items: C.value,
|
|
1058
|
+
onClick: Re
|
|
997
1059
|
}, null, 8, ["modelValue", "items"])
|
|
998
1060
|
])
|
|
999
1061
|
], 64)),
|
|
1000
|
-
a.value.outputs._node ? (i(),
|
|
1062
|
+
a.value.outputs._node ? (i(), S(ke, {
|
|
1001
1063
|
key: 3,
|
|
1002
1064
|
node: a.value,
|
|
1003
1065
|
intf: a.value.outputs._node,
|
|
1004
1066
|
class: "--output",
|
|
1005
1067
|
"data-interface-type": "node"
|
|
1006
|
-
}, null, 8, ["node", "intf"])) :
|
|
1068
|
+
}, null, 8, ["node", "intf"])) : I("", !0)
|
|
1007
1069
|
], 32),
|
|
1008
|
-
|
|
1009
|
-
class: U(["__content",
|
|
1010
|
-
onKeydown:
|
|
1070
|
+
l("div", {
|
|
1071
|
+
class: U(["__content", ze.value]),
|
|
1072
|
+
onKeydown: b[4] || (b[4] = ee(P(() => {
|
|
1011
1073
|
}, ["stop"]), ["delete"])),
|
|
1012
|
-
onContextmenu:
|
|
1074
|
+
onContextmenu: b[5] || (b[5] = P(() => {
|
|
1013
1075
|
}, ["prevent"]))
|
|
1014
1076
|
}, [
|
|
1015
|
-
|
|
1016
|
-
(i(!0), r(
|
|
1017
|
-
key:
|
|
1077
|
+
l("div", Ns, [
|
|
1078
|
+
(i(!0), r(z, null, H(je.value, (p) => (i(), r(z, {
|
|
1079
|
+
key: p.id
|
|
1018
1080
|
}, [
|
|
1019
|
-
a.value.state?.hidden ? (i(), r("div",
|
|
1020
|
-
|
|
1081
|
+
a.value.state?.hidden ? (i(), r("div", Ms, [
|
|
1082
|
+
p.port ? (i(), r("div", {
|
|
1021
1083
|
key: 0,
|
|
1022
|
-
id:
|
|
1023
|
-
title:
|
|
1084
|
+
id: p.id,
|
|
1085
|
+
title: p.name,
|
|
1024
1086
|
class: "baklava-node-interface --output --connected"
|
|
1025
|
-
}, [...
|
|
1026
|
-
|
|
1027
|
-
])], 8,
|
|
1028
|
-
])) :
|
|
1087
|
+
}, [...b[6] || (b[6] = [
|
|
1088
|
+
l("div", { class: "__port" }, null, -1)
|
|
1089
|
+
])], 8, $s)) : I("", !0)
|
|
1090
|
+
])) : Z(c.$slots, "nodeInterface", {
|
|
1029
1091
|
key: 1,
|
|
1030
1092
|
type: "output",
|
|
1031
1093
|
node: a.value,
|
|
1032
|
-
intf:
|
|
1094
|
+
intf: p
|
|
1033
1095
|
}, () => [
|
|
1034
|
-
|
|
1096
|
+
V(y(n), {
|
|
1035
1097
|
node: a.value,
|
|
1036
|
-
intf:
|
|
1037
|
-
|
|
1098
|
+
intf: p,
|
|
1099
|
+
title: p.type
|
|
1100
|
+
}, null, 8, ["node", "intf", "title"])
|
|
1038
1101
|
])
|
|
1039
1102
|
], 64))), 128))
|
|
1040
1103
|
]),
|
|
1041
|
-
|
|
1042
|
-
(i(!0), r(
|
|
1043
|
-
key:
|
|
1104
|
+
l("div", Os, [
|
|
1105
|
+
(i(!0), r(z, null, H(Be.value, (p) => (i(), r(z, {
|
|
1106
|
+
key: p.id
|
|
1044
1107
|
}, [
|
|
1045
|
-
a.value.state?.hidden ? (i(), r("div",
|
|
1046
|
-
|
|
1108
|
+
a.value.state?.hidden ? (i(), r("div", Ts, [
|
|
1109
|
+
p.port ? (i(), r("div", {
|
|
1047
1110
|
key: 0,
|
|
1048
|
-
id:
|
|
1049
|
-
title:
|
|
1111
|
+
id: p.id,
|
|
1112
|
+
title: p.name,
|
|
1050
1113
|
class: "baklava-node-interface --input --connected"
|
|
1051
|
-
}, [...
|
|
1052
|
-
|
|
1053
|
-
])], 8,
|
|
1054
|
-
])) :
|
|
1114
|
+
}, [...b[7] || (b[7] = [
|
|
1115
|
+
l("div", { class: "__port" }, null, -1)
|
|
1116
|
+
])], 8, Es)) : I("", !0)
|
|
1117
|
+
])) : Z(c.$slots, "nodeInterface", {
|
|
1055
1118
|
key: 1,
|
|
1056
1119
|
node: a.value,
|
|
1057
|
-
intf:
|
|
1120
|
+
intf: p,
|
|
1058
1121
|
type: "input"
|
|
1059
1122
|
}, () => [
|
|
1060
|
-
|
|
1123
|
+
V(y(n), {
|
|
1061
1124
|
node: a.value,
|
|
1062
|
-
intf:
|
|
1063
|
-
title:
|
|
1125
|
+
intf: p,
|
|
1126
|
+
title: p.type
|
|
1064
1127
|
}, null, 8, ["node", "intf", "title"])
|
|
1065
1128
|
])
|
|
1066
1129
|
], 64))), 128))
|
|
1067
1130
|
])
|
|
1068
1131
|
], 34)
|
|
1069
|
-
], 46,
|
|
1132
|
+
], 46, ks));
|
|
1070
1133
|
}
|
|
1071
|
-
}),
|
|
1134
|
+
}), zs = ["title"], Vs = {
|
|
1072
1135
|
key: 0,
|
|
1073
1136
|
class: "__label"
|
|
1074
|
-
},
|
|
1137
|
+
}, Bs = /* @__PURE__ */ L({
|
|
1075
1138
|
__name: "Checkbox",
|
|
1076
1139
|
props: {
|
|
1077
1140
|
disabled: { type: Boolean },
|
|
@@ -1087,114 +1150,114 @@ const cs = /* @__PURE__ */ z(ds, [["render", us]]), ps = ["id", "data-node-type"
|
|
|
1087
1150
|
title: s.name,
|
|
1088
1151
|
onClick: o[0] || (o[0] = (a) => t("update:modelValue", !s.modelValue))
|
|
1089
1152
|
}, [
|
|
1090
|
-
o[1] || (o[1] =
|
|
1091
|
-
|
|
1153
|
+
o[1] || (o[1] = l("div", { class: "__checkmark-container" }, [
|
|
1154
|
+
l("svg", {
|
|
1092
1155
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1093
1156
|
width: "18",
|
|
1094
1157
|
height: "18",
|
|
1095
1158
|
viewBox: "0 0 18 18"
|
|
1096
1159
|
}, [
|
|
1097
|
-
|
|
1160
|
+
l("path", {
|
|
1098
1161
|
class: "__checkmark",
|
|
1099
1162
|
d: "M 6 5 L 6 10 L 16 10",
|
|
1100
1163
|
transform: "rotate(-45 10 10)"
|
|
1101
1164
|
})
|
|
1102
1165
|
])
|
|
1103
1166
|
], -1)),
|
|
1104
|
-
s.name ? (i(), r("div",
|
|
1105
|
-
], 10,
|
|
1167
|
+
s.name ? (i(), r("div", Vs, B(s.name), 1)) : I("", !0)
|
|
1168
|
+
], 10, zs));
|
|
1106
1169
|
}
|
|
1107
|
-
}),
|
|
1170
|
+
}), js = { class: "__header" }, Ls = { class: "__node-name" }, Us = { style: { display: "flex" } }, Gs = {
|
|
1108
1171
|
key: 1,
|
|
1109
1172
|
class: "__interface"
|
|
1110
|
-
},
|
|
1173
|
+
}, Rs = /* @__PURE__ */ L({
|
|
1111
1174
|
__name: "CodeGraphSidebar",
|
|
1112
1175
|
setup(s) {
|
|
1113
|
-
const { viewModel: e } = F(), { graph: t } =
|
|
1114
|
-
let
|
|
1115
|
-
const
|
|
1116
|
-
const
|
|
1117
|
-
return t.value.nodes.find((
|
|
1118
|
-
}),
|
|
1176
|
+
const { viewModel: e } = F(), { graph: t } = ne(), n = T(null), o = Me(e.value.settings.sidebar, "width"), a = _(() => e.value.settings.sidebar.resizable);
|
|
1177
|
+
let d = 0, u = 0;
|
|
1178
|
+
const m = _(() => {
|
|
1179
|
+
const v = t.value.sidebar.nodeId;
|
|
1180
|
+
return t.value.nodes.find((h) => h.id === v);
|
|
1181
|
+
}), w = _(() => m.value), k = _(() => ({
|
|
1119
1182
|
width: `${o.value}px`
|
|
1120
|
-
})),
|
|
1183
|
+
})), O = _(() => w.value ? [...Object.values(w.value.inputs), ...Object.values(w.value.outputs)].filter((h) => h.displayInSidebar && h.component) : []), j = () => {
|
|
1121
1184
|
t.value.sidebar.visible = !1;
|
|
1122
|
-
},
|
|
1123
|
-
|
|
1124
|
-
},
|
|
1125
|
-
|
|
1185
|
+
}, x = () => {
|
|
1186
|
+
m.value?.events.update.emit(null);
|
|
1187
|
+
}, f = (v) => {
|
|
1188
|
+
d = o.value, u = v.clientX, window.addEventListener("mousemove", g), window.addEventListener(
|
|
1126
1189
|
"mouseup",
|
|
1127
1190
|
() => {
|
|
1128
|
-
window.removeEventListener("mousemove",
|
|
1191
|
+
window.removeEventListener("mousemove", g);
|
|
1129
1192
|
},
|
|
1130
1193
|
{ once: !0 }
|
|
1131
1194
|
);
|
|
1132
|
-
},
|
|
1133
|
-
const
|
|
1134
|
-
let
|
|
1135
|
-
|
|
1195
|
+
}, g = (v) => {
|
|
1196
|
+
const h = n.value?.parentElement?.getBoundingClientRect().width ?? 500, C = v.clientX - u;
|
|
1197
|
+
let N = d - C;
|
|
1198
|
+
N < 300 ? N = 300 : N > 0.9 * h && (N = 0.9 * h), o.value = N;
|
|
1136
1199
|
};
|
|
1137
|
-
return (
|
|
1200
|
+
return (v, h) => (i(), r("div", {
|
|
1138
1201
|
ref_key: "el",
|
|
1139
1202
|
ref: n,
|
|
1140
|
-
class: U(["baklava-sidebar", { "--open":
|
|
1141
|
-
style:
|
|
1203
|
+
class: U(["baklava-sidebar", { "--open": y(t).sidebar.visible }]),
|
|
1204
|
+
style: ae(k.value)
|
|
1142
1205
|
}, [
|
|
1143
1206
|
a.value ? (i(), r("div", {
|
|
1144
1207
|
key: 0,
|
|
1145
1208
|
class: "__resizer",
|
|
1146
|
-
onMousedown:
|
|
1147
|
-
}, null, 32)) :
|
|
1148
|
-
|
|
1149
|
-
|
|
1209
|
+
onMousedown: f
|
|
1210
|
+
}, null, 32)) : I("", !0),
|
|
1211
|
+
l("div", js, [
|
|
1212
|
+
l("button", {
|
|
1150
1213
|
tabindex: "-1",
|
|
1151
1214
|
class: "__close",
|
|
1152
|
-
onClick:
|
|
1215
|
+
onClick: j
|
|
1153
1216
|
}, "×"),
|
|
1154
|
-
|
|
1155
|
-
|
|
1217
|
+
l("div", Ls, [
|
|
1218
|
+
l("b", null, B(m.value ? m.value.title : ""), 1)
|
|
1156
1219
|
])
|
|
1157
1220
|
]),
|
|
1158
|
-
(i(!0), r(
|
|
1159
|
-
key:
|
|
1221
|
+
(i(!0), r(z, null, H(O.value, (C) => (i(), r("div", {
|
|
1222
|
+
key: C.id,
|
|
1160
1223
|
class: "__interface"
|
|
1161
1224
|
}, [
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
modelValue:
|
|
1225
|
+
l("div", Us, [
|
|
1226
|
+
V(Bs, {
|
|
1227
|
+
modelValue: C.hidden,
|
|
1165
1228
|
"onUpdate:modelValue": [
|
|
1166
|
-
(
|
|
1167
|
-
|
|
1229
|
+
(N) => C.hidden = N,
|
|
1230
|
+
h[0] || (h[0] = () => m.value?.events.update.emit(null))
|
|
1168
1231
|
],
|
|
1169
|
-
disabled: !
|
|
1232
|
+
disabled: !C.optional,
|
|
1170
1233
|
inversed: "",
|
|
1171
1234
|
style: { "padding-right": "8px" }
|
|
1172
1235
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"]),
|
|
1173
|
-
(i(),
|
|
1174
|
-
modelValue:
|
|
1175
|
-
"onUpdate:modelValue": (
|
|
1176
|
-
node:
|
|
1177
|
-
intf:
|
|
1236
|
+
(i(), S(pt(C.component), {
|
|
1237
|
+
modelValue: C.value,
|
|
1238
|
+
"onUpdate:modelValue": (N) => C.value = N,
|
|
1239
|
+
node: m.value,
|
|
1240
|
+
intf: C,
|
|
1178
1241
|
style: { width: "100%" }
|
|
1179
1242
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "node", "intf"]))
|
|
1180
1243
|
])
|
|
1181
1244
|
]))), 128)),
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
"onUpdate:modelValue":
|
|
1245
|
+
w.value && w.value.state ? (i(), r("div", Gs, [
|
|
1246
|
+
h[2] || (h[2] = l("label", null, "Variable name", -1)),
|
|
1247
|
+
ie(l("input", {
|
|
1248
|
+
"onUpdate:modelValue": h[1] || (h[1] = (C) => w.value.state.variableName = C),
|
|
1186
1249
|
type: "text",
|
|
1187
1250
|
class: "baklava-input",
|
|
1188
1251
|
title: "Variable name",
|
|
1189
|
-
onBlur:
|
|
1190
|
-
onKeydown:
|
|
1252
|
+
onBlur: x,
|
|
1253
|
+
onKeydown: ee(x, ["enter"])
|
|
1191
1254
|
}, null, 544), [
|
|
1192
|
-
[
|
|
1255
|
+
[re, w.value.state.variableName]
|
|
1193
1256
|
])
|
|
1194
|
-
])) :
|
|
1257
|
+
])) : I("", !0)
|
|
1195
1258
|
], 6));
|
|
1196
1259
|
}
|
|
1197
|
-
}),
|
|
1260
|
+
}), Ds = L({
|
|
1198
1261
|
props: {
|
|
1199
1262
|
type: {
|
|
1200
1263
|
type: String,
|
|
@@ -1206,153 +1269,153 @@ const cs = /* @__PURE__ */ z(ds, [["render", us]]), ps = ["id", "data-node-type"
|
|
|
1206
1269
|
}
|
|
1207
1270
|
},
|
|
1208
1271
|
setup(s) {
|
|
1209
|
-
const { viewModel: e } = F(), { switchGraph: t } =
|
|
1272
|
+
const { viewModel: e } = F(), { switchGraph: t } = ne(), n = T(!1), o = _(() => s.type.startsWith(K));
|
|
1210
1273
|
return { showContextMenu: n, hasContextMenu: o, contextMenuItems: [
|
|
1211
1274
|
{ label: "Edit Subgraph", value: "editSubgraph" },
|
|
1212
1275
|
{ label: "Delete Subgraph", value: "deleteSubgraph" }
|
|
1213
1276
|
], openContextMenu: () => {
|
|
1214
1277
|
n.value = !0;
|
|
1215
|
-
}, onContextMenuClick: (
|
|
1216
|
-
const
|
|
1217
|
-
if (
|
|
1218
|
-
switch (
|
|
1278
|
+
}, onContextMenuClick: (m) => {
|
|
1279
|
+
const w = s.type.substring(K.length), k = e.value.editor.graphTemplates.find((O) => O.id === w);
|
|
1280
|
+
if (k)
|
|
1281
|
+
switch (m) {
|
|
1219
1282
|
case "editSubgraph":
|
|
1220
|
-
t(
|
|
1283
|
+
t(k);
|
|
1221
1284
|
break;
|
|
1222
1285
|
case "deleteSubgraph":
|
|
1223
|
-
e.value.editor.removeGraphTemplate(
|
|
1286
|
+
e.value.editor.removeGraphTemplate(k);
|
|
1224
1287
|
break;
|
|
1225
1288
|
}
|
|
1226
1289
|
} };
|
|
1227
1290
|
}
|
|
1228
|
-
}),
|
|
1229
|
-
function
|
|
1291
|
+
}), Ps = ["data-node-type"], Hs = { class: "__title" }, As = { class: "__title-label" };
|
|
1292
|
+
function Fs(s, e, t, n, o, a) {
|
|
1230
1293
|
return i(), r("div", {
|
|
1231
1294
|
class: "baklava-node --palette",
|
|
1232
1295
|
"data-node-type": s.type
|
|
1233
1296
|
}, [
|
|
1234
|
-
|
|
1235
|
-
|
|
1297
|
+
l("div", Hs, [
|
|
1298
|
+
l("div", As, B(s.title), 1)
|
|
1236
1299
|
])
|
|
1237
|
-
], 8,
|
|
1300
|
+
], 8, Ps);
|
|
1238
1301
|
}
|
|
1239
|
-
const xe = /* @__PURE__ */
|
|
1302
|
+
const xe = /* @__PURE__ */ $(Ds, [["render", Fs]]), Ws = {
|
|
1240
1303
|
class: "baklava-node --palette",
|
|
1241
1304
|
style: { "margin-top": "-20px", "margin-bottom": "20px" }
|
|
1242
|
-
},
|
|
1305
|
+
}, Xs = {
|
|
1243
1306
|
key: 0,
|
|
1244
1307
|
style: { display: "flex", "justify-content": "space-between" }
|
|
1245
|
-
},
|
|
1308
|
+
}, Js = ["onClick"], Ys = {
|
|
1246
1309
|
key: 0,
|
|
1247
1310
|
style: { margin: "auto 0", "font-size": "12px" }
|
|
1248
|
-
},
|
|
1311
|
+
}, qs = /* @__PURE__ */ L({
|
|
1249
1312
|
__name: "CodeNodePalette",
|
|
1250
1313
|
setup(s) {
|
|
1251
|
-
const { viewModel: e } = F(), { x: t, y: n } =
|
|
1252
|
-
(
|
|
1253
|
-
(
|
|
1314
|
+
const { viewModel: e } = F(), { x: t, y: n } = wt(), { transform: o } = st(), a = nt(e), d = ht("editorEl"), u = T(""), m = T(null), w = () => u.value ? a.value.filter(
|
|
1315
|
+
(x) => x.name.toLowerCase().includes(u.value.toLowerCase()) || Object.values(x.nodeTypes).some(
|
|
1316
|
+
(f) => f.title.toLowerCase().includes(u.value.toLowerCase())
|
|
1254
1317
|
)
|
|
1255
|
-
) : a.value,
|
|
1256
|
-
(
|
|
1257
|
-
) : Object.values(
|
|
1258
|
-
if (!
|
|
1259
|
-
const { left:
|
|
1318
|
+
) : a.value, k = (x) => u.value ? Object.values(x).filter(
|
|
1319
|
+
(f) => f.category.toLowerCase().includes(u.value.toLowerCase()) || f.title.toLowerCase().includes(u.value.toLowerCase())
|
|
1320
|
+
) : Object.values(x), O = _(() => {
|
|
1321
|
+
if (!m.value || !d?.value) return {};
|
|
1322
|
+
const { left: x, top: f } = d.value.getBoundingClientRect();
|
|
1260
1323
|
return {
|
|
1261
|
-
top: `${n.value -
|
|
1262
|
-
left: `${t.value -
|
|
1324
|
+
top: `${n.value - f}px`,
|
|
1325
|
+
left: `${t.value - x}px`
|
|
1263
1326
|
};
|
|
1264
|
-
}),
|
|
1265
|
-
|
|
1266
|
-
type:
|
|
1267
|
-
nodeInformation:
|
|
1327
|
+
}), j = (x, f) => {
|
|
1328
|
+
m.value = {
|
|
1329
|
+
type: x,
|
|
1330
|
+
nodeInformation: f
|
|
1268
1331
|
};
|
|
1269
|
-
const
|
|
1270
|
-
const
|
|
1271
|
-
e.value.displayedGraph.addNode(
|
|
1272
|
-
const
|
|
1273
|
-
|
|
1332
|
+
const g = () => {
|
|
1333
|
+
const v = R(new f.type());
|
|
1334
|
+
e.value.displayedGraph.addNode(v);
|
|
1335
|
+
const h = d.value.getBoundingClientRect(), [C, N] = o(t.value - h.left, n.value - h.top);
|
|
1336
|
+
v.position.x = C, v.position.y = N, m.value = null, document.removeEventListener("pointerup", g);
|
|
1274
1337
|
};
|
|
1275
|
-
document.addEventListener("pointerup",
|
|
1338
|
+
document.addEventListener("pointerup", g);
|
|
1276
1339
|
};
|
|
1277
|
-
return (
|
|
1278
|
-
|
|
1279
|
-
class: U(["baklava-node-palette", { "--open":
|
|
1280
|
-
onContextmenu:
|
|
1340
|
+
return (x, f) => (i(), r(z, null, [
|
|
1341
|
+
l("div", {
|
|
1342
|
+
class: U(["baklava-node-palette", { "--open": y(e).settings.palette.enabled }]),
|
|
1343
|
+
onContextmenu: f[1] || (f[1] = P(() => {
|
|
1281
1344
|
}, ["stop", "prevent"]))
|
|
1282
1345
|
}, [
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
"onUpdate:modelValue":
|
|
1346
|
+
l("div", Ws, [
|
|
1347
|
+
ie(l("input", {
|
|
1348
|
+
"onUpdate:modelValue": f[0] || (f[0] = (g) => u.value = g),
|
|
1286
1349
|
type: "text",
|
|
1287
1350
|
class: "baklava-input",
|
|
1288
1351
|
title: "Filter nodes",
|
|
1289
|
-
onKeyup:
|
|
1352
|
+
onKeyup: w
|
|
1290
1353
|
}, null, 544), [
|
|
1291
|
-
[
|
|
1354
|
+
[re, u.value]
|
|
1292
1355
|
])
|
|
1293
1356
|
]),
|
|
1294
|
-
(i(!0), r(
|
|
1295
|
-
key:
|
|
1357
|
+
(i(!0), r(z, null, H(w(), (g) => (i(), r("section", {
|
|
1358
|
+
key: g.name
|
|
1296
1359
|
}, [
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
onClick: (
|
|
1360
|
+
g.name !== "default" ? (i(), r("h3", Xs, [
|
|
1361
|
+
l("div", {
|
|
1362
|
+
onClick: (v) => u.value = g.name,
|
|
1300
1363
|
style: { cursor: "pointer" }
|
|
1301
|
-
},
|
|
1302
|
-
|
|
1303
|
-
])) :
|
|
1304
|
-
(i(!0), r(
|
|
1305
|
-
key:
|
|
1306
|
-
type:
|
|
1307
|
-
title:
|
|
1308
|
-
onPointerdown: (
|
|
1364
|
+
}, B(g.name), 9, Js),
|
|
1365
|
+
k(g.nodeTypes).length < Object.values(g.nodeTypes).length ? (i(), r("div", Ys, " ( " + B(k(g.nodeTypes).length) + " / " + B(Object.values(g.nodeTypes).length) + " ) ", 1)) : I("", !0)
|
|
1366
|
+
])) : I("", !0),
|
|
1367
|
+
(i(!0), r(z, null, H(k(g.nodeTypes), (v) => (i(), S(xe, {
|
|
1368
|
+
key: v.type,
|
|
1369
|
+
type: v.type,
|
|
1370
|
+
title: v.title,
|
|
1371
|
+
onPointerdown: (h) => j(v.type, v)
|
|
1309
1372
|
}, null, 8, ["type", "title", "onPointerdown"]))), 128))
|
|
1310
1373
|
]))), 128))
|
|
1311
1374
|
], 34),
|
|
1312
|
-
|
|
1313
|
-
default:
|
|
1314
|
-
|
|
1375
|
+
V(vt, { name: "fade" }, {
|
|
1376
|
+
default: J(() => [
|
|
1377
|
+
m.value ? (i(), r("div", {
|
|
1315
1378
|
key: 0,
|
|
1316
1379
|
class: "baklava-dragged-node",
|
|
1317
|
-
style:
|
|
1380
|
+
style: ae(O.value)
|
|
1318
1381
|
}, [
|
|
1319
|
-
|
|
1320
|
-
type:
|
|
1321
|
-
title:
|
|
1382
|
+
V(xe, {
|
|
1383
|
+
type: m.value.type,
|
|
1384
|
+
title: m.value.nodeInformation.title
|
|
1322
1385
|
}, null, 8, ["type", "title"])
|
|
1323
|
-
], 4)) :
|
|
1386
|
+
], 4)) : I("", !0)
|
|
1324
1387
|
]),
|
|
1325
1388
|
_: 1
|
|
1326
1389
|
})
|
|
1327
1390
|
], 64));
|
|
1328
1391
|
}
|
|
1329
|
-
}),
|
|
1392
|
+
}), wn = /* @__PURE__ */ L({
|
|
1330
1393
|
__name: "CodeGraphEditor",
|
|
1331
1394
|
props: {
|
|
1332
1395
|
viewModel: {}
|
|
1333
1396
|
},
|
|
1334
1397
|
setup(s) {
|
|
1335
|
-
const t =
|
|
1336
|
-
return
|
|
1398
|
+
const t = Me(s, "viewModel"), n = (o) => o.events.update.emit(null);
|
|
1399
|
+
return oe(() => {
|
|
1337
1400
|
t.value.subscribe(), t.value.engine.start();
|
|
1338
|
-
}),
|
|
1401
|
+
}), mt(() => {
|
|
1339
1402
|
t.value.unsubscribe(), t.value.engine.stop();
|
|
1340
|
-
}), (o, a) => (i(),
|
|
1341
|
-
palette:
|
|
1342
|
-
|
|
1403
|
+
}), (o, a) => (i(), S(y(ot), { "view-model": t.value }, {
|
|
1404
|
+
palette: J(() => [
|
|
1405
|
+
V(qs)
|
|
1343
1406
|
]),
|
|
1344
|
-
node:
|
|
1345
|
-
|
|
1346
|
-
onUpdate: (
|
|
1407
|
+
node: J((d) => [
|
|
1408
|
+
V(Ss, bt(d, {
|
|
1409
|
+
onUpdate: (u) => n(d.node)
|
|
1347
1410
|
}), null, 16, ["onUpdate"])
|
|
1348
1411
|
]),
|
|
1349
|
-
sidebar:
|
|
1350
|
-
|
|
1412
|
+
sidebar: J((d) => [
|
|
1413
|
+
V(Rs, ft(gt(d)), null, 16)
|
|
1351
1414
|
]),
|
|
1352
1415
|
_: 1
|
|
1353
1416
|
}, 8, ["view-model"]));
|
|
1354
1417
|
}
|
|
1355
|
-
}),
|
|
1418
|
+
}), Qs = (s) => {
|
|
1356
1419
|
const e = "TOGGLE_PALETTE";
|
|
1357
1420
|
s.commandHandler.registerCommand(e, {
|
|
1358
1421
|
execute: () => s.settings.palette.enabled = !s.settings.palette.enabled,
|
|
@@ -1372,23 +1435,23 @@ const xe = /* @__PURE__ */ z(Es, [["render", Ls]]), Vs = {
|
|
|
1372
1435
|
command: e,
|
|
1373
1436
|
title: "Toggle palette",
|
|
1374
1437
|
// Tooltip text
|
|
1375
|
-
icon:
|
|
1438
|
+
icon: _(() => s.settings.palette.enabled ? Ht : Xt)
|
|
1376
1439
|
},
|
|
1377
|
-
...
|
|
1440
|
+
...at,
|
|
1378
1441
|
{
|
|
1379
1442
|
command: t,
|
|
1380
1443
|
title: "Clear all",
|
|
1381
1444
|
// Tooltip text
|
|
1382
|
-
icon:
|
|
1445
|
+
icon: ws
|
|
1383
1446
|
},
|
|
1384
1447
|
{
|
|
1385
1448
|
command: n,
|
|
1386
1449
|
title: "Toggle minimap",
|
|
1387
1450
|
// Tooltip text
|
|
1388
|
-
icon:
|
|
1451
|
+
icon: _(() => s.settings.enableMinimap ? hs : ds)
|
|
1389
1452
|
}
|
|
1390
1453
|
];
|
|
1391
|
-
},
|
|
1454
|
+
}, X = {
|
|
1392
1455
|
enableMinimap: !1,
|
|
1393
1456
|
toolbar: {
|
|
1394
1457
|
enabled: !0
|
|
@@ -1403,26 +1466,26 @@ const xe = /* @__PURE__ */ z(Es, [["render", Ls]]), Vs = {
|
|
|
1403
1466
|
},
|
|
1404
1467
|
displayValueOnHover: !1
|
|
1405
1468
|
};
|
|
1406
|
-
function
|
|
1407
|
-
const e =
|
|
1408
|
-
e.code = s?.code ? new s.code(e) : new
|
|
1469
|
+
function kn(s) {
|
|
1470
|
+
const e = it(s?.existingEditor);
|
|
1471
|
+
e.code = s?.code ? new s.code(e) : new Ot(e), Qs(e);
|
|
1409
1472
|
const t = {};
|
|
1410
|
-
return Object.keys(
|
|
1411
|
-
t[n] = typeof
|
|
1412
|
-
}), e.settings =
|
|
1473
|
+
return Object.keys(X).forEach((n) => {
|
|
1474
|
+
t[n] = typeof X[n] == "object" ? { ...e.settings[n], ...X[n] } : X[n];
|
|
1475
|
+
}), e.settings = R({ ...e.settings, ...t }), e.settings.nodes.defaultWidth = 350, e.state = R({
|
|
1413
1476
|
modules: {},
|
|
1414
1477
|
token: null
|
|
1415
|
-
}), e.engine = new
|
|
1478
|
+
}), e.engine = new rt(e.editor), e.subscribe = () => {
|
|
1416
1479
|
e.state.token && e.unsubscribe();
|
|
1417
1480
|
const n = Symbol();
|
|
1418
1481
|
e.displayedGraph.events.addNode.subscribe(n, (o) => o.code = e.code), e.engine.events.beforeRun.subscribe(n, () => {
|
|
1419
|
-
e.engine.pause(), e.code && (e.code.onCodeUpdate(), e.code.sortNodes()), e.engine.resume();
|
|
1482
|
+
e.engine.pause(), e.code && (e.code.onCodeUpdate(), e.code.sortNodes(), e.code.updateCodeTemplates(), e.code.resetInputInterfaceScript()), e.engine.resume();
|
|
1420
1483
|
}), e.engine.events.beforeNodeCalculation.subscribe(n, (o) => {
|
|
1421
1484
|
e.engine.pause();
|
|
1422
1485
|
const a = o.node;
|
|
1423
|
-
a.isCodeNode && (a.updateOutputVariableName(), a.
|
|
1486
|
+
a.isCodeNode && (a.updateOutputVariableName(), a.updateConnectedInputInterfaces()), e.engine.resume();
|
|
1424
1487
|
}), e.engine.events.afterRun.subscribe(n, (o) => {
|
|
1425
|
-
e.engine.pause(),
|
|
1488
|
+
e.engine.pause(), lt(o, e.editor), e.code && (e.code.renderNodeCodes(), e.code.renderCode()), e.engine.resume();
|
|
1426
1489
|
}), e.state.token = n;
|
|
1427
1490
|
}, e.unsubscribe = () => {
|
|
1428
1491
|
if (!e.state.token) return;
|
|
@@ -1431,46 +1494,44 @@ function cn(s) {
|
|
|
1431
1494
|
}, e;
|
|
1432
1495
|
}
|
|
1433
1496
|
export {
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
rn as getPositionAtColumn,
|
|
1466
|
-
dn as getPositionBeforeNode,
|
|
1467
|
-
kt as listType,
|
|
1497
|
+
kt as AbstractCodeNode,
|
|
1498
|
+
rn as CheckboxInterface,
|
|
1499
|
+
In as CheckboxInterfaceComponent,
|
|
1500
|
+
Ot as Code,
|
|
1501
|
+
wn as CodeGraphEditor,
|
|
1502
|
+
$e as CodeNode,
|
|
1503
|
+
W as CodeNodeInputInterface,
|
|
1504
|
+
D as CodeNodeInterface,
|
|
1505
|
+
Mt as CodeNodeOutputInterface,
|
|
1506
|
+
X as DEFAULT_SETTINGS,
|
|
1507
|
+
$t as DynamicCodeNode,
|
|
1508
|
+
ln as IntegerInterface,
|
|
1509
|
+
dn as ListInputInterface,
|
|
1510
|
+
un as NumberInterface,
|
|
1511
|
+
Nn as NumberInterfaceComponent,
|
|
1512
|
+
cn as SelectInterface,
|
|
1513
|
+
pn as SliderInterface,
|
|
1514
|
+
hn as TextInputInterface,
|
|
1515
|
+
vn as TextareaInputInterface,
|
|
1516
|
+
mn as TupleInputInterface,
|
|
1517
|
+
an as addDefaultInterfaceTypes,
|
|
1518
|
+
Qs as addToolbarCommands,
|
|
1519
|
+
Te as booleanType,
|
|
1520
|
+
fn as defineCodeNode,
|
|
1521
|
+
gn as defineDynamicCodeNode,
|
|
1522
|
+
Nt as dictType,
|
|
1523
|
+
xt as formatInputs,
|
|
1524
|
+
te as getCodeNodes,
|
|
1525
|
+
bn as getPositionAtColumn,
|
|
1526
|
+
yn as getPositionBeforeNode,
|
|
1527
|
+
Ee as listType,
|
|
1468
1528
|
Oe as loadNodeState,
|
|
1469
1529
|
A as nodeType,
|
|
1470
1530
|
de as numberType,
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1531
|
+
Ct as saveNodeState,
|
|
1532
|
+
on as setOptional,
|
|
1533
|
+
ue as stringType,
|
|
1534
|
+
_n as transferCodeScript,
|
|
1535
|
+
Se as tupleType,
|
|
1536
|
+
kn as useCodeGraph
|
|
1476
1537
|
};
|