@code0-tech/pictor 0.0.0-mvp.45 → 0.0.0-mvp.46

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.
Files changed (33) hide show
  1. package/dist/assets/components/d-flow-input/DFlowInputDataType.style.css +1 -1
  2. package/dist/assets/components/d-flow-suggestion/DFlowSuggestionSearchInput.style.css +1 -1
  3. package/dist/components/d-flow/DFlow.service.js +31 -23
  4. package/dist/components/d-flow-data-type/DFlowDataType.service.d.ts +2 -2
  5. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js +22 -13
  6. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js +19 -13
  7. package/dist/components/d-flow-file/DFlowTabDefault.js +38 -37
  8. package/dist/components/d-flow-file/DFlowTabTrigger.js +1 -1
  9. package/dist/components/d-flow-input/DFlowInput.d.ts +11 -0
  10. package/dist/components/d-flow-input/DFlowInput.js +29 -0
  11. package/dist/components/d-flow-input/DFlowInputDefault.d.ts +2 -7
  12. package/dist/components/d-flow-input/DFlowInputNodeBadge.js +13 -13
  13. package/dist/components/d-flow-input/DFlowInputObject.d.ts +10 -0
  14. package/dist/components/d-flow-input/DFlowInputObject.js +83 -0
  15. package/dist/components/d-flow-input/DFlowInputObjectEditDialog.d.ts +16 -0
  16. package/dist/components/d-flow-input/DFlowInputObjectEditDialog.js +118 -0
  17. package/dist/components/d-flow-input/DFlowInputObjectTree.d.ts +16 -0
  18. package/dist/components/d-flow-input/DFlowInputObjectTree.js +99 -0
  19. package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +12 -12
  20. package/dist/components/d-flow-node/DFlowNodeReference.return.hook.d.ts +4 -0
  21. package/dist/components/d-flow-node/DFlowNodeReference.return.hook.js +77 -0
  22. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +104 -103
  23. package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +43 -50
  24. package/dist/components/d-flow-validation/DNodeValidation.hook.js +44 -39
  25. package/dist/components/editor/Editor.js +15 -15
  26. package/dist/components/form/InputSuggestion.js +29 -29
  27. package/dist/components/form/useForm.d.ts +3 -3
  28. package/dist/components/form/useForm.js +16 -16
  29. package/dist/node_modules/prettier/plugins/babel.js +6674 -6685
  30. package/dist/node_modules/prettier/plugins/estree.js +2830 -2628
  31. package/dist/node_modules/prettier/standalone.js +1657 -1440
  32. package/dist/utils/generics.js +85 -97
  33. package/package.json +22 -22
@@ -1,132 +1,133 @@
1
- import g from "react";
2
- import { useService as I, useStore as N } from "../../utils/contextStore.js";
1
+ import f from "react";
2
+ import { useService as g, useStore as I } from "../../utils/contextStore.js";
3
3
  import "merge-props";
4
4
  import "js-md5";
5
- import { DFlowDataTypeReactiveService as x } from "../d-flow-data-type/DFlowDataType.service.js";
6
- import { DFlowSuggestionType as A } from "./DFlowSuggestion.view.js";
7
- import { replaceGenericsAndSortType as C, resolveType as P, isMatchingType as V, resolveGenericKeys as Y, targetForGenericKey as k, replaceGenericKeysInType as J } from "../../utils/generics.js";
8
- import { DFlowFunctionReactiveService as O } from "../d-flow-function/DFlowFunction.service.js";
5
+ import { DFlowDataTypeReactiveService as R } from "../d-flow-data-type/DFlowDataType.service.js";
6
+ import { DFlowSuggestionType as Y } from "./DFlowSuggestion.view.js";
7
+ import { replaceGenericsAndSortType as C, resolveType as P, isMatchingType as k, resolveGenericKeys as J, targetForGenericKey as U, replaceGenericKeysInType as q } from "../../utils/generics.js";
8
+ import { DFlowFunctionReactiveService as G } from "../d-flow-function/DFlowFunction.service.js";
9
9
  import "../d-flow/DFlow.js";
10
- import { DFlowReactiveService as R } from "../d-flow/DFlow.service.js";
11
- import { useReturnTypes as j } from "../d-flow-node/DFlowNode.return.hook.js";
12
- const re = (n, t, o, u = []) => {
13
- const m = I(x), r = N(x), v = I(R), T = N(R), M = $(n), S = g.useMemo(() => t ? M?.find((i) => i.nodeFunctionId === t) : void 0, [M, t]), B = g.useMemo(() => t ? v.getNodeById(n, t)?.parameters?.nodes?.map((a) => a?.value).filter((a) => a?.__typename === "NodeFunctionIdWrapper") ?? [] : [], [n, t, v, T]), c = g.useMemo(() => o ? C(P(o, m), u) : void 0, [o, m, r, u]), p = U(n), f = j(n);
14
- return g.useMemo(() => {
15
- if (!c || !S) return [];
10
+ import { DFlowReactiveService as B } from "../d-flow/DFlow.service.js";
11
+ import { useReturnType as z } from "../d-flow-function/DFlowFunction.return.hook.js";
12
+ import { DFlowTypeReactiveService as j } from "../d-flow-type/DFlowType.service.js";
13
+ const pe = (o, t, n, d = []) => {
14
+ const m = g(R), u = I(R), M = g(B), s = I(B), N = $(o), l = f.useMemo(() => t ? N?.find((i) => i.nodeFunctionId === t) : void 0, [N, t]), D = f.useMemo(() => t ? M.getNodeById(o, t)?.parameters?.nodes?.map((r) => r?.value).filter((r) => r?.__typename === "NodeFunctionIdWrapper") ?? [] : [], [o, t, M, s]), S = f.useMemo(() => n ? C(P(n, m), d) : void 0, [n, m, u, d]), h = H(o);
15
+ return f.useMemo(() => {
16
+ if (!S || !l) return [];
16
17
  const {
17
18
  depth: i,
18
- scope: a,
19
- node: l
20
- } = S;
21
- return p.flatMap((e) => {
19
+ scope: r,
20
+ node: T
21
+ } = l;
22
+ return h.flatMap((e) => {
22
23
  if (e.node === null || e.node === void 0) return [];
23
24
  if (e.depth === null || e.depth === void 0) return [];
24
25
  if (e.scope === null || e.scope === void 0) return [];
25
- const d = e.parameterIndex !== void 0 && e.inputTypeIndex !== void 0, D = d ? e.scope?.every((s, F) => a?.[F] === s) : !0;
26
- if (d && !D) return [];
27
- if (B.some((s) => s.id === e.nodeFunctionId)) return [];
28
- if (!d && e.node >= l) return [];
26
+ const c = e.parameterIndex !== void 0 && e.inputIndex !== void 0, a = c ? e.scope?.every((p, x) => r?.[x] === p) : !0;
27
+ if (c && !a) return [];
28
+ if (D.some((p) => p.id === e.nodeFunctionId)) return [];
29
+ if (!c && e.node >= T) return [];
29
30
  if (e.depth > i) return [];
30
- if (e.scope.some((s) => !a.includes(s))) return [];
31
- const h = f.get(e.nodeFunctionId), E = C(P(h, m), []);
32
- return V(c, E) ? [{
31
+ if (e.scope.some((p) => !r.includes(p))) return [];
32
+ const F = C(P(e.dataTypeIdentifier, m), []);
33
+ return k(S, F) ? [{
33
34
  path: [],
34
- type: A.REF_OBJECT,
35
- displayText: [`${e.depth}-${e.scope}-${e.node || ""}-${e.referencePath?.map((s) => s.path).join(".") ?? ""}`],
35
+ type: Y.REF_OBJECT,
36
+ displayText: [`${e.depth}-${e.scope}-${e.node || ""}-${e.referencePath?.map((p) => p.path).join(".") ?? ""}`],
36
37
  value: e
37
38
  }] : [];
38
39
  });
39
- }, [m, S, B, p, c, f]);
40
- }, U = (n) => {
41
- const t = I(x);
42
- N(x);
43
- const o = I(O), u = I(R), m = N(R), r = g.useMemo(() => u.getById(n), [n, m]), v = $(n), T = j(n), M = g.useMemo(() => r?.nodes?.nodes?.map((c) => {
44
- const p = T.get(c?.id), f = v?.find((i) => i.nodeFunctionId === c?.id);
45
- return p && f ? G(f, p, t) : {};
46
- }) ?? [], [r]), S = g.useMemo(() => G({
40
+ }, [m, l, D, h, S]);
41
+ }, H = (o) => {
42
+ const t = g(R);
43
+ I(R);
44
+ const n = g(G), d = g(B), m = I(B), u = g(j), M = I(j), s = f.useMemo(() => d.getById(o), [o, m]), N = f.useMemo(() => u.getById(s?.type?.id), [s?.type?.id, M]), l = $(o), D = f.useMemo(() => s?.nodes?.nodes?.map((i) => {
45
+ const r = i?.parameters?.nodes?.map((a) => a?.value) ?? [], T = n.getById(i?.functionDefinition?.id), e = z(T, r, t, n), c = l?.find((a) => a.nodeFunctionId === i?.id);
46
+ return e && c ? E(c, e, t) : {};
47
+ }) ?? [], [s]), S = f.useMemo(() => E({
47
48
  node: 0,
48
49
  depth: 0,
49
- nodeFunctionId: "gid://sagittarius/NodeFunction/-1",
50
50
  scope: [0]
51
51
  }, {
52
- dataType: r?.inputType
53
- }), [r]);
54
- return [...g.useMemo(() => r?.nodes?.nodes?.length ? r.nodes.nodes.flatMap((c) => {
55
- const p = o.getById(c?.functionDefinition?.id);
56
- if (!p) return [];
57
- const f = c?.parameters?.nodes?.map((i) => i?.value).filter(Boolean) ?? [];
58
- return (p.parameterDefinitions ?? []).flatMap((i, a) => {
59
- const l = i?.dataTypeIdentifier;
60
- if (!l) return [];
61
- const e = t.getDataType(l);
62
- if (!e || e.variant !== "NODE") return [];
63
- const d = c?.parameters?.nodes?.find((y) => y?.parameterDefinition?.id === i?.id);
64
- if (!d?.value || d.value.__typename !== "NodeFunctionIdWrapper") return [];
65
- const D = v?.find((y) => d?.value?.__typename === "NodeFunctionIdWrapper" && y.nodeFunctionId === d.value?.id);
66
- if (!D) return [];
67
- const h = e.rules?.nodes?.filter((y) => y?.variant === "INPUT_TYPES") ?? [], E = Y(p, f, t, o), s = k(p, l), F = new Map([...E].map(([y, b]) => [s.get(y) ?? y, b]));
68
- return h.flatMap((y) => (y?.config?.inputTypes ?? []).flatMap((W, K) => {
69
- const w = J(W.dataTypeIdentifier, F);
70
- return w ? G({
71
- ...D,
72
- nodeFunctionId: c?.id,
73
- parameterIndex: a,
74
- inputTypeIndex: K,
75
- inputTypeIdentifier: W.inputIdentifier
76
- }, w, t) : [];
52
+ dataType: N?.inputType
53
+ }, t), [s]);
54
+ return [...f.useMemo(() => s?.nodes?.nodes?.length ? s.nodes.nodes.flatMap((i) => {
55
+ const r = n.getById(i?.functionDefinition?.id);
56
+ if (!r) return [];
57
+ const T = i?.parameters?.nodes?.map((e) => e?.value).filter(Boolean) ?? [];
58
+ return (r.parameterDefinitions ?? []).flatMap((e, c) => {
59
+ const a = e?.dataTypeIdentifier;
60
+ if (!a) return [];
61
+ const F = t.getDataType(a);
62
+ if (!F || F.variant !== "NODE") return [];
63
+ const p = i?.parameters?.nodes?.find((y) => y?.parameterDefinition?.id === e?.id);
64
+ if (!p?.value || p.value.__typename !== "NodeFunctionIdWrapper") return [];
65
+ const x = l?.find((y) => p?.value?.__typename === "NodeFunctionIdWrapper" && y.nodeFunctionId === p.value?.id);
66
+ if (!x) return [];
67
+ const v = F.rules?.nodes?.filter((y) => y?.variant === "INPUT_TYPES") ?? [], w = J(r, T, t, n), K = U(r, a), V = new Map([...w].map(([y, O]) => [K.get(y) ?? y, O]));
68
+ return v.flatMap((y) => (y?.config?.inputTypes ?? []).flatMap((b, A) => {
69
+ const W = q(b.dataTypeIdentifier, V);
70
+ return W ? E({
71
+ ...x,
72
+ nodeFunctionId: i?.id,
73
+ parameterIndex: c,
74
+ inputIndex: A,
75
+ inputTypeIdentifier: b.inputIdentifier
76
+ }, W, t) : [];
77
77
  }));
78
78
  });
79
- }) : [], [r, v, o, t]), ...S, ...M].flat();
80
- }, G = (n, t, o) => {
81
- const u = o ? o.getDataType(t) : t.dataType ?? t.genericType?.dataType;
82
- return u ? [...u.rules?.nodes?.map((r) => {
83
- if (r?.variant === "CONTAINS_KEY")
84
- return t ? G({
85
- ...n,
86
- referencePath: [...n.referencePath ?? [], {
87
- path: r.config.key
79
+ }) : [], [s, l, n, t]), ...S, ...D].flat();
80
+ }, E = (o, t, n) => {
81
+ const d = t.dataType ? n.getDataType(t) : t.genericType?.dataType;
82
+ return d ? [...d.rules?.nodes?.map((u) => {
83
+ if (u?.variant === "CONTAINS_KEY")
84
+ return t ? E({
85
+ ...o,
86
+ referencePath: [...o.referencePath ?? [], {
87
+ path: u.config.key
88
88
  }]
89
- }, r.config.dataTypeIdentifier) : void 0;
90
- }).flat().filter((r) => !!r) ?? [], {
89
+ }, u.config.dataTypeIdentifier, n) : void 0;
90
+ }).flat().filter((u) => !!u) ?? [], {
91
+ ...o,
91
92
  __typename: "ReferenceValue",
92
- nodeFunctionId: n.nodeFunctionId,
93
- ...n
93
+ nodeFunctionId: o.nodeFunctionId,
94
+ dataTypeIdentifier: t
94
95
  }] : [];
95
- }, $ = (n) => {
96
- const t = I(x), o = I(R), u = I(O), m = N(R), r = N(O), v = N(x), T = g.useMemo(() => o.getById(n), [n, m]);
97
- return g.useMemo(() => {
98
- if (!t || !o || !u || !T?.startingNodeId) return;
99
- let M = 0;
100
- const S = () => ++M;
101
- let B = 0;
102
- const c = () => ++B, p = [], f = (i, a, l) => {
103
- if (!i) return;
104
- let e = i.__typename === "NodeFunctionIdWrapper" ? o.getNodeById(n, i.id) : i;
105
- for (; e; ) {
106
- const d = u.getById(e.functionDefinition?.id);
107
- if (!d) break;
108
- if (e.parameters && d.parameterDefinitions)
109
- for (const h of d.parameterDefinitions) {
110
- const E = t.getDataType(h.dataTypeIdentifier), s = e.parameters?.nodes?.find((F) => F?.parameterDefinition?.id === h.id);
111
- if (E?.variant === "NODE") {
112
- if (s?.value && s.value.__typename === "NodeFunctionIdWrapper") {
113
- const F = [...l, S()];
114
- f(s.value, a + 1, F);
96
+ }, $ = (o) => {
97
+ const t = g(R), n = g(B), d = g(G), m = I(B), u = I(G), M = I(R), s = f.useMemo(() => n.getById(o), [o, m]);
98
+ return f.useMemo(() => {
99
+ if (!t || !n || !d || !s?.startingNodeId) return;
100
+ let N = 0;
101
+ const l = () => ++N;
102
+ let D = 0;
103
+ const S = () => ++D, h = [], i = (r, T, e) => {
104
+ if (!r) return;
105
+ let c = r.__typename === "NodeFunctionIdWrapper" ? n.getNodeById(o, r.id) : r;
106
+ for (; c; ) {
107
+ const a = d.getById(c.functionDefinition?.id);
108
+ if (!a) break;
109
+ if (c.parameters && a.parameterDefinitions)
110
+ for (const p of a.parameterDefinitions) {
111
+ const x = t.getDataType(p.dataTypeIdentifier), v = c.parameters?.nodes?.find((w) => w?.parameterDefinition?.id === p.id);
112
+ if (x?.variant === "NODE") {
113
+ if (v?.value && v.value.__typename === "NodeFunctionIdWrapper") {
114
+ const w = [...e, l()];
115
+ i(v.value, T + 1, w);
115
116
  }
116
- } else s?.value && s.value.__typename === "NodeFunctionIdWrapper" && f(s.value, a, l);
117
+ } else v?.value && v.value.__typename === "NodeFunctionIdWrapper" && i(v.value, T, e);
117
118
  }
118
- const D = c();
119
- p.push({
120
- node: D,
121
- depth: a,
122
- scope: l,
123
- nodeFunctionId: e.id
124
- }), e = o.getNodeById(T.id, e.nextNodeId);
119
+ const F = S();
120
+ h.push({
121
+ node: F,
122
+ depth: T,
123
+ scope: e,
124
+ nodeFunctionId: c.id
125
+ }), c = n.getNodeById(s.id, c.nextNodeId);
125
126
  }
126
127
  };
127
- return f(o.getNodeById(T.id, T.startingNodeId), 0, [0]), p;
128
- }, [t, T, n, o, u, v, m, r]) ?? [];
128
+ return i(n.getNodeById(s.id, s.startingNodeId), 0, [0]), h;
129
+ }, [t, s, o, n, d, M, m, u]) ?? [];
129
130
  };
130
131
  export {
131
- re as useReferenceSuggestions
132
+ pe as useReferenceSuggestions
132
133
  };
@@ -1,8 +1,7 @@
1
- import { jsx as r, jsxs as _ } from "react/jsx-runtime";
2
- import { c as k } from "../../_virtual/compiler-runtime.js";
3
- import { MenuTrigger as v, MenuSeparator as C, MenuPortal as A, Menu as E } from "../menu/Menu.js";
4
- import I from "react";
5
- import { DFlowSuggestionMenuFooter as B } from "./DFlowSuggestionMenuFooter.js";
1
+ import { jsx as m, jsxs as w } from "react/jsx-runtime";
2
+ import { c as F } from "../../_virtual/compiler-runtime.js";
3
+ import { MenuTrigger as j, MenuPortal as k, Menu as v } from "../menu/Menu.js";
4
+ import D from "react";
6
5
  import "@radix-ui/react-checkbox";
7
6
  import "merge-props";
8
7
  import "js-md5";
@@ -10,64 +9,58 @@ import "@tabler/icons-react";
10
9
  import '../../assets/components/form/Input.style.css';/* empty css */
11
10
  import "../form/EmailInput.js";
12
11
  import "../form/Input.js";
13
- import { InputSuggestionMenuContentItems as L, InputSuggestionMenuContent as P } from "../form/InputSuggestion.js";
12
+ import { InputSuggestionMenuContentItems as A, InputSuggestionMenuContent as E } from "../form/InputSuggestion.js";
14
13
  import "../form/NumberInput.js";
15
14
  import "../form/PasswordInput.js";
16
15
  import "@radix-ui/react-one-time-password-field";
17
16
  import "@radix-ui/react-radio-group";
18
17
  import "../form/SwitchInput.js";
19
18
  import "../form/TextInput.js";
20
- import { toInputSuggestions as U } from "./DFlowSuggestionMenu.util.js";
21
- import { DFlowSuggestionMenuSearchBar as $ } from "./DFlowSuggestionMenuSearchBar.js";
22
- const ue = (R) => {
23
- const e = k.c(25), {
24
- suggestions: f,
25
- triggerContent: M,
26
- onSuggestionSelect: x
27
- } = R;
28
- let c;
29
- e[0] !== f ? (c = f === void 0 ? [] : f, e[0] = f, e[1] = c) : c = e[1];
30
- const t = c, D = x === void 0 ? q : x, w = I.useRef(null), [y, F] = I.useState(t);
31
- let p, g;
32
- e[2] !== t ? (p = () => {
33
- F(t);
34
- }, g = [t], e[2] = t, e[3] = p, e[4] = g) : (p = e[3], g = e[4]), I.useEffect(p, g);
19
+ import { toInputSuggestions as z } from "./DFlowSuggestionMenu.util.js";
20
+ import { DFlowSuggestionMenuSearchBar as B } from "./DFlowSuggestionMenuSearchBar.js";
21
+ import { Card as L } from "../card/Card.js";
22
+ const it = (y) => {
23
+ const t = F.c(22), {
24
+ suggestions: p,
25
+ triggerContent: S,
26
+ onSuggestionSelect: M
27
+ } = y;
28
+ let g;
29
+ t[0] !== p ? (g = p === void 0 ? [] : p, t[0] = p, t[1] = g) : g = t[1];
30
+ const e = g, d = M === void 0 ? P : M, h = D.useRef(null), [x, I] = D.useState(e);
31
+ let c, f;
32
+ t[2] !== e ? (c = () => {
33
+ I(e);
34
+ }, f = [e], t[2] = e, t[3] = c, t[4] = f) : (c = t[3], f = t[4]), D.useEffect(c, f);
35
+ let r;
36
+ t[5] !== S ? (r = /* @__PURE__ */ m(j, { asChild: !0, children: S }), t[5] = S, t[6] = r) : r = t[6];
35
37
  let i;
36
- e[5] !== M ? (i = /* @__PURE__ */ r(v, { asChild: !0, children: M }), e[5] = M, e[6] = i) : i = e[6];
38
+ t[7] !== e ? (i = /* @__PURE__ */ m(B, { onType: (o) => {
39
+ o.key === "ArrowDown" ? (o.preventDefault(), h.current?.focusFirstItem()) : o.key === "ArrowUp" && (o.preventDefault(), h.current?.focusLastItem());
40
+ const C = o.target.value;
41
+ return I(e.filter((R) => R.displayText.some((T) => T.includes(C)))), o.preventDefault(), !1;
42
+ } }), t[7] = e, t[8] = i) : i = t[8];
37
43
  let s;
38
- e[7] !== t ? (s = /* @__PURE__ */ r($, { onType: (o) => {
39
- o.key === "ArrowDown" ? (o.preventDefault(), w.current?.focusFirstItem()) : o.key === "ArrowUp" && (o.preventDefault(), w.current?.focusLastItem());
40
- const T = o.target.value;
41
- return F(t.filter((b) => b.displayText.some((j) => j.includes(T)))), o.preventDefault(), !1;
42
- } }), e[7] = t, e[8] = s) : s = e[8];
43
- let a;
44
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ r(C, {}), e[9] = a) : a = e[9];
44
+ t[9] !== x ? (s = z(x), t[9] = x, t[10] = s) : s = t[10];
45
45
  let n;
46
- e[10] !== y ? (n = U(y), e[10] = y, e[11] = n) : n = e[11];
46
+ t[11] !== d ? (n = (o) => {
47
+ d(o.valueData);
48
+ }, t[11] = d, t[12] = n) : n = t[12];
47
49
  let l;
48
- e[12] !== D ? (l = (o) => {
49
- D(o.valueData);
50
- }, e[12] = D, e[13] = l) : l = e[13];
50
+ t[13] !== s || t[14] !== n ? (l = /* @__PURE__ */ m(L, { paddingSize: "xxs", mt: -0.2, mx: -0.2, children: /* @__PURE__ */ m(A, { ref: h, suggestions: s, onSuggestionSelect: n }) }), t[13] = s, t[14] = n, t[15] = l) : l = t[15];
51
51
  let u;
52
- e[14] !== n || e[15] !== l ? (u = /* @__PURE__ */ r(L, { ref: w, suggestions: n, onSuggestionSelect: l }), e[14] = n, e[15] = l, e[16] = u) : u = e[16];
53
- let S, d;
54
- e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ r(C, {}), d = /* @__PURE__ */ r(B, {}), e[17] = S, e[18] = d) : (S = e[17], d = e[18]);
55
- let m;
56
- e[19] !== u || e[20] !== s ? (m = /* @__PURE__ */ r(A, { children: /* @__PURE__ */ _(P, { align: "center", children: [
57
- s,
58
- a,
59
- u,
60
- S,
61
- d
62
- ] }) }), e[19] = u, e[20] = s, e[21] = m) : m = e[21];
63
- let h;
64
- return e[22] !== m || e[23] !== i ? (h = /* @__PURE__ */ _(E, { children: [
52
+ t[16] !== i || t[17] !== l ? (u = /* @__PURE__ */ m(k, { children: /* @__PURE__ */ w(E, { align: "center", color: "secondary", children: [
65
53
  i,
66
- m
67
- ] }), e[22] = m, e[23] = i, e[24] = h) : h = e[24], h;
54
+ l
55
+ ] }) }), t[16] = i, t[17] = l, t[18] = u) : u = t[18];
56
+ let a;
57
+ return t[19] !== u || t[20] !== r ? (a = /* @__PURE__ */ w(v, { children: [
58
+ r,
59
+ u
60
+ ] }), t[19] = u, t[20] = r, t[21] = a) : a = t[21], a;
68
61
  };
69
- function q() {
62
+ function P() {
70
63
  }
71
64
  export {
72
- ue as DFlowSuggestionMenu
65
+ it as DFlowSuggestionMenu
73
66
  };
@@ -1,58 +1,63 @@
1
- import S from "react";
2
- import { DFlowDataTypeReactiveService as E } from "../d-flow-data-type/DFlowDataType.service.js";
3
- import { DataTypeView as C } from "../d-flow-data-type/DFlowDataType.view.js";
4
- import { useService as V, useStore as _ } from "../../utils/contextStore.js";
5
- import { InspectionSeverity as P } from "../../utils/inspection.js";
1
+ import V from "react";
2
+ import { DFlowDataTypeReactiveService as x } from "../d-flow-data-type/DFlowDataType.service.js";
3
+ import { DataTypeView as q } from "../d-flow-data-type/DFlowDataType.view.js";
4
+ import { useService as _, useStore as R } from "../../utils/contextStore.js";
5
+ import { InspectionSeverity as z } from "../../utils/inspection.js";
6
6
  import "merge-props";
7
7
  import "js-md5";
8
- import { resolveGenericKeys as U, replaceGenericKeysInType as q, replaceGenericKeysInDataTypeObject as z } from "../../utils/generics.js";
9
- import { useReturnType as H } from "../d-flow-function/DFlowFunction.return.hook.js";
10
- import { DFlowFunctionReactiveService as G } from "../d-flow-function/DFlowFunction.service.js";
11
- import { useDataTypeValidation as O } from "./DDataTypeValidation.hook.js";
12
- import { useValueValidation as w } from "./DValueValidation.hook.js";
8
+ import { resolveGenericKeys as H, replaceGenericKeysInType as J, replaceGenericKeysInDataTypeObject as L } from "../../utils/generics.js";
9
+ import { useReturnType as Q } from "../d-flow-function/DFlowFunction.return.hook.js";
10
+ import { DFlowFunctionReactiveService as E } from "../d-flow-function/DFlowFunction.service.js";
11
+ import { useDataTypeValidation as G } from "./DDataTypeValidation.hook.js";
12
+ import { useValueValidation as O } from "./DValueValidation.hook.js";
13
13
  import "../d-flow/DFlow.js";
14
14
  import { DFlowReactiveService as M } from "../d-flow/DFlow.service.js";
15
- const N = (t) => t.__typename === "ReferenceValue", F = (t) => t.__typename === "NodeFunctionIdWrapper", b = (t, r) => new C(z(t.json, r)), W = (t, r, i) => ({
16
- parameterId: t,
17
- type: P.ERROR,
15
+ import { getReferenceType as X } from "../d-flow-node/DFlowNodeReference.return.hook.js";
16
+ import { DFlowTypeReactiveService as W } from "../d-flow-type/DFlowType.service.js";
17
+ const F = (r) => r.__typename === "ReferenceValue", I = (r) => r.__typename === "NodeFunctionIdWrapper", b = (r, i) => new q(L(r.json, i)), j = (r, i, n) => ({
18
+ parameterId: r,
19
+ type: z.ERROR,
18
20
  message: [{
19
21
  code: "en-US",
20
- content: `Argument of type ${i?.name[0]?.content} is not assignable to parameter of type ${r?.name[0]?.content}`
22
+ content: `Argument of type ${n?.name[0]?.content} is not assignable to parameter of type ${i?.name[0]?.content}`
21
23
  }]
22
- }), ae = (t, r) => {
23
- const i = V(G), j = _(G), f = V(M), I = _(M), n = V(E), K = _(E), s = f.getById(r), l = f.getNodeById(r, t), T = l?.parameters?.nodes?.map((e) => e?.value) ?? [], m = i.getById(l?.functionDefinition?.id), R = m?.parameterDefinitions ?? [], h = m?.genericKeys ?? [], D = S.useMemo(() => U(m, T, n, i, s), [m, T, n, K, s, I]), x = S.useCallback((e, a) => {
24
- if (F(e) && a?.variant !== "NODE" || N(e)) {
25
- const d = f.getNodeById(r, e.__typename == "NodeFunctionIdWrapper" ? e.id : e.__typename === "ReferenceValue" ? e.nodeFunctionId : void 0), o = i.getById(d?.functionDefinition?.id), g = d?.parameters?.nodes?.map((p) => p?.value) ?? [];
26
- return H(o, g, n, i);
24
+ }), ue = (r, i) => {
25
+ const n = _(E), $ = R(E), y = _(M), N = R(M), k = _(W), A = R(W), o = _(x), B = R(x), s = y.getById(i), T = y.getNodeById(i, r), g = T?.parameters?.nodes?.map((e) => e?.value) ?? [], f = n.getById(T?.functionDefinition?.id), S = f?.parameterDefinitions ?? [], w = f?.genericKeys ?? [], D = V.useMemo(() => H(f, g, o, n, s), [f, g, o, B, s, N]), K = V.useCallback((e, p) => {
26
+ if (I(e) && p?.variant !== "NODE") {
27
+ const a = y.getNodeById(i, e.__typename == "NodeFunctionIdWrapper" ? e.id : e.__typename === "ReferenceValue" ? e.nodeFunctionId : void 0), t = n.getById(a?.functionDefinition?.id), m = a?.parameters?.nodes?.map((d) => d?.value) ?? [];
28
+ return Q(t, m, o, n);
29
+ } else if (F(e)) {
30
+ const a = y.getNodeById(i, e.__typename == "NodeFunctionIdWrapper" ? e.id : e.__typename === "ReferenceValue" ? e.nodeFunctionId : void 0), t = n.getById(a?.functionDefinition?.id), m = k.getById(s?.type?.id)?.json();
31
+ return X(e, o, n, t, a, m);
27
32
  }
28
- return n.getTypeFromValue(e, s);
29
- }, [n, s, r, f, i]);
30
- return S.useMemo(() => {
33
+ return o.getTypeFromValue(e, s);
34
+ }, [o, s, i, y, n, A]);
35
+ return V.useMemo(() => {
31
36
  const e = [];
32
- for (let a = 0; a < R.length; a++) {
33
- const d = R[a], o = T[a], g = l?.parameters?.nodes?.find((v) => v?.parameterDefinition?.id === d.id);
34
- if (!o) continue;
35
- const p = d.dataTypeIdentifier, B = q(p, D), c = n.getDataType(B), $ = x(o, c), y = n.getDataType($);
36
- if (!c || !y) {
37
- e.push(W(g?.id, c, y));
37
+ for (let p = 0; p < S.length; p++) {
38
+ const a = S[p], t = g[p], m = T?.parameters?.nodes?.find((v) => v?.parameterDefinition?.id === a.id);
39
+ if (!t) continue;
40
+ const d = a.dataTypeIdentifier, h = J(d, D), c = o.getDataType(h), C = K(t, c), u = o.getDataType(C);
41
+ if (!c || !u) {
42
+ e.push(j(m?.id, c, u));
38
43
  continue;
39
44
  }
40
- const k = !!p?.genericType || !!p?.genericKey && h.includes(p.genericKey);
41
- let u = !0;
42
- if (k) {
45
+ const P = !!d?.genericType || !!d?.genericKey && w.includes(d.genericKey);
46
+ let l = !0;
47
+ if (P) {
43
48
  const v = b(c, D);
44
- if (N(o) || F(o) && c.variant !== "NODE") {
45
- const A = b(y, D);
46
- u = O(v, A);
49
+ if (F(t) || I(t) && c.variant !== "NODE") {
50
+ const U = b(u, D);
51
+ l = G(v, U);
47
52
  } else
48
- u = w(o, v, n, s, B?.genericType?.genericMappers, i);
53
+ l = O(t, v, o, s, h?.genericType?.genericMappers, n);
49
54
  } else
50
- N(o) || F(o) && c.variant !== "NODE" ? u = O(c, y) : u = w(o, c, n, s, [], i);
51
- u || e.push(W(g?.id, c, y));
55
+ F(t) || I(t) && c.variant !== "NODE" ? l = G(c, u) : l = O(t, c, o, s, [], n);
56
+ l || e.push(j(m?.id, c, u));
52
57
  }
53
58
  return e.length > 0 ? e : null;
54
- }, [s, l, T, m, R, h, D, x, t, r, j, I, K, n]);
59
+ }, [s, T, g, f, S, w, D, K, r, i, $, N, B, o]);
55
60
  };
56
61
  export {
57
- ae as useNodeValidation
62
+ ue as useNodeValidation
58
63
  };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
2
  import m, { isValidElement as ce } from "react";
3
- import { createPortal as H } from "react-dom";
3
+ import { createPortal as K } from "react-dom";
4
4
  import "../../utils/contextStore.js";
5
5
  import { mergeCode0Props as ue } from "../../utils/utils.js";
6
- import de, { Prec as J, keymap as K, ViewPlugin as me, RangeSetBuilder as he, Decoration as F, EditorView as fe, WidgetType as ge } from "@uiw/react-codemirror";
6
+ import de, { Prec as _, keymap as J, ViewPlugin as me, RangeSetBuilder as he, Decoration as F, EditorView as fe, WidgetType as ge } from "@uiw/react-codemirror";
7
7
  import { json as pe, jsonParseLinter as ye } from "@codemirror/lang-json";
8
8
  import { syntaxTree as L } from "@codemirror/language";
9
9
  import { linter as be } from "@codemirror/lint";
@@ -15,7 +15,7 @@ import { tags as b, getStyleTags as Te } from "../../node_modules/@lezer/highlig
15
15
  import { hashToColor as v } from "../d-flow/DFlow.util.js";
16
16
  import '../../assets/components/editor/Editor.styles.css';/* empty css */
17
17
  import { Badge as y } from "../badge/Badge.js";
18
- import { IconExclamationCircle as xe, IconAlertTriangle as Ae, IconAlertSquareRounded as ke, IconInfoCircle as Ee, IconSpace as ze, IconArrowBarToRight as Pe, IconCornerDownLeft as je } from "@tabler/icons-react";
18
+ import { IconExclamationCircle as Ae, IconAlertTriangle as xe, IconAlertSquareRounded as ke, IconInfoCircle as Ee, IconSpace as ze, IconArrowBarToRight as Pe, IconCornerDownLeft as je } from "@tabler/icons-react";
19
19
  import { Text as a } from "../text/Text.js";
20
20
  import { Flex as k } from "../flex/Flex.js";
21
21
  import { Tooltip as E, TooltipTrigger as z, TooltipPortal as P, TooltipContent as j, TooltipArrow as V } from "../tooltip/Tooltip.js";
@@ -140,10 +140,10 @@ const Fe = Ce({
140
140
  } : {
141
141
  override: [w]
142
142
  }
143
- })), e.push(J.highest(K.of([{
143
+ })), e.push(_.highest(J.of([{
144
144
  key: "Tab",
145
145
  run: Re
146
- }]))), D && e.push(J.highest(K.of([{
146
+ }]))), D && e.push(_.highest(J.of([{
147
147
  key: "ArrowUp",
148
148
  run: (l) => (f || N(l), !0)
149
149
  }, {
@@ -165,15 +165,15 @@ const Fe = Ce({
165
165
  const l = new he(), u = Object.keys(g || {});
166
166
  return L(o.state).iterate({
167
167
  enter: (d) => {
168
- const x = o.state.doc.sliceString(d.from, d.to);
169
- if (x.includes(`
168
+ const A = o.state.doc.sliceString(d.from, d.to);
169
+ if (A.includes(`
170
170
  `)) return;
171
- const q = h?.(x), ae = Te(d)?.tags.map((A) => "name" in A ? A.name : void 0), _ = u.find((A) => ae?.includes(A));
172
- _ && !q ? l.add(d.from, d.to, F.replace({
173
- widget: new X(_, x),
171
+ const q = h?.(A), ae = Te(d)?.tags.map((x) => "name" in x ? x.name : void 0), H = u.find((x) => ae?.includes(x));
172
+ H && !q ? l.add(d.from, d.to, F.replace({
173
+ widget: new X(H, A),
174
174
  point: !0
175
175
  })) : q && l.add(d.from, d.to, F.replace({
176
- widget: new X(q, x),
176
+ widget: new X(q, A),
177
177
  point: !0
178
178
  }));
179
179
  }
@@ -237,7 +237,7 @@ const Fe = Ce({
237
237
  }, align: "center", children: [
238
238
  c.filter((e) => e.severity == "error").length > 0 ? /* @__PURE__ */ s(E, { children: [
239
239
  /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "red", children: [
240
- /* @__PURE__ */ t(xe, { size: 13 }),
240
+ /* @__PURE__ */ t(Ae, { size: 13 }),
241
241
  /* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "error").length })
242
242
  ] }) }),
243
243
  /* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
@@ -247,7 +247,7 @@ const Fe = Ce({
247
247
  ] }) : null,
248
248
  c.filter((e) => e.severity == "warning").length > 0 ? /* @__PURE__ */ s(E, { children: [
249
249
  /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "orange", children: [
250
- /* @__PURE__ */ t(Ae, { size: 13 }),
250
+ /* @__PURE__ */ t(xe, { size: 13 }),
251
251
  /* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "warning").length })
252
252
  ] }) }),
253
253
  /* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
@@ -316,13 +316,13 @@ const Fe = Ce({
316
316
  }, onUpdate: M, basicSetup: ee }),
317
317
  g && Array.from(oe.entries()).map(([e, n]) => {
318
318
  const o = g[n.type];
319
- return o ? H(/* @__PURE__ */ t("div", { style: {
319
+ return o ? K(/* @__PURE__ */ t("div", { style: {
320
320
  display: "contents"
321
321
  }, children: o({
322
322
  content: n.value
323
323
  }) }, e.outerHTML + n.value), e) : null;
324
324
  }),
325
- f && H(/* @__PURE__ */ t("div", { ref: B, style: {
325
+ f && K(/* @__PURE__ */ t("div", { ref: B, style: {
326
326
  position: "fixed",
327
327
  top: f.position.top,
328
328
  left: f.position.left,