@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.
- package/dist/assets/components/data-table/DataTable.style.css +1 -0
- package/dist/assets/components/menu/Menu.style.css +1 -1
- package/dist/components/d-flow/DFlow.service.js +80 -100
- package/dist/components/d-flow-data-type/DFlowDataType.service.js +6 -7
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.d.ts +1 -1
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js +15 -15
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.d.ts +1 -1
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js +17 -17
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeParentRule.d.ts +1 -1
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeParentRule.js +1 -1
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.d.ts +2 -1
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js +87 -85
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeRule.d.ts +2 -1
- package/dist/components/d-flow-function/DFlowFunction.input.hook.d.ts +2 -1
- package/dist/components/d-flow-function/DFlowFunction.input.hook.js +5 -5
- package/dist/components/d-flow-function/DFlowFunction.return.hook.d.ts +2 -1
- package/dist/components/d-flow-function/DFlowFunction.return.hook.js +5 -5
- package/dist/components/d-flow-input/DFlowInputDataTypeEditDialog.js +1 -1
- package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +17 -17
- package/dist/components/d-flow-node/DFlowNode.return.hook.d.ts +5 -0
- package/dist/components/d-flow-node/DFlowNode.return.hook.js +27 -0
- package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +90 -91
- package/dist/components/d-flow-validation/DDataTypeValidation.hook.js +1 -1
- package/dist/components/d-flow-validation/DNodeValidation.hook.js +33 -33
- package/dist/components/d-flow-validation/DValueValidation.hook.d.ts +2 -1
- package/dist/components/d-flow-validation/DValueValidation.hook.js +5 -5
- package/dist/components/d-project/DNamespaceProject.service.d.ts +2 -1
- package/dist/components/data-table/DataTable.d.ts +23 -0
- package/dist/components/data-table/DataTable.js +41 -0
- package/dist/components/data-table/DataTableColumn.d.ts +6 -0
- package/dist/components/data-table/DataTableColumn.js +22 -0
- package/dist/components/data-table/DataTableFilterInput.d.ts +18 -0
- package/dist/components/data-table/DataTableFilterInput.js +210 -0
- package/dist/components/data-table/DataTableFilterSuggestionMenu.d.ts +7 -0
- package/dist/components/data-table/DataTableFilterSuggestionMenu.js +53 -0
- package/dist/components/data-table/index.d.ts +4 -0
- package/dist/components/data-table/index.js +11 -0
- package/dist/components/editor/Editor.d.ts +9 -3
- package/dist/components/editor/Editor.js +249 -174
- package/dist/components/menu/Menu.d.ts +5 -1
- package/dist/components/menu/Menu.js +73 -57
- package/dist/index.d.ts +1 -0
- package/dist/index.js +182 -171
- package/dist/node_modules/@lezer/highlight/dist/index.js +132 -169
- package/dist/utils/generics.d.ts +2 -1
- package/dist/utils/generics.js +84 -80
- package/package.json +32 -21
- package/dist/node_modules/@codemirror/language/dist/index.js +0 -429
- package/dist/node_modules/@codemirror/lint/dist/index.js +0 -515
- package/dist/node_modules/@codemirror/state/dist/index.js +0 -2614
- package/dist/node_modules/@codemirror/view/dist/index.js +0 -6227
- package/dist/node_modules/@lezer/common/dist/index.js +0 -1357
- package/dist/node_modules/@marijn/find-cluster-break/src/index.js +0 -69
- package/dist/node_modules/crelt/index.js +0 -27
- package/dist/node_modules/style-mod/src/style-mod.js +0 -109
- package/dist/node_modules/w3c-keyname/index.js +0 -88
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.data-table{width:100%;-webkit-border-horizontal-spacing:0;-webkit-border-vertical-spacing:0;border-spacing:0}.data-table__row td{border-bottom:.5px solid rgba(191,191,191,.1);border-top:.5px solid rgba(191,191,191,.1);padding:.7rem .35rem}.data-table__row:hover{background:#191825;cursor:pointer}.data-table__row td:last-child{width:1px;white-space:nowrap}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.menu__content,.menu__sub-content{padding:.35rem;position:relative;box-sizing:border-box;z-index:999}.menu__content,.menu__sub-content{border-radius:1rem}.menu__label{text-transform:uppercase;font-size:.7rem;display:flex;gap:.35rem;align-items:center;padding:.35rem .7rem;color:#ffffff80}.menu__label{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.menu__item,.menu__sub-trigger{border-radius:.65rem;padding:.35rem .7rem;gap:.7rem;cursor:pointer;width:100%;display:flex;align-items:center;font-size:.8rem}.menu__item,.menu__sub-trigger{background:#070514;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__item:focus,.menu__sub-trigger:focus{outline:none}.menu__item,.menu__sub-trigger{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.menu__item:disabled,.menu__item[data-disabled],.menu__item[aria-disabled=true],.menu__item--disabled,.menu__sub-trigger:disabled,.menu__sub-trigger[data-disabled],.menu__sub-trigger[aria-disabled=true],.menu__sub-trigger--disabled{cursor:not-allowed;opacity:25%;pointer-events:unset}.menu__item,.menu__sub-trigger{box-shadow:none}.menu__item:focus,.menu__item[data-focus=true],.menu__sub-trigger:focus,.menu__sub-trigger[data-focus=true]{background:#201e2c;box-shadow:inset 0 1px 1px #ffffff1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;box-shadow:none;width:100%}.menu__separator{border:none;margin:.35rem 0;color:#ffffff1a;height:1px;background-color:#ffffff1a}.menu__content--primary,.menu__sub-content--primary{background:#070514;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__content--secondary,.menu__sub-content--secondary{background:#191825;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__content--tertiary,.menu__sub-content--tertiary{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__content--success,.menu__sub-content--success{background:#0a1814;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__content--warning,.menu__sub-content--warning{background:#201813;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__content--error,.menu__sub-content--error{background:#1c0516;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__content--info,.menu__sub-content--info{background:#121e24;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}
|
|
1
|
+
.menu__content,.menu__sub-content{padding:.35rem;position:relative;box-sizing:border-box;z-index:999}.menu__content,.menu__sub-content{border-radius:1rem}.menu__label{text-transform:uppercase;font-size:.7rem;display:flex;gap:.35rem;align-items:center;padding:.35rem .7rem;color:#ffffff80}.menu__label{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.menu__item,.menu__sub-trigger,.menu__checkbox-item{border-radius:.65rem;padding:.35rem .7rem;gap:.7rem;cursor:pointer;width:100%;display:flex;align-items:center;font-size:.8rem}.menu__item,.menu__sub-trigger,.menu__checkbox-item{background:#070514;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__item:focus,.menu__sub-trigger:focus,.menu__checkbox-item:focus{outline:none}.menu__item,.menu__sub-trigger,.menu__checkbox-item{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.menu__item:disabled,.menu__item[data-disabled],.menu__item[aria-disabled=true],.menu__item--disabled,.menu__sub-trigger:disabled,.menu__sub-trigger[data-disabled],.menu__sub-trigger[aria-disabled=true],.menu__sub-trigger--disabled,.menu__checkbox-item:disabled,.menu__checkbox-item[data-disabled],.menu__checkbox-item[aria-disabled=true],.menu__checkbox-item--disabled{cursor:not-allowed;opacity:25%;pointer-events:unset}.menu__item,.menu__sub-trigger,.menu__checkbox-item{box-shadow:none}.menu__item:focus,.menu__item[data-focus=true],.menu__sub-trigger:focus,.menu__sub-trigger[data-focus=true],.menu__checkbox-item:focus,.menu__checkbox-item[data-focus=true]{background:#201e2c;box-shadow:inset 0 1px 1px #ffffff1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;box-shadow:none;width:100%}.menu__separator{border:none;margin:.35rem 0;color:#ffffff1a;height:1px;background-color:#ffffff1a}.menu__content--primary,.menu__sub-content--primary{background:#070514;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__content--secondary,.menu__sub-content--secondary{background:#191825;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__content--tertiary,.menu__sub-content--tertiary{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__content--success,.menu__sub-content--success{background:#0a1814;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__content--warning,.menu__sub-content--warning{background:#201813;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__content--error,.menu__sub-content--error{background:#1c0516;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.menu__content--info,.menu__sub-content--info{background:#121e24;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}
|
|
@@ -1,167 +1,147 @@
|
|
|
1
1
|
import "../../utils/contextStore.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import { ReactiveArrayService as
|
|
3
|
+
import { ReactiveArrayService as l } from "../../utils/reactiveArrayService.js";
|
|
4
4
|
import "merge-props";
|
|
5
|
-
import { View as
|
|
6
|
-
class
|
|
7
|
-
getById(
|
|
8
|
-
return this.values(i).find((
|
|
5
|
+
import { View as c } from "../../utils/view.js";
|
|
6
|
+
class v extends l {
|
|
7
|
+
getById(n, i) {
|
|
8
|
+
return this.values(i).find((t) => t.id === n);
|
|
9
9
|
}
|
|
10
|
-
removeParameterNode(
|
|
10
|
+
removeParameterNode(n, i) {
|
|
11
11
|
if (i?.value?.__typename === "NodeFunctionIdWrapper") {
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
let e =
|
|
12
|
+
const t = n?.nodes?.nodes?.find((e) => e?.id === i.value?.id);
|
|
13
|
+
if (t) {
|
|
14
|
+
n.nodes.nodes = n.nodes.nodes.filter((d) => d?.id !== i.value?.id);
|
|
15
|
+
let e = t.nextNodeId;
|
|
16
16
|
for (; e; ) {
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const d = n.nodes.nodes.find((o) => o?.id === e);
|
|
18
|
+
d ? (n.nodes.nodes = n.nodes.nodes.filter((o) => o?.id !== e), e = d.nextNodeId) : e = null;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
this.removeParameterNode(
|
|
20
|
+
t.parameters?.nodes?.forEach((d) => {
|
|
21
|
+
this.removeParameterNode(n, d);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
getLinkedNodesById(
|
|
27
|
-
const
|
|
28
|
-
return
|
|
26
|
+
getLinkedNodesById(n, i) {
|
|
27
|
+
const t = this.getNodeById(n, i), e = t ? this.getLinkedNodesById(n, t.nextNodeId) : [], d = [];
|
|
28
|
+
return t?.parameters?.nodes?.forEach((o) => {
|
|
29
29
|
if (o?.value?.__typename === "NodeFunctionIdWrapper") {
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const r = this.getNodeById(n, o.value?.id);
|
|
31
|
+
r && (d.push(r), d.push(...r ? this.getLinkedNodesById(n, r.nextNodeId) : []));
|
|
32
32
|
}
|
|
33
|
-
}), [...
|
|
33
|
+
}), [...t ? [t] : [], ...d, ...e];
|
|
34
34
|
}
|
|
35
|
-
getNodeById(
|
|
36
|
-
return this.getById(
|
|
35
|
+
getNodeById(n, i) {
|
|
36
|
+
return this.getById(n)?.nodes?.nodes?.find((t) => t?.id === i);
|
|
37
37
|
}
|
|
38
|
-
getPayloadById(
|
|
39
|
-
const i = this.getById(
|
|
40
|
-
...e?.dataType ? {
|
|
41
|
-
dataTypeId: e?.dataType?.id
|
|
42
|
-
} : {},
|
|
43
|
-
...e?.genericKey ? {
|
|
44
|
-
genericKey: e?.genericKey
|
|
45
|
-
} : {},
|
|
46
|
-
...e?.genericType ? {
|
|
47
|
-
genericType: {
|
|
48
|
-
dataTypeId: e?.genericType?.dataType?.id,
|
|
49
|
-
genericMappers: e?.genericType?.genericMappers?.map((t) => ({
|
|
50
|
-
target: t.target,
|
|
51
|
-
sourceDataTypeIdentifiers: t.sourceDataTypeIdentifiers?.map(n) ?? []
|
|
52
|
-
})) ?? []
|
|
53
|
-
}
|
|
54
|
-
} : {}
|
|
55
|
-
});
|
|
38
|
+
getPayloadById(n) {
|
|
39
|
+
const i = this.getById(n);
|
|
56
40
|
return {
|
|
57
41
|
name: i?.name,
|
|
58
42
|
type: i?.type?.id,
|
|
59
|
-
settings: i?.settings?.nodes?.map((
|
|
60
|
-
flowSettingIdentifier:
|
|
61
|
-
value:
|
|
43
|
+
settings: i?.settings?.nodes?.map((t) => ({
|
|
44
|
+
flowSettingIdentifier: t?.flowSettingIdentifier,
|
|
45
|
+
value: t?.value
|
|
62
46
|
})) ?? [],
|
|
63
|
-
nodes: (i?.nodes?.nodes ?? []).map((
|
|
64
|
-
id:
|
|
65
|
-
nextNodeId:
|
|
66
|
-
functionDefinitionId:
|
|
67
|
-
parameters: (
|
|
68
|
-
let
|
|
69
|
-
switch (
|
|
47
|
+
nodes: (i?.nodes?.nodes ?? []).map((t) => ({
|
|
48
|
+
id: t?.id,
|
|
49
|
+
nextNodeId: t?.nextNodeId,
|
|
50
|
+
functionDefinitionId: t?.functionDefinition?.id,
|
|
51
|
+
parameters: (t?.parameters?.nodes ?? []).map((e) => {
|
|
52
|
+
let d;
|
|
53
|
+
switch (e?.value?.__typename) {
|
|
70
54
|
case "NodeFunctionIdWrapper":
|
|
71
|
-
|
|
72
|
-
nodeFunctionId:
|
|
55
|
+
d = {
|
|
56
|
+
nodeFunctionId: e.value.id
|
|
73
57
|
};
|
|
74
58
|
break;
|
|
75
59
|
case "LiteralValue":
|
|
76
|
-
|
|
77
|
-
literalValue:
|
|
60
|
+
d = {
|
|
61
|
+
literalValue: e.value.value
|
|
78
62
|
};
|
|
79
63
|
break;
|
|
80
64
|
case "ReferenceValue": {
|
|
81
|
-
const
|
|
82
|
-
|
|
65
|
+
const o = e.value;
|
|
66
|
+
d = {
|
|
83
67
|
referenceValue: {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
node: s.node,
|
|
87
|
-
nodeFunctionId: s.nodeFunctionId,
|
|
88
|
-
referencePath: s.referencePath ?? [],
|
|
89
|
-
scope: s.scope
|
|
68
|
+
nodeFunctionId: o.nodeFunctionId,
|
|
69
|
+
referencePath: o.referencePath ?? []
|
|
90
70
|
}
|
|
91
71
|
};
|
|
92
72
|
break;
|
|
93
73
|
}
|
|
94
74
|
default:
|
|
95
|
-
|
|
75
|
+
d = {
|
|
96
76
|
literalValue: null
|
|
97
77
|
};
|
|
98
78
|
}
|
|
99
79
|
return {
|
|
100
|
-
parameterDefinitionId:
|
|
101
|
-
value:
|
|
80
|
+
parameterDefinitionId: e?.parameterDefinition?.id,
|
|
81
|
+
value: d
|
|
102
82
|
};
|
|
103
83
|
})
|
|
104
84
|
})),
|
|
105
85
|
startingNodeId: i?.startingNodeId
|
|
106
86
|
};
|
|
107
87
|
}
|
|
108
|
-
async deleteNodeById(
|
|
109
|
-
const
|
|
110
|
-
if (!(!
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
|
|
88
|
+
async deleteNodeById(n, i) {
|
|
89
|
+
const t = this.getById(n), e = this.getNodeById(n, i), d = t?.nodes?.nodes?.find((s) => s?.parameters?.nodes?.find((a) => a?.value?.__typename === "NodeFunctionIdWrapper" && a.value?.id === i)), o = t?.nodes?.nodes?.find((s) => s?.nextNodeId === i), r = this.values().findIndex((s) => s.id === n);
|
|
90
|
+
if (!(!t || !e)) {
|
|
91
|
+
if (t.nodes.nodes = t.nodes.nodes.filter((s) => s?.id !== i), e.parameters?.nodes?.forEach((s) => this.removeParameterNode(t, s)), o ? o.nextNodeId = e.nextNodeId : d || (t.startingNodeId = e.nextNodeId ?? void 0), d) {
|
|
92
|
+
const s = d.parameters?.nodes?.find((a) => a?.value?.__typename === "NodeFunctionIdWrapper" && a.value?.id === i);
|
|
93
|
+
s && (s.value = void 0);
|
|
114
94
|
}
|
|
115
|
-
|
|
95
|
+
t.editedAt = (/* @__PURE__ */ new Date()).toISOString(), this.set(r, new c(t));
|
|
116
96
|
}
|
|
117
97
|
}
|
|
118
|
-
async addNextNodeById(
|
|
119
|
-
const e = this.getById(
|
|
98
|
+
async addNextNodeById(n, i, t) {
|
|
99
|
+
const e = this.getById(n), d = this.values().findIndex((u) => u.id === n), o = i ? this.getNodeById(n, i) : void 0;
|
|
120
100
|
if (!e || i && !o) return;
|
|
121
|
-
const
|
|
122
|
-
...JSON.parse(JSON.stringify(
|
|
123
|
-
id:
|
|
101
|
+
const s = `gid://sagittarius/NodeFunction/${Math.max(0, ...e.nodes?.nodes?.map((u) => Number(u?.id?.match(/NodeFunction\/(\d+)$/)?.[1] ?? 0)) ?? [0]) + 1}`, a = {
|
|
102
|
+
...JSON.parse(JSON.stringify(t)),
|
|
103
|
+
id: s
|
|
124
104
|
};
|
|
125
|
-
o && o.nextNodeId ?
|
|
105
|
+
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, e.editedAt = (/* @__PURE__ */ new Date()).toISOString(), this.set(d, new c(e));
|
|
126
106
|
}
|
|
127
|
-
async setSettingValue(
|
|
128
|
-
const e = this.getById(
|
|
107
|
+
async setSettingValue(n, i, t) {
|
|
108
|
+
const e = this.getById(n), d = this.values().findIndex((r) => r.id === n);
|
|
129
109
|
if (!e) return;
|
|
130
110
|
e.editedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
131
|
-
const o = e.settings?.nodes?.find((
|
|
111
|
+
const o = e.settings?.nodes?.find((r) => r?.flowSettingIdentifier === i);
|
|
132
112
|
if (o)
|
|
133
|
-
o.value =
|
|
113
|
+
o.value = t;
|
|
134
114
|
else {
|
|
135
|
-
const
|
|
115
|
+
const r = {
|
|
136
116
|
flowSettingIdentifier: i,
|
|
137
117
|
value: null
|
|
138
118
|
};
|
|
139
|
-
|
|
119
|
+
r.value = t, e.settings.nodes.push(r);
|
|
140
120
|
}
|
|
141
|
-
this.set(
|
|
121
|
+
this.set(d, new c(e));
|
|
142
122
|
}
|
|
143
|
-
async setParameterValue(
|
|
144
|
-
const
|
|
145
|
-
if (!
|
|
146
|
-
const
|
|
147
|
-
if (!
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
if (this.removeParameterNode(
|
|
151
|
-
const
|
|
123
|
+
async setParameterValue(n, i, t, e) {
|
|
124
|
+
const d = this.getById(n), o = this.values().findIndex((a) => a.id === n);
|
|
125
|
+
if (!d) return;
|
|
126
|
+
const r = this.getNodeById(n, i);
|
|
127
|
+
if (!r) return;
|
|
128
|
+
const s = r.parameters?.nodes?.find((a) => a?.id === t);
|
|
129
|
+
if (s) {
|
|
130
|
+
if (this.removeParameterNode(d, s), e?.__typename === "NodeFunction") {
|
|
131
|
+
const a = Math.max(0, ...d.nodes?.nodes?.map((N) => Number(N?.id?.match(/NodeFunction\/(\d+)$/)?.[1] ?? 0)) ?? [0]), u = {
|
|
152
132
|
...e,
|
|
153
|
-
id: `gid://sagittarius/NodeFunction/${
|
|
133
|
+
id: `gid://sagittarius/NodeFunction/${a + 1}`
|
|
154
134
|
};
|
|
155
|
-
|
|
156
|
-
id: `gid://sagittarius/NodeFunction/${
|
|
135
|
+
d.nodes?.nodes?.push(u), s.value = {
|
|
136
|
+
id: `gid://sagittarius/NodeFunction/${a + 1}`,
|
|
157
137
|
__typename: "NodeFunctionIdWrapper"
|
|
158
138
|
};
|
|
159
139
|
} else
|
|
160
|
-
|
|
161
|
-
|
|
140
|
+
s.value = e;
|
|
141
|
+
d.editedAt = (/* @__PURE__ */ new Date()).toISOString(), this.set(o, new c(d));
|
|
162
142
|
}
|
|
163
143
|
}
|
|
164
144
|
}
|
|
165
145
|
export {
|
|
166
|
-
|
|
146
|
+
v as DFlowReactiveService
|
|
167
147
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import "../../utils/contextStore.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import { ReactiveArrayService as
|
|
3
|
+
import { ReactiveArrayService as c } from "../../utils/reactiveArrayService.js";
|
|
4
4
|
import "merge-props";
|
|
5
|
-
import { DataTypeView as
|
|
5
|
+
import { DataTypeView as l } from "./DFlowDataType.view.js";
|
|
6
6
|
import { resolveType as g } from "../../utils/generics.js";
|
|
7
7
|
import { useValueValidation as m } from "../d-flow-validation/DValueValidation.hook.js";
|
|
8
8
|
import { findReturnNode as v } from "./rules/DFlowDataTypeReturnTypeRule.js";
|
|
9
9
|
import { md5 as _ } from "js-md5";
|
|
10
|
-
class
|
|
10
|
+
class R extends c {
|
|
11
11
|
getDataType(e, n) {
|
|
12
12
|
if (!e || e.genericKey) return;
|
|
13
13
|
const i = e.dataType ?? e.genericType?.dataType, t = i?.identifier, u = i?.id;
|
|
14
|
-
return i?.rules ? new
|
|
14
|
+
return i?.rules ? new l(i) : this.values().find((y) => y.identifier == t || y.id == u);
|
|
15
15
|
}
|
|
16
16
|
getDataTypeFromValue(e, n, i) {
|
|
17
17
|
if (!e) return;
|
|
@@ -108,7 +108,6 @@ class F extends l {
|
|
|
108
108
|
}
|
|
109
109
|
getTypeFromValue(e, n, i) {
|
|
110
110
|
if (!e) return;
|
|
111
|
-
if (e.__typename === "ReferenceValue") return e.dataTypeIdentifier;
|
|
112
111
|
const t = this.getDataTypeFromValue(e, n, i);
|
|
113
112
|
if ((t?.genericKeys?.length ?? 0) <= 0 || !t?.genericKeys) return {
|
|
114
113
|
dataType: {
|
|
@@ -166,7 +165,7 @@ class F extends l {
|
|
|
166
165
|
}));
|
|
167
166
|
return {
|
|
168
167
|
sourceDataTypeIdentifiers: [{
|
|
169
|
-
dataType: new
|
|
168
|
+
dataType: new l({
|
|
170
169
|
...t.json,
|
|
171
170
|
genericKeys: [],
|
|
172
171
|
identifier: _(String(e.value)),
|
|
@@ -200,5 +199,5 @@ class F extends l {
|
|
|
200
199
|
}
|
|
201
200
|
}
|
|
202
201
|
export {
|
|
203
|
-
|
|
202
|
+
R as DFlowDataTypeReactiveService
|
|
204
203
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DFlowDataTypeReactiveService } from '../DFlowDataType.service';
|
|
2
2
|
import { DataTypeRulesContainsKeyConfig, Flow, GenericMapper, NodeParameterValue } from '@code0-tech/sagittarius-graphql-types';
|
|
3
3
|
export declare class DFlowDataTypeContainsKeyRule {
|
|
4
|
-
static validate(value: NodeParameterValue, config: DataTypeRulesContainsKeyConfig, generics?: Map<string, GenericMapper>,
|
|
4
|
+
static validate(value: NodeParameterValue, config: DataTypeRulesContainsKeyConfig, generics?: Map<string, GenericMapper>, flow?: Flow, dataTypeService?: DFlowDataTypeReactiveService): boolean;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { genericMapping as
|
|
2
|
-
import { useValueValidation as
|
|
1
|
+
import { genericMapping as D, staticImplements as T } from "./DFlowDataTypeRule.js";
|
|
2
|
+
import { useValueValidation as m } from "../../d-flow-validation/DValueValidation.hook.js";
|
|
3
3
|
function A(r, e, t, n) {
|
|
4
4
|
var i = k(), o = e(function(s) {
|
|
5
5
|
i.initializeInstanceElements(s, a.elements);
|
|
@@ -128,7 +128,7 @@ function I(r) {
|
|
|
128
128
|
}, n = 0; n < r.length; n++) {
|
|
129
129
|
var i, o = r[n];
|
|
130
130
|
if (o.kind === "method" && (i = e.find(t)))
|
|
131
|
-
if (
|
|
131
|
+
if (y(o.descriptor) || y(i.descriptor)) {
|
|
132
132
|
if (u(o) || u(i)) throw new ReferenceError("Duplicated methods (" + o.key + ") can't be decorated.");
|
|
133
133
|
i.descriptor = o.descriptor;
|
|
134
134
|
} else {
|
|
@@ -145,7 +145,7 @@ function I(r) {
|
|
|
145
145
|
function u(r) {
|
|
146
146
|
return r.decorators && r.decorators.length;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function y(r) {
|
|
149
149
|
return r !== void 0 && !(r.value === void 0 && r.writable === void 0);
|
|
150
150
|
}
|
|
151
151
|
function v(r, e) {
|
|
@@ -168,13 +168,13 @@ function _(r, e) {
|
|
|
168
168
|
return (e === "string" ? String : Number)(r);
|
|
169
169
|
}
|
|
170
170
|
function x(r) {
|
|
171
|
-
return
|
|
171
|
+
return j(r) || O(r) || F(r) || z();
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function z() {
|
|
174
174
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
175
175
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function F(r, e) {
|
|
178
178
|
if (r) {
|
|
179
179
|
if (typeof r == "string") return b(r, e);
|
|
180
180
|
var t = {}.toString.call(r).slice(8, -1);
|
|
@@ -186,13 +186,13 @@ function b(r, e) {
|
|
|
186
186
|
for (var t = 0, n = Array(e); t < e; t++) n[t] = r[t];
|
|
187
187
|
return n;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function O(r) {
|
|
190
190
|
if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function j(r) {
|
|
193
193
|
if (Array.isArray(r)) return r;
|
|
194
194
|
}
|
|
195
|
-
let
|
|
195
|
+
let M = A([T()], function(r) {
|
|
196
196
|
class e {
|
|
197
197
|
constructor() {
|
|
198
198
|
r(this);
|
|
@@ -206,17 +206,17 @@ let R = A([D()], function(r) {
|
|
|
206
206
|
key: "validate",
|
|
207
207
|
value: function(n, i, o, a, s) {
|
|
208
208
|
const l = o?.get(i?.dataTypeIdentifier?.genericKey), c = o?.get(i?.dataTypeIdentifier?.genericKey)?.sourceDataTypeIdentifiers, p = o?.get(i?.dataTypeIdentifier?.genericKey)?.genericCombinationStrategies;
|
|
209
|
-
if ((i?.key ?? "") in n && i?.dataTypeIdentifier?.genericKey && !l && !
|
|
210
|
-
if (!(
|
|
209
|
+
if ((i?.key ?? "") in n && i?.dataTypeIdentifier?.genericKey && !l && !s?.getDataType(i.dataTypeIdentifier)) return !0;
|
|
210
|
+
if (!(s?.getDataType(i.dataTypeIdentifier) || l) || l && !s?.hasDataTypes(c) || l && (p?.length ?? 0) + 1 != c.length) return !1;
|
|
211
211
|
if (i?.dataTypeIdentifier?.genericKey && l && c) {
|
|
212
|
-
const d = c.map((f) =>
|
|
212
|
+
const d = c.map((f) => m(n.value[i?.key ?? ""], s?.getDataType(f), s, a, f.genericType.genericMappers)), E = d.length > 1 ? d.reduce((f, h, g) => p && p[g - 1].type == "OR" ? f || h : f && h) : d[0];
|
|
213
213
|
return (i?.key ?? "") in n && E;
|
|
214
214
|
}
|
|
215
|
-
return i?.dataTypeIdentifier?.dataType ? (i?.key ?? "") in n &&
|
|
215
|
+
return i?.dataTypeIdentifier?.dataType ? (i?.key ?? "") in n && m(n.value[i?.key ?? ""], s?.getDataType(i.dataTypeIdentifier), s) : (i?.key ?? "") in n && m(n.value[i?.key ?? ""], s?.getDataType(i.dataTypeIdentifier), s, a, D(i?.dataTypeIdentifier?.genericType?.genericMappers, o));
|
|
216
216
|
}
|
|
217
217
|
}]
|
|
218
218
|
};
|
|
219
219
|
});
|
|
220
220
|
export {
|
|
221
|
-
|
|
221
|
+
M as DFlowDataTypeContainsKeyRule
|
|
222
222
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DFlowDataTypeReactiveService } from '../DFlowDataType.service';
|
|
2
2
|
import { DataTypeRulesContainsKeyConfig, Flow, GenericMapper, NodeParameterValue } from '@code0-tech/sagittarius-graphql-types';
|
|
3
3
|
export declare class DFlowDataTypeContainsTypeRule {
|
|
4
|
-
static validate(value: NodeParameterValue, config: DataTypeRulesContainsKeyConfig, generics?: Map<string, GenericMapper>,
|
|
4
|
+
static validate(value: NodeParameterValue, config: DataTypeRulesContainsKeyConfig, generics?: Map<string, GenericMapper>, flow?: Flow, dataTypeService?: DFlowDataTypeReactiveService): boolean;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { genericMapping as E, staticImplements as
|
|
2
|
-
import { useValueValidation as
|
|
3
|
-
function
|
|
1
|
+
import { genericMapping as E, staticImplements as D } from "./DFlowDataTypeRule.js";
|
|
2
|
+
import { useValueValidation as h } from "../../d-flow-validation/DValueValidation.hook.js";
|
|
3
|
+
function T(r, e, t, n) {
|
|
4
4
|
var i = w(), o = e(function(s) {
|
|
5
5
|
i.initializeInstanceElements(s, a.elements);
|
|
6
6
|
}, t), a = i.decorateClass(C(o.d.map(A)), r);
|
|
@@ -128,7 +128,7 @@ function C(r) {
|
|
|
128
128
|
}, n = 0; n < r.length; n++) {
|
|
129
129
|
var i, o = r[n];
|
|
130
130
|
if (o.kind === "method" && (i = e.find(t)))
|
|
131
|
-
if (
|
|
131
|
+
if (y(o.descriptor) || y(i.descriptor)) {
|
|
132
132
|
if (m(o) || m(i)) throw new ReferenceError("Duplicated methods (" + o.key + ") can't be decorated.");
|
|
133
133
|
i.descriptor = o.descriptor;
|
|
134
134
|
} else {
|
|
@@ -145,7 +145,7 @@ function C(r) {
|
|
|
145
145
|
function m(r) {
|
|
146
146
|
return r.decorators && r.decorators.length;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function y(r) {
|
|
149
149
|
return r !== void 0 && !(r.value === void 0 && r.writable === void 0);
|
|
150
150
|
}
|
|
151
151
|
function v(r, e) {
|
|
@@ -168,13 +168,13 @@ function I(r, e) {
|
|
|
168
168
|
return (e === "string" ? String : Number)(r);
|
|
169
169
|
}
|
|
170
170
|
function _(r) {
|
|
171
|
-
return
|
|
171
|
+
return O(r) || F(r) || z(r) || x();
|
|
172
172
|
}
|
|
173
173
|
function x() {
|
|
174
174
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
175
175
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function z(r, e) {
|
|
178
178
|
if (r) {
|
|
179
179
|
if (typeof r == "string") return b(r, e);
|
|
180
180
|
var t = {}.toString.call(r).slice(8, -1);
|
|
@@ -186,13 +186,13 @@ function b(r, e) {
|
|
|
186
186
|
for (var t = 0, n = Array(e); t < e; t++) n[t] = r[t];
|
|
187
187
|
return n;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function F(r) {
|
|
190
190
|
if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function O(r) {
|
|
193
193
|
if (Array.isArray(r)) return r;
|
|
194
194
|
}
|
|
195
|
-
let
|
|
195
|
+
let R = T([D()], function(r) {
|
|
196
196
|
class e {
|
|
197
197
|
constructor() {
|
|
198
198
|
r(this);
|
|
@@ -207,23 +207,23 @@ let K = D([T()], function(r) {
|
|
|
207
207
|
value: function(n, i, o, a, s) {
|
|
208
208
|
const l = o?.get(i?.dataTypeIdentifier?.genericKey), p = o?.get(i?.dataTypeIdentifier?.genericKey)?.sourceDataTypeIdentifiers, d = o?.get(i?.dataTypeIdentifier?.genericKey)?.genericCombinationStrategies;
|
|
209
209
|
if ("value" in n && !Array.isArray(n.value)) return !1;
|
|
210
|
-
if (i?.dataTypeIdentifier?.genericKey && !l && !
|
|
211
|
-
if (!(
|
|
210
|
+
if (i?.dataTypeIdentifier?.genericKey && !l && !s?.getDataType(i.dataTypeIdentifier)) return !0;
|
|
211
|
+
if (!(s?.getDataType(i.dataTypeIdentifier) || l) || l && !s?.hasDataTypes(p) || l && (d?.length ?? 0) + 1 != p.length) return !1;
|
|
212
212
|
if (i?.dataTypeIdentifier?.genericKey && l && p) {
|
|
213
|
-
const c = p.map((f) => n.value.every((u) => f.genericType ?
|
|
213
|
+
const c = p.map((f) => n.value.every((u) => f.genericType ? h({
|
|
214
214
|
__typename: "LiteralValue",
|
|
215
215
|
value: u
|
|
216
|
-
},
|
|
216
|
+
}, s?.getDataType(f), s, a, f.genericType.genericMappers) : h({
|
|
217
217
|
__typename: "LiteralValue",
|
|
218
218
|
value: u
|
|
219
|
-
},
|
|
219
|
+
}, s?.getDataType(f), s, a)));
|
|
220
220
|
return c.length > 1 ? c.reduce((f, u, k) => d && d[k - 1].type == "OR" ? f || u : f && u) : c[0];
|
|
221
221
|
}
|
|
222
|
-
return i?.dataTypeIdentifier?.dataType ? n.value.every((c) =>
|
|
222
|
+
return i?.dataTypeIdentifier?.dataType ? n.value.every((c) => h(c, s?.getDataType(i.dataTypeIdentifier), s)) : n.value.every((c) => h(c, s?.getDataType(i.dataTypeIdentifier), s, a, E((i.dataTypeIdentifier?.genericType).genericMappers, o)));
|
|
223
223
|
}
|
|
224
224
|
}]
|
|
225
225
|
};
|
|
226
226
|
});
|
|
227
227
|
export {
|
|
228
|
-
|
|
228
|
+
R as DFlowDataTypeContainsTypeRule
|
|
229
229
|
};
|
|
@@ -4,5 +4,5 @@ export interface DFlowDataTypeParentRuleConfig {
|
|
|
4
4
|
type: DataTypeIdentifier;
|
|
5
5
|
}
|
|
6
6
|
export declare class DFlowDataTypeParentRule {
|
|
7
|
-
static validate(value: NodeParameterValue, config: DFlowDataTypeParentRuleConfig, generics?: Map<string, GenericMapper>,
|
|
7
|
+
static validate(value: NodeParameterValue, config: DFlowDataTypeParentRuleConfig, generics?: Map<string, GenericMapper>, flow?: Flow, dataTypeService?: DFlowDataTypeReactiveService): boolean;
|
|
8
8
|
}
|
|
@@ -207,7 +207,7 @@ let j = k([w()], function(r) {
|
|
|
207
207
|
key: "validate",
|
|
208
208
|
value: function(i, n, o, s, a) {
|
|
209
209
|
const l = o ? b(n.type, o) : n.type;
|
|
210
|
-
return
|
|
210
|
+
return a ? E(i, a.getDataType(l), a, s, Array.from(o, ([p, c]) => c)) : !1;
|
|
211
211
|
}
|
|
212
212
|
}]
|
|
213
213
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DFlowDataTypeReactiveService } from '../DFlowDataType.service';
|
|
2
2
|
import { DataTypeRulesReturnTypeConfig, Flow, GenericMapper, NodeFunction, NodeFunctionIdWrapper, NodeParameterValue } from '@code0-tech/sagittarius-graphql-types';
|
|
3
|
+
import { DFlowFunctionReactiveService } from '../../d-flow-function';
|
|
3
4
|
export declare class DFlowDataTypeReturnTypeRule {
|
|
4
|
-
static validate(value: NodeParameterValue, config: DataTypeRulesReturnTypeConfig, generics?: Map<string, GenericMapper>,
|
|
5
|
+
static validate(value: NodeParameterValue, config: DataTypeRulesReturnTypeConfig, generics?: Map<string, GenericMapper>, flow?: Flow, dataTypeService?: DFlowDataTypeReactiveService, functionService?: DFlowFunctionReactiveService): boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare const findReturnNode: (n: NodeFunctionIdWrapper, flow: Flow) => NodeFunction | undefined;
|