@code0-tech/pictor 0.0.0-mvp.37 → 0.0.0-mvp.39

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.
@@ -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
  };
@@ -60,7 +60,7 @@ const oe = (n, t, o, m = []) => {
60
60
  if (!d) return [];
61
61
  const e = t.getDataType(d);
62
62
  if (!e || e.variant !== "NODE") return [];
63
- const c = a?.parameters?.nodes?.find((p) => p?.id === i?.id);
63
+ const c = a?.parameters?.nodes?.find((p) => p?.parameterDefinition?.id === i?.id);
64
64
  if (!c?.value || c.value.__typename !== "NodeFunctionIdWrapper") return [];
65
65
  const I = v?.find((p) => c?.value?.__typename === "NodeFunctionIdWrapper" && p.nodeFunctionId === c.value?.id);
66
66
  if (!I) return [];
@@ -108,7 +108,7 @@ const oe = (n, t, o, m = []) => {
108
108
  if (!I) break;
109
109
  if (c.parameters && I.parameterDefinitions)
110
110
  for (const f of I.parameterDefinitions) {
111
- const B = t.getDataType(f.dataTypeIdentifier), S = c.parameters?.nodes?.find((p) => p?.id === f.id);
111
+ const B = t.getDataType(f.dataTypeIdentifier), S = c.parameters?.nodes?.find((p) => p?.parameterDefinition?.id === f.id);
112
112
  if (B?.variant === "NODE") {
113
113
  if (S?.value && S.value.__typename === "NodeFunctionIdWrapper") {
114
114
  const p = [...e, D()];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.0.0-mvp.37",
3
+ "version": "0.0.0-mvp.39",
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",