@eccenca/gui-elements 23.1.0-rc.2 → 23.1.0-rc.4

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 (295) hide show
  1. package/CHANGELOG.md +54 -10
  2. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +6 -4
  3. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  4. package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js +33 -8
  5. package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
  6. package/dist/cjs/cmem/ConfidenceValue/ConfidenceValue.js +52 -0
  7. package/dist/cjs/cmem/ConfidenceValue/ConfidenceValue.js.map +1 -0
  8. package/dist/cjs/cmem/ConfidenceValue/index.js +14 -0
  9. package/dist/cjs/cmem/ConfidenceValue/index.js.map +1 -0
  10. package/dist/cjs/cmem/index.js +11 -0
  11. package/dist/cjs/cmem/index.js.map +1 -1
  12. package/dist/cjs/cmem/markdown/Markdown.js +8 -4
  13. package/dist/cjs/cmem/markdown/Markdown.js.map +1 -1
  14. package/dist/cjs/common/Intent/index.js +1 -0
  15. package/dist/cjs/common/Intent/index.js.map +1 -1
  16. package/dist/cjs/common/utils/CssCustomProperties.js.map +1 -1
  17. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +10 -1
  18. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  19. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +8 -10
  20. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
  21. package/dist/cjs/components/Card/Card.js +7 -6
  22. package/dist/cjs/components/Card/Card.js.map +1 -1
  23. package/dist/cjs/components/Card/CardContent.js +4 -2
  24. package/dist/cjs/components/Card/CardContent.js.map +1 -1
  25. package/dist/cjs/components/Card/CardHeader.js.map +1 -1
  26. package/dist/cjs/components/Depiction/Depiction.js +13 -13
  27. package/dist/cjs/components/Depiction/Depiction.js.map +1 -1
  28. package/dist/cjs/components/Icon/BaseIcon.js +4 -2
  29. package/dist/cjs/components/Icon/BaseIcon.js.map +1 -1
  30. package/dist/cjs/components/Icon/canonicalIconNames.js +7 -0
  31. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  32. package/dist/cjs/components/Pagination/Pagination.js +24 -9
  33. package/dist/cjs/components/Pagination/Pagination.js.map +1 -1
  34. package/dist/cjs/components/ProgressBar/index.js +14 -0
  35. package/dist/cjs/components/ProgressBar/index.js.map +1 -0
  36. package/dist/cjs/components/Separation/Divider.js +20 -2
  37. package/dist/cjs/components/Separation/Divider.js.map +1 -1
  38. package/dist/cjs/components/Switch/Switch.js +2 -2
  39. package/dist/cjs/components/Switch/Switch.js.map +1 -1
  40. package/dist/cjs/components/Table/Table.js +46 -0
  41. package/dist/cjs/components/Table/Table.js.map +1 -0
  42. package/dist/cjs/components/Table/TableCell.js +29 -0
  43. package/dist/cjs/components/Table/TableCell.js.map +1 -0
  44. package/dist/cjs/components/Table/TableContainer.js +32 -0
  45. package/dist/cjs/components/Table/TableContainer.js.map +1 -0
  46. package/dist/cjs/components/Table/TableExpandHeader.js +36 -0
  47. package/dist/cjs/components/Table/TableExpandHeader.js.map +1 -0
  48. package/dist/cjs/components/Table/TableExpandRow.js +45 -0
  49. package/dist/cjs/components/Table/TableExpandRow.js.map +1 -0
  50. package/dist/cjs/components/{SimpleTable/TableContainer.js → Table/TableRow.js} +9 -11
  51. package/dist/cjs/components/Table/TableRow.js.map +1 -0
  52. package/dist/cjs/components/Table/index.js +26 -0
  53. package/dist/cjs/components/Table/index.js.map +1 -0
  54. package/dist/cjs/components/Tag/TagList.js.map +1 -1
  55. package/dist/cjs/components/Tag/index.js +11 -0
  56. package/dist/cjs/components/Tag/index.js.map +1 -0
  57. package/dist/cjs/components/TextField/TextField.js +25 -9
  58. package/dist/cjs/components/TextField/TextField.js.map +1 -1
  59. package/dist/cjs/components/index.js +4 -0
  60. package/dist/cjs/components/index.js.map +1 -1
  61. package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js +20 -5
  62. package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
  63. package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js +82 -0
  64. package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js.map +1 -0
  65. package/dist/cjs/extensions/react-flow/edges/edgeTypes.js +10 -9
  66. package/dist/cjs/extensions/react-flow/edges/edgeTypes.js.map +1 -1
  67. package/dist/cjs/extensions/react-flow/handles/HandleContent.js.map +1 -1
  68. package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +14 -3
  69. package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
  70. package/dist/cjs/extensions/react-flow/index.js +14 -3
  71. package/dist/cjs/extensions/react-flow/index.js.map +1 -1
  72. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +118 -35
  73. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  74. package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js +5 -2
  75. package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
  76. package/dist/cjs/extensions/react-flow/versionsupport.js +20 -0
  77. package/dist/cjs/extensions/react-flow/versionsupport.js.map +1 -0
  78. package/dist/cjs/index.js +3 -19
  79. package/dist/cjs/index.js.map +1 -1
  80. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +6 -4
  81. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  82. package/dist/esm/cmem/ActivityControl/SilkActivityControl.js +35 -10
  83. package/dist/esm/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
  84. package/dist/esm/cmem/ConfidenceValue/ConfidenceValue.js +56 -0
  85. package/dist/esm/cmem/ConfidenceValue/ConfidenceValue.js.map +1 -0
  86. package/dist/esm/cmem/ConfidenceValue/index.js +2 -0
  87. package/dist/esm/cmem/ConfidenceValue/index.js.map +1 -0
  88. package/dist/esm/cmem/index.js +1 -0
  89. package/dist/esm/cmem/index.js.map +1 -1
  90. package/dist/esm/cmem/markdown/Markdown.js +8 -4
  91. package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
  92. package/dist/esm/common/Intent/index.js +1 -0
  93. package/dist/esm/common/Intent/index.js.map +1 -1
  94. package/dist/esm/common/utils/CssCustomProperties.js.map +1 -1
  95. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +10 -1
  96. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  97. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +8 -10
  98. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
  99. package/dist/esm/components/Card/Card.js +7 -6
  100. package/dist/esm/components/Card/Card.js.map +1 -1
  101. package/dist/esm/components/Card/CardContent.js +4 -2
  102. package/dist/esm/components/Card/CardContent.js.map +1 -1
  103. package/dist/esm/components/Card/CardHeader.js.map +1 -1
  104. package/dist/esm/components/Depiction/Depiction.js +15 -14
  105. package/dist/esm/components/Depiction/Depiction.js.map +1 -1
  106. package/dist/esm/components/Icon/BaseIcon.js +4 -2
  107. package/dist/esm/components/Icon/BaseIcon.js.map +1 -1
  108. package/dist/esm/components/Icon/canonicalIconNames.js +7 -0
  109. package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
  110. package/dist/esm/components/Pagination/Pagination.js +25 -10
  111. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  112. package/dist/esm/components/ProgressBar/index.js +2 -0
  113. package/dist/esm/components/ProgressBar/index.js.map +1 -0
  114. package/dist/esm/components/Separation/Divider.js +29 -3
  115. package/dist/esm/components/Separation/Divider.js.map +1 -1
  116. package/dist/esm/components/Switch/Switch.js +2 -2
  117. package/dist/esm/components/Switch/Switch.js.map +1 -1
  118. package/dist/esm/components/Table/Table.js +50 -0
  119. package/dist/esm/components/Table/Table.js.map +1 -0
  120. package/dist/esm/components/{SimpleTable/TableContainer.js → Table/TableCell.js} +8 -12
  121. package/dist/esm/components/Table/TableCell.js.map +1 -0
  122. package/dist/esm/components/Table/TableContainer.js +36 -0
  123. package/dist/esm/components/Table/TableContainer.js.map +1 -0
  124. package/dist/esm/components/Table/TableExpandHeader.js +40 -0
  125. package/dist/esm/components/Table/TableExpandHeader.js.map +1 -0
  126. package/dist/esm/components/Table/TableExpandRow.js +49 -0
  127. package/dist/esm/components/Table/TableExpandRow.js.map +1 -0
  128. package/dist/esm/components/Table/TableRow.js +33 -0
  129. package/dist/esm/components/Table/TableRow.js.map +1 -0
  130. package/dist/esm/components/Table/index.js +9 -0
  131. package/dist/esm/components/Table/index.js.map +1 -0
  132. package/dist/esm/components/Tag/TagList.js.map +1 -1
  133. package/dist/esm/components/Tag/index.js +4 -0
  134. package/dist/esm/components/Tag/index.js.map +1 -0
  135. package/dist/esm/components/TextField/TextField.js +26 -10
  136. package/dist/esm/components/TextField/TextField.js.map +1 -1
  137. package/dist/esm/components/index.js +4 -0
  138. package/dist/esm/components/index.js.map +1 -1
  139. package/dist/esm/extensions/react-flow/edges/EdgeDefault.js +20 -4
  140. package/dist/esm/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
  141. package/dist/esm/extensions/react-flow/edges/EdgeLabel.js +71 -0
  142. package/dist/esm/extensions/react-flow/edges/EdgeLabel.js.map +1 -0
  143. package/dist/esm/extensions/react-flow/edges/edgeTypes.js +10 -9
  144. package/dist/esm/extensions/react-flow/edges/edgeTypes.js.map +1 -1
  145. package/dist/esm/extensions/react-flow/handles/HandleContent.js.map +1 -1
  146. package/dist/esm/extensions/react-flow/handles/HandleDefault.js +15 -4
  147. package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
  148. package/dist/esm/extensions/react-flow/index.js +3 -1
  149. package/dist/esm/extensions/react-flow/index.js.map +1 -1
  150. package/dist/esm/extensions/react-flow/nodes/NodeContent.js +126 -40
  151. package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  152. package/dist/esm/extensions/react-flow/nodes/NodeDefault.js +5 -2
  153. package/dist/esm/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
  154. package/dist/esm/extensions/react-flow/versionsupport.js +32 -0
  155. package/dist/esm/extensions/react-flow/versionsupport.js.map +1 -0
  156. package/dist/esm/index.js +3 -8
  157. package/dist/esm/index.js.map +1 -1
  158. package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +1 -1
  159. package/dist/types/cmem/ActivityControl/SilkActivityControl.d.ts +6 -2
  160. package/dist/types/cmem/ConfidenceValue/ConfidenceValue.d.ts +46 -0
  161. package/dist/types/cmem/ConfidenceValue/index.d.ts +1 -0
  162. package/dist/types/cmem/index.d.ts +1 -0
  163. package/dist/types/cmem/markdown/Markdown.d.ts +6 -1
  164. package/dist/types/common/Intent/index.d.ts +1 -1
  165. package/dist/types/common/utils/CssCustomProperties.d.ts +1 -1
  166. package/dist/types/components/Card/Card.d.ts +5 -1
  167. package/dist/types/components/Card/CardContent.d.ts +7 -1
  168. package/dist/types/components/Card/CardHeader.d.ts +9 -1
  169. package/dist/types/components/Grid/Grid.d.ts +1 -1
  170. package/dist/types/components/Grid/GridColumn.d.ts +1 -1
  171. package/dist/types/components/Grid/GridRow.d.ts +1 -1
  172. package/dist/types/components/Icon/BaseIcon.d.ts +1 -1
  173. package/dist/types/components/Icon/IconButton.d.ts +1 -1
  174. package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
  175. package/dist/types/components/Pagination/Pagination.d.ts +5 -1
  176. package/dist/types/components/ProgressBar/index.d.ts +1 -0
  177. package/dist/types/components/Separation/Divider.d.ts +18 -2
  178. package/dist/types/components/Separation/Spacing.d.ts +1 -1
  179. package/dist/types/components/Switch/Switch.d.ts +5 -1
  180. package/dist/types/components/Table/Table.d.ts +32 -0
  181. package/dist/types/components/Table/TableCell.d.ts +11 -0
  182. package/dist/types/components/Table/TableContainer.d.ts +13 -0
  183. package/dist/types/components/Table/TableExpandHeader.d.ts +13 -0
  184. package/dist/types/components/Table/TableExpandRow.d.ts +17 -0
  185. package/dist/types/components/Table/TableRow.d.ts +10 -0
  186. package/dist/types/components/Table/index.d.ts +7 -0
  187. package/dist/types/components/Tag/Tag.d.ts +1 -1
  188. package/dist/types/components/Tag/TagList.d.ts +5 -2
  189. package/dist/types/components/Tag/index.d.ts +4 -0
  190. package/dist/types/components/TextField/TextField.d.ts +9 -0
  191. package/dist/types/components/index.d.ts +4 -0
  192. package/dist/types/extensions/react-flow/edges/EdgeDefault.d.ts +16 -1
  193. package/dist/types/extensions/react-flow/edges/EdgeLabel.d.ts +49 -0
  194. package/dist/types/extensions/react-flow/edges/edgeTypes.d.ts +10 -9
  195. package/dist/types/extensions/react-flow/handles/HandleContent.d.ts +3 -0
  196. package/dist/types/extensions/react-flow/handles/HandleDefault.d.ts +17 -3
  197. package/dist/types/extensions/react-flow/index.d.ts +3 -2
  198. package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +55 -8
  199. package/dist/types/extensions/react-flow/nodes/NodeDefault.d.ts +2 -1
  200. package/dist/types/extensions/react-flow/versionsupport.d.ts +7 -0
  201. package/dist/types/index.d.ts +1 -6
  202. package/package.json +2 -1
  203. package/src/cmem/ActivityControl/ActivityControlWidget.tsx +5 -5
  204. package/src/cmem/ActivityControl/SilkActivityControl.tsx +44 -17
  205. package/src/cmem/ConfidenceValue/ConfidenceValue.stories.tsx +22 -0
  206. package/src/cmem/ConfidenceValue/ConfidenceValue.tsx +116 -0
  207. package/src/cmem/ConfidenceValue/confidencevalue.scss +49 -0
  208. package/src/cmem/ConfidenceValue/index.ts +1 -0
  209. package/src/cmem/_index.scss +1 -0
  210. package/src/cmem/index.ts +2 -0
  211. package/src/cmem/markdown/Markdown.stories.tsx +3 -1
  212. package/src/cmem/markdown/Markdown.tsx +22 -10
  213. package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +2 -2
  214. package/src/cmem/react-flow/_edges.scss +3 -2
  215. package/src/cmem/react-flow/configuration/_colors-workflow.scss +3 -0
  216. package/src/common/Intent/index.ts +2 -1
  217. package/src/common/utils/CssCustomProperties.ts +1 -1
  218. package/src/components/AutoSuggestion/AutoSuggestion.scss +1 -0
  219. package/src/components/AutoSuggestion/AutoSuggestion.tsx +10 -1
  220. package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +8 -10
  221. package/src/components/AutoSuggestion/tests/SingleLineCodeEditor.test.tsx +5 -0
  222. package/src/components/Badge/badge.scss +2 -5
  223. package/src/components/Card/Card.tsx +11 -5
  224. package/src/components/Card/CardContent.tsx +12 -1
  225. package/src/components/Card/CardHeader.tsx +9 -1
  226. package/src/components/Card/card.scss +108 -3
  227. package/src/components/Checkbox/checkbox.scss +6 -2
  228. package/src/components/Depiction/Depiction.tsx +11 -10
  229. package/src/components/Grid/Grid.tsx +1 -1
  230. package/src/components/Grid/GridColumn.tsx +1 -1
  231. package/src/components/Grid/GridRow.tsx +1 -1
  232. package/src/components/Icon/BaseIcon.tsx +3 -0
  233. package/src/components/Icon/IconButton.tsx +1 -1
  234. package/src/components/Icon/canonicalIconNames.tsx +15 -0
  235. package/src/components/Menu/menu.scss +4 -0
  236. package/src/components/OverviewItem/overviewitem.scss +2 -2
  237. package/src/components/Pagination/Pagination.tsx +29 -9
  238. package/src/components/Pagination/pagination.scss +16 -0
  239. package/src/components/ProgressBar/index.ts +1 -0
  240. package/src/components/PropertyValuePair/propertyvalue.scss +4 -0
  241. package/src/components/Separation/Divider.tsx +36 -2
  242. package/src/components/Separation/Spacing.tsx +1 -1
  243. package/src/components/Separation/Stories/Divider.stories.tsx +22 -0
  244. package/src/components/Separation/separation.scss +31 -5
  245. package/src/components/Switch/Switch.tsx +6 -2
  246. package/src/components/Table/Table.tsx +88 -0
  247. package/src/components/Table/TableCell.tsx +37 -0
  248. package/src/components/Table/TableContainer.tsx +49 -0
  249. package/src/components/Table/TableExpandHeader.tsx +51 -0
  250. package/src/components/Table/TableExpandRow.tsx +70 -0
  251. package/src/components/Table/TableRow.tsx +36 -0
  252. package/src/components/Table/index.tsx +14 -0
  253. package/src/components/Table/table.scss +324 -0
  254. package/src/components/Tag/Tag.tsx +1 -1
  255. package/src/components/Tag/TagList.tsx +5 -3
  256. package/src/components/Tag/index.ts +5 -0
  257. package/src/components/Tag/{Tag.stories.tsx → stories/Tag.stories.tsx} +3 -2
  258. package/src/components/Tag/stories/TagList.stories.tsx +28 -0
  259. package/src/components/Tag/tag.scss +1 -0
  260. package/src/components/TextField/TextField.tsx +43 -12
  261. package/src/components/TextField/stories/TextField.stories.tsx +3 -0
  262. package/src/components/TextField/textfield.scss +23 -1
  263. package/src/components/Tree/tree.scss +4 -0
  264. package/src/components/Typography/typography.scss +2 -2
  265. package/src/components/index.scss +1 -0
  266. package/src/components/index.ts +5 -0
  267. package/src/extensions/react-flow/_config.scss +8 -4
  268. package/src/extensions/react-flow/edges/EdgeDefault.tsx +60 -5
  269. package/src/extensions/react-flow/edges/EdgeLabel.tsx +139 -0
  270. package/src/extensions/react-flow/edges/_edges.scss +214 -38
  271. package/src/extensions/react-flow/edges/edgeTypes.ts +13 -9
  272. package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +34 -13
  273. package/src/extensions/react-flow/edges/stories/EdgeLabel.stories.tsx +40 -0
  274. package/src/extensions/react-flow/handles/HandleContent.tsx +3 -0
  275. package/src/extensions/react-flow/handles/HandleDefault.tsx +47 -10
  276. package/src/extensions/react-flow/handles/stories/HandleDefault.stories.tsx +71 -0
  277. package/src/extensions/react-flow/index.ts +4 -2
  278. package/src/extensions/react-flow/nodes/NodeContent.tsx +239 -62
  279. package/src/extensions/react-flow/nodes/NodeDefault.tsx +7 -2
  280. package/src/extensions/react-flow/nodes/_nodes.scss +232 -67
  281. package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +67 -1
  282. package/src/extensions/react-flow/versionsupport.ts +22 -0
  283. package/src/index.scss +0 -1
  284. package/src/index.ts +5 -38
  285. package/dist/cjs/components/SimpleTable/TableContainer.js.map +0 -1
  286. package/dist/cjs/components/SimpleTable/index.js +0 -16
  287. package/dist/cjs/components/SimpleTable/index.js.map +0 -1
  288. package/dist/esm/components/SimpleTable/TableContainer.js.map +0 -1
  289. package/dist/esm/components/SimpleTable/index.js +0 -4
  290. package/dist/esm/components/SimpleTable/index.js.map +0 -1
  291. package/dist/types/components/SimpleTable/TableContainer.d.ts +0 -3
  292. package/dist/types/components/SimpleTable/index.d.ts +0 -3
  293. package/src/components/SimpleTable/TableContainer.tsx +0 -20
  294. package/src/components/SimpleTable/index.tsx +0 -4
  295. package/src/components/SimpleTable/simpletable.scss +0 -180
@@ -1,19 +1,29 @@
1
1
  import React from "react";
2
- import { Position, useStoreState } from "react-flow-renderer";
3
- import { Icon, Tooltip } from "../../../index";
2
+ import Color from "color";
3
+ import { Position, useStoreState as getStoreStateFlowLegacy } from "react-flow-renderer";
4
+ import { useStore as getStoreStateFlowNext } from "react-flow-renderer-lts";
5
+ import { Icon, Depiction, OverflowText } from "../../../index";
4
6
  import { CLASSPREFIX as eccgui } from "../../../configuration/constants";
5
7
  import { ValidIconName } from "../../../components/Icon/canonicalIconNames";
6
- import { HandleDefault, HandleProps } from "./../handles/HandleDefault";
8
+ import { DepictionProps } from "../../../components/Depiction/Depiction";
9
+ import { IntentTypes, intentClassName } from "../../../common/Intent";
10
+ import { ReacFlowVersionSupportProps, useReactFlowVersion } from "../versionsupport";
11
+ import { HandleDefault, HandleProps, HandleNextProps } from "./../handles/HandleDefault";
7
12
  import { NodeProps } from "./NodeDefault";
8
13
  import { NodeContentExtensionProps } from "./NodeContentExtension";
9
14
  import { Resizable } from "re-resizable";
10
15
 
11
16
  export type HighlightingState = "success" | "warning" | "danger" | "match" | "altmatch";
17
+ export type NodeHighlightColor = "default" | "alternate" | Color | string;
12
18
 
13
19
  export interface IHandleProps extends HandleProps {
14
20
  category?: "configuration";
15
21
  }
16
22
 
23
+ interface NodeContentHandleNextProps extends HandleNextProps {
24
+ category?: "configuration";
25
+ }
26
+
17
27
  export type NodeDimensions = {
18
28
  width: number;
19
29
  height: number;
@@ -26,13 +36,22 @@ interface NodeContentData<CONTENT_PROPS = any> {
26
36
  */
27
37
  iconName?: ValidIconName;
28
38
  /**
29
- * Valid and accessible URL or `data-uri` for an image that should be displayed before the node label.
39
+ * Depiction element that should be displayed before the node label.
40
+ * As alternative a valid and accessible URL or `data-uri` for an image can be set, then the Depiction element is created automatically.
30
41
  */
31
- depiction?: string;
42
+ depiction?: string | React.ReactElement<DepictionProps>;
43
+ /**
44
+ * Any element that should be displayed as depiction before the node label.
45
+ */
46
+ leftElement?: JSX.Element;
32
47
  /**
33
48
  * Label that is displayed in the node header.
34
49
  */
35
- label: string;
50
+ label: string | JSX.Element;
51
+ /**
52
+ * Element that is displayed as subline under the label in the header.
53
+ */
54
+ labelSubline?: JSX.Element;
36
55
  /**
37
56
  * Content element, displayed in the node body.
38
57
  */
@@ -48,7 +67,7 @@ interface NodeContentData<CONTENT_PROPS = any> {
48
67
  }
49
68
 
50
69
  export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any>
51
- extends NodeContentData,
70
+ extends NodeContentData, ReacFlowVersionSupportProps,
52
71
  React.HTMLAttributes<HTMLDivElement> {
53
72
  /**
54
73
  * Size of the node.
@@ -61,9 +80,35 @@ export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any>
61
80
  */
62
81
  minimalShape?: "none" | "circular" | "rectangular";
63
82
  /**
83
+ * Stretches the node to the full available width.
84
+ */
85
+ fullWidth?: boolean;
86
+ /**
87
+ * Increase the hight of the node header.
88
+ * Use this for example if you need more space for a label subline.
89
+ * Also the depiction is displayed larger.
90
+ */
91
+ enlargeHeader?: boolean;
92
+ /**
93
+ * @deprecated
64
94
  * Set the type of used highlights to mark the node.
95
+ * Replaced by `intent` and `highlightColor` properties.
65
96
  */
66
97
  highlightedState?: HighlightingState | HighlightingState[];
98
+ /**
99
+ * Defines how the borders of a node are displayed.
100
+ * Use this property to overwrite default styles.
101
+ * You can use this to visuaize different states or type without depending only on color.
102
+ */
103
+ border?: "solid" | "double" | "dashed" | "dotted";
104
+ /**
105
+ * Feedback state of the node.
106
+ */
107
+ intent?: IntentTypes;
108
+ /**
109
+ * Set the type of used highlights to mark the node.
110
+ */
111
+ highlightColor?: NodeHighlightColor | [NodeHighlightColor, NodeHighlightColor];
67
112
  /**
68
113
  * Text used for tooltip used on icon and depiction.
69
114
  */
@@ -90,7 +135,7 @@ export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any>
90
135
  * Array of property definition objects for `Handle` components that need to be created for the node.
91
136
  * @see https://reactflow.dev/docs/api/handle/
92
137
  */
93
- handles?: IHandleProps[];
138
+ handles?: IHandleProps[] | NodeContentHandleNextProps[];
94
139
  /**
95
140
  * Set the minimal number of handles on left or right side of the node to activate the recalculation of the minimal height of the node.
96
141
  */
@@ -153,14 +198,32 @@ export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any>
153
198
  nodeDimensions?: NodeDimensions;
154
199
  }
155
200
 
156
- interface MemoHandlerProps extends HandleProps {
201
+ interface MemoHandlerLegacyProps extends HandleProps {
202
+ posdirection: string;
203
+ style: {
204
+ [key: string]: string | undefined;
205
+ };
206
+ }
207
+
208
+ interface MemoHandlerNextProps extends HandleNextProps {
157
209
  posdirection: string;
158
210
  style: {
159
211
  [key: string]: string | undefined;
160
212
  };
161
213
  }
162
214
 
163
- const defaultHandles = [{ type: "target" }, { type: "source" }] as IHandleProps[];
215
+ type MemoHandlerProps = MemoHandlerLegacyProps | MemoHandlerNextProps;
216
+
217
+ const defaultHandles = (flowVersion: ReacFlowVersionSupportProps["flowVersion"]) => {
218
+ switch (flowVersion) {
219
+ case "legacy":
220
+ return [{ type: "target" }, { type: "source" }] as IHandleProps[];
221
+ case "next":
222
+ return [{ type: "target" }, { type: "source" }] as NodeContentHandleNextProps[];
223
+ default:
224
+ return [];
225
+ }
226
+ }
164
227
 
165
228
  const getDefaultMinimalTooltipData = (node: any) => {
166
229
  return {
@@ -171,7 +234,7 @@ const getDefaultMinimalTooltipData = (node: any) => {
171
234
  };
172
235
  };
173
236
 
174
- const addHandles = (handles: any, position: any, posDirection: any, isConnectable: any, nodeStyle: any) => {
237
+ const addHandles = (handles: any, position: any, posDirection: any, isConnectable: any, nodeStyle: any, flowVersion: any = "legacy") => {
175
238
  return handles[position].map((handle: any, idx: any) => {
176
239
  const { className, style = {}, category } = handle;
177
240
  const styleAdditions: { [key: string]: string } = {
@@ -191,33 +254,29 @@ const addHandles = (handles: any, position: any, posDirection: any, isConnectabl
191
254
  : className,
192
255
  },
193
256
  };
194
- return <MemoHandler {...handleProperties} key={"handle" + idx} />;
257
+ return <MemoHandler flowVersion={flowVersion} {...handleProperties} key={"handle" + idx} />;
195
258
  });
196
259
  };
197
260
 
198
- const imgWithTooltip = (imgEl: any, tooltipText: any) => {
199
- if (!!tooltipText) {
200
- return (
201
- <Tooltip content={tooltipText}>
202
- <span>{imgEl}</span>
203
- </Tooltip>
204
- );
205
- }
206
-
207
- return imgEl;
208
- };
209
-
210
- export const gethighlightedStateClasses = (state: any, baseClassName: any) => {
261
+ export const gethighlightedStateClasses = (
262
+ state: HighlightingState | HighlightingState[],
263
+ baseClassName: string
264
+ ) => {
211
265
  let hightlights = typeof state === "string" ? [state] : state;
212
- //@ts-ignore
213
- return hightlights.map((item) => `${baseClassName}--highlight-${item}`).join(" ");
266
+ return hightlights.map(
267
+ (item : HighlightingState) => `${baseClassName}--highlight-${item}`
268
+ ).join(" ");
214
269
  };
215
270
 
216
271
  const MemoHandler = React.memo(
217
272
  (props: MemoHandlerProps) => <HandleDefault {...props} />,
218
273
  (prev, next) => {
219
- const styleHasChanged = prev.style[prev.posdirection] === next.style[next.posdirection];
220
- return styleHasChanged;
274
+ return (
275
+ // we only test a few properties to control re-rendering
276
+ // need to be extended if also other properties need to be changed late
277
+ prev.style[prev.posdirection] === next.style[next.posdirection]
278
+ && prev.isConnectable === next.isConnectable
279
+ )
221
280
  }
222
281
  );
223
282
 
@@ -226,20 +285,28 @@ const MemoHandler = React.memo(
226
285
  * This element cannot be used directly, all properties must be routed through the `data` property of an `elements` property item inside the `ReactFlow` container.
227
286
  */
228
287
  export function NodeContent<CONTENT_PROPS = any>({
288
+ flowVersion,
229
289
  iconName,
230
290
  depiction,
291
+ leftElement,
231
292
  typeLabel,
232
293
  label,
294
+ labelSubline,
295
+ enlargeHeader,
296
+ fullWidth,
233
297
  showExecutionButtons = true,
234
298
  executionButtons,
235
299
  menuButtons,
236
300
  content,
237
301
  contentExtension,
238
- footerContent,
302
+ footerContent,
239
303
  size = "small",
240
304
  minimalShape = "circular",
241
305
  highlightedState,
242
- handles = defaultHandles,
306
+ intent,
307
+ border,
308
+ highlightColor,
309
+ //handles = defaultHandles(),
243
310
  adaptHeightForHandleMinCount,
244
311
  adaptSizeIncrement = 15,
245
312
  getMinimalTooltipData = getDefaultMinimalTooltipData,
@@ -257,18 +324,32 @@ export function NodeContent<CONTENT_PROPS = any>({
257
324
  // businessData is just being ignored
258
325
  businessData,
259
326
  // other props for DOM element
260
- ...otherProps
327
+ ...otherDomProps
261
328
  }: NodeContentProps<any>) {
329
+ const evaluateFlowVersion = useReactFlowVersion();
330
+ const flowVersionCheck = flowVersion || evaluateFlowVersion;
331
+
332
+ const {
333
+ handles = defaultHandles(flowVersionCheck),
334
+ ...otherProps
335
+ } = otherDomProps;
336
+
337
+ const isResizeable = (!!onNodeResize && minimalShape === "none");
262
338
  const [width, setWidth] = React.useState<number>(nodeDimensions?.width ?? 0);
263
339
  const [height, setHeight] = React.useState<number>(nodeDimensions?.height ?? 0);
264
- const [, , zoom] = useStoreState((state) => state.transform);
340
+ let zoom = 1;
341
+ if (isResizeable) try {
342
+ [, , zoom] = flowVersionCheck === "legacy"
343
+ ? getStoreStateFlowLegacy((state) => state.transform)
344
+ : getStoreStateFlowNext((state) => state.transform);
345
+ } catch {}
265
346
  const [adjustedContentProps, setAdjustedContentProps] = React.useState<Partial<CONTENT_PROPS>>({});
266
347
  const nodeContentRef = React.useRef<any>();
267
- const handleStack: { [key: string]: IHandleProps[] } = {};
268
- handleStack[Position.Top] = [] as IHandleProps[];
269
- handleStack[Position.Right] = [] as IHandleProps[];
270
- handleStack[Position.Bottom] = [] as IHandleProps[];
271
- handleStack[Position.Left] = [] as IHandleProps[];
348
+ const handleStack = flowVersionCheck==="legacy" ? {} as { [key: string]: IHandleProps[] } : {} as { [key: string]: NodeContentHandleNextProps[] };
349
+ handleStack[Position.Top] = flowVersionCheck==="legacy" ? [] as IHandleProps[] : [] as NodeContentHandleNextProps[];
350
+ handleStack[Position.Right] = flowVersionCheck==="legacy" ? [] as IHandleProps[] : [] as NodeContentHandleNextProps[];
351
+ handleStack[Position.Bottom] = flowVersionCheck==="legacy" ? [] as IHandleProps[] : [] as NodeContentHandleNextProps[];
352
+ handleStack[Position.Left] = flowVersionCheck==="legacy" ? [] as IHandleProps[] : [] as NodeContentHandleNextProps[];
272
353
 
273
354
  // initial dimension before resize
274
355
  React.useEffect(() => {
@@ -322,17 +403,29 @@ export function NodeContent<CONTENT_PROPS = any>({
322
403
  styleExpandDimensions["minHeight"] = Math.max(minHeightLeft, minHeightRight);
323
404
  }
324
405
 
406
+ const {
407
+ highlightClassNameSuffix,
408
+ highlightCustomPropertySettings
409
+ } = evaluateHighlightColors("--node-highlight", highlightColor);
410
+
325
411
  const resizableStyles = (!!onNodeResize === true && minimalShape === "none" && (width + height > 0)) ? { width, height } : {};
326
412
  const nodeContent = (
327
413
  <>
328
414
  <section
329
415
  ref={nodeContentRef}
330
416
  {...otherProps}
331
- style={{ ...style, ...styleExpandDimensions, ...resizableStyles }}
417
+ style={{ ...style, ...highlightCustomPropertySettings, ...styleExpandDimensions, ...resizableStyles }}
332
418
  className={
333
419
  `${eccgui}-graphviz__node` +
334
420
  ` ${eccgui}-graphviz__node--${size}` +
335
421
  ` ${eccgui}-graphviz__node--minimal-${minimalShape}` +
422
+ (fullWidth ? ` ${eccgui}-graphviz__node--fullwidth` : "") +
423
+ (border ? ` ${eccgui}-graphviz__node--border-${border}` : "") +
424
+ (intent ? ` ${intentClassName(intent)}` : "") +
425
+ (highlightClassNameSuffix.length > 0
426
+ ? highlightClassNameSuffix.map(highlight => ` ${eccgui}-graphviz__node--highlight-${highlight}`).join("")
427
+ : ""
428
+ ) +
336
429
  (!!highlightedState
337
430
  ? " " + gethighlightedStateClasses(highlightedState, `${eccgui}-graphviz__node`)
338
431
  : "") +
@@ -341,32 +434,66 @@ export function NodeContent<CONTENT_PROPS = any>({
341
434
  (letPassWheelEvents === false ? ` nowheel` : "")
342
435
  }
343
436
  >
344
- <header className={`${eccgui}-graphviz__node__header`}>
345
- {(!!iconName || !!depiction) && (
346
- <span className={`${eccgui}-graphviz__node__header-depiction`}>
347
- {!!depiction &&
348
- imgWithTooltip(
349
- <img src={depiction} alt="" />,
350
- minimalShape === "none" || selected ? typeLabel : undefined
351
- )}
352
- {!!iconName && !depiction && (
353
- <Icon
354
- name={iconName}
355
- tooltipText={minimalShape === "none" || selected ? typeLabel : undefined}
437
+ <header className={
438
+ `${eccgui}-graphviz__node__header` +
439
+ ((enlargeHeader && minimalShape==="none") ? ` ${eccgui}-graphviz__node__header--large` : "")
440
+ }>
441
+ {(!!iconName || !!depiction || !!leftElement) && (
442
+ <div className={`${eccgui}-graphviz__node__header-depiction`}>
443
+ { leftElement }
444
+ {!!depiction && !leftElement && typeof depiction === "string" && (
445
+ <Depiction
446
+ image={<img src={depiction} alt="" />}
447
+ caption={minimalShape === "none" || selected ? typeLabel : undefined}
448
+ captionPosition="tooltip"
449
+ padding="tiny"
450
+ ratio="1:1"
451
+ resizing="contain"
452
+ forceInlineSvg
356
453
  />
357
454
  )}
358
- </span>
455
+ {!!depiction && !leftElement && typeof depiction !== "string" && (
456
+ React.cloneElement(depiction, {
457
+ caption: minimalShape === "none" || selected ? typeLabel : undefined,
458
+ captionPosition: "tooltip",
459
+ padding: "tiny",
460
+ ratio: "1:1",
461
+ resizing: "contain",
462
+ forceInlineSvg: true,
463
+ })
464
+ )}
465
+ {!!iconName && !leftElement && !depiction && (
466
+ <Depiction
467
+ image={<Icon name={iconName} />}
468
+ caption={minimalShape === "none" || selected ? typeLabel : undefined}
469
+ captionPosition="tooltip"
470
+ padding="tiny"
471
+ ratio="1:1"
472
+ resizing="contain"
473
+ forceInlineSvg
474
+ />
475
+ )}
476
+ </div>
359
477
  )}
360
- <span className={`${eccgui}-graphviz__node__header-label`} title={label}>
361
- {label}
362
- </span>
478
+ <div className={`${eccgui}-graphviz__node__header-label`} title={typeof label==="string" ? label : undefined}>
479
+ {
480
+ typeof label === "string"
481
+ ? <OverflowText className={`${eccgui}-graphviz__node__header-label__mainline`}>{label}</OverflowText>
482
+ : <div className={`${eccgui}-graphviz__node__header-label__mainline`}>{label}</div>
483
+ }
484
+ {!!labelSubline && (
485
+ <div className={`${eccgui}-graphviz__node__header-label__subline`}>
486
+ { labelSubline }
487
+ </div>
488
+ )}
489
+ </div>
363
490
  {(menuButtons || (showExecutionButtons && executionButtons)) && (
364
- <span className={`${eccgui}-graphviz__node__header-menu`}>
491
+ <div className={`${eccgui}-graphviz__node__header-menu`}>
365
492
  {showExecutionButtons && typeof executionButtons === "function"
366
493
  ? executionButtons(adjustedContentProps, setAdjustedContentProps)
367
494
  : null}
368
495
  {menuButtons ?? null}
369
- </span>
496
+ </div>
370
497
  )}
371
498
  </header>
372
499
  {content && (
@@ -383,10 +510,10 @@ export function NodeContent<CONTENT_PROPS = any>({
383
510
  </section>
384
511
  {!!handles && (
385
512
  <>
386
- {addHandles(handleStack, Position.Top, "left", isConnectable, style)}
387
- {addHandles(handleStack, Position.Right, "top", isConnectable, style)}
388
- {addHandles(handleStack, Position.Bottom, "left", isConnectable, style)}
389
- {addHandles(handleStack, Position.Left, "top", isConnectable, style)}
513
+ {addHandles(handleStack, Position.Top, "left", isConnectable, style, flowVersionCheck)}
514
+ {addHandles(handleStack, Position.Right, "top", isConnectable, style, flowVersionCheck)}
515
+ {addHandles(handleStack, Position.Bottom, "left", isConnectable, style, flowVersionCheck)}
516
+ {addHandles(handleStack, Position.Left, "top", isConnectable, style, flowVersionCheck)}
390
517
  </>
391
518
  )}
392
519
  </>
@@ -419,5 +546,55 @@ export function NodeContent<CONTENT_PROPS = any>({
419
546
  </Resizable>
420
547
  );
421
548
 
422
- return (!!onNodeResize && minimalShape === "none") ? resizableNode() : nodeContent;
549
+ return (isResizeable) ? resizableNode() : nodeContent;
550
+ }
551
+
552
+ export const evaluateHighlightColors = (
553
+ baseCustomProperty: string,
554
+ highlightColor?: NodeHighlightColor | NodeHighlightColor[]
555
+ ) => {
556
+ let styleHighlightColors = {
557
+ [`${baseCustomProperty}-default-color`]: undefined,
558
+ [`${baseCustomProperty}-alternate-color`]: undefined,
559
+ } as React.CSSProperties;
560
+ const classesHightlightColors = [] as string[];
561
+ if (!!highlightColor) {
562
+ const highlightingColors = (typeof highlightColor === "string") ? [highlightColor] : highlightColor;
563
+ (highlightingColors as Array<string>).map((color, idx) => {
564
+ switch (color) {
565
+ case "default":
566
+ classesHightlightColors.push("default");
567
+ break;
568
+ case "alternate":
569
+ classesHightlightColors.push("alternate");
570
+ break;
571
+ default:
572
+ classesHightlightColors.push("custom");
573
+ let customColor = Color("#ffffff")
574
+ try {
575
+ customColor = Color(color);
576
+ } catch(ex) {
577
+ console.warn("Received invalid color for highlight: " + color)
578
+ }
579
+ if (idx === 0) {
580
+ styleHighlightColors = {
581
+ ...styleHighlightColors,
582
+ [`${baseCustomProperty}-default-color`]: customColor.rgb().toString(),
583
+ } as React.CSSProperties
584
+ } else {
585
+ styleHighlightColors = {
586
+ ...styleHighlightColors,
587
+ [`${baseCustomProperty}-alternate-color`]: customColor.rgb().toString(),
588
+ } as React.CSSProperties
589
+ }
590
+ break;
591
+ }
592
+ return color;
593
+ });
594
+ }
595
+
596
+ return {
597
+ highlightClassNameSuffix: classesHightlightColors,
598
+ highlightCustomPropertySettings: styleHighlightColors,
599
+ }
423
600
  }
@@ -5,8 +5,9 @@ import {
5
5
  } from "react-flow-renderer";
6
6
  import { Tooltip } from "../../../index";
7
7
  import { NodeContent, NodeContentProps } from "./NodeContent";
8
+ import { ReacFlowVersionSupportProps, useReactFlowVersion } from "../versionsupport";
8
9
 
9
- export interface NodeProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends ReactFlowNodeProps {
10
+ export interface NodeProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends ReacFlowVersionSupportProps, ReactFlowNodeProps {
10
11
  /**
11
12
  * Contains all properties for our implementation of the React-Flow node.
12
13
  * For details pls see the `NodeContent` element documentation.
@@ -22,14 +23,18 @@ export interface NodeProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends ReactFlo
22
23
  export const NodeDefault = memo(
23
24
  (node: NodeProps<any>) => {
24
25
  const {
26
+ flowVersion,
25
27
  data,
26
28
  targetPosition = Position.Left,
27
29
  sourcePosition = Position.Right,
28
30
  isConnectable = true,
29
31
  selected
30
32
  } = node;
33
+
34
+ const evaluateFlowVersion = useReactFlowVersion();
35
+ const flowVersionCheck = flowVersion || evaluateFlowVersion;
31
36
 
32
- const nodeEl = <NodeContent {...{...data, targetPosition, sourcePosition, isConnectable, selected}} />
37
+ const nodeEl = <NodeContent {...{flowVersion: flowVersionCheck, ...data, targetPosition, sourcePosition, isConnectable, selected}} />
33
38
 
34
39
  if (!selected && data?.minimalShape !== "none" && !!data?.getMinimalTooltipData) {
35
40
  const tooltipData = data?.getMinimalTooltipData(node);