@code0-tech/pictor 0.0.0-mvp.28 → 0.0.0-mvp.29
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/components/context-menu/ContextMenu.js +8 -8
- package/dist/components/d-flow/DFlow.d.ts +3 -1
- package/dist/components/d-flow/DFlow.edges.hook.d.ts +2 -2
- package/dist/components/d-flow/DFlow.edges.hook.js +10 -10
- package/dist/components/d-flow/DFlow.js +220 -218
- package/dist/components/d-flow/DFlow.nodes.hook.d.ts +2 -2
- package/dist/components/d-flow/DFlow.nodes.hook.js +66 -63
- package/dist/components/d-flow/DFlow.service.d.ts +7 -3
- package/dist/components/d-flow/DFlow.service.js +2 -2
- package/dist/components/d-flow-data-type/DFlowDataType.service.d.ts +11 -6
- package/dist/components/d-flow-data-type/DFlowDataType.service.js +34 -34
- package/dist/components/d-flow-file/DFlowTabs.d.ts +3 -1
- package/dist/components/d-flow-file/DFlowTabs.js +29 -24
- package/dist/components/d-flow-folder/DFlowFolder.d.ts +16 -8
- package/dist/components/d-flow-folder/DFlowFolder.js +144 -121
- package/dist/components/d-flow-folder/DFlowFolderContextMenu.d.ts +2 -2
- package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +31 -62
- package/dist/components/d-flow-folder/DFlowFolderCreateDialog.d.ts +2 -2
- package/dist/components/d-flow-folder/DFlowFolderDeleteDialog.d.ts +10 -0
- package/dist/components/d-flow-folder/DFlowFolderDeleteDialog.js +55 -0
- package/dist/components/d-flow-folder/DFlowFolderRenameDialog.d.ts +3 -2
- package/dist/components/d-flow-folder/DFlowFolderRenameDialog.js +16 -16
- package/dist/components/d-flow-folder/index.d.ts +3 -0
- package/dist/components/d-flow-folder/index.js +10 -4
- package/dist/components/d-flow-function/DFlowFunction.service.d.ts +8 -3
- package/dist/components/d-flow-function/DFlowFunction.service.js +5 -5
- package/dist/components/d-flow-panel/DFlowPanelLayout.js +14 -14
- package/dist/components/d-flow-type/DFlowType.service.d.ts +8 -3
- package/dist/components/d-flow-type/DFlowType.service.js +5 -5
- package/dist/index.js +221 -215
- package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +8 -8
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +4 -4
- package/package.json +1 -2
|
@@ -1,158 +1,181 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsxs as k, Fragment as R, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as T } from "../../_virtual/compiler-runtime.js";
|
|
3
3
|
import '../../assets/components/d-flow-folder/DFlowFolder.style.css';/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import { useService as
|
|
6
|
-
import { mergeCode0Props as
|
|
7
|
-
import { IconFolderOpen as
|
|
4
|
+
import p from "react";
|
|
5
|
+
import { useService as E, useStore as H } from "../../utils/contextStore.js";
|
|
6
|
+
import { mergeCode0Props as j } from "../../utils/utils.js";
|
|
7
|
+
import { IconFolderOpen as N, IconFolderFilled as G, IconDots as V, IconChevronDown as q, IconChevronRight as J, IconFile as K } from "@tabler/icons-react";
|
|
8
8
|
import "../d-flow/DFlow.js";
|
|
9
|
-
import { DFlowReactiveService as
|
|
9
|
+
import { DFlowReactiveService as A } from "../d-flow/DFlow.service.js";
|
|
10
10
|
import "../d-flow-data-type/rules/DFlowDataTypeRegexRule.js";
|
|
11
11
|
import "../d-flow-data-type/rules/DFlowDataTypeNumberRangeRule.js";
|
|
12
12
|
import "../d-flow-data-type/rules/DFlowDataTypeItemOfCollectionRule.js";
|
|
13
13
|
import "../d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js";
|
|
14
14
|
import "../d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js";
|
|
15
15
|
import "../d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js";
|
|
16
|
-
import "js-md5";
|
|
17
|
-
import { ScrollArea as
|
|
18
|
-
import { Flex as
|
|
19
|
-
import { Text as
|
|
20
|
-
import { Button as
|
|
21
|
-
import { DFlowFolderContextMenu as
|
|
22
|
-
const
|
|
16
|
+
import { md5 as L } from "js-md5";
|
|
17
|
+
import { ScrollArea as Q, ScrollAreaViewport as U, ScrollAreaScrollbar as W, ScrollAreaThumb as X } from "../scroll-area/ScrollArea.js";
|
|
18
|
+
import { Flex as z } from "../flex/Flex.js";
|
|
19
|
+
import { Text as P } from "../text/Text.js";
|
|
20
|
+
import { Button as M } from "../button/Button.js";
|
|
21
|
+
import { DFlowFolderContextMenu as B } from "./DFlowFolderContextMenu.js";
|
|
22
|
+
const be = p.forwardRef((h, e) => {
|
|
23
23
|
const {
|
|
24
|
-
activeFlowId:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
activeFlowId: i,
|
|
25
|
+
namespaceId: _,
|
|
26
|
+
projectId: S
|
|
27
|
+
} = h, $ = E(A), u = H(A), v = (l) => l.replace(/^\/+|\/+$/g, "").split("/").filter(Boolean), o = p.useMemo(() => ($.values?.({
|
|
28
|
+
namespaceId: _,
|
|
29
|
+
projectId: S
|
|
30
|
+
}) ?? []).filter((n) => !!n?.name), [u]), b = p.useMemo(() => {
|
|
31
|
+
const l = o.find((n) => n.id === i);
|
|
32
|
+
return l?.name ? v(l.name) : [];
|
|
33
|
+
}, [o, i]), D = p.useMemo(() => {
|
|
29
34
|
const l = {
|
|
30
35
|
name: "",
|
|
31
36
|
path: "",
|
|
32
37
|
children: {}
|
|
33
38
|
};
|
|
34
|
-
for (const
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
39
|
+
for (const n of o) {
|
|
40
|
+
const w = v(n.name);
|
|
41
|
+
if (w.length === 0) continue;
|
|
37
42
|
let r = l, t = "";
|
|
38
|
-
for (let
|
|
39
|
-
const
|
|
40
|
-
t = t ? `${t}/${
|
|
41
|
-
name:
|
|
43
|
+
for (let O = 0; O < w.length; O++) {
|
|
44
|
+
const x = w[O];
|
|
45
|
+
t = t ? `${t}/${x}` : x, O === w.length - 1 ? r.children[x] ? r.children[x].flow = n : r.children[x] = {
|
|
46
|
+
name: x,
|
|
42
47
|
path: t,
|
|
43
48
|
children: {},
|
|
44
|
-
flow:
|
|
45
|
-
} : (r.children[
|
|
46
|
-
name:
|
|
49
|
+
flow: n
|
|
50
|
+
} : (r.children[x] || (r.children[x] = {
|
|
51
|
+
name: x,
|
|
47
52
|
path: t,
|
|
48
53
|
children: {}
|
|
49
|
-
}), r = r.children[
|
|
54
|
+
}), r = r.children[x]);
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
57
|
return l;
|
|
53
|
-
}, [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
}, [o]), a = p.useCallback((l) => l ? l.split("/").filter(Boolean).every((w, r) => b[r] === w) : !1, [b]), [s, m] = p.useState("default"), [C, g] = p.useState(0), d = p.useCallback(() => {
|
|
59
|
+
m("allOpen"), g((l) => l + 1);
|
|
60
|
+
}, []), f = p.useCallback(() => {
|
|
61
|
+
m("allClosed"), g((l) => l + 1);
|
|
62
|
+
}, []), I = p.useCallback(() => {
|
|
63
|
+
m("activePath"), g((l) => l + 1);
|
|
64
|
+
}, []);
|
|
65
|
+
p.useImperativeHandle(e, () => ({
|
|
66
|
+
openAll: d,
|
|
67
|
+
closeAll: f,
|
|
68
|
+
openActivePath: I
|
|
69
|
+
}), [d, f, I]);
|
|
70
|
+
const y = p.useCallback((l) => s === "allOpen" ? !0 : s === "allClosed" ? !1 : a(l), [a, s]), F = p.useCallback((l) => {
|
|
71
|
+
const n = Object.values(l), w = n.filter((t) => !t.flow), r = n.filter((t) => !!t.flow);
|
|
72
|
+
return w.sort((t, O) => t.name.localeCompare(O.name)), r.sort((t, O) => t.name.localeCompare(O.name)), /* @__PURE__ */ k(R, { children: [
|
|
73
|
+
w.map((t) => /* @__PURE__ */ c(Y, { name: t.name, flows: Object.values(t.children).map((O) => O.flow), defaultOpen: y(t.path), ...h, children: F(t.children) }, `${t.path}-${C}`)),
|
|
74
|
+
r.map((t) => /* @__PURE__ */ c(Z, { name: t.name, path: t.path, flow: t.flow, active: t.flow.id === i, "data-flow-id": t.flow.id ?? void 0, ...h }, t.flow.id ?? t.path))
|
|
58
75
|
] });
|
|
59
|
-
}, [
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
76
|
+
}, [i, y, C]);
|
|
77
|
+
return /* @__PURE__ */ k(Q, { h: "100%", children: [
|
|
78
|
+
/* @__PURE__ */ c(U, { children: /* @__PURE__ */ c("div", { className: "d-folder__root", children: F(D.children) }) }),
|
|
79
|
+
/* @__PURE__ */ c(W, { orientation: "vertical", children: /* @__PURE__ */ c(X, {}) })
|
|
63
80
|
] });
|
|
64
|
-
},
|
|
65
|
-
const e =
|
|
66
|
-
name:
|
|
67
|
-
flows:
|
|
68
|
-
defaultOpen:
|
|
69
|
-
children:
|
|
70
|
-
...
|
|
71
|
-
} =
|
|
72
|
-
let
|
|
73
|
-
e[0] !==
|
|
74
|
-
name:
|
|
75
|
-
|
|
76
|
-
type: "
|
|
77
|
-
}, e[0] =
|
|
81
|
+
}), Y = (h) => {
|
|
82
|
+
const e = T.c(31), {
|
|
83
|
+
name: i,
|
|
84
|
+
flows: _,
|
|
85
|
+
defaultOpen: S,
|
|
86
|
+
children: $,
|
|
87
|
+
...u
|
|
88
|
+
} = h, v = S === void 0 ? !1 : S, [o, b] = p.useState(v), D = B;
|
|
89
|
+
let a;
|
|
90
|
+
e[0] !== _ || e[1] !== i ? (a = {
|
|
91
|
+
name: i,
|
|
92
|
+
flow: _,
|
|
93
|
+
type: "folder"
|
|
94
|
+
}, e[0] = _, e[1] = i, e[2] = a) : a = e[2];
|
|
78
95
|
let s;
|
|
79
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = () =>
|
|
80
|
-
const
|
|
81
|
-
let
|
|
82
|
-
e[4] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
96
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = () => b(ee), e[3] = s) : s = e[3];
|
|
97
|
+
const m = j("d-folder", u);
|
|
98
|
+
let C;
|
|
99
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (C = {
|
|
83
100
|
gap: "0.35rem"
|
|
84
|
-
}, e[4] =
|
|
85
|
-
let
|
|
86
|
-
e[5] !==
|
|
87
|
-
let
|
|
88
|
-
e[7] !==
|
|
89
|
-
let
|
|
90
|
-
e[9] !==
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
] }), e[9] =
|
|
94
|
-
let
|
|
95
|
-
e[12] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
101
|
+
}, e[4] = C) : C = e[4];
|
|
102
|
+
let g;
|
|
103
|
+
e[5] !== o ? (g = o ? /* @__PURE__ */ c(N, { size: 12 }) : /* @__PURE__ */ c(G, { size: 12 }), e[5] = o, e[6] = g) : g = e[6];
|
|
104
|
+
let d;
|
|
105
|
+
e[7] !== i ? (d = /* @__PURE__ */ c(P, { children: i }), e[7] = i, e[8] = d) : d = e[8];
|
|
106
|
+
let f;
|
|
107
|
+
e[9] !== g || e[10] !== d ? (f = /* @__PURE__ */ k(z, { align: "center", style: C, children: [
|
|
108
|
+
g,
|
|
109
|
+
d
|
|
110
|
+
] }), e[9] = g, e[10] = d, e[11] = f) : f = e[11];
|
|
111
|
+
let I;
|
|
112
|
+
e[12] === Symbol.for("react.memo_cache_sentinel") ? (I = {
|
|
96
113
|
gap: "0.35rem"
|
|
97
|
-
}, e[12] =
|
|
98
|
-
let
|
|
99
|
-
e[13] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
100
|
-
let S;
|
|
101
|
-
e[14] !== a ? (S = /* @__PURE__ */ g($, { align: "center", style: y, children: [
|
|
102
|
-
D,
|
|
103
|
-
/* @__PURE__ */ n(A, { p: "0", variant: "none", children: a ? /* @__PURE__ */ n(V, { size: 12 }) : /* @__PURE__ */ n(q, { size: 12 }) })
|
|
104
|
-
] }), e[14] = a, e[15] = S) : S = e[15];
|
|
114
|
+
}, e[12] = I) : I = e[12];
|
|
115
|
+
let y;
|
|
116
|
+
e[13] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ c(M, { p: "0", variant: "none", children: /* @__PURE__ */ c(V, { size: 12 }) }), e[13] = y) : y = e[13];
|
|
105
117
|
let F;
|
|
106
|
-
e[
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
] }), e[
|
|
110
|
-
let
|
|
111
|
-
e[
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
e[
|
|
115
|
-
let
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
118
|
+
e[14] !== o ? (F = /* @__PURE__ */ k(z, { align: "center", style: I, children: [
|
|
119
|
+
y,
|
|
120
|
+
/* @__PURE__ */ c(M, { p: "0", variant: "none", children: o ? /* @__PURE__ */ c(q, { size: 12 }) : /* @__PURE__ */ c(J, { size: 12 }) })
|
|
121
|
+
] }), e[14] = o, e[15] = F) : F = e[15];
|
|
122
|
+
let l;
|
|
123
|
+
e[16] !== F || e[17] !== s || e[18] !== m || e[19] !== f ? (l = /* @__PURE__ */ k("div", { onClick: s, ...m, children: [
|
|
124
|
+
f,
|
|
125
|
+
F
|
|
126
|
+
] }), e[16] = F, e[17] = s, e[18] = m, e[19] = f, e[20] = l) : l = e[20];
|
|
127
|
+
let n;
|
|
128
|
+
e[21] !== D || e[22] !== u || e[23] !== a || e[24] !== l ? (n = /* @__PURE__ */ c(D, { contextData: a, ...u, children: l }), e[21] = D, e[22] = u, e[23] = a, e[24] = l, e[25] = n) : n = e[25];
|
|
129
|
+
const w = o ? $ : null;
|
|
130
|
+
let r;
|
|
131
|
+
e[26] !== w ? (r = /* @__PURE__ */ c("div", { className: "d-folder__content", children: w }), e[26] = w, e[27] = r) : r = e[27];
|
|
132
|
+
let t;
|
|
133
|
+
return e[28] !== n || e[29] !== r ? (t = /* @__PURE__ */ k(R, { children: [
|
|
134
|
+
n,
|
|
135
|
+
r
|
|
136
|
+
] }), e[28] = n, e[29] = r, e[30] = t) : t = e[30], t;
|
|
137
|
+
}, Z = (h) => {
|
|
138
|
+
const e = T.c(30);
|
|
139
|
+
let i, _, S, $, u, v, o, b;
|
|
140
|
+
if (e[0] !== h) {
|
|
124
141
|
const {
|
|
125
|
-
name:
|
|
126
|
-
path:
|
|
127
|
-
flow:
|
|
128
|
-
|
|
129
|
-
active:
|
|
130
|
-
...
|
|
131
|
-
} =
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
142
|
+
name: g,
|
|
143
|
+
path: d,
|
|
144
|
+
flow: f,
|
|
145
|
+
onSelect: I,
|
|
146
|
+
active: y,
|
|
147
|
+
...F
|
|
148
|
+
} = h;
|
|
149
|
+
S = g;
|
|
150
|
+
const l = L(d + S), n = te;
|
|
151
|
+
_ = B, e[9] !== f || e[10] !== d ? (o = {
|
|
152
|
+
name: d,
|
|
153
|
+
flow: f,
|
|
135
154
|
type: "item"
|
|
136
|
-
}, e[
|
|
155
|
+
}, e[9] = f, e[10] = d, e[11] = o) : o = e[11], b = F, u = j(`d-folder__item ${y ? "d-folder__item--active" : ""}`, F), e[12] !== f || e[13] !== I ? (v = () => I?.(f), e[12] = f, e[13] = I, e[14] = v) : v = e[14], i = K, $ = n(l), e[0] = h, e[1] = i, e[2] = _, e[3] = S, e[4] = $, e[5] = u, e[6] = v, e[7] = o, e[8] = b;
|
|
137
156
|
} else
|
|
138
|
-
|
|
157
|
+
i = e[1], _ = e[2], S = e[3], $ = e[4], u = e[5], v = e[6], o = e[7], b = e[8];
|
|
158
|
+
const D = `hsl(${$}, 100%, 72%)`;
|
|
139
159
|
let a;
|
|
140
|
-
e[
|
|
141
|
-
let
|
|
142
|
-
e[
|
|
143
|
-
let
|
|
144
|
-
e[
|
|
160
|
+
e[15] !== i || e[16] !== D ? (a = /* @__PURE__ */ c(i, { color: D, size: 12 }), e[15] = i, e[16] = D, e[17] = a) : a = e[17];
|
|
161
|
+
let s;
|
|
162
|
+
e[18] !== S ? (s = /* @__PURE__ */ c(P, { children: S }), e[18] = S, e[19] = s) : s = e[19];
|
|
163
|
+
let m;
|
|
164
|
+
e[20] !== u || e[21] !== v || e[22] !== a || e[23] !== s ? (m = /* @__PURE__ */ k("div", { ...u, onClick: v, children: [
|
|
145
165
|
a,
|
|
146
|
-
|
|
147
|
-
] }), e[
|
|
148
|
-
let
|
|
149
|
-
return e[
|
|
166
|
+
s
|
|
167
|
+
] }), e[20] = u, e[21] = v, e[22] = a, e[23] = s, e[24] = m) : m = e[24];
|
|
168
|
+
let C;
|
|
169
|
+
return e[25] !== _ || e[26] !== o || e[27] !== b || e[28] !== m ? (C = /* @__PURE__ */ c(_, { contextData: o, ...b, children: m }), e[25] = _, e[26] = o, e[27] = b, e[28] = m, e[29] = C) : C = e[29], C;
|
|
150
170
|
};
|
|
151
|
-
function
|
|
152
|
-
return !
|
|
171
|
+
function ee(h) {
|
|
172
|
+
return !h;
|
|
173
|
+
}
|
|
174
|
+
function te(h) {
|
|
175
|
+
return parseInt(h.slice(0, 8), 16) % 360;
|
|
153
176
|
}
|
|
154
177
|
export {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
178
|
+
be as DFlowFolder,
|
|
179
|
+
Y as DFlowFolderGroup,
|
|
180
|
+
Z as DFlowFolderItem
|
|
158
181
|
};
|
|
@@ -3,8 +3,8 @@ import { default as React } from 'react';
|
|
|
3
3
|
import { Flow } from '@code0-tech/sagittarius-graphql-types';
|
|
4
4
|
export interface DFlowFolderContextMenuGroupData {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
7
|
-
type: "
|
|
6
|
+
flow: Flow[];
|
|
7
|
+
type: "folder";
|
|
8
8
|
}
|
|
9
9
|
export interface DFlowFolderContextMenuItemData {
|
|
10
10
|
name: string;
|
|
@@ -1,69 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { ContextMenu as
|
|
4
|
-
import { Flex as
|
|
5
|
-
import { Text as
|
|
6
|
-
import { IconChevronRight as
|
|
7
|
-
import {
|
|
8
|
-
import { Badge as P } from "../badge/Badge.js";
|
|
9
|
-
import { Button as s } from "../button/Button.js";
|
|
10
|
-
import { useService as _, useStore as Y } from "../../utils/contextStore.js";
|
|
1
|
+
import { jsx as e, Fragment as a, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import h from "react";
|
|
3
|
+
import { ContextMenu as s, ContextMenuTrigger as x, ContextMenuPortal as C, ContextMenuContent as S, ContextMenuSub as f, ContextMenuSubTrigger as M, ContextMenuSubContent as g, ContextMenuItem as r, ContextMenuSeparator as p } from "../context-menu/ContextMenu.js";
|
|
4
|
+
import { Flex as v } from "../flex/Flex.js";
|
|
5
|
+
import { Text as i } from "../text/Text.js";
|
|
6
|
+
import { IconChevronRight as w, IconEdit as D, IconTrash as F } from "@tabler/icons-react";
|
|
7
|
+
import { useService as R, useStore as T } from "../../utils/contextStore.js";
|
|
11
8
|
import "merge-props";
|
|
12
|
-
import { DFlowTypeReactiveService as
|
|
13
|
-
|
|
14
|
-
import { DFlowFolderCreateDialog as G } from "./DFlowFolderCreateDialog.js";
|
|
15
|
-
const ne = (t) => {
|
|
9
|
+
import { DFlowTypeReactiveService as c } from "../d-flow-type/DFlowType.service.js";
|
|
10
|
+
const k = (t) => {
|
|
16
11
|
const {
|
|
17
|
-
children:
|
|
18
|
-
} = t,
|
|
19
|
-
return /* @__PURE__ */ n(
|
|
20
|
-
/* @__PURE__ */ e(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
" ",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
12
|
+
children: l
|
|
13
|
+
} = t, d = R(c), m = T(c), u = h.useMemo(() => d.values(), [m]);
|
|
14
|
+
return /* @__PURE__ */ e(a, { children: /* @__PURE__ */ n(s, { children: [
|
|
15
|
+
/* @__PURE__ */ e(x, { asChild: !0, children: l }),
|
|
16
|
+
/* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(S, { children: /* @__PURE__ */ n(f, { children: [
|
|
17
|
+
/* @__PURE__ */ e(M, { children: /* @__PURE__ */ n(v, { align: "center", justify: "space-between", w: "100%", children: [
|
|
18
|
+
/* @__PURE__ */ e(i, { children: "New flow" }),
|
|
19
|
+
/* @__PURE__ */ e(w, { size: 12 })
|
|
20
|
+
] }) }),
|
|
21
|
+
/* @__PURE__ */ e(g, { children: u.map((o) => /* @__PURE__ */ e(r, { onSelect: () => {
|
|
22
|
+
t.onCreate?.(o.id);
|
|
23
|
+
}, children: o.names?.nodes[0]?.content ?? o.id }, o.id)) }),
|
|
24
|
+
/* @__PURE__ */ e(p, {}),
|
|
25
|
+
/* @__PURE__ */ n(r, { onSelect: () => t.onRename?.(t.contextData), children: [
|
|
26
|
+
/* @__PURE__ */ e(D, { size: 12, color: "purple" }),
|
|
27
|
+
/* @__PURE__ */ e(i, { children: "Rename" })
|
|
32
28
|
] }),
|
|
33
|
-
/* @__PURE__ */ n(
|
|
34
|
-
/* @__PURE__ */ e(
|
|
35
|
-
/* @__PURE__ */ e(
|
|
36
|
-
t.contextData.type === "item" ? t.onDelete?.(t.contextData.flow) : t.contextData.type === "group" && t.contextData.flows.forEach((o) => {
|
|
37
|
-
t.onDelete?.(o);
|
|
38
|
-
});
|
|
39
|
-
}, children: "Yes, remove!" }) })
|
|
29
|
+
/* @__PURE__ */ n(r, { onSelect: () => t.onDelete?.(t.contextData), children: [
|
|
30
|
+
/* @__PURE__ */ e(F, { size: 12, color: "red" }),
|
|
31
|
+
/* @__PURE__ */ e(i, { children: "Delete" })
|
|
40
32
|
] })
|
|
41
|
-
] }) }) })
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */ e(G, { flowTypeId: y, onOpenChange: (o) => d(o), open: w, ...t }),
|
|
44
|
-
/* @__PURE__ */ n(F, { children: [
|
|
45
|
-
/* @__PURE__ */ e(M, { asChild: !0, children: f }),
|
|
46
|
-
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(R, { children: /* @__PURE__ */ n(b, { children: [
|
|
47
|
-
/* @__PURE__ */ e(T, { children: /* @__PURE__ */ n(u, { align: "center", justify: "space-between", w: "100%", children: [
|
|
48
|
-
/* @__PURE__ */ e(l, { children: "New flow" }),
|
|
49
|
-
/* @__PURE__ */ e(z, { size: 12 })
|
|
50
|
-
] }) }),
|
|
51
|
-
/* @__PURE__ */ e(I, { children: C.map((o) => /* @__PURE__ */ e(i, { onSelect: () => {
|
|
52
|
-
S(o.id), d(!0);
|
|
53
|
-
}, children: o.names?.nodes[0]?.content ?? o.id }, o.id)) }),
|
|
54
|
-
/* @__PURE__ */ e(j, {}),
|
|
55
|
-
/* @__PURE__ */ n(i, { onSelect: () => c(!0), children: [
|
|
56
|
-
/* @__PURE__ */ e(B, { size: 12, color: "purple" }),
|
|
57
|
-
/* @__PURE__ */ e(l, { children: "Rename" })
|
|
58
|
-
] }),
|
|
59
|
-
/* @__PURE__ */ n(i, { onSelect: () => a(!0), children: [
|
|
60
|
-
/* @__PURE__ */ e(k, { size: 12, color: "red" }),
|
|
61
|
-
/* @__PURE__ */ e(l, { children: "Delete" })
|
|
62
|
-
] })
|
|
63
|
-
] }) }) })
|
|
64
|
-
] })
|
|
65
|
-
] });
|
|
33
|
+
] }) }) })
|
|
34
|
+
] }) });
|
|
66
35
|
};
|
|
67
36
|
export {
|
|
68
|
-
|
|
37
|
+
k as DFlowFolderContextMenu
|
|
69
38
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DFlowFolderProps } from './DFlowFolder';
|
|
2
1
|
import { default as React } from 'react';
|
|
3
2
|
import { FlowType } from '@code0-tech/sagittarius-graphql-types';
|
|
4
|
-
export interface DFlowFolderCreateDialogProps
|
|
3
|
+
export interface DFlowFolderCreateDialogProps {
|
|
5
4
|
open?: boolean;
|
|
6
5
|
onOpenChange?: (open: boolean) => void;
|
|
7
6
|
flowTypeId: FlowType['id'];
|
|
7
|
+
onCreate?: (name: string, type: FlowType['id']) => void;
|
|
8
8
|
}
|
|
9
9
|
export declare const DFlowFolderCreateDialog: React.FC<DFlowFolderCreateDialogProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DFlowFolderContextMenuGroupData, DFlowFolderContextMenuItemData } from './DFlowFolderContextMenu';
|
|
3
|
+
import { Flow } from '@code0-tech/sagittarius-graphql-types';
|
|
4
|
+
export interface DFlowFolderDeleteDialogProps {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
contextData: DFlowFolderContextMenuGroupData | DFlowFolderContextMenuItemData;
|
|
8
|
+
onDelete?: (flow: Flow) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const DFlowFolderDeleteDialog: React.FC<DFlowFolderDeleteDialogProps>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as o, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import { c as b } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import { DialogClose as x, DialogPortal as v, DialogContent as j, Dialog as F } from "../dialog/Dialog.js";
|
|
4
|
+
import { Text as g } from "../text/Text.js";
|
|
5
|
+
import { Badge as R } from "../badge/Badge.js";
|
|
6
|
+
import { Flex as S } from "../flex/Flex.js";
|
|
7
|
+
import { Button as w } from "../button/Button.js";
|
|
8
|
+
import B from "react";
|
|
9
|
+
const Y = (t) => {
|
|
10
|
+
const e = b.c(18), {
|
|
11
|
+
open: _
|
|
12
|
+
} = t, [s, C] = B.useState(_);
|
|
13
|
+
let a;
|
|
14
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = (u) => C(u), e[0] = a) : a = e[0];
|
|
15
|
+
const d = t.contextData.type == "item" ? "Remove flow" : "Remove folder", h = t.contextData.type == "item" ? "Are you sure you want to remove flow" : "Are you sure you want to remove folder";
|
|
16
|
+
let c;
|
|
17
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (c = {
|
|
18
|
+
color: "inherit"
|
|
19
|
+
}, e[1] = c) : c = e[1];
|
|
20
|
+
let l;
|
|
21
|
+
e[2] !== t.contextData.name ? (l = /* @__PURE__ */ o(R, { color: "info", children: /* @__PURE__ */ o(g, { size: "md", style: c, children: t.contextData.name }) }), e[2] = t.contextData.name, e[3] = l) : l = e[3];
|
|
22
|
+
const D = t.contextData.type == "folder" ? ", all flows and sub-folders inside " : "";
|
|
23
|
+
let n;
|
|
24
|
+
e[4] !== h || e[5] !== l || e[6] !== D ? (n = /* @__PURE__ */ y(g, { size: "md", hierarchy: "secondary", children: [
|
|
25
|
+
h,
|
|
26
|
+
" ",
|
|
27
|
+
" ",
|
|
28
|
+
l,
|
|
29
|
+
" ",
|
|
30
|
+
" ",
|
|
31
|
+
D,
|
|
32
|
+
"from the this project?"
|
|
33
|
+
] }), e[4] = h, e[5] = l, e[6] = D, e[7] = n) : n = e[7];
|
|
34
|
+
let m;
|
|
35
|
+
e[8] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ o(x, { asChild: !0, children: /* @__PURE__ */ o(w, { color: "secondary", children: "No, go back!" }) }), e[8] = m) : m = e[8];
|
|
36
|
+
let i;
|
|
37
|
+
e[9] !== t ? (i = /* @__PURE__ */ y(S, { justify: "space-between", align: "center", children: [
|
|
38
|
+
m,
|
|
39
|
+
/* @__PURE__ */ o(x, { asChild: !0, children: /* @__PURE__ */ o(w, { color: "error", onClick: () => {
|
|
40
|
+
t.contextData.type === "item" ? t.onDelete?.(t.contextData.flow) : t.contextData.type === "folder" && t.contextData.flow.forEach((u) => {
|
|
41
|
+
t.onDelete?.(u);
|
|
42
|
+
});
|
|
43
|
+
}, children: "Yes, remove!" }) })
|
|
44
|
+
] }), e[9] = t, e[10] = i) : i = e[10];
|
|
45
|
+
let r;
|
|
46
|
+
e[11] !== d || e[12] !== n || e[13] !== i ? (r = /* @__PURE__ */ o(v, { children: /* @__PURE__ */ y(j, { autoFocus: !0, showCloseButton: !0, title: d, children: [
|
|
47
|
+
n,
|
|
48
|
+
i
|
|
49
|
+
] }) }), e[11] = d, e[12] = n, e[13] = i, e[14] = r) : r = e[14];
|
|
50
|
+
let f;
|
|
51
|
+
return e[15] !== s || e[16] !== r ? (f = /* @__PURE__ */ o(F, { open: s, onOpenChange: a, children: r }), e[15] = s, e[16] = r, e[17] = f) : f = e[17], f;
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
Y as DFlowFolderDeleteDialog
|
|
55
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { DFlowFolderContextMenuGroupData, DFlowFolderContextMenuItemData } from './DFlowFolderContextMenu';
|
|
3
|
-
import {
|
|
4
|
-
export interface DFlowFolderRenameDialogProps
|
|
3
|
+
import { Flow } from '@code0-tech/sagittarius-graphql-types';
|
|
4
|
+
export interface DFlowFolderRenameDialogProps {
|
|
5
5
|
contextData: DFlowFolderContextMenuGroupData | DFlowFolderContextMenuItemData;
|
|
6
6
|
open?: boolean;
|
|
7
7
|
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
onRename?: (flow: Flow, newName: string) => void;
|
|
8
9
|
}
|
|
9
10
|
export declare const DFlowFolderRenameDialog: React.FC<DFlowFolderRenameDialogProps>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import i from "react";
|
|
3
|
-
import { Dialog as f, DialogPortal as D, DialogContent as g, DialogClose as
|
|
3
|
+
import { Dialog as f, DialogPortal as D, DialogContent as g, DialogClose as m } from "../dialog/Dialog.js";
|
|
4
4
|
import { DFlowFolderItemPathInput as x } from "./DFlowFolderItemPathInput.js";
|
|
5
5
|
import { Flex as w } from "../flex/Flex.js";
|
|
6
|
-
import { Button as
|
|
6
|
+
import { Button as l } from "../button/Button.js";
|
|
7
7
|
import "../../_virtual/compiler-runtime.js";
|
|
8
8
|
import "@radix-ui/react-checkbox";
|
|
9
9
|
import "merge-props";
|
|
@@ -22,31 +22,31 @@ import { useForm as C } from "../form/useForm.js";
|
|
|
22
22
|
const G = (e) => {
|
|
23
23
|
const {
|
|
24
24
|
open: a
|
|
25
|
-
} = e, [
|
|
25
|
+
} = e, [c, h] = i.useState(a), u = i.useMemo(() => ({
|
|
26
26
|
path: e.contextData.name
|
|
27
27
|
}), []);
|
|
28
28
|
i.useEffect(() => {
|
|
29
|
-
|
|
29
|
+
h(a);
|
|
30
30
|
}, [a]);
|
|
31
|
-
const [s,
|
|
32
|
-
initialValues:
|
|
31
|
+
const [s, d] = C({
|
|
32
|
+
initialValues: u,
|
|
33
33
|
validate: {
|
|
34
34
|
path: (o) => null
|
|
35
35
|
},
|
|
36
36
|
onSubmit: (o) => {
|
|
37
|
-
e.contextData.type === "item" ? e.onRename?.(e.contextData.flow, o.path) : e.contextData.type === "
|
|
38
|
-
const
|
|
39
|
-
e.onRename?.(n,
|
|
37
|
+
e.contextData.type === "item" ? e.onRename?.(e.contextData.flow, o.path) : e.contextData.type === "folder" && e.contextData.flow.forEach((n) => {
|
|
38
|
+
const p = n.name?.replace(e.contextData.name, o.path) ?? n.name;
|
|
39
|
+
e.onRename?.(n, p);
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
return /* @__PURE__ */ t(f, { open:
|
|
44
|
-
e.onOpenChange?.(o)
|
|
45
|
-
}, children: /* @__PURE__ */ t(D, { children: /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ t(f, { open: c, onOpenChange: (o) => {
|
|
44
|
+
e.onOpenChange?.(o);
|
|
45
|
+
}, children: /* @__PURE__ */ t(D, { children: /* @__PURE__ */ r(g, { autoFocus: !0, showCloseButton: !0, title: e.contextData.type == "item" ? "Rename flow" : "Rename folder", children: [
|
|
46
46
|
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(x, { description: "You can choose a new name here and only use alphanumeric names.", title: e.contextData.type == "item" ? "Name of the flow" : "Name of the folder", ...s.getInputProps("path") }) }),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */ t(
|
|
49
|
-
/* @__PURE__ */ t(
|
|
47
|
+
/* @__PURE__ */ r(w, { justify: "space-between", align: "center", children: [
|
|
48
|
+
/* @__PURE__ */ t(m, { asChild: !0, children: /* @__PURE__ */ t(l, { color: "secondary", children: "No, go back!" }) }),
|
|
49
|
+
/* @__PURE__ */ t(m, { asChild: !0, children: /* @__PURE__ */ t(l, { color: "success", onClick: d, children: "Yes, save!" }) })
|
|
50
50
|
] })
|
|
51
51
|
] }) }) });
|
|
52
52
|
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { DFlowFolder as
|
|
1
|
+
import { DFlowFolder as l, DFlowFolderGroup as r, DFlowFolderItem as F } from "./DFlowFolder.js";
|
|
2
|
+
import { DFlowFolderDeleteDialog as t } from "./DFlowFolderDeleteDialog.js";
|
|
3
|
+
import { DFlowFolderCreateDialog as m } from "./DFlowFolderCreateDialog.js";
|
|
4
|
+
import { DFlowFolderRenameDialog as a } from "./DFlowFolderRenameDialog.js";
|
|
2
5
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
l as DFlowFolder,
|
|
7
|
+
m as DFlowFolderCreateDialog,
|
|
8
|
+
t as DFlowFolderDeleteDialog,
|
|
9
|
+
r as DFlowFolderGroup,
|
|
10
|
+
F as DFlowFolderItem,
|
|
11
|
+
a as DFlowFolderRenameDialog
|
|
6
12
|
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { ReactiveArrayService } from '../../utils';
|
|
2
2
|
import { FunctionDefinitionView } from './DFlowFunction.view';
|
|
3
|
-
import { FunctionDefinition } from '@code0-tech/sagittarius-graphql-types';
|
|
4
|
-
export
|
|
5
|
-
|
|
3
|
+
import { FunctionDefinition, Namespace, NamespaceProject, Runtime } from '@code0-tech/sagittarius-graphql-types';
|
|
4
|
+
export type DFlowFunctionDependencies = {
|
|
5
|
+
namespaceId: Namespace['id'];
|
|
6
|
+
projectId: NamespaceProject['id'];
|
|
7
|
+
runtimeId: Runtime['id'];
|
|
8
|
+
};
|
|
9
|
+
export declare abstract class DFlowFunctionReactiveService extends ReactiveArrayService<FunctionDefinitionView, DFlowFunctionDependencies> {
|
|
10
|
+
getById(id: FunctionDefinition['id'], dependencies?: DFlowFunctionDependencies): FunctionDefinitionView | undefined;
|
|
6
11
|
}
|