@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
@@ -0,0 +1,15 @@
1
+ import { __exports as r } from "../../_virtual/server.browser2.js";
2
+ import { __require as t } from "./cjs/react-dom-server-legacy.browser.production.js";
3
+ import { __require as a } from "./cjs/react-dom-server.browser.production.js";
4
+ import { __require as s } from "./cjs/react-dom-server-legacy.browser.development.js";
5
+ import { __require as _ } from "./cjs/react-dom-server.browser.development.js";
6
+ var i;
7
+ function v() {
8
+ if (i) return r;
9
+ i = 1;
10
+ var e, o;
11
+ return process.env.NODE_ENV === "production" ? (e = t(), o = a()) : (e = s(), o = _()), r.version = e.version, r.renderToString = e.renderToString, r.renderToStaticMarkup = e.renderToStaticMarkup, r.renderToReadableStream = o.renderToReadableStream, r.resume = o.resume, r;
12
+ }
13
+ export {
14
+ v as __require
15
+ };
@@ -4,6 +4,7 @@ import { DataType, DataTypeIdentifier, Flow, GenericMapper, NodeParameterValue }
4
4
  type GenericMappingResult = Record<string, DataTypeIdentifier>;
5
5
  type GenericReplacement = DataTypeIdentifier | GenericMapper;
6
6
  export type GenericMap = Map<string, GenericReplacement>;
7
+ export type GenericTargetMap = Map<string, string>;
7
8
  export declare const resolveGenericKeyMappings: (parameterType: DataTypeIdentifier, valueType: DataTypeIdentifier, genericKeys: string[]) => GenericMappingResult;
8
9
  export declare const replaceGenericKeysInType: (type: DataTypeIdentifier, genericMap: GenericMap) => DataTypeIdentifier;
9
10
  export declare const resolveAllGenericKeysInDataTypeObject: (genericObj: DataType, concreteObj: DataType, genericKeys: string[]) => Record<string, GenericReplacement | undefined>;
@@ -12,5 +13,6 @@ export declare const resolveGenericKeys: (func: FunctionDefinitionView, values:
12
13
  export declare function isMatchingDataTypeObject(source: DataType, target: DataType): boolean;
13
14
  export declare function isMatchingType(source: DataTypeIdentifier, target: DataTypeIdentifier): boolean;
14
15
  export declare const resolveType: (type: DataTypeIdentifier, service: DFlowDataTypeReactiveService) => DataTypeIdentifier;
16
+ export declare const targetForGenericKey: (func: FunctionDefinitionView, target: DataTypeIdentifier) => GenericTargetMap;
15
17
  export declare const replaceGenericsAndSortType: (type: DataTypeIdentifier, genericKeys?: string[]) => DataTypeIdentifier;
16
18
  export {};
@@ -1,13 +1,13 @@
1
- const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isArray(e), T = (e) => y(e) ? "genericKey" in e || "genericType" in e || "dataType" in e : !1, A = (e) => y(e) && "target" in e && Array.isArray(e.sourceDataTypeIdentifiers), E = (e) => y(e) && "variant" in e && "identifier" in e, b = (e) => y(e) && "variant" in e && "config" in e, O = (e) => {
1
+ const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isArray(e), T = (e) => y(e) ? "genericKey" in e || "genericType" in e || "dataType" in e : !1, K = (e) => y(e) && "target" in e && Array.isArray(e.sourceDataTypeIdentifiers), E = (e) => y(e) && "variant" in e && "identifier" in e, b = (e) => y(e) && "variant" in e && "config" in e, O = (e) => {
2
2
  if (e)
3
3
  return typeof e == "string" ? e : e?.dataType?.identifier ?? e?.genericType?.dataType?.identifier ?? void 0;
4
4
  }, j = (e, n) => {
5
5
  if (e)
6
6
  return typeof e == "string" ? n && n.has(e) ? e : void 0 : e.genericKey ?? void 0;
7
- }, _ = (e) => !e || typeof e == "string" ? [] : e.genericType?.genericMappers ?? [], G = (e, n) => ({
7
+ }, _ = (e) => !e || typeof e == "string" ? [] : e.genericType?.genericMappers ?? [], P = (e, n) => ({
8
8
  ...e,
9
9
  sourceDataTypeIdentifiers: n
10
- }), R = (e) => {
10
+ }), w = (e) => {
11
11
  const n = e.genericCombinationStrategies ?? [];
12
12
  return new Set(n.map((i) => i.type));
13
13
  }, m = (e) => {
@@ -27,7 +27,7 @@ const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
27
27
  if (n.genericKey) return !0;
28
28
  const t = O(n), a = O(e);
29
29
  return !!t && t === a;
30
- }, z = (e, n) => {
30
+ }, R = (e, n) => {
31
31
  switch (e.__typename) {
32
32
  case "DataTypeRulesContainsKeyConfig":
33
33
  case "DataTypeRulesContainsTypeConfig":
@@ -51,32 +51,32 @@ const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
51
51
  default:
52
52
  return e;
53
53
  }
54
- }, w = (e, n, i) => {
55
- const t = {}, a = new Set(i), c = (s, r) => {
54
+ }, z = (e, n, i) => {
55
+ const t = {}, a = new Set(i), o = (s, r) => {
56
56
  if (!s || !r) return;
57
57
  const f = j(s, a);
58
58
  if (f && a.has(f)) {
59
59
  T(r) && (t[f] = r);
60
60
  return;
61
61
  }
62
- const o = _(s);
63
- if (o.length === 0) return;
62
+ const c = _(s);
63
+ if (c.length === 0) return;
64
64
  const u = _(r);
65
- for (const p of o) {
65
+ for (const p of c) {
66
66
  const l = u.find((g) => g.target === p.target);
67
67
  if (!l) continue;
68
- const d = (p.sourceDataTypeIdentifiers ?? []).map((g) => j(g, a)).filter((g) => !!g && a.has(g)), I = R(p), D = l.sourceDataTypeIdentifiers ?? [];
69
- if ((I.has("AND") || I.has("OR")) && D.length === 1 && d.length === (p.sourceDataTypeIdentifiers?.length ?? 0))
68
+ const d = (p.sourceDataTypeIdentifiers ?? []).map((g) => j(g, a)).filter((g) => !!g && a.has(g)), h = w(p), D = l.sourceDataTypeIdentifiers ?? [];
69
+ if ((h.has("AND") || h.has("OR")) && D.length === 1 && d.length === (p.sourceDataTypeIdentifiers?.length ?? 0))
70
70
  for (const g of d)
71
71
  t[g] = D[0];
72
72
  else {
73
73
  const g = Math.min(p.sourceDataTypeIdentifiers?.length ?? 0, D.length);
74
- for (let K = 0; K < g; K++)
75
- c(p.sourceDataTypeIdentifiers[K], D[K]);
74
+ for (let A = 0; A < g; A++)
75
+ o(p.sourceDataTypeIdentifiers[A], D[A]);
76
76
  }
77
77
  }
78
78
  };
79
- return c(e, n), t;
79
+ return o(e, n), t;
80
80
  }, M = (e, n) => {
81
81
  if (!T(e)) return e;
82
82
  const {
@@ -84,21 +84,21 @@ const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
84
84
  genericType: t
85
85
  } = e;
86
86
  if (i && n.has(i)) {
87
- const c = n.get(i);
88
- return c && T(c) ? c : e;
87
+ const o = n.get(i);
88
+ return o && T(o) ? o : e;
89
89
  }
90
90
  if (!t) return e;
91
- const a = (t.genericMappers ?? []).map((c) => {
91
+ const a = (t.genericMappers ?? []).map((o) => {
92
92
  const s = [];
93
- for (const r of c.sourceDataTypeIdentifiers ?? []) {
93
+ for (const r of o.sourceDataTypeIdentifiers ?? []) {
94
94
  if (!r) continue;
95
95
  const f = r.genericKey;
96
96
  if (f && n.has(f)) {
97
- const o = n.get(f);
98
- o && A(o) ? s.push(...o.sourceDataTypeIdentifiers) : o && T(o) ? s.push(o) : s.push(r);
97
+ const c = n.get(f);
98
+ c && K(c) ? s.push(...c.sourceDataTypeIdentifiers) : c && T(c) ? s.push(c) : s.push(r);
99
99
  } else T(r) ? s.push(M(r, n)) : s.push(r);
100
100
  }
101
- return G(c, s);
101
+ return P(o, s);
102
102
  });
103
103
  return {
104
104
  ...e,
@@ -108,52 +108,52 @@ const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
108
108
  }
109
109
  };
110
110
  }, J = (e, n, i) => {
111
- const t = {}, a = new Set(i), c = (s, r, f) => {
111
+ const t = {}, a = new Set(i), o = (s, r, f) => {
112
112
  if (!(!s || !r || a.size === 0)) {
113
113
  if (T(s)) {
114
- const o = s.genericKey;
115
- if (o && a.has(o) && (f ? t[o] = f : (A(r) || T(r)) && (t[o] = r), a.delete(o), a.size === 0))
114
+ const c = s.genericKey;
115
+ if (c && a.has(c) && (f ? t[c] = f : (K(r) || T(r)) && (t[c] = r), a.delete(c), a.size === 0))
116
116
  return;
117
117
  }
118
- if (A(s) && A(r)) {
119
- const o = Math.min(s.sourceDataTypeIdentifiers?.length, r.sourceDataTypeIdentifiers?.length);
120
- for (let u = 0; u < o; u++)
121
- if (c(s.sourceDataTypeIdentifiers[u], r.sourceDataTypeIdentifiers[u], r), a.size === 0) return;
118
+ if (K(s) && K(r)) {
119
+ const c = Math.min(s.sourceDataTypeIdentifiers?.length, r.sourceDataTypeIdentifiers?.length);
120
+ for (let u = 0; u < c; u++)
121
+ if (o(s.sourceDataTypeIdentifiers[u], r.sourceDataTypeIdentifiers[u], r), a.size === 0) return;
122
122
  return;
123
123
  }
124
124
  if (E(s) && E(r)) {
125
- const o = s.rules?.nodes ?? [], u = r.rules?.nodes ?? [], p = Math.min(o.length, u.length);
125
+ const c = s.rules?.nodes ?? [], u = r.rules?.nodes ?? [], p = Math.min(c.length, u.length);
126
126
  for (let l = 0; l < p; l++) {
127
- const d = o[l], I = u[l];
128
- if (!(!d || !I) && (c(d, I), a.size === 0))
127
+ const d = c[l], h = u[l];
128
+ if (!(!d || !h) && (o(d, h), a.size === 0))
129
129
  return;
130
130
  }
131
131
  return;
132
132
  }
133
133
  if (b(s) && b(r)) {
134
- c(s.config, r.config);
134
+ o(s.config, r.config);
135
135
  return;
136
136
  }
137
137
  if (Array.isArray(s) && Array.isArray(r)) {
138
- const o = Math.min(s.length, r.length);
139
- for (let u = 0; u < o; u++)
140
- if (c(s[u], r[u], f), a.size === 0) return;
138
+ const c = Math.min(s.length, r.length);
139
+ for (let u = 0; u < c; u++)
140
+ if (o(s[u], r[u], f), a.size === 0) return;
141
141
  return;
142
142
  }
143
143
  if (y(s) && y(r)) {
144
- for (const o of Object.keys(s))
145
- if (o in r && o !== "__typename" && (c(s[o], r[o], f), a.size === 0))
144
+ for (const c of Object.keys(s))
145
+ if (c in r && c !== "__typename" && (o(s[c], r[c], f), a.size === 0))
146
146
  return;
147
147
  }
148
148
  }
149
149
  };
150
- return c(e, n), t;
150
+ return o(e, n), t;
151
151
  }, Y = (e, n) => {
152
152
  const i = e.rules ? {
153
153
  ...e.rules,
154
154
  nodes: e.rules.nodes?.map((t) => t && {
155
155
  ...t,
156
- config: z(t.config, n)
156
+ config: R(t.config, n)
157
157
  })
158
158
  } : void 0;
159
159
  return {
@@ -161,18 +161,18 @@ const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
161
161
  rules: i
162
162
  };
163
163
  }, k = (e, n, i, t) => {
164
- const a = /* @__PURE__ */ new Map(), c = e?.genericKeys ?? [];
165
- if (!e?.parameterDefinitions || c.length <= 0) return a;
166
- const s = new Set(c);
164
+ const a = /* @__PURE__ */ new Map(), o = e?.genericKeys ?? [];
165
+ if (!e?.parameterDefinitions || o.length <= 0) return a;
166
+ const s = new Set(o);
167
167
  return e.parameterDefinitions.forEach((r, f) => {
168
- const o = r.dataTypeIdentifier, u = n[f], p = i.getTypeFromValue(u, t);
169
- if (!o || !p) return;
170
- const l = w(o, p, c);
171
- for (const [d, I] of Object.entries(l))
172
- s.has(d) && (a.has(d) || a.set(d, I));
168
+ const c = r.dataTypeIdentifier, u = n[f], p = i.getTypeFromValue(u, t);
169
+ if (!c || !p) return;
170
+ const l = z(c, p, o);
171
+ for (const [d, h] of Object.entries(l))
172
+ s.has(d) && (a.has(d) || a.set(d, h));
173
173
  }), a;
174
174
  };
175
- function L(e, n) {
175
+ function F(e, n) {
176
176
  if (e.variant !== n.variant) return !1;
177
177
  const i = n.rules?.nodes ?? [];
178
178
  if (i.length === 0) return !0;
@@ -194,12 +194,12 @@ function x(e, n) {
194
194
  return i.key !== t.key ? !1 : S(i.dataTypeIdentifier, t.dataTypeIdentifier);
195
195
  }
196
196
  case "INPUT_TYPES": {
197
- const i = e.config, a = n.config.inputTypes ?? [], c = i.inputTypes ?? [];
198
- return a.every((s) => c.some((r) => S(r.dataTypeIdentifier, s.dataTypeIdentifier)));
197
+ const i = e.config, a = n.config.inputTypes ?? [], o = i.inputTypes ?? [];
198
+ return a.every((s) => o.some((r) => S(r.dataTypeIdentifier, s.dataTypeIdentifier)));
199
199
  }
200
200
  case "ITEM_OF_COLLECTION": {
201
201
  const i = e.config.items ?? [], t = n.config.items ?? [];
202
- return i.length !== t.length ? !1 : i.every((a, c) => a === t[c]);
202
+ return i.length !== t.length ? !1 : i.every((a, o) => a === t[o]);
203
203
  }
204
204
  case "NUMBER_RANGE": {
205
205
  const i = e.config, t = n.config;
@@ -213,11 +213,11 @@ function x(e, n) {
213
213
  return JSON.stringify(m(e.config)) === JSON.stringify(m(n.config));
214
214
  }
215
215
  }
216
- function V(e, n) {
217
- const i = (s) => !!(s === C || T(s) && s.genericKey), t = (s, r) => i(s) || i(r) ? !0 : s == null || r == null ? s === r : Array.isArray(r) ? !Array.isArray(s) || s.length !== r.length ? !1 : s.every((f, o) => t(f, r[o])) : y(r) ? y(s) ? Object.keys(r).every((o) => t(s[o], r[o])) : !1 : s === r, a = m(e), c = m(n);
218
- return t(a, c);
216
+ function L(e, n) {
217
+ const i = (s) => !!(s === C || T(s) && s.genericKey), t = (s, r) => i(s) || i(r) ? !0 : s == null || r == null ? s === r : Array.isArray(r) ? !Array.isArray(s) || s.length !== r.length ? !1 : s.every((f, c) => t(f, r[c])) : y(r) ? y(s) ? Object.keys(r).every((c) => t(s[c], r[c])) : !1 : s === r, a = m(e), o = m(n);
218
+ return t(a, o);
219
219
  }
220
- const P = (e, n) => {
220
+ const G = (e, n) => {
221
221
  if (typeof e == "string") {
222
222
  const t = n.getDataType(e);
223
223
  if (!t) return e;
@@ -232,7 +232,7 @@ const P = (e, n) => {
232
232
  dataType: t.json,
233
233
  genericMappers: [{
234
234
  target: r,
235
- sourceDataTypeIdentifiers: [P(s, n)]
235
+ sourceDataTypeIdentifiers: [G(s, n)]
236
236
  }]
237
237
  }
238
238
  } : e;
@@ -243,7 +243,7 @@ const P = (e, n) => {
243
243
  if (!T(e) || !e.genericType) return e;
244
244
  const i = e.genericType.genericMappers?.map((t) => ({
245
245
  ...t,
246
- sourceDataTypeIdentifiers: t?.sourceDataTypeIdentifiers?.map((a) => P(a, n))
246
+ sourceDataTypeIdentifiers: t?.sourceDataTypeIdentifiers?.map((a) => G(a, n))
247
247
  })) ?? [];
248
248
  return {
249
249
  ...e,
@@ -252,59 +252,72 @@ const P = (e, n) => {
252
252
  genericMappers: i
253
253
  }
254
254
  };
255
- }, h = (e) => {
255
+ }, I = (e) => {
256
256
  if (Array.isArray(e)) {
257
- const n = e.map(h);
258
- return n.length <= 1 ? n : n.every(y) ? [...n].sort((a, c) => JSON.stringify(a).localeCompare(JSON.stringify(c))) : n.every((a) => !Array.isArray(a) && !y(a)) ? [...n].sort((a, c) => JSON.stringify(a).localeCompare(JSON.stringify(c))) : n;
257
+ const n = e.map(I);
258
+ return n.length <= 1 ? n : n.every(y) ? [...n].sort((a, o) => JSON.stringify(a).localeCompare(JSON.stringify(o))) : n.every((a) => !Array.isArray(a) && !y(a)) ? [...n].sort((a, o) => JSON.stringify(a).localeCompare(JSON.stringify(o))) : n;
259
259
  }
260
260
  if (y(e)) {
261
261
  const n = e;
262
- return Object.keys(n).sort().reduce((i, t) => (i[t] = h(n[t]), i), {});
262
+ return Object.keys(n).sort().reduce((i, t) => (i[t] = I(n[t]), i), {});
263
263
  }
264
264
  return e;
265
- }, F = (e, n = []) => {
265
+ }, V = (e, n) => {
266
+ if (!n.genericType) return /* @__PURE__ */ new Map();
267
+ const i = new Set(e.genericKeys ?? []), t = /* @__PURE__ */ new Map();
268
+ for (const a of n.genericType.genericMappers ?? []) {
269
+ const o = a.target;
270
+ if (!i.has(o))
271
+ for (const s of a.sourceDataTypeIdentifiers ?? []) {
272
+ const r = s.genericKey;
273
+ r && i.has(r) && t.set(r, o);
274
+ }
275
+ }
276
+ return t;
277
+ }, U = (e, n = []) => {
266
278
  const i = new Set(n), t = (r) => r ? i.size === 0 ? !0 : i.has(r) : !1, a = (r) => {
267
- const o = t(r.target) ? C : r.target, u = (r.sourceDataTypeIdentifiers ?? []).map((p) => s(p));
268
- return h({
279
+ const c = t(r.target) ? C : r.target, u = (r.sourceDataTypeIdentifiers ?? []).map((p) => s(p));
280
+ return I({
269
281
  ...r,
270
- target: o,
282
+ target: c,
271
283
  sourceDataTypeIdentifiers: u
272
284
  });
273
- }, c = (r) => {
274
- const o = t(r.genericKey) ? C : r.genericKey, u = {
285
+ }, o = (r) => {
286
+ const c = t(r.genericKey) ? C : r.genericKey, u = {
275
287
  ...r,
276
- genericKey: o,
288
+ genericKey: c,
277
289
  dataType: r.dataType ? s(r.dataType) : r.dataType,
278
290
  genericType: r.genericType ? s(r.genericType) : r.genericType
279
291
  };
280
- return h(u);
292
+ return I(u);
281
293
  };
282
294
  function s(r) {
283
295
  if (r == null) return r;
284
296
  if (Array.isArray(r)) {
285
- const f = r.map((o) => s(o));
286
- return h(f);
297
+ const f = r.map((c) => s(c));
298
+ return I(f);
287
299
  }
288
300
  if (T(r))
289
- return c(r);
290
- if (A(r))
301
+ return o(r);
302
+ if (K(r))
291
303
  return a(r);
292
304
  if (y(r)) {
293
- const f = Object.entries(r).reduce((o, [u, p]) => (o[u] = s(p), o), {});
294
- return h(f);
305
+ const f = Object.entries(r).reduce((c, [u, p]) => (c[u] = s(p), c), {});
306
+ return I(f);
295
307
  }
296
308
  return r;
297
309
  }
298
310
  return s(e);
299
311
  };
300
312
  export {
301
- L as isMatchingDataTypeObject,
302
- V as isMatchingType,
313
+ F as isMatchingDataTypeObject,
314
+ L as isMatchingType,
303
315
  Y as replaceGenericKeysInDataTypeObject,
304
316
  M as replaceGenericKeysInType,
305
- F as replaceGenericsAndSortType,
317
+ U as replaceGenericsAndSortType,
306
318
  J as resolveAllGenericKeysInDataTypeObject,
307
- w as resolveGenericKeyMappings,
319
+ z as resolveGenericKeyMappings,
308
320
  k as resolveGenericKeys,
309
- P as resolveType
321
+ G as resolveType,
322
+ V as targetForGenericKey
310
323
  };
@@ -1,28 +1,29 @@
1
- import { ContextStore as o, ContextStoreProvider as t, useService as i, useStore as c } from "./contextStore.js";
2
- import { InspectionSeverity as v } from "./inspection.js";
3
- import { NonReactiveArrayService as S, createNonReactiveArrayService as p } from "./nonReactiveArrayService.js";
4
- import { ObjectService as g, createObjectService as x } from "./objectStore.js";
5
- import { ReactiveArrayService as f, useReactiveArrayService as C } from "./reactiveArrayService.js";
6
- import { Colors as y } from "./types.js";
7
- import { getChild as P, getContent as u, getPositionAroundTarget as R, getPositioning as b, getWindowPositioning as j, mergeCode0Props as l, parseUnit as N } from "./utils.js";
1
+ import { ContextStore as t, ContextStoreProvider as o, useService as i, useStore as n } from "./contextStore.js";
2
+ import { InspectionSeverity as v, underlineBySeverity as a } from "./inspection.js";
3
+ import { NonReactiveArrayService as p, createNonReactiveArrayService as s } from "./nonReactiveArrayService.js";
4
+ import { ObjectService as x, createObjectService as m } from "./objectStore.js";
5
+ import { ReactiveArrayService as y, useReactiveArrayService as d } from "./reactiveArrayService.js";
6
+ import { Colors as u } from "./types.js";
7
+ import { getChild as P, getContent as R, getPositionAroundTarget as l, getPositioning as b, getWindowPositioning as j, mergeCode0Props as N, parseUnit as O } from "./utils.js";
8
8
  export {
9
- y as Colors,
10
- o as ContextStore,
11
- t as ContextStoreProvider,
9
+ u as Colors,
10
+ t as ContextStore,
11
+ o as ContextStoreProvider,
12
12
  v as InspectionSeverity,
13
- S as NonReactiveArrayService,
14
- g as ObjectService,
15
- f as ReactiveArrayService,
16
- p as createNonReactiveArrayService,
17
- x as createObjectService,
13
+ p as NonReactiveArrayService,
14
+ x as ObjectService,
15
+ y as ReactiveArrayService,
16
+ s as createNonReactiveArrayService,
17
+ m as createObjectService,
18
18
  P as getChild,
19
- u as getContent,
20
- R as getPositionAroundTarget,
19
+ R as getContent,
20
+ l as getPositionAroundTarget,
21
21
  b as getPositioning,
22
22
  j as getWindowPositioning,
23
- l as mergeCode0Props,
24
- N as parseUnit,
25
- C as useReactiveArrayService,
23
+ N as mergeCode0Props,
24
+ O as parseUnit,
25
+ a as underlineBySeverity,
26
+ d as useReactiveArrayService,
26
27
  i as useService,
27
- c as useStore
28
+ n as useStore
28
29
  };
@@ -1,4 +1,5 @@
1
- import { Maybe, Scalars, TranslationConnection } from '@code0-tech/sagittarius-graphql-types';
1
+ import { Maybe, Scalars, Translation } from '@code0-tech/sagittarius-graphql-types';
2
+ import { CSSProperties } from 'react';
2
3
  export declare enum InspectionSeverity {
3
4
  TYPO = 0,
4
5
  GRAMMAR = 1,
@@ -9,5 +10,6 @@ export declare enum InspectionSeverity {
9
10
  export interface ValidationResult {
10
11
  parameterId: Maybe<Scalars["ParameterDefinitionID"]["output"]>;
11
12
  type: InspectionSeverity;
12
- message: TranslationConnection;
13
+ message: Array<Translation>;
13
14
  }
15
+ export declare const underlineBySeverity: Record<InspectionSeverity, CSSProperties>;
@@ -1,4 +1,29 @@
1
- var A = /* @__PURE__ */ ((R) => (R[R.TYPO = 0] = "TYPO", R[R.GRAMMAR = 1] = "GRAMMAR", R[R.WEAK = 2] = "WEAK", R[R.WARNING = 3] = "WARNING", R[R.ERROR = 4] = "ERROR", R))(A || {});
1
+ var r = /* @__PURE__ */ ((d) => (d[d.TYPO = 0] = "TYPO", d[d.GRAMMAR = 1] = "GRAMMAR", d[d.WEAK = 2] = "WEAK", d[d.WARNING = 3] = "WARNING", d[d.ERROR = 4] = "ERROR", d))(r || {});
2
+ const o = (d, a = "5px 4px") => ({
3
+ paddingBottom: "0.2rem",
4
+ backgroundRepeat: "repeat-x",
5
+ backgroundPosition: "left bottom",
6
+ backgroundSize: a,
7
+ backgroundImage: `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='6' viewBox='0 0 12 6'> <path d='M0 3 Q3 0 6 3 T12 3' fill='none' stroke='${d}' stroke-width='2'/></svg>")`
8
+ }), g = {
9
+ 0: {
10
+ borderBottom: "1px dotted #3b82f6"
11
+ // blue
12
+ },
13
+ 1: {
14
+ borderBottom: "1px dashed #8b5cf6"
15
+ // violet
16
+ },
17
+ 2: {
18
+ borderBottom: "3px double #9ca3af"
19
+ // gray
20
+ },
21
+ 3: o("orange"),
22
+ // amber
23
+ 4: o("red")
24
+ // already yours
25
+ };
2
26
  export {
3
- A as InspectionSeverity
27
+ r as InspectionSeverity,
28
+ g as underlineBySeverity
4
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.0.0-mvp.29",
3
+ "version": "0.0.0-mvp.30",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {
@@ -20,7 +20,7 @@
20
20
  "@ariakit/react": "^0.4.17",
21
21
  "@babel/plugin-proposal-decorators": "^7.28.0",
22
22
  "@babel/plugin-transform-class-properties": "^7.27.1",
23
- "@code0-tech/sagittarius-graphql-types": "^0.0.0-968478cecf351385c6c13c2be8aeae5c45da026c",
23
+ "@code0-tech/sagittarius-graphql-types": "^0.0.0-a2b1f5e9adf8f52b5a0f235ca9906ac5a699b4fc",
24
24
  "@dagrejs/dagre": "^2.0.0",
25
25
  "@mdx-js/react": "^3.1.1",
26
26
  "@radix-ui/react-checkbox": "^1.3.3",
@@ -47,6 +47,7 @@
47
47
  "@tabler/icons-react": "3.35.0",
48
48
  "@types/jest-image-snapshot": "^6.4.0",
49
49
  "@types/react": "^19.2.7",
50
+ "@types/react-dom": "^19.2.3",
50
51
  "@vitejs/plugin-react": "^5.1.1",
51
52
  "@vitest/browser-playwright": "^4.0.14",
52
53
  "@vitest/coverage-v8": "^4.0.14",
@@ -64,9 +65,9 @@
64
65
  "merge-props": "^6.0.0",
65
66
  "overlap-area": "^1.1.0",
66
67
  "playwright": "1.57.0",
67
- "react": "^19.2.0",
68
- "react-dom": "^19.2.0",
69
- "react-resizable-panels": "^3.0.6",
68
+ "react": "^19.2.3",
69
+ "react-dom": "^19.2.3",
70
+ "react-resizable-panels": "^4.3.1",
70
71
  "react-zoom-pan-pinch": "^3.7.0",
71
72
  "rimraf": "^6.1.2",
72
73
  "sass": "^1.94.2",
@@ -93,7 +94,7 @@
93
94
  "types": "dist/index.d.ts",
94
95
  "peerDependencies": {
95
96
  "@ariakit/react": "^0.4.5",
96
- "@code0-tech/sagittarius-graphql-types": "^0.0.0-968478cecf351385c6c13c2be8aeae5c45da026c",
97
+ "@code0-tech/sagittarius-graphql-types": "^0.0.0-a2b1f5e9adf8f52b5a0f235ca9906ac5a699b4fc",
97
98
  "@radix-ui/react-checkbox": "^1.3.2",
98
99
  "@radix-ui/react-dialog": "^1.1.14",
99
100
  "@radix-ui/react-dropdown-menu": "^2.1.15",
@@ -111,7 +112,7 @@
111
112
  "overlap-area": "^1.1.0",
112
113
  "react": "^18.0.0 || ^19.0.0",
113
114
  "react-dom": "^18.0.0 || ^19.0.0",
114
- "react-resizable-panels": "^3.0.3",
115
+ "react-resizable-panels": "^3.0.3 || ^4.0.0",
115
116
  "react-zoom-pan-pinch": "^3.6.1",
116
117
  "sonner": "^2.0.7"
117
118
  },
@@ -119,6 +120,7 @@
119
120
  "access": "public"
120
121
  },
121
122
  "dependencies": {
122
- "@radix-ui/react-context-menu": "^2.2.16"
123
+ "@radix-ui/react-context-menu": "^2.2.16",
124
+ "react-contenteditable": "^3.3.7"
123
125
  }
124
126
  }
@@ -1,17 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { ResolvedVisualSelectionRange } from './InputSyntax';
3
- import { VisualizedInputSyntaxSegment } from './Input.syntax.hook';
4
- import { InputSuggestion } from './InputSuggestion';
5
- export declare const useSelectionVisibility: (inputRef: RefObject<HTMLInputElement | null>, syntaxRef: RefObject<HTMLDivElement | null>) => {
6
- ensureVisualIndexVisible: (visualIndex: number | null) => void;
7
- syncSyntaxScroll: () => void;
8
- };
9
- export declare const useSelectionNormalization: (transformSyntax: ((value: any, appliedSyntaxParts?: (InputSuggestion | any)[]) => any) | undefined, expandSelectionRangeToBlockBoundaries: (rawStart: number, rawEnd: number) => {
10
- start: number;
11
- end: number;
12
- hasBlockOverlap: boolean;
13
- }) => (target: HTMLInputElement) => void;
14
- export declare const useSelectionResolution: (transformSyntax: ((value: any, appliedSyntaxParts?: (InputSuggestion | any)[]) => any) | undefined, inputRef: RefObject<HTMLInputElement>, visualSelectionRange: {
15
- start: number;
16
- end: number;
17
- } | null, visualizedSyntaxSegments: VisualizedInputSyntaxSegment[], mapRawIndexToVisualIndex: (rawIndex: number) => number) => ResolvedVisualSelectionRange;
@@ -1,78 +0,0 @@
1
- import { c as M } from "../../_virtual/compiler-runtime.js";
2
- import _ from "react";
3
- import { useSyncSyntaxScroll as p, getSelectionMetrics as L, setSelectionRangeSafe as $ } from "./Input.utils.js";
4
- const A = (r, n) => {
5
- const t = M.c(6);
6
- let s;
7
- t[0] !== r || t[1] !== n ? (s = (u) => {
8
- if (u === null || !r.current || !n.current)
9
- return;
10
- const e = n.current, c = Math.round(u), m = e.querySelector(`[data-visual-index="${c}"]`);
11
- let f = null, i = null;
12
- if (m)
13
- f = m.offsetLeft, i = m.offsetLeft + m.offsetWidth;
14
- else {
15
- const E = Array.from(e.querySelectorAll("[data-visual-start][data-visual-end]")).find((d) => {
16
- const v = Number(d.dataset.visualStart), b = Number(d.dataset.visualEnd);
17
- return Number.isFinite(v) && Number.isFinite(b) && c >= v && c <= b;
18
- });
19
- if (E) {
20
- const d = Number(E.dataset.visualStart) || 0, v = Number(E.dataset.visualEnd) || d, b = E.offsetWidth, W = v === d ? 0 : (c - d) / (v - d);
21
- f = E.offsetLeft + b * W, i = f;
22
- }
23
- }
24
- if (f === null || i === null)
25
- return;
26
- const S = e.scrollLeft, N = S + e.clientWidth;
27
- let h = S;
28
- f - 8 < S ? h = Math.max(f - 8, 0) : i + 8 > N && (h = Math.max(i + 8 - e.clientWidth, 0)), h !== S && (r.current.scrollLeft = h, e.scrollLeft = h);
29
- }, t[0] = r, t[1] = n, t[2] = s) : s = t[2];
30
- const o = s, a = p(r, n);
31
- let l;
32
- return t[3] !== o || t[4] !== a ? (l = {
33
- ensureVisualIndexVisible: o,
34
- syncSyntaxScroll: a
35
- }, t[3] = o, t[4] = a, t[5] = l) : l = t[5], l;
36
- }, F = (r, n) => {
37
- const t = M.c(3);
38
- let s;
39
- return t[0] !== n || t[1] !== r ? (s = (o) => {
40
- if (!r)
41
- return;
42
- const {
43
- selectionStart: a,
44
- selectionEnd: l
45
- } = L(o);
46
- if (a === l)
47
- return;
48
- const {
49
- start: u,
50
- end: e,
51
- hasBlockOverlap: c
52
- } = n(a, l);
53
- c && (u === a && e === l || $(o, u, e));
54
- }, t[0] = n, t[1] = r, t[2] = s) : s = t[2], s;
55
- }, O = (r, n, t, s, o) => _.useMemo(() => {
56
- if (!r) return null;
57
- const a = n.current;
58
- if (!a) return t;
59
- const {
60
- rawStart: l,
61
- rawEnd: u
62
- } = L(a);
63
- if (l === u) return null;
64
- let e = o(l), c = o(u);
65
- s.forEach((i) => {
66
- i.type !== "block" || !(l < i.end && u > i.start) || (e = Math.min(e, i.visualStart), c = Math.max(c, i.visualEnd));
67
- });
68
- const m = Math.min(e, c), f = Math.max(e, c);
69
- return {
70
- start: m,
71
- end: f
72
- };
73
- }, [n, o, r, t, s]);
74
- export {
75
- F as useSelectionNormalization,
76
- O as useSelectionResolution,
77
- A as useSelectionVisibility
78
- };
@@ -1,19 +0,0 @@
1
- import { default as React } from 'react';
2
- import { VisualizedInputSyntaxSegment } from './Input.syntax.hook';
3
- import { InputSuggestion } from './InputSuggestion';
4
- export type ResolvedVisualSelectionRange = {
5
- start: number;
6
- end: number;
7
- } | null;
8
- export interface InputSyntaxProps {
9
- transformSyntax?: ((value: any, appliedSyntaxParts?: (InputSuggestion | any)[]) => any);
10
- syntaxRef: React.RefObject<HTMLDivElement | null>;
11
- visualizedSyntaxSegments: VisualizedInputSyntaxSegment[];
12
- resolvedVisualSelectionRange: ResolvedVisualSelectionRange;
13
- visualCaretIndex: number | null;
14
- isFocused: boolean;
15
- onPointerDown: (event: React.PointerEvent<HTMLDivElement>) => void;
16
- onPointerMove: (event: React.PointerEvent<HTMLDivElement>) => void;
17
- onPointerUp: (event: React.PointerEvent<HTMLDivElement>) => void;
18
- }
19
- export declare const InputSyntax: React.FC<InputSyntaxProps>;