@code0-tech/pictor 0.0.0-mvp.35 → 0.0.0-mvp.36
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/d-flow-folder/DFlowFolder.style.css +1 -1
- package/dist/assets/components/scroll-area/ScrollArea.style.css +1 -1
- package/dist/components/context-menu/ContextMenu.js +96 -181
- package/dist/components/d-flow-file/DFlowTabDefault.js +24 -24
- package/dist/components/d-flow-folder/DFlowFolder.d.ts +3 -0
- package/dist/components/d-flow-folder/DFlowFolder.js +237 -174
- package/dist/components/d-flow-folder/DFlowFolderContextMenu.d.ts +1 -1
- package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +33 -26
- package/dist/components/d-flow-folder/index.js +8 -7
- package/dist/components/d-flow-input/DFlowInputDefault.js +18 -18
- package/dist/index.js +219 -218
- package/package.json +6 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
.d-folder{padding:.35rem .7rem;display:flex;white-space:nowrap;flex-wrap:nowrap;gap:.35rem;cursor:pointer;align-items:center;justify-content:space-between;font-size:.8rem;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.d-folder{border-radius:1rem;background:#030014;border:1px solid rgba(255,255,255,.1);color:#ffffffbf;position:relative;box-sizing:border-box}.d-folder:hover{background:#292637}.d-folder{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px;border:none;background:#030014}.d-folder[data-state=open]{background:#353343;outline:none;border:none}.d-folder__icon,.d-folder__status,.d-folder__item-icon{display:flex;align-items:center;justify-content:center}.d-folder__content{margin-left:.7rem;position:relative;padding-left:calc(5px + .35rem)}.d-folder__content:before{height:100%;width:1px;background:#1c1a2c;position:absolute;content:"";left:5px}.d-folder__item{padding:.35rem .7rem;display:flex;white-space:nowrap;flex-wrap:nowrap;gap:.35rem;align-items:center;cursor:pointer;font-size:.8rem;position:relative}.d-folder__item{border-radius:1rem;background:#030014;border:1px solid rgba(255,255,255,.1);color:#ffffffbf;position:relative;box-sizing:border-box}.d-folder__item:hover{background:#292637}.d-folder__item:active,.d-folder__item:focus,.d-folder__item[aria-selected=true],.d-folder__item[data-state=open]{background:#353343;outline:none}.d-folder__item{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px;border:none}.d-folder__item[data-state=open],.d-folder__item--active{background:#353343;outline:none;border:none}
|
|
1
|
+
.d-folder{padding:.35rem .7rem;display:flex;white-space:nowrap;flex-wrap:nowrap;gap:.35rem;cursor:pointer;align-items:center;justify-content:space-between;font-size:.8rem;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.d-folder__root{padding:.7rem;width:100%;height:100%;box-sizing:border-box}.d-folder{border-radius:1rem;background:#030014;border:1px solid rgba(255,255,255,.1);color:#ffffffbf;position:relative;box-sizing:border-box}.d-folder:hover{background:#292637}.d-folder{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px;border:none;background:#030014}.d-folder[data-state=open]{background:#353343;outline:none;border:none}.d-folder__icon,.d-folder__status,.d-folder__item-icon{display:flex;align-items:center;justify-content:center}.d-folder__content{margin-left:.7rem;position:relative;padding-left:calc(5px + .35rem)}.d-folder__content:before{height:100%;width:1px;background:#1c1a2c;position:absolute;content:"";left:5px}.d-folder__item{padding:.35rem .7rem;display:flex;white-space:nowrap;flex-wrap:nowrap;gap:.35rem;align-items:center;cursor:pointer;font-size:.8rem;position:relative;margin:.175rem 0}.d-folder__item{border-radius:1rem;background:#030014;border:1px solid rgba(255,255,255,.1);color:#ffffffbf;position:relative;box-sizing:border-box}.d-folder__item:hover{background:#292637}.d-folder__item:active,.d-folder__item:focus,.d-folder__item[aria-selected=true],.d-folder__item[data-state=open]{background:#353343;outline:none}.d-folder__item{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px;border:none}.d-folder__item-hover-card{background:#1c1a2c;border:1px solid rgba(255,255,255,.1);color:#ffffffbf;position:relative;box-sizing:border-box;background:#353343;outline:none}.d-folder__item-hover-card:hover{background:#292637}.d-folder__item-hover-card:active,.d-folder__item-hover-card:focus,.d-folder__item-hover-card[aria-selected=true],.d-folder__item-hover-card[data-state=open]{background:#353343;outline:none}.d-folder__item-hover-card{border-radius:1rem;cursor:pointer;border:none}.d-folder__item[data-state=open],.d-folder__item--active{background:#353343;outline:none;border:none}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.scroll-area{overflow:hidden}.scroll-area__viewport{width:100%;height:100
|
|
1
|
+
.scroll-area{overflow:hidden}.scroll-area__viewport{width:100%;height:100%;display:block!important}.scroll-area__scrollbar{display:flex;-webkit-user-select:none;user-select:none;touch-action:none}.scroll-area__scrollbar[data-orientation=vertical]{width:.5rem}.scroll-area__scrollbar[data-orientation=horizontal]{flex-direction:column;height:.5rem}.scroll-area__thumb{flex:1;cursor:grabbing}.scroll-area__thumb{background:#1c1a2c;border:1px solid rgba(255,255,255,.1);color:#ffffffbf;position:relative;box-sizing:border-box;border-radius:1rem}
|
|
@@ -1,191 +1,106 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { c as u } from "../../_virtual/compiler-runtime.js";
|
|
3
3
|
import "../../utils/contextStore.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { mergeCode0Props as i } from "../../utils/utils.js";
|
|
6
|
-
import * as
|
|
6
|
+
import * as r from "@radix-ui/react-context-menu";
|
|
7
7
|
import '../../assets/components/context-menu/ContextMenu.style.css';/* empty css */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, H = (t) => {
|
|
35
|
-
const e = r.c(17), l = t.align, c = `context-menu__content context-menu__content--${t.color ?? "secondary"}`;
|
|
36
|
-
let n;
|
|
37
|
-
e[0] !== t || e[1] !== c ? (n = i(c, t), e[0] = t, e[1] = c, e[2] = n) : n = e[2];
|
|
38
|
-
const C = n;
|
|
8
|
+
const g = (n) => {
|
|
9
|
+
const t = u.c(4);
|
|
10
|
+
let o;
|
|
11
|
+
t[0] !== n ? (o = i("context-menu", n), t[0] = n, t[1] = o) : o = t[1];
|
|
12
|
+
const c = o;
|
|
13
|
+
let e;
|
|
14
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenu, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
15
|
+
}, $ = (n) => {
|
|
16
|
+
const t = u.c(4);
|
|
17
|
+
let o;
|
|
18
|
+
t[0] !== n ? (o = i("context-menu__trigger", n), t[0] = n, t[1] = o) : o = t[1];
|
|
19
|
+
const c = o;
|
|
20
|
+
let e;
|
|
21
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuTrigger, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
22
|
+
}, b = (n) => {
|
|
23
|
+
const t = u.c(4);
|
|
24
|
+
let o;
|
|
25
|
+
t[0] !== n ? (o = i("context-menu__portal", n), t[0] = n, t[1] = o) : o = t[1];
|
|
26
|
+
const c = o;
|
|
27
|
+
let e;
|
|
28
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuPortal, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
29
|
+
}, S = (n) => {
|
|
30
|
+
const t = u.c(6), o = n.align, c = `context-menu__content context-menu__content--${n.color ?? "primary"}`;
|
|
31
|
+
let e;
|
|
32
|
+
t[0] !== n || t[1] !== c ? (e = i(c, n), t[0] = n, t[1] = c, t[2] = e) : e = t[2];
|
|
33
|
+
const x = e;
|
|
39
34
|
let s;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
e
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
let
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
]
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, T = (t) => {
|
|
82
|
-
const e = r.c(4);
|
|
83
|
-
let l;
|
|
84
|
-
e[0] !== t ? (l = i("context-menu__label", t), e[0] = t, e[1] = l) : l = e[1];
|
|
85
|
-
const c = l;
|
|
86
|
-
let n;
|
|
87
|
-
return e[2] !== c ? (n = /* @__PURE__ */ o(m.ContextMenuLabel, { ...c }), e[2] = c, e[3] = n) : n = e[3], n;
|
|
88
|
-
}, J = (t) => {
|
|
89
|
-
const e = r.c(4);
|
|
90
|
-
let l;
|
|
91
|
-
e[0] !== t ? (l = i("context-menu__item", t), e[0] = t, e[1] = l) : l = e[1];
|
|
92
|
-
const c = l;
|
|
93
|
-
let n;
|
|
94
|
-
return e[2] !== c ? (n = /* @__PURE__ */ o(m.ContextMenuItem, { ...c }), e[2] = c, e[3] = n) : n = e[3], n;
|
|
95
|
-
}, K = (t) => {
|
|
96
|
-
const e = r.c(4);
|
|
97
|
-
let l;
|
|
98
|
-
e[0] !== t ? (l = i("context-menu__group", t), e[0] = t, e[1] = l) : l = e[1];
|
|
99
|
-
const c = l;
|
|
100
|
-
let n;
|
|
101
|
-
return e[2] !== c ? (n = /* @__PURE__ */ o(m.ContextMenuGroup, { ...c }), e[2] = c, e[3] = n) : n = e[3], n;
|
|
102
|
-
}, N = (t) => {
|
|
103
|
-
const e = r.c(4);
|
|
104
|
-
let l;
|
|
105
|
-
e[0] !== t ? (l = i("context-menu__sub", t), e[0] = t, e[1] = l) : l = e[1];
|
|
106
|
-
const c = l;
|
|
107
|
-
let n;
|
|
108
|
-
return e[2] !== c ? (n = /* @__PURE__ */ o(m.ContextMenuSub, { ...c }), e[2] = c, e[3] = n) : n = e[3], n;
|
|
109
|
-
}, O = (t) => {
|
|
110
|
-
const e = r.c(4);
|
|
111
|
-
let l;
|
|
112
|
-
e[0] !== t ? (l = i("context-menu__sub-trigger", t), e[0] = t, e[1] = l) : l = e[1];
|
|
113
|
-
const c = l;
|
|
114
|
-
let n;
|
|
115
|
-
return e[2] !== c ? (n = /* @__PURE__ */ o(m.ContextMenuSubTrigger, { ...c }), e[2] = c, e[3] = n) : n = e[3], n;
|
|
116
|
-
}, Q = (t) => {
|
|
117
|
-
const e = r.c(16), l = `context-menu__sub-content context-menu__sub-content--${t.color ?? "secondary"}`;
|
|
118
|
-
let c;
|
|
119
|
-
e[0] !== t || e[1] !== l ? (c = i(l, t), e[0] = t, e[1] = l, e[2] = c) : c = e[2];
|
|
120
|
-
const n = c;
|
|
121
|
-
let C;
|
|
122
|
-
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (C = {
|
|
123
|
-
borderWidth: "2px"
|
|
124
|
-
}, e[3] = C) : C = e[3];
|
|
35
|
+
return t[3] !== n.align || t[4] !== x ? (s = /* @__PURE__ */ l(r.ContextMenuContent, { align: o, ...x }), t[3] = n.align, t[4] = x, t[5] = s) : s = t[5], s;
|
|
36
|
+
}, T = (n) => {
|
|
37
|
+
const t = u.c(4);
|
|
38
|
+
let o;
|
|
39
|
+
t[0] !== n ? (o = i("context-menu__label", n), t[0] = n, t[1] = o) : o = t[1];
|
|
40
|
+
const c = o;
|
|
41
|
+
let e;
|
|
42
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuLabel, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
43
|
+
}, w = (n) => {
|
|
44
|
+
const t = u.c(4);
|
|
45
|
+
let o;
|
|
46
|
+
t[0] !== n ? (o = i("context-menu__item", n), t[0] = n, t[1] = o) : o = t[1];
|
|
47
|
+
const c = o;
|
|
48
|
+
let e;
|
|
49
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuItem, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
50
|
+
}, P = (n) => {
|
|
51
|
+
const t = u.c(4);
|
|
52
|
+
let o;
|
|
53
|
+
t[0] !== n ? (o = i("context-menu__group", n), t[0] = n, t[1] = o) : o = t[1];
|
|
54
|
+
const c = o;
|
|
55
|
+
let e;
|
|
56
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuGroup, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
57
|
+
}, d = (n) => {
|
|
58
|
+
const t = u.c(4);
|
|
59
|
+
let o;
|
|
60
|
+
t[0] !== n ? (o = i("context-menu__sub", n), t[0] = n, t[1] = o) : o = t[1];
|
|
61
|
+
const c = o;
|
|
62
|
+
let e;
|
|
63
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuSub, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
64
|
+
}, y = (n) => {
|
|
65
|
+
const t = u.c(4);
|
|
66
|
+
let o;
|
|
67
|
+
t[0] !== n ? (o = i("context-menu__sub-trigger", n), t[0] = n, t[1] = o) : o = t[1];
|
|
68
|
+
const c = o;
|
|
69
|
+
let e;
|
|
70
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuSubTrigger, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
71
|
+
}, A = (n) => {
|
|
72
|
+
const t = u.c(6), o = n.align, c = `context-menu__sub-content context-menu__sub-content--${n.color ?? "primary"}`;
|
|
73
|
+
let e;
|
|
74
|
+
t[0] !== n || t[1] !== c ? (e = i(c, n), t[0] = n, t[1] = c, t[2] = e) : e = t[2];
|
|
75
|
+
const x = e;
|
|
125
76
|
let s;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
e
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
/* @__PURE__ */ o(y, { border: !0, children: /* @__PURE__ */ o(w, { size: 12 }) })
|
|
142
|
-
] }),
|
|
143
|
-
"move"
|
|
144
|
-
] }), d = /* @__PURE__ */ o(A, { spacing: "xxs" }), e[9] = _, e[10] = d) : (_ = e[9], d = e[10]);
|
|
145
|
-
let h;
|
|
146
|
-
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
147
|
-
gap: ".35rem"
|
|
148
|
-
}, e[11] = h) : h = e[11];
|
|
149
|
-
let b;
|
|
150
|
-
e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ o(T, { children: /* @__PURE__ */ a(S, { style: u, children: [
|
|
151
|
-
_,
|
|
152
|
-
d,
|
|
153
|
-
/* @__PURE__ */ a(S, { align: "center", style: h, children: [
|
|
154
|
-
/* @__PURE__ */ o(y, { border: !0, children: /* @__PURE__ */ o(I, { size: 12 }) }),
|
|
155
|
-
"select"
|
|
156
|
-
] })
|
|
157
|
-
] }) }), e[12] = b) : b = e[12];
|
|
158
|
-
let g;
|
|
159
|
-
return e[13] !== n || e[14] !== s ? (g = /* @__PURE__ */ a(m.ContextMenuSubContent, { ...n, children: [
|
|
160
|
-
s,
|
|
161
|
-
b
|
|
162
|
-
] }), e[13] = n, e[14] = s, e[15] = g) : g = e[15], g;
|
|
163
|
-
}, V = (t) => {
|
|
164
|
-
const e = r.c(4);
|
|
165
|
-
let l;
|
|
166
|
-
e[0] !== t ? (l = i("context-menu__separator", t), e[0] = t, e[1] = l) : l = e[1];
|
|
167
|
-
const c = l;
|
|
168
|
-
let n;
|
|
169
|
-
return e[2] !== c ? (n = /* @__PURE__ */ o(m.ContextMenuSeparator, { ...c }), e[2] = c, e[3] = n) : n = e[3], n;
|
|
170
|
-
}, X = (t) => {
|
|
171
|
-
const e = r.c(4);
|
|
172
|
-
let l;
|
|
173
|
-
e[0] !== t ? (l = i("context-menu__arrow", t), e[0] = t, e[1] = l) : l = e[1];
|
|
174
|
-
const c = l;
|
|
175
|
-
let n;
|
|
176
|
-
return e[2] !== c ? (n = /* @__PURE__ */ o(m.ContextMenuArrow, { ...c }), e[2] = c, e[3] = n) : n = e[3], n;
|
|
77
|
+
return t[3] !== n.align || t[4] !== x ? (s = /* @__PURE__ */ l(r.ContextMenuSubContent, { align: o, ...x }), t[3] = n.align, t[4] = x, t[5] = s) : s = t[5], s;
|
|
78
|
+
}, G = (n) => {
|
|
79
|
+
const t = u.c(4);
|
|
80
|
+
let o;
|
|
81
|
+
t[0] !== n ? (o = i("context-menu__separator", n), t[0] = n, t[1] = o) : o = t[1];
|
|
82
|
+
const c = o;
|
|
83
|
+
let e;
|
|
84
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuSeparator, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
85
|
+
}, I = (n) => {
|
|
86
|
+
const t = u.c(4);
|
|
87
|
+
let o;
|
|
88
|
+
t[0] !== n ? (o = i("context-menu__arrow", n), t[0] = n, t[1] = o) : o = t[1];
|
|
89
|
+
const c = o;
|
|
90
|
+
let e;
|
|
91
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuArrow, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
177
92
|
};
|
|
178
93
|
export {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
94
|
+
g as ContextMenu,
|
|
95
|
+
I as ContextMenuArrow,
|
|
96
|
+
S as ContextMenuContent,
|
|
97
|
+
P as ContextMenuGroup,
|
|
98
|
+
w as ContextMenuItem,
|
|
184
99
|
T as ContextMenuLabel,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
100
|
+
b as ContextMenuPortal,
|
|
101
|
+
G as ContextMenuSeparator,
|
|
102
|
+
d as ContextMenuSub,
|
|
103
|
+
A as ContextMenuSubContent,
|
|
104
|
+
y as ContextMenuSubTrigger,
|
|
105
|
+
$ as ContextMenuTrigger
|
|
191
106
|
};
|
|
@@ -17,10 +17,10 @@ import "../form/TextInput.js";
|
|
|
17
17
|
import { useForm as M } from "../form/useForm.js";
|
|
18
18
|
import { Flex as k } from "../flex/Flex.js";
|
|
19
19
|
import { useService as p, useStore as S } from "../../utils/contextStore.js";
|
|
20
|
-
import { DFlowFunctionReactiveService as
|
|
20
|
+
import { DFlowFunctionReactiveService as g } from "../d-flow-function/DFlowFunction.service.js";
|
|
21
21
|
import "js-md5";
|
|
22
22
|
import "../d-flow/DFlow.js";
|
|
23
|
-
import { DFlowReactiveService as
|
|
23
|
+
import { DFlowReactiveService as V } from "../d-flow/DFlow.service.js";
|
|
24
24
|
import "../d-flow-data-type/rules/DFlowDataTypeRegexRule.js";
|
|
25
25
|
import "../d-flow-data-type/rules/DFlowDataTypeNumberRangeRule.js";
|
|
26
26
|
import "../d-flow-data-type/rules/DFlowDataTypeItemOfCollectionRule.js";
|
|
@@ -30,60 +30,60 @@ import "../d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js";
|
|
|
30
30
|
import { useNodeValidation as B } from "../d-flow-validation/DNodeValidation.hook.js";
|
|
31
31
|
import { FileTabsService as E } from "../file-tabs/FileTabs.service.js";
|
|
32
32
|
import { DFlowInputDefault as J } from "../d-flow-input/DFlowInputDefault.js";
|
|
33
|
-
const ve = (
|
|
33
|
+
const ve = (D) => {
|
|
34
34
|
const {
|
|
35
35
|
node: o,
|
|
36
36
|
flowId: a
|
|
37
|
-
} =
|
|
37
|
+
} = D, N = p(g), w = S(g), u = p(V), I = S(V), h = p(E), f = B(o.id, a), d = r.useRef(/* @__PURE__ */ new Set()), [, b] = r.useTransition(), v = r.useMemo(() => N.getById(o.functionDefinition?.id), [w]), F = r.useMemo(() => {
|
|
38
38
|
const t = {};
|
|
39
39
|
return v?.parameterDefinitions?.forEach((e) => {
|
|
40
40
|
t[e.id] = e;
|
|
41
41
|
}), t;
|
|
42
|
-
}, [v]), s = r.useMemo(() => [...o.parameters?.nodes || []].sort((t, e) => t.id.localeCompare(e?.id)), [o]),
|
|
42
|
+
}, [v]), s = r.useMemo(() => [...o.parameters?.nodes || []].sort((t, e) => t.id.localeCompare(e?.id)), [o]), _ = r.useMemo(() => {
|
|
43
43
|
const t = {};
|
|
44
44
|
return s.forEach((e) => {
|
|
45
|
-
t[e?.id] = e?.value?.__typename === "LiteralValue" ? typeof e.value?.value == "object" ? JSON.stringify(e.value?.value) : e.value.value : JSON.stringify(e?.value);
|
|
45
|
+
t[e?.id] = e?.value?.__typename === "LiteralValue" ? typeof e.value?.value == "object" && e.value?.value != null ? JSON.stringify(e.value?.value) : e.value.value : e?.value != null ? JSON.stringify(e?.value) : e?.value;
|
|
46
46
|
}), t;
|
|
47
47
|
}, [s]), P = r.useMemo(() => {
|
|
48
48
|
const t = {};
|
|
49
49
|
return s.forEach((e) => {
|
|
50
|
-
t[e?.id] = (
|
|
50
|
+
t[e?.id] = (c) => {
|
|
51
51
|
const n = f?.find((i) => i.parameterId === e?.id);
|
|
52
52
|
return n ? n.message[0]?.content || "Invalid value" : null;
|
|
53
53
|
};
|
|
54
54
|
}), t;
|
|
55
55
|
}, [s, f]), x = r.useCallback((t) => {
|
|
56
|
-
|
|
56
|
+
b(async () => {
|
|
57
57
|
for (const e of s) {
|
|
58
|
-
if (!
|
|
59
|
-
const
|
|
60
|
-
n && n.__typename === "NodeFunctionIdWrapper" && n.id &&
|
|
61
|
-
y.id &&
|
|
62
|
-
}), (!i || !
|
|
58
|
+
if (!d.current.has(e?.id)) continue;
|
|
59
|
+
const c = t[e?.id], n = e?.value, i = c?.[0]?.value;
|
|
60
|
+
n && n.__typename === "NodeFunctionIdWrapper" && n.id && u.getLinkedNodesById(a, n.id).reverse().forEach((y) => {
|
|
61
|
+
y.id && h.deleteById(y.id);
|
|
62
|
+
}), (!i || !c) && await u.setParameterValue(a, o.id, e.id, void 0);
|
|
63
63
|
try {
|
|
64
|
-
const
|
|
64
|
+
const l = Number.isNaN(Number(i)) ? JSON.parse(String(i)) : String(i);
|
|
65
65
|
if (!i?.__typename) {
|
|
66
|
-
await
|
|
66
|
+
await u.setParameterValue(a, o.id, e.id, i ? {
|
|
67
67
|
__typename: "LiteralValue",
|
|
68
|
-
value:
|
|
68
|
+
value: l ?? String(l)
|
|
69
69
|
} : void 0);
|
|
70
70
|
continue;
|
|
71
71
|
}
|
|
72
72
|
} catch {
|
|
73
73
|
if (!i?.__typename) {
|
|
74
|
-
await
|
|
74
|
+
await u.setParameterValue(a, o.id, e.id, i ? {
|
|
75
75
|
__typename: "LiteralValue",
|
|
76
76
|
value: i
|
|
77
77
|
} : void 0);
|
|
78
78
|
continue;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
await
|
|
81
|
+
await u.setParameterValue(a, o.id, e.id, i.__typename === "LiteralValue" ? i.value ? i : void 0 : i);
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
d.current.clear();
|
|
84
84
|
});
|
|
85
|
-
}, [
|
|
86
|
-
initialValues:
|
|
85
|
+
}, [I, s]), [T, L] = M({
|
|
86
|
+
initialValues: _,
|
|
87
87
|
validate: P,
|
|
88
88
|
truthyValidationBeforeSubmit: !1,
|
|
89
89
|
onSubmit: x
|
|
@@ -93,9 +93,9 @@ const ve = (g) => {
|
|
|
93
93
|
flexDirection: "column"
|
|
94
94
|
}, children: s.map((t) => {
|
|
95
95
|
if (!t) return null;
|
|
96
|
-
const e =
|
|
97
|
-
return /* @__PURE__ */ m("div", { children: /* @__PURE__ */ m(J, { flowId: a, nodeId: o.id, parameterId: t.id, title:
|
|
98
|
-
|
|
96
|
+
const e = F[t?.parameterDefinition?.id], c = e?.names ? e?.names[0]?.content : e?.id, n = e?.descriptions ? e?.descriptions[0]?.content : JSON.stringify(e?.dataTypeIdentifier);
|
|
97
|
+
return /* @__PURE__ */ m("div", { children: /* @__PURE__ */ m(J, { flowId: a, nodeId: o.id, parameterId: t.id, title: c, description: n, clearable: !0, onChange: () => {
|
|
98
|
+
d.current.add(t.id), L();
|
|
99
99
|
}, ...T.getInputProps(t.id) }) });
|
|
100
100
|
}) });
|
|
101
101
|
};
|
|
@@ -31,3 +31,6 @@ export interface DFlowFolderItemProps extends DFlowFolderProps, Omit<Code0Compon
|
|
|
31
31
|
export declare const DFlowFolder: React.ForwardRefExoticComponent<DFlowFolderProps & React.RefAttributes<DFlowFolderHandle>>;
|
|
32
32
|
export declare const DFlowFolderGroup: React.FC<DFlowFolderGroupProps>;
|
|
33
33
|
export declare const DFlowFolderItem: React.FC<DFlowFolderItemProps>;
|
|
34
|
+
type TruncateMode = "start" | "middle" | "end";
|
|
35
|
+
export declare function truncateText(value: string, wrapperWidth: number, mode?: TruncateMode, ellipsis?: string): string;
|
|
36
|
+
export {};
|