@code0-tech/pictor 0.0.0-mvp.29 → 0.0.0-mvp.30

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 (125) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +6 -0
  2. package/dist/_virtual/index.js +4 -0
  3. package/dist/_virtual/index2.js +4 -0
  4. package/dist/_virtual/react-contenteditable.js +7 -0
  5. package/dist/_virtual/react-contenteditable2.js +4 -0
  6. package/dist/_virtual/react-dom-server-legacy.browser.development.js +4 -0
  7. package/dist/_virtual/react-dom-server-legacy.browser.production.js +4 -0
  8. package/dist/_virtual/react-dom-server.browser.development.js +4 -0
  9. package/dist/_virtual/react-dom-server.browser.production.js +4 -0
  10. package/dist/_virtual/react-is.development.js +4 -0
  11. package/dist/_virtual/react-is.production.min.js +4 -0
  12. package/dist/_virtual/server.browser.js +5 -0
  13. package/dist/_virtual/server.browser2.js +4 -0
  14. package/dist/assets/components/d-resizable/DResizable.style.css +1 -1
  15. package/dist/assets/components/form/Input.style.css +1 -1
  16. package/dist/components/breadcrumb/Breadcrumb.js +12 -12
  17. package/dist/components/button-group/ButtonGroup.js +12 -12
  18. package/dist/components/d-flow/DFlow.edges.hook.js +57 -54
  19. package/dist/components/d-flow/DFlow.js +304 -268
  20. package/dist/components/d-flow/DFlow.nodes.hook.js +60 -59
  21. package/dist/components/d-flow/DFlow.service.d.ts +3 -2
  22. package/dist/components/d-flow/DFlow.service.js +62 -47
  23. package/dist/components/d-flow/DFlow.util.d.ts +4 -0
  24. package/dist/components/d-flow/DFlow.util.js +63 -0
  25. package/dist/components/d-flow/DFlowEdge.js +34 -34
  26. package/dist/components/d-flow-data-type/DFlowDataType.service.js +17 -14
  27. package/dist/components/d-flow-data-type/DFlowDataType.view.d.ts +7 -4
  28. package/dist/components/d-flow-data-type/DFlowDataType.view.js +11 -6
  29. package/dist/components/d-flow-file/DFlowTabDefault.d.ts +0 -3
  30. package/dist/components/d-flow-file/DFlowTabDefault.js +77 -112
  31. package/dist/components/d-flow-file/DFlowTabTrigger.js +38 -49
  32. package/dist/components/d-flow-file/DFlowTabs.js +26 -27
  33. package/dist/components/d-flow-folder/DFlowFolder.js +170 -143
  34. package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +18 -11
  35. package/dist/components/d-flow-folder/DFlowFolderItemPathInput.js +1 -0
  36. package/dist/components/d-flow-function/DFlowFunction.input.hook.js +4 -5
  37. package/dist/components/d-flow-function/DFlowFunction.return.hook.js +1 -1
  38. package/dist/components/d-flow-function/DFlowFunction.view.d.ts +14 -11
  39. package/dist/components/d-flow-function/DFlowFunction.view.js +19 -12
  40. package/dist/components/d-flow-function/DFlowFunctionDefaultCard.js +72 -75
  41. package/dist/components/d-flow-function/DFlowFunctionSuggestionCard.js +27 -32
  42. package/dist/components/d-flow-function/DFlowFunctionTriggerCard.js +17 -10
  43. package/dist/components/d-flow-input/DFlowInputDataType.js +38 -33
  44. package/dist/components/d-flow-input/DFlowInputDefault.d.ts +10 -0
  45. package/dist/components/d-flow-input/DFlowInputDefault.js +128 -0
  46. package/dist/components/d-flow-input/DFlowInputLiteralBadge.d.ts +7 -0
  47. package/dist/components/d-flow-input/DFlowInputLiteralBadge.js +24 -0
  48. package/dist/components/d-flow-input/DFlowInputNodeBadge.d.ts +11 -0
  49. package/dist/components/d-flow-input/DFlowInputNodeBadge.js +44 -0
  50. package/dist/components/d-flow-input/DFlowInputReferenceBadge.d.ts +11 -0
  51. package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +33 -0
  52. package/dist/components/d-flow-panel/DFlowExport.js +1 -1
  53. package/dist/components/d-flow-panel/DFlowMiniMap.js +1 -1
  54. package/dist/components/d-flow-panel/DFlowPanelControl.js +34 -32
  55. package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.d.ts +3 -0
  56. package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.js +34 -0
  57. package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.d.ts +3 -0
  58. package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.js +50 -0
  59. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.d.ts +3 -0
  60. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +133 -0
  61. package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.d.ts +3 -18
  62. package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.js +19 -156
  63. package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +47 -58
  64. package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.util.js +5 -4
  65. package/dist/components/d-flow-suggestion/DFlowSuggestionSearchInput.js +6 -6
  66. package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.d.ts +3 -0
  67. package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.js +44 -0
  68. package/dist/components/d-flow-type/DFlowType.view.d.ts +5 -5
  69. package/dist/components/d-flow-type/DFlowType.view.js +22 -12
  70. package/dist/components/d-flow-validation/DFlowValidation.hook.js +1 -1
  71. package/dist/components/d-flow-validation/DNodeValidation.hook.js +39 -43
  72. package/dist/components/d-resizable/DResizable.d.ts +4 -4
  73. package/dist/components/d-resizable/DResizable.js +22 -21
  74. package/dist/components/d-user/DUserInput.js +23 -21
  75. package/dist/components/file-tabs/FileTabs.service.d.ts +0 -1
  76. package/dist/components/file-tabs/FileTabs.service.js +49 -53
  77. package/dist/components/form/EmailInput.js +9 -9
  78. package/dist/components/form/Input.d.ts +2 -1
  79. package/dist/components/form/Input.js +294 -397
  80. package/dist/components/form/Input.syntax.hook.d.ts +1 -18
  81. package/dist/components/form/Input.syntax.hook.js +7 -73
  82. package/dist/components/form/Input.utils.d.ts +1 -2
  83. package/dist/components/form/Input.utils.js +26 -21
  84. package/dist/components/form/InputContentEditable.hook.d.ts +40 -0
  85. package/dist/components/form/InputContentEditable.hook.js +471 -0
  86. package/dist/components/form/InputSuggestion.d.ts +2 -2
  87. package/dist/components/form/InputSuggestion.js +169 -107
  88. package/dist/components/form/PasswordInput.js +8 -8
  89. package/dist/components/form/TextInput.js +11 -11
  90. package/dist/components/form/useForm.d.ts +1 -0
  91. package/dist/components/form/useForm.js +45 -60
  92. package/dist/components/menu/Menu.js +4 -4
  93. package/dist/index.js +155 -154
  94. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +30 -30
  95. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +8 -8
  96. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +8 -8
  97. package/dist/node_modules/fast-deep-equal/index.js +31 -0
  98. package/dist/node_modules/object-assign/index.js +49 -0
  99. package/dist/node_modules/prop-types/checkPropTypes.js +54 -0
  100. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +52 -0
  101. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +329 -0
  102. package/dist/node_modules/prop-types/index.js +17 -0
  103. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
  104. package/dist/node_modules/prop-types/lib/has.js +7 -0
  105. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +87 -0
  106. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +70 -0
  107. package/dist/node_modules/prop-types/node_modules/react-is/index.js +10 -0
  108. package/dist/node_modules/react-contenteditable/lib/react-contenteditable.js +132 -0
  109. package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +6235 -0
  110. package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +4096 -0
  111. package/dist/node_modules/react-dom/cjs/react-dom-server.browser.development.js +6753 -0
  112. package/dist/node_modules/react-dom/cjs/react-dom-server.browser.production.js +4645 -0
  113. package/dist/node_modules/react-dom/server.browser.js +15 -0
  114. package/dist/utils/generics.d.ts +2 -0
  115. package/dist/utils/generics.js +93 -80
  116. package/dist/utils/index.js +22 -21
  117. package/dist/utils/inspection.d.ts +4 -2
  118. package/dist/utils/inspection.js +27 -2
  119. package/package.json +10 -8
  120. package/dist/components/form/Input.selection.hook.d.ts +0 -17
  121. package/dist/components/form/Input.selection.hook.js +0 -78
  122. package/dist/components/form/InputSyntax.d.ts +0 -19
  123. package/dist/components/form/InputSyntax.js +0 -52
  124. package/dist/components/form/inputSyntaxMapping.d.ts +0 -3
  125. package/dist/components/form/inputSyntaxMapping.js +0 -42
@@ -1,52 +1,52 @@
1
1
  import { useService as b, useStore as B } from "../../utils/contextStore.js";
2
- import w from "react";
2
+ import C from "react";
3
3
  import "merge-props";
4
4
  import { DFlowReactiveService as M } from "./DFlow.service.js";
5
- import { DFlowFunctionReactiveService as C } from "../d-flow-function/DFlowFunction.service.js";
6
- import { DFlowDataTypeReactiveService as _ } from "../d-flow-data-type/DFlowDataType.service.js";
7
- import { md5 as V } from "js-md5";
8
- const j = /* @__PURE__ */ new Map([["std", "default"]]), q = (i, h) => {
9
- if (!h || i.size === 0) return "";
10
- const p = /[:._\-\/\s]+/, n = h.trim().toLowerCase();
11
- let o = null, u = -1 / 0;
5
+ import { DFlowFunctionReactiveService as _ } from "../d-flow-function/DFlowFunction.service.js";
6
+ import { hashToColor as O } from "./DFlow.util.js";
7
+ import { DFlowDataTypeReactiveService as k } from "../d-flow-data-type/DFlowDataType.service.js";
8
+ const V = /* @__PURE__ */ new Map([["std", "default"]]), j = (i, m) => {
9
+ if (!m || i.size === 0) return "";
10
+ const v = /[:._\-\/\s]+/, o = m.trim().toLowerCase();
11
+ let n = null, u = -1 / 0;
12
12
  for (const [l, T] of i.entries()) {
13
13
  const a = l.trim().toLowerCase();
14
- if (n === a)
14
+ if (o === a)
15
15
  return T;
16
- let e = 0;
17
- if (n.startsWith(a)) {
18
- e = 2e3 + a.length * 2;
19
- const d = n.charAt(a.length);
20
- (d === "" || p.test(d)) && (e += 200);
16
+ let t = 0;
17
+ if (o.startsWith(a)) {
18
+ t = 2e3 + a.length * 2;
19
+ const d = o.charAt(a.length);
20
+ (d === "" || v.test(d)) && (t += 200);
21
21
  } else {
22
- const d = Math.min(n.length, a.length);
23
- let s = 0;
24
- for (; s < d && n.charCodeAt(s) === a.charCodeAt(s); )
25
- s++;
26
- if (s > 0) {
27
- e = 1e3 + s;
28
- const f = n.charAt(s), g = a.charAt(s);
29
- (f === "" || p.test(f) || g === "" || p.test(g)) && (e += 50);
22
+ const d = Math.min(o.length, a.length);
23
+ let r = 0;
24
+ for (; r < d && o.charCodeAt(r) === a.charCodeAt(r); )
25
+ r++;
26
+ if (r > 0) {
27
+ t = 1e3 + r;
28
+ const f = o.charAt(r), g = a.charAt(r);
29
+ (f === "" || v.test(f) || g === "" || v.test(g)) && (t += 50);
30
30
  }
31
31
  }
32
- e > u ? (u = e, o = l) : (e === u && o !== null && l.length > o.length || e === u && o === null) && (o = l);
32
+ t > u ? (u = t, n = l) : (t === u && n !== null && l.length > n.length || t === u && n === null) && (n = l);
33
33
  }
34
- return o !== null ? i.get(o) : "";
35
- }, ne = (i, h, p) => {
36
- const n = b(M), o = B(M), u = b(C), l = B(C), T = b(_), a = B(_), e = w.useMemo(() => n.getById(i, {
37
- namespaceId: h,
38
- projectId: p
39
- }), [i, o]);
40
- return w.useMemo(() => {
41
- if (!e) return [];
34
+ return n !== null ? i.get(n) : "";
35
+ }, Z = (i, m, v) => {
36
+ const o = b(M), n = B(M), u = b(_), l = B(_), T = b(k), a = B(k), t = C.useMemo(() => o.getById(i, {
37
+ namespaceId: m,
38
+ projectId: v
39
+ }), [i, n]);
40
+ return C.useMemo(() => {
41
+ if (!t) return [];
42
42
  const d = [];
43
- let s = 0;
44
- const f = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), k = (t, r = f) => (r.has(t) || r.set(t, u.getById(t)), r.get(t)), A = (t, r = g) => (r.has(t) || r.set(t, T.getDataType(t)), r.get(t));
43
+ let r = 0;
44
+ const f = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), A = (e, s = f) => (s.has(e) || s.set(e, u.getById(e)), s.get(e)), $ = (e, s = g) => (s.has(e) || s.set(e, T.getDataType(e)), s.get(e));
45
45
  let R = 0;
46
46
  const E = () => ++R;
47
47
  let W = 0;
48
48
  d.push({
49
- id: `${e.id}`,
49
+ id: `${t.id}`,
50
50
  type: "trigger",
51
51
  position: {
52
52
  x: 0,
@@ -54,15 +54,16 @@ const j = /* @__PURE__ */ new Map([["std", "default"]]), q = (i, h) => {
54
54
  },
55
55
  draggable: !1,
56
56
  data: {
57
- instance: e,
57
+ instance: t,
58
58
  flowId: i
59
59
  }
60
60
  });
61
- const I = (t, r = !1, K, v = 0, S = [0], y, N = f, D = g) => {
62
- const m = `${t.id}-${s++}`, L = ++W;
61
+ const I = (e, s = !1, K, p = 0, h = [0], y, S = f, N = g) => {
62
+ if (!e) return;
63
+ const D = `${e?.id}-${r++}`, L = ++W;
63
64
  d.push({
64
- id: m,
65
- type: q(j, t.functionDefinition?.identifier),
65
+ id: D,
66
+ type: j(V, e?.functionDefinition?.identifier),
66
67
  position: {
67
68
  x: 0,
68
69
  y: 0
@@ -71,24 +72,24 @@ const j = /* @__PURE__ */ new Map([["std", "default"]]), q = (i, h) => {
71
72
  parentId: y,
72
73
  extent: y ? "parent" : void 0,
73
74
  data: {
74
- nodeId: t.id,
75
- isParameter: r,
75
+ nodeId: e.id,
76
+ isParameter: s,
76
77
  flowId: i,
77
- linkingId: r ? K : void 0,
78
- scope: S,
78
+ linkingId: s ? K : void 0,
79
+ scope: h,
79
80
  // scope is now a PATH (number[])
80
- depth: v,
81
+ depth: p,
81
82
  // structural depth (0 at root, +1 per group)
82
83
  index: L
83
84
  // global node level
84
85
  }
85
86
  });
86
- const O = k(t.functionDefinition?.id, N);
87
- t.parameters?.nodes?.forEach((c) => {
88
- const F = O?.parameterDefinitions.find((x) => x.id == c?.runtimeParameter?.id)?.dataTypeIdentifier;
89
- if ((F ? A(F, D) : void 0)?.variant === "NODE") {
87
+ const z = A(e?.functionDefinition?.id, S);
88
+ e.parameters?.nodes?.forEach((c) => {
89
+ const F = z?.parameterDefinitions.find((x) => x.id == c?.runtimeParameter?.id)?.dataTypeIdentifier;
90
+ if ((F ? $(F, N) : void 0)?.variant === "NODE") {
90
91
  if (c?.value && c.value.__typename === "NodeFunctionIdWrapper") {
91
- const x = `${m}-group-${s++}`, $ = [...S, E()], z = V(`${m}-param-${JSON.stringify(c)}`), H = (J) => parseInt(J.slice(0, 8), 16) % 360;
92
+ const x = `${D}-group-${r++}`, w = [...h, E()];
92
93
  d.push({
93
94
  id: x,
94
95
  type: "group",
@@ -101,20 +102,20 @@ const j = /* @__PURE__ */ new Map([["std", "default"]]), q = (i, h) => {
101
102
  extent: y ? "parent" : void 0,
102
103
  data: {
103
104
  isParameter: !0,
104
- linkingId: m,
105
+ linkingId: D,
105
106
  flowId: i,
106
- depth: v + 1,
107
- scope: $,
108
- color: `hsl(${H(z)}, 100%, 72%)`
107
+ depth: p + 1,
108
+ scope: w,
109
+ color: O(c.value?.id ?? "")
109
110
  }
110
- }), I(n.getNodeById(i, c.value.id), !1, void 0, v + 1, $, x, N, D);
111
+ }), I(o.getNodeById(i, c.value.id), !1, void 0, p + 1, w, x, S, N);
111
112
  }
112
- } else c?.value && c.value.__typename === "NodeFunctionIdWrapper" && I(n.getNodeById(i, c.value.id), !0, m, v, S, y, N, D);
113
- }), t.nextNodeId && I(n.getNodeById(e.id, t.nextNodeId), !1, void 0, v, S, y, N, D);
113
+ } else c?.value && c.value.__typename === "NodeFunctionIdWrapper" && I(o.getNodeById(i, c.value.id), !0, D, p, h, y, S, N);
114
+ }), e.nextNodeId && I(o.getNodeById(t.id, e.nextNodeId), !1, void 0, p, h, y, S, N);
114
115
  };
115
- return e.startingNodeId && I(n.getNodeById(e.id, e.startingNodeId), !1, void 0, 0, [0], void 0, f, g), d;
116
- }, [e, o, l, a]);
116
+ return t.startingNodeId && I(o.getNodeById(t.id, t.startingNodeId), !1, void 0, 0, [0], void 0, f, g), d;
117
+ }, [t, n, l, a]);
117
118
  };
118
119
  export {
119
- ne as useFlowNodes
120
+ Z as useFlowNodes
120
121
  };
@@ -1,5 +1,5 @@
1
1
  import { ReactiveArrayService } from '../../utils';
2
- import { Flow, FlowInput, FlowSetting, LiteralValue, Namespace, NamespaceProject, NamespacesProjectsFlowsCreateInput, NamespacesProjectsFlowsCreatePayload, NamespacesProjectsFlowsDeleteInput, NamespacesProjectsFlowsDeletePayload, NamespacesProjectsFlowsUpdateInput, NamespacesProjectsFlowsUpdatePayload, NodeFunction, NodeParameter, ReferenceValue } from '@code0-tech/sagittarius-graphql-types';
2
+ import { Flow, FlowInput, FlowSetting, LiteralValue, Maybe, Namespace, NamespaceProject, NamespacesProjectsFlowsCreateInput, NamespacesProjectsFlowsCreatePayload, NamespacesProjectsFlowsDeleteInput, NamespacesProjectsFlowsDeletePayload, NamespacesProjectsFlowsUpdateInput, NamespacesProjectsFlowsUpdatePayload, NodeFunction, NodeParameter, ReferenceValue, Scalars } from '@code0-tech/sagittarius-graphql-types';
3
3
  export type DFlowDependencies = {
4
4
  namespaceId: Namespace['id'];
5
5
  projectId: NamespaceProject['id'];
@@ -7,11 +7,12 @@ export type DFlowDependencies = {
7
7
  export declare abstract class DFlowReactiveService extends ReactiveArrayService<Flow, DFlowDependencies> {
8
8
  getById(id: Flow['id'], dependencies?: DFlowDependencies): Flow | undefined;
9
9
  protected removeParameterNode(flow: Flow, parameter: NodeParameter): void;
10
+ getLinkedNodesById(flowId: Flow['id'], nodeId: NodeFunction['id']): NodeFunction[];
10
11
  getNodeById(flowId: Flow['id'], nodeId: NodeFunction['id']): NodeFunction | undefined;
11
12
  getPayloadById(flowId: Flow['id']): FlowInput | undefined;
12
13
  deleteNodeById(flowId: Flow['id'], nodeId: NodeFunction['id']): Promise<void>;
13
14
  addNextNodeById(flowId: Flow['id'], parentNodeId: NodeFunction['id'] | null, nextNode: NodeFunction): Promise<void>;
14
- setSettingValue(flowId: Flow['id'], settingId: FlowSetting['id'], value: FlowSetting['value']): Promise<void>;
15
+ setSettingValue(flowId: Flow['id'], settingIdentifier: Maybe<Scalars['String']['output']>, value: FlowSetting['value']): Promise<void>;
15
16
  setParameterValue(flowId: Flow['id'], nodeId: NodeFunction['id'], parameterId: NodeParameter['id'], value?: LiteralValue | ReferenceValue | NodeFunction): Promise<void>;
16
17
  abstract flowCreate(payload: NamespacesProjectsFlowsCreateInput): Promise<NamespacesProjectsFlowsCreatePayload | undefined>;
17
18
  abstract flowDelete(payload: NamespacesProjectsFlowsDeleteInput): Promise<NamespacesProjectsFlowsDeletePayload | undefined>;
@@ -1,32 +1,41 @@
1
1
  import "../../utils/contextStore.js";
2
2
  import "react";
3
- import { ReactiveArrayService as I } from "../../utils/reactiveArrayService.js";
3
+ import { ReactiveArrayService as N } from "../../utils/reactiveArrayService.js";
4
4
  import "merge-props";
5
- class m extends I {
6
- getById(n, t) {
7
- return this.values(t).find((i) => i.id === n);
5
+ class m extends N {
6
+ getById(t, i) {
7
+ return this.values(i).find((n) => n.id === t);
8
8
  }
9
- removeParameterNode(n, t) {
10
- if (t?.value?.__typename === "NodeFunctionIdWrapper") {
11
- const i = n?.nodes?.nodes?.find((e) => e?.id === t.value?.id);
12
- if (i) {
13
- n.nodes.nodes = n.nodes.nodes.filter((d) => d?.id !== t.value?.id);
14
- let e = i.nextNodeId;
9
+ removeParameterNode(t, i) {
10
+ if (i?.value?.__typename === "NodeFunctionIdWrapper") {
11
+ const n = t?.nodes?.nodes?.find((e) => e?.id === i.value?.id);
12
+ if (n) {
13
+ t.nodes.nodes = t.nodes.nodes.filter((d) => d?.id !== i.value?.id);
14
+ let e = n.nextNodeId;
15
15
  for (; e; ) {
16
- const d = n.nodes.nodes.find((o) => o?.id === e);
17
- d ? (n.nodes.nodes = n.nodes.nodes.filter((o) => o?.id !== e), e = d.nextNodeId) : e = null;
16
+ const d = t.nodes.nodes.find((o) => o?.id === e);
17
+ d ? (t.nodes.nodes = t.nodes.nodes.filter((o) => o?.id !== e), e = d.nextNodeId) : e = null;
18
18
  }
19
- i.parameters?.nodes?.forEach((d) => {
20
- this.removeParameterNode(n, d);
19
+ n.parameters?.nodes?.forEach((d) => {
20
+ this.removeParameterNode(t, d);
21
21
  });
22
22
  }
23
23
  }
24
24
  }
25
- getNodeById(n, t) {
26
- return this.getById(n)?.nodes?.nodes?.find((i) => i?.id === t);
25
+ getLinkedNodesById(t, i) {
26
+ const n = this.getNodeById(t, i), e = n ? this.getLinkedNodesById(t, n.nextNodeId) : [], d = [];
27
+ return n?.parameters?.nodes?.forEach((o) => {
28
+ if (o?.value?.__typename === "NodeFunctionIdWrapper") {
29
+ const r = this.getNodeById(t, o.value?.id);
30
+ r && (d.push(r), d.push(...r ? this.getLinkedNodesById(t, r.nextNodeId) : []));
31
+ }
32
+ }), [...n ? [n] : [], ...d, ...e];
33
+ }
34
+ getNodeById(t, i) {
35
+ return this.getById(t)?.nodes?.nodes?.find((n) => n?.id === i);
27
36
  }
28
- getPayloadById(n) {
29
- const t = this.getById(n), i = (e) => ({
37
+ getPayloadById(t) {
38
+ const i = this.getById(t), n = (e) => ({
30
39
  ...e?.dataType ? {
31
40
  dataTypeId: e?.dataType?.id
32
41
  } : {},
@@ -38,19 +47,19 @@ class m extends I {
38
47
  dataTypeId: e?.genericType?.dataType?.id,
39
48
  genericMappers: e?.genericType?.genericMappers?.map((d) => ({
40
49
  target: d.target,
41
- sourceDataTypeIdentifiers: d.sourceDataTypeIdentifiers?.map(i) ?? []
50
+ sourceDataTypeIdentifiers: d.sourceDataTypeIdentifiers?.map(n) ?? []
42
51
  })) ?? []
43
52
  }
44
53
  } : {}
45
54
  });
46
55
  return {
47
- name: t?.name,
48
- type: t?.type?.id,
49
- settings: t?.settings?.nodes?.map((e) => ({
56
+ name: i?.name,
57
+ type: i?.type?.id,
58
+ settings: i?.settings?.nodes?.map((e) => ({
50
59
  flowSettingIdentifier: e?.flowSettingIdentifier,
51
60
  value: e?.value
52
61
  })),
53
- nodes: t?.nodes?.nodes?.map((e) => ({
62
+ nodes: i?.nodes?.nodes?.map((e) => ({
54
63
  id: e?.id,
55
64
  nextNodeId: e?.nextNodeId,
56
65
  parameters: e?.parameters?.nodes?.map((d) => ({
@@ -61,7 +70,7 @@ class m extends I {
61
70
  literalValue: d.value.value
62
71
  } : {
63
72
  referenceValue: {
64
- dataTypeIdentifier: i((d?.value).dataTypeIdentifier),
73
+ dataTypeIdentifier: n((d?.value).dataTypeIdentifier),
65
74
  depth: (d?.value).depth,
66
75
  node: (d?.value).node,
67
76
  nodeFunctionId: (d?.value).nodeFunctionId,
@@ -72,46 +81,52 @@ class m extends I {
72
81
  })) ?? [],
73
82
  runtimeFunctionId: e?.functionDefinition?.runtimeFunctionDefinition?.id
74
83
  })) ?? [],
75
- startingNodeId: t?.startingNodeId
84
+ startingNodeId: i?.startingNodeId
76
85
  };
77
86
  }
78
- async deleteNodeById(n, t) {
79
- const i = this.getById(n), e = this.getNodeById(n, t), d = i?.nodes?.nodes?.find((s) => s?.nextNodeId === t), o = this.values().findIndex((s) => s.id === n);
80
- !i || !e || (i.nodes.nodes = i.nodes.nodes.filter((s) => s?.id !== t), e.parameters?.nodes?.forEach((s) => this.removeParameterNode(i, s)), d ? d.nextNodeId = e.nextNodeId : i.startingNodeId = e.nextNodeId ?? void 0, this.set(o, i));
87
+ async deleteNodeById(t, i) {
88
+ const n = this.getById(t), e = this.getNodeById(t, i), d = n?.nodes?.nodes?.find((s) => s?.parameters?.nodes?.find((a) => a?.value?.__typename === "NodeFunctionIdWrapper" && a.value?.id === i)), o = n?.nodes?.nodes?.find((s) => s?.nextNodeId === i), r = this.values().findIndex((s) => s.id === t);
89
+ if (!(!n || !e)) {
90
+ if (n.nodes.nodes = n.nodes.nodes.filter((s) => s?.id !== i), e.parameters?.nodes?.forEach((s) => this.removeParameterNode(n, s)), o ? o.nextNodeId = e.nextNodeId : d || (n.startingNodeId = e.nextNodeId ?? void 0), d) {
91
+ const s = d.parameters?.nodes?.find((a) => a?.value?.__typename === "NodeFunctionIdWrapper" && a.value?.id === i);
92
+ s && (s.value = void 0);
93
+ }
94
+ this.set(r, n);
95
+ }
81
96
  }
82
- async addNextNodeById(n, t, i) {
83
- const e = this.getById(n), d = this.values().findIndex((u) => u.id === n), o = t ? this.getNodeById(n, t) : void 0;
84
- if (!e || t && !o) return;
85
- const r = `gid://sagittarius/NodeFunction/${Math.max(0, ...e.nodes?.nodes?.map((u) => Number(u?.id?.match(/NodeFunction\/(\d+)$/)?.[1] ?? 0)) ?? [0]) + 1}`, a = {
86
- ...i,
87
- id: r
97
+ async addNextNodeById(t, i, n) {
98
+ const e = this.getById(t), d = this.values().findIndex((u) => u.id === t), o = i ? this.getNodeById(t, i) : void 0;
99
+ if (!e || i && !o) return;
100
+ const s = `gid://sagittarius/NodeFunction/${Math.max(0, ...e.nodes?.nodes?.map((u) => Number(u?.id?.match(/NodeFunction\/(\d+)$/)?.[1] ?? 0)) ?? [0]) + 1}`, a = {
101
+ ...JSON.parse(JSON.stringify(n)),
102
+ id: s
88
103
  };
89
104
  o && o.nextNodeId ? a.nextNodeId = o.nextNodeId : !o && e.startingNodeId && (a.nextNodeId = e.startingNodeId), e.nodes?.nodes?.push(a), o ? o.nextNodeId = a.id : e.startingNodeId = a.id, this.set(d, e);
90
105
  }
91
- async setSettingValue(n, t, i) {
92
- const e = this.getById(n), d = this.values().findIndex((s) => s.id === n);
106
+ async setSettingValue(t, i, n) {
107
+ const e = this.getById(t), d = this.values().findIndex((r) => r.id === t);
93
108
  if (!e) return;
94
- const o = e.settings?.nodes?.find((s) => s?.id === t);
95
- o && (o.value = i, this.set(d, e));
109
+ const o = e.settings?.nodes?.find((r) => r?.flowSettingIdentifier === i);
110
+ o && (o.value = n, this.set(d, e));
96
111
  }
97
- async setParameterValue(n, t, i, e) {
98
- const d = this.getById(n), o = this.values().findIndex((a) => a.id === n);
112
+ async setParameterValue(t, i, n, e) {
113
+ const d = this.getById(t), o = this.values().findIndex((a) => a.id === t);
99
114
  if (!d) return;
100
- const s = this.getNodeById(n, t);
101
- if (!s) return;
102
- const r = s.parameters?.nodes?.find((a) => a?.id === i);
103
- if (r) {
104
- if (this.removeParameterNode(d, r), e?.__typename === "NodeFunction") {
115
+ const r = this.getNodeById(t, i);
116
+ if (!r) return;
117
+ const s = r.parameters?.nodes?.find((a) => a?.id === n);
118
+ if (s) {
119
+ if (this.removeParameterNode(d, s), e?.__typename === "NodeFunction") {
105
120
  const a = Math.max(0, ...d.nodes?.nodes?.map((c) => Number(c?.id?.match(/NodeFunction\/(\d+)$/)?.[1] ?? 0)) ?? [0]), u = {
106
121
  ...e,
107
122
  id: `gid://sagittarius/NodeFunction/${a + 1}`
108
123
  };
109
- d.nodes?.nodes?.push(u), r.value = {
124
+ d.nodes?.nodes?.push(u), s.value = {
110
125
  id: `gid://sagittarius/NodeFunction/${a + 1}`,
111
126
  __typename: "NodeFunctionIdWrapper"
112
127
  };
113
128
  } else
114
- r.value = e;
129
+ s.value = e;
115
130
  this.set(o, d);
116
131
  }
117
132
  }
@@ -0,0 +1,4 @@
1
+ import { DataTypeIdentifier } from '@code0-tech/sagittarius-graphql-types';
2
+ export declare const hashToColor: (s: string) => string;
3
+ export declare const attachDataTypeIdentifiers: <T>(identifiers: DataTypeIdentifier[], input: T) => T;
4
+ export declare const resolveDataTypeIdentifiers: (list: DataTypeIdentifier[]) => DataTypeIdentifier[];
@@ -0,0 +1,63 @@
1
+ import { md5 as d } from "js-md5";
2
+ const f = 137.50776405003785, T = (t) => {
3
+ const a = t.match(/\/(\d+)\s*$/);
4
+ return a ? Number(a[1]) : null;
5
+ }, m = (t) => {
6
+ const a = T(t);
7
+ if (a != null)
8
+ return `hsl(${25 + a * f % 320}, 100%, 72%)`;
9
+ const n = d(d(t));
10
+ return `hsl(${25 + parseInt(n.slice(0, 8), 16) % 320}, 100%, 72%)`;
11
+ }, l = (t, a) => {
12
+ const n = new Map(t.filter((r) => r?.id).map((r) => [r.id, r])), i = (r) => Array.isArray(r) ? r.map(i) : r && typeof r == "object" ? {
13
+ ...Object.fromEntries(Object.entries(r).map(([s, e]) => [s, i(e)])),
14
+ ...r.dataTypeIdentifierId ? {
15
+ dataTypeIdentifier: n.get(r.dataTypeIdentifierId) ?? null
16
+ } : {},
17
+ ...Array.isArray(r.sourceDataTypeIdentifierIds) ? {
18
+ sourceDataTypeIdentifiers: r.sourceDataTypeIdentifierIds.map((s) => n.get(s)).filter(Boolean)
19
+ } : {}
20
+ } : r;
21
+ return i(a);
22
+ }, u = (t) => {
23
+ const a = new Map(t.filter((e) => e?.id).map((e) => [e.id, e])), n = /* @__PURE__ */ new Map(), i = (e) => {
24
+ if (!e?.id) return e;
25
+ if (n.has(e.id)) return n.get(e.id);
26
+ const o = {
27
+ ...e
28
+ };
29
+ if (n.set(e.id, o), e.genericType) {
30
+ o.genericType = {
31
+ ...e.genericType
32
+ };
33
+ const p = e.genericType.genericMappers;
34
+ Array.isArray(p) && (o.genericType.genericMappers = p.map((c) => ({
35
+ ...c,
36
+ ...Array.isArray(c.sourceDataTypeIdentifierIds) ? {
37
+ sourceDataTypeIdentifiers: c.sourceDataTypeIdentifierIds.map((y) => i(a.get(y) ?? null)).filter(Boolean)
38
+ } : {}
39
+ })));
40
+ }
41
+ return o;
42
+ }, r = t.map((e) => i(e)).filter(Boolean), s = (e) => {
43
+ if (!e) return e;
44
+ const o = e?.dataTypeIdentifiers?.nodes;
45
+ if (!Array.isArray(o)) return e;
46
+ const p = u(o), c = {
47
+ ...e,
48
+ dataTypeIdentifiers: {
49
+ ...e.dataTypeIdentifiers,
50
+ nodes: p
51
+ }
52
+ };
53
+ return l(p, c);
54
+ };
55
+ return r.forEach((e) => {
56
+ e?.dataType && (e.dataType = s(e.dataType)), e?.genericType?.dataType && (e.genericType.dataType = s(e.genericType.dataType));
57
+ }), r;
58
+ };
59
+ export {
60
+ l as attachDataTypeIdentifiers,
61
+ m as hashToColor,
62
+ u as resolveDataTypeIdentifiers
63
+ };
@@ -1,29 +1,29 @@
1
- import { jsx as a, jsxs as L, Fragment as U } from "react/jsx-runtime";
2
- import { c as z } from "../../_virtual/compiler-runtime.js";
3
- import { Position as P, getSmoothStepPath as D, BaseEdge as G, EdgeLabelRenderer as T } from "@xyflow/react";
4
- import { memo as W } from "react";
5
- import { Badge as q } from "../badge/Badge.js";
6
- const Q = W((E) => {
7
- const t = z.c(42);
8
- let n, s, i, d, e, o, r, l;
1
+ import { jsx as n, jsxs as O, Fragment as z } from "react/jsx-runtime";
2
+ import { c as D } from "../../_virtual/compiler-runtime.js";
3
+ import { Position as P, getSmoothStepPath as G, BaseEdge as T, EdgeLabelRenderer as W } from "@xyflow/react";
4
+ import { memo as q } from "react";
5
+ import { Badge as A } from "../badge/Badge.js";
6
+ const V = q((E) => {
7
+ const t = D.c(43);
8
+ let s, i, a, d, e, o, r, l;
9
9
  if (t[0] !== E) {
10
10
  const {
11
- sourceX: O,
12
- sourceY: S,
13
- targetX: j,
14
- targetY: v,
15
- id: w,
16
- data: C,
17
- label: F,
18
- style: A,
19
- ...I
11
+ sourceX: S,
12
+ sourceY: j,
13
+ targetX: v,
14
+ targetY: w,
15
+ id: C,
16
+ data: F,
17
+ label: I,
18
+ style: H,
19
+ ...U
20
20
  } = E;
21
- e = O, o = S, r = j, l = v, s = w, n = C, i = F, d = I, t[0] = E, t[1] = n, t[2] = s, t[3] = i, t[4] = d, t[5] = e, t[6] = o, t[7] = r, t[8] = l;
21
+ e = S, o = j, r = v, l = w, i = C, s = F, a = I, d = U, t[0] = E, t[1] = s, t[2] = i, t[3] = a, t[4] = d, t[5] = e, t[6] = o, t[7] = r, t[8] = l;
22
22
  } else
23
- n = t[1], s = t[2], i = t[3], d = t[4], e = t[5], o = t[6], r = t[7], l = t[8];
24
- const X = n?.type === "parameter" ? P.Left : P.Bottom, Y = n?.type === "parameter" ? P.Right : P.Top;
23
+ s = t[1], i = t[2], a = t[3], d = t[4], e = t[5], o = t[6], r = t[7], l = t[8];
24
+ const X = s?.type === "parameter" ? P.Left : P.Bottom, Y = s?.type === "parameter" ? P.Right : P.Top;
25
25
  let h;
26
- t[9] !== e || t[10] !== o || t[11] !== X || t[12] !== Y || t[13] !== r || t[14] !== l ? (h = D({
26
+ t[9] !== e || t[10] !== o || t[11] !== X || t[12] !== Y || t[13] !== r || t[14] !== l ? (h = G({
27
27
  sourceX: e,
28
28
  sourceY: o,
29
29
  sourcePosition: X,
@@ -33,37 +33,37 @@ const Q = W((E) => {
33
33
  borderRadius: 16,
34
34
  stepPosition: 0.5
35
35
  }), t[9] = e, t[10] = o, t[11] = X, t[12] = Y, t[13] = r, t[14] = l, t[15] = h) : h = t[15];
36
- const [$, R, k] = h, x = n?.color ?? "#ffffff", y = `dflow-edge-gradient-${s}`;
36
+ const [$, R, k] = h, x = s?.color ?? "#ffffff", y = `dflow-edge-gradient-${i}`;
37
37
  let c, p;
38
- t[16] !== x ? (c = /* @__PURE__ */ a("stop", { offset: "0", stopColor: x, stopOpacity: 0.75 }), p = /* @__PURE__ */ a("stop", { offset: "1", stopColor: x, stopOpacity: 0.25 }), t[16] = x, t[17] = c, t[18] = p) : (c = t[17], p = t[18]);
38
+ t[16] !== x ? (c = /* @__PURE__ */ n("stop", { offset: "0", stopColor: x, stopOpacity: 0.25 }), p = /* @__PURE__ */ n("stop", { offset: "1", stopColor: x, stopOpacity: 0.75 }), t[16] = x, t[17] = c, t[18] = p) : (c = t[17], p = t[18]);
39
39
  let f;
40
- t[19] !== y || t[20] !== e || t[21] !== o || t[22] !== c || t[23] !== p || t[24] !== r || t[25] !== l ? (f = /* @__PURE__ */ a("defs", { children: /* @__PURE__ */ L("linearGradient", { id: y, x1: e, y1: o, x2: r, y2: l, gradientUnits: "userSpaceOnUse", children: [
40
+ t[19] !== y || t[20] !== e || t[21] !== o || t[22] !== c || t[23] !== p || t[24] !== r || t[25] !== l ? (f = /* @__PURE__ */ n("defs", { children: /* @__PURE__ */ O("linearGradient", { id: y, x1: e, y1: o, x2: r, y2: l, gradientUnits: "userSpaceOnUse", children: [
41
41
  c,
42
42
  p
43
43
  ] }) }), t[19] = y, t[20] = e, t[21] = o, t[22] = c, t[23] = p, t[24] = r, t[25] = l, t[26] = f) : f = t[26];
44
- const B = `url(#${y})`;
44
+ const B = `url(#${y})`, L = s?.type === "default" ? "3px" : "2px";
45
45
  let m;
46
- t[27] !== B ? (m = {
46
+ t[27] !== B || t[28] !== L ? (m = {
47
47
  stroke: B,
48
- strokeWidth: "2px",
48
+ strokeWidth: L,
49
49
  strokeLinecap: "round"
50
- }, t[27] = B, t[28] = m) : m = t[28];
50
+ }, t[27] = B, t[28] = L, t[29] = m) : m = t[29];
51
51
  let g;
52
- t[29] !== $ || t[30] !== s || t[31] !== d || t[32] !== m ? (g = /* @__PURE__ */ a(G, { id: s, path: $, ...d, style: m }), t[29] = $, t[30] = s, t[31] = d, t[32] = m, t[33] = g) : g = t[33];
52
+ t[30] !== $ || t[31] !== i || t[32] !== d || t[33] !== m ? (g = /* @__PURE__ */ n(T, { id: i, path: $, ...d, style: m }), t[30] = $, t[31] = i, t[32] = d, t[33] = m, t[34] = g) : g = t[34];
53
53
  let u;
54
- t[34] !== i || t[35] !== R || t[36] !== k ? (u = i ? /* @__PURE__ */ a(T, { children: /* @__PURE__ */ a("div", { style: {
54
+ t[35] !== a || t[36] !== R || t[37] !== k ? (u = a ? /* @__PURE__ */ n(W, { children: /* @__PURE__ */ n("div", { style: {
55
55
  position: "absolute",
56
56
  transform: `translate(-50%, -50%) translate(${R}px, ${k}px)`,
57
57
  pointerEvents: "all",
58
58
  zIndex: 100
59
- }, children: /* @__PURE__ */ a(q, { color: "primary", border: !0, children: i }) }) }) : null, t[34] = i, t[35] = R, t[36] = k, t[37] = u) : u = t[37];
59
+ }, children: /* @__PURE__ */ n(A, { color: "primary", border: !0, children: a }) }) }) : null, t[35] = a, t[36] = R, t[37] = k, t[38] = u) : u = t[38];
60
60
  let b;
61
- return t[38] !== f || t[39] !== g || t[40] !== u ? (b = /* @__PURE__ */ L(U, { children: [
61
+ return t[39] !== u || t[40] !== f || t[41] !== g ? (b = /* @__PURE__ */ O(z, { children: [
62
62
  f,
63
63
  g,
64
64
  u
65
- ] }), t[38] = f, t[39] = g, t[40] = u, t[41] = b) : b = t[41], b;
65
+ ] }), t[39] = u, t[40] = f, t[41] = g, t[42] = b) : b = t[42], b;
66
66
  });
67
67
  export {
68
- Q as DFlowEdge
68
+ V as DFlowEdge
69
69
  };
@@ -1,10 +1,10 @@
1
1
  import "../../utils/contextStore.js";
2
2
  import "react";
3
- import { ReactiveArrayService as f } from "../../utils/reactiveArrayService.js";
3
+ import { ReactiveArrayService as y } from "../../utils/reactiveArrayService.js";
4
4
  import "merge-props";
5
5
  import { resolveType as s } from "../../utils/generics.js";
6
6
  import { useValueValidation as o } from "../d-flow-validation/DValueValidation.hook.js";
7
- class v extends f {
7
+ class v extends y {
8
8
  getDataType(e, r) {
9
9
  if (!e || e.genericKey) return;
10
10
  const i = e.dataType?.identifier ?? e.genericType?.dataType?.identifier, t = e.dataType?.id ?? e.genericType?.dataType?.id;
@@ -15,7 +15,7 @@ class v extends f {
15
15
  if (e.__typename == "LiteralValue") {
16
16
  if (Array.isArray(e.value) && Array.from(e.value).length > 0) return this.getDataType({
17
17
  dataType: {
18
- identifier: "ARRAY"
18
+ identifier: "LIST"
19
19
  }
20
20
  });
21
21
  if (typeof e.value == "string") return this.getDataType({
@@ -43,46 +43,49 @@ class v extends f {
43
43
  const t = this.getDataTypeFromValue(e, r, i);
44
44
  if ((t?.genericKeys?.length ?? 0) <= 0 || !t?.genericKeys) return {
45
45
  dataType: {
46
- id: t?.id
46
+ id: t?.id,
47
+ identifier: t?.identifier
47
48
  }
48
49
  };
49
50
  const a = t.genericKeys.map((n) => {
50
- const T = t.rules?.nodes?.find((p) => "dataTypeIdentifier" in (p?.config ?? {}) && p?.config?.dataTypeIdentifier?.genericKey == n || "inputTypes" in (p?.config ?? {}) && p.config.inputTypes?.some((y) => y.dataTypeIdentifier?.genericKey == n));
51
- return T && T.variant == "CONTAINS_TYPE" && "value" in e && e?.value && t.variant === "ARRAY" ? {
51
+ const d = t.rules?.nodes?.find((T) => "dataTypeIdentifier" in (T?.config ?? {}) && T?.config?.dataTypeIdentifier?.genericKey == n || "inputTypes" in (T?.config ?? {}) && T.config.inputTypes?.some((p) => p.dataTypeIdentifier?.genericKey == n));
52
+ return d && d.variant == "CONTAINS_TYPE" && "value" in e && e?.value && t.variant === "ARRAY" ? {
52
53
  sourceDataTypeIdentifiers: [this.getTypeFromValue({
53
54
  __typename: "LiteralValue",
54
55
  value: e.value[0]
55
56
  }, r, i)],
56
57
  target: n
57
- } : T && T.variant == "CONTAINS_KEY" && "value" in e && e?.value && t.variant === "OBJECT" ? {
58
+ } : d && d.variant == "CONTAINS_KEY" && "value" in e && e?.value && t.variant === "OBJECT" ? {
58
59
  sourceDataTypeIdentifiers: [this.getTypeFromValue({
59
60
  __typename: "LiteralValue",
60
61
  /* @ts-ignore */
61
- value: e.value[T.config?.key ?? ""]
62
+ value: e.value[d.config?.key ?? ""]
62
63
  }, r, i)],
63
64
  target: n
64
- } : T && T.variant == "RETURN_TYPE" && t.variant === "NODE" ? {
65
+ } : d && d.variant == "RETURN_TYPE" && t.variant === "NODE" ? {
65
66
  sourceDataTypeIdentifiers: [this.getTypeFromValue(e, r, i)],
66
67
  target: n
67
- } : T && T.variant == "INPUT_TYPES" && t.variant === "NODE" ? {
68
+ } : d && d.variant == "INPUT_TYPES" && t.variant === "NODE" ? {
68
69
  sourceDataTypeIdentifiers: [{
69
70
  genericKey: n
70
71
  }],
71
72
  target: n
72
73
  } : null;
73
- }).filter((n) => !!n), d = a.length > 0 ? {
74
+ }).filter((n) => !!n), f = a.length > 0 ? {
74
75
  genericType: {
75
76
  dataType: {
76
- id: t.id
77
+ id: t.id,
78
+ identifier: t.identifier
77
79
  },
78
80
  genericMappers: a
79
81
  }
80
82
  } : {
81
83
  dataType: {
82
- id: t.id
84
+ id: t.id,
85
+ identifier: t.identifier
83
86
  }
84
87
  };
85
- return s(d, this);
88
+ return s(f, this);
86
89
  }
87
90
  hasDataTypes(e, r) {
88
91
  return e.every((i) => this.values(r).find((t) => t.id === (i.genericType?.dataType?.id ?? i.dataType?.id)));