@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,58 +1,63 @@
1
- import S from "react";
2
- import { DFlowDataTypeReactiveService as E } from "../d-flow-data-type/DFlowDataType.service.js";
3
- import { DataTypeView as C } from "../d-flow-data-type/DFlowDataType.view.js";
4
- import { useService as V, useStore as _ } from "../../utils/contextStore.js";
5
- import { InspectionSeverity as P } from "../../utils/inspection.js";
1
+ import V from "react";
2
+ import { DFlowDataTypeReactiveService as x } from "../d-flow-data-type/DFlowDataType.service.js";
3
+ import { DataTypeView as q } from "../d-flow-data-type/DFlowDataType.view.js";
4
+ import { useService as _, useStore as R } from "../../utils/contextStore.js";
5
+ import { InspectionSeverity as z } from "../../utils/inspection.js";
6
6
  import "merge-props";
7
7
  import "js-md5";
8
- import { resolveGenericKeys as U, replaceGenericKeysInType as q, replaceGenericKeysInDataTypeObject as z } from "../../utils/generics.js";
9
- import { useReturnType as H } from "../d-flow-function/DFlowFunction.return.hook.js";
10
- import { DFlowFunctionReactiveService as G } from "../d-flow-function/DFlowFunction.service.js";
11
- import { useDataTypeValidation as O } from "./DDataTypeValidation.hook.js";
12
- import { useValueValidation as w } from "./DValueValidation.hook.js";
8
+ import { resolveGenericKeys as H, replaceGenericKeysInType as J, replaceGenericKeysInDataTypeObject as L } from "../../utils/generics.js";
9
+ import { useReturnType as Q } from "../d-flow-function/DFlowFunction.return.hook.js";
10
+ import { DFlowFunctionReactiveService as E } from "../d-flow-function/DFlowFunction.service.js";
11
+ import { useDataTypeValidation as G } from "./DDataTypeValidation.hook.js";
12
+ import { useValueValidation as O } from "./DValueValidation.hook.js";
13
13
  import "../d-flow/DFlow.js";
14
14
  import { DFlowReactiveService as M } from "../d-flow/DFlow.service.js";
15
- const N = (t) => t.__typename === "ReferenceValue", F = (t) => t.__typename === "NodeFunctionIdWrapper", b = (t, r) => new C(z(t.json, r)), W = (t, r, i) => ({
16
- parameterId: t,
17
- type: P.ERROR,
15
+ import { getReferenceType as X } from "../d-flow-node/DFlowNodeReference.return.hook.js";
16
+ import { DFlowTypeReactiveService as W } from "../d-flow-type/DFlowType.service.js";
17
+ const F = (r) => r.__typename === "ReferenceValue", I = (r) => r.__typename === "NodeFunctionIdWrapper", b = (r, i) => new q(L(r.json, i)), j = (r, i, n) => ({
18
+ parameterId: r,
19
+ type: z.ERROR,
18
20
  message: [{
19
21
  code: "en-US",
20
- content: `Argument of type ${i?.name[0]?.content} is not assignable to parameter of type ${r?.name[0]?.content}`
22
+ content: `Argument of type ${n?.name[0]?.content} is not assignable to parameter of type ${i?.name[0]?.content}`
21
23
  }]
22
- }), ae = (t, r) => {
23
- const i = V(G), j = _(G), f = V(M), I = _(M), n = V(E), K = _(E), s = f.getById(r), l = f.getNodeById(r, t), T = l?.parameters?.nodes?.map((e) => e?.value) ?? [], m = i.getById(l?.functionDefinition?.id), R = m?.parameterDefinitions ?? [], h = m?.genericKeys ?? [], D = S.useMemo(() => U(m, T, n, i, s), [m, T, n, K, s, I]), x = S.useCallback((e, a) => {
24
- if (F(e) && a?.variant !== "NODE" || N(e)) {
25
- const d = f.getNodeById(r, e.__typename == "NodeFunctionIdWrapper" ? e.id : e.__typename === "ReferenceValue" ? e.nodeFunctionId : void 0), o = i.getById(d?.functionDefinition?.id), g = d?.parameters?.nodes?.map((p) => p?.value) ?? [];
26
- return H(o, g, n, i);
24
+ }), ue = (r, i) => {
25
+ const n = _(E), $ = R(E), y = _(M), N = R(M), k = _(W), A = R(W), o = _(x), B = R(x), s = y.getById(i), T = y.getNodeById(i, r), g = T?.parameters?.nodes?.map((e) => e?.value) ?? [], f = n.getById(T?.functionDefinition?.id), S = f?.parameterDefinitions ?? [], w = f?.genericKeys ?? [], D = V.useMemo(() => H(f, g, o, n, s), [f, g, o, B, s, N]), K = V.useCallback((e, p) => {
26
+ if (I(e) && p?.variant !== "NODE") {
27
+ const a = y.getNodeById(i, e.__typename == "NodeFunctionIdWrapper" ? e.id : e.__typename === "ReferenceValue" ? e.nodeFunctionId : void 0), t = n.getById(a?.functionDefinition?.id), m = a?.parameters?.nodes?.map((d) => d?.value) ?? [];
28
+ return Q(t, m, o, n);
29
+ } else if (F(e)) {
30
+ const a = y.getNodeById(i, e.__typename == "NodeFunctionIdWrapper" ? e.id : e.__typename === "ReferenceValue" ? e.nodeFunctionId : void 0), t = n.getById(a?.functionDefinition?.id), m = k.getById(s?.type?.id)?.json();
31
+ return X(e, o, n, t, a, m);
27
32
  }
28
- return n.getTypeFromValue(e, s);
29
- }, [n, s, r, f, i]);
30
- return S.useMemo(() => {
33
+ return o.getTypeFromValue(e, s);
34
+ }, [o, s, i, y, n, A]);
35
+ return V.useMemo(() => {
31
36
  const e = [];
32
- for (let a = 0; a < R.length; a++) {
33
- const d = R[a], o = T[a], g = l?.parameters?.nodes?.find((v) => v?.parameterDefinition?.id === d.id);
34
- if (!o) continue;
35
- const p = d.dataTypeIdentifier, B = q(p, D), c = n.getDataType(B), $ = x(o, c), y = n.getDataType($);
36
- if (!c || !y) {
37
- e.push(W(g?.id, c, y));
37
+ for (let p = 0; p < S.length; p++) {
38
+ const a = S[p], t = g[p], m = T?.parameters?.nodes?.find((v) => v?.parameterDefinition?.id === a.id);
39
+ if (!t) continue;
40
+ const d = a.dataTypeIdentifier, h = J(d, D), c = o.getDataType(h), C = K(t, c), u = o.getDataType(C);
41
+ if (!c || !u) {
42
+ e.push(j(m?.id, c, u));
38
43
  continue;
39
44
  }
40
- const k = !!p?.genericType || !!p?.genericKey && h.includes(p.genericKey);
41
- let u = !0;
42
- if (k) {
45
+ const P = !!d?.genericType || !!d?.genericKey && w.includes(d.genericKey);
46
+ let l = !0;
47
+ if (P) {
43
48
  const v = b(c, D);
44
- if (N(o) || F(o) && c.variant !== "NODE") {
45
- const A = b(y, D);
46
- u = O(v, A);
49
+ if (F(t) || I(t) && c.variant !== "NODE") {
50
+ const U = b(u, D);
51
+ l = G(v, U);
47
52
  } else
48
- u = w(o, v, n, s, B?.genericType?.genericMappers, i);
53
+ l = O(t, v, o, s, h?.genericType?.genericMappers, n);
49
54
  } else
50
- N(o) || F(o) && c.variant !== "NODE" ? u = O(c, y) : u = w(o, c, n, s, [], i);
51
- u || e.push(W(g?.id, c, y));
55
+ F(t) || I(t) && c.variant !== "NODE" ? l = G(c, u) : l = O(t, c, o, s, [], n);
56
+ l || e.push(j(m?.id, c, u));
52
57
  }
53
58
  return e.length > 0 ? e : null;
54
- }, [s, l, T, m, R, h, D, x, t, r, j, I, K, n]);
59
+ }, [s, T, g, f, S, w, D, K, r, i, $, N, B, o]);
55
60
  };
56
61
  export {
57
- ae as useNodeValidation
62
+ ue as useNodeValidation
58
63
  };
@@ -1,4 +1,4 @@
1
- import { Flow, FlowConnection, Maybe, Namespace, NamespaceProject, NamespaceProjectUserAbilities, Runtime, RuntimeConnection, Scalars } from '@code0-tech/sagittarius-graphql-types';
1
+ import { Flow, FlowConnection, Maybe, Namespace, NamespaceProject, NamespaceProjectUserAbilities, NamespaceRoleConnection, Runtime, RuntimeConnection, Scalars } from '@code0-tech/sagittarius-graphql-types';
2
2
  export declare class DNamespaceProjectView {
3
3
  /** Time when this NamespaceProject was created */
4
4
  private readonly _createdAt?;
@@ -16,8 +16,12 @@ export declare class DNamespaceProjectView {
16
16
  private readonly _namespace?;
17
17
  /** The primary runtime for the project */
18
18
  private readonly _primaryRuntime?;
19
+ /** Roles assigned to this project */
20
+ private readonly _roles?;
19
21
  /** Runtimes assigned to this project */
20
22
  private readonly _runtimes?;
23
+ /** Slug of the project used in URLs to identify flows */
24
+ private readonly _slug?;
21
25
  /** Time when this NamespaceProject was last updated */
22
26
  private readonly _updatedAt?;
23
27
  /** Abilities for the current user on this NamespaceProject */
@@ -31,7 +35,9 @@ export declare class DNamespaceProjectView {
31
35
  get name(): Maybe<Scalars["String"]["output"]> | undefined;
32
36
  get namespace(): Maybe<Namespace> | undefined;
33
37
  get primaryRuntime(): Maybe<Runtime> | undefined;
38
+ get roles(): Maybe<NamespaceRoleConnection> | undefined;
34
39
  get runtimes(): Maybe<RuntimeConnection> | undefined;
40
+ get slug(): Maybe<Scalars["String"]["output"]> | undefined;
35
41
  get updatedAt(): Maybe<Scalars["Time"]["output"]> | undefined;
36
42
  get userAbilities(): Maybe<NamespaceProjectUserAbilities> | undefined;
37
43
  json(): NamespaceProject;
@@ -17,7 +17,7 @@ function u(i, t) {
17
17
  }
18
18
  class o {
19
19
  constructor(t) {
20
- e(this, "_createdAt", void 0), e(this, "_description", void 0), e(this, "_flow", void 0), e(this, "_flows", void 0), e(this, "_id", void 0), e(this, "_name", void 0), e(this, "_namespace", void 0), e(this, "_primaryRuntime", void 0), e(this, "_runtimes", void 0), e(this, "_updatedAt", void 0), e(this, "_userAbilities", void 0), this._createdAt = t.createdAt, this._description = t.description, this._flow = t.flow, this._flows = t.flows, this._id = t.id, this._name = t.name, this._namespace = t.namespace, this._primaryRuntime = t.primaryRuntime, this._runtimes = t.runtimes, this._updatedAt = t.updatedAt, this._userAbilities = t.userAbilities;
20
+ e(this, "_createdAt", void 0), e(this, "_description", void 0), e(this, "_flow", void 0), e(this, "_flows", void 0), e(this, "_id", void 0), e(this, "_name", void 0), e(this, "_namespace", void 0), e(this, "_primaryRuntime", void 0), e(this, "_roles", void 0), e(this, "_runtimes", void 0), e(this, "_slug", void 0), e(this, "_updatedAt", void 0), e(this, "_userAbilities", void 0), this._createdAt = t.createdAt, this._description = t.description, this._flow = t.flow, this._flows = t.flows, this._id = t.id, this._name = t.name, this._namespace = t.namespace, this._primaryRuntime = t.primaryRuntime, this._roles = t.roles, this._runtimes = t.runtimes, this._slug = t.slug, this._updatedAt = t.updatedAt, this._userAbilities = t.userAbilities;
21
21
  }
22
22
  get createdAt() {
23
23
  return this._createdAt;
@@ -43,9 +43,15 @@ class o {
43
43
  get primaryRuntime() {
44
44
  return this._primaryRuntime;
45
45
  }
46
+ get roles() {
47
+ return this._roles;
48
+ }
46
49
  get runtimes() {
47
50
  return this._runtimes;
48
51
  }
52
+ get slug() {
53
+ return this._slug;
54
+ }
49
55
  get updatedAt() {
50
56
  return this._updatedAt;
51
57
  }
@@ -1,9 +1,9 @@
1
1
  import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
2
  import m, { isValidElement as ce } from "react";
3
- import { createPortal as H } from "react-dom";
3
+ import { createPortal as K } from "react-dom";
4
4
  import "../../utils/contextStore.js";
5
5
  import { mergeCode0Props as ue } from "../../utils/utils.js";
6
- import de, { Prec as J, keymap as K, ViewPlugin as me, RangeSetBuilder as he, Decoration as F, EditorView as fe, WidgetType as ge } from "@uiw/react-codemirror";
6
+ import de, { Prec as _, keymap as J, ViewPlugin as me, RangeSetBuilder as he, Decoration as F, EditorView as fe, WidgetType as ge } from "@uiw/react-codemirror";
7
7
  import { json as pe, jsonParseLinter as ye } from "@codemirror/lang-json";
8
8
  import { syntaxTree as L } from "@codemirror/language";
9
9
  import { linter as be } from "@codemirror/lint";
@@ -15,7 +15,7 @@ import { tags as b, getStyleTags as Te } from "../../node_modules/@lezer/highlig
15
15
  import { hashToColor as v } from "../d-flow/DFlow.util.js";
16
16
  import '../../assets/components/editor/Editor.styles.css';/* empty css */
17
17
  import { Badge as y } from "../badge/Badge.js";
18
- import { IconExclamationCircle as xe, IconAlertTriangle as Ae, IconAlertSquareRounded as ke, IconInfoCircle as Ee, IconSpace as ze, IconArrowBarToRight as Pe, IconCornerDownLeft as je } from "@tabler/icons-react";
18
+ import { IconExclamationCircle as Ae, IconAlertTriangle as xe, IconAlertSquareRounded as ke, IconInfoCircle as Ee, IconSpace as ze, IconArrowBarToRight as Pe, IconCornerDownLeft as je } from "@tabler/icons-react";
19
19
  import { Text as a } from "../text/Text.js";
20
20
  import { Flex as k } from "../flex/Flex.js";
21
21
  import { Tooltip as E, TooltipTrigger as z, TooltipPortal as P, TooltipContent as j, TooltipArrow as V } from "../tooltip/Tooltip.js";
@@ -140,10 +140,10 @@ const Fe = Ce({
140
140
  } : {
141
141
  override: [w]
142
142
  }
143
- })), e.push(J.highest(K.of([{
143
+ })), e.push(_.highest(J.of([{
144
144
  key: "Tab",
145
145
  run: Re
146
- }]))), D && e.push(J.highest(K.of([{
146
+ }]))), D && e.push(_.highest(J.of([{
147
147
  key: "ArrowUp",
148
148
  run: (l) => (f || N(l), !0)
149
149
  }, {
@@ -165,15 +165,15 @@ const Fe = Ce({
165
165
  const l = new he(), u = Object.keys(g || {});
166
166
  return L(o.state).iterate({
167
167
  enter: (d) => {
168
- const x = o.state.doc.sliceString(d.from, d.to);
169
- if (x.includes(`
168
+ const A = o.state.doc.sliceString(d.from, d.to);
169
+ if (A.includes(`
170
170
  `)) return;
171
- const q = h?.(x), ae = Te(d)?.tags.map((A) => "name" in A ? A.name : void 0), _ = u.find((A) => ae?.includes(A));
172
- _ && !q ? l.add(d.from, d.to, F.replace({
173
- widget: new X(_, x),
171
+ const q = h?.(A), ae = Te(d)?.tags.map((x) => "name" in x ? x.name : void 0), H = u.find((x) => ae?.includes(x));
172
+ H && !q ? l.add(d.from, d.to, F.replace({
173
+ widget: new X(H, A),
174
174
  point: !0
175
175
  })) : q && l.add(d.from, d.to, F.replace({
176
- widget: new X(q, x),
176
+ widget: new X(q, A),
177
177
  point: !0
178
178
  }));
179
179
  }
@@ -237,7 +237,7 @@ const Fe = Ce({
237
237
  }, align: "center", children: [
238
238
  c.filter((e) => e.severity == "error").length > 0 ? /* @__PURE__ */ s(E, { children: [
239
239
  /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "red", children: [
240
- /* @__PURE__ */ t(xe, { size: 13 }),
240
+ /* @__PURE__ */ t(Ae, { size: 13 }),
241
241
  /* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "error").length })
242
242
  ] }) }),
243
243
  /* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
@@ -247,7 +247,7 @@ const Fe = Ce({
247
247
  ] }) : null,
248
248
  c.filter((e) => e.severity == "warning").length > 0 ? /* @__PURE__ */ s(E, { children: [
249
249
  /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "orange", children: [
250
- /* @__PURE__ */ t(Ae, { size: 13 }),
250
+ /* @__PURE__ */ t(xe, { size: 13 }),
251
251
  /* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "warning").length })
252
252
  ] }) }),
253
253
  /* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
@@ -316,13 +316,13 @@ const Fe = Ce({
316
316
  }, onUpdate: M, basicSetup: ee }),
317
317
  g && Array.from(oe.entries()).map(([e, n]) => {
318
318
  const o = g[n.type];
319
- return o ? H(/* @__PURE__ */ t("div", { style: {
319
+ return o ? K(/* @__PURE__ */ t("div", { style: {
320
320
  display: "contents"
321
321
  }, children: o({
322
322
  content: n.value
323
323
  }) }, e.outerHTML + n.value), e) : null;
324
324
  }),
325
- f && H(/* @__PURE__ */ t("div", { ref: B, style: {
325
+ f && K(/* @__PURE__ */ t("div", { ref: B, style: {
326
326
  position: "fixed",
327
327
  top: f.position.top,
328
328
  left: f.position.left,
@@ -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((u) => {
7
+ const D = i.memo((l) => {
8
8
  const e = x.c(17), {
9
9
  suggestion: n,
10
- visibleIndex: l,
10
+ visibleIndex: u,
11
11
  isActive: p,
12
12
  inputRef: d,
13
13
  onSelect: v,
14
14
  onActivate: c,
15
15
  itemRef: f
16
- } = u;
17
- if (l === null)
16
+ } = l;
17
+ if (u === null)
18
18
  return null;
19
19
  let m;
20
- if (e[0] !== d || e[1] !== c || e[2] !== l) {
20
+ if (e[0] !== d || e[1] !== c || e[2] !== u) {
21
21
  const b = () => {
22
- c(l), d?.current?.focus({
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] = l, e[3] = m;
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] !== l ? (a = (b) => {
34
- b.preventDefault(), b.stopPropagation(), c(l);
35
- }, e[4] = c, e[5] = l, e[6] = a) : a = e[6];
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
- }, (u, e) => u.suggestion === e.suggestion && u.visibleIndex === e.visibleIndex && u.isActive === e.isActive && u.inputRef === e.inputRef && u.onSelect === e.onSelect && u.onActivate === e.onActivate && u.itemRef === e.itemRef);
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((u, e) => {
43
+ const P = i.forwardRef((l, e) => {
44
44
  const n = x.c(12);
45
- let l, p, d;
46
- n[0] !== u ? ({
47
- children: l,
45
+ let u, p, d;
46
+ n[0] !== l ? ({
47
+ children: u,
48
48
  inputRef: p,
49
49
  ...d
50
- } = u, n[0] = u, n[1] = l, n[2] = p, n[3] = d) : (l = n[1], p = n[2], d = n[3]);
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] !== l || n[8] !== d || n[9] !== c || n[10] !== f ? (m = /* @__PURE__ */ I(F, { ref: v, forceMount: !0, onContextMenuCapture: H, onInteractOutside: U, onCloseAutoFocus: q, onOpenAutoFocus: c, onFocusCapture: f, align: "start", sideOffset: 8, ...d, children: l }), n[7] = l, n[8] = d, n[9] = c, n[10] = f, n[11] = m) : m = n[11], m;
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((u, e) => {
64
+ const Z = i.memo(P), V = i.forwardRef((l, e) => {
65
65
  const {
66
66
  suggestions: n,
67
- onSuggestionSelect: l = () => {
67
+ onSuggestionSelect: u = () => {
68
68
  },
69
69
  inputRef: p,
70
70
  ...d
71
- } = u, v = i.useRef([]), c = i.useRef(/* @__PURE__ */ new Map()), [f, m] = i.useState({}), g = i.useRef(null), a = i.useCallback((t, r) => {
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(() => l(r), 0), r;
158
+ return setTimeout(() => u(r), 0), r;
159
159
  },
160
160
  clearActiveItem: () => a(null)
161
- }), [l, a, o]);
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: l,
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(u) {
207
- return u.stopPropagation();
206
+ function H(l) {
207
+ return l.stopPropagation();
208
208
  }
209
- function U(u) {
210
- return u.target instanceof HTMLInputElement && u.preventDefault();
209
+ function U(l) {
210
+ return l.target instanceof HTMLInputElement && l.preventDefault();
211
211
  }
212
- function q(u) {
213
- return u.preventDefault();
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 | null;
12
- defaultValue?: Value | null;
13
- value?: Value | null;
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 n = e.call(r, t);
14
- if (typeof n != "object") return n;
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, n) {
21
- c(this, "changeValue", void 0), c(this, "currentValues", void 0), c(this, "currentValidations", void 0), this.changeValue = t, this.currentValues = e, this.currentValidations = n;
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], n = e ?? null, u = t, a = (this.currentValidations && this.currentValidations[t] ? this.currentValidations[t] : (i) => null)(e, this.currentValues);
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: n,
37
- initialValue: n,
36
+ defaultValue: i,
37
+ initialValue: i || void 0,
38
38
  formValidation: {
39
- setValue: (i) => {
40
- this.changeValue(u, i);
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: n = !0,
55
+ truthyValidationBeforeSubmit: i = !0,
56
56
  onSubmit: u
57
- } = r, [o, a] = b(t), i = p(t);
57
+ } = r, [o, a] = b(t), n = p(t);
58
58
  y(() => {
59
- a(t), i.current = 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 i.current = V, V;
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, i.current, e);
71
- u && (!n || l.isValid()) && u(i.current);
72
- }, [s, e, u, n]);
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 {