@eccenca/gui-elements 23.0.0-rc.1 → 23.0.0-rc.3

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 (311) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +4 -10
  3. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  4. package/dist/cjs/cmem/index.js +3 -1
  5. package/dist/cjs/cmem/index.js.map +1 -1
  6. package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +2 -1
  7. package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
  8. package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +64 -0
  9. package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -0
  10. package/dist/cjs/cmem/react-flow/configuration/graph.js.map +1 -1
  11. package/dist/cjs/cmem/react-flow/configuration/linking.js +2 -0
  12. package/dist/cjs/cmem/react-flow/configuration/linking.js.map +1 -1
  13. package/dist/cjs/cmem/react-flow/configuration/typing.js +35 -0
  14. package/dist/cjs/cmem/react-flow/configuration/typing.js.map +1 -0
  15. package/dist/cjs/cmem/react-flow/configuration/workflow.js +2 -0
  16. package/dist/cjs/cmem/react-flow/configuration/workflow.js.map +1 -1
  17. package/dist/cjs/cmem/react-flow/nodes/StickyNoteNode.js +42 -0
  18. package/dist/cjs/cmem/react-flow/nodes/StickyNoteNode.js.map +1 -0
  19. package/dist/cjs/common/utils/CssCustomProperties.js +114 -0
  20. package/dist/cjs/common/utils/CssCustomProperties.js.map +1 -0
  21. package/dist/cjs/common/utils/getColorConfiguration.js +21 -0
  22. package/dist/cjs/common/utils/getColorConfiguration.js.map +1 -0
  23. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +19 -19
  24. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  25. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +4 -12
  26. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  27. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +15 -6
  28. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  29. package/dist/cjs/components/Breadcrumb/BreadcrumbItem.js +13 -4
  30. package/dist/cjs/components/Breadcrumb/BreadcrumbItem.js.map +1 -1
  31. package/dist/cjs/components/Breadcrumb/BreadcrumbList.js +11 -4
  32. package/dist/cjs/components/Breadcrumb/BreadcrumbList.js.map +1 -1
  33. package/dist/cjs/components/Button/Button.js +2 -2
  34. package/dist/cjs/components/Button/Button.js.map +1 -1
  35. package/dist/cjs/components/ContextOverlay/ContextMenu.js +6 -5
  36. package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
  37. package/dist/cjs/components/ContextOverlay/ContextOverlay.js +6 -8
  38. package/dist/cjs/components/ContextOverlay/ContextOverlay.js.map +1 -1
  39. package/dist/cjs/components/Form/FieldItem.js +2 -2
  40. package/dist/cjs/components/Form/FieldItem.js.map +1 -1
  41. package/dist/cjs/components/Icon/Icon.js +2 -2
  42. package/dist/cjs/components/Icon/Icon.js.map +1 -1
  43. package/dist/cjs/components/Icon/IconButton.js +2 -2
  44. package/dist/cjs/components/Icon/IconButton.js.map +1 -1
  45. package/dist/cjs/components/Icon/canonicalIconNames.js +124 -114
  46. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  47. package/dist/cjs/components/Label/Label.js +6 -6
  48. package/dist/cjs/components/Label/Label.js.map +1 -1
  49. package/dist/cjs/components/Menu/MenuItem.js +2 -5
  50. package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
  51. package/dist/cjs/components/MultiSelect/MultiSelect.js +8 -10
  52. package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
  53. package/dist/cjs/components/Select/Select.js +29 -0
  54. package/dist/cjs/components/Select/Select.js.map +1 -0
  55. package/dist/cjs/components/Tabs/TabTitle.js +2 -4
  56. package/dist/cjs/components/Tabs/TabTitle.js.map +1 -1
  57. package/dist/cjs/components/Tag/Tag.js +2 -1
  58. package/dist/cjs/components/Tag/Tag.js.map +1 -1
  59. package/dist/cjs/components/Tooltip/Tooltip.js +7 -4
  60. package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
  61. package/dist/cjs/extensions/codemirror/CodeMirror.js +3 -3
  62. package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
  63. package/dist/cjs/extensions/react-flow/edges/EdgeTools.js +2 -1
  64. package/dist/cjs/extensions/react-flow/edges/EdgeTools.js.map +1 -1
  65. package/dist/cjs/extensions/react-flow/handles/HandleContent.js +1 -1
  66. package/dist/cjs/extensions/react-flow/handles/HandleContent.js.map +1 -1
  67. package/dist/cjs/extensions/react-flow/index.js +6 -1
  68. package/dist/cjs/extensions/react-flow/index.js.map +1 -1
  69. package/dist/cjs/extensions/react-flow/minimap/MiniMap.js +3 -2
  70. package/dist/cjs/extensions/react-flow/minimap/MiniMap.js.map +1 -1
  71. package/dist/cjs/extensions/react-flow/minimap/utils.js +12 -6
  72. package/dist/cjs/extensions/react-flow/minimap/utils.js.map +1 -1
  73. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +74 -25
  74. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  75. package/dist/cjs/extensions/react-flow/nodes/NodeContentExtension.js +10 -6
  76. package/dist/cjs/extensions/react-flow/nodes/NodeContentExtension.js.map +1 -1
  77. package/dist/cjs/extensions/react-flow/nodes/NodeTools.js +1 -3
  78. package/dist/cjs/extensions/react-flow/nodes/NodeTools.js.map +1 -1
  79. package/dist/cjs/extensions/react-flow/nodes/nodeUtils.js +49 -0
  80. package/dist/cjs/extensions/react-flow/nodes/nodeUtils.js.map +1 -0
  81. package/dist/cjs/index.js +3 -2
  82. package/dist/cjs/index.js.map +1 -1
  83. package/dist/cjs/legacy-replacements/Tabs/Tabs.js +1 -1
  84. package/dist/cjs/legacy-replacements/Tabs/Tabs.js.map +1 -1
  85. package/dist/cjs/legacy-replacements/TextField/TextField.js +5 -8
  86. package/dist/cjs/legacy-replacements/TextField/TextField.js.map +1 -1
  87. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +4 -10
  88. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  89. package/dist/esm/cmem/index.js +1 -0
  90. package/dist/esm/cmem/index.js.map +1 -1
  91. package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +2 -1
  92. package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
  93. package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +89 -0
  94. package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -0
  95. package/dist/esm/cmem/react-flow/configuration/graph.js +1 -1
  96. package/dist/esm/cmem/react-flow/configuration/graph.js.map +1 -1
  97. package/dist/esm/cmem/react-flow/configuration/linking.js +3 -1
  98. package/dist/esm/cmem/react-flow/configuration/linking.js.map +1 -1
  99. package/dist/esm/cmem/react-flow/configuration/typing.js +32 -0
  100. package/dist/esm/cmem/react-flow/configuration/typing.js.map +1 -0
  101. package/dist/esm/cmem/react-flow/configuration/workflow.js +3 -1
  102. package/dist/esm/cmem/react-flow/configuration/workflow.js.map +1 -1
  103. package/dist/esm/cmem/react-flow/nodes/StickyNoteNode.js +31 -0
  104. package/dist/esm/cmem/react-flow/nodes/StickyNoteNode.js.map +1 -0
  105. package/dist/esm/common/utils/CssCustomProperties.js +154 -0
  106. package/dist/esm/common/utils/CssCustomProperties.js.map +1 -0
  107. package/dist/esm/common/utils/getColorConfiguration.js +16 -0
  108. package/dist/esm/common/utils/getColorConfiguration.js.map +1 -0
  109. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +23 -21
  110. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  111. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +4 -12
  112. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  113. package/dist/esm/components/AutocompleteField/AutoCompleteField.js +32 -23
  114. package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  115. package/dist/esm/components/Breadcrumb/BreadcrumbItem.js +13 -4
  116. package/dist/esm/components/Breadcrumb/BreadcrumbItem.js.map +1 -1
  117. package/dist/esm/components/Breadcrumb/BreadcrumbList.js +11 -4
  118. package/dist/esm/components/Breadcrumb/BreadcrumbList.js.map +1 -1
  119. package/dist/esm/components/Button/Button.js +2 -2
  120. package/dist/esm/components/Button/Button.js.map +1 -1
  121. package/dist/esm/components/ContextOverlay/ContextMenu.js +6 -5
  122. package/dist/esm/components/ContextOverlay/ContextMenu.js.map +1 -1
  123. package/dist/esm/components/ContextOverlay/ContextOverlay.js +6 -8
  124. package/dist/esm/components/ContextOverlay/ContextOverlay.js.map +1 -1
  125. package/dist/esm/components/Form/FieldItem.js +2 -2
  126. package/dist/esm/components/Form/FieldItem.js.map +1 -1
  127. package/dist/esm/components/Icon/Icon.js +2 -2
  128. package/dist/esm/components/Icon/Icon.js.map +1 -1
  129. package/dist/esm/components/Icon/IconButton.js +2 -2
  130. package/dist/esm/components/Icon/IconButton.js.map +1 -1
  131. package/dist/esm/components/Icon/canonicalIconNames.js +124 -114
  132. package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
  133. package/dist/esm/components/Label/Label.js +6 -6
  134. package/dist/esm/components/Label/Label.js.map +1 -1
  135. package/dist/esm/components/Menu/MenuItem.js +2 -5
  136. package/dist/esm/components/Menu/MenuItem.js.map +1 -1
  137. package/dist/esm/components/MultiSelect/MultiSelect.js +5 -7
  138. package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
  139. package/dist/esm/components/Select/Select.js +35 -0
  140. package/dist/esm/components/Select/Select.js.map +1 -0
  141. package/dist/esm/components/Tabs/TabTitle.js +2 -4
  142. package/dist/esm/components/Tabs/TabTitle.js.map +1 -1
  143. package/dist/esm/components/Tag/Tag.js +2 -1
  144. package/dist/esm/components/Tag/Tag.js.map +1 -1
  145. package/dist/esm/components/Tooltip/Tooltip.js +7 -4
  146. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  147. package/dist/esm/extensions/codemirror/CodeMirror.js +3 -3
  148. package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
  149. package/dist/esm/extensions/react-flow/edges/EdgeTools.js +2 -1
  150. package/dist/esm/extensions/react-flow/edges/EdgeTools.js.map +1 -1
  151. package/dist/esm/extensions/react-flow/handles/HandleContent.js +1 -1
  152. package/dist/esm/extensions/react-flow/handles/HandleContent.js.map +1 -1
  153. package/dist/esm/extensions/react-flow/index.js +1 -0
  154. package/dist/esm/extensions/react-flow/index.js.map +1 -1
  155. package/dist/esm/extensions/react-flow/minimap/MiniMap.js +3 -2
  156. package/dist/esm/extensions/react-flow/minimap/MiniMap.js.map +1 -1
  157. package/dist/esm/extensions/react-flow/minimap/utils.js +10 -5
  158. package/dist/esm/extensions/react-flow/minimap/utils.js.map +1 -1
  159. package/dist/esm/extensions/react-flow/nodes/NodeContent.js +76 -27
  160. package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  161. package/dist/esm/extensions/react-flow/nodes/NodeContentExtension.js +26 -6
  162. package/dist/esm/extensions/react-flow/nodes/NodeContentExtension.js.map +1 -1
  163. package/dist/esm/extensions/react-flow/nodes/NodeTools.js +1 -3
  164. package/dist/esm/extensions/react-flow/nodes/NodeTools.js.map +1 -1
  165. package/dist/esm/extensions/react-flow/nodes/nodeUtils.js +44 -0
  166. package/dist/esm/extensions/react-flow/nodes/nodeUtils.js.map +1 -0
  167. package/dist/esm/index.js +3 -2
  168. package/dist/esm/index.js.map +1 -1
  169. package/dist/esm/legacy-replacements/Tabs/Tabs.js +1 -1
  170. package/dist/esm/legacy-replacements/Tabs/Tabs.js.map +1 -1
  171. package/dist/esm/legacy-replacements/TextField/TextField.js +2 -5
  172. package/dist/esm/legacy-replacements/TextField/TextField.js.map +1 -1
  173. package/dist/types/cmem/index.d.ts +1 -0
  174. package/dist/types/cmem/react-flow/StickyNoteModal/StickyNoteModal.d.ts +26 -0
  175. package/dist/types/cmem/react-flow/configuration/graph.d.ts +3 -8
  176. package/dist/types/cmem/react-flow/configuration/linking.d.ts +3 -9
  177. package/dist/types/cmem/react-flow/configuration/typing.d.ts +28 -0
  178. package/dist/types/cmem/react-flow/configuration/workflow.d.ts +3 -9
  179. package/dist/types/cmem/react-flow/nodes/StickyNoteNode.d.ts +3 -0
  180. package/dist/types/common/utils/CssCustomProperties.d.ts +28 -0
  181. package/dist/types/common/utils/getColorConfiguration.d.ts +8 -0
  182. package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +7 -4
  183. package/dist/types/components/Breadcrumb/BreadcrumbItem.d.ts +7 -3
  184. package/dist/types/components/Breadcrumb/BreadcrumbList.d.ts +20 -8
  185. package/dist/types/components/Button/Button.d.ts +2 -2
  186. package/dist/types/components/ContextOverlay/ContextMenu.d.ts +37 -3
  187. package/dist/types/components/ContextOverlay/ContextOverlay.d.ts +12 -1
  188. package/dist/types/components/Form/FieldItem.d.ts +3 -2
  189. package/dist/types/components/Icon/Icon.d.ts +32 -7
  190. package/dist/types/components/Icon/IconButton.d.ts +21 -7
  191. package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
  192. package/dist/types/components/Label/Label.d.ts +30 -2
  193. package/dist/types/components/Menu/MenuItem.d.ts +3 -7
  194. package/dist/types/components/MultiSelect/MultiSelect.d.ts +13 -9
  195. package/dist/types/components/Select/Select.d.ts +22 -0
  196. package/dist/types/components/Tag/Tag.d.ts +5 -1
  197. package/dist/types/components/Tooltip/Tooltip.d.ts +13 -11
  198. package/dist/types/components/interfaces.d.ts +1 -0
  199. package/dist/types/extensions/codemirror/CodeMirror.d.ts +5 -1
  200. package/dist/types/extensions/react-flow/edges/EdgeTools.d.ts +2 -2
  201. package/dist/types/extensions/react-flow/index.d.ts +1 -0
  202. package/dist/types/extensions/react-flow/minimap/MiniMap.d.ts +1 -1
  203. package/dist/types/extensions/react-flow/minimap/utils.d.ts +1 -0
  204. package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +17 -1
  205. package/dist/types/extensions/react-flow/nodes/NodeContentExtension.d.ts +2 -2
  206. package/dist/types/extensions/react-flow/nodes/NodeTools.d.ts +2 -2
  207. package/dist/types/extensions/react-flow/nodes/nodeUtils.d.ts +14 -0
  208. package/dist/types/index.d.ts +3 -2
  209. package/dist/types/legacy-replacements/Tabs/Tabs.d.ts +1 -1
  210. package/package.json +19 -15
  211. package/scripts/compile-sass.ts +9 -0
  212. package/scripts/fix-cjs-dist +5 -0
  213. package/scripts/fix-esm-dist +6 -0
  214. package/scripts/sassConfig.js +13 -0
  215. package/src/_shame.scss +17 -0
  216. package/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +2 -2
  217. package/src/cmem/ActivityControl/ActivityControlWidget.tsx +5 -10
  218. package/src/cmem/index.ts +1 -0
  219. package/src/cmem/markdown/markdown.scss +1 -1
  220. package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +48 -15
  221. package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +2 -0
  222. package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +134 -0
  223. package/src/cmem/react-flow/_index.scss +1 -1
  224. package/src/cmem/react-flow/_minimap.scss +6 -2
  225. package/src/cmem/react-flow/configuration/graph.ts +3 -5
  226. package/src/cmem/react-flow/configuration/linking.ts +5 -6
  227. package/src/cmem/react-flow/configuration/typing.ts +30 -0
  228. package/src/cmem/react-flow/configuration/workflow.ts +5 -5
  229. package/src/cmem/react-flow/nodes/StickyNoteNode.tsx +13 -0
  230. package/src/cmem/react-flow/{_nodes.scss → nodes/_colors.scss} +0 -0
  231. package/src/cmem/react-flow/nodes/_index.scss +2 -0
  232. package/src/cmem/react-flow/nodes/_stickynote.scss +72 -0
  233. package/src/common/utils/CssCustomProperties.ts +14 -12
  234. package/src/common/utils/getColorConfiguration.ts +1 -2
  235. package/src/components/Accordion/accordion.scss +11 -11
  236. package/src/components/Application/_header.scss +4 -3
  237. package/src/components/AutoSuggestion/AutoSuggestion.tsx +23 -23
  238. package/src/components/AutoSuggestion/AutoSuggestionList.tsx +15 -17
  239. package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +1 -1
  240. package/src/components/AutocompleteField/AutoCompleteField.tsx +44 -19
  241. package/src/components/AutocompleteField/autocompletefield.scss +5 -3
  242. package/src/components/AutocompleteField/stories/AutoCompleteField.stories.tsx +75 -0
  243. package/src/components/Breadcrumb/BreadcrumbItem.tsx +15 -6
  244. package/src/components/Breadcrumb/BreadcrumbList.tsx +36 -14
  245. package/src/components/Breadcrumb/breadcrumb.scss +24 -1
  246. package/src/components/Breadcrumb/stories/BreadcrumbItem.stories.tsx +19 -0
  247. package/src/components/Breadcrumb/stories/BreadcrumbList.stories.tsx +26 -0
  248. package/src/components/Button/Button.tsx +3 -3
  249. package/src/components/Button/button.scss +43 -6
  250. package/src/components/Card/card.scss +5 -5
  251. package/src/components/ContextOverlay/ContextMenu.stories.tsx +33 -0
  252. package/src/components/ContextOverlay/ContextMenu.tsx +46 -8
  253. package/src/components/ContextOverlay/ContextOverlay.stories.tsx +148 -0
  254. package/src/components/ContextOverlay/ContextOverlay.tsx +16 -9
  255. package/src/components/ContextOverlay/contextoverlay.scss +17 -5
  256. package/src/components/Dialog/dialog.scss +10 -8
  257. package/src/components/Form/FieldItem.tsx +4 -4
  258. package/src/components/Form/form.scss +6 -6
  259. package/src/components/Icon/Icon.tsx +33 -18
  260. package/src/components/Icon/IconButton.tsx +24 -19
  261. package/src/components/Icon/canonicalIconNames.tsx +134 -121
  262. package/src/components/Icon/icon.scss +1 -1
  263. package/src/components/Icon/stories/Icon.stories.tsx +52 -0
  264. package/src/components/Icon/stories/IconButton.stories.tsx +27 -0
  265. package/src/components/Label/Label.stories.tsx +27 -0
  266. package/src/components/Label/Label.tsx +47 -15
  267. package/src/components/Label/label.scss +2 -2
  268. package/src/components/Menu/MenuItem.tsx +9 -16
  269. package/src/components/Menu/menu.scss +10 -9
  270. package/src/components/MultiSelect/MultiSelect.tsx +30 -18
  271. package/src/components/Notification/notification.scss +3 -1
  272. package/src/components/OverviewItem/overviewitem.scss +8 -8
  273. package/src/components/PropertyValuePair/propertyvalue.scss +9 -7
  274. package/src/components/Select/Select.stories.tsx +35 -0
  275. package/src/components/Select/Select.tsx +38 -0
  276. package/src/components/Select/_select.scss +8 -0
  277. package/src/components/Separation/separation.scss +6 -6
  278. package/src/components/SimpleTable/simpletable.scss +5 -5
  279. package/src/components/Tabs/TabTitle.tsx +2 -4
  280. package/src/components/Tabs/tabs.scss +3 -3
  281. package/src/components/Tag/Tag.tsx +6 -0
  282. package/src/components/Tag/tag.scss +62 -33
  283. package/src/components/TextField/textfield.scss +6 -4
  284. package/src/components/Tooltip/Tooltip.stories.tsx +36 -0
  285. package/src/components/Tooltip/Tooltip.tsx +23 -18
  286. package/src/components/Tooltip/tooltip.scss +7 -7
  287. package/src/components/Typography/typography.scss +5 -4
  288. package/src/components/interfaces.ts +3 -1
  289. package/src/configuration/_variables.scss +11 -9
  290. package/src/extensions/codemirror/CodeMirror.tsx +9 -4
  291. package/src/extensions/react-flow/edges/EdgeTools.tsx +6 -4
  292. package/src/extensions/react-flow/edges/_edges.scss +3 -3
  293. package/src/extensions/react-flow/handles/HandleContent.tsx +0 -1
  294. package/src/extensions/react-flow/handles/_handles.scss +13 -13
  295. package/src/extensions/react-flow/index.ts +1 -0
  296. package/src/extensions/react-flow/minimap/MiniMap.tsx +16 -1
  297. package/src/extensions/react-flow/minimap/_minimap.scss +6 -6
  298. package/src/extensions/react-flow/minimap/utils.ts +8 -3
  299. package/src/extensions/react-flow/nodes/NodeContent.tsx +253 -166
  300. package/src/extensions/react-flow/nodes/NodeContentExtension.tsx +17 -11
  301. package/src/extensions/react-flow/nodes/NodeTools.tsx +10 -7
  302. package/src/extensions/react-flow/nodes/_nodes.scss +44 -12
  303. package/src/extensions/react-flow/nodes/nodeUtils.tsx +53 -0
  304. package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +41 -12
  305. package/src/extensions/react-flow/nodes/stories/NodeContentExtension.stories.tsx +39 -47
  306. package/src/includes/blueprintjs/_variables.scss +4 -2
  307. package/src/includes/carbon-components/_variables.scss +7 -5
  308. package/src/index.scss +9 -5
  309. package/src/index.ts +4 -2
  310. package/src/legacy-replacements/Tabs/Tabs.tsx +3 -1
  311. package/src/legacy-replacements/TextField/TextField.tsx +7 -5
@@ -8,6 +8,10 @@ export declare type HighlightingState = "success" | "warning" | "danger" | "matc
8
8
  export interface IHandleProps extends HandleProps {
9
9
  category?: "configuration";
10
10
  }
11
+ export declare type NodeDimensions = {
12
+ width: number;
13
+ height: number;
14
+ };
11
15
  interface NodeContentData<CONTENT_PROPS = any> {
12
16
  /**
13
17
  * Name of icon that should be displayed before the node label.
@@ -30,6 +34,10 @@ interface NodeContentData<CONTENT_PROPS = any> {
30
34
  * Content extension, displayed at the bottom side of a node.
31
35
  */
32
36
  contentExtension?: React.ReactElement<NodeContentExtensionProps>;
37
+ /**
38
+ * If submitted then the node will display footer element.
39
+ */
40
+ footerContent?: React.ReactNode;
33
41
  }
34
42
  export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends NodeContentData, React.HTMLAttributes<HTMLDivElement> {
35
43
  /**
@@ -117,11 +125,19 @@ export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends N
117
125
  * If this is allowed scrolling inside a node is not possible.
118
126
  */
119
127
  letPassWheelEvents?: boolean;
128
+ /**
129
+ * When set to true, allows nodes to be resized by dragging edges and sides
130
+ */
131
+ onNodeResize?: (data: NodeDimensions) => void;
132
+ /**
133
+ * width and height dimensions of the node (Optional)
134
+ */
135
+ nodeDimensions?: NodeDimensions;
120
136
  }
121
137
  export declare const gethighlightedStateClasses: (state: any, baseClassName: any) => any;
122
138
  /**
123
139
  * The `NodeContent` element manages the main view of how a node is displaying which content.
124
140
  * This element cannot be used directly, all properties must be routed through the `data` property of an `elements` property item inside the `ReactFlow` container.
125
141
  */
126
- export declare function NodeContent<CONTENT_PROPS = any>({ iconName, depiction, typeLabel, label, showExecutionButtons, executionButtons, menuButtons, content, contentExtension, size, minimalShape, highlightedState, handles, adaptHeightForHandleMinCount, adaptSizeIncrement, getMinimalTooltipData, style, showUnconnectableHandles, animated, targetPosition, sourcePosition, isConnectable, selected, letPassWheelEvents, businessData, ...otherProps }: NodeContentProps<any>): JSX.Element;
142
+ export declare function NodeContent<CONTENT_PROPS = any>({ iconName, depiction, typeLabel, label, showExecutionButtons, executionButtons, menuButtons, content, contentExtension, footerContent, size, minimalShape, highlightedState, handles, adaptHeightForHandleMinCount, adaptSizeIncrement, getMinimalTooltipData, style, showUnconnectableHandles, animated, onNodeResize, nodeDimensions, targetPosition, sourcePosition, isConnectable, selected, letPassWheelEvents, businessData, ...otherProps }: NodeContentProps<any>): JSX.Element;
127
143
  export {};
@@ -13,7 +13,7 @@ export interface NodeContentExtensionProps extends React.HTMLAttributes<HTMLDivE
13
13
  * Click handler to manage the expanded state from outside the the element.
14
14
  * This state is not managed automatically by the element itself.
15
15
  */
16
- onToggle?: (event: React.MouseEvent<HTMLElement>, isExpanded: boolean) => void;
16
+ setExpanded?: (event: React.MouseEvent<HTMLElement>, isCurrentlyExpanded: boolean) => boolean;
17
17
  /**
18
18
  * Single element or aray of `IconButton` and `Button` elements.
19
19
  * They will be displayed beside the closing button under the element content body.
@@ -31,4 +31,4 @@ export interface NodeContentExtensionProps extends React.HTMLAttributes<HTMLDivE
31
31
  /**
32
32
  * Displays an content area that can be attached to `NodeContent` elements.
33
33
  */
34
- export declare const NodeContentExtension: ({ children, slideOutOfNode, isExpanded, onToggle, actionButtons, tooltipExpand, tooltipReduce, ...otherProps }: NodeContentExtensionProps) => JSX.Element;
34
+ export declare const NodeContentExtension: ({ children, slideOutOfNode, isExpanded, setExpanded, actionButtons, tooltipExpand, tooltipReduce, ...otherProps }: NodeContentExtensionProps) => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import { IPopoverProps as IBlueprintPopoverProps } from "@blueprintjs/core";
2
+ import { ContextOverlayProps } from "./../../../components/ContextOverlay/ContextOverlay";
3
3
  import { ValidIconName } from "../../../components/Icon/canonicalIconNames";
4
- export interface NodeToolsProps extends IBlueprintPopoverProps {
4
+ export interface NodeToolsProps extends Omit<ContextOverlayProps, "children"> {
5
5
  children: string | JSX.Element;
6
6
  togglerElement?: ValidIconName | JSX.Element;
7
7
  togglerText?: string;
@@ -0,0 +1,14 @@
1
+ import { CSSProperties } from "react";
2
+ import { Node } from "react-flow-renderer";
3
+ interface IStickyNote {
4
+ id: string;
5
+ content: string;
6
+ color: string;
7
+ position: number[];
8
+ dimension: number[];
9
+ }
10
+ declare const utils: {
11
+ generateStyleWithColor: (color: string) => CSSProperties;
12
+ transformNodeToStickyNode: (node: Node<any>) => IStickyNote;
13
+ };
14
+ export default utils;
@@ -51,7 +51,7 @@ import Tag from "./components/Tag/Tag";
51
51
  import TagList from "./components/Tag/TagList";
52
52
  import Notification from "./components/Notification/Notification";
53
53
  import Toast from "./components/Notification/Toast";
54
- import { Select } from "@blueprintjs/select";
54
+ import Select from "./components/Select/Select";
55
55
  import MultiSelect from "./components/MultiSelect/MultiSelect";
56
56
  import { Iframe } from "./components/Iframe/Iframe";
57
57
  import { IframeModal } from "./components/Iframe/IframeModal";
@@ -92,6 +92,7 @@ declare const Utilities: {
92
92
  openInNewTab: (event: import("react").MouseEvent<HTMLElement, MouseEvent>, handler?: ((e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void) | undefined, url?: string | undefined) => void;
93
93
  };
94
94
  export { ApplicationContainer, ApplicationHeader, ApplicationContent, ApplicationSidebarNavigation, ApplicationSidebarToggler, ApplicationTitle, ApplicationToolbar, ApplicationToolbarSection, ApplicationToolbarAction, ApplicationToolbarPanel, AutoSuggestion, AutoSuggestionList, SingleLineCodeEditor, HtmlContentBlock, OverflowText, WhiteSpaceContainer, Highlighter, Grid, GridRow, GridColumn, List, WorkspaceContent, WorkspaceMain, WorkspaceSide, WorkspaceHeader, Menu, MenuItem, MenuDivider, ContextOverlay, ContextMenu, OverviewItem, OverviewItemDepiction, OverviewItemDescription, OverviewItemLine, OverviewItemActions, OverviewItemList, TableContainer, Table, TableHead, TableRow, TableBody, TableCell, TableHeader, Icon, IconButton, Label, Button, Checkbox, RadioButton, Tabs, Tab, TabTitle, TextField, TextArea, SearchField, Switch, NumericInput, FieldItem, FieldItemRow, FieldSet, BreadcrumbList, BreadcrumbItem, Modal, SimpleDialog, AlertDialog, Card, CardHeader, CardTitle, CardOptions, CardContent, CardActions, CardActionsAux, Spacing, Divider, Tooltip, Section, SectionHeader, TitlePage, TitleMainsection, TitleSubsection, Accordion, AccordionItem, Toolbar, ToolbarSection, Tag, TagList, Pagination, Notification, Link, Spinner, PropertyName, PropertyValue, PropertyValuePair, PropertyValueList, Toast, HelperClasses, Select, // FIXME: CMEM-3742: include as own element
95
- MultiSelect, AutoCompleteField, ProgressBar, Iframe, IframeModal, Utilities, LegacyReplacements, };
95
+ MultiSelect, AutoCompleteField, ProgressBar, Iframe, IframeModal, Utilities, LegacyReplacements };
96
96
  export * from "./cmem";
97
97
  export * from "./extensions";
98
+ export * from "./components/interfaces";
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { TabsProps as BlueprintTabsProps } from "@blueprintjs/core";
3
- interface TabsProps extends Omit<BlueprintTabsProps, "vertical" | "onChange" | "large" | "id" | "renderActiveTabPanelOnly"> {
3
+ interface TabsProps extends Omit<BlueprintTabsProps, "vertical" | "onChange" | "large" | "id" | "animate"> {
4
4
  activeTab: string;
5
5
  tabs: DeprecatedTabProps[];
6
6
  onTabClick?: ({ props }: any) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eccenca/gui-elements",
3
3
  "description": "GUI elements based on other libraries, usable in React application, written in Typescript.",
4
- "version": "23.0.0-rc.1",
4
+ "version": "23.0.0-rc.3",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/eccenca/gui-elements",
7
7
  "bugs": "https://github.com/eccenca/gui-elements/issues",
@@ -38,11 +38,13 @@
38
38
  ".": {
39
39
  "import": "./dist/esm/index.js",
40
40
  "require": "./dist/cjs/index.js"
41
- }
41
+ },
42
+ "./config/sassOptions": "./scripts/sassConfig.js"
42
43
  },
43
44
  "files": [
44
45
  "dist",
45
- "src"
46
+ "src",
47
+ "scripts"
46
48
  ],
47
49
  "scripts": {
48
50
  "build:clean": "rimraf dist/",
@@ -50,7 +52,7 @@
50
52
  "build:cjs": "tsc --project .typescript/tsbuild-cjs.json && ./scripts/fix-cjs-dist",
51
53
  "build:all": "yarn build:clean && yarn build:esm && yarn build:cjs",
52
54
  "compile": "tsc --build tsconfig.json",
53
- "compile-scss": "node-sass src/index.scss --importer=node_modules/node-sass-tilde-importer",
55
+ "compile-scss": "ts-node -O \"{ \\\"esModuleInterop\\\": true, \\\"module\\\": \\\"commonjs\\\"}\" ./scripts/compile-sass.ts",
54
56
  "storybook": "start-storybook -p 6006",
55
57
  "build-storybook": "build-storybook",
56
58
  "test": "jest",
@@ -60,8 +62,10 @@
60
62
  "check:package": "pjv --warnings --recommendations"
61
63
  },
62
64
  "dependencies": {
63
- "@blueprintjs/core": "3.49.1",
64
- "@blueprintjs/select": "3.18.1",
65
+ "@blueprintjs/colors": "^4.1.5",
66
+ "@blueprintjs/core": "^4.9.0",
67
+ "@blueprintjs/popover2": "^1.6.0",
68
+ "@blueprintjs/select": "^4.6.0",
65
69
  "@carbon/icons": "10.44.0",
66
70
  "@carbon/icons-react": "10.44.0",
67
71
  "@mavrin/remark-typograf": "^2.2.0",
@@ -72,6 +76,7 @@
72
76
  "color": "3.2.1",
73
77
  "lodash": "^4.17.21",
74
78
  "micromark": "^3.0.10",
79
+ "re-resizable": "6.9.9",
75
80
  "react": "^16.13.1",
76
81
  "react-codemirror2": "^7.2.1",
77
82
  "react-dom": "^16.13.1",
@@ -93,12 +98,12 @@
93
98
  "@babel/preset-flow": "^7.16.5",
94
99
  "@babel/preset-react": "^7.16.7",
95
100
  "@babel/preset-typescript": "^7.16.7",
96
- "@storybook/addon-actions": "^6.4.9",
97
- "@storybook/addon-essentials": "^6.4.9",
98
- "@storybook/addon-jest": "^6.4.13",
99
- "@storybook/addon-links": "^6.4.9",
101
+ "@storybook/addon-actions": "^6.5.10",
102
+ "@storybook/addon-essentials": "^6.5.10",
103
+ "@storybook/addon-jest": "^6.5.10",
104
+ "@storybook/addon-links": "^6.5.10",
100
105
  "@storybook/preset-scss": "^1.0.3",
101
- "@storybook/react": "^6.4.9",
106
+ "@storybook/react": "^6.5.10",
102
107
  "@testing-library/jest-dom": "^5.16.1",
103
108
  "@testing-library/react": "^12.1.2",
104
109
  "@types/carbon-components-react": "7.49.0",
@@ -117,15 +122,16 @@
117
122
  "jest": "^26.6.3",
118
123
  "jest-environment-jsdom-fourteen": "1.0.1",
119
124
  "jest-pnp-resolver": "^1.2.1",
120
- "node-sass": "6.0.1",
121
- "node-sass-tilde-importer": "^1.0.2",
125
+ "node-sass-package-importer": "^5.3.2",
122
126
  "package-json-validator": "^0.6.3",
123
127
  "react-app-polyfill": "^1.0.6",
124
128
  "react-lorem-ipsum": "^1.4.9",
125
129
  "regenerator-runtime": "^0.13.9",
126
130
  "rimraf": "^3.0.2",
131
+ "sass": "^1.53.0",
127
132
  "sass-loader": "^10.3.1",
128
133
  "style-loader": "0.23.1",
134
+ "ts-node": "^10.9.1",
129
135
  "tsc-esm-fix": "^2.13.0",
130
136
  "typescript": "4.4.4",
131
137
  "webpack": "^4.46.0"
@@ -135,8 +141,6 @@
135
141
  "react-dom": ">=16"
136
142
  },
137
143
  "resolutions": {
138
- "**/@blueprintjs/core": "3.49.1",
139
- "**/@blueprintjs/select": "3.18.1",
140
144
  "**/@carbon/icons": "10.44.0",
141
145
  "**/@carbon/icons-react": "10.44.0",
142
146
  "**/carbon-components": "10.44.0",
@@ -0,0 +1,9 @@
1
+ import * as sass from "sass";
2
+ import tildeImporter from "node-sass-package-importer";
3
+ import sassRenderSyncConfig from "./sassConfig";
4
+
5
+ sass.renderSync({
6
+ importer: tildeImporter(),
7
+ ...sassRenderSyncConfig,
8
+ file: "src/index.scss",
9
+ });
@@ -0,0 +1,5 @@
1
+ cat >dist/cjs/package.json <<!EOF
2
+ {
3
+ "type": "commonjs"
4
+ }
5
+ !EOF
@@ -0,0 +1,6 @@
1
+ yarn tsc-esm-fix --target='dist/esm'
2
+ cat >dist/esm/package.json <<!EOF
3
+ {
4
+ "type": "module"
5
+ }
6
+ !EOF
@@ -0,0 +1,13 @@
1
+ const sass = require("sass");
2
+
3
+ const functions = {
4
+ 'svg-icon($path, $selectors: null)': function(_path, _selectors) {
5
+ return new sass.SassString("unset");
6
+ },
7
+ };
8
+ const sassRenderSyncConfig = {
9
+ quietDeps: true,
10
+ functions,
11
+ };
12
+
13
+ module.exports = sassRenderSyncConfig;
package/src/_shame.scss CHANGED
@@ -109,3 +109,20 @@ scrollbar-color: #bbb transparent;
109
109
  background-color: #bbb;
110
110
  }
111
111
  }
112
+
113
+ /*
114
+ CHANGE: default focus behaviour
115
+ */
116
+
117
+
118
+ :focus,
119
+ input:focus-visible,
120
+ textarea:focus-visible {
121
+ outline: none;
122
+ outline-offset: 0;
123
+ }
124
+
125
+ :focus-visible {
126
+ outline: rgba($eccgui-color-accent, $eccgui-opacity-muted) solid 2px;
127
+ outline-offset: 1px;
128
+ }
@@ -66,10 +66,10 @@ const actions = [
66
66
  ];
67
67
 
68
68
  const commonWidgetArgs = {
69
- label: loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 4, random: false }),
69
+ label: loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 4, random: false }).toString(),
70
70
  border: true,
71
71
  activityActions: actions,
72
- statusMessage: loremIpsum({ p: 1, startWithLoremIpsum: false, random: false }),
72
+ statusMessage: loremIpsum({ p: 1, startWithLoremIpsum: false, random: false }).toString(),
73
73
  progressSpinner: {
74
74
  intent: "none",
75
75
  value: 0.5,
@@ -151,15 +151,8 @@ export function ActivityControlWidget(props: IActivityControlProps) {
151
151
  <Tooltip
152
152
  content={props.statusMessage}
153
153
  size="large"
154
- tooltipProps={{
155
- position: "top-right",
156
- boundary: "viewport",
157
- modifiers: {
158
- flip: {
159
- enabled: false
160
- }
161
- }
162
- }}
154
+ placement="top-start"
155
+ rootBoundary="viewport"
163
156
  >
164
157
  {props.statusMessage}
165
158
  </Tooltip>
@@ -181,9 +174,11 @@ export function ActivityControlWidget(props: IActivityControlProps) {
181
174
  name={action.icon}
182
175
  text={action.tooltip}
183
176
  onClick={action.action}
184
- tooltipOpenDelay={200}
185
177
  disabled={action.disabled}
186
178
  hasStateWarning={action.hasStateWarning}
179
+ tooltipProps={{
180
+ hoverOpenDelay: 200
181
+ }}
187
182
  />
188
183
  );
189
184
  })}
package/src/cmem/index.ts CHANGED
@@ -13,6 +13,7 @@ export { firstNonEmptyLine } from "./ContentBlobToggler/StringPreviewContentBlob
13
13
  export { ElapsedDateTimeDisplay } from "./DateTimeDisplay/ElapsedDateTimeDisplay";
14
14
  export { Markdown } from "./markdown/Markdown";
15
15
  export { ReactFlow } from "./react-flow/ReactFlow/ReactFlow";
16
+ export { StickyNoteModal } from "./react-flow/StickyNoteModal/StickyNoteModal";
16
17
 
17
18
  export type {
18
19
  IActivityStatus,
@@ -8,7 +8,7 @@
8
8
 
9
9
  vertical-align: super;
10
10
  font-size: $eccgui-size-typo-caption;
11
- margin-left: $eccgui-size-inline-whitespace / 2;
11
+ margin-left: $eccgui-size-inline-whitespace * 0.5;
12
12
  }
13
13
 
14
14
  .footnote-back {
@@ -1,8 +1,8 @@
1
1
  import React, { useState, useEffect, useCallback, FC } from "react";
2
2
  import { ComponentStory, ComponentMeta } from "@storybook/react";
3
- import IconButton from "../../../components/Icon/IconButton";
4
- import { ReactFlow, ReactFlowProps } from "./ReactFlow";
5
- import { ArrowHeadType, Elements, getMarkerEnd } 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";
6
6
 
7
7
  export default {
8
8
  title: "CMEM/React Flow/Configurations",
@@ -17,7 +17,8 @@ const nodeExamples = {
17
17
  id: 'unspecified-1',
18
18
  type: "default",
19
19
  data: {
20
- label: "Default ", content: "Example content.", minimalShape: "none"
20
+ label: "Default ", content: "Example content.", minimalShape: "none",
21
+ menuButtons: <NodeTools>Pass your menu here.</NodeTools>
21
22
  },
22
23
  position: { x: 200, y: 50 },
23
24
  },
@@ -42,7 +43,8 @@ const nodeExamples = {
42
43
  id: 'linking-1',
43
44
  type: "sourcepath",
44
45
  data: {
45
- 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>
46
48
  },
47
49
  position: { x: 100, y: 50 },
48
50
  },
@@ -91,7 +93,8 @@ const nodeExamples = {
91
93
  id: 'workflow-1',
92
94
  type: "dataset",
93
95
  data: {
94
- label: "Dataset", content: "Example content.", minimalShape: "none"
96
+ label: "Dataset", content: "Example content.", minimalShape: "none",
97
+ menuButtons: <NodeTools>Pass your menu here.</NodeTools>
95
98
  },
96
99
  position: { x: 100, y: 50 },
97
100
  },
@@ -140,7 +143,8 @@ const nodeExamples = {
140
143
  id: 'graph-1',
141
144
  type: "default",
142
145
  data: {
143
- label: "Default ", content: "Example content.", minimalShape: "none"
146
+ label: "Default ", content: "Example content.", minimalShape: "none",
147
+ menuButtons: <NodeTools>Pass your menu here.</NodeTools>
144
148
  },
145
149
  position: { x: 100, y: 50 },
146
150
  },
@@ -264,12 +268,36 @@ const nodeExamples = {
264
268
  const ReactFlowExample: FC<ReactFlowProps> = (args) => {
265
269
  const [reactflowInstance, setReactflowInstance] = useState(null);
266
270
  const [elements, setElements] = useState([] as Elements);
267
- //const [edgeTools, setEdgeTools] = useState<JSX.Element>(<></>);
271
+ const [edgeTools, setEdgeTools] = useState<JSX.Element>(<></>);
268
272
 
269
273
  useEffect(() => {
270
274
  setElements(nodeExamples[args.configuration ?? "unspecified"] as Elements);
271
275
  }, [args]);
272
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
+
273
301
  const onLoad = useCallback(
274
302
  (rfi) => {
275
303
  if (!reactflowInstance) {
@@ -279,13 +307,18 @@ const ReactFlowExample: FC<ReactFlowProps> = (args) => {
279
307
  [reactflowInstance]
280
308
  );
281
309
 
282
- return <ReactFlow
283
- configuration={args.configuration}
284
- elements={elements}
285
- style={{ height: '400px' }}
286
- onLoad={onLoad}
287
- defaultZoom={1}
288
- />
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
+ </>
289
322
  }
290
323
 
291
324
  const Template: ComponentStory<typeof ReactFlow> = (args) => (
@@ -22,6 +22,7 @@ export interface ReactFlowProps extends ReactFlowOriginalProps {
22
22
  export const ReactFlow = React.forwardRef<HTMLDivElement, ReactFlowProps>((
23
23
  {
24
24
  configuration = "unspecified",
25
+ children,
25
26
  ...originalProps
26
27
  },
27
28
  ref) => {
@@ -41,6 +42,7 @@ export const ReactFlow = React.forwardRef<HTMLDivElement, ReactFlowProps>((
41
42
  edgeTypes={ configReactFlow[configuration].edgeTypes }
42
43
  {...originalProps}
43
44
  >
45
+ { children }
44
46
  <ReactFlowMarkers />
45
47
  </ReactFlowOriginal>
46
48
  );
@@ -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
@@ -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 };