@code0-tech/pictor 0.0.0-mvp.45 → 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.
- package/dist/assets/components/d-flow-input/DFlowInputDataType.style.css +1 -1
- package/dist/assets/components/d-flow-suggestion/DFlowSuggestionSearchInput.style.css +1 -1
- package/dist/components/d-flow/DFlow.service.js +31 -23
- package/dist/components/d-flow-data-type/DFlowDataType.service.d.ts +2 -2
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js +22 -13
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js +19 -13
- package/dist/components/d-flow-file/DFlowTabDefault.js +38 -37
- package/dist/components/d-flow-file/DFlowTabTrigger.js +1 -1
- package/dist/components/d-flow-input/DFlowInput.d.ts +11 -0
- package/dist/components/d-flow-input/DFlowInput.js +29 -0
- package/dist/components/d-flow-input/DFlowInputDefault.d.ts +2 -7
- package/dist/components/d-flow-input/DFlowInputNodeBadge.js +13 -13
- package/dist/components/d-flow-input/DFlowInputObject.d.ts +10 -0
- package/dist/components/d-flow-input/DFlowInputObject.js +83 -0
- package/dist/components/d-flow-input/DFlowInputObjectEditDialog.d.ts +16 -0
- package/dist/components/d-flow-input/DFlowInputObjectEditDialog.js +118 -0
- package/dist/components/d-flow-input/DFlowInputObjectTree.d.ts +16 -0
- package/dist/components/d-flow-input/DFlowInputObjectTree.js +99 -0
- package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +12 -12
- package/dist/components/d-flow-node/DFlowNodeReference.return.hook.d.ts +4 -0
- package/dist/components/d-flow-node/DFlowNodeReference.return.hook.js +77 -0
- package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +104 -103
- package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +43 -50
- package/dist/components/d-flow-validation/DNodeValidation.hook.js +44 -39
- package/dist/components/editor/Editor.js +15 -15
- package/dist/components/form/InputSuggestion.js +29 -29
- package/dist/components/form/useForm.d.ts +3 -3
- package/dist/components/form/useForm.js +16 -16
- package/dist/node_modules/prettier/plugins/babel.js +6674 -6685
- package/dist/node_modules/prettier/plugins/estree.js +2830 -2628
- package/dist/node_modules/prettier/standalone.js +1657 -1440
- package/dist/utils/generics.js +85 -97
- package/package.json +22 -22
|
@@ -4,50 +4,50 @@ import { MenuItem as L, MenuContent as F, MenuLabel as k } from "../menu/Menu.js
|
|
|
4
4
|
import i from "react";
|
|
5
5
|
import { ScrollArea as N, ScrollAreaViewport as O, ScrollAreaScrollbar as T, ScrollAreaThumb as j } from "../scroll-area/ScrollArea.js";
|
|
6
6
|
import { IconChevronDown as $, IconChevronUp as z } from "@tabler/icons-react";
|
|
7
|
-
const D = i.memo((
|
|
7
|
+
const D = i.memo((l) => {
|
|
8
8
|
const e = x.c(17), {
|
|
9
9
|
suggestion: n,
|
|
10
|
-
visibleIndex:
|
|
10
|
+
visibleIndex: u,
|
|
11
11
|
isActive: p,
|
|
12
12
|
inputRef: d,
|
|
13
13
|
onSelect: v,
|
|
14
14
|
onActivate: c,
|
|
15
15
|
itemRef: f
|
|
16
|
-
} =
|
|
17
|
-
if (
|
|
16
|
+
} = l;
|
|
17
|
+
if (u === null)
|
|
18
18
|
return null;
|
|
19
19
|
let m;
|
|
20
|
-
if (e[0] !== d || e[1] !== c || e[2] !==
|
|
20
|
+
if (e[0] !== d || e[1] !== c || e[2] !== u) {
|
|
21
21
|
const b = () => {
|
|
22
|
-
c(
|
|
22
|
+
c(u), d?.current?.focus({
|
|
23
23
|
preventScroll: !0
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
m = (M) => {
|
|
27
27
|
M.preventDefault(), b();
|
|
28
|
-
}, e[0] = d, e[1] = c, e[2] =
|
|
28
|
+
}, e[0] = d, e[1] = c, e[2] = u, e[3] = m;
|
|
29
29
|
} else
|
|
30
30
|
m = e[3];
|
|
31
31
|
const g = m;
|
|
32
32
|
let a;
|
|
33
|
-
e[4] !== c || e[5] !==
|
|
34
|
-
b.preventDefault(), b.stopPropagation(), c(
|
|
35
|
-
}, e[4] = c, e[5] =
|
|
33
|
+
e[4] !== c || e[5] !== u ? (a = (b) => {
|
|
34
|
+
b.preventDefault(), b.stopPropagation(), c(u);
|
|
35
|
+
}, e[4] = c, e[5] = u, e[6] = a) : a = e[6];
|
|
36
36
|
const y = a;
|
|
37
37
|
let C;
|
|
38
38
|
e[7] !== v || e[8] !== n ? (C = () => setTimeout(() => v(n), 0), e[7] = v, e[8] = n, e[9] = C) : C = e[9];
|
|
39
39
|
let o;
|
|
40
40
|
return e[10] !== g || e[11] !== y || e[12] !== p || e[13] !== f || e[14] !== n.children || e[15] !== C ? (o = /* @__PURE__ */ I(L, { textValue: "", onPointerDown: g, onPointerMove: y, onSelect: C, "data-focus": p, ref: f, children: n.children }), e[10] = g, e[11] = y, e[12] = p, e[13] = f, e[14] = n.children, e[15] = C, e[16] = o) : o = e[16], o;
|
|
41
|
-
}, (
|
|
41
|
+
}, (l, e) => l.suggestion === e.suggestion && l.visibleIndex === e.visibleIndex && l.isActive === e.isActive && l.inputRef === e.inputRef && l.onSelect === e.onSelect && l.onActivate === e.onActivate && l.itemRef === e.itemRef);
|
|
42
42
|
D.displayName = "SuggestionMenuItem";
|
|
43
|
-
const P = i.forwardRef((
|
|
43
|
+
const P = i.forwardRef((l, e) => {
|
|
44
44
|
const n = x.c(12);
|
|
45
|
-
let
|
|
46
|
-
n[0] !==
|
|
47
|
-
children:
|
|
45
|
+
let u, p, d;
|
|
46
|
+
n[0] !== l ? ({
|
|
47
|
+
children: u,
|
|
48
48
|
inputRef: p,
|
|
49
49
|
...d
|
|
50
|
-
} =
|
|
50
|
+
} = l, n[0] = l, n[1] = u, n[2] = p, n[3] = d) : (u = n[1], p = n[2], d = n[3]);
|
|
51
51
|
const v = i.useRef(null);
|
|
52
52
|
let c, f;
|
|
53
53
|
n[4] !== p ? (c = (g) => {
|
|
@@ -58,17 +58,17 @@ const P = i.forwardRef((u, e) => {
|
|
|
58
58
|
preventScroll: !0
|
|
59
59
|
}), n[4] = p, n[5] = c, n[6] = f) : (c = n[5], f = n[6]);
|
|
60
60
|
let m;
|
|
61
|
-
return n[7] !==
|
|
61
|
+
return n[7] !== u || n[8] !== d || n[9] !== c || n[10] !== f ? (m = /* @__PURE__ */ I(F, { ref: v, onContextMenuCapture: H, onInteractOutside: U, onCloseAutoFocus: q, onOpenAutoFocus: c, onFocusCapture: f, align: "start", sideOffset: 8, ...d, children: u }), n[7] = u, n[8] = d, n[9] = c, n[10] = f, n[11] = m) : m = n[11], m;
|
|
62
62
|
});
|
|
63
63
|
P.displayName = "InputSuggestionMenuContent";
|
|
64
|
-
const Z = i.memo(P), V = i.forwardRef((
|
|
64
|
+
const Z = i.memo(P), V = i.forwardRef((l, e) => {
|
|
65
65
|
const {
|
|
66
66
|
suggestions: n,
|
|
67
|
-
onSuggestionSelect:
|
|
67
|
+
onSuggestionSelect: u = () => {
|
|
68
68
|
},
|
|
69
69
|
inputRef: p,
|
|
70
70
|
...d
|
|
71
|
-
} =
|
|
71
|
+
} = l, v = i.useRef([]), c = i.useRef(/* @__PURE__ */ new Map()), [f, m] = i.useState({}), g = i.useRef(null), a = i.useCallback((t, r) => {
|
|
72
72
|
const s = g.current;
|
|
73
73
|
if (!(!r?.force && s === t) && (s !== null && v.current[s]?.removeAttribute("data-focus"), g.current = t, t !== null)) {
|
|
74
74
|
const h = v.current[t];
|
|
@@ -155,10 +155,10 @@ const Z = i.memo(P), V = i.forwardRef((u, e) => {
|
|
|
155
155
|
const t = g.current;
|
|
156
156
|
if (t === null || !o[t]) return;
|
|
157
157
|
const r = o[t];
|
|
158
|
-
return setTimeout(() =>
|
|
158
|
+
return setTimeout(() => u(r), 0), r;
|
|
159
159
|
},
|
|
160
160
|
clearActiveItem: () => a(null)
|
|
161
|
-
}), [
|
|
161
|
+
}), [u, a, o]);
|
|
162
162
|
const b = (t) => {
|
|
163
163
|
m((r) => ({
|
|
164
164
|
...r,
|
|
@@ -191,7 +191,7 @@ const Z = i.memo(P), V = i.forwardRef((u, e) => {
|
|
|
191
191
|
visibleIndex: S,
|
|
192
192
|
isActive: w,
|
|
193
193
|
inputRef: p,
|
|
194
|
-
onSelect:
|
|
194
|
+
onSelect: u,
|
|
195
195
|
onActivate: a,
|
|
196
196
|
itemRef: S !== null ? M(S) : void 0
|
|
197
197
|
}
|
|
@@ -203,14 +203,14 @@ const Z = i.memo(P), V = i.forwardRef((u, e) => {
|
|
|
203
203
|
});
|
|
204
204
|
V.displayName = "InputSuggestionMenuContentItems";
|
|
205
205
|
const _ = i.memo(V);
|
|
206
|
-
function H(
|
|
207
|
-
return
|
|
206
|
+
function H(l) {
|
|
207
|
+
return l.stopPropagation();
|
|
208
208
|
}
|
|
209
|
-
function U(
|
|
210
|
-
return
|
|
209
|
+
function U(l) {
|
|
210
|
+
return l.target instanceof HTMLInputElement && l.preventDefault();
|
|
211
211
|
}
|
|
212
|
-
function q(
|
|
213
|
-
return
|
|
212
|
+
function q(l) {
|
|
213
|
+
return l.preventDefault();
|
|
214
214
|
}
|
|
215
215
|
export {
|
|
216
216
|
Z as InputSuggestionMenuContent,
|
|
@@ -8,9 +8,9 @@ export interface FormValidationProps<Values> {
|
|
|
8
8
|
onSubmit?: (values: Values) => void;
|
|
9
9
|
}
|
|
10
10
|
export interface ValidationProps<Value> {
|
|
11
|
-
initialValue?: Value |
|
|
12
|
-
defaultValue?: Value |
|
|
13
|
-
value?: Value |
|
|
11
|
+
initialValue?: Value | undefined;
|
|
12
|
+
defaultValue?: Value | undefined;
|
|
13
|
+
value?: Value | undefined;
|
|
14
14
|
required?: boolean;
|
|
15
15
|
formValidation?: {
|
|
16
16
|
setValue: (value: any) => void;
|
|
@@ -10,15 +10,15 @@ function S(r, t) {
|
|
|
10
10
|
if (typeof r != "object" || !r) return r;
|
|
11
11
|
var e = r[Symbol.toPrimitive];
|
|
12
12
|
if (e !== void 0) {
|
|
13
|
-
var
|
|
14
|
-
if (typeof
|
|
13
|
+
var i = e.call(r, t);
|
|
14
|
+
if (typeof i != "object") return i;
|
|
15
15
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16
16
|
}
|
|
17
17
|
return (t === "string" ? String : Number)(r);
|
|
18
18
|
}
|
|
19
19
|
class f {
|
|
20
|
-
constructor(t, e,
|
|
21
|
-
c(this, "changeValue", void 0), c(this, "currentValues", void 0), c(this, "currentValidations", void 0), this.changeValue = t, this.currentValues = e, this.currentValidations =
|
|
20
|
+
constructor(t, e, i) {
|
|
21
|
+
c(this, "changeValue", void 0), c(this, "currentValues", void 0), c(this, "currentValidations", void 0), this.changeValue = t, this.currentValues = e, this.currentValidations = i;
|
|
22
22
|
}
|
|
23
23
|
isValid() {
|
|
24
24
|
if (!this.currentValidations) return !0;
|
|
@@ -30,14 +30,14 @@ class f {
|
|
|
30
30
|
return !0;
|
|
31
31
|
}
|
|
32
32
|
getInputProps(t) {
|
|
33
|
-
const e = this.currentValues[t],
|
|
33
|
+
const e = this.currentValues[t], i = e ?? null, u = t, a = (this.currentValidations && this.currentValidations[t] ? this.currentValidations[t] : (n) => null)(e, this.currentValues);
|
|
34
34
|
return {
|
|
35
35
|
// @ts-ignore – z.B. wenn dein Input `defaultValue` kennt
|
|
36
|
-
defaultValue:
|
|
37
|
-
initialValue:
|
|
36
|
+
defaultValue: i,
|
|
37
|
+
initialValue: i || void 0,
|
|
38
38
|
formValidation: {
|
|
39
|
-
setValue: (
|
|
40
|
-
this.changeValue(u,
|
|
39
|
+
setValue: (n) => {
|
|
40
|
+
this.changeValue(u, n);
|
|
41
41
|
},
|
|
42
42
|
notValidMessage: a,
|
|
43
43
|
valid: a === null
|
|
@@ -52,11 +52,11 @@ const _ = (r) => {
|
|
|
52
52
|
const {
|
|
53
53
|
initialValues: t,
|
|
54
54
|
validate: e = {},
|
|
55
|
-
truthyValidationBeforeSubmit:
|
|
55
|
+
truthyValidationBeforeSubmit: i = !0,
|
|
56
56
|
onSubmit: u
|
|
57
|
-
} = r, [o, a] = b(t),
|
|
57
|
+
} = r, [o, a] = b(t), n = p(t);
|
|
58
58
|
y(() => {
|
|
59
|
-
a(t),
|
|
59
|
+
a(t), n.current = t;
|
|
60
60
|
}, [t]);
|
|
61
61
|
const s = d((l, m) => {
|
|
62
62
|
a((g) => {
|
|
@@ -64,12 +64,12 @@ const _ = (r) => {
|
|
|
64
64
|
...g,
|
|
65
65
|
[l]: m
|
|
66
66
|
};
|
|
67
|
-
return
|
|
67
|
+
return n.current = V, V;
|
|
68
68
|
});
|
|
69
69
|
}, []), h = P(() => new f(s, o, e), [s, o, e]), v = d(() => {
|
|
70
|
-
const l = new f(s,
|
|
71
|
-
u && (!
|
|
72
|
-
}, [s, e, u,
|
|
70
|
+
const l = new f(s, n.current, e);
|
|
71
|
+
u && (!i || l.isValid()) && u(n.current);
|
|
72
|
+
}, [s, e, u, i]);
|
|
73
73
|
return [h, v];
|
|
74
74
|
};
|
|
75
75
|
export {
|