@code0-tech/pictor 0.0.0-mvp.40 → 0.0.0-mvp.42

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 (56) hide show
  1. package/dist/assets/components/data-table/DataTable.style.css +1 -0
  2. package/dist/assets/components/menu/Menu.style.css +1 -1
  3. package/dist/components/d-flow/DFlow.service.js +80 -100
  4. package/dist/components/d-flow-data-type/DFlowDataType.service.js +6 -7
  5. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.d.ts +1 -1
  6. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js +15 -15
  7. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.d.ts +1 -1
  8. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js +17 -17
  9. package/dist/components/d-flow-data-type/rules/DFlowDataTypeParentRule.d.ts +1 -1
  10. package/dist/components/d-flow-data-type/rules/DFlowDataTypeParentRule.js +1 -1
  11. package/dist/components/d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.d.ts +2 -1
  12. package/dist/components/d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js +87 -85
  13. package/dist/components/d-flow-data-type/rules/DFlowDataTypeRule.d.ts +2 -1
  14. package/dist/components/d-flow-function/DFlowFunction.input.hook.d.ts +2 -1
  15. package/dist/components/d-flow-function/DFlowFunction.input.hook.js +5 -5
  16. package/dist/components/d-flow-function/DFlowFunction.return.hook.d.ts +2 -1
  17. package/dist/components/d-flow-function/DFlowFunction.return.hook.js +5 -5
  18. package/dist/components/d-flow-input/DFlowInputDataTypeEditDialog.js +1 -1
  19. package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +17 -17
  20. package/dist/components/d-flow-node/DFlowNode.return.hook.d.ts +5 -0
  21. package/dist/components/d-flow-node/DFlowNode.return.hook.js +27 -0
  22. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +90 -91
  23. package/dist/components/d-flow-validation/DDataTypeValidation.hook.js +1 -1
  24. package/dist/components/d-flow-validation/DNodeValidation.hook.js +33 -33
  25. package/dist/components/d-flow-validation/DValueValidation.hook.d.ts +2 -1
  26. package/dist/components/d-flow-validation/DValueValidation.hook.js +5 -5
  27. package/dist/components/d-project/DNamespaceProject.service.d.ts +2 -1
  28. package/dist/components/data-table/DataTable.d.ts +23 -0
  29. package/dist/components/data-table/DataTable.js +41 -0
  30. package/dist/components/data-table/DataTableColumn.d.ts +6 -0
  31. package/dist/components/data-table/DataTableColumn.js +22 -0
  32. package/dist/components/data-table/DataTableFilterInput.d.ts +18 -0
  33. package/dist/components/data-table/DataTableFilterInput.js +210 -0
  34. package/dist/components/data-table/DataTableFilterSuggestionMenu.d.ts +7 -0
  35. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +53 -0
  36. package/dist/components/data-table/index.d.ts +4 -0
  37. package/dist/components/data-table/index.js +11 -0
  38. package/dist/components/editor/Editor.d.ts +9 -3
  39. package/dist/components/editor/Editor.js +249 -174
  40. package/dist/components/menu/Menu.d.ts +5 -1
  41. package/dist/components/menu/Menu.js +73 -57
  42. package/dist/index.d.ts +1 -0
  43. package/dist/index.js +182 -171
  44. package/dist/node_modules/@lezer/highlight/dist/index.js +132 -169
  45. package/dist/utils/generics.d.ts +2 -1
  46. package/dist/utils/generics.js +84 -80
  47. package/package.json +32 -21
  48. package/dist/node_modules/@codemirror/language/dist/index.js +0 -429
  49. package/dist/node_modules/@codemirror/lint/dist/index.js +0 -515
  50. package/dist/node_modules/@codemirror/state/dist/index.js +0 -2614
  51. package/dist/node_modules/@codemirror/view/dist/index.js +0 -6227
  52. package/dist/node_modules/@lezer/common/dist/index.js +0 -1357
  53. package/dist/node_modules/@marijn/find-cluster-break/src/index.js +0 -69
  54. package/dist/node_modules/crelt/index.js +0 -27
  55. package/dist/node_modules/style-mod/src/style-mod.js +0 -109
  56. package/dist/node_modules/w3c-keyname/index.js +0 -88
@@ -1,49 +1,49 @@
1
- import l from "react";
2
- import { useService as F, useStore as N } from "../../utils/contextStore.js";
1
+ import g from "react";
2
+ import { useService as I, useStore as N } from "../../utils/contextStore.js";
3
3
  import "merge-props";
4
- import { DFlowDataTypeReactiveService as h } from "../d-flow-data-type/DFlowDataType.service.js";
4
+ import { DFlowDataTypeReactiveService as x } from "../d-flow-data-type/DFlowDataType.service.js";
5
5
  import "js-md5";
6
- import { DFlowSuggestionType as $ } from "./DFlowSuggestion.view.js";
7
- import { replaceGenericsAndSortType as W, resolveType as C, isMatchingType as K, resolveGenericKeys as V, targetForGenericKey as A, replaceGenericKeysInType as Y } from "../../utils/generics.js";
8
- import { DFlowFunctionReactiveService as E } from "../d-flow-function/DFlowFunction.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";
9
9
  import "../d-flow/DFlow.js";
10
- import { DFlowReactiveService as x } from "../d-flow/DFlow.service.js";
11
- import { useReturnType as k } from "../d-flow-function/DFlowFunction.return.hook.js";
12
- const oe = (n, t, o, m = []) => {
13
- const y = F(h), r = N(h), v = F(x), g = N(x), M = P(n), D = l.useMemo(() => t ? M?.find((i) => i.nodeFunctionId === t) : void 0, [M, t]), a = l.useMemo(() => t ? v.getNodeById(n, t)?.parameters?.nodes?.map((s) => s?.value).filter((s) => s?.__typename === "NodeFunctionIdWrapper") ?? [] : [], [n, t, v, g]), u = l.useMemo(() => o ? W(C(o, y), m) : void 0, [o, y, r, m]), T = J(n);
14
- return l.useMemo(() => {
15
- if (!u || !D) return [];
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 f = 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, f), u) : void 0, [o, f, r, u]), p = U(n), m = j(n);
14
+ return g.useMemo(() => {
15
+ if (!c || !S) return [];
16
16
  const {
17
17
  depth: i,
18
- scope: s,
19
- node: d
20
- } = D;
21
- return T.flatMap((e) => {
18
+ scope: a,
19
+ node: l
20
+ } = S;
21
+ return p.flatMap((e) => {
22
22
  if (e.node === null || e.node === void 0) return [];
23
23
  if (e.depth === null || e.depth === void 0) return [];
24
24
  if (e.scope === null || e.scope === void 0) return [];
25
- const c = e.parameterIndex !== void 0 && e.inputTypeIndex !== void 0, I = c ? e.scope?.every((f, B) => s?.[B] === f) : !0;
26
- if (c && !I) return [];
27
- if (a.some((f) => f.id === e.nodeFunctionId)) return [];
28
- if (!c && e.node >= d) 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 [];
29
29
  if (e.depth > i) return [];
30
- if (e.scope.some((f) => !s.includes(f))) return [];
31
- const R = W(C(e.dataTypeIdentifier, y), []);
32
- return K(u, R) ? [{
30
+ if (e.scope.some((s) => !a.includes(s))) return [];
31
+ const h = m.get(e.nodeFunctionId), E = C(P(h, f), []);
32
+ return V(c, E) ? [{
33
33
  path: [],
34
- type: $.REF_OBJECT,
35
- displayText: [`${e.depth}-${e.scope}-${e.node || ""}-${e.referencePath?.map((f) => f.path).join(".") ?? ""}`],
34
+ type: A.REF_OBJECT,
35
+ displayText: [`${e.depth}-${e.scope}-${e.node || ""}-${e.referencePath?.map((s) => s.path).join(".") ?? ""}`],
36
36
  value: e
37
37
  }] : [];
38
38
  });
39
- }, [y, D, a, T, u]);
40
- }, J = (n) => {
41
- const t = F(h);
42
- N(h);
43
- const o = F(E), m = F(x), y = N(x), r = l.useMemo(() => m.getById(n), [n, y]), v = P(n), g = l.useMemo(() => r?.nodes?.nodes?.map((a) => {
44
- const u = a?.parameters?.nodes?.map((d) => d?.value) ?? [], T = o.getById(a?.functionDefinition?.id), i = k(T, u, t), s = v?.find((d) => d.nodeFunctionId === a?.id);
45
- return i && s ? w(s, i, t) : {};
46
- }) ?? [], [r]), M = l.useMemo(() => w({
39
+ }, [f, S, B, p, c]);
40
+ }, U = (n) => {
41
+ const t = I(x);
42
+ N(x);
43
+ const o = I(O), u = I(R), f = N(R), r = g.useMemo(() => u.getById(n), [n, f]), v = $(n), T = j(n), M = g.useMemo(() => r?.nodes?.nodes?.map((c) => {
44
+ const p = T.get(c?.id), m = v?.find((i) => i.nodeFunctionId === c?.id);
45
+ return p && m ? G(m, p, t) : {};
46
+ }) ?? [], [r]), S = g.useMemo(() => G({
47
47
  node: 0,
48
48
  depth: 0,
49
49
  nodeFunctionId: "gid://sagittarius/NodeFunction/-1",
@@ -51,37 +51,37 @@ const oe = (n, t, o, m = []) => {
51
51
  }, {
52
52
  dataType: r?.inputType
53
53
  }), [r]);
54
- return [...l.useMemo(() => r?.nodes?.nodes?.length ? r.nodes.nodes.flatMap((a) => {
55
- const u = o.getById(a?.functionDefinition?.id);
56
- if (!u) return [];
57
- const T = a?.parameters?.nodes?.map((i) => i?.value).filter(Boolean) ?? [];
58
- return (u.parameterDefinitions ?? []).flatMap((i, s) => {
59
- const d = i?.dataTypeIdentifier;
60
- if (!d) return [];
61
- const e = t.getDataType(d);
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 m = 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
62
  if (!e || e.variant !== "NODE") return [];
63
- const c = a?.parameters?.nodes?.find((p) => p?.parameterDefinition?.id === i?.id);
64
- if (!c?.value || c.value.__typename !== "NodeFunctionIdWrapper") return [];
65
- const I = v?.find((p) => c?.value?.__typename === "NodeFunctionIdWrapper" && p.nodeFunctionId === c.value?.id);
66
- if (!I) return [];
67
- const R = e.rules?.nodes?.filter((p) => p?.variant === "INPUT_TYPES") ?? [], f = V(u, T, t), B = A(u, d), S = new Map([...f].map(([p, G]) => [B.get(p) ?? p, G]));
68
- return R.flatMap((p) => (p?.config?.inputTypes ?? []).flatMap((O, j) => {
69
- const b = Y(O.dataTypeIdentifier, S);
70
- return b ? w({
71
- ...I,
72
- nodeFunctionId: a?.id,
73
- parameterIndex: s,
74
- inputTypeIndex: j,
75
- inputTypeIdentifier: O.inputIdentifier
76
- }, b, t) : [];
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, m, 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) : [];
77
77
  }));
78
78
  });
79
- }) : [], [r, v, o, t]), ...M, ...g].flat();
80
- }, w = (n, t, o) => {
81
- const m = o ? o.getDataType(t) : t.dataType ?? t.genericType?.dataType;
82
- return m ? [...m.rules?.nodes?.map((r) => {
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
83
  if (r?.variant === "CONTAINS_KEY")
84
- return t ? w({
84
+ return t ? G({
85
85
  ...n,
86
86
  referencePath: [...n.referencePath ?? [], {
87
87
  path: r.config.key
@@ -89,45 +89,44 @@ const oe = (n, t, o, m = []) => {
89
89
  }, r.config.dataTypeIdentifier) : void 0;
90
90
  }).flat().filter((r) => !!r) ?? [], {
91
91
  __typename: "ReferenceValue",
92
- dataTypeIdentifier: t,
93
92
  nodeFunctionId: n.nodeFunctionId,
94
93
  ...n
95
94
  }] : [];
96
- }, P = (n) => {
97
- const t = F(h), o = F(x), m = F(E), y = N(x), r = N(E), v = N(h), g = l.useMemo(() => o.getById(n), [n, y]);
98
- return l.useMemo(() => {
99
- if (!t || !o || !m || !g?.startingNodeId) return;
95
+ }, $ = (n) => {
96
+ const t = I(x), o = I(R), u = I(O), f = N(R), r = N(O), v = N(x), T = g.useMemo(() => o.getById(n), [n, f]);
97
+ return g.useMemo(() => {
98
+ if (!t || !o || !u || !T?.startingNodeId) return;
100
99
  let M = 0;
101
- const D = () => ++M;
102
- let a = 0;
103
- const u = () => ++a, T = [], i = (s, d, e) => {
104
- if (!s) return;
105
- let c = s.__typename === "NodeFunctionIdWrapper" ? o.getNodeById(n, s.id) : s;
106
- for (; c; ) {
107
- const I = m.getById(c.functionDefinition?.id);
108
- if (!I) break;
109
- if (c.parameters && I.parameterDefinitions)
110
- for (const f of I.parameterDefinitions) {
111
- const B = t.getDataType(f.dataTypeIdentifier), S = c.parameters?.nodes?.find((p) => p?.parameterDefinition?.id === f.id);
112
- if (B?.variant === "NODE") {
113
- if (S?.value && S.value.__typename === "NodeFunctionIdWrapper") {
114
- const p = [...e, D()];
115
- i(S.value, d + 1, p);
100
+ const S = () => ++M;
101
+ let B = 0;
102
+ const c = () => ++B, p = [], m = (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
+ m(s.value, a + 1, F);
116
115
  }
117
- } else S?.value && S.value.__typename === "NodeFunctionIdWrapper" && i(S.value, d, e);
116
+ } else s?.value && s.value.__typename === "NodeFunctionIdWrapper" && m(s.value, a, l);
118
117
  }
119
- const R = u();
120
- T.push({
121
- node: R,
122
- depth: d,
123
- scope: e,
124
- nodeFunctionId: c.id
125
- }), c = o.getNodeById(g.id, c.nextNodeId);
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);
126
125
  }
127
126
  };
128
- return i(o.getNodeById(g.id, g.startingNodeId), 0, [0]), T;
129
- }, [t, g, n, o, m, v, y, r]) ?? [];
127
+ return m(o.getNodeById(T.id, T.startingNodeId), 0, [0]), p;
128
+ }, [t, T, n, o, u, v, f, r]) ?? [];
130
129
  };
131
130
  export {
132
- oe as useReferenceSuggestions
131
+ re as useReferenceSuggestions
133
132
  };
@@ -1,5 +1,5 @@
1
1
  const g = ["id", "__typename", "createdAt", "updatedAt", "aliases", "displayMessages", "name", "runtime"], h = (l, u) => {
2
- if (l.variant !== u.variant) return !1;
2
+ if (l?.variant !== u?.variant) return !1;
3
3
  const c = (e) => e !== null && typeof e == "object", i = (e, r) => {
4
4
  if (e === r) return !0;
5
5
  const a = Array.isArray(e), y = Array.isArray(r);
@@ -1,57 +1,57 @@
1
- import R from "react";
1
+ import S from "react";
2
2
  import { DFlowDataTypeReactiveService as E } from "../d-flow-data-type/DFlowDataType.service.js";
3
3
  import { DataTypeView as C } from "../d-flow-data-type/DFlowDataType.view.js";
4
- import { useService as V, useStore as N } from "../../utils/contextStore.js";
4
+ import { useService as V, useStore as _ } from "../../utils/contextStore.js";
5
5
  import { InspectionSeverity as P } from "../../utils/inspection.js";
6
6
  import "merge-props";
7
7
  import { resolveGenericKeys as U, replaceGenericKeysInType as q, replaceGenericKeysInDataTypeObject as z } from "../../utils/generics.js";
8
8
  import { useReturnType as H } from "../d-flow-function/DFlowFunction.return.hook.js";
9
9
  import { DFlowFunctionReactiveService as G } from "../d-flow-function/DFlowFunction.service.js";
10
10
  import "js-md5";
11
- import { useDataTypeValidation as I } from "./DDataTypeValidation.hook.js";
12
- import { useValueValidation as O } from "./DValueValidation.hook.js";
11
+ import { useDataTypeValidation as O } from "./DDataTypeValidation.hook.js";
12
+ import { useValueValidation as w } from "./DValueValidation.hook.js";
13
13
  import "../d-flow/DFlow.js";
14
- import { DFlowReactiveService as w } from "../d-flow/DFlow.service.js";
15
- const M = (e) => e.__typename === "ReferenceValue", K = (e) => e.__typename === "NodeFunctionIdWrapper", b = (e, r) => new C(z(e.json, r)), j = (e, r, p) => ({
16
- parameterId: e,
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
17
  type: P.ERROR,
18
18
  message: [{
19
19
  code: "en-US",
20
- content: `Argument of type ${p?.name[0]?.content} is not assignable to parameter of type ${r?.name[0]?.content}`
20
+ content: `Argument of type ${i?.name[0]?.content} is not assignable to parameter of type ${r?.name[0]?.content}`
21
21
  }]
22
- }), ae = (e, r) => {
23
- const p = V(G), W = N(G), d = V(w), _ = N(w), t = V(E), F = N(E), s = d.getById(r), f = d.getNodeById(r, e), v = f?.parameters?.nodes?.map((n) => n?.value) ?? [], m = p.getById(f?.functionDefinition?.id), S = m?.parameterDefinitions ?? [], h = m?.genericKeys ?? [], T = R.useMemo(() => U(m, v, t, s), [m, v, t, F, s, _]), x = R.useCallback((n, c) => {
24
- if (K(n) && c?.variant !== "NODE") {
25
- const u = d.getNodeById(r, n.id), o = p.getById(u?.functionDefinition?.id), D = u?.parameters?.nodes?.map((a) => a?.value) ?? [];
26
- return H(o, D, t);
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);
27
27
  }
28
- return t.getTypeFromValue(n, s);
29
- }, [t, s, r, d, p]);
30
- return R.useMemo(() => {
31
- const n = [];
32
- for (let c = 0; c < S.length; c++) {
33
- const u = S[c], o = v[c], D = f?.parameters?.nodes?.find((g) => g?.parameterDefinition?.id === u.id);
28
+ return n.getTypeFromValue(e, s);
29
+ }, [n, s, r, f, i]);
30
+ return S.useMemo(() => {
31
+ 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
34
  if (!o) continue;
35
- const a = u.dataTypeIdentifier, B = q(a, T), i = t.getDataType(B), $ = x(o, i), l = t.getDataType($);
36
- if (!i || !l) {
37
- n.push(j(D?.id, i, l));
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));
38
38
  continue;
39
39
  }
40
- const k = !!a?.genericType || !!a?.genericKey && h.includes(a.genericKey);
41
- let y = !0;
40
+ const k = !!p?.genericType || !!p?.genericKey && h.includes(p.genericKey);
41
+ let u = !0;
42
42
  if (k) {
43
- const g = b(i, T);
44
- if (M(o) || K(o) && i.variant !== "NODE") {
45
- const A = b(l, T);
46
- y = I(g, A);
43
+ 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);
47
47
  } else
48
- y = O(o, g, t, s, B?.genericType?.genericMappers);
48
+ u = w(o, v, n, s, B?.genericType?.genericMappers, i);
49
49
  } else
50
- M(o) || K(o) && i.variant !== "NODE" ? y = I(i, l) : y = O(o, i, t, s);
51
- y || n.push(j(D?.id, i, l));
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));
52
52
  }
53
- return n.length > 0 ? n : null;
54
- }, [s, f, v, m, S, h, T, x, e, r, W, _, F, t]);
53
+ return e.length > 0 ? e : null;
54
+ }, [s, l, T, m, R, h, D, x, t, r, j, I, K, n]);
55
55
  };
56
56
  export {
57
57
  ae as useNodeValidation
@@ -1,3 +1,4 @@
1
1
  import { Flow, GenericMapper, NodeParameterValue } from '@code0-tech/sagittarius-graphql-types';
2
2
  import { DataTypeView, DFlowDataTypeReactiveService } from '../d-flow-data-type';
3
- export declare const useValueValidation: (value: NodeParameterValue, dataType: DataTypeView, dataTypeService: DFlowDataTypeReactiveService, flow?: Flow, generics?: GenericMapper[]) => boolean;
3
+ import { DFlowFunctionReactiveService } from '../d-flow-function';
4
+ export declare const useValueValidation: (value: NodeParameterValue, dataType: DataTypeView, dataTypeService: DFlowDataTypeReactiveService, flow?: Flow, generics?: GenericMapper[], functionService?: DFlowFunctionReactiveService) => boolean;
@@ -1,9 +1,9 @@
1
1
  import { RuleMap as r } from "../d-flow-data-type/rules/DFlowDataTypeRules.js";
2
- import { VariantsMap as m } from "../d-flow-data-type/variants/DFlowDataTypeVariants.js";
3
- const V = (a, i, n, e, o) => {
4
- const s = new Map(o?.map((t) => [t.target, t])), f = i.rules?.nodes?.every((t) => !t || !t.variant || !t.config ? !1 : r.get(t.variant) ? r.get(t.variant)?.validate(a, t.config, s, n, e) : !0) ?? !0, p = m.get(i.variant)?.validate(a) ?? !0;
5
- return f && p;
2
+ import { VariantsMap as u } from "../d-flow-data-type/variants/DFlowDataTypeVariants.js";
3
+ const c = (a, i, n, e, o, s) => {
4
+ const f = new Map(o?.map((t) => [t.target, t])), p = i?.rules?.nodes?.every((t) => !t || !t.variant || !t.config ? !1 : r.get(t.variant) ? r.get(t.variant)?.validate(a, t.config, f, e, n, s) : !0) ?? !0, m = u.get(i.variant)?.validate(a) ?? !0;
5
+ return p && m;
6
6
  };
7
7
  export {
8
- V as useValueValidation
8
+ c as useValueValidation
9
9
  };
@@ -1,4 +1,4 @@
1
- import { Namespace, NamespaceProject, NamespacesProjectsAssignRuntimesInput, NamespacesProjectsAssignRuntimesPayload, NamespacesProjectsCreateInput, NamespacesProjectsCreatePayload, NamespacesProjectsDeleteInput, NamespacesProjectsDeletePayload } from '@code0-tech/sagittarius-graphql-types';
1
+ import { Namespace, NamespaceProject, NamespacesProjectsAssignRuntimesInput, NamespacesProjectsAssignRuntimesPayload, NamespacesProjectsCreateInput, NamespacesProjectsCreatePayload, NamespacesProjectsDeleteInput, NamespacesProjectsDeletePayload, NamespacesProjectsUpdateInput, NamespacesProjectsUpdatePayload } from '@code0-tech/sagittarius-graphql-types';
2
2
  import { DNamespaceProjectView } from './DNamespaceProject.view';
3
3
  import { ReactiveArrayService } from '../../utils';
4
4
  export type DProjectDependencies = {
@@ -7,6 +7,7 @@ export type DProjectDependencies = {
7
7
  export declare abstract class DNamespaceProjectReactiveService extends ReactiveArrayService<DNamespaceProjectView, DProjectDependencies> {
8
8
  getById(id: NamespaceProject['id'], dependencies?: DProjectDependencies): DNamespaceProjectView | undefined;
9
9
  abstract projectAssignRuntimes(payload: NamespacesProjectsAssignRuntimesInput): Promise<NamespacesProjectsAssignRuntimesPayload | undefined>;
10
+ abstract projectUpdate(payload: NamespacesProjectsUpdateInput): Promise<NamespacesProjectsUpdatePayload | undefined>;
10
11
  abstract projectCreate(payload: NamespacesProjectsCreateInput): Promise<NamespacesProjectsCreatePayload | undefined>;
11
12
  abstract projectDelete(payload: NamespacesProjectsDeleteInput): Promise<NamespacesProjectsDeletePayload | undefined>;
12
13
  }
@@ -0,0 +1,23 @@
1
+ import { default as React } from 'react';
2
+ import { Code0Component } from '../../utils';
3
+ export type DataTableFilterOperator = "isOneOf" | "isNotOneOf";
4
+ export interface DataTableFilterProps {
5
+ [key: string]: {
6
+ operator: DataTableFilterOperator;
7
+ value: string | string[];
8
+ };
9
+ }
10
+ export interface DataTableSortProps {
11
+ [key: string]: 'asc' | 'desc' | undefined;
12
+ }
13
+ export interface DataTableProps<T> extends Omit<Code0Component<HTMLTableElement>, 'data' | 'children' | 'onSelect'> {
14
+ data: Array<T>;
15
+ sort?: DataTableSortProps;
16
+ filter?: DataTableFilterProps;
17
+ loading?: boolean;
18
+ loadingComponent?: React.ReactNode;
19
+ emptyComponent?: React.ReactNode;
20
+ onSelect?: (item: T | undefined) => void;
21
+ children?: (item: T, index: number) => React.ReactNode;
22
+ }
23
+ export declare const DataTable: <T>(props: DataTableProps<T>) => React.JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { jsxs as g, jsx as O } from "react/jsx-runtime";
2
+ import h from "react";
3
+ import '../../assets/components/data-table/DataTable.style.css';/* empty css */
4
+ import "../../utils/contextStore.js";
5
+ import { mergeCode0Props as C } from "../../utils/utils.js";
6
+ const d = (l, y) => y.split(".").reduce((t, f) => {
7
+ if (t != null)
8
+ return Array.isArray(t) ? t.map((a) => a?.[f]).filter((a) => a !== void 0) : t[f];
9
+ }, l), N = (l) => {
10
+ const {
11
+ data: y,
12
+ sort: t,
13
+ filter: f,
14
+ loading: a,
15
+ loadingComponent: j,
16
+ emptyComponent: A,
17
+ onSelect: u,
18
+ children: p,
19
+ ...b
20
+ } = l, m = y.filter((i) => Object.entries(f || {}).every(([o, {
21
+ operator: n,
22
+ value: r
23
+ }]) => {
24
+ const e = d(i, o);
25
+ return n === "isOneOf" && !Array.isArray(r) && !Array.isArray(e) ? e === r : n === "isOneOf" && !Array.isArray(r) && Array.isArray(e) ? Array.from(e).includes(r) : n === "isOneOf" && Array.isArray(r) && !Array.isArray(e) ? Array.from(r).some((s) => s === e) : n === "isOneOf" && Array.isArray(r) && Array.isArray(e) ? Array.from(r).some((s) => Array.from(e).includes(s)) : !1;
26
+ })), c = h.useMemo(() => t ? [...m].sort((i, o) => {
27
+ for (const [n, r] of Object.entries(t)) {
28
+ const e = d(i, n), s = d(o, n);
29
+ if (e < s) return r === "asc" ? -1 : 1;
30
+ if (e > s) return r === "asc" ? 1 : -1;
31
+ }
32
+ return 0;
33
+ }) : m, [m, t]);
34
+ return /* @__PURE__ */ g("table", { ...C("data-table", b), children: [
35
+ c.map((i, o) => /* @__PURE__ */ O("tr", { className: "data-table__row", onClick: () => u?.(i), children: p?.(i, o) })),
36
+ c.length === 0 && !a && A ? /* @__PURE__ */ O("tr", { className: "data-table__row", onClick: () => u?.(void 0), children: A }) : null
37
+ ] });
38
+ };
39
+ export {
40
+ N as DataTable
41
+ };
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ import { Code0Component } from '../../utils';
3
+ export interface DataTableColumnProps extends Code0Component<HTMLTableCellElement> {
4
+ children?: React.ReactNode | React.ReactNode[];
5
+ }
6
+ export declare const DataTableColumn: React.FC<DataTableColumnProps>;
@@ -0,0 +1,22 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { c as n } from "../../_virtual/compiler-runtime.js";
3
+ import "../../utils/contextStore.js";
4
+ import "react";
5
+ import { mergeCode0Props as s } from "../../utils/utils.js";
6
+ const x = (m) => {
7
+ const t = n.c(6);
8
+ let e, r;
9
+ if (t[0] !== m) {
10
+ const {
11
+ children: i,
12
+ ...l
13
+ } = m;
14
+ e = i, r = s("", l), t[0] = m, t[1] = e, t[2] = r;
15
+ } else
16
+ e = t[1], r = t[2];
17
+ let o;
18
+ return t[3] !== e || t[4] !== r ? (o = /* @__PURE__ */ c("td", { ...r, children: e }), t[3] = e, t[4] = r, t[5] = o) : o = t[5], o;
19
+ };
20
+ export {
21
+ x as DataTableColumn
22
+ };
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ import { StreamLanguage } from '@codemirror/language';
3
+ import { CompletionContext } from '@codemirror/autocomplete';
4
+ import { DataTableFilterOperator, DataTableFilterProps } from './DataTable';
5
+ export interface DataTableFilterTokens {
6
+ token: string;
7
+ key: string;
8
+ operators: DataTableFilterOperator[];
9
+ suggestion?: (context: CompletionContext, operator: DataTableFilterOperator, currentValue: string, applySuggestion: (value: string, silently?: boolean) => void) => React.ReactNode;
10
+ }
11
+ export interface DataTableFilterInputProps {
12
+ filterTokens?: DataTableFilterTokens[];
13
+ onChange?: (filter: DataTableFilterProps) => void;
14
+ }
15
+ export declare const createFilterQueryLanguage: (validTokens: string[]) => StreamLanguage<{
16
+ tokens: string[];
17
+ }>;
18
+ export declare const DataTableFilterInput: React.FC<DataTableFilterInputProps>;