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

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 (75) hide show
  1. package/dist/assets/components/avatar/Avatar.style.css +1 -1
  2. package/dist/components/avatar/Avatar.d.ts +2 -0
  3. package/dist/components/avatar/Avatar.js +46 -48
  4. package/dist/components/d-application/DApplication.service.js +1 -0
  5. package/dist/components/d-flow/DFlow.edges.hook.js +3 -2
  6. package/dist/components/d-flow/DFlow.nodes.hook.js +16 -15
  7. package/dist/components/d-flow/DFlow.service.js +3 -2
  8. package/dist/components/d-flow-data-type/DFlowDataType.service.js +8 -8
  9. package/dist/components/d-flow-file/DFlowTabDefault.js +1 -1
  10. package/dist/components/d-flow-file/DFlowTabTrigger.js +1 -1
  11. package/dist/components/d-flow-file/DFlowTabs.js +1 -1
  12. package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +1 -1
  13. package/dist/components/d-flow-folder/DFlowFolderCreateDialog.js +52 -50
  14. package/dist/components/d-flow-folder/DFlowFolderDeleteDialog.js +43 -38
  15. package/dist/components/d-flow-folder/DFlowFolderItemPathInput.js +3 -2
  16. package/dist/components/d-flow-folder/DFlowFolderRenameDialog.js +26 -22
  17. package/dist/components/d-flow-function/DFlowFunction.service.js +3 -2
  18. package/dist/components/d-flow-input/DFlowInputDataType.js +15 -14
  19. package/dist/components/d-flow-input/DFlowInputDataTypeEditDialog.js +3 -2
  20. package/dist/components/d-flow-input/DFlowInputDefault.js +1 -1
  21. package/dist/components/d-flow-input/DFlowInputNodeBadge.js +1 -1
  22. package/dist/components/d-flow-node/DFlowNode.return.hook.js +1 -1
  23. package/dist/components/d-flow-node/DFlowNodeDefaultCard.js +1 -1
  24. package/dist/components/d-flow-panel/DFlowExport.js +1 -1
  25. package/dist/components/d-flow-panel/DFlowPanelControl.js +1 -1
  26. package/dist/components/d-flow-panel/DFlowPanelUpdate.js +1 -1
  27. package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.js +1 -1
  28. package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.js +1 -1
  29. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +15 -15
  30. package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.js +1 -1
  31. package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +6 -5
  32. package/dist/components/d-flow-suggestion/DFlowSuggestionSearchInput.js +3 -2
  33. package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.js +1 -1
  34. package/dist/components/d-flow-type/DFlowType.service.d.ts +3 -3
  35. package/dist/components/d-flow-type/DFlowType.service.js +3 -2
  36. package/dist/components/d-flow-type/DFlowType.view.d.ts +4 -1
  37. package/dist/components/d-flow-type/DFlowType.view.js +16 -10
  38. package/dist/components/d-flow-validation/DFlowValidation.hook.js +1 -1
  39. package/dist/components/d-flow-validation/DFlowValidation.js +3 -2
  40. package/dist/components/d-flow-validation/DNodeValidation.hook.js +1 -1
  41. package/dist/components/d-license/DNamespaceLicense.service.js +3 -2
  42. package/dist/components/d-member/DNamespaceMember.service.js +1 -0
  43. package/dist/components/d-member/DNamespaceMemberContent.js +3 -2
  44. package/dist/components/d-member/DNamespaceMemberList.js +5 -4
  45. package/dist/components/d-namespace/DNamespace.service.js +3 -2
  46. package/dist/components/d-organization/DOrganization.service.js +3 -2
  47. package/dist/components/d-organization/DOrganizationList.js +7 -6
  48. package/dist/components/d-organization/DOrganizatonContent.js +3 -2
  49. package/dist/components/d-organization/index.js +9 -8
  50. package/dist/components/d-project/DNamespaceProject.service.js +3 -2
  51. package/dist/components/d-project/DNamespaceProjectContent.js +3 -2
  52. package/dist/components/d-project/DNamespaceProjectList.js +3 -2
  53. package/dist/components/d-project/index.js +10 -9
  54. package/dist/components/d-role/DNamespaceRole.service.js +3 -2
  55. package/dist/components/d-role/DNamespaceRoleContent.js +3 -2
  56. package/dist/components/d-role/DNamespaceRoleList.js +6 -5
  57. package/dist/components/d-runtime/DRuntimeContent.js +3 -2
  58. package/dist/components/d-runtime/DRuntimeList.js +3 -2
  59. package/dist/components/d-user/DUser.service.js +3 -2
  60. package/dist/components/d-user/DUserContent.js +6 -5
  61. package/dist/components/d-user/DUserInput.js +3 -2
  62. package/dist/components/d-user/DUserList.js +5 -4
  63. package/dist/components/d-user/DUserMenu.js +5 -4
  64. package/dist/components/d-user/index.js +15 -14
  65. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +8 -8
  66. package/dist/components/form/index.d.ts +1 -0
  67. package/dist/components/form/index.js +25 -23
  68. package/dist/index.js +178 -181
  69. package/dist/node_modules/@lezer/common/dist/index.js +146 -0
  70. package/dist/node_modules/@lezer/highlight/dist/index.js +1 -1
  71. package/dist/utils/generics.js +1 -1
  72. package/dist/utils/index.js +19 -24
  73. package/dist/utils/utils.d.ts +3 -18
  74. package/dist/utils/utils.js +101 -176
  75. package/package.json +12 -11
@@ -1 +1 @@
1
- .avatar{aspect-ratio:1/1;padding:.35rem;display:flex;width:38px;align-items:center;justify-content:center;overflow:hidden}.avatar{background:#191825;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;border-radius:1rem;background:transparent;box-shadow:none}.avatar--image{padding:0}
1
+ .avatar{aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:50%}.avatar{background:#191825;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;background:transparent;box-shadow:none}.avatar--image{padding:0}.avatar--identicon>div>div{--color: inherit;background:#201e2c}.avatar--identicon>div>div>span,.avatar--identicon>div>div>p{color:var(--color)}
@@ -4,5 +4,7 @@ export interface AvatarProps extends Code0Component<HTMLDivElement> {
4
4
  identifier?: string;
5
5
  src?: string;
6
6
  size?: number;
7
+ color?: string;
8
+ type?: 'character' | 'shape';
7
9
  }
8
10
  export declare const Avatar: React.FC<AvatarProps>;
@@ -1,56 +1,54 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { c as p } from "../../_virtual/compiler-runtime.js";
3
- import d from "react";
4
- import { md5 as v } from "js-md5";
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { c as v } from "../../_virtual/compiler-runtime.js";
5
3
  import '../../assets/components/avatar/Avatar.style.css';/* empty css */
6
- import { mergeCode0Props as R } from "../../utils/utils.js";
7
- import { hashToColor as x } from "../d-flow/DFlow.util.js";
8
- const C = (s) => {
9
- const t = p.c(3), {
4
+ import { mergeCode0Props as y } from "../../utils/utils.js";
5
+ import z from "avvvatars-react";
6
+ import { hashToColor as A } from "../d-flow/DFlow.util.js";
7
+ const $ = (m) => {
8
+ const t = v.c(3), {
10
9
  src: e,
11
- size: o
12
- } = s;
13
- let i;
14
- return t[0] !== o || t[1] !== e ? (i = /* @__PURE__ */ m("img", { src: e, width: o, height: o, alt: "Avatar image" }), t[0] = o, t[1] = e, t[2] = i) : i = t[2], i;
15
- }, E = ({
16
- identifier: s,
17
- size: t
18
- }) => {
19
- const e = d.useRef(null);
20
- d.useEffect(() => {
21
- o();
22
- });
23
- const o = () => {
24
- const i = v(s), r = Math.floor(t / 5), a = x(s);
25
- e.current.width = r * 5, e.current.height = r * 5;
26
- let c = i.split("").map((f) => (f = parseInt(f, 16), f < 8 ? 0 : 1)), l = [];
27
- l[0] = l[4] = c.slice(0, 5), l[1] = l[3] = c.slice(5, 10), l[2] = c.slice(10, 15);
28
- const n = e.current.getContext("2d");
29
- n.imageSmoothingEnabled = !1, n.clearRect(0, 0, e.current.width, e.current.height), l.forEach((f, h) => {
30
- f.forEach((g, u) => {
31
- g ? (n.fillStyle = a, n.fillRect(r * h, r * u, r, r)) : (n.fillStyle = "transparent", n.fillRect(r * h, r * u, r, r));
32
- });
33
- });
34
- };
35
- return /* @__PURE__ */ m("canvas", { ref: e });
36
- }, y = (s) => {
37
- const t = p.c(12);
38
- let e, o, i, r;
39
- if (t[0] !== s) {
10
+ size: i
11
+ } = m;
12
+ let r;
13
+ return t[0] !== i || t[1] !== e ? (r = /* @__PURE__ */ d("img", { src: e, width: i, height: i, alt: "Avatar image" }), t[0] = i, t[1] = e, t[2] = r) : r = t[2], r;
14
+ }, x = (m) => {
15
+ const t = v.c(12), {
16
+ identifier: e,
17
+ size: i,
18
+ color: r,
19
+ type: s
20
+ } = m;
21
+ let o;
22
+ t[0] !== r || t[1] !== e ? (o = r ?? A(e), t[0] = r, t[1] = e, t[2] = o) : o = t[2];
23
+ let l;
24
+ t[3] !== o ? (l = {
25
+ "--color": o
26
+ }, t[3] = o, t[4] = l) : l = t[4];
27
+ const c = l, n = s ?? "shape";
28
+ let a;
29
+ t[5] !== e || t[6] !== i || t[7] !== n ? (a = /* @__PURE__ */ d(z, { style: n, value: e, size: i }), t[5] = e, t[6] = i, t[7] = n, t[8] = a) : a = t[8];
30
+ let f;
31
+ return t[9] !== c || t[10] !== a ? (f = /* @__PURE__ */ d("div", { style: c, children: a }), t[9] = c, t[10] = a, t[11] = f) : f = t[11], f;
32
+ }, R = (m) => {
33
+ const t = v.c(16);
34
+ let e, i, r, s, o, l;
35
+ if (t[0] !== m) {
40
36
  const {
41
- identifier: l,
42
- src: n,
43
- size: f,
44
- ...h
45
- } = s;
46
- e = l, i = n, o = f === void 0 ? 25 : f, r = R(`avatar ${!e && i ? "avatar--image" : ""}`, h), t[0] = s, t[1] = e, t[2] = o, t[3] = i, t[4] = r;
37
+ identifier: a,
38
+ color: f,
39
+ src: h,
40
+ size: p,
41
+ type: g,
42
+ ...u
43
+ } = m;
44
+ i = a, e = f, s = h, l = g, r = p === void 0 ? 32 : p, o = y(`avatar ${!i && s ? "avatar--image" : "avatar--identicon"}`, u), t[0] = m, t[1] = e, t[2] = i, t[3] = r, t[4] = s, t[5] = o, t[6] = l;
47
45
  } else
48
- e = t[1], o = t[2], i = t[3], r = t[4];
49
- let a;
50
- t[5] !== e || t[6] !== o || t[7] !== i ? (a = e ? /* @__PURE__ */ m(E, { identifier: e, size: o }) : i ? /* @__PURE__ */ m(C, { src: i, size: o + 13 }) : null, t[5] = e, t[6] = o, t[7] = i, t[8] = a) : a = t[8];
46
+ e = t[1], i = t[2], r = t[3], s = t[4], o = t[5], l = t[6];
51
47
  let c;
52
- return t[9] !== r || t[10] !== a ? (c = /* @__PURE__ */ m("div", { ...r, children: a }), t[9] = r, t[10] = a, t[11] = c) : c = t[11], c;
48
+ t[7] !== e || t[8] !== i || t[9] !== r || t[10] !== s || t[11] !== l ? (c = i ? /* @__PURE__ */ d(x, { type: l, color: e, identifier: i, size: r }) : s ? /* @__PURE__ */ d($, { src: s, size: r }) : null, t[7] = e, t[8] = i, t[9] = r, t[10] = s, t[11] = l, t[12] = c) : c = t[12];
49
+ let n;
50
+ return t[13] !== o || t[14] !== c ? (n = /* @__PURE__ */ d("div", { ...o, children: c }), t[13] = o, t[14] = c, t[15] = n) : n = t[15], n;
53
51
  };
54
52
  export {
55
- y as Avatar
53
+ R as Avatar
56
54
  };
@@ -2,6 +2,7 @@ import "../../utils/contextStore.js";
2
2
  import "react";
3
3
  import { ReactiveArrayService as r } from "../../utils/reactiveArrayService.js";
4
4
  import "merge-props";
5
+ import "js-md5";
5
6
  class c extends r {
6
7
  }
7
8
  export {
@@ -1,11 +1,12 @@
1
1
  import { useService as u, useStore as p } from "../../utils/contextStore.js";
2
2
  import $ from "react";
3
3
  import "merge-props";
4
+ import "js-md5";
4
5
  import { DFlowReactiveService as h } from "./DFlow.service.js";
5
6
  import { DFlowFunctionReactiveService as I } from "../d-flow-function/DFlowFunction.service.js";
6
7
  import { hashToColor as b } from "./DFlow.util.js";
7
8
  import { DFlowDataTypeReactiveService as D } from "../d-flow-data-type/DFlowDataType.service.js";
8
- const H = (i, S, N) => {
9
+ const O = (i, S, N) => {
9
10
  const f = u(h), g = p(h), F = u(I), m = p(I), T = u(D), y = p(D), s = $.useMemo(() => f.getById(i, {
10
11
  namespaceId: S,
11
12
  projectId: N
@@ -105,5 +106,5 @@ const H = (i, S, N) => {
105
106
  }, [s, g, m, y]);
106
107
  };
107
108
  export {
108
- H as useFlowEdges
109
+ O as useFlowEdges
109
110
  };
@@ -1,13 +1,14 @@
1
1
  import { useService as S, useStore as x } from "../../utils/contextStore.js";
2
2
  import B from "react";
3
3
  import "merge-props";
4
+ import "js-md5";
4
5
  import { DFlowReactiveService as F } from "./DFlow.service.js";
5
6
  import { DFlowFunctionReactiveService as w } from "../d-flow-function/DFlowFunction.service.js";
6
7
  import { hashToColor as D } from "./DFlow.util.js";
7
8
  import { DFlowDataTypeReactiveService as A } from "../d-flow-data-type/DFlowDataType.service.js";
8
9
  const _ = /* @__PURE__ */ new Map([["std", "default"]]), k = (i, y) => {
9
10
  if (!y || i.size === 0) return "";
10
- const g = /[:._\-\/\s]+/, o = y.trim().toLowerCase();
11
+ const p = /[:._\-\/\s]+/, o = y.trim().toLowerCase();
11
12
  let n = null, l = -1 / 0;
12
13
  for (const [f, N] of i.entries()) {
13
14
  const a = f.trim().toLowerCase();
@@ -17,7 +18,7 @@ const _ = /* @__PURE__ */ new Map([["std", "default"]]), k = (i, y) => {
17
18
  if (o.startsWith(a)) {
18
19
  e = 2e3 + a.length * 2;
19
20
  const s = o.charAt(a.length);
20
- (s === "" || g.test(s)) && (e += 200);
21
+ (s === "" || p.test(s)) && (e += 200);
21
22
  } else {
22
23
  const s = Math.min(o.length, a.length);
23
24
  let t = 0;
@@ -25,24 +26,24 @@ const _ = /* @__PURE__ */ new Map([["std", "default"]]), k = (i, y) => {
25
26
  t++;
26
27
  if (t > 0) {
27
28
  e = 1e3 + t;
28
- const v = o.charAt(t), m = a.charAt(t);
29
- (v === "" || g.test(v) || m === "" || g.test(m)) && (e += 50);
29
+ const m = o.charAt(t), v = a.charAt(t);
30
+ (m === "" || p.test(m) || v === "" || p.test(v)) && (e += 50);
30
31
  }
31
32
  }
32
33
  e > l ? (l = e, n = f) : (e === l && n !== null && f.length > n.length || e === l && n === null) && (n = f);
33
34
  }
34
35
  return n !== null ? i.get(n) : "";
35
- }, V = (i, y, g) => {
36
+ }, j = (i, y, p) => {
36
37
  const o = S(F), n = x(F), l = S(w), f = x(w), N = S(A), a = x(A), e = B.useMemo(() => o.getById(i, {
37
38
  namespaceId: y,
38
- projectId: g
39
+ projectId: p
39
40
  }), [i, n]);
40
41
  return B.useMemo(() => {
41
42
  if (!e) return [];
42
43
  if (f.length <= 0) return [];
43
44
  if (a.length <= 0) return [];
44
45
  const s = [], t = /* @__PURE__ */ new Set();
45
- let v = 0, m = 0;
46
+ let m = 0, v = 0;
46
47
  s.push({
47
48
  id: `${e.id}`,
48
49
  type: "trigger",
@@ -75,17 +76,17 @@ const _ = /* @__PURE__ */ new Map([["std", "default"]]), k = (i, y) => {
75
76
  isParameter: C,
76
77
  flowId: i,
77
78
  parentNodeId: C ? M : void 0,
78
- index: ++m,
79
+ index: ++v,
79
80
  color: D(d)
80
81
  }
81
82
  }));
82
83
  const R = r.functionDefinition?.id ? l.getById(r.functionDefinition.id) : void 0;
83
- if (r.parameters?.nodes?.forEach((p) => {
84
- const h = p?.value;
84
+ if (r.parameters?.nodes?.forEach((g) => {
85
+ const h = g?.value;
85
86
  if (!h || h.__typename !== "NodeFunctionIdWrapper") return;
86
- const T = R?.parameterDefinitions?.find((c) => c.id === p?.parameterDefinition?.id);
87
+ const T = R?.parameterDefinitions?.find((c) => c.id === g?.parameterDefinition?.id);
87
88
  if ((T?.dataTypeIdentifier ? N.getDataType(T.dataTypeIdentifier) : void 0)?.variant === "NODE") {
88
- const c = `${d}-group-${v++}`;
89
+ const c = `${d}-group-${m++}`;
89
90
  t.has(c) || (t.add(c), s.push({
90
91
  id: c,
91
92
  type: "group",
@@ -111,8 +112,8 @@ const _ = /* @__PURE__ */ new Map([["std", "default"]]), k = (i, y) => {
111
112
  c && I(c, !0, d, u);
112
113
  }
113
114
  }), r.nextNodeId) {
114
- const p = o.getNodeById(e.id, r.nextNodeId);
115
- p && I(p, !1, void 0, u);
115
+ const g = o.getNodeById(e.id, r.nextNodeId);
116
+ g && I(g, !1, void 0, u);
116
117
  }
117
118
  };
118
119
  if (e.startingNodeId) {
@@ -123,5 +124,5 @@ const _ = /* @__PURE__ */ new Map([["std", "default"]]), k = (i, y) => {
123
124
  }, [e, n, f, a]);
124
125
  };
125
126
  export {
126
- V as useFlowNodes
127
+ j as useFlowNodes
127
128
  };
@@ -2,8 +2,9 @@ import "../../utils/contextStore.js";
2
2
  import "react";
3
3
  import { ReactiveArrayService as l } from "../../utils/reactiveArrayService.js";
4
4
  import "merge-props";
5
+ import "js-md5";
5
6
  import { View as c } from "../../utils/view.js";
6
- class v extends l {
7
+ class x extends l {
7
8
  getById(n, i) {
8
9
  return this.values(i).find((t) => t.id === n);
9
10
  }
@@ -143,5 +144,5 @@ class v extends l {
143
144
  }
144
145
  }
145
146
  export {
146
- v as DFlowReactiveService
147
+ x as DFlowReactiveService
147
148
  };
@@ -2,11 +2,11 @@ import "../../utils/contextStore.js";
2
2
  import "react";
3
3
  import { ReactiveArrayService as c } from "../../utils/reactiveArrayService.js";
4
4
  import "merge-props";
5
+ import { md5 as g } from "js-md5";
5
6
  import { DataTypeView as l } from "./DFlowDataType.view.js";
6
- import { resolveType as g } from "../../utils/generics.js";
7
- import { useValueValidation as m } from "../d-flow-validation/DValueValidation.hook.js";
8
- import { findReturnNode as v } from "./rules/DFlowDataTypeReturnTypeRule.js";
9
- import { md5 as _ } from "js-md5";
7
+ import { resolveType as m } from "../../utils/generics.js";
8
+ import { useValueValidation as v } from "../d-flow-validation/DValueValidation.hook.js";
9
+ import { findReturnNode as _ } from "./rules/DFlowDataTypeReturnTypeRule.js";
10
10
  class R extends c {
11
11
  getDataType(e, n) {
12
12
  if (!e || e.genericKey) return;
@@ -42,7 +42,7 @@ class R extends c {
42
42
  }
43
43
  }, i);
44
44
  }
45
- const t = this.values(i).filter((u) => e.__typename === "NodeFunctionIdWrapper" && (u.variant != "NODE" || !n) ? !1 : m(e, u, this, n));
45
+ const t = this.values(i).filter((u) => e.__typename === "NodeFunctionIdWrapper" && (u.variant != "NODE" || !n) ? !1 : v(e, u, this, n));
46
46
  return t[t.length - 1];
47
47
  }
48
48
  getValueFromType(e, n, i) {
@@ -135,7 +135,7 @@ class R extends c {
135
135
  target: p
136
136
  };
137
137
  if (s && s.variant == "RETURN_TYPE" && t.variant === "NODE") {
138
- const a = v(e, n)?.parameters?.nodes?.[0]?.value;
138
+ const a = _(e, n)?.parameters?.nodes?.[0]?.value;
139
139
  return {
140
140
  sourceDataTypeIdentifiers: [this.getTypeFromValue(a ?? {
141
141
  __typename: "LiteralValue",
@@ -168,7 +168,7 @@ class R extends c {
168
168
  dataType: new l({
169
169
  ...t.json,
170
170
  genericKeys: [],
171
- identifier: _(String(e.value)),
171
+ identifier: g(String(e.value)),
172
172
  rules: {
173
173
  nodes: r
174
174
  }
@@ -192,7 +192,7 @@ class R extends c {
192
192
  identifier: t.identifier
193
193
  }
194
194
  };
195
- return g(y, this);
195
+ return m(y, this);
196
196
  }
197
197
  hasDataTypes(e, n) {
198
198
  return e.every((i) => this.values(n).find((t) => t.id === (i.genericType?.dataType?.id ?? i.dataType?.id)));
@@ -3,6 +3,7 @@ import r from "react";
3
3
  import "../../_virtual/compiler-runtime.js";
4
4
  import "@radix-ui/react-checkbox";
5
5
  import "merge-props";
6
+ import "js-md5";
6
7
  import "@tabler/icons-react";
7
8
  import '../../assets/components/form/Input.style.css';/* empty css */
8
9
  import "../form/EmailInput.js";
@@ -18,7 +19,6 @@ import { useForm as M } from "../form/useForm.js";
18
19
  import { Flex as k } from "../flex/Flex.js";
19
20
  import { useService as p, useStore as S } from "../../utils/contextStore.js";
20
21
  import { DFlowFunctionReactiveService as g } from "../d-flow-function/DFlowFunction.service.js";
21
- import "js-md5";
22
22
  import "../d-flow/DFlow.js";
23
23
  import { DFlowReactiveService as V } from "../d-flow/DFlow.service.js";
24
24
  import "../d-flow-data-type/rules/DFlowDataTypeRegexRule.js";
@@ -2,9 +2,9 @@ import { jsxs as V, jsx as u } from "react/jsx-runtime";
2
2
  import I from "react";
3
3
  import { useService as c } from "../../utils/contextStore.js";
4
4
  import "merge-props";
5
+ import "js-md5";
5
6
  import "../d-flow/DFlow.js";
6
7
  import { DFlowReactiveService as b } from "../d-flow/DFlow.service.js";
7
- import "js-md5";
8
8
  import { DFlowDataTypeReactiveService as h } from "../d-flow-data-type/DFlowDataType.service.js";
9
9
  import { Flex as F } from "../flex/Flex.js";
10
10
  import { DFlowTypeReactiveService as j } from "../d-flow-type/DFlowType.service.js";
@@ -2,6 +2,7 @@ import { jsx as e, Fragment as E, jsxs as o } from "react/jsx-runtime";
2
2
  import { useService as f, useStore as g } from "../../utils/contextStore.js";
3
3
  import t from "react";
4
4
  import "merge-props";
5
+ import "js-md5";
5
6
  import { FileTabsService as S } from "../file-tabs/FileTabs.service.js";
6
7
  import { FileTabs as U, FileTabsContent as H, FileTabsList as J, FileTabsTrigger as K } from "../file-tabs/FileTabs.js";
7
8
  import { Menu as x, MenuTrigger as w, MenuPortal as C, MenuContent as I, MenuLabel as m, MenuItem as l, MenuSeparator as v } from "../menu/Menu.js";
@@ -11,7 +12,6 @@ import { DLayout as Y } from "../d-layout/DLayout.js";
11
12
  import { ButtonGroup as Z } from "../button-group/ButtonGroup.js";
12
13
  import "../d-flow/DFlow.js";
13
14
  import { DFlowReactiveService as A } from "../d-flow/DFlow.service.js";
14
- import "js-md5";
15
15
  import "../d-flow-data-type/rules/DFlowDataTypeRegexRule.js";
16
16
  import "../d-flow-data-type/rules/DFlowDataTypeNumberRangeRule.js";
17
17
  import "../d-flow-data-type/rules/DFlowDataTypeItemOfCollectionRule.js";
@@ -6,8 +6,8 @@ import { Text as i } from "../text/Text.js";
6
6
  import { IconChevronRight as b, IconEdit as v, IconTrash as F } from "@tabler/icons-react";
7
7
  import { useService as R, useStore as T } from "../../utils/contextStore.js";
8
8
  import "merge-props";
9
- import { DFlowTypeReactiveService as l } from "../d-flow-type/DFlowType.service.js";
10
9
  import "js-md5";
10
+ import { DFlowTypeReactiveService as l } from "../d-flow-type/DFlowType.service.js";
11
11
  import "../d-flow-data-type/rules/DFlowDataTypeRegexRule.js";
12
12
  import "../d-flow-data-type/rules/DFlowDataTypeNumberRangeRule.js";
13
13
  import "../d-flow-data-type/rules/DFlowDataTypeItemOfCollectionRule.js";
@@ -1,13 +1,14 @@
1
1
  import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
- import i from "react";
2
+ import n from "react";
3
3
  import "../../_virtual/compiler-runtime.js";
4
4
  import "@radix-ui/react-checkbox";
5
- import { InputLabel as T } from "../form/InputLabel.js";
6
- import { InputDescription as D } from "../form/InputDescription.js";
5
+ import { InputLabel as D } from "../form/InputLabel.js";
6
+ import { InputDescription as F } from "../form/InputDescription.js";
7
7
  import "merge-props";
8
- import { InputMessage as F } from "../form/InputMessage.js";
8
+ import "js-md5";
9
+ import { InputMessage as S } from "../form/InputMessage.js";
9
10
  import '../../assets/components/form/Input.style.css';/* empty css */
10
- import { IconFile as S, IconArrowUp as v, IconArrowDown as x, IconCornerDownLeft as M } from "@tabler/icons-react";
11
+ import { IconFile as M, IconArrowUp as v, IconArrowDown as x, IconCornerDownLeft as b } from "@tabler/icons-react";
11
12
  import "../form/EmailInput.js";
12
13
  import "../form/Input.js";
13
14
  import "../form/InputSuggestion.js";
@@ -17,14 +18,14 @@ import "@radix-ui/react-one-time-password-field";
17
18
  import "@radix-ui/react-radio-group";
18
19
  import "../form/SwitchInput.js";
19
20
  import "../form/TextInput.js";
20
- import { useForm as b } from "../form/useForm.js";
21
- import { Dialog as P, DialogPortal as V, DialogContent as O, DialogClose as z } from "../dialog/Dialog.js";
21
+ import { useForm as P } from "../form/useForm.js";
22
+ import { Dialog as O, DialogPortal as V, DialogOverlay as z, DialogContent as j, DialogClose as B } from "../dialog/Dialog.js";
22
23
  import { Flex as l } from "../flex/Flex.js";
23
- import { Button as c } from "../button/Button.js";
24
- import { DFlowFolderItemPathInput as j } from "./DFlowFolderItemPathInput.js";
25
- import { useService as B, useStore as L } from "../../utils/contextStore.js";
26
- import { DFlowTypeReactiveService as u } from "../d-flow-type/DFlowType.service.js";
27
- import { hashToColor as N } from "../d-flow/DFlow.util.js";
24
+ import { Button as p } from "../button/Button.js";
25
+ import { DFlowFolderItemPathInput as L } from "./DFlowFolderItemPathInput.js";
26
+ import { useService as N, useStore as Y } from "../../utils/contextStore.js";
27
+ import { DFlowTypeReactiveService as h } from "../d-flow-type/DFlowType.service.js";
28
+ import { hashToColor as k } from "../d-flow/DFlow.util.js";
28
29
  import "../d-flow-data-type/rules/DFlowDataTypeRegexRule.js";
29
30
  import "../d-flow-data-type/rules/DFlowDataTypeNumberRangeRule.js";
30
31
  import "../d-flow-data-type/rules/DFlowDataTypeItemOfCollectionRule.js";
@@ -32,22 +33,21 @@ import "../d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js";
32
33
  import "../d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js";
33
34
  import "../d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js";
34
35
  import "../d-flow-data-type/variants/DFlowDataTypeNodeVariant.js";
35
- import "js-md5";
36
- import { Menu as Y, MenuTrigger as k, MenuPortal as q, MenuContent as A, MenuItem as R, MenuLabel as E } from "../menu/Menu.js";
37
- import { Spacing as f } from "../spacing/Spacing.js";
38
- import { Badge as p } from "../badge/Badge.js";
39
- import { Card as U } from "../card/Card.js";
40
- const Pe = (t) => {
36
+ import { Menu as q, MenuTrigger as A, MenuPortal as R, MenuContent as E, MenuItem as U, MenuLabel as W } from "../menu/Menu.js";
37
+ import { Spacing as c } from "../spacing/Spacing.js";
38
+ import { Badge as s } from "../badge/Badge.js";
39
+ import { Card as G } from "../card/Card.js";
40
+ const Ve = (t) => {
41
41
  const {
42
42
  open: m
43
- } = t, s = B(u), h = L(u), [g, w] = i.useState(m), [a, y] = i.useState(t.flowTypeId), d = i.useMemo(() => s.getById(a), [a, h]), I = i.useMemo(() => ({
43
+ } = t, d = N(h), u = Y(h), [g, y] = n.useState(m), [a, w] = n.useState(t.flowTypeId), f = n.useMemo(() => d.getById(a), [a, u]), I = n.useMemo(() => ({
44
44
  name: "",
45
45
  flowTypeId: t.flowTypeId ?? null
46
- }), []);
47
- i.useEffect(() => {
48
- w(m);
46
+ }), []), C = n.useMemo(() => d.values(), [u]);
47
+ n.useEffect(() => {
48
+ y(m);
49
49
  }, [m]);
50
- const [n, C] = b({
50
+ const [i, T] = P({
51
51
  initialValues: I,
52
52
  validate: {
53
53
  name: (o) => o ? null : "Name is required",
@@ -57,57 +57,59 @@ const Pe = (t) => {
57
57
  t.onCreate?.(o.name, o.flowTypeId), t.onOpenChange?.(!1);
58
58
  }
59
59
  });
60
- return /* @__PURE__ */ e(P, { open: g, onOpenChange: (o) => {
60
+ return /* @__PURE__ */ e(O, { open: g, onOpenChange: (o) => {
61
61
  t.onOpenChange?.(o);
62
- }, children: /* @__PURE__ */ e(V, { children: /* @__PURE__ */ r(O, { autoFocus: !0, showCloseButton: !0, title: "Create new flow", children: [
63
- /* @__PURE__ */ r("div", { children: [
64
- /* @__PURE__ */ e(T, { children: "Type of flow" }),
65
- /* @__PURE__ */ e(D, { children: "You can choose a flow type here" }),
66
- /* @__PURE__ */ r(Y, { children: [
67
- /* @__PURE__ */ e(k, { asChild: !0, children: /* @__PURE__ */ r(c, { w: "100%", color: n.getInputProps("flowTypeId").formValidation?.valid ? "secondary" : "error", style: {
62
+ }, children: /* @__PURE__ */ r(V, { children: [
63
+ /* @__PURE__ */ e(z, {}),
64
+ /* @__PURE__ */ r(j, { autoFocus: !0, showCloseButton: !0, title: "Create new flow", children: [
65
+ /* @__PURE__ */ e(D, { children: "Type of flow" }),
66
+ /* @__PURE__ */ e(F, { children: "You can choose a flow type here" }),
67
+ /* @__PURE__ */ r(q, { children: [
68
+ /* @__PURE__ */ e(A, { asChild: !0, children: /* @__PURE__ */ r(p, { w: "100%", color: i.getInputProps("flowTypeId").formValidation?.valid ? "secondary" : "error", style: {
68
69
  justifyContent: "start"
69
70
  }, children: [
70
- a ? /* @__PURE__ */ e(S, { size: 13, color: N(a) }) : null,
71
- d ? d?.names?.[0].content : "Select flow type"
71
+ a ? /* @__PURE__ */ e(M, { size: 13, color: k(a) }) : null,
72
+ f ? f?.names?.[0].content : "Select flow type"
72
73
  ] }) }),
73
- /* @__PURE__ */ e(q, { children: /* @__PURE__ */ r(A, { align: "start", color: "secondary", sideOffset: 8, children: [
74
- /* @__PURE__ */ e(U, { paddingSize: "xxs", mt: -0.35, mx: -0.35, style: {
74
+ /* @__PURE__ */ e(R, { children: /* @__PURE__ */ r(E, { align: "start", color: "secondary", sideOffset: 8, children: [
75
+ /* @__PURE__ */ e(G, { paddingSize: "xxs", mt: -0.35, mx: -0.35, style: {
75
76
  borderWidth: "2px"
76
- }, children: s.values().map((o) => /* @__PURE__ */ e(R, { onSelect: () => {
77
- n.getInputProps("flowTypeId").formValidation?.setValue(o.id), y(o.id);
77
+ }, children: C.map((o) => /* @__PURE__ */ e(U, { onSelect: () => {
78
+ i.getInputProps("flowTypeId").formValidation?.setValue(o.id), w(o.id);
78
79
  }, children: o.names?.[0].content }, o.id)) }),
79
- /* @__PURE__ */ e(E, { children: /* @__PURE__ */ r(l, { style: {
80
+ /* @__PURE__ */ e(W, { children: /* @__PURE__ */ r(l, { style: {
80
81
  gap: ".35rem"
81
82
  }, children: [
82
83
  /* @__PURE__ */ r(l, { align: "center", style: {
83
84
  gap: "0.35rem"
84
85
  }, children: [
85
86
  /* @__PURE__ */ r(l, { children: [
86
- /* @__PURE__ */ e(p, { border: !0, children: /* @__PURE__ */ e(v, { size: 12 }) }),
87
- /* @__PURE__ */ e(p, { border: !0, children: /* @__PURE__ */ e(x, { size: 12 }) })
87
+ /* @__PURE__ */ e(s, { border: !0, children: /* @__PURE__ */ e(v, { size: 12 }) }),
88
+ /* @__PURE__ */ e(s, { border: !0, children: /* @__PURE__ */ e(x, { size: 12 }) })
88
89
  ] }),
89
90
  "move"
90
91
  ] }),
91
- /* @__PURE__ */ e(f, { spacing: "xxs" }),
92
+ /* @__PURE__ */ e(c, { spacing: "xxs" }),
92
93
  /* @__PURE__ */ r(l, { align: "center", style: {
93
94
  gap: ".35rem"
94
95
  }, children: [
95
- /* @__PURE__ */ e(p, { border: !0, children: /* @__PURE__ */ e(M, { size: 12 }) }),
96
+ /* @__PURE__ */ e(s, { border: !0, children: /* @__PURE__ */ e(b, { size: 12 }) }),
96
97
  "select"
97
98
  ] })
98
99
  ] }) })
99
100
  ] }) })
100
101
  ] }),
101
- n.getInputProps("flowTypeId").formValidation?.valid ? null : /* @__PURE__ */ e(F, { children: n.getInputProps("flowTypeId").formValidation?.notValidMessage }),
102
- /* @__PURE__ */ e(f, { spacing: "md" }),
103
- /* @__PURE__ */ e(j, { description: "You can choose a name here and only use alphanumeric names.", title: "Name of the flow", ...n.getInputProps("name") })
104
- ] }),
105
- /* @__PURE__ */ r(l, { justify: "space-between", align: "center", children: [
106
- /* @__PURE__ */ e(z, { asChild: !0, children: /* @__PURE__ */ e(c, { color: "secondary", children: "No, go back!" }) }),
107
- /* @__PURE__ */ e(c, { color: "success", onClick: C, children: "Yes, create!" })
102
+ i.getInputProps("flowTypeId").formValidation?.valid ? null : /* @__PURE__ */ e(S, { children: i.getInputProps("flowTypeId").formValidation?.notValidMessage }),
103
+ /* @__PURE__ */ e(c, { spacing: "md" }),
104
+ /* @__PURE__ */ e(L, { description: "You can choose a name here and only use alphanumeric names.", title: "Name of the flow", ...i.getInputProps("name") }),
105
+ /* @__PURE__ */ e(c, { spacing: "md" }),
106
+ /* @__PURE__ */ r(l, { justify: "space-between", align: "center", children: [
107
+ /* @__PURE__ */ e(B, { asChild: !0, children: /* @__PURE__ */ e(p, { color: "secondary", children: "No, go back!" }) }),
108
+ /* @__PURE__ */ e(p, { color: "success", onClick: T, children: "Yes, create!" })
109
+ ] })
108
110
  ] })
109
- ] }) }) });
111
+ ] }) });
110
112
  };
111
113
  export {
112
- Pe as DFlowFolderCreateDialog
114
+ Ve as DFlowFolderCreateDialog
113
115
  };