@eccenca/gui-elements 23.0.0-rc.0 → 23.0.0-rc.3-unofficial.0

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 (339) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +1 -11
  3. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +4 -10
  4. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  5. package/dist/cjs/cmem/index.js +3 -1
  6. package/dist/cjs/cmem/index.js.map +1 -1
  7. package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +9 -2
  8. package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
  9. package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +64 -0
  10. package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -0
  11. package/dist/cjs/cmem/react-flow/configuration/customLabel.js +13 -0
  12. package/dist/cjs/cmem/react-flow/configuration/customLabel.js.map +1 -0
  13. package/dist/cjs/cmem/react-flow/configuration/graph.js.map +1 -1
  14. package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js +13 -0
  15. package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js.map +1 -0
  16. package/dist/cjs/cmem/react-flow/configuration/linking.js +2 -0
  17. package/dist/cjs/cmem/react-flow/configuration/linking.js.map +1 -1
  18. package/dist/cjs/cmem/react-flow/configuration/typing.js +35 -0
  19. package/dist/cjs/cmem/react-flow/configuration/typing.js.map +1 -0
  20. package/dist/cjs/cmem/react-flow/configuration/workflow.js +2 -0
  21. package/dist/cjs/cmem/react-flow/configuration/workflow.js.map +1 -1
  22. package/dist/cjs/cmem/react-flow/nodes/StickyNoteNode.js +42 -0
  23. package/dist/cjs/cmem/react-flow/nodes/StickyNoteNode.js.map +1 -0
  24. package/dist/cjs/common/utils/CssCustomProperties.js +114 -0
  25. package/dist/cjs/common/utils/CssCustomProperties.js.map +1 -0
  26. package/dist/cjs/common/utils/getColorConfiguration.js +21 -0
  27. package/dist/cjs/common/utils/getColorConfiguration.js.map +1 -0
  28. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +19 -19
  29. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  30. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +4 -12
  31. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  32. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +15 -6
  33. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  34. package/dist/cjs/components/Button/Button.js +2 -2
  35. package/dist/cjs/components/Button/Button.js.map +1 -1
  36. package/dist/cjs/components/ContextOverlay/ContextMenu.js +6 -5
  37. package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
  38. package/dist/cjs/components/ContextOverlay/ContextOverlay.js +6 -8
  39. package/dist/cjs/components/ContextOverlay/ContextOverlay.js.map +1 -1
  40. package/dist/cjs/components/Dialog/SimpleDialog.js +9 -4
  41. package/dist/cjs/components/Dialog/SimpleDialog.js.map +1 -1
  42. package/dist/cjs/components/Form/FieldItem.js +2 -2
  43. package/dist/cjs/components/Form/FieldItem.js.map +1 -1
  44. package/dist/cjs/components/Icon/Icon.js +2 -2
  45. package/dist/cjs/components/Icon/Icon.js.map +1 -1
  46. package/dist/cjs/components/Icon/IconButton.js +2 -2
  47. package/dist/cjs/components/Icon/IconButton.js.map +1 -1
  48. package/dist/cjs/components/Icon/canonicalIconNames.js +134 -114
  49. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  50. package/dist/cjs/components/Iframe/IframeModal.js +2 -6
  51. package/dist/cjs/components/Iframe/IframeModal.js.map +1 -1
  52. package/dist/cjs/components/Label/Label.js +6 -6
  53. package/dist/cjs/components/Label/Label.js.map +1 -1
  54. package/dist/cjs/components/Menu/MenuItem.js +2 -5
  55. package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
  56. package/dist/cjs/components/MultiSelect/MultiSelect.js +8 -10
  57. package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
  58. package/dist/cjs/components/Select/Select.js +29 -0
  59. package/dist/cjs/components/Select/Select.js.map +1 -0
  60. package/dist/cjs/components/Tabs/TabTitle.js +2 -4
  61. package/dist/cjs/components/Tabs/TabTitle.js.map +1 -1
  62. package/dist/cjs/components/Tag/Tag.js +2 -1
  63. package/dist/cjs/components/Tag/Tag.js.map +1 -1
  64. package/dist/cjs/components/Tooltip/Tooltip.js +7 -4
  65. package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
  66. package/dist/cjs/extensions/codemirror/CodeMirror.js +3 -3
  67. package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
  68. package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js +5 -5
  69. package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
  70. package/dist/cjs/extensions/react-flow/edges/EdgeTools.js +2 -1
  71. package/dist/cjs/extensions/react-flow/edges/EdgeTools.js.map +1 -1
  72. package/dist/cjs/extensions/react-flow/handles/HandleContent.js +1 -1
  73. package/dist/cjs/extensions/react-flow/handles/HandleContent.js.map +1 -1
  74. package/dist/cjs/extensions/react-flow/index.js +10 -1
  75. package/dist/cjs/extensions/react-flow/index.js.map +1 -1
  76. package/dist/cjs/extensions/react-flow/markers/MarkerArrowClosedInverse.js +13 -0
  77. package/dist/cjs/extensions/react-flow/markers/MarkerArrowClosedInverse.js.map +1 -0
  78. package/dist/cjs/extensions/react-flow/markers/ReactFlowMarkers.js +15 -0
  79. package/dist/cjs/extensions/react-flow/markers/ReactFlowMarkers.js.map +1 -0
  80. package/dist/cjs/extensions/react-flow/minimap/MiniMap.js +3 -2
  81. package/dist/cjs/extensions/react-flow/minimap/MiniMap.js.map +1 -1
  82. package/dist/cjs/extensions/react-flow/minimap/utils.js +12 -6
  83. package/dist/cjs/extensions/react-flow/minimap/utils.js.map +1 -1
  84. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +74 -25
  85. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  86. package/dist/cjs/extensions/react-flow/nodes/NodeContentExtension.js +10 -6
  87. package/dist/cjs/extensions/react-flow/nodes/NodeContentExtension.js.map +1 -1
  88. package/dist/cjs/extensions/react-flow/nodes/NodeTools.js +1 -3
  89. package/dist/cjs/extensions/react-flow/nodes/NodeTools.js.map +1 -1
  90. package/dist/cjs/extensions/react-flow/nodes/nodeUtils.js +49 -0
  91. package/dist/cjs/extensions/react-flow/nodes/nodeUtils.js.map +1 -0
  92. package/dist/cjs/index.js +3 -2
  93. package/dist/cjs/index.js.map +1 -1
  94. package/dist/cjs/legacy-replacements/Tabs/Tabs.js +1 -1
  95. package/dist/cjs/legacy-replacements/Tabs/Tabs.js.map +1 -1
  96. package/dist/cjs/legacy-replacements/TextField/TextField.js +5 -8
  97. package/dist/cjs/legacy-replacements/TextField/TextField.js.map +1 -1
  98. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +4 -10
  99. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  100. package/dist/esm/cmem/index.js +1 -0
  101. package/dist/esm/cmem/index.js.map +1 -1
  102. package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +9 -2
  103. package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
  104. package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +89 -0
  105. package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -0
  106. package/dist/esm/cmem/react-flow/configuration/customLabel.js +10 -0
  107. package/dist/esm/cmem/react-flow/configuration/customLabel.js.map +1 -0
  108. package/dist/esm/cmem/react-flow/configuration/graph.js +1 -1
  109. package/dist/esm/cmem/react-flow/configuration/graph.js.map +1 -1
  110. package/dist/esm/cmem/react-flow/configuration/inverseEdge.js +10 -0
  111. package/dist/esm/cmem/react-flow/configuration/inverseEdge.js.map +1 -0
  112. package/dist/esm/cmem/react-flow/configuration/linking.js +3 -1
  113. package/dist/esm/cmem/react-flow/configuration/linking.js.map +1 -1
  114. package/dist/esm/cmem/react-flow/configuration/typing.js +32 -0
  115. package/dist/esm/cmem/react-flow/configuration/typing.js.map +1 -0
  116. package/dist/esm/cmem/react-flow/configuration/workflow.js +3 -1
  117. package/dist/esm/cmem/react-flow/configuration/workflow.js.map +1 -1
  118. package/dist/esm/cmem/react-flow/nodes/StickyNoteNode.js +31 -0
  119. package/dist/esm/cmem/react-flow/nodes/StickyNoteNode.js.map +1 -0
  120. package/dist/esm/common/utils/CssCustomProperties.js +154 -0
  121. package/dist/esm/common/utils/CssCustomProperties.js.map +1 -0
  122. package/dist/esm/common/utils/getColorConfiguration.js +16 -0
  123. package/dist/esm/common/utils/getColorConfiguration.js.map +1 -0
  124. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +23 -21
  125. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  126. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +4 -12
  127. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  128. package/dist/esm/components/AutocompleteField/AutoCompleteField.js +32 -23
  129. package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  130. package/dist/esm/components/Button/Button.js +2 -2
  131. package/dist/esm/components/Button/Button.js.map +1 -1
  132. package/dist/esm/components/ContextOverlay/ContextMenu.js +6 -5
  133. package/dist/esm/components/ContextOverlay/ContextMenu.js.map +1 -1
  134. package/dist/esm/components/ContextOverlay/ContextOverlay.js +6 -8
  135. package/dist/esm/components/ContextOverlay/ContextOverlay.js.map +1 -1
  136. package/dist/esm/components/Dialog/SimpleDialog.js +25 -4
  137. package/dist/esm/components/Dialog/SimpleDialog.js.map +1 -1
  138. package/dist/esm/components/Form/FieldItem.js +2 -2
  139. package/dist/esm/components/Form/FieldItem.js.map +1 -1
  140. package/dist/esm/components/Icon/Icon.js +2 -2
  141. package/dist/esm/components/Icon/Icon.js.map +1 -1
  142. package/dist/esm/components/Icon/IconButton.js +2 -2
  143. package/dist/esm/components/Icon/IconButton.js.map +1 -1
  144. package/dist/esm/components/Icon/canonicalIconNames.js +134 -114
  145. package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
  146. package/dist/esm/components/Iframe/IframeModal.js +2 -22
  147. package/dist/esm/components/Iframe/IframeModal.js.map +1 -1
  148. package/dist/esm/components/Label/Label.js +6 -6
  149. package/dist/esm/components/Label/Label.js.map +1 -1
  150. package/dist/esm/components/Menu/MenuItem.js +2 -5
  151. package/dist/esm/components/Menu/MenuItem.js.map +1 -1
  152. package/dist/esm/components/MultiSelect/MultiSelect.js +5 -7
  153. package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
  154. package/dist/esm/components/Select/Select.js +35 -0
  155. package/dist/esm/components/Select/Select.js.map +1 -0
  156. package/dist/esm/components/Tabs/TabTitle.js +2 -4
  157. package/dist/esm/components/Tabs/TabTitle.js.map +1 -1
  158. package/dist/esm/components/Tag/Tag.js +2 -1
  159. package/dist/esm/components/Tag/Tag.js.map +1 -1
  160. package/dist/esm/components/Tooltip/Tooltip.js +7 -4
  161. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  162. package/dist/esm/extensions/codemirror/CodeMirror.js +3 -3
  163. package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
  164. package/dist/esm/extensions/react-flow/edges/EdgeDefault.js +6 -6
  165. package/dist/esm/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
  166. package/dist/esm/extensions/react-flow/edges/EdgeTools.js +2 -1
  167. package/dist/esm/extensions/react-flow/edges/EdgeTools.js.map +1 -1
  168. package/dist/esm/extensions/react-flow/handles/HandleContent.js +1 -1
  169. package/dist/esm/extensions/react-flow/handles/HandleContent.js.map +1 -1
  170. package/dist/esm/extensions/react-flow/index.js +3 -0
  171. package/dist/esm/extensions/react-flow/index.js.map +1 -1
  172. package/dist/esm/extensions/react-flow/markers/MarkerArrowClosedInverse.js +6 -0
  173. package/dist/esm/extensions/react-flow/markers/MarkerArrowClosedInverse.js.map +1 -0
  174. package/dist/esm/extensions/react-flow/markers/ReactFlowMarkers.js +8 -0
  175. package/dist/esm/extensions/react-flow/markers/ReactFlowMarkers.js.map +1 -0
  176. package/dist/esm/extensions/react-flow/minimap/MiniMap.js +3 -2
  177. package/dist/esm/extensions/react-flow/minimap/MiniMap.js.map +1 -1
  178. package/dist/esm/extensions/react-flow/minimap/utils.js +10 -5
  179. package/dist/esm/extensions/react-flow/minimap/utils.js.map +1 -1
  180. package/dist/esm/extensions/react-flow/nodes/NodeContent.js +76 -27
  181. package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  182. package/dist/esm/extensions/react-flow/nodes/NodeContentExtension.js +26 -6
  183. package/dist/esm/extensions/react-flow/nodes/NodeContentExtension.js.map +1 -1
  184. package/dist/esm/extensions/react-flow/nodes/NodeTools.js +1 -3
  185. package/dist/esm/extensions/react-flow/nodes/NodeTools.js.map +1 -1
  186. package/dist/esm/extensions/react-flow/nodes/nodeUtils.js +44 -0
  187. package/dist/esm/extensions/react-flow/nodes/nodeUtils.js.map +1 -0
  188. package/dist/esm/index.js +3 -2
  189. package/dist/esm/index.js.map +1 -1
  190. package/dist/esm/legacy-replacements/Tabs/Tabs.js +1 -1
  191. package/dist/esm/legacy-replacements/Tabs/Tabs.js.map +1 -1
  192. package/dist/esm/legacy-replacements/TextField/TextField.js +2 -5
  193. package/dist/esm/legacy-replacements/TextField/TextField.js.map +1 -1
  194. package/dist/types/cmem/index.d.ts +1 -0
  195. package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +2 -3
  196. package/dist/types/cmem/react-flow/StickyNoteModal/StickyNoteModal.d.ts +26 -0
  197. package/dist/types/cmem/react-flow/configuration/customLabel.d.ts +8 -0
  198. package/dist/types/cmem/react-flow/configuration/graph.d.ts +3 -8
  199. package/dist/types/cmem/react-flow/configuration/inverseEdge.d.ts +8 -0
  200. package/dist/types/cmem/react-flow/configuration/linking.d.ts +3 -9
  201. package/dist/types/cmem/react-flow/configuration/typing.d.ts +28 -0
  202. package/dist/types/cmem/react-flow/configuration/workflow.d.ts +3 -9
  203. package/dist/types/cmem/react-flow/nodes/StickyNoteNode.d.ts +3 -0
  204. package/dist/types/common/utils/CssCustomProperties.d.ts +28 -0
  205. package/dist/types/common/utils/getColorConfiguration.d.ts +8 -0
  206. package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +7 -4
  207. package/dist/types/components/Button/Button.d.ts +2 -2
  208. package/dist/types/components/ContextOverlay/ContextMenu.d.ts +37 -3
  209. package/dist/types/components/ContextOverlay/ContextOverlay.d.ts +12 -1
  210. package/dist/types/components/Dialog/SimpleDialog.d.ts +5 -1
  211. package/dist/types/components/Form/FieldItem.d.ts +3 -2
  212. package/dist/types/components/Icon/Icon.d.ts +32 -7
  213. package/dist/types/components/Icon/IconButton.d.ts +21 -7
  214. package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
  215. package/dist/types/components/Label/Label.d.ts +30 -2
  216. package/dist/types/components/Menu/MenuItem.d.ts +3 -7
  217. package/dist/types/components/MultiSelect/MultiSelect.d.ts +13 -9
  218. package/dist/types/components/Select/Select.d.ts +22 -0
  219. package/dist/types/components/Tag/Tag.d.ts +5 -1
  220. package/dist/types/components/Tooltip/Tooltip.d.ts +13 -11
  221. package/dist/types/components/interfaces.d.ts +1 -0
  222. package/dist/types/extensions/codemirror/CodeMirror.d.ts +5 -1
  223. package/dist/types/extensions/react-flow/edges/EdgeDefault.d.ts +3 -0
  224. package/dist/types/extensions/react-flow/edges/EdgeTools.d.ts +2 -2
  225. package/dist/types/extensions/react-flow/index.d.ts +3 -0
  226. package/dist/types/extensions/react-flow/markers/MarkerArrowClosedInverse.d.ts +2 -0
  227. package/dist/types/extensions/react-flow/markers/ReactFlowMarkers.d.ts +2 -0
  228. package/dist/types/extensions/react-flow/minimap/MiniMap.d.ts +1 -1
  229. package/dist/types/extensions/react-flow/minimap/utils.d.ts +1 -0
  230. package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +17 -1
  231. package/dist/types/extensions/react-flow/nodes/NodeContentExtension.d.ts +2 -2
  232. package/dist/types/extensions/react-flow/nodes/NodeTools.d.ts +2 -2
  233. package/dist/types/extensions/react-flow/nodes/nodeUtils.d.ts +14 -0
  234. package/dist/types/index.d.ts +3 -2
  235. package/dist/types/legacy-replacements/Tabs/Tabs.d.ts +1 -1
  236. package/package.json +19 -11
  237. package/scripts/compile-sass.ts +9 -0
  238. package/scripts/fix-cjs-dist +5 -0
  239. package/scripts/fix-esm-dist +6 -0
  240. package/scripts/sassConfig.js +13 -0
  241. package/src/_shame.scss +17 -0
  242. package/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +2 -2
  243. package/src/cmem/ActivityControl/ActivityControlWidget.tsx +5 -10
  244. package/src/cmem/index.ts +1 -0
  245. package/src/cmem/markdown/markdown.scss +1 -1
  246. package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +160 -51
  247. package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +12 -3
  248. package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +134 -0
  249. package/src/cmem/react-flow/_index.scss +1 -1
  250. package/src/cmem/react-flow/_minimap.scss +6 -2
  251. package/src/cmem/react-flow/configuration/customLabel.ts +11 -0
  252. package/src/cmem/react-flow/configuration/graph.ts +3 -5
  253. package/src/cmem/react-flow/configuration/inverseEdge.ts +11 -0
  254. package/src/cmem/react-flow/configuration/linking.ts +5 -6
  255. package/src/cmem/react-flow/configuration/typing.ts +30 -0
  256. package/src/cmem/react-flow/configuration/workflow.ts +5 -5
  257. package/src/cmem/react-flow/nodes/StickyNoteNode.tsx +13 -0
  258. package/src/cmem/react-flow/{_nodes.scss → nodes/_colors.scss} +0 -0
  259. package/src/cmem/react-flow/nodes/_index.scss +2 -0
  260. package/src/cmem/react-flow/nodes/_stickynote.scss +72 -0
  261. package/src/common/utils/CssCustomProperties.ts +25 -13
  262. package/src/common/utils/getColorConfiguration.ts +1 -2
  263. package/src/components/Accordion/accordion.scss +11 -11
  264. package/src/components/Application/_header.scss +4 -3
  265. package/src/components/AutoSuggestion/AutoSuggestion.tsx +23 -23
  266. package/src/components/AutoSuggestion/AutoSuggestionList.tsx +15 -17
  267. package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +1 -1
  268. package/src/components/AutocompleteField/AutoCompleteField.tsx +44 -19
  269. package/src/components/AutocompleteField/autocompletefield.scss +5 -3
  270. package/src/components/AutocompleteField/stories/AutoCompleteField.stories.tsx +75 -0
  271. package/src/components/Button/Button.tsx +3 -3
  272. package/src/components/Button/button.scss +43 -6
  273. package/src/components/Card/card.scss +5 -5
  274. package/src/components/ContextOverlay/ContextMenu.stories.tsx +33 -0
  275. package/src/components/ContextOverlay/ContextMenu.tsx +46 -8
  276. package/src/components/ContextOverlay/ContextOverlay.stories.tsx +148 -0
  277. package/src/components/ContextOverlay/ContextOverlay.tsx +16 -9
  278. package/src/components/ContextOverlay/contextoverlay.scss +17 -5
  279. package/src/components/Dialog/SimpleDialog.tsx +25 -4
  280. package/src/components/Dialog/dialog.scss +10 -8
  281. package/src/components/Form/FieldItem.tsx +4 -4
  282. package/src/components/Form/form.scss +6 -6
  283. package/src/components/Icon/Icon.tsx +33 -18
  284. package/src/components/Icon/IconButton.tsx +24 -19
  285. package/src/components/Icon/canonicalIconNames.tsx +146 -121
  286. package/src/components/Icon/icon.scss +1 -1
  287. package/src/components/Icon/stories/Icon.stories.tsx +52 -0
  288. package/src/components/Icon/stories/IconButton.stories.tsx +27 -0
  289. package/src/components/Iframe/IframeModal.tsx +6 -17
  290. package/src/components/Label/Label.stories.tsx +27 -0
  291. package/src/components/Label/Label.tsx +47 -15
  292. package/src/components/Label/label.scss +2 -2
  293. package/src/components/Menu/MenuItem.tsx +9 -16
  294. package/src/components/Menu/menu.scss +10 -9
  295. package/src/components/MultiSelect/MultiSelect.tsx +30 -18
  296. package/src/components/Notification/notification.scss +3 -1
  297. package/src/components/OverviewItem/overviewitem.scss +8 -8
  298. package/src/components/PropertyValuePair/propertyvalue.scss +9 -7
  299. package/src/components/Select/Select.stories.tsx +35 -0
  300. package/src/components/Select/Select.tsx +38 -0
  301. package/src/components/Select/_select.scss +8 -0
  302. package/src/components/Separation/separation.scss +6 -6
  303. package/src/components/SimpleTable/simpletable.scss +5 -5
  304. package/src/components/Tabs/TabTitle.tsx +2 -4
  305. package/src/components/Tabs/tabs.scss +3 -3
  306. package/src/components/Tag/Tag.tsx +6 -0
  307. package/src/components/Tag/tag.scss +62 -33
  308. package/src/components/TextField/textfield.scss +6 -4
  309. package/src/components/Tooltip/Tooltip.stories.tsx +36 -0
  310. package/src/components/Tooltip/Tooltip.tsx +23 -18
  311. package/src/components/Tooltip/tooltip.scss +7 -7
  312. package/src/components/Typography/typography.scss +5 -4
  313. package/src/components/interfaces.ts +3 -1
  314. package/src/configuration/_variables.scss +11 -9
  315. package/src/extensions/codemirror/CodeMirror.tsx +9 -4
  316. package/src/extensions/react-flow/edges/EdgeDefault.tsx +7 -2
  317. package/src/extensions/react-flow/edges/EdgeTools.tsx +6 -4
  318. package/src/extensions/react-flow/edges/_edges.scss +3 -3
  319. package/src/extensions/react-flow/handles/HandleContent.tsx +0 -1
  320. package/src/extensions/react-flow/handles/_handles.scss +13 -13
  321. package/src/extensions/react-flow/index.ts +3 -0
  322. package/src/extensions/react-flow/markers/MarkerArrowClosedInverse.tsx +25 -0
  323. package/src/extensions/react-flow/markers/ReactFlowMarkers.tsx +13 -0
  324. package/src/extensions/react-flow/minimap/MiniMap.tsx +16 -1
  325. package/src/extensions/react-flow/minimap/_minimap.scss +6 -6
  326. package/src/extensions/react-flow/minimap/utils.ts +8 -3
  327. package/src/extensions/react-flow/nodes/NodeContent.tsx +253 -166
  328. package/src/extensions/react-flow/nodes/NodeContentExtension.tsx +17 -11
  329. package/src/extensions/react-flow/nodes/NodeTools.tsx +10 -7
  330. package/src/extensions/react-flow/nodes/_nodes.scss +44 -12
  331. package/src/extensions/react-flow/nodes/nodeUtils.tsx +53 -0
  332. package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +41 -12
  333. package/src/extensions/react-flow/nodes/stories/NodeContentExtension.stories.tsx +39 -47
  334. package/src/includes/blueprintjs/_variables.scss +4 -2
  335. package/src/includes/carbon-components/_variables.scss +7 -5
  336. package/src/index.scss +9 -5
  337. package/src/index.ts +4 -2
  338. package/src/legacy-replacements/Tabs/Tabs.tsx +3 -1
  339. package/src/legacy-replacements/TextField/TextField.tsx +7 -5
@@ -1,7 +1,8 @@
1
- import React, { useState, useEffect, useCallback } from "react";
1
+ import React, { useState, useEffect, useCallback, FC } from "react";
2
2
  import { ComponentStory, ComponentMeta } from "@storybook/react";
3
- import { ReactFlow } from "./ReactFlow";
4
- import { Elements } from 'react-flow-renderer';
3
+ import { ReactFlow, EdgeTools, NodeTools, IconButton } from "./../../../index";
4
+ import { ReactFlowProps } from "./ReactFlow";
5
+ import { ArrowHeadType, Elements, FlowElement, getMarkerEnd } from "react-flow-renderer";
5
6
 
6
7
  export default {
7
8
  title: "CMEM/React Flow/Configurations",
@@ -13,15 +14,16 @@ export default {
13
14
  const nodeExamples = {
14
15
  unspecified: [
15
16
  {
16
- id: 1,
17
+ id: 'unspecified-1',
17
18
  type: "default",
18
19
  data: {
19
- label: "Default ", content: "Example content.", minimalShape: "none"
20
+ label: "Default ", content: "Example content.", minimalShape: "none",
21
+ menuButtons: <NodeTools>Pass your menu here.</NodeTools>
20
22
  },
21
23
  position: { x: 200, y: 50 },
22
24
  },
23
25
  {
24
- id: 2,
26
+ id: 'unspecified-2',
25
27
  type: "default",
26
28
  data: {
27
29
  label: "Default ", content: "Example content.", minimalShape: "none",
@@ -30,23 +32,24 @@ const nodeExamples = {
30
32
  position: { x: 200, y: 300 },
31
33
  },
32
34
  {
33
- id: 'e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: '1', target: '2',
35
+ id: 'unspecified-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: 'unspecified-1', target: 'unspecified-2',
34
36
  },
35
37
  {
36
- id: 'e2', type: 'step', label: "step edge", arrowHeadType: "arrowclosed",source: '2', target: '1',
38
+ id: 'unspecified-e2', type: 'step', label: "step edge", arrowHeadType: "arrowclosed",source: 'unspecified-2', target: 'unspecified-1',
37
39
  }
38
40
  ],
39
41
  linking: [
40
42
  {
41
- id: 1,
43
+ id: 'linking-1',
42
44
  type: "sourcepath",
43
45
  data: {
44
- label: "Source path", content: "Example content.", minimalShape: "none"
46
+ label: "Source path", content: "Example content.", minimalShape: "none",
47
+ menuButtons: <NodeTools>Pass your menu here.</NodeTools>
45
48
  },
46
49
  position: { x: 100, y: 50 },
47
50
  },
48
51
  {
49
- id: 2,
52
+ id: 'linking-2',
50
53
  type: "targetpath",
51
54
  data: {
52
55
  label: "Target path", content: "Example content.", minimalShape: "none"
@@ -54,7 +57,7 @@ const nodeExamples = {
54
57
  position: { x: 400, y: 200 },
55
58
  },
56
59
  {
57
- id: 3,
60
+ id: 'linking-3',
58
61
  type: "transformation",
59
62
  data: {
60
63
  label: "Transformation", content: "Example content.", minimalShape: "none"
@@ -62,7 +65,7 @@ const nodeExamples = {
62
65
  position: { x: 700, y: 50 },
63
66
  },
64
67
  {
65
- id: 4,
68
+ id: 'linking-4',
66
69
  type: "comparator",
67
70
  data: {
68
71
  label: "Comparation", content: "Example content.", minimalShape: "none",
@@ -71,7 +74,7 @@ const nodeExamples = {
71
74
  position: { x: 750, y: 300 },
72
75
  },
73
76
  {
74
- id: 5,
77
+ id: 'linking-5',
75
78
  type: "aggregator",
76
79
  data: {
77
80
  label: "Aggregation", content: "Example content.", minimalShape: "none",
@@ -79,23 +82,24 @@ const nodeExamples = {
79
82
  },
80
83
  position: { x: 50, y: 300 },
81
84
  },
82
- { id: 'e1', type: 'value', label: "value edge", arrowHeadType: "arrowclosed",source: '1', target: '2' },
83
- { id: 'e2', type: 'score', label: "score edge", arrowHeadType: "arrowclosed",source: '2', target: '3' },
84
- { id: 'e3', type: 'success', label: "success edge", arrowHeadType: "arrowclosed",source: '3', target: '4' },
85
- { id: 'e4', type: 'warning', label: "warning edge", arrowHeadType: "arrowclosed",source: '4', target: '5' },
86
- { id: 'e5', type: 'danger', label: "danger edge", arrowHeadType: "arrowclosed",source: '5', target: '1' },
85
+ { id: 'linking-e1', type: 'value', label: "value edge", arrowHeadType: "arrowclosed",source: 'linking-1', target: 'linking-2' },
86
+ { id: 'linking-e2', type: 'score', label: "score edge", arrowHeadType: "arrowclosed",source: 'linking-2', target: 'linking-3' },
87
+ { id: 'linking-e3', type: 'success', label: "success edge", arrowHeadType: "arrowclosed",source: 'linking-3', target: 'linking-4' },
88
+ { id: 'linking-e4', type: 'warning', label: "warning edge", arrowHeadType: "arrowclosed",source: 'linking-4', target: 'linking-5' },
89
+ { id: 'linking-e5', type: 'danger', label: "danger edge", arrowHeadType: "arrowclosed",source: 'linking-5', target: 'linking-1' },
87
90
  ],
88
91
  workflow: [
89
92
  {
90
- id: 1,
93
+ id: 'workflow-1',
91
94
  type: "dataset",
92
95
  data: {
93
- label: "Dataset", content: "Example content.", minimalShape: "none"
96
+ label: "Dataset", content: "Example content.", minimalShape: "none",
97
+ menuButtons: <NodeTools>Pass your menu here.</NodeTools>
94
98
  },
95
99
  position: { x: 100, y: 50 },
96
100
  },
97
101
  {
98
- id: 2,
102
+ id: 'workflow-2',
99
103
  type: "linking",
100
104
  data: {
101
105
  label: "Linking", content: "Example content.", minimalShape: "none"
@@ -103,7 +107,7 @@ const nodeExamples = {
103
107
  position: { x: 400, y: 200 },
104
108
  },
105
109
  {
106
- id: 3,
110
+ id: 'workflow-3',
107
111
  type: "transform",
108
112
  data: {
109
113
  label: "Transform", content: "Example content.", minimalShape: "none"
@@ -111,7 +115,7 @@ const nodeExamples = {
111
115
  position: { x: 700, y: 50 },
112
116
  },
113
117
  {
114
- id: 4,
118
+ id: 'workflow-4',
115
119
  type: "task",
116
120
  data: {
117
121
  label: "Task", content: "Example content.", minimalShape: "none",
@@ -120,7 +124,7 @@ const nodeExamples = {
120
124
  position: { x: 750, y: 300 },
121
125
  },
122
126
  {
123
- id: 5,
127
+ id: 'workflow-5',
124
128
  type: "workflow",
125
129
  data: {
126
130
  label: "Workflow", content: "Example content.", minimalShape: "none",
@@ -128,23 +132,24 @@ const nodeExamples = {
128
132
  },
129
133
  position: { x: 50, y: 300 },
130
134
  },
131
- { id: 'e1', arrowHeadType: "arrowclosed",source: '1', target: '2' },
132
- { id: 'e2', arrowHeadType: "arrowclosed",source: '2', target: '3' },
133
- { id: 'e3', type: 'success', label: "success edge", arrowHeadType: "arrowclosed",source: '3', target: '4' },
134
- { id: 'e4', type: 'warning', label: "warning edge", arrowHeadType: "arrowclosed",source: '4', target: '5' },
135
- { id: 'e5', type: 'danger', label: "danger edge", arrowHeadType: "arrowclosed",source: '5', target: '1' },
135
+ { id: 'workflow-e1', arrowHeadType: "arrowclosed",source: 'workflow-1', target: 'workflow-2' },
136
+ { id: 'workflow-e2', arrowHeadType: "arrowclosed",source: 'workflow-2', target: 'workflow-3' },
137
+ { id: 'workflow-e3', type: 'success', label: "success edge", arrowHeadType: "arrowclosed",source: 'workflow-3', target: 'workflow-4' },
138
+ { id: 'workflow-e4', type: 'warning', label: "warning edge", arrowHeadType: "arrowclosed",source: 'workflow-4', target: 'workflow-5' },
139
+ { id: 'workflow-e5', type: 'danger', label: "danger edge", arrowHeadType: "arrowclosed",source: 'workflow-5', target: 'workflow-1' },
136
140
  ],
137
141
  graph: [
138
142
  {
139
- id: 1,
143
+ id: 'graph-1',
140
144
  type: "default",
141
145
  data: {
142
- label: "Default ", content: "Example content.", minimalShape: "none"
146
+ label: "Default ", content: "Example content.", minimalShape: "none",
147
+ menuButtons: <NodeTools>Pass your menu here.</NodeTools>
143
148
  },
144
149
  position: { x: 100, y: 50 },
145
150
  },
146
151
  {
147
- id: 2,
152
+ id: 'graph-2',
148
153
  type: "graph",
149
154
  data: {
150
155
  label: "Graph", content: "Example content.", minimalShape: "none"
@@ -152,7 +157,7 @@ const nodeExamples = {
152
157
  position: { x: 400, y: 200 },
153
158
  },
154
159
  {
155
- id: 3,
160
+ id: 'graph-3',
156
161
  type: "class",
157
162
  data: {
158
163
  label: "Class", content: "Example content.", minimalShape: "none"
@@ -160,7 +165,7 @@ const nodeExamples = {
160
165
  position: { x: 700, y: 50 },
161
166
  },
162
167
  {
163
- id: 4,
168
+ id: 'graph-4',
164
169
  type: "instance",
165
170
  data: {
166
171
  label: "Instance", content: "Example content.", minimalShape: "none",
@@ -169,7 +174,7 @@ const nodeExamples = {
169
174
  position: { x: 750, y: 300 },
170
175
  },
171
176
  {
172
- id: 5,
177
+ id: 'graph-5',
173
178
  type: "property",
174
179
  data: {
175
180
  label: "Property", content: "Example content.", minimalShape: "none",
@@ -177,23 +182,122 @@ const nodeExamples = {
177
182
  },
178
183
  position: { x: 50, y: 300 },
179
184
  },
180
- { id: 'e1', type: 'implicit', label: "implicit edge", arrowHeadType: "arrowclosed",source: '1', target: '2' },
181
- { id: 'e2', type: 'import', label: "import edge", arrowHeadType: "arrowclosed",source: '2', target: '3' },
182
- { id: 'e3', type: 'subclass', label: "subclass edge", arrowHeadType: "arrowclosed",source: '3', target: '4' },
183
- { id: 'e4', type: 'subproperty', label: "subproperty edge", arrowHeadType: "arrowclosed",source: '4', target: '5' },
184
- { id: 'e5', type: 'rdftype', label: "rdftype edge", arrowHeadType: "arrowclosed",source: '5', target: '1' },
185
+ { id: 'graph-e1', type: 'implicit', label: "implicit edge", arrowHeadType: "arrowclosed",source: 'graph-1', target: 'graph-2' },
186
+ { id: 'graph-e2', type: 'import', label: "import edge", arrowHeadType: "arrowclosed",source: 'graph-2', target: 'graph-3' },
187
+ { id: 'graph-e3', type: 'subclass', label: "subclass edge", arrowHeadType: "arrowclosed",source: 'graph-3', target: 'graph-4' },
188
+ { id: 'graph-e4', type: 'subproperty', label: "subproperty edge", arrowHeadType: "arrowclosed",source: 'graph-4', target: 'graph-5' },
189
+ { id: 'graph-e5', type: 'rdftype', label: "rdftype edge", arrowHeadType: "arrowclosed",source: 'graph-5', target: 'graph-1' },
190
+ ],
191
+ inverseEdge: [
192
+ {
193
+ id: 'inverseEdge-1',
194
+ type: "default",
195
+ data: {
196
+ label: "Default ", content: "Example content.", minimalShape: "none"
197
+ },
198
+ position: { x: 200, y: 50 },
199
+ },
200
+ {
201
+ id: 'inverseEdge-2',
202
+ type: "default",
203
+ data: {
204
+ label: "Default ", content: "Example content.", minimalShape: "none",
205
+ handles: [ { type: "source", position: "left" }, { type: "target", position: "right" } ],
206
+ inversePath: true,
207
+ },
208
+ position: { x: 200, y: 300 },
209
+ },
210
+ {
211
+ id: 'inverseEdge-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: 'inverseEdge-1', target: 'inverseEdge-2',
212
+ },
213
+ {
214
+ id: 'inverseEdge-e2', type: 'default', label: "inverse edge", source: 'inverseEdge-2', target: 'inverseEdge-1',
215
+ data: {
216
+ markerStart: getMarkerEnd(
217
+ `${ArrowHeadType.ArrowClosed}-inverse` as ArrowHeadType
218
+ ),
219
+ }
220
+ }
185
221
  ],
222
+ customLabel: [
223
+ {
224
+ id: 'customLabel-1',
225
+ type: "default",
226
+ data: {
227
+ label: "Default ", content: "Example content.", minimalShape: "none"
228
+ },
229
+ position: { x: 200, y: 50 },
230
+ },
231
+ {
232
+ id: 'customLabel-2',
233
+ type: "default",
234
+ data: {
235
+ label: "Default ", content: "Example content.", minimalShape: "none",
236
+ handles: [ { type: "source", position: "left" }, { type: "target", position: "right" } ],
237
+ inversePath: true,
238
+ },
239
+ position: { x: 200, y: 300 },
240
+ },
241
+ {
242
+ id: 'customLabel-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed", source: 'customLabel-1', target: 'customLabel-2',
243
+ },
244
+ {
245
+ id: 'customLabel-e2', type: 'default', label: "custom edge", arrowHeadType: "arrowclosed", source: 'customLabel-2', target: 'customLabel-1',
246
+ data: {
247
+ renderLabel: (
248
+ edgeCenter: [number, number, number, number]
249
+ ) => (
250
+ <foreignObject
251
+ width={30}
252
+ height={30}
253
+ x={edgeCenter[0] - 15}
254
+ y={edgeCenter[1] - 15}
255
+ className="instance-viz-multiedge"
256
+ requiredExtensions="http://www.w3.org/1999/xhtml"
257
+ >
258
+ <body>
259
+ <IconButton name="navigation-close" />
260
+ </body>
261
+ </foreignObject>
262
+ )
263
+ }
264
+ }
265
+ ]
186
266
  }
187
267
 
188
- const ReactFlowExample = (args) => {
268
+ const ReactFlowExample: FC<ReactFlowProps> = (args) => {
189
269
  const [reactflowInstance, setReactflowInstance] = useState(null);
190
270
  const [elements, setElements] = useState([] as Elements);
191
- //const [edgeTools, setEdgeTools] = useState<JSX.Element>(<></>);
271
+ const [edgeTools, setEdgeTools] = useState<JSX.Element>(<></>);
192
272
 
193
273
  useEffect(() => {
194
- setElements(nodeExamples[args.configuration] as Elements);
274
+ setElements(nodeExamples[args.configuration ?? "unspecified"] as Elements);
195
275
  }, [args]);
196
276
 
277
+ // Helper methods for nodes and edges
278
+ const isNode = (element: FlowElement & { source?: string }): boolean =>
279
+ !element.source;
280
+ const isEdge = (element: FlowElement & { source?: string }): boolean =>
281
+ !isNode(element);
282
+
283
+ // Fired when clicked on any elements, e.g. edge or node. Used to show the edge menu.
284
+ const onElementClick = React.useCallback((event, element) => {
285
+ if (isEdge(element)) {
286
+ event.preventDefault();
287
+ setEdgeTools(
288
+ <EdgeTools
289
+ posOffset={{ left: event.clientX, top: event.clientY }}
290
+ onClose={() => {
291
+ setEdgeTools(<></>);
292
+ }}
293
+ >
294
+ EdgeTools demo,
295
+ add elements here.
296
+ </EdgeTools>
297
+ );
298
+ }
299
+ }, []);
300
+
197
301
  const onLoad = useCallback(
198
302
  (rfi) => {
199
303
  if (!reactflowInstance) {
@@ -203,13 +307,18 @@ const ReactFlowExample = (args) => {
203
307
  [reactflowInstance]
204
308
  );
205
309
 
206
- return <ReactFlow
207
- configuration={args.configuration}
208
- elements={elements}
209
- style={{ height: '400px' }}
210
- onLoad={onLoad}
211
- defaultZoom={1}
212
- />
310
+ return <>
311
+ <ReactFlow
312
+ configuration={args.configuration}
313
+ elements={elements}
314
+ style={{ height: '400px' }}
315
+ onLoad={onLoad}
316
+ defaultZoom={1}
317
+ onElementClick={onElementClick}
318
+ onEdgeContextMenu={onElementClick}
319
+ />
320
+ {edgeTools}
321
+ </>
213
322
  }
214
323
 
215
324
  const Template: ComponentStory<typeof ReactFlow> = (args) => (
@@ -1,15 +1,18 @@
1
1
  import React from "react";
2
2
  import {default as ReactFlowOriginal, ReactFlowProps as ReactFlowOriginalProps} from "react-flow-renderer";
3
+ import { ReactFlowMarkers } from "../../../extensions/react-flow/markers/ReactFlowMarkers";
3
4
  import * as unspecifiedConfig from "./../configuration/unspecified";
4
5
  import * as graphConfig from "./../configuration/graph";
5
6
  import * as workflowConfig from "./../configuration/workflow";
6
7
  import * as linkingConfig from "./../configuration/linking";
8
+ import * as inverseEdgeConfig from "./../configuration/inverseEdge";
9
+ import * as customLabelConfig from "./../configuration/customLabel";
7
10
 
8
- interface ReactFlowProps extends ReactFlowOriginalProps {
11
+ export interface ReactFlowProps extends ReactFlowOriginalProps {
9
12
  /**
10
13
  * Load `ReactFlow` component with pre-configured values for `nodeTypes` and `edgeTypes`
11
14
  */
12
- configuration?: "unspecified" | "graph" | "workflow" | "linking";
15
+ configuration?: "unspecified" | "graph" | "workflow" | "linking" | "inverseEdge" | "customLabel";
13
16
  }
14
17
 
15
18
  /**
@@ -19,6 +22,7 @@ interface ReactFlowProps extends ReactFlowOriginalProps {
19
22
  export const ReactFlow = React.forwardRef<HTMLDivElement, ReactFlowProps>((
20
23
  {
21
24
  configuration = "unspecified",
25
+ children,
22
26
  ...originalProps
23
27
  },
24
28
  ref) => {
@@ -27,6 +31,8 @@ export const ReactFlow = React.forwardRef<HTMLDivElement, ReactFlowProps>((
27
31
  graph: graphConfig,
28
32
  workflow: workflowConfig,
29
33
  linking: linkingConfig,
34
+ inverseEdge: inverseEdgeConfig,
35
+ customLabel: customLabelConfig,
30
36
  }
31
37
 
32
38
  return (
@@ -35,6 +41,9 @@ export const ReactFlow = React.forwardRef<HTMLDivElement, ReactFlowProps>((
35
41
  nodeTypes={ configReactFlow[configuration].nodeTypes }
36
42
  edgeTypes={ configReactFlow[configuration].edgeTypes }
37
43
  {...originalProps}
38
- />
44
+ >
45
+ { children }
46
+ <ReactFlowMarkers />
47
+ </ReactFlowOriginal>
39
48
  );
40
49
  })
@@ -0,0 +1,134 @@
1
+ import React from "react";
2
+ import { Tag, TagList, SimpleDialog, Icon, Button, FieldItem } from "./../../../index";
3
+ import getColorConfiguration from "../../../common/utils/getColorConfiguration";
4
+ import { CodeEditor } from "../../../extensions";
5
+
6
+ export type StickyNoteModalTranslationKeys = "modalTitle" | "noteLabel" | "colorLabel" | "saveButton" | "cancelButton";
7
+
8
+ export type StickyNoteMetadataType = { note: string; color: string };
9
+
10
+ export interface StickyNoteModalProps {
11
+ /**
12
+ * sticky data containing the sticky note and the selected color
13
+ */
14
+ metaData?: StickyNoteMetadataType;
15
+ /**
16
+ * utility to close the sticky note modal when cancelled as well as closed also
17
+ */
18
+ onClose: () => void;
19
+ /**
20
+ * utility to save recently entered metadata for sticky
21
+ * note and add on to the canvas
22
+ */
23
+ onSubmit: (data: StickyNoteMetadataType) => void;
24
+ /**
25
+ * translation utility for language compatibility
26
+ */
27
+ translate: (key: StickyNoteModalTranslationKeys) => string;
28
+ }
29
+
30
+ export const StickyNoteModal: React.FC<StickyNoteModalProps> = ({ metaData, onClose, onSubmit, translate }) => {
31
+ const refNote = React.useRef<string>(metaData?.note ?? "");
32
+ const [color, setSelectedColor] = React.useState<string>(metaData?.color ?? "");
33
+ const noteColors: [string, string][] = Object.entries(getColorConfiguration("stickynotes")).map(([key, value]) => [
34
+ key,
35
+ value as string,
36
+ ]);
37
+
38
+ React.useEffect(() => {
39
+ if (!color && noteColors[0][1]) {
40
+ setSelectedColor(noteColors[0][1]);
41
+ }
42
+ }, [color, noteColors]);
43
+
44
+ const wrapperDivProps: { [key: string]: (event: any) => any } = {
45
+ // Prevent react-flow from getting these events
46
+ onContextMenu: (event) => event.stopPropagation(),
47
+ onDrag: (event) => event.stopPropagation(),
48
+ onDragStart: (event) => event.stopPropagation(),
49
+ onDragEnd: (event) => event.stopPropagation(),
50
+ onMouseDown: (event) => event.stopPropagation(),
51
+ onMouseUp: (event) => event.stopPropagation(),
52
+ onClick: (event) => event.stopPropagation(),
53
+ };
54
+
55
+ const predefinedColorsMenu = (
56
+ <TagList>
57
+ {noteColors &&
58
+ noteColors.map(([colorName, colorValue]) => {
59
+ const selectedFeedback =
60
+ color === colorValue
61
+ ? {
62
+ icon: <Icon name="state-checkedsimple" />,
63
+ large: true,
64
+ }
65
+ : {};
66
+ return (
67
+ <Tag
68
+ round
69
+ onClick={() => setSelectedColor(colorValue)}
70
+ backgroundColor={colorValue}
71
+ {...selectedFeedback}
72
+ key={colorName}
73
+ />
74
+ );
75
+ })}
76
+ </TagList>
77
+ );
78
+
79
+ return (
80
+ <SimpleDialog
81
+ data-test-id={"sticky-note-modal"}
82
+ size="small"
83
+ title={translate("modalTitle")}
84
+ hasBorder
85
+ isOpen
86
+ onClose={onClose}
87
+ wrapperDivProps={wrapperDivProps}
88
+ actions={[
89
+ <Button
90
+ key="submit"
91
+ data-test-id="sticky-submit-btn"
92
+ affirmative
93
+ onClick={() => {
94
+ onSubmit({ note: refNote.current, color: color || "#444444" });
95
+ onClose();
96
+ }}
97
+ >
98
+ {translate("saveButton")}
99
+ </Button>,
100
+ <Button key="cancel" onClick={onClose}>
101
+ {translate("cancelButton")}
102
+ </Button>,
103
+ ]}
104
+ >
105
+ <FieldItem
106
+ key="note"
107
+ labelProps={{
108
+ htmlFor: "noteinput",
109
+ text: translate("noteLabel"),
110
+ }}
111
+ >
112
+ <CodeEditor
113
+ name={translate("noteLabel")}
114
+ id={"sticky-note-input"}
115
+ mode="markdown"
116
+ preventLineNumbers
117
+ onChange={(value) => {
118
+ refNote.current = value;
119
+ }}
120
+ defaultValue={refNote.current}
121
+ />
122
+ </FieldItem>
123
+ <FieldItem
124
+ key="color"
125
+ labelProps={{
126
+ htmlFor: "colorinput",
127
+ text: translate("colorLabel"),
128
+ }}
129
+ >
130
+ {predefinedColorsMenu}
131
+ </FieldItem>
132
+ </SimpleDialog>
133
+ );
134
+ };
@@ -2,4 +2,4 @@
2
2
  @import "edges";
3
3
  @import "handles";
4
4
  @import "minimap";
5
- @import "nodes";
5
+ @import "./nodes";
@@ -5,8 +5,12 @@
5
5
  }
6
6
 
7
7
  @mixin mapcoloring($color) {
8
- fill: $color;
9
- stroke: $color;
8
+ &:not([fill]) {
9
+ fill: $color;
10
+ }
11
+ &:not([stroke]) {
12
+ stroke: $color;
13
+ }
10
14
  }
11
15
 
12
16
  // Graph node type
@@ -0,0 +1,11 @@
1
+ import { EdgeDefault } from "./../../../extensions/react-flow/edges/EdgeDefault";
2
+ import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault";
3
+
4
+ export const edgeTypes = {
5
+ default: EdgeDefault,
6
+ straight: EdgeDefault,
7
+ };
8
+
9
+ export const nodeTypes = {
10
+ default: NodeDefault,
11
+ };
@@ -1,5 +1,6 @@
1
1
  import { EdgeDefault } from "./../../../extensions/react-flow/edges/EdgeDefault";
2
2
  import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault";
3
+ import { GRAPH_NODE_TYPES } from "./typing";
3
4
 
4
5
  const edgeTypes = {
5
6
  default: EdgeDefault,
@@ -13,7 +14,7 @@ const edgeTypes = {
13
14
  danger: EdgeDefault,
14
15
  };
15
16
 
16
- const nodeTypes = {
17
+ const nodeTypes: Record<GRAPH_NODE_TYPES, React.ReactNode> = {
17
18
  default: NodeDefault,
18
19
  graph: NodeDefault,
19
20
  class: NodeDefault,
@@ -21,7 +22,4 @@ const nodeTypes = {
21
22
  property: NodeDefault,
22
23
  };
23
24
 
24
- export {
25
- edgeTypes,
26
- nodeTypes,
27
- }
25
+ export { edgeTypes, nodeTypes };
@@ -0,0 +1,11 @@
1
+ import { EdgeDefault } from "./../../../extensions/react-flow/edges/EdgeDefault";
2
+ import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault";
3
+
4
+ export const edgeTypes = {
5
+ default: EdgeDefault,
6
+ straight: EdgeDefault,
7
+ };
8
+
9
+ export const nodeTypes = {
10
+ default: NodeDefault,
11
+ };
@@ -1,6 +1,7 @@
1
-
2
1
  import { EdgeStep } from "./../../../extensions/react-flow/edges/EdgeStep";
3
2
  import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault";
3
+ import { StickyNoteNode } from "./../nodes/StickyNoteNode";
4
+ import { LINKING_NODE_TYPES } from "./typing";
4
5
 
5
6
  const edgeTypes = {
6
7
  default: EdgeStep,
@@ -11,16 +12,14 @@ const edgeTypes = {
11
12
  danger: EdgeStep,
12
13
  };
13
14
 
14
- const nodeTypes = {
15
+ const nodeTypes: Record<LINKING_NODE_TYPES, React.ReactNode> = {
15
16
  default: NodeDefault,
16
17
  sourcepath: NodeDefault,
17
18
  targetpath: NodeDefault,
18
19
  transformation: NodeDefault,
19
20
  comparator: NodeDefault,
20
21
  aggregator: NodeDefault,
22
+ stickynote: StickyNoteNode,
21
23
  };
22
24
 
23
- export {
24
- edgeTypes,
25
- nodeTypes,
26
- }
25
+ export { edgeTypes, nodeTypes };