@code0-tech/pictor 0.0.0-mvp.36 → 0.0.0-mvp.38

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.
@@ -204,7 +204,7 @@ let z = b([w()], function(r) {
204
204
  static: !0,
205
205
  key: "validate",
206
206
  value: function(i, n) {
207
- return i.__typename !== "LiteralValue" || typeof i.value != "number" || !n.from || !n.to ? !1 : i.value >= n.from && i.value <= n.to;
207
+ return i.__typename !== "LiteralValue" || !n.from || !n.to ? !1 : i.value >= n.from && i.value <= n.to;
208
208
  }
209
209
  }]
210
210
  };
@@ -3,7 +3,7 @@ import w from "react";
3
3
  import { useService as f } from "../../utils/contextStore.js";
4
4
  import "merge-props";
5
5
  import "../d-flow/DFlow.js";
6
- import { DFlowReactiveService as I } from "../d-flow/DFlow.service.js";
6
+ import { DFlowReactiveService as V } from "../d-flow/DFlow.service.js";
7
7
  import "js-md5";
8
8
  import "../d-flow-data-type/rules/DFlowDataTypeRegexRule.js";
9
9
  import "../d-flow-data-type/rules/DFlowDataTypeNumberRangeRule.js";
@@ -11,48 +11,52 @@ import "../d-flow-data-type/rules/DFlowDataTypeItemOfCollectionRule.js";
11
11
  import "../d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js";
12
12
  import "../d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js";
13
13
  import "../d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js";
14
- import { Flex as V } from "../flex/Flex.js";
14
+ import { Flex as I } from "../flex/Flex.js";
15
15
  import { DFlowTypeReactiveService as b } from "../d-flow-type/DFlowType.service.js";
16
- import { useValueSuggestions as F } from "../d-flow-suggestion/DFlowValueSuggestions.hook.js";
17
- import { useDataTypeSuggestions as h } from "../d-flow-suggestion/DFlowDataTypeSuggestions.hook.js";
18
- import { toInputSuggestions as x } from "../d-flow-suggestion/DFlowSuggestionMenu.util.js";
16
+ import { useValueSuggestions as x } from "../d-flow-suggestion/DFlowValueSuggestions.hook.js";
17
+ import { useDataTypeSuggestions as F } from "../d-flow-suggestion/DFlowDataTypeSuggestions.hook.js";
18
+ import { toInputSuggestions as h } from "../d-flow-suggestion/DFlowSuggestionMenu.util.js";
19
19
  import { DFlowInputDataType as j } from "../d-flow-input/DFlowInputDataType.js";
20
- import { DFlowInputDefault as B } from "../d-flow-input/DFlowInputDefault.js";
21
- const X = (n) => {
20
+ import { DFlowInputDefault as L } from "../d-flow-input/DFlowInputDefault.js";
21
+ const X = (s) => {
22
22
  const {
23
23
  instance: r
24
- } = n, y = f(b), s = f(I), [, g] = w.useTransition(), o = y.getById(r.type?.id), m = {};
24
+ } = s, y = f(b), l = f(V), [, g] = w.useTransition(), o = y.getById(r.type?.id), m = {};
25
25
  return o?.flowTypeSettings?.forEach((e) => {
26
26
  const t = {
27
27
  dataType: e.dataType
28
- }, l = F(t), p = h(t);
29
- m[e.identifier] = [...l, ...p].sort();
30
- }), /* @__PURE__ */ T(V, { style: {
28
+ }, p = x(t), u = F(t);
29
+ m[e.identifier] = [...p, ...u].sort();
30
+ }), /* @__PURE__ */ T(I, { style: {
31
31
  gap: ".7rem",
32
32
  flexDirection: "column"
33
33
  }, children: [
34
34
  o?.inputType ? /* @__PURE__ */ c(j, { onDataTypeChange: (e) => {
35
- r.inputType = e, s.update();
35
+ r.inputType = e, l.update();
36
36
  }, initialValue: r.inputType || o.inputType, blockingDataType: o.inputType }) : null,
37
37
  o?.flowTypeSettings?.map((e) => {
38
- const t = r.settings?.nodes?.find((i) => i?.flowSettingIdentifier == e.identifier), l = e.names[0]?.content ?? "", p = e?.descriptions[0]?.content ?? "", v = m[e.identifier], S = (t?.value?.__typename === "LiteralValue", typeof t?.value == "object" ? JSON.stringify(t?.value) : t?.value), u = (i) => {
38
+ const t = r.settings?.nodes?.find((i) => i?.flowSettingIdentifier == e.identifier), p = e.names[0]?.content ?? "", u = e?.descriptions[0]?.content ?? "", v = m[e.identifier], S = (t?.value?.__typename === "LiteralValue", typeof t?.value == "object" ? JSON.stringify(t?.value) : t?.value), a = (i) => {
39
39
  g(async () => {
40
- i?.__typename == "LiteralValue" && e.identifier ? await s.setSettingValue(n.instance.id, String(e.identifier), i.value) : e.identifier && await s.setSettingValue(n.instance.id, String(e.identifier), i);
40
+ i?.__typename == "LiteralValue" && e.identifier ? await l.setSettingValue(s.instance.id, String(e.identifier), i.value) : e.identifier && await l.setSettingValue(s.instance.id, String(e.identifier), i);
41
41
  });
42
42
  }, d = (i) => {
43
43
  try {
44
- const a = JSON.parse(i.target.value);
45
- if (a.__typename == "LiteralValue") {
46
- u(a.value);
44
+ const n = JSON.parse(i.target.value);
45
+ if (n.__typename == "LiteralValue") {
46
+ a(n.value);
47
47
  return;
48
48
  }
49
- u(a);
49
+ a(n);
50
50
  } catch {
51
+ a({
52
+ value: i.target.innerText,
53
+ __typename: "LiteralValue"
54
+ });
51
55
  }
52
56
  };
53
- return /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(B, { flowId: void 0, nodeId: void 0, parameterId: void 0, title: l, description: p, clearable: !0, defaultValue: S, onBlur: d, onClear: d, onSuggestionSelect: (i) => {
54
- u(i.value);
55
- }, suggestions: x(v) }, e.identifier) });
57
+ return /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(L, { flowId: void 0, nodeId: void 0, parameterId: void 0, title: p, description: u, clearable: !0, defaultValue: S, onBlur: d, onClear: d, onSuggestionSelect: (i) => {
58
+ a(i.value);
59
+ }, suggestions: h(v) }, e.identifier) });
56
60
  })
57
61
  ] });
58
62
  };
@@ -1,10 +1,10 @@
1
- import { useService as d, useStore as v } from "../../utils/contextStore.js";
1
+ import { useService as p, useStore as a } from "../../utils/contextStore.js";
2
2
  import n from "react";
3
3
  import "merge-props";
4
- import { DFlowFunctionReactiveService as y } from "../d-flow-function/DFlowFunction.service.js";
4
+ import { DFlowFunctionReactiveService as g } from "../d-flow-function/DFlowFunction.service.js";
5
5
  import "js-md5";
6
6
  import "../d-flow/DFlow.js";
7
- import { DFlowReactiveService as F } from "../d-flow/DFlow.service.js";
7
+ import { DFlowReactiveService as S } from "../d-flow/DFlow.service.js";
8
8
  import "../d-flow-data-type/rules/DFlowDataTypeRegexRule.js";
9
9
  import "../d-flow-data-type/rules/DFlowDataTypeNumberRangeRule.js";
10
10
  import "../d-flow-data-type/rules/DFlowDataTypeItemOfCollectionRule.js";
@@ -16,11 +16,11 @@ import { useReferenceSuggestions as B } from "./DFlowReferenceSuggestions.hook.j
16
16
  import { useFunctionSuggestions as K } from "./DFlowFunctionSuggestions.hook.js";
17
17
  import { useDataTypeSuggestions as b } from "./DFlowDataTypeSuggestions.hook.js";
18
18
  const Q = (i, t, s) => {
19
- const c = d(y), m = v(y), u = d(F), f = v(F), e = n.useMemo(() => u.getNodeById(i, t), [i, u, f, t]), r = n.useMemo(() => e?.functionDefinition?.id ? c.getById(e.functionDefinition.id) : void 0, [m, c, e?.functionDefinition?.id]), o = n.useMemo(() => r?.parameterDefinitions?.find((M) => {
19
+ const D = p(g), d = a(g), v = p(S), y = a(S), e = n.useMemo(() => v.getNodeById(i, t), [i, y, t]), r = n.useMemo(() => e?.functionDefinition?.id ? D.getById(e.functionDefinition.id) : void 0, [d, e?.functionDefinition?.id]), o = n.useMemo(() => r?.parameterDefinitions?.find((M) => {
20
20
  const R = e?.parameters?.nodes?.find((T) => T?.id === s)?.parameterDefinition?.id;
21
21
  return M.id === R;
22
- }), [r?.parameterDefinitions, e])?.dataTypeIdentifier, p = r?.genericKeys ?? [], a = l(o), g = b(o), S = B(i, t, o, p), D = K(o, p);
23
- return n.useMemo(() => [...a, ...g, ...S, ...D].sort(), [i, t, s, m, f, a, g, S, D]);
22
+ }), [r?.parameterDefinitions, e])?.dataTypeIdentifier, c = r?.genericKeys ?? [], F = l(o), m = b(o), u = B(i, t, o, c), f = K(o, c);
23
+ return n.useMemo(() => [...F, ...m, ...u, ...f].sort(), [i, t, s, m, u, f]);
24
24
  };
25
25
  export {
26
26
  Q as useSuggestions
@@ -5,14 +5,14 @@ import { DFlowDataTypeReactiveService as p } from "../d-flow-data-type/DFlowData
5
5
  import "js-md5";
6
6
  import { DFlowSuggestionType as u } from "./DFlowSuggestion.view.js";
7
7
  const T = (r) => {
8
- const s = c(p), m = f(p), i = n.useMemo(() => r ? s?.getDataType(r) : void 0, [r, s, m]);
8
+ const a = c(p), m = f(p), i = n.useMemo(() => r ? a?.getDataType(r) : void 0, [r, a, m]);
9
9
  return n.useMemo(() => {
10
10
  if (!i) return [];
11
- const a = [];
11
+ const s = [];
12
12
  return i.rules?.nodes?.forEach((e) => {
13
13
  if (e?.variant === "ITEM_OF_COLLECTION")
14
14
  e.config.items?.forEach((t) => {
15
- a.push({
15
+ s.push({
16
16
  path: [],
17
17
  type: u.VALUE,
18
18
  displayText: [t.toString()],
@@ -25,8 +25,8 @@ const T = (r) => {
25
25
  else if (e?.variant === "NUMBER_RANGE") {
26
26
  const t = e.config;
27
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({
28
+ for (let o = t.from; o <= t.to; o += (t.steps ?? 1) <= 0 ? 1 : t.steps ?? 1)
29
+ s.push({
30
30
  path: [],
31
31
  type: u.VALUE,
32
32
  displayText: [o.toString() ?? ""],
@@ -36,7 +36,7 @@ const T = (r) => {
36
36
  }
37
37
  });
38
38
  }
39
- }), a;
39
+ }), s;
40
40
  }, [i]);
41
41
  };
42
42
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.0.0-mvp.36",
3
+ "version": "0.0.0-mvp.38",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {
@@ -66,7 +66,7 @@
66
66
  "js-md5": "^0.8.3",
67
67
  "merge-props": "^6.0.0",
68
68
  "overlap-area": "^1.1.0",
69
- "playwright": "1.57.0",
69
+ "playwright": "1.58.0",
70
70
  "react": "^19.2.3",
71
71
  "react-contenteditable": "^3.3.7",
72
72
  "react-dom": "^19.2.3",