@code0-tech/pictor 0.0.0-mvp.29 → 0.0.0-mvp.30

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 (125) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +6 -0
  2. package/dist/_virtual/index.js +4 -0
  3. package/dist/_virtual/index2.js +4 -0
  4. package/dist/_virtual/react-contenteditable.js +7 -0
  5. package/dist/_virtual/react-contenteditable2.js +4 -0
  6. package/dist/_virtual/react-dom-server-legacy.browser.development.js +4 -0
  7. package/dist/_virtual/react-dom-server-legacy.browser.production.js +4 -0
  8. package/dist/_virtual/react-dom-server.browser.development.js +4 -0
  9. package/dist/_virtual/react-dom-server.browser.production.js +4 -0
  10. package/dist/_virtual/react-is.development.js +4 -0
  11. package/dist/_virtual/react-is.production.min.js +4 -0
  12. package/dist/_virtual/server.browser.js +5 -0
  13. package/dist/_virtual/server.browser2.js +4 -0
  14. package/dist/assets/components/d-resizable/DResizable.style.css +1 -1
  15. package/dist/assets/components/form/Input.style.css +1 -1
  16. package/dist/components/breadcrumb/Breadcrumb.js +12 -12
  17. package/dist/components/button-group/ButtonGroup.js +12 -12
  18. package/dist/components/d-flow/DFlow.edges.hook.js +57 -54
  19. package/dist/components/d-flow/DFlow.js +304 -268
  20. package/dist/components/d-flow/DFlow.nodes.hook.js +60 -59
  21. package/dist/components/d-flow/DFlow.service.d.ts +3 -2
  22. package/dist/components/d-flow/DFlow.service.js +62 -47
  23. package/dist/components/d-flow/DFlow.util.d.ts +4 -0
  24. package/dist/components/d-flow/DFlow.util.js +63 -0
  25. package/dist/components/d-flow/DFlowEdge.js +34 -34
  26. package/dist/components/d-flow-data-type/DFlowDataType.service.js +17 -14
  27. package/dist/components/d-flow-data-type/DFlowDataType.view.d.ts +7 -4
  28. package/dist/components/d-flow-data-type/DFlowDataType.view.js +11 -6
  29. package/dist/components/d-flow-file/DFlowTabDefault.d.ts +0 -3
  30. package/dist/components/d-flow-file/DFlowTabDefault.js +77 -112
  31. package/dist/components/d-flow-file/DFlowTabTrigger.js +38 -49
  32. package/dist/components/d-flow-file/DFlowTabs.js +26 -27
  33. package/dist/components/d-flow-folder/DFlowFolder.js +170 -143
  34. package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +18 -11
  35. package/dist/components/d-flow-folder/DFlowFolderItemPathInput.js +1 -0
  36. package/dist/components/d-flow-function/DFlowFunction.input.hook.js +4 -5
  37. package/dist/components/d-flow-function/DFlowFunction.return.hook.js +1 -1
  38. package/dist/components/d-flow-function/DFlowFunction.view.d.ts +14 -11
  39. package/dist/components/d-flow-function/DFlowFunction.view.js +19 -12
  40. package/dist/components/d-flow-function/DFlowFunctionDefaultCard.js +72 -75
  41. package/dist/components/d-flow-function/DFlowFunctionSuggestionCard.js +27 -32
  42. package/dist/components/d-flow-function/DFlowFunctionTriggerCard.js +17 -10
  43. package/dist/components/d-flow-input/DFlowInputDataType.js +38 -33
  44. package/dist/components/d-flow-input/DFlowInputDefault.d.ts +10 -0
  45. package/dist/components/d-flow-input/DFlowInputDefault.js +128 -0
  46. package/dist/components/d-flow-input/DFlowInputLiteralBadge.d.ts +7 -0
  47. package/dist/components/d-flow-input/DFlowInputLiteralBadge.js +24 -0
  48. package/dist/components/d-flow-input/DFlowInputNodeBadge.d.ts +11 -0
  49. package/dist/components/d-flow-input/DFlowInputNodeBadge.js +44 -0
  50. package/dist/components/d-flow-input/DFlowInputReferenceBadge.d.ts +11 -0
  51. package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +33 -0
  52. package/dist/components/d-flow-panel/DFlowExport.js +1 -1
  53. package/dist/components/d-flow-panel/DFlowMiniMap.js +1 -1
  54. package/dist/components/d-flow-panel/DFlowPanelControl.js +34 -32
  55. package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.d.ts +3 -0
  56. package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.js +34 -0
  57. package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.d.ts +3 -0
  58. package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.js +50 -0
  59. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.d.ts +3 -0
  60. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +133 -0
  61. package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.d.ts +3 -18
  62. package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.js +19 -156
  63. package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +47 -58
  64. package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.util.js +5 -4
  65. package/dist/components/d-flow-suggestion/DFlowSuggestionSearchInput.js +6 -6
  66. package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.d.ts +3 -0
  67. package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.js +44 -0
  68. package/dist/components/d-flow-type/DFlowType.view.d.ts +5 -5
  69. package/dist/components/d-flow-type/DFlowType.view.js +22 -12
  70. package/dist/components/d-flow-validation/DFlowValidation.hook.js +1 -1
  71. package/dist/components/d-flow-validation/DNodeValidation.hook.js +39 -43
  72. package/dist/components/d-resizable/DResizable.d.ts +4 -4
  73. package/dist/components/d-resizable/DResizable.js +22 -21
  74. package/dist/components/d-user/DUserInput.js +23 -21
  75. package/dist/components/file-tabs/FileTabs.service.d.ts +0 -1
  76. package/dist/components/file-tabs/FileTabs.service.js +49 -53
  77. package/dist/components/form/EmailInput.js +9 -9
  78. package/dist/components/form/Input.d.ts +2 -1
  79. package/dist/components/form/Input.js +294 -397
  80. package/dist/components/form/Input.syntax.hook.d.ts +1 -18
  81. package/dist/components/form/Input.syntax.hook.js +7 -73
  82. package/dist/components/form/Input.utils.d.ts +1 -2
  83. package/dist/components/form/Input.utils.js +26 -21
  84. package/dist/components/form/InputContentEditable.hook.d.ts +40 -0
  85. package/dist/components/form/InputContentEditable.hook.js +471 -0
  86. package/dist/components/form/InputSuggestion.d.ts +2 -2
  87. package/dist/components/form/InputSuggestion.js +169 -107
  88. package/dist/components/form/PasswordInput.js +8 -8
  89. package/dist/components/form/TextInput.js +11 -11
  90. package/dist/components/form/useForm.d.ts +1 -0
  91. package/dist/components/form/useForm.js +45 -60
  92. package/dist/components/menu/Menu.js +4 -4
  93. package/dist/index.js +155 -154
  94. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +30 -30
  95. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +8 -8
  96. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +8 -8
  97. package/dist/node_modules/fast-deep-equal/index.js +31 -0
  98. package/dist/node_modules/object-assign/index.js +49 -0
  99. package/dist/node_modules/prop-types/checkPropTypes.js +54 -0
  100. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +52 -0
  101. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +329 -0
  102. package/dist/node_modules/prop-types/index.js +17 -0
  103. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
  104. package/dist/node_modules/prop-types/lib/has.js +7 -0
  105. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +87 -0
  106. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +70 -0
  107. package/dist/node_modules/prop-types/node_modules/react-is/index.js +10 -0
  108. package/dist/node_modules/react-contenteditable/lib/react-contenteditable.js +132 -0
  109. package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +6235 -0
  110. package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +4096 -0
  111. package/dist/node_modules/react-dom/cjs/react-dom-server.browser.development.js +6753 -0
  112. package/dist/node_modules/react-dom/cjs/react-dom-server.browser.production.js +4645 -0
  113. package/dist/node_modules/react-dom/server.browser.js +15 -0
  114. package/dist/utils/generics.d.ts +2 -0
  115. package/dist/utils/generics.js +93 -80
  116. package/dist/utils/index.js +22 -21
  117. package/dist/utils/inspection.d.ts +4 -2
  118. package/dist/utils/inspection.js +27 -2
  119. package/package.json +10 -8
  120. package/dist/components/form/Input.selection.hook.d.ts +0 -17
  121. package/dist/components/form/Input.selection.hook.js +0 -78
  122. package/dist/components/form/InputSyntax.d.ts +0 -19
  123. package/dist/components/form/InputSyntax.js +0 -52
  124. package/dist/components/form/inputSyntaxMapping.d.ts +0 -3
  125. package/dist/components/form/inputSyntaxMapping.js +0 -42
@@ -1,18 +1,3 @@
1
- import { DFlowSuggestion, DFlowSuggestionType } from './DFlowSuggestion.view';
2
- import { DataTypeIdentifier, Flow, ReferenceValue } from '@code0-tech/sagittarius-graphql-types';
3
- export declare const useSuggestions: (type: DataTypeIdentifier | undefined, genericKeys: string[] | undefined, flowId: Flow["id"], depth?: number, scope?: number[], node?: number, suggestionTypes?: DFlowSuggestionType[]) => DFlowSuggestion[];
4
- /**
5
- * Walks the flow starting at its startingNode (depth-first, left-to-right) and collects
6
- * all RefObjects (variables/outputs) with contextual metadata:
7
- * - depth: nesting level (root 0; +1 per NODE-parameter sub-block)
8
- * - scope: PATH of scope ids as number[], e.g. [0], [0,1], [0,2], [0,2,3] ...
9
- * (root is [0]; each NODE-parameter group appends a new unique id)
10
- * - node: GLOBAL visit index across the entire flow (1-based, strictly increasing)
11
- *
12
- * Notes:
13
- * - A NODE-typed parameter opens a new group/lane: depth+1 and scopePath+[newId].
14
- * - Functions passed as non-NODE parameters are traversed in the SAME depth/scopePath.
15
- * - The `node` id is incremented globally for every visited node and shared by all
16
- * RefObjects (inputs from rules and the return value) produced by that node.
17
- */
18
- export declare const useRefObjects: (flowId: Flow["id"]) => Array<ReferenceValue>;
1
+ import { DFlowSuggestion } from './DFlowSuggestion.view';
2
+ import { Flow, NodeFunction, NodeParameter } from '@code0-tech/sagittarius-graphql-types';
3
+ export declare const useSuggestions: (flowId: Flow["id"], nodeId?: NodeFunction["id"], parameterId?: NodeParameter["id"]) => DFlowSuggestion[];
@@ -1,161 +1,24 @@
1
- import { useService as _ } from "../../utils/contextStore.js";
2
- import "react";
1
+ import { useService as f, useStore as p } from "../../utils/contextStore.js";
2
+ import o from "react";
3
3
  import "merge-props";
4
- import { DFlowDataTypeReactiveService as C } from "../d-flow-data-type/DFlowDataType.service.js";
5
- import { DFlowSuggestionType as i } from "./DFlowSuggestion.view.js";
6
- import { DFlowFunctionReactiveService as B } from "../d-flow-function/DFlowFunction.service.js";
7
- import { replaceGenericsAndSortType as h, resolveType as A, isMatchingType as S } from "../../utils/generics.js";
8
- import "../d-flow/DFlow.js";
9
- import { DFlowReactiveService as V } from "../d-flow/DFlow.service.js";
4
+ import { DFlowFunctionReactiveService as g } from "../d-flow-function/DFlowFunction.service.js";
10
5
  import "js-md5";
11
- import { useReturnType as x } from "../d-flow-function/DFlowFunction.return.hook.js";
12
- import { useInputType as b } from "../d-flow-function/DFlowFunction.input.hook.js";
13
- const z = (s, l, T, E = 0, y = [0], I = 1, N = [i.REF_OBJECT, i.VALUE, i.FUNCTION, i.FUNCTION_COMBINATION, i.DATA_TYPE]) => {
14
- const v = _(C), D = _(B), g = s ? v?.getDataType(s) : void 0, m = s ? h(A(s, v), l) : void 0, o = [];
15
- return g && N.includes(i.VALUE) && g.rules?.nodes?.forEach((r) => {
16
- if (r?.variant === "ITEM_OF_COLLECTION")
17
- r.config.items?.forEach((e) => {
18
- const t = {
19
- path: [],
20
- type: i.VALUE,
21
- displayText: [e.toString()],
22
- value: {
23
- __typename: "LiteralValue",
24
- value: e
25
- }
26
- };
27
- o.push(t);
28
- });
29
- else if (r?.variant === "NUMBER_RANGE") {
30
- const e = r.config, t = {
31
- path: [],
32
- type: i.VALUE,
33
- displayText: [e.from?.toString() ?? ""],
34
- value: {
35
- __typename: "LiteralValue",
36
- value: e.from
37
- }
38
- };
39
- o.push(t);
40
- }
41
- }), g && g.variant === "DATA_TYPE" && N.includes(i.DATA_TYPE) && v.values().forEach((r) => {
42
- const e = {
43
- path: [],
44
- type: i.DATA_TYPE,
45
- displayText: [r.name?.nodes[0]?.content],
46
- /*@ts-ignore*/
47
- value: r.json
48
- };
49
- o.push(e);
50
- }), N.includes(i.FUNCTION_COMBINATION) && D.values().filter((e) => {
51
- if (!s || !m) return !0;
52
- if (e.runtimeFunctionDefinition?.identifier == "RETURN" && s) return !1;
53
- if (g?.variant === "NODE") return !0;
54
- if (!e.returnType || !e.genericKeys) return !1;
55
- const t = h(A(e.returnType, v), e.genericKeys);
56
- return S(m, t);
57
- }).sort((e, t) => {
58
- const [a, d, c] = e.runtimeFunctionDefinition.identifier.split("::"), [u, n, p] = t.runtimeFunctionDefinition.identifier.split("::"), f = a.localeCompare(u);
59
- if (f !== 0) return f;
60
- const F = d.localeCompare(n);
61
- return F !== 0 ? F : c.localeCompare(p);
62
- }).forEach((e) => {
63
- const t = {
64
- __typename: "NodeFunction",
65
- id: "gid://sagittarius/NodeFunction/1",
66
- functionDefinition: {
67
- id: e.id,
68
- runtimeFunctionDefinition: e.runtimeFunctionDefinition
69
- },
70
- parameters: {
71
- nodes: e.parameterDefinitions?.map((d) => ({
72
- id: d.id,
73
- runtimeParameter: {
74
- id: d.id
75
- }
76
- })) ?? []
77
- }
78
- }, a = {
79
- path: [],
80
- type: i.FUNCTION,
81
- displayText: [e.names?.nodes[0]?.content],
82
- value: t
83
- };
84
- o.push(a);
85
- }), N.includes(i.REF_OBJECT) && (s ? L(T) : []).forEach((e) => {
86
- if ((e?.node ?? 0) >= I || (e?.depth ?? 0) > E || (e?.scope ?? []).some((d) => !y.includes(d)) || !m) return;
87
- const t = h(A(e.dataTypeIdentifier, v), []);
88
- if (!S(m, t)) return;
89
- const a = {
90
- path: [],
91
- type: i.REF_OBJECT,
92
- displayText: [`${e.depth}-${e.scope}-${e.node || ""}`],
93
- value: e
94
- };
95
- o.push(a);
96
- }), o.sort();
97
- }, L = (s) => {
98
- const l = _(C), T = _(V), E = _(B), y = [];
99
- if (!l || !T || !E) return y;
100
- const I = T.values().find((o) => o.id === s);
101
- if (!I?.startingNodeId) return y;
102
- let N = 0;
103
- const v = () => ++N;
104
- let D = 0;
105
- const g = () => ++D, m = (o, r, e) => {
106
- if (!o) return;
107
- let t = o.__typename === "NodeFunctionIdWrapper" ? T.getNodeById(s, o.id) : o;
108
- for (; t; ) {
109
- const a = E.getById(t.functionDefinition?.id);
110
- if (!a) break;
111
- const d = g();
112
- if (t.parameters && a.parameterDefinitions)
113
- for (const c of a.parameterDefinitions) {
114
- const u = l.getDataType(c.dataTypeIdentifier);
115
- if (!u || u.variant === "NODE") continue;
116
- const n = u.rules?.nodes?.filter((p) => p?.variant === "INPUT_TYPES") ?? [];
117
- if (n.length) {
118
- const f = t.parameters?.nodes?.find((O) => O?.id === c.id)?.value, F = f !== void 0 ? f?.__typename === "NodeFunctionIdWrapper" ? [f] : [f] : [];
119
- for (const O of n) {
120
- const U = O?.config, R = b(U.dataTypeIdentifier, a, F, l);
121
- R && y.push({
122
- __typename: "ReferenceValue",
123
- dataTypeIdentifier: R,
124
- depth: r,
125
- scope: e,
126
- node: d
127
- });
128
- }
129
- }
130
- }
131
- {
132
- const c = t.parameters?.nodes?.map((n) => n?.value).filter((n) => n !== void 0) ?? [], u = x(a, c, l);
133
- u && y.push({
134
- __typename: "ReferenceValue",
135
- dataTypeIdentifier: u,
136
- depth: r,
137
- scope: e,
138
- node: d
139
- });
140
- }
141
- if (t.parameters && a.parameterDefinitions)
142
- for (const c of a.parameterDefinitions)
143
- if (l.getDataType(c.dataTypeIdentifier)?.variant === "NODE") {
144
- const n = t.parameters?.nodes?.find((p) => p?.id === c.id);
145
- if (n?.value && n.value.__typename === "NodeFunctionIdWrapper") {
146
- const p = n.value, f = [...e, v()];
147
- m(p, r + 1, f);
148
- }
149
- } else {
150
- const n = t.parameters?.nodes?.find((p) => p?.id === c.id);
151
- n?.value && n.value.__typename === "NodeFunctionIdWrapper" && m(n.value, r, e);
152
- }
153
- t = T.getNodeById(I.id, t.nextNodeId);
154
- }
155
- };
156
- return m(T.getNodeById(I.id, I.startingNodeId), 0, [0]), y;
6
+ import "../d-flow/DFlow.js";
7
+ import { DFlowReactiveService as a } from "../d-flow/DFlow.service.js";
8
+ import "../d-flow-data-type/rules/DFlowDataTypeRegexRule.js";
9
+ import "../d-flow-data-type/rules/DFlowDataTypeNumberRangeRule.js";
10
+ import "../d-flow-data-type/rules/DFlowDataTypeItemOfCollectionRule.js";
11
+ import "../d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js";
12
+ import "../d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js";
13
+ import "../d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js";
14
+ import { useValueSuggestions as M } from "./DFlowValueSuggestions.hook.js";
15
+ import { useReferenceSuggestions as R } from "./DFlowReferenceSuggestions.hook.js";
16
+ import { useFunctionSuggestions as T } from "./DFlowFunctionSuggestions.hook.js";
17
+ import { useDataTypeSuggestions as B } from "./DFlowDataTypeSuggestions.hook.js";
18
+ const J = (e, t, n) => {
19
+ const c = f(g), u = f(a), S = p(g), D = p(a), r = o.useMemo(() => u.getNodeById(e, t), [e, u, D, t]), s = o.useMemo(() => r?.functionDefinition?.id ? c.getById(r.functionDefinition.id) : void 0, [S, c, r?.functionDefinition?.id]), i = o.useMemo(() => s?.parameterDefinitions?.find((F) => F.id === n), [s?.parameterDefinitions, n])?.dataTypeIdentifier, m = s?.genericKeys ?? [], v = M(i), y = B(i), d = R(e, t, i, m), l = T(i, m);
20
+ return o.useMemo(() => [...v, ...y, ...d, ...l].sort(), [e, t, n]);
157
21
  };
158
22
  export {
159
- L as useRefObjects,
160
- z as useSuggestions
23
+ J as useSuggestions
161
24
  };
@@ -1,83 +1,72 @@
1
- import { jsx as r, jsxs as T } from "react/jsx-runtime";
2
- import { c as _ } from "../../_virtual/compiler-runtime.js";
3
- import { MenuTrigger as B, MenuSeparator as A, MenuPortal as L, Menu as O } from "../menu/Menu.js";
4
- import b from "react";
5
- import { DFlowSuggestionMenuFooter as P } from "./DFlowSuggestionMenuFooter.js";
1
+ import { jsx as r, jsxs as F } from "react/jsx-runtime";
2
+ import { c as k } from "../../_virtual/compiler-runtime.js";
3
+ import { MenuTrigger as v, MenuSeparator as C, MenuPortal as A, Menu as E } from "../menu/Menu.js";
4
+ import y from "react";
5
+ import { DFlowSuggestionMenuFooter as B } from "./DFlowSuggestionMenuFooter.js";
6
6
  import "@radix-ui/react-checkbox";
7
7
  import "merge-props";
8
8
  import "@tabler/icons-react";
9
9
  import '../../assets/components/form/Input.style.css';/* empty css */
10
10
  import "../form/EmailInput.js";
11
11
  import "../form/Input.js";
12
- import { InputSuggestionMenuContentItems as U, InputSuggestionMenuContent as $ } from "../form/InputSuggestion.js";
12
+ import { InputSuggestionMenuContentItems as L, InputSuggestionMenuContent as P } from "../form/InputSuggestion.js";
13
13
  import "../form/NumberInput.js";
14
14
  import "../form/PasswordInput.js";
15
15
  import "@radix-ui/react-one-time-password-field";
16
16
  import "@radix-ui/react-radio-group";
17
17
  import "../form/SwitchInput.js";
18
18
  import "../form/TextInput.js";
19
- import { toInputSuggestions as q } from "./DFlowSuggestionMenu.util.js";
20
- import { DFlowSuggestionMenuSearchBar as v } from "./DFlowSuggestionMenuSearchBar.js";
21
- import { useStoreApi as z } from "@xyflow/react";
22
- const ce = (R) => {
23
- const e = _.c(28), {
24
- suggestions: c,
19
+ import { toInputSuggestions as U } from "./DFlowSuggestionMenu.util.js";
20
+ import { DFlowSuggestionMenuSearchBar as $ } from "./DFlowSuggestionMenuSearchBar.js";
21
+ const le = (R) => {
22
+ const e = k.c(25), {
23
+ suggestions: f,
25
24
  triggerContent: M,
26
- onSuggestionSelect: x
25
+ onSuggestionSelect: I
27
26
  } = R;
28
- let p;
29
- e[0] !== c ? (p = c === void 0 ? [] : c, e[0] = c, e[1] = p) : p = e[1];
30
- const o = p, w = x === void 0 ? G : x, y = z(), C = b.useRef(null), [I, F] = b.useState(o);
31
- let g, a;
32
- e[2] !== o ? (g = () => {
33
- F(o);
34
- }, a = [o], e[2] = o, e[3] = g, e[4] = a) : (g = e[3], a = e[4]), b.useEffect(g, a);
35
- let s;
36
- e[5] !== y ? (s = (t) => {
37
- setTimeout(() => {
38
- y.setState({
39
- nodesDraggable: !t,
40
- nodesConnectable: !t,
41
- elementsSelectable: !t
42
- });
43
- }, 250);
44
- }, e[5] = y, e[6] = s) : s = e[6];
27
+ let c;
28
+ e[0] !== f ? (c = f === void 0 ? [] : f, e[0] = f, e[1] = c) : c = e[1];
29
+ const t = c, D = I === void 0 ? q : I, _ = y.useRef(null), [w, x] = y.useState(t);
30
+ let g, p;
31
+ e[2] !== t ? (g = () => {
32
+ x(t);
33
+ }, p = [t], e[2] = t, e[3] = g, e[4] = p) : (g = e[3], p = e[4]), y.useEffect(g, p);
45
34
  let i;
46
- e[7] !== M ? (i = /* @__PURE__ */ r(B, { asChild: !0, children: M }), e[7] = M, e[8] = i) : i = e[8];
35
+ e[5] !== M ? (i = /* @__PURE__ */ r(v, { asChild: !0, children: M }), e[5] = M, e[6] = i) : i = e[6];
36
+ let s;
37
+ e[7] !== t ? (s = /* @__PURE__ */ r($, { onType: (o) => {
38
+ o.key === "ArrowDown" ? (o.preventDefault(), _.current?.focusFirstItem()) : o.key === "ArrowUp" && (o.preventDefault(), _.current?.focusLastItem());
39
+ const T = o.target.value;
40
+ return x(t.filter((b) => b.displayText.some((j) => j.includes(T)))), o.preventDefault(), !1;
41
+ } }), e[7] = t, e[8] = s) : s = e[8];
42
+ let a;
43
+ e[9] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ r(C, {}), e[9] = a) : a = e[9];
47
44
  let n;
48
- e[9] !== o ? (n = /* @__PURE__ */ r(v, { onType: (t) => {
49
- t.key === "ArrowDown" ? (t.preventDefault(), C.current?.focusFirstItem()) : t.key === "ArrowUp" && (t.preventDefault(), C.current?.focusLastItem());
50
- const j = t.target.value;
51
- return F(o.filter((k) => k.displayText.some((E) => E.includes(j)))), t.preventDefault(), !1;
52
- } }), e[9] = o, e[10] = n) : n = e[10];
53
- let S;
54
- e[11] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ r(A, {}), e[11] = S) : S = e[11];
45
+ e[10] !== w ? (n = U(w), e[10] = w, e[11] = n) : n = e[11];
55
46
  let l;
56
- e[12] !== I ? (l = q(I), e[12] = I, e[13] = l) : l = e[13];
47
+ e[12] !== D ? (l = (o) => {
48
+ D(o.valueData);
49
+ }, e[12] = D, e[13] = l) : l = e[13];
57
50
  let u;
58
- e[14] !== w ? (u = (t) => {
59
- w(t.valueData);
60
- }, e[14] = w, e[15] = u) : u = e[15];
51
+ e[14] !== n || e[15] !== l ? (u = /* @__PURE__ */ r(L, { ref: _, suggestions: n, onSuggestionSelect: l }), e[14] = n, e[15] = l, e[16] = u) : u = e[16];
52
+ let S, d;
53
+ e[17] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ r(C, {}), d = /* @__PURE__ */ r(B, {}), e[17] = S, e[18] = d) : (S = e[17], d = e[18]);
61
54
  let m;
62
- e[16] !== u || e[17] !== l ? (m = /* @__PURE__ */ r(U, { ref: C, suggestions: l, onSuggestionSelect: u }), e[16] = u, e[17] = l, e[18] = m) : m = e[18];
63
- let d, h;
64
- e[19] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ r(A, {}), h = /* @__PURE__ */ r(P, {}), e[19] = d, e[20] = h) : (d = e[19], h = e[20]);
65
- let f;
66
- e[21] !== m || e[22] !== n ? (f = /* @__PURE__ */ r(L, { children: /* @__PURE__ */ T($, { align: "center", children: [
67
- n,
55
+ e[19] !== u || e[20] !== s ? (m = /* @__PURE__ */ r(A, { children: /* @__PURE__ */ F(P, { align: "center", children: [
56
+ s,
57
+ a,
58
+ u,
68
59
  S,
69
- m,
70
- d,
71
- h
72
- ] }) }), e[21] = m, e[22] = n, e[23] = f) : f = e[23];
73
- let D;
74
- return e[24] !== f || e[25] !== s || e[26] !== i ? (D = /* @__PURE__ */ T(O, { onOpenChange: s, children: [
60
+ d
61
+ ] }) }), e[19] = u, e[20] = s, e[21] = m) : m = e[21];
62
+ let h;
63
+ return e[22] !== m || e[23] !== i ? (h = /* @__PURE__ */ F(E, { children: [
75
64
  i,
76
- f
77
- ] }), e[24] = f, e[25] = s, e[26] = i, e[27] = D) : D = e[27], D;
65
+ m
66
+ ] }), e[22] = m, e[23] = i, e[24] = h) : h = e[24], h;
78
67
  };
79
- function G() {
68
+ function q() {
80
69
  }
81
70
  export {
82
- ce as DFlowSuggestionMenu
71
+ le as DFlowSuggestionMenu
83
72
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as o, jsxs as T, Fragment as d } from "react/jsx-runtime";
2
2
  import { DFlowSuggestionType as e } from "./DFlowSuggestion.view.js";
3
- import { IconCircleDot as c, IconCirclesRelation as u, IconFileFunctionFilled as a } from "@tabler/icons-react";
4
- import { Text as I } from "../text/Text.js";
3
+ import { IconCircleDot as c, IconCirclesRelation as s, IconFileFunctionFilled as a } from "@tabler/icons-react";
4
+ import { Text as u } from "../text/Text.js";
5
5
  const D = (p) => {
6
6
  const f = {
7
7
  [e.VALUE]: "Values",
@@ -12,12 +12,12 @@ const D = (p) => {
12
12
  const m = {
13
13
  [e.FUNCTION]: /* @__PURE__ */ o(a, { color: "#70ffb2", size: 16 }),
14
14
  [e.FUNCTION_COMBINATION]: /* @__PURE__ */ o(a, { color: "#70ffb2", size: 16 }),
15
- [e.REF_OBJECT]: /* @__PURE__ */ o(u, { color: "#FFBE0B", size: 16 }),
15
+ [e.REF_OBJECT]: /* @__PURE__ */ o(s, { color: "#FFBE0B", size: 16 }),
16
16
  [e.VALUE]: /* @__PURE__ */ o(c, { color: "#D90429", size: 16 }),
17
17
  [e.DATA_TYPE]: /* @__PURE__ */ o(c, { color: "#D90429", size: 16 })
18
18
  }, F = /* @__PURE__ */ T(d, { children: [
19
19
  m[i.type],
20
- /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(I, { display: "flex", style: {
20
+ /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(u, { display: "flex", style: {
21
21
  gap: ".5rem"
22
22
  }, children: i.displayText.map((t, r) => /* @__PURE__ */ o("span", { children: t }, r)) }) })
23
23
  ] });
@@ -31,6 +31,7 @@ const D = (p) => {
31
31
  }
32
32
  return {
33
33
  children: F,
34
+ insertMode: "replace",
34
35
  valueData: i,
35
36
  value: i.value,
36
37
  groupBy: n
@@ -16,16 +16,16 @@ import "../form/SwitchInput.js";
16
16
  import "../form/TextInput.js";
17
17
  import { Button as l } from "../button/Button.js";
18
18
  /* empty css */
19
- import { setElementKey as u } from "../form/Input.utils.js";
20
- const D = i.forwardRef((e, t) => {
19
+ import { clearInputElement as u } from "../form/Input.utils.js";
20
+ const D = i.forwardRef((p, t) => {
21
21
  t = t || i.useRef(null);
22
22
  const {
23
23
  clearable: m = !1,
24
- right: p,
24
+ right: e,
25
25
  ...n
26
- } = e, a = () => {
27
- t.current && u(t.current, "value", "", "change");
28
- }, r = [p];
26
+ } = p, a = () => {
27
+ u(t.current);
28
+ }, r = [e];
29
29
  return m && r.push(/* @__PURE__ */ o(l, { variant: "none", onClick: a, children: /* @__PURE__ */ o(s, { size: 13 }) })), /* @__PURE__ */ o(c, { wrapperComponent: {
30
30
  className: "d-flow-suggestion-search-input"
31
31
  }, right: r, type: "text", ref: t, ...n });
@@ -0,0 +1,3 @@
1
+ import { DFlowSuggestion } from './DFlowSuggestion.view';
2
+ import { DataTypeIdentifier } from '@code0-tech/sagittarius-graphql-types';
3
+ export declare const useValueSuggestions: (dataTypeIdentifier?: DataTypeIdentifier) => DFlowSuggestion[];
@@ -0,0 +1,44 @@
1
+ import n from "react";
2
+ import { useService as f, useStore as c } from "../../utils/contextStore.js";
3
+ import "merge-props";
4
+ import { DFlowDataTypeReactiveService as p } from "../d-flow-data-type/DFlowDataType.service.js";
5
+ import "js-md5";
6
+ import { DFlowSuggestionType as u } from "./DFlowSuggestion.view.js";
7
+ const E = (r) => {
8
+ const s = f(p), m = c(p), i = n.useMemo(() => r ? s?.getDataType(r) : void 0, [r, s, m]);
9
+ return n.useMemo(() => {
10
+ if (!i) return [];
11
+ const a = [];
12
+ return i.rules?.nodes?.forEach((e) => {
13
+ if (e?.variant === "ITEM_OF_COLLECTION")
14
+ e.config.items?.forEach((t) => {
15
+ a.push({
16
+ path: [],
17
+ type: u.VALUE,
18
+ displayText: [t.toString()],
19
+ value: {
20
+ __typename: "LiteralValue",
21
+ value: t
22
+ }
23
+ });
24
+ });
25
+ else if (e?.variant === "NUMBER_RANGE") {
26
+ const t = e.config;
27
+ if (t.from === null || t.from === void 0 || t.to === null || t.to === void 0) return;
28
+ for (let o = t.from; o <= t.to; o += t.steps ?? 1)
29
+ a.push({
30
+ path: [],
31
+ type: u.VALUE,
32
+ displayText: [o.toString() ?? ""],
33
+ value: {
34
+ __typename: "LiteralValue",
35
+ value: String(o)
36
+ }
37
+ });
38
+ }
39
+ }), a;
40
+ }, [i]);
41
+ };
42
+ export {
43
+ E as useValueSuggestions
44
+ };
@@ -1,4 +1,4 @@
1
- import { DataType, FlowType, FlowTypeSetting, Maybe, Scalars, TranslationConnection } from '@code0-tech/sagittarius-graphql-types';
1
+ import { DataType, FlowType, FlowTypeSetting, Maybe, Scalars, Translation } from '@code0-tech/sagittarius-graphql-types';
2
2
  export declare class FlowTypeView {
3
3
  /** Name of the function */
4
4
  private readonly _aliases?;
@@ -25,16 +25,16 @@ export declare class FlowTypeView {
25
25
  /** Time when this FlowType was last updated */
26
26
  private readonly _updatedAt?;
27
27
  constructor(flowType: FlowType);
28
- get aliases(): Maybe<TranslationConnection> | undefined;
28
+ get aliases(): Maybe<Array<Translation>> | undefined;
29
29
  get createdAt(): Maybe<Scalars["Time"]["output"]> | undefined;
30
- get descriptions(): Maybe<TranslationConnection> | undefined;
31
- get displayMessages(): Maybe<TranslationConnection> | undefined;
30
+ get descriptions(): Maybe<Array<Translation>> | undefined;
31
+ get displayMessages(): Maybe<Array<Translation>> | undefined;
32
32
  get editable(): Maybe<Scalars["Boolean"]["output"]> | undefined;
33
33
  get flowTypeSettings(): Maybe<Array<FlowTypeSetting>> | undefined;
34
34
  get id(): Maybe<Scalars["FlowTypeID"]["output"]> | undefined;
35
35
  get identifier(): Maybe<Scalars["String"]["output"]> | undefined;
36
36
  get inputType(): Maybe<DataType> | undefined;
37
- get names(): Maybe<TranslationConnection> | undefined;
37
+ get names(): Maybe<Array<Translation>> | undefined;
38
38
  get returnType(): Maybe<DataType> | undefined;
39
39
  get updatedAt(): Maybe<Scalars["Time"]["output"]> | undefined;
40
40
  json(): FlowType;
@@ -1,23 +1,33 @@
1
- function i(e, t, s) {
2
- return (t = n(t)) in e ? Object.defineProperty(e, t, { value: s, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = s, e;
1
+ import "../../utils/contextStore.js";
2
+ import "react";
3
+ import "merge-props";
4
+ import "../d-flow-data-type/rules/DFlowDataTypeRegexRule.js";
5
+ import "../d-flow-data-type/rules/DFlowDataTypeNumberRangeRule.js";
6
+ import "../d-flow-data-type/rules/DFlowDataTypeItemOfCollectionRule.js";
7
+ import "../d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js";
8
+ import "../d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js";
9
+ import "../d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js";
10
+ import { DataTypeView as n } from "../d-flow-data-type/DFlowDataType.view.js";
11
+ function e(i, t, s) {
12
+ return (t = d(t)) in i ? Object.defineProperty(i, t, { value: s, enumerable: !0, configurable: !0, writable: !0 }) : i[t] = s, i;
3
13
  }
4
- function n(e) {
5
- var t = d(e, "string");
14
+ function d(i) {
15
+ var t = p(i, "string");
6
16
  return typeof t == "symbol" ? t : t + "";
7
17
  }
8
- function d(e, t) {
9
- if (typeof e != "object" || !e) return e;
10
- var s = e[Symbol.toPrimitive];
18
+ function p(i, t) {
19
+ if (typeof i != "object" || !i) return i;
20
+ var s = i[Symbol.toPrimitive];
11
21
  if (s !== void 0) {
12
- var r = s.call(e, t);
22
+ var r = s.call(i, t);
13
23
  if (typeof r != "object") return r;
14
24
  throw new TypeError("@@toPrimitive must return a primitive value.");
15
25
  }
16
- return (t === "string" ? String : Number)(e);
26
+ return (t === "string" ? String : Number)(i);
17
27
  }
18
- class a {
28
+ class v {
19
29
  constructor(t) {
20
- i(this, "_aliases", void 0), i(this, "_createdAt", void 0), i(this, "_descriptions", void 0), i(this, "_displayMessages", void 0), i(this, "_editable", void 0), i(this, "_flowTypeSettings", void 0), i(this, "_id", void 0), i(this, "_identifier", void 0), i(this, "_inputType", void 0), i(this, "_names", void 0), i(this, "_returnType", void 0), i(this, "_updatedAt", void 0), this._aliases = t.aliases, this._createdAt = t.createdAt, this._descriptions = t.descriptions, this._displayMessages = t.displayMessages, this._editable = t.editable, this._flowTypeSettings = t.flowTypeSettings, this._id = t.id, this._identifier = t.identifier, this._inputType = t.inputType, this._names = t.names, this._returnType = t.returnType, this._updatedAt = t.updatedAt;
30
+ e(this, "_aliases", void 0), e(this, "_createdAt", void 0), e(this, "_descriptions", void 0), e(this, "_displayMessages", void 0), e(this, "_editable", void 0), e(this, "_flowTypeSettings", void 0), e(this, "_id", void 0), e(this, "_identifier", void 0), e(this, "_inputType", void 0), e(this, "_names", void 0), e(this, "_returnType", void 0), e(this, "_updatedAt", void 0), this._aliases = t.aliases, this._createdAt = t.createdAt, this._descriptions = t.descriptions, this._displayMessages = t.displayMessages, this._editable = t.editable, this._flowTypeSettings = t.flowTypeSettings, this._id = t.id, this._identifier = t.identifier, this._inputType = t.inputType ? new n(t.inputType).json : void 0, this._names = t.names, this._returnType = t.returnType ? new n(t.returnType).json : void 0, this._updatedAt = t.updatedAt, console.log(JSON.stringify(this.inputType)), console.log(this.inputType);
21
31
  }
22
32
  get aliases() {
23
33
  return this._aliases;
@@ -71,5 +81,5 @@ class a {
71
81
  }
72
82
  }
73
83
  export {
74
- a as FlowTypeView
84
+ v as FlowTypeView
75
85
  };
@@ -4,13 +4,13 @@ import "react";
4
4
  import "merge-props";
5
5
  import "../d-flow/DFlow.js";
6
6
  import { DFlowReactiveService as i } from "../d-flow/DFlow.service.js";
7
+ import "js-md5";
7
8
  import "../d-flow-data-type/rules/DFlowDataTypeRegexRule.js";
8
9
  import "../d-flow-data-type/rules/DFlowDataTypeNumberRangeRule.js";
9
10
  import "../d-flow-data-type/rules/DFlowDataTypeItemOfCollectionRule.js";
10
11
  import "../d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js";
11
12
  import "../d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js";
12
13
  import "../d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js";
13
- import "js-md5";
14
14
  const _ = (r) => {
15
15
  const t = m.c(1), e = p(i);
16
16
  c(i), e.getById(r);