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

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 (37) hide show
  1. package/dist/assets/components/d-flow-input/DFlowInputDataType.style.css +1 -1
  2. package/dist/assets/components/d-flow-suggestion/DFlowSuggestionSearchInput.style.css +1 -1
  3. package/dist/assets/components/menu/Menu.style.css +1 -1
  4. package/dist/components/d-flow/DFlow.service.js +31 -23
  5. package/dist/components/d-flow-data-type/DFlowDataType.service.d.ts +2 -2
  6. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js +22 -13
  7. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js +19 -13
  8. package/dist/components/d-flow-file/DFlowTabDefault.js +38 -37
  9. package/dist/components/d-flow-file/DFlowTabTrigger.js +1 -1
  10. package/dist/components/d-flow-file/DFlowTabs.js +57 -105
  11. package/dist/components/d-flow-input/DFlowInput.d.ts +11 -0
  12. package/dist/components/d-flow-input/DFlowInput.js +29 -0
  13. package/dist/components/d-flow-input/DFlowInputDefault.d.ts +2 -7
  14. package/dist/components/d-flow-input/DFlowInputNodeBadge.js +13 -13
  15. package/dist/components/d-flow-input/DFlowInputObject.d.ts +10 -0
  16. package/dist/components/d-flow-input/DFlowInputObject.js +83 -0
  17. package/dist/components/d-flow-input/DFlowInputObjectEditDialog.d.ts +16 -0
  18. package/dist/components/d-flow-input/DFlowInputObjectEditDialog.js +118 -0
  19. package/dist/components/d-flow-input/DFlowInputObjectTree.d.ts +16 -0
  20. package/dist/components/d-flow-input/DFlowInputObjectTree.js +99 -0
  21. package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +12 -12
  22. package/dist/components/d-flow-node/DFlowNodeReference.return.hook.d.ts +4 -0
  23. package/dist/components/d-flow-node/DFlowNodeReference.return.hook.js +77 -0
  24. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +104 -103
  25. package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +43 -50
  26. package/dist/components/d-flow-validation/DNodeValidation.hook.js +44 -39
  27. package/dist/components/d-project/DNamespaceProject.view.d.ts +7 -1
  28. package/dist/components/d-project/DNamespaceProject.view.js +7 -1
  29. package/dist/components/editor/Editor.js +15 -15
  30. package/dist/components/form/InputSuggestion.js +29 -29
  31. package/dist/components/form/useForm.d.ts +3 -3
  32. package/dist/components/form/useForm.js +16 -16
  33. package/dist/node_modules/prettier/plugins/babel.js +6674 -6685
  34. package/dist/node_modules/prettier/plugins/estree.js +2830 -2628
  35. package/dist/node_modules/prettier/standalone.js +1657 -1440
  36. package/dist/utils/generics.js +85 -97
  37. package/package.json +26 -26
@@ -1,17 +1,17 @@
1
- import { jsx as e, Fragment as E, jsxs as o } from "react/jsx-runtime";
2
- import { useService as f, useStore as g } from "../../utils/contextStore.js";
3
- import t from "react";
1
+ import { jsx as i, Fragment as q, jsxs as s } from "react/jsx-runtime";
2
+ import { useService as u, useStore as f } from "../../utils/contextStore.js";
3
+ import o from "react";
4
4
  import "merge-props";
5
5
  import "js-md5";
6
6
  import { FileTabsService as S } from "../file-tabs/FileTabs.service.js";
7
- import { FileTabs as U, FileTabsContent as H, FileTabsList as J, FileTabsTrigger as K } from "../file-tabs/FileTabs.js";
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";
7
+ import { FileTabs as N, FileTabsContent as O, FileTabsList as W, FileTabsTrigger as G } from "../file-tabs/FileTabs.js";
8
+ import { Menu as b, MenuTrigger as y, MenuPortal as C, MenuContent as w, MenuLabel as h, MenuItem as r, MenuSeparator as p } from "../menu/Menu.js";
9
9
  import { Button as M } from "../button/Button.js";
10
- import { IconPlus as Q, IconArrowUp as z, IconArrowDown as F, IconCornerDownLeft as L, IconDotsVertical as X } from "@tabler/icons-react";
11
- import { DLayout as Y } from "../d-layout/DLayout.js";
12
- import { ButtonGroup as Z } from "../button-group/ButtonGroup.js";
10
+ import { IconPlus as P, IconDotsVertical as V } from "@tabler/icons-react";
11
+ import { DLayout as E } from "../d-layout/DLayout.js";
12
+ import { ButtonGroup as H } from "../button-group/ButtonGroup.js";
13
13
  import "../d-flow/DFlow.js";
14
- import { DFlowReactiveService as A } from "../d-flow/DFlow.service.js";
14
+ import { DFlowReactiveService as I } from "../d-flow/DFlow.service.js";
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";
@@ -19,114 +19,66 @@ import "../d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js";
19
19
  import "../d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js";
20
20
  import "../d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js";
21
21
  import "../d-flow-data-type/variants/DFlowDataTypeNodeVariant.js";
22
- import { DFlowTypeReactiveService as B } from "../d-flow-type/DFlowType.service.js";
23
- import { Card as D } from "../card/Card.js";
24
- import { Flex as n } from "../flex/Flex.js";
25
- import { Badge as s } from "../badge/Badge.js";
26
- import { Spacing as k } from "../spacing/Spacing.js";
27
- const Ie = (R) => {
22
+ import { DFlowTypeReactiveService as F } from "../d-flow-type/DFlowType.service.js";
23
+ const he = (x) => {
28
24
  const {
29
- flowId: $,
30
- namespaceId: j,
31
- projectId: q
32
- } = R, i = f(S), a = g(S), N = f(A), O = g(A), W = f(B), G = g(B), h = t.useId(), b = t.useMemo(() => N.getById($, {
33
- namespaceId: j,
34
- projectId: q
35
- }), [O]), p = t.useMemo(() => W.getById(b?.type?.id), [G, b]), y = t.useMemo(() => a.find((r) => r.active)?.id ?? i.getActiveTab()?.id, [a, i]), c = t.useMemo(() => {
36
- if (p?.id)
37
- return i.values().find((r) => r.id === p.id);
38
- }, [a, p]), T = t.useMemo(() => i.values().filter((r) => r.show), [a, c]), P = t.useMemo(() => i.values().filter((r) => !r.show && r.id !== c?.id), [a, c]);
39
- return t.useEffect(() => {
25
+ flowId: L,
26
+ namespaceId: B,
27
+ projectId: A
28
+ } = x, t = u(S), c = f(S), D = u(I), k = f(I), z = u(F), R = f(F), a = o.useId(), v = o.useMemo(() => D.getById(L, {
29
+ namespaceId: B,
30
+ projectId: A
31
+ }), [k]), d = o.useMemo(() => z.getById(v?.type?.id), [R, v]), T = o.useMemo(() => c.find((e) => e.active)?.id ?? t.getActiveTab()?.id, [c, t]), n = o.useMemo(() => {
32
+ if (d?.id)
33
+ return t.values().find((e) => e.id === d.id);
34
+ }, [c, d]), g = o.useMemo(() => t.values().filter((e) => e.show), [c, n]), $ = o.useMemo(() => t.values().filter((e) => !e.show && e.id !== n?.id), [c, n]);
35
+ return o.useEffect(() => {
40
36
  setTimeout(() => {
41
- const d = document.querySelector('[data-id="' + h + '"]').querySelector(".file-tabs__list-content"), u = d.querySelector('[data-value="' + i.getActiveTab()?.id + '"]');
42
- if (d && u) {
43
- const V = u.offsetLeft + u.offsetWidth / 2 - d.offsetWidth / 2;
44
- d.scrollLeft = 0, d.scrollBy({
45
- left: V,
37
+ const l = document.querySelector('[data-id="' + a + '"]').querySelector(".file-tabs__list-content"), m = l.querySelector('[data-value="' + t.getActiveTab()?.id + '"]');
38
+ if (l && m) {
39
+ const j = m.offsetLeft + m.offsetWidth / 2 - l.offsetWidth / 2;
40
+ l.scrollLeft = 0, l.scrollBy({
41
+ left: j,
46
42
  behavior: "smooth"
47
43
  });
48
44
  }
49
45
  }, 0);
50
- }, [y, h]), /* @__PURE__ */ e(U, { "data-id": h, value: y, onValueChange: (r) => {
51
- i.activateTab(r);
52
- }, children: /* @__PURE__ */ e(Y, { layoutGap: "0", topContent: /* @__PURE__ */ e(J, { controls: /* @__PURE__ */ o(Z, { color: "primary", p: 0, style: {
46
+ }, [T, a]), /* @__PURE__ */ i(N, { "data-id": a, value: T, onValueChange: (e) => {
47
+ t.activateTab(e);
48
+ }, children: /* @__PURE__ */ i(E, { layoutGap: "0", topContent: /* @__PURE__ */ i(W, { controls: /* @__PURE__ */ s(H, { color: "primary", p: 0, style: {
53
49
  boxShadow: "none"
54
50
  }, children: [
55
- /* @__PURE__ */ o(x, { children: [
56
- /* @__PURE__ */ e(w, { asChild: !0, children: /* @__PURE__ */ e(M, { variant: "none", paddingSize: "xxs", color: "primary", children: /* @__PURE__ */ e(Q, { size: 12 }) }) }),
57
- /* @__PURE__ */ e(C, { children: /* @__PURE__ */ o(I, { align: "start", sideOffset: 8, color: "secondary", children: [
58
- /* @__PURE__ */ o(D, { paddingSize: "xxs", mt: -0.2, mx: -0.2, children: [
59
- /* @__PURE__ */ e(m, { children: "Starting Node" }),
60
- c && /* @__PURE__ */ e(l, { onSelect: () => i.activateTab(c.id), children: c.children }),
61
- /* @__PURE__ */ e(v, {}),
62
- /* @__PURE__ */ e(m, { children: "Opened Nodes" }),
63
- T.map((r) => /* @__PURE__ */ e(l, { onSelect: () => {
64
- i.activateTab(r.id);
65
- }, children: r.children }, `menu-${r.id}`)),
66
- /* @__PURE__ */ e(v, {}),
67
- /* @__PURE__ */ e(m, { children: "Available Node" }),
68
- P.map((r) => /* @__PURE__ */ e(l, { onSelect: () => {
69
- i.activateTab(r.id);
70
- }, children: r.children }, `menu-${r.id}`))
71
- ] }),
72
- /* @__PURE__ */ e(m, { children: /* @__PURE__ */ o(n, { style: {
73
- gap: ".35rem"
74
- }, children: [
75
- /* @__PURE__ */ o(n, { align: "center", style: {
76
- gap: "0.35rem"
77
- }, children: [
78
- /* @__PURE__ */ o(n, { children: [
79
- /* @__PURE__ */ e(s, { border: !0, children: /* @__PURE__ */ e(z, { size: 12 }) }),
80
- /* @__PURE__ */ e(s, { border: !0, children: /* @__PURE__ */ e(F, { size: 12 }) })
81
- ] }),
82
- "move"
83
- ] }),
84
- /* @__PURE__ */ e(k, { spacing: "xxs" }),
85
- /* @__PURE__ */ o(n, { align: "center", style: {
86
- gap: ".35rem"
87
- }, children: [
88
- /* @__PURE__ */ e(s, { border: !0, children: /* @__PURE__ */ e(L, { size: 12 }) }),
89
- "select"
90
- ] })
91
- ] }) })
51
+ /* @__PURE__ */ s(b, { children: [
52
+ /* @__PURE__ */ i(y, { asChild: !0, children: /* @__PURE__ */ i(M, { variant: "none", paddingSize: "xxs", color: "primary", children: /* @__PURE__ */ i(P, { size: 12 }) }) }),
53
+ /* @__PURE__ */ i(C, { children: /* @__PURE__ */ s(w, { align: "start", sideOffset: 8, children: [
54
+ /* @__PURE__ */ i(h, { children: "Starting Node" }),
55
+ n && /* @__PURE__ */ i(r, { onSelect: () => t.activateTab(n.id), children: n.children }),
56
+ /* @__PURE__ */ i(p, {}),
57
+ /* @__PURE__ */ i(h, { children: "Opened Nodes" }),
58
+ g.map((e) => /* @__PURE__ */ i(r, { onSelect: () => {
59
+ t.activateTab(e.id);
60
+ }, children: e.children }, `menu-${e.id}`)),
61
+ /* @__PURE__ */ i(p, {}),
62
+ /* @__PURE__ */ i(h, { children: "Available Node" }),
63
+ $.map((e) => /* @__PURE__ */ i(r, { onSelect: () => {
64
+ t.activateTab(e.id);
65
+ }, children: e.children }, `menu-${e.id}`))
92
66
  ] }) })
93
67
  ] }),
94
- /* @__PURE__ */ o(x, { children: [
95
- /* @__PURE__ */ e(w, { asChild: !0, children: /* @__PURE__ */ e(M, { variant: "none", paddingSize: "xxs", color: "primary", children: /* @__PURE__ */ e(X, { size: 12 }) }) }),
96
- /* @__PURE__ */ e(C, { children: /* @__PURE__ */ o(I, { align: "end", sideOffset: 8, color: "secondary", children: [
97
- /* @__PURE__ */ o(D, { paddingSize: "xxs", mt: -0.2, mx: -0.2, children: [
98
- /* @__PURE__ */ e(l, { onClick: () => i.clearAll(), children: "Close all tabs" }),
99
- /* @__PURE__ */ e(l, { onClick: () => i.clearWithoutActive(), children: "Close other tabs" }),
100
- /* @__PURE__ */ e(v, {}),
101
- /* @__PURE__ */ e(l, { onClick: () => i.clearLeft(), children: "Close all tabs to left" }),
102
- /* @__PURE__ */ e(l, { onClick: () => i.clearRight(), children: "Close all tabs to right" })
103
- ] }),
104
- /* @__PURE__ */ e(m, { children: /* @__PURE__ */ o(n, { style: {
105
- gap: ".35rem"
106
- }, children: [
107
- /* @__PURE__ */ o(n, { align: "center", style: {
108
- gap: "0.35rem"
109
- }, children: [
110
- /* @__PURE__ */ o(n, { children: [
111
- /* @__PURE__ */ e(s, { border: !0, children: /* @__PURE__ */ e(z, { size: 12 }) }),
112
- /* @__PURE__ */ e(s, { border: !0, children: /* @__PURE__ */ e(F, { size: 12 }) })
113
- ] }),
114
- "move"
115
- ] }),
116
- /* @__PURE__ */ e(k, { spacing: "xxs" }),
117
- /* @__PURE__ */ o(n, { align: "center", style: {
118
- gap: ".35rem"
119
- }, children: [
120
- /* @__PURE__ */ e(s, { border: !0, children: /* @__PURE__ */ e(L, { size: 12 }) }),
121
- "select"
122
- ] })
123
- ] }) })
68
+ /* @__PURE__ */ s(b, { children: [
69
+ /* @__PURE__ */ i(y, { asChild: !0, children: /* @__PURE__ */ i(M, { variant: "none", paddingSize: "xxs", color: "primary", children: /* @__PURE__ */ i(V, { size: 12 }) }) }),
70
+ /* @__PURE__ */ i(C, { children: /* @__PURE__ */ s(w, { align: "end", sideOffset: 8, children: [
71
+ /* @__PURE__ */ i(r, { onClick: () => t.clearAll(), children: "Close all tabs" }),
72
+ /* @__PURE__ */ i(r, { onClick: () => t.clearWithoutActive(), children: "Close other tabs" }),
73
+ /* @__PURE__ */ i(p, {}),
74
+ /* @__PURE__ */ i(r, { onClick: () => t.clearLeft(), children: "Close all tabs to left" }),
75
+ /* @__PURE__ */ i(r, { onClick: () => t.clearRight(), children: "Close all tabs to right" })
124
76
  ] }) })
125
77
  ] })
126
- ] }), children: T.map((r, d) => r.show && /* @__PURE__ */ e(K, { closable: r.closeable, value: r.id, onClose: () => {
127
- i.removeTabById(r.id);
128
- }, children: r.children }, `trigger-${r.id}`)) }), children: /* @__PURE__ */ e(E, { children: i.values().map((r) => /* @__PURE__ */ e(H, { value: r.id, children: r.content }, `content-${r.id}`)) }) }) });
78
+ ] }), children: g.map((e, l) => e.show && /* @__PURE__ */ i(G, { closable: e.closeable, value: e.id, onClose: () => {
79
+ t.removeTabById(e.id);
80
+ }, children: e.children }, `trigger-${e.id}`)) }), children: /* @__PURE__ */ i(q, { children: t.values().map((e) => /* @__PURE__ */ i(O, { value: e.id, children: e.content }, `content-${e.id}`)) }) }) });
129
81
  };
130
82
  export {
131
- Ie as DFlowTabs
83
+ he as DFlowTabs
132
84
  };
@@ -0,0 +1,11 @@
1
+ import { Flow, NodeFunction, NodeParameter } from '@code0-tech/sagittarius-graphql-types';
2
+ import { default as React } from 'react';
3
+ import { InputProps } from '../form';
4
+ export interface DFlowInputProps extends Omit<InputProps<any | null>, "wrapperComponent" | "type"> {
5
+ flowId: Flow['id'];
6
+ nodeId: NodeFunction['id'];
7
+ parameterId: NodeParameter['id'];
8
+ clearable?: boolean;
9
+ onClear?: (event: React.MouseEvent<HTMLButtonElement>) => void;
10
+ }
11
+ export declare const DFlowInput: React.FC<DFlowInputProps>;
@@ -0,0 +1,29 @@
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import e from "react";
3
+ import { DFlowInputDefault as R } from "./DFlowInputDefault.js";
4
+ import { useService as a, useStore as c } from "../../utils/contextStore.js";
5
+ import "merge-props";
6
+ import "js-md5";
7
+ import "../d-flow/DFlow.js";
8
+ import { DFlowReactiveService as u } from "../d-flow/DFlow.service.js";
9
+ import { DFlowFunctionReactiveService as D } from "../d-flow-function/DFlowFunction.service.js";
10
+ import { DFlowDataTypeReactiveService as l } from "../d-flow-data-type/DFlowDataType.service.js";
11
+ import { DFlowInputObject as M } from "./DFlowInputObject.js";
12
+ const Y = (v) => {
13
+ const {
14
+ flowId: t,
15
+ nodeId: o,
16
+ parameterId: i,
17
+ ...m
18
+ } = v, S = a(u), w = c(u), y = a(l), I = c(l), T = a(D), F = c(D), r = e.useMemo(() => S.getNodeById(t, o), [w, t, o]), p = e.useMemo(() => r?.parameters?.nodes?.find((n) => n?.id === i), [r, i]), s = e.useMemo(() => T.getById(r?.functionDefinition?.id), [F, r]), f = e.useMemo(() => s?.parameterDefinitions?.find((n) => n.id === p?.parameterDefinition?.id), [s, p]);
19
+ switch (e.useMemo(() => y.getDataType(f?.dataTypeIdentifier), [I, f])?.variant) {
20
+ case "ARRAY":
21
+ case "OBJECT":
22
+ return /* @__PURE__ */ d(M, { flowId: t, nodeId: o, parameterId: i, ...m });
23
+ default:
24
+ return /* @__PURE__ */ d(R, { flowId: t, nodeId: o, parameterId: i, ...m });
25
+ }
26
+ };
27
+ export {
28
+ Y as DFlowInput
29
+ };
@@ -1,10 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { TextInputProps } from '../form';
3
- import { Flow, NodeFunction, NodeParameter } from '@code0-tech/sagittarius-graphql-types';
4
- export interface DFlowInputDefaultProps extends TextInputProps {
5
- flowId: Flow['id'];
6
- nodeId: NodeFunction['id'];
7
- parameterId: NodeParameter['id'];
8
- }
2
+ import { DFlowInputProps } from './DFlowInput';
3
+ export type DFlowInputDefaultProps = DFlowInputProps;
9
4
  export declare const splitTextAndObjects: (input: string) => (string | Record<string, any>)[];
10
5
  export declare const DFlowInputDefault: React.FC<DFlowInputDefaultProps>;
@@ -1,13 +1,13 @@
1
1
  import { jsxs as B, jsx as i } from "react/jsx-runtime";
2
2
  import { Badge as T } from "../badge/Badge.js";
3
- import p from "react";
4
- import { IconBolt as N, IconNote as h } from "@tabler/icons-react";
5
- import { Text as x } from "../text/Text.js";
3
+ import s from "react";
4
+ import { IconBolt as h, IconNote as x } from "@tabler/icons-react";
5
+ import { Text as D } from "../text/Text.js";
6
6
  import { useService as n, useStore as m } from "../../utils/contextStore.js";
7
7
  import "merge-props";
8
8
  import "js-md5";
9
9
  import { DFlowFunctionReactiveService as f } from "../d-flow-function/DFlowFunction.service.js";
10
- import { hashToColor as D } from "../d-flow/DFlow.util.js";
10
+ import { hashToColor as N } from "../d-flow/DFlow.util.js";
11
11
  import "../d-flow/DFlow.js";
12
12
  import { DFlowReactiveService as d } from "../d-flow/DFlow.service.js";
13
13
  import "../d-flow-data-type/rules/DFlowDataTypeRegexRule.js";
@@ -25,21 +25,21 @@ const X = (a) => {
25
25
  flowId: c,
26
26
  definition: o,
27
27
  ...u
28
- } = a, w = o || n(f), y = o || m(f), s = o || n(d), g = o || m(d), v = o || n(l), S = o || m(l), t = e.__typename === "NodeFunctionIdWrapper" && e.id === "gid://sagittarius/NodeFunction/-1", r = p.useMemo(() => {
28
+ } = a, w = o || n(f), y = o || m(f), p = o || n(d), v = o || m(d), S = o || n(l), g = o || m(l), t = e.__typename === "NodeFunctionIdWrapper" && !e.id, r = s.useMemo(() => {
29
29
  if (t && !o) {
30
- const I = s.getById(c);
31
- return v.getById(I?.type?.id);
30
+ const F = p.getById(c);
31
+ return S.getById(F?.type?.id);
32
32
  }
33
- return e.__typename === "NodeFunction" || o ? e : s.getNodeById(c, e.id);
34
- }, [g, S]), F = p.useMemo(() => o ? o.names?.[0]?.content : t && r instanceof R ? r.names?.[0]?.content : w.getById(r?.functionDefinition?.id)?.names?.[0]?.content, [y, r]);
33
+ return e.__typename === "NodeFunction" || o ? e : p.getNodeById(c, e.id);
34
+ }, [v, g]), I = s.useMemo(() => o ? o.names?.[0]?.content : t && r instanceof R ? r.names?.[0]?.content : w.getById(r?.functionDefinition?.id)?.names?.[0]?.content, [y, r]);
35
35
  return /* @__PURE__ */ B(T, { style: {
36
36
  verticalAlign: "middle",
37
37
  textWrap: "nowrap"
38
- }, color: t ? "info" : D(e.id || ""), border: !0, ...u, children: [
39
- t ? /* @__PURE__ */ i(N, { size: 12 }) : /* @__PURE__ */ i(h, { size: 12 }),
40
- /* @__PURE__ */ i(x, { size: "sm", style: {
38
+ }, color: t ? "info" : N(e.id || ""), border: !0, ...u, children: [
39
+ t ? /* @__PURE__ */ i(h, { size: 12 }) : /* @__PURE__ */ i(x, { size: 12 }),
40
+ /* @__PURE__ */ i(D, { size: "sm", style: {
41
41
  color: "inherit"
42
- }, children: String(F) })
42
+ }, children: String(I) })
43
43
  ] });
44
44
  };
45
45
  export {
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { DFlowInputProps } from './DFlowInput';
3
+ import { LiteralValue } from '@code0-tech/sagittarius-graphql-types';
4
+ export interface EditableObjectEntry {
5
+ key: string;
6
+ value: LiteralValue | null;
7
+ path: string[];
8
+ }
9
+ export type DFlowInputObjectProps = DFlowInputProps;
10
+ export declare const DFlowInputObject: React.FC<DFlowInputObjectProps>;
@@ -0,0 +1,83 @@
1
+ import { jsxs as m, Fragment as H, jsx as e } from "react/jsx-runtime";
2
+ import o from "react";
3
+ import { Card as h } from "../card/Card.js";
4
+ import { Flex as F } from "../flex/Flex.js";
5
+ import { Text as J } from "../text/Text.js";
6
+ import { Button as f } from "../button/Button.js";
7
+ import { IconAlignLeft as K, IconEdit as P, IconX as Q } from "@tabler/icons-react";
8
+ import U from "./DFlowInputObjectEditDialog.js";
9
+ import '../../assets/components/form/Input.style.css';import '../../assets/components/d-flow-input/DFlowInputDataType.style.css';/* empty css */
10
+ import { ButtonGroup as Y } from "../button-group/ButtonGroup.js";
11
+ import { DFlowInputObjectTree as Z } from "./DFlowInputObjectTree.js";
12
+ import { useService as g, useStore as S } from "../../utils/contextStore.js";
13
+ import "merge-props";
14
+ import "js-md5";
15
+ import "../d-flow/DFlow.js";
16
+ import { DFlowReactiveService as w } from "../d-flow/DFlow.service.js";
17
+ import { DFlowFunctionReactiveService as x } from "../d-flow-function/DFlowFunction.service.js";
18
+ import { DFlowDataTypeReactiveService as C } from "../d-flow-data-type/DFlowDataType.service.js";
19
+ import { DFlowSuggestionMenu as $ } from "../d-flow-suggestion/DFlowSuggestionMenu.js";
20
+ import { useSuggestions as ee } from "../d-flow-suggestion/DFlowSuggestion.hook.js";
21
+ import "../../_virtual/compiler-runtime.js";
22
+ import "@radix-ui/react-checkbox";
23
+ import { InputLabel as te } from "../form/InputLabel.js";
24
+ import { InputDescription as oe } from "../form/InputDescription.js";
25
+ import { InputMessage as ie } from "../form/InputMessage.js";
26
+ /* empty css */
27
+ import "../form/EmailInput.js";
28
+ import "../form/Input.js";
29
+ import "../form/InputSuggestion.js";
30
+ import "../form/NumberInput.js";
31
+ import "../form/PasswordInput.js";
32
+ import "@radix-ui/react-one-time-password-field";
33
+ import "@radix-ui/react-radio-group";
34
+ import "../form/SwitchInput.js";
35
+ import "../form/TextInput.js";
36
+ import { DFlowInputNodeBadge as re } from "./DFlowInputNodeBadge.js";
37
+ import { DFlowInputReferenceBadge as ne } from "./DFlowInputReferenceBadge.js";
38
+ const Xe = (V) => {
39
+ const {
40
+ flowId: n,
41
+ nodeId: s,
42
+ parameterId: d,
43
+ title: b,
44
+ description: j,
45
+ formValidation: a,
46
+ onChange: _
47
+ } = V, E = g(w), M = S(w), y = g(C), v = S(C), T = g(x), z = S(x), l = o.useMemo(() => E.getNodeById(n, s), [M, n, s]), r = o.useMemo(() => l?.parameters?.nodes?.find((t) => t?.id === d), [l, d]), D = o.useMemo(() => T.getById(l?.functionDefinition?.id), [z, l]), c = o.useMemo(() => D?.parameterDefinitions?.find((t) => t.id === r?.parameterDefinition?.id), [D, r]), O = o.useMemo(() => !r?.value || r?.value?.__typename === "LiteralValue" && r.value.value == null ? y.getValueFromType(c?.dataTypeIdentifier) : r?.value, [r, c, v]), R = ee(n, s, d), [i, u] = o.useState(O), [I, p] = o.useState(!1), [k, B] = o.useState(null), [L, N] = o.useState({}), A = (t, X) => {
48
+ N((q) => ({
49
+ ...q,
50
+ [t.join(".")]: X
51
+ }));
52
+ }, G = (t) => {
53
+ B(t), p(!0);
54
+ }, W = o.useCallback(() => {
55
+ u(y.getValueFromType(c?.dataTypeIdentifier));
56
+ }, [r, c, v]);
57
+ return o.useEffect(() => {
58
+ a?.setValue(i), _?.();
59
+ }, [i]), /* @__PURE__ */ m(H, { children: [
60
+ i?.__typename === "LiteralValue" && /* @__PURE__ */ e(U, { open: I, entry: k, value: i, onOpenChange: (t) => p(t), onObjectChange: (t) => u(t ?? void 0) }, String(I)),
61
+ /* @__PURE__ */ e(te, { children: b }),
62
+ /* @__PURE__ */ e(oe, { children: j }),
63
+ /* @__PURE__ */ m(h, { color: "secondary", paddingSize: "xs", children: [
64
+ /* @__PURE__ */ m(F, { style: {
65
+ gap: ".7rem"
66
+ }, align: "center", justify: "space-between", children: [
67
+ /* @__PURE__ */ e(F, { style: {
68
+ gap: ".35rem"
69
+ }, align: "center", children: /* @__PURE__ */ e(J, { children: "Object" }) }),
70
+ /* @__PURE__ */ m(Y, { color: "primary", children: [
71
+ /* @__PURE__ */ e($, { suggestions: R, onSuggestionSelect: (t) => u(t.value), triggerContent: /* @__PURE__ */ e(f, { paddingSize: "xxs", variant: "filled", color: "secondary", onClick: () => p(!0), children: /* @__PURE__ */ e(K, { size: 13 }) }) }),
72
+ /* @__PURE__ */ e(f, { paddingSize: "xxs", variant: "filled", color: "secondary", onClick: () => p(!0), children: /* @__PURE__ */ e(P, { size: 13 }) }),
73
+ /* @__PURE__ */ e(f, { paddingSize: "xxs", variant: "filled", color: "secondary", onClick: W, children: /* @__PURE__ */ e(Q, { size: 13 }) })
74
+ ] })
75
+ ] }),
76
+ /* @__PURE__ */ e(h, { paddingSize: "xs", mt: 0.7, mb: -0.55, mx: -0.55, children: i?.__typename === "NodeFunction" || i?.__typename === "NodeFunctionIdWrapper" ? /* @__PURE__ */ e(re, { value: i, flowId: n }) : i?.__typename === "ReferenceValue" ? /* @__PURE__ */ e(ne, { value: i, flowId: n }) : /* @__PURE__ */ e(Z, { object: i, onEntryClick: G, collapsedState: L, setCollapsedState: A }) })
77
+ ] }),
78
+ !a?.valid && a?.notValidMessage && /* @__PURE__ */ e(ie, { children: a.notValidMessage })
79
+ ] });
80
+ };
81
+ export {
82
+ Xe as DFlowInputObject
83
+ };
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { LiteralValue } from '@code0-tech/sagittarius-graphql-types';
3
+ export interface EditableObjectEntry {
4
+ key: string;
5
+ value: LiteralValue | null;
6
+ path: string[];
7
+ }
8
+ export interface DFlowInputObjectEditDialogProps {
9
+ open: boolean;
10
+ entry: EditableObjectEntry | null;
11
+ value: LiteralValue | null;
12
+ onOpenChange?: (open: boolean) => void;
13
+ onObjectChange?: (object: LiteralValue | null) => void;
14
+ }
15
+ declare const DFlowInputObjectEditDialog: React.FC<DFlowInputObjectEditDialogProps>;
16
+ export default DFlowInputObjectEditDialog;
@@ -0,0 +1,118 @@
1
+ import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
+ import c from "react";
3
+ import { Dialog as F, DialogPortal as I, DialogOverlay as G, DialogContent as H, DialogClose as L } from "../dialog/Dialog.js";
4
+ import { DLayout as B } from "../d-layout/DLayout.js";
5
+ import { Flex as N } from "../flex/Flex.js";
6
+ import { Text as X } from "../text/Text.js";
7
+ import { DResizablePanelGroup as q, DResizablePanel as v, DResizableHandle as J } from "../d-resizable/DResizable.js";
8
+ import { ScrollArea as K, ScrollAreaViewport as M, ScrollAreaScrollbar as S, ScrollAreaThumb as C } from "../scroll-area/ScrollArea.js";
9
+ import { Spacing as b } from "../spacing/Spacing.js";
10
+ import { Button as Q } from "../button/Button.js";
11
+ import { IconX as U } from "@tabler/icons-react";
12
+ import { Editor as W } from "../editor/Editor.js";
13
+ import { DFlowInputObjectTree as Y } from "./DFlowInputObjectTree.js";
14
+ function O(r, i) {
15
+ if (!r || !Array.isArray(i) || i.length === 0) return r?.value;
16
+ let e = r.value;
17
+ for (const n of i)
18
+ if (e && typeof e == "object" && n in e)
19
+ e = e[n];
20
+ else
21
+ return;
22
+ return e;
23
+ }
24
+ function m(r, i, e) {
25
+ if (!r) return null;
26
+ if (i.length === 0) return {
27
+ ...r,
28
+ value: e
29
+ };
30
+ const [n, ...u] = i;
31
+ if (Array.isArray(r.value)) {
32
+ const l = Number(n), s = [...r.value];
33
+ return u.length > 0 && typeof s[l] == "object" && s[l] !== null ? s[l] = m({
34
+ ...r,
35
+ value: s[l]
36
+ }, u, e)?.value : s[l] = e, {
37
+ ...r,
38
+ value: s
39
+ };
40
+ } else if (typeof r.value == "object" && r.value !== null) {
41
+ const l = {
42
+ ...r.value
43
+ };
44
+ return u.length > 0 && typeof l[n] == "object" && l[n] !== null ? l[n] = m({
45
+ ...r,
46
+ value: l[n]
47
+ }, u, e)?.value : l[n] = e, {
48
+ ...r,
49
+ value: l
50
+ };
51
+ } else
52
+ return {
53
+ ...r,
54
+ value: e
55
+ };
56
+ }
57
+ const ue = (r) => {
58
+ const {
59
+ open: i,
60
+ entry: e,
61
+ value: n,
62
+ onObjectChange: u,
63
+ onOpenChange: l
64
+ } = r, [s, E] = c.useState(i), [w, A] = c.useState({}), [f, g] = c.useState(e?.path ?? []), [h, y] = c.useState(n), [x, k] = c.useState(O(n, e?.path ?? [])), d = c.useRef(null);
65
+ c.useEffect(() => {
66
+ k(O(h, f));
67
+ }, [f]), c.useEffect(() => {
68
+ g(e?.path ?? []), y(n);
69
+ }, [e]), c.useEffect(() => {
70
+ E(i);
71
+ }, [i]);
72
+ const D = (o, a) => {
73
+ A((j) => ({
74
+ ...j,
75
+ [o.join(".")]: a
76
+ }));
77
+ }, z = (o) => {
78
+ d.current && clearTimeout(d.current), d.current = setTimeout(() => {
79
+ g(o.path ?? []);
80
+ }, 200);
81
+ }, P = (o, a) => {
82
+ d.current && clearTimeout(d.current), D(o, !a);
83
+ }, R = (o) => {
84
+ const a = m(h, f, o);
85
+ y(a), u?.(a);
86
+ }, T = () => null, V = {};
87
+ return /* @__PURE__ */ t(F, { open: s, onOpenChange: (o) => l?.(o), children: /* @__PURE__ */ p(I, { children: [
88
+ /* @__PURE__ */ t(G, {}),
89
+ /* @__PURE__ */ t(H, { "aria-describedby": "DFlowInputObjectEditDialog", onPointerDownOutside: (o) => {
90
+ const a = o.target;
91
+ (a.closest("[data-slot=resizable-handle]") || a.closest("[data-slot=resizable-panel]")) && o.preventDefault();
92
+ }, w: "75%", h: "75%", style: {
93
+ padding: "2px"
94
+ }, children: /* @__PURE__ */ t(B, { layoutGap: 0, showLayoutSplitter: !1, topContent: /* @__PURE__ */ p(N, { style: {
95
+ gap: ".7rem"
96
+ }, p: 0.7, justify: "space-between", align: "center", children: [
97
+ /* @__PURE__ */ t(X, { children: e?.key ?? "Edit Object" }),
98
+ /* @__PURE__ */ t(L, { asChild: !0, children: /* @__PURE__ */ t(Q, { variant: "filled", color: "tertiary", paddingSize: "xxs", children: /* @__PURE__ */ t(U, { size: 13 }) }) })
99
+ ] }), children: /* @__PURE__ */ p(q, { style: {
100
+ borderRadius: "1rem"
101
+ }, children: [
102
+ /* @__PURE__ */ t(v, { color: "primary", children: /* @__PURE__ */ p(K, { h: "100%", w: "100%", type: "scroll", children: [
103
+ /* @__PURE__ */ p(M, { px: 1, children: [
104
+ /* @__PURE__ */ t(b, { spacing: "md" }),
105
+ /* @__PURE__ */ t(Y, { object: h, onEntryClick: z, collapsedState: w, setCollapsedState: D, activePath: f, onDoubleClick: P }),
106
+ /* @__PURE__ */ t(b, { spacing: "md" })
107
+ ] }),
108
+ /* @__PURE__ */ t(S, { orientation: "vertical", children: /* @__PURE__ */ t(C, {}) }),
109
+ /* @__PURE__ */ t(S, { orientation: "horizontal", children: /* @__PURE__ */ t(C, {}) })
110
+ ] }) }),
111
+ /* @__PURE__ */ t(J, {}),
112
+ /* @__PURE__ */ t(v, { color: "primary", children: /* @__PURE__ */ t(W, { suggestions: T, tokenHighlights: V, language: "json", initialValue: x, onChange: R }) })
113
+ ] }) }) })
114
+ ] }) });
115
+ };
116
+ export {
117
+ ue as default
118
+ };
@@ -0,0 +1,16 @@
1
+ import { EditableObjectEntry } from './DFlowInputObject';
2
+ import { default as React } from 'react';
3
+ import { LiteralValue } from '@code0-tech/sagittarius-graphql-types';
4
+ export interface DFlowInputObjectTreeProps {
5
+ object: LiteralValue;
6
+ parentKey?: string;
7
+ isRoot?: boolean;
8
+ onEntryClick: (entry: EditableObjectEntry) => void;
9
+ collapsedState: Record<string, boolean>;
10
+ setCollapsedState: (path: string[], collapsed: boolean) => void;
11
+ path?: string[];
12
+ activePath?: string[] | null;
13
+ onDoubleClick?: (path: string[], isCollapsed: boolean) => void;
14
+ parentColor?: string;
15
+ }
16
+ export declare const DFlowInputObjectTree: React.FC<DFlowInputObjectTreeProps>;