@nodish/base 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -0
- package/README.md +0 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +492 -0
- package/dist/nodes/boolean/basic.d.ts +9 -0
- package/dist/nodes/boolean/basic.d.ts.map +1 -0
- package/dist/nodes/math/basic.d.ts +14 -0
- package/dist/nodes/math/basic.d.ts.map +1 -0
- package/dist/nodes/math/compare.d.ts +6 -0
- package/dist/nodes/math/compare.d.ts.map +1 -0
- package/dist/nodes/math/trig.d.ts +9 -0
- package/dist/nodes/math/trig.d.ts.map +1 -0
- package/dist/nodes/text/basic.d.ts +8 -0
- package/dist/nodes/text/basic.d.ts.map +1 -0
- package/dist/nodes/text/compare.d.ts +9 -0
- package/dist/nodes/text/compare.d.ts.map +1 -0
- package/dist/nodes/text/regex.d.ts +5 -0
- package/dist/nodes/text/regex.d.ts.map +1 -0
- package/dist/types/boolean/boolean.d.ts +3 -0
- package/dist/types/boolean/boolean.d.ts.map +1 -0
- package/dist/types/boolean/boolean.vue.d.ts +15 -0
- package/dist/types/boolean/boolean.vue.d.ts.map +1 -0
- package/dist/types/number.d.ts +3 -0
- package/dist/types/number.d.ts.map +1 -0
- package/dist/types/string.d.ts +3 -0
- package/dist/types/string.d.ts.map +1 -0
- package/package.json +39 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
|
2
|
+
|
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
4
|
+
distribute this software, either in source code form or as a compiled
|
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
6
|
+
means.
|
|
7
|
+
|
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
|
9
|
+
of this software dedicate any and all copyright interest in the
|
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
|
11
|
+
of the public at large and to the detriment of our heirs and
|
|
12
|
+
successors. We intend this dedication to be an overt act of
|
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
|
14
|
+
software under copyright law.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
For more information, please refer to <https://unlicense.org>
|
package/README.md
ADDED
|
File without changes
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bool[data-v-71ee835c]{cursor:pointer;-webkit-user-select:none;user-select:none;flex:1;align-items:center;gap:6px;min-width:0;display:flex}.bool input[data-v-71ee835c]{accent-color:#86efac;flex:none;margin:0}.label[data-v-71ee835c]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAa7C,eAAO,MAAM,IAAI,EAAE,QAmBlB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import { defineType as e } from "@nodish/core";
|
|
2
|
+
import { createElementBlock as t, createElementVNode as n, defineComponent as r, openBlock as i, toDisplayString as a, withModifiers as o } from "vue";
|
|
3
|
+
import './index.css';//#region src/types/number.ts
|
|
4
|
+
var s = e({
|
|
5
|
+
id: "number",
|
|
6
|
+
label: "Number",
|
|
7
|
+
color: "#7dd3fc",
|
|
8
|
+
validate: (e) => typeof e == "number" && !Number.isNaN(e),
|
|
9
|
+
defaultValue: 0,
|
|
10
|
+
widget: { kind: "number" }
|
|
11
|
+
}), c = "boolean", l = e({
|
|
12
|
+
id: "boolean",
|
|
13
|
+
label: "Boolean",
|
|
14
|
+
color: "#86efac",
|
|
15
|
+
validate: (e) => typeof e == "boolean",
|
|
16
|
+
defaultValue: !1,
|
|
17
|
+
widget: {
|
|
18
|
+
kind: "custom",
|
|
19
|
+
componentId: c
|
|
20
|
+
},
|
|
21
|
+
coerce: (e) => e === !0,
|
|
22
|
+
format: (e) => e === !0 ? "true" : "false"
|
|
23
|
+
}), u = ["title"], ee = ["checked"], te = { class: "label" }, d = /*#__PURE__*/ ((e, t) => {
|
|
24
|
+
let n = e.__vccOpts || e;
|
|
25
|
+
for (let [e, r] of t) n[e] = r;
|
|
26
|
+
return n;
|
|
27
|
+
})(/* @__PURE__ */ r({
|
|
28
|
+
__name: "boolean",
|
|
29
|
+
props: {
|
|
30
|
+
port: {},
|
|
31
|
+
typeDef: {},
|
|
32
|
+
placeholder: {}
|
|
33
|
+
},
|
|
34
|
+
emits: ["update:value", "commit"],
|
|
35
|
+
setup(e, { emit: r }) {
|
|
36
|
+
let s = r;
|
|
37
|
+
function c(e) {
|
|
38
|
+
let t = e.target.checked;
|
|
39
|
+
s("update:value", t), s("commit");
|
|
40
|
+
}
|
|
41
|
+
return (r, s) => (i(), t("label", {
|
|
42
|
+
class: "bool",
|
|
43
|
+
title: e.port.name,
|
|
44
|
+
onPointerdown: s[0] ||= o(() => {}, ["stop"])
|
|
45
|
+
}, [n("input", {
|
|
46
|
+
type: "checkbox",
|
|
47
|
+
checked: e.port.value === !0,
|
|
48
|
+
onChange: c
|
|
49
|
+
}, null, 40, ee), n("span", te, a(e.port.name), 1)], 40, u));
|
|
50
|
+
}
|
|
51
|
+
}), [["__scopeId", "data-v-71ee835c"]]), f = {
|
|
52
|
+
typeId: "add",
|
|
53
|
+
displayName: "Add",
|
|
54
|
+
inputs: {
|
|
55
|
+
a: { type: "number" },
|
|
56
|
+
b: { type: "number" }
|
|
57
|
+
},
|
|
58
|
+
outputs: { result: { type: "number" } },
|
|
59
|
+
group: ["math", "basic"],
|
|
60
|
+
execute: (e) => ({ result: e.a + e.b })
|
|
61
|
+
}, p = {
|
|
62
|
+
typeId: "subtract",
|
|
63
|
+
displayName: "Subtract",
|
|
64
|
+
inputs: {
|
|
65
|
+
a: { type: "number" },
|
|
66
|
+
b: { type: "number" }
|
|
67
|
+
},
|
|
68
|
+
outputs: { result: { type: "number" } },
|
|
69
|
+
group: ["math", "basic"],
|
|
70
|
+
execute: (e) => ({ result: e.a - e.b })
|
|
71
|
+
}, m = {
|
|
72
|
+
typeId: "multiply",
|
|
73
|
+
displayName: "Multiply",
|
|
74
|
+
inputs: {
|
|
75
|
+
a: { type: "number" },
|
|
76
|
+
b: { type: "number" }
|
|
77
|
+
},
|
|
78
|
+
outputs: { result: { type: "number" } },
|
|
79
|
+
group: ["math", "basic"],
|
|
80
|
+
execute: (e) => ({ result: e.a * e.b })
|
|
81
|
+
}, h = {
|
|
82
|
+
typeId: "divide",
|
|
83
|
+
displayName: "Divide",
|
|
84
|
+
inputs: {
|
|
85
|
+
a: { type: "number" },
|
|
86
|
+
b: { type: "number" }
|
|
87
|
+
},
|
|
88
|
+
outputs: { result: { type: "number" } },
|
|
89
|
+
group: ["math", "basic"],
|
|
90
|
+
execute: (e) => ({ result: e.a / e.b })
|
|
91
|
+
}, g = {
|
|
92
|
+
typeId: "power",
|
|
93
|
+
displayName: "Power",
|
|
94
|
+
inputs: {
|
|
95
|
+
base: { type: "number" },
|
|
96
|
+
exponent: { type: "number" }
|
|
97
|
+
},
|
|
98
|
+
outputs: { result: { type: "number" } },
|
|
99
|
+
group: ["math", "basic"],
|
|
100
|
+
execute: (e) => ({ result: e.base ** +e.exponent })
|
|
101
|
+
}, _ = {
|
|
102
|
+
typeId: "ceil",
|
|
103
|
+
displayName: "Ceil",
|
|
104
|
+
inputs: { value: { type: "number" } },
|
|
105
|
+
outputs: { result: { type: "number" } },
|
|
106
|
+
group: [
|
|
107
|
+
"math",
|
|
108
|
+
"basic",
|
|
109
|
+
"rounding"
|
|
110
|
+
],
|
|
111
|
+
execute: (e) => ({ result: Math.ceil(e.value) })
|
|
112
|
+
}, v = {
|
|
113
|
+
typeId: "floor",
|
|
114
|
+
displayName: "Floor",
|
|
115
|
+
inputs: { value: { type: "number" } },
|
|
116
|
+
outputs: { result: { type: "number" } },
|
|
117
|
+
group: [
|
|
118
|
+
"math",
|
|
119
|
+
"basic",
|
|
120
|
+
"rounding"
|
|
121
|
+
],
|
|
122
|
+
execute: (e) => ({ result: Math.floor(e.value) })
|
|
123
|
+
}, y = {
|
|
124
|
+
typeId: "round",
|
|
125
|
+
displayName: "Round",
|
|
126
|
+
inputs: { value: { type: "number" } },
|
|
127
|
+
outputs: { result: { type: "number" } },
|
|
128
|
+
group: [
|
|
129
|
+
"math",
|
|
130
|
+
"basic",
|
|
131
|
+
"rounding"
|
|
132
|
+
],
|
|
133
|
+
execute: (e) => ({ result: Math.round(e.value) })
|
|
134
|
+
}, b = {
|
|
135
|
+
typeId: "absolute",
|
|
136
|
+
displayName: "Absolute value",
|
|
137
|
+
inputs: { value: { type: "number" } },
|
|
138
|
+
outputs: { result: { type: "number" } },
|
|
139
|
+
group: ["math", "basic"],
|
|
140
|
+
execute: (e) => ({ result: Math.abs(e.value) })
|
|
141
|
+
}, x = {
|
|
142
|
+
typeId: "mapping",
|
|
143
|
+
displayName: "Mapping",
|
|
144
|
+
inputs: {
|
|
145
|
+
value: { type: "number" },
|
|
146
|
+
inputMin: { type: "number" },
|
|
147
|
+
inputMax: { type: "number" },
|
|
148
|
+
outputMin: { type: "number" },
|
|
149
|
+
outputMax: { type: "number" },
|
|
150
|
+
clamp: { type: "boolean" }
|
|
151
|
+
},
|
|
152
|
+
outputs: { result: { type: "number" } },
|
|
153
|
+
group: ["math", "basic"],
|
|
154
|
+
execute: (e) => {
|
|
155
|
+
let t = e.value, n = e.inputMin, r = e.inputMax, i = e.outputMin, a = e.outputMax;
|
|
156
|
+
return e.clamp && (t = Math.max(n, Math.min(t, r))), { result: ((t - n) * (a - i) + i) / (r - n) };
|
|
157
|
+
}
|
|
158
|
+
}, ne = {
|
|
159
|
+
[f.typeId]: f,
|
|
160
|
+
[p.typeId]: p,
|
|
161
|
+
[m.typeId]: m,
|
|
162
|
+
[h.typeId]: h,
|
|
163
|
+
[g.typeId]: g,
|
|
164
|
+
[_.typeId]: _,
|
|
165
|
+
[v.typeId]: v,
|
|
166
|
+
[y.typeId]: y,
|
|
167
|
+
[b.typeId]: b,
|
|
168
|
+
[x.typeId]: x
|
|
169
|
+
}, S = {
|
|
170
|
+
typeId: "sine",
|
|
171
|
+
displayName: "Sine",
|
|
172
|
+
inputs: { value: { type: "number" } },
|
|
173
|
+
outputs: { result: { type: "number" } },
|
|
174
|
+
group: ["math", "trigonometry"],
|
|
175
|
+
execute: (e) => ({ result: Math.sin(e.value) })
|
|
176
|
+
}, C = {
|
|
177
|
+
typeId: "cosine",
|
|
178
|
+
displayName: "Cosine",
|
|
179
|
+
inputs: { value: { type: "number" } },
|
|
180
|
+
outputs: { result: { type: "number" } },
|
|
181
|
+
group: ["math", "trigonometry"],
|
|
182
|
+
execute: (e) => ({ result: Math.cos(e.value) })
|
|
183
|
+
}, w = {
|
|
184
|
+
typeId: "tangent",
|
|
185
|
+
displayName: "Tangent",
|
|
186
|
+
inputs: { value: { type: "number" } },
|
|
187
|
+
outputs: { result: { type: "number" } },
|
|
188
|
+
group: ["math", "trigonometry"],
|
|
189
|
+
execute: (e) => ({ result: Math.tan(e.value) })
|
|
190
|
+
}, T = {
|
|
191
|
+
typeId: "cotangent",
|
|
192
|
+
displayName: "Cotangent",
|
|
193
|
+
inputs: { value: { type: "number" } },
|
|
194
|
+
outputs: { result: { type: "number" } },
|
|
195
|
+
group: ["math", "trigonometry"],
|
|
196
|
+
execute: (e) => ({ result: 1 / Math.tan(e.value) })
|
|
197
|
+
}, E = {
|
|
198
|
+
typeId: "secant",
|
|
199
|
+
displayName: "Secant",
|
|
200
|
+
inputs: { value: { type: "number" } },
|
|
201
|
+
outputs: { result: { type: "number" } },
|
|
202
|
+
group: ["math", "trigonometry"],
|
|
203
|
+
execute: (e) => ({ result: 1 / Math.cos(e.value) })
|
|
204
|
+
}, D = {
|
|
205
|
+
typeId: "cosecant",
|
|
206
|
+
displayName: "Cosecant",
|
|
207
|
+
inputs: { value: { type: "number" } },
|
|
208
|
+
outputs: { result: { type: "number" } },
|
|
209
|
+
group: ["math", "trigonometry"],
|
|
210
|
+
execute: (e) => ({ result: 1 / Math.sin(e.value) })
|
|
211
|
+
}, O = {
|
|
212
|
+
[S.typeId]: S,
|
|
213
|
+
[C.typeId]: C,
|
|
214
|
+
[w.typeId]: w,
|
|
215
|
+
[T.typeId]: T,
|
|
216
|
+
[E.typeId]: E,
|
|
217
|
+
[D.typeId]: D
|
|
218
|
+
}, k = e({
|
|
219
|
+
id: "string",
|
|
220
|
+
label: "String",
|
|
221
|
+
color: "#f472b6",
|
|
222
|
+
validate: (e) => typeof e == "string",
|
|
223
|
+
defaultValue: "",
|
|
224
|
+
widget: {
|
|
225
|
+
kind: "text",
|
|
226
|
+
rows: 3
|
|
227
|
+
}
|
|
228
|
+
}), A = {
|
|
229
|
+
typeId: "equals",
|
|
230
|
+
displayName: "Equals",
|
|
231
|
+
inputs: {
|
|
232
|
+
a: { type: "number" },
|
|
233
|
+
b: { type: "number" }
|
|
234
|
+
},
|
|
235
|
+
outputs: { result: { type: "boolean" } },
|
|
236
|
+
execute: (e) => ({ result: e.a === e.b })
|
|
237
|
+
}, j = {
|
|
238
|
+
typeId: "greaterThan",
|
|
239
|
+
displayName: "Greater Than",
|
|
240
|
+
inputs: {
|
|
241
|
+
a: { type: "number" },
|
|
242
|
+
b: { type: "number" },
|
|
243
|
+
orEqual: { type: "boolean" }
|
|
244
|
+
},
|
|
245
|
+
outputs: { result: { type: "boolean" } },
|
|
246
|
+
execute: (e) => {
|
|
247
|
+
let t = e.a, n = e.b, r = e.orEqual;
|
|
248
|
+
return { result: t > n || r && t === n };
|
|
249
|
+
}
|
|
250
|
+
}, M = {
|
|
251
|
+
typeId: "lessThan",
|
|
252
|
+
displayName: "Less Than",
|
|
253
|
+
inputs: {
|
|
254
|
+
a: { type: "number" },
|
|
255
|
+
b: { type: "number" },
|
|
256
|
+
orEqual: { type: "boolean" }
|
|
257
|
+
},
|
|
258
|
+
outputs: { result: { type: "boolean" } },
|
|
259
|
+
execute: (e) => {
|
|
260
|
+
let t = e.a, n = e.b, r = e.orEqual;
|
|
261
|
+
return { result: t < n || r && t === n };
|
|
262
|
+
}
|
|
263
|
+
}, re = {
|
|
264
|
+
[A.typeId]: A,
|
|
265
|
+
[j.typeId]: j,
|
|
266
|
+
[M.typeId]: M
|
|
267
|
+
}, N = {
|
|
268
|
+
typeId: "concatenate",
|
|
269
|
+
displayName: "Concatenate",
|
|
270
|
+
inputs: {
|
|
271
|
+
a: { type: "string" },
|
|
272
|
+
b: { type: "string" }
|
|
273
|
+
},
|
|
274
|
+
outputs: { result: { type: "string" } },
|
|
275
|
+
group: ["text", "basic"],
|
|
276
|
+
execute: (e) => ({ result: e.a + e.b })
|
|
277
|
+
}, P = {
|
|
278
|
+
typeId: "length",
|
|
279
|
+
displayName: "Length",
|
|
280
|
+
inputs: { value: { type: "string" } },
|
|
281
|
+
outputs: { result: { type: "number" } },
|
|
282
|
+
group: ["text", "basic"],
|
|
283
|
+
execute: (e) => ({ result: e.value.length })
|
|
284
|
+
}, F = {
|
|
285
|
+
typeId: "trim",
|
|
286
|
+
displayName: "Trim",
|
|
287
|
+
inputs: { value: { type: "string" } },
|
|
288
|
+
outputs: { result: { type: "string" } },
|
|
289
|
+
group: ["text", "basic"],
|
|
290
|
+
execute: (e) => ({ result: e.value.trim() })
|
|
291
|
+
}, I = {
|
|
292
|
+
typeId: "toUpperCase",
|
|
293
|
+
displayName: "To Upper Case",
|
|
294
|
+
inputs: { value: { type: "string" } },
|
|
295
|
+
outputs: { result: { type: "string" } },
|
|
296
|
+
group: ["text", "basic"],
|
|
297
|
+
execute: (e) => ({ result: e.value.toUpperCase() })
|
|
298
|
+
}, L = {
|
|
299
|
+
typeId: "simpleReplace",
|
|
300
|
+
displayName: "Simple Replace",
|
|
301
|
+
inputs: {
|
|
302
|
+
value: { type: "string" },
|
|
303
|
+
old: { type: "string" },
|
|
304
|
+
new: { type: "string" }
|
|
305
|
+
},
|
|
306
|
+
outputs: { result: { type: "string" } },
|
|
307
|
+
group: ["text", "basic"],
|
|
308
|
+
execute: (e) => ({ result: e.value.replace(e.old, e.new) })
|
|
309
|
+
}, R = {
|
|
310
|
+
[N.typeId]: N,
|
|
311
|
+
[P.typeId]: P,
|
|
312
|
+
[F.typeId]: F,
|
|
313
|
+
[I.typeId]: I,
|
|
314
|
+
[L.typeId]: L
|
|
315
|
+
}, z = {
|
|
316
|
+
typeId: "equals",
|
|
317
|
+
displayName: "Equals",
|
|
318
|
+
inputs: {
|
|
319
|
+
a: { type: "string" },
|
|
320
|
+
b: { type: "string" }
|
|
321
|
+
},
|
|
322
|
+
outputs: { result: { type: "boolean" } },
|
|
323
|
+
execute: (e) => ({ result: e.a === e.b })
|
|
324
|
+
}, B = {
|
|
325
|
+
typeId: "greaterThan",
|
|
326
|
+
displayName: "Greater Than",
|
|
327
|
+
inputs: {
|
|
328
|
+
a: { type: "string" },
|
|
329
|
+
b: { type: "string" },
|
|
330
|
+
orEqual: { type: "boolean" }
|
|
331
|
+
},
|
|
332
|
+
outputs: { result: { type: "boolean" } },
|
|
333
|
+
execute: (e) => {
|
|
334
|
+
let t = e.a, n = e.b, r = e.orEqual;
|
|
335
|
+
return { result: t > n || r && t === n };
|
|
336
|
+
}
|
|
337
|
+
}, V = {
|
|
338
|
+
typeId: "lessThan",
|
|
339
|
+
displayName: "Less Than",
|
|
340
|
+
inputs: {
|
|
341
|
+
a: { type: "string" },
|
|
342
|
+
b: { type: "string" },
|
|
343
|
+
orEqual: { type: "boolean" }
|
|
344
|
+
},
|
|
345
|
+
outputs: { result: { type: "boolean" } },
|
|
346
|
+
execute: (e) => {
|
|
347
|
+
let t = e.a, n = e.b, r = e.orEqual;
|
|
348
|
+
return { result: t < n || r && t === n };
|
|
349
|
+
}
|
|
350
|
+
}, H = {
|
|
351
|
+
typeId: "contains",
|
|
352
|
+
displayName: "Contains",
|
|
353
|
+
inputs: {
|
|
354
|
+
a: { type: "string" },
|
|
355
|
+
b: { type: "string" }
|
|
356
|
+
},
|
|
357
|
+
outputs: { result: { type: "boolean" } },
|
|
358
|
+
execute: (e) => ({ result: e.a.includes(e.b) })
|
|
359
|
+
}, U = {
|
|
360
|
+
typeId: "toLowerCase",
|
|
361
|
+
displayName: "To Lower Case",
|
|
362
|
+
inputs: { value: { type: "string" } },
|
|
363
|
+
outputs: { result: { type: "string" } },
|
|
364
|
+
group: ["text", "basic"],
|
|
365
|
+
execute: (e) => ({ result: e.value.toLowerCase() })
|
|
366
|
+
}, W = {
|
|
367
|
+
typeId: "startsWith",
|
|
368
|
+
displayName: "Starts With",
|
|
369
|
+
inputs: {
|
|
370
|
+
value: { type: "string" },
|
|
371
|
+
prefix: { type: "string" }
|
|
372
|
+
},
|
|
373
|
+
outputs: { result: { type: "boolean" } },
|
|
374
|
+
group: ["text", "basic"],
|
|
375
|
+
execute: (e) => ({ result: e.value.startsWith(e.prefix) })
|
|
376
|
+
}, G = {
|
|
377
|
+
[z.typeId]: z,
|
|
378
|
+
[B.typeId]: B,
|
|
379
|
+
[V.typeId]: V,
|
|
380
|
+
[H.typeId]: H,
|
|
381
|
+
[U.typeId]: U,
|
|
382
|
+
[W.typeId]: W
|
|
383
|
+
}, K = {
|
|
384
|
+
typeId: "not",
|
|
385
|
+
displayName: "Not",
|
|
386
|
+
inputs: { value: { type: "boolean" } },
|
|
387
|
+
outputs: { result: { type: "boolean" } },
|
|
388
|
+
group: ["boolean", "basic"],
|
|
389
|
+
execute: (e) => ({ result: !e.value })
|
|
390
|
+
}, q = {
|
|
391
|
+
typeId: "or",
|
|
392
|
+
displayName: "Or",
|
|
393
|
+
inputs: {
|
|
394
|
+
a: { type: "boolean" },
|
|
395
|
+
b: { type: "boolean" }
|
|
396
|
+
},
|
|
397
|
+
outputs: { result: { type: "boolean" } },
|
|
398
|
+
group: ["boolean", "basic"],
|
|
399
|
+
execute: (e) => ({ result: e.a || e.b })
|
|
400
|
+
}, J = {
|
|
401
|
+
typeId: "and",
|
|
402
|
+
displayName: "And",
|
|
403
|
+
inputs: {
|
|
404
|
+
a: { type: "boolean" },
|
|
405
|
+
b: { type: "boolean" }
|
|
406
|
+
},
|
|
407
|
+
outputs: { result: { type: "boolean" } },
|
|
408
|
+
group: ["boolean", "basic"],
|
|
409
|
+
execute: (e) => ({ result: e.a && e.b })
|
|
410
|
+
}, Y = {
|
|
411
|
+
typeId: "xor",
|
|
412
|
+
displayName: "Xor",
|
|
413
|
+
inputs: {
|
|
414
|
+
a: { type: "boolean" },
|
|
415
|
+
b: { type: "boolean" }
|
|
416
|
+
},
|
|
417
|
+
outputs: { result: { type: "boolean" } },
|
|
418
|
+
group: ["boolean", "basic"],
|
|
419
|
+
execute: (e) => ({ result: e.a !== e.b })
|
|
420
|
+
}, X = {
|
|
421
|
+
typeId: "nand",
|
|
422
|
+
displayName: "Nand",
|
|
423
|
+
inputs: {
|
|
424
|
+
a: { type: "boolean" },
|
|
425
|
+
b: { type: "boolean" }
|
|
426
|
+
},
|
|
427
|
+
outputs: { result: { type: "boolean" } },
|
|
428
|
+
group: ["boolean", "basic"],
|
|
429
|
+
execute: (e) => ({ result: !(e.a && e.b) })
|
|
430
|
+
}, Z = {
|
|
431
|
+
typeId: "nor",
|
|
432
|
+
displayName: "Nor",
|
|
433
|
+
inputs: {
|
|
434
|
+
a: { type: "boolean" },
|
|
435
|
+
b: { type: "boolean" }
|
|
436
|
+
},
|
|
437
|
+
outputs: { result: { type: "boolean" } },
|
|
438
|
+
group: ["boolean", "basic"],
|
|
439
|
+
execute: (e) => ({ result: !(e.a || e.b) })
|
|
440
|
+
}, ie = {
|
|
441
|
+
[K.typeId]: K,
|
|
442
|
+
[q.typeId]: q,
|
|
443
|
+
[J.typeId]: J,
|
|
444
|
+
[Y.typeId]: Y,
|
|
445
|
+
[X.typeId]: X,
|
|
446
|
+
[Z.typeId]: Z
|
|
447
|
+
}, Q = {
|
|
448
|
+
typeId: "regexMatch",
|
|
449
|
+
displayName: "Regex Match",
|
|
450
|
+
inputs: {
|
|
451
|
+
value: { type: "string" },
|
|
452
|
+
regex: { type: "string" }
|
|
453
|
+
},
|
|
454
|
+
outputs: { result: { type: "boolean" } },
|
|
455
|
+
group: ["text", "regex"],
|
|
456
|
+
execute: (e) => ({ result: e.value.match(e.regex) })
|
|
457
|
+
}, $ = {
|
|
458
|
+
typeId: "regexReplace",
|
|
459
|
+
displayName: "Regex Replace",
|
|
460
|
+
inputs: {
|
|
461
|
+
value: { type: "string" },
|
|
462
|
+
regex: { type: "string" },
|
|
463
|
+
replacement: { type: "string" }
|
|
464
|
+
},
|
|
465
|
+
outputs: { result: { type: "string" } },
|
|
466
|
+
group: ["text", "regex"],
|
|
467
|
+
execute: (e) => ({ result: e.value.replace(e.regex, e.replacement) })
|
|
468
|
+
}, ae = {
|
|
469
|
+
[Q.typeId]: Q,
|
|
470
|
+
[$.typeId]: $
|
|
471
|
+
}, oe = {
|
|
472
|
+
id: "@nodish/base",
|
|
473
|
+
nodeTypes: {
|
|
474
|
+
...ne,
|
|
475
|
+
...O,
|
|
476
|
+
...re,
|
|
477
|
+
...R,
|
|
478
|
+
...G,
|
|
479
|
+
...ie,
|
|
480
|
+
...ae
|
|
481
|
+
},
|
|
482
|
+
types: {
|
|
483
|
+
number: s,
|
|
484
|
+
boolean: l,
|
|
485
|
+
string: k
|
|
486
|
+
},
|
|
487
|
+
setup({ registerComponentWidget: e }) {
|
|
488
|
+
e(c, d);
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
//#endregion
|
|
492
|
+
export { oe as pack };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NodeSpecRegistry, NodeSpec } from '@nodish/core';
|
|
2
|
+
export declare const not: NodeSpec;
|
|
3
|
+
export declare const or: NodeSpec;
|
|
4
|
+
export declare const and: NodeSpec;
|
|
5
|
+
export declare const xor: NodeSpec;
|
|
6
|
+
export declare const nand: NodeSpec;
|
|
7
|
+
export declare const nor: NodeSpec;
|
|
8
|
+
export declare const booleanBasicNodes: NodeSpecRegistry;
|
|
9
|
+
//# sourceMappingURL=basic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/nodes/boolean/basic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE/D,eAAO,MAAM,GAAG,EAAE,QAWjB,CAAC;AAEF,eAAO,MAAM,EAAE,EAAE,QAYhB,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,QAYjB,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,QAYjB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,QAYlB,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,QAYjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,gBAO/B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NodeSpecRegistry, NodeSpec } from '@nodish/core';
|
|
2
|
+
export declare const add: NodeSpec;
|
|
3
|
+
export declare const subtract: NodeSpec;
|
|
4
|
+
export declare const multiply: NodeSpec;
|
|
5
|
+
export declare const divide: NodeSpec;
|
|
6
|
+
export declare const power: NodeSpec;
|
|
7
|
+
export declare const ceil: NodeSpec;
|
|
8
|
+
export declare const floor: NodeSpec;
|
|
9
|
+
export declare const round: NodeSpec;
|
|
10
|
+
export declare const absolute: NodeSpec;
|
|
11
|
+
export declare const modulo: NodeSpec;
|
|
12
|
+
export declare const mapping: NodeSpec;
|
|
13
|
+
export declare const basicMathNodes: NodeSpecRegistry;
|
|
14
|
+
//# sourceMappingURL=basic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/nodes/math/basic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC/D,eAAO,MAAM,GAAG,EAAE,QAYjB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,QAYtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,QAYtB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,QAYpB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,QAcnB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,QAWlB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,QAWnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,QAWnB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,QAWtB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,QAYpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,QA4BrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAW5B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NodeSpecRegistry, NodeSpec } from '@nodish/core';
|
|
2
|
+
export declare const equals: NodeSpec;
|
|
3
|
+
export declare const greaterThan: NodeSpec;
|
|
4
|
+
export declare const lessThan: NodeSpec;
|
|
5
|
+
export declare const mathCompareNodes: NodeSpecRegistry;
|
|
6
|
+
//# sourceMappingURL=compare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../../src/nodes/math/compare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE/D,eAAO,MAAM,MAAM,EAAE,QAWpB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,QAiBzB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,QAiBtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,gBAI9B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NodeSpecRegistry, NodeSpec } from '@nodish/core';
|
|
2
|
+
export declare const sine: NodeSpec;
|
|
3
|
+
export declare const cosine: NodeSpec;
|
|
4
|
+
export declare const tangent: NodeSpec;
|
|
5
|
+
export declare const cotangent: NodeSpec;
|
|
6
|
+
export declare const secant: NodeSpec;
|
|
7
|
+
export declare const cosecant: NodeSpec;
|
|
8
|
+
export declare const trigMathNodes: NodeSpecRegistry;
|
|
9
|
+
//# sourceMappingURL=trig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trig.d.ts","sourceRoot":"","sources":["../../../src/nodes/math/trig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE/D,eAAO,MAAM,IAAI,EAAE,QAWlB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,QAWpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,QAWrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,QAWvB,CAAC;AACF,eAAO,MAAM,MAAM,EAAE,QAWpB,CAAC;AACF,eAAO,MAAM,QAAQ,EAAE,QAWtB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,gBAO3B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NodeSpecRegistry, NodeSpec } from '@nodish/core';
|
|
2
|
+
export declare const concatenate: NodeSpec;
|
|
3
|
+
export declare const length: NodeSpec;
|
|
4
|
+
export declare const trim: NodeSpec;
|
|
5
|
+
export declare const toUpperCase: NodeSpec;
|
|
6
|
+
export declare const simpleReplace: NodeSpec;
|
|
7
|
+
export declare const textBasicNodes: NodeSpecRegistry;
|
|
8
|
+
//# sourceMappingURL=basic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/nodes/text/basic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE/D,eAAO,MAAM,WAAW,EAAE,QAYzB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,QAWpB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,QAWlB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,QAWzB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAkB3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAM5B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NodeSpecRegistry, NodeSpec } from '@nodish/core';
|
|
2
|
+
export declare const equals: NodeSpec;
|
|
3
|
+
export declare const greaterThan: NodeSpec;
|
|
4
|
+
export declare const lessThan: NodeSpec;
|
|
5
|
+
export declare const contains: NodeSpec;
|
|
6
|
+
export declare const toLowerCase: NodeSpec;
|
|
7
|
+
export declare const startsWith: NodeSpec;
|
|
8
|
+
export declare const textCompareNodes: NodeSpecRegistry;
|
|
9
|
+
//# sourceMappingURL=compare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../../src/nodes/text/compare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE/D,eAAO,MAAM,MAAM,EAAE,QAWpB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,QAiBzB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,QAiBtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,QAWtB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,QAWzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,QAcxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,gBAO9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../../src/nodes/text/regex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE/D,eAAO,MAAM,UAAU,EAAE,QAYxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAkB1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,gBAGxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src/types/boolean/boolean.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,OAAO,2CASlB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Port, PortTypeDefinition } from '@nodish/core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
port: Port;
|
|
4
|
+
typeDef?: PortTypeDefinition;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
+
"update:value": (value: unknown) => any;
|
|
9
|
+
commit: () => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
"onUpdate:value"?: ((value: unknown) => any) | undefined;
|
|
12
|
+
onCommit?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLLabelElement>;
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=boolean.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boolean.vue.d.ts","sourceRoot":"","sources":["../../../src/types/boolean/boolean.vue"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE7D,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;;;;;;;;AAsEF,wBAQG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/types/number.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,2CAOjB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/types/string.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,2CAOjB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nodish/base",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "base nodepack for nodish",
|
|
5
|
+
"license": "AGPL-3.0-or-later",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"style": "./dist/index.css"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": [
|
|
18
|
+
"**/*.css"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"dev": "vite --config vite.config.dev.ts",
|
|
22
|
+
"build": "vite build --config vite.config.ts",
|
|
23
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
24
|
+
"typecheck:dev": "tsc --noEmit -p tsconfig.dev.json"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"vue": "^3.5.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@nodish/core": "^0.2.1",
|
|
31
|
+
"@types/node": "^26.0.1",
|
|
32
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
33
|
+
"typescript": "^6.0.3",
|
|
34
|
+
"vite": "^8.1.2",
|
|
35
|
+
"vite-plugin-dts": "^4.5.4",
|
|
36
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
37
|
+
"vue": "^3.5.39"
|
|
38
|
+
}
|
|
39
|
+
}
|