@pega/cosmos-react-build 3.0.0-dev.3.0 → 3.0.0-dev.30.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 (274) hide show
  1. package/lib/components/AppHeader/AppHeader.d.ts +4 -2
  2. package/lib/components/AppHeader/AppHeader.d.ts.map +1 -1
  3. package/lib/components/AppHeader/AppHeader.js +12 -10
  4. package/lib/components/AppHeader/AppHeader.js.map +1 -1
  5. package/lib/components/AppHeader/AppHeader.styles.d.ts +1 -3
  6. package/lib/components/AppHeader/AppHeader.styles.d.ts.map +1 -1
  7. package/lib/components/AppHeader/AppHeader.styles.js +5 -22
  8. package/lib/components/AppHeader/AppHeader.styles.js.map +1 -1
  9. package/lib/components/AppHeader/BranchButton.d.ts.map +1 -1
  10. package/lib/components/AppHeader/BranchButton.js +22 -18
  11. package/lib/components/AppHeader/BranchButton.js.map +1 -1
  12. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppShell.js +21 -20
  14. package/lib/components/AppShell/AppShell.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  16. package/lib/components/AppShell/AppShell.styles.js +17 -2
  17. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  18. package/lib/components/AppShell/AppShell.types.d.ts +6 -9
  19. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  20. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  21. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +3 -0
  22. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
  23. package/lib/components/DynamicContentEditor/DynamicContentEditor.js +173 -42
  24. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  25. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts +6 -0
  26. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts.map +1 -1
  27. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.js.map +1 -1
  28. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts +307 -3
  29. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts.map +1 -1
  30. package/lib/components/DynamicContentEditor/PegaCustomElement.js +21 -21
  31. package/lib/components/DynamicContentEditor/PegaCustomElement.js.map +1 -1
  32. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +8 -0
  33. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -0
  34. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +124 -0
  35. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -0
  36. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +8 -0
  37. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -0
  38. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +517 -0
  39. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -0
  40. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +35 -0
  41. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -0
  42. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js +2 -0
  43. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -0
  44. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts +13 -0
  45. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -0
  46. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +46 -0
  47. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -0
  48. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +6 -0
  49. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -0
  50. package/lib/components/ExpressionBuilder/ExpressionBuilder.js +51 -0
  51. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -0
  52. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +14 -0
  53. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -0
  54. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js +81 -0
  55. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js.map +1 -0
  56. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +74 -0
  57. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -0
  58. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js +2 -0
  59. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -0
  60. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts +7 -0
  61. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts.map +1 -0
  62. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.js +6 -0
  63. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.js.map +1 -0
  64. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +6 -0
  65. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -0
  66. package/lib/components/ExpressionBuilder/ExpressionDetails.js +12 -0
  67. package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -0
  68. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts +6 -0
  69. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts.map +1 -0
  70. package/lib/components/ExpressionBuilder/ExpressionItem.js +43 -0
  71. package/lib/components/ExpressionBuilder/ExpressionItem.js.map +1 -0
  72. package/lib/components/ExpressionBuilder/ExpressionList.d.ts +6 -0
  73. package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -0
  74. package/lib/components/ExpressionBuilder/ExpressionList.js +32 -0
  75. package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -0
  76. package/lib/components/ExpressionBuilder/index.d.ts +8 -0
  77. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -0
  78. package/lib/components/ExpressionBuilder/index.js +6 -0
  79. package/lib/components/ExpressionBuilder/index.js.map +1 -0
  80. package/lib/components/FlowModeller/AddNode.d.ts +11 -9
  81. package/lib/components/FlowModeller/AddNode.d.ts.map +1 -1
  82. package/lib/components/FlowModeller/AddNode.js +9 -3
  83. package/lib/components/FlowModeller/AddNode.js.map +1 -1
  84. package/lib/components/FlowModeller/Connector.d.ts +7 -0
  85. package/lib/components/FlowModeller/Connector.d.ts.map +1 -0
  86. package/lib/components/FlowModeller/Connector.js +71 -0
  87. package/lib/components/FlowModeller/Connector.js.map +1 -0
  88. package/lib/components/FlowModeller/DeletePopover.d.ts +19 -0
  89. package/lib/components/FlowModeller/DeletePopover.d.ts.map +1 -0
  90. package/lib/components/FlowModeller/DeletePopover.js +136 -0
  91. package/lib/components/FlowModeller/DeletePopover.js.map +1 -0
  92. package/lib/components/FlowModeller/FlowModeller.d.ts +3 -19
  93. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -1
  94. package/lib/components/FlowModeller/FlowModeller.js +187 -63
  95. package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
  96. package/lib/components/FlowModeller/FlowModeller.types.d.ts +25 -0
  97. package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +1 -0
  98. package/lib/components/FlowModeller/FlowModeller.types.js +2 -0
  99. package/lib/components/FlowModeller/FlowModeller.types.js.map +1 -0
  100. package/lib/components/FlowModeller/FlowModellerContext.d.ts +6 -0
  101. package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +1 -0
  102. package/lib/components/FlowModeller/FlowModellerContext.js +7 -0
  103. package/lib/components/FlowModeller/FlowModellerContext.js.map +1 -0
  104. package/lib/components/FlowModeller/Node/Node.types.d.ts +22 -9
  105. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -1
  106. package/lib/components/FlowModeller/Node/Node.types.js +2 -3
  107. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -1
  108. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +6 -4
  109. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
  110. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +21 -11
  111. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
  112. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +1 -1
  113. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
  114. package/lib/components/FlowModeller/Node/NodeTemplates.js +43 -19
  115. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
  116. package/lib/components/FlowModeller/Node.d.ts +5 -0
  117. package/lib/components/FlowModeller/Node.d.ts.map +1 -0
  118. package/lib/components/FlowModeller/Node.js +22 -0
  119. package/lib/components/FlowModeller/Node.js.map +1 -0
  120. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +1 -1
  121. package/lib/components/FlowModeller/Renderer/Renderer.js +37 -6
  122. package/lib/components/FlowModeller/Renderer/Renderer.js.map +1 -1
  123. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +9 -9
  124. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +1 -1
  125. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +1 -1
  126. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +8 -3
  127. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +1 -1
  128. package/lib/components/FlowModeller/Renderer/Utils/Graph.js +7 -1
  129. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -1
  130. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +2 -1
  131. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +1 -1
  132. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +19 -6
  133. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +1 -1
  134. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +9 -6
  135. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +1 -1
  136. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +23 -3
  137. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +1 -1
  138. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +17 -0
  139. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +1 -0
  140. package/lib/components/FlowModeller/Utils/{AddNodeUtils.js → addNodeUtils.js} +58 -35
  141. package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +1 -0
  142. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +30 -0
  143. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +1 -0
  144. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +81 -0
  145. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +1 -0
  146. package/lib/components/FlowModeller/helper.d.ts +18 -8
  147. package/lib/components/FlowModeller/helper.d.ts.map +1 -1
  148. package/lib/components/FlowModeller/helper.js +114 -55
  149. package/lib/components/FlowModeller/helper.js.map +1 -1
  150. package/lib/components/FlowModeller/index.d.ts +8 -3
  151. package/lib/components/FlowModeller/index.d.ts.map +1 -1
  152. package/lib/components/FlowModeller/index.js +5 -1
  153. package/lib/components/FlowModeller/index.js.map +1 -1
  154. package/lib/components/ItemLibrary/ItemLibrary.d.ts +8 -6
  155. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  156. package/lib/components/ItemLibrary/ItemLibrary.js +6 -8
  157. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  158. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  159. package/lib/components/LifeCycle/Category.js +17 -13
  160. package/lib/components/LifeCycle/Category.js.map +1 -1
  161. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
  162. package/lib/components/LifeCycle/LifeCycle.js +2 -3
  163. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  164. package/lib/components/LifeCycle/LifeCycle.types.d.ts +2 -4
  165. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  166. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  167. package/lib/components/LifeCycle/LifeCycleList.d.ts +1 -1
  168. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  169. package/lib/components/LifeCycle/LifeCycleList.js +3 -2
  170. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  171. package/lib/components/LifeCycle/Stage.d.ts +1 -1
  172. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  173. package/lib/components/LifeCycle/Stage.js +8 -17
  174. package/lib/components/LifeCycle/Stage.js.map +1 -1
  175. package/lib/components/LifeCycle/Step.d.ts +5 -8
  176. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  177. package/lib/components/LifeCycle/Step.js +10 -32
  178. package/lib/components/LifeCycle/Step.js.map +1 -1
  179. package/lib/components/LifeCycle/Task.d.ts +5 -3
  180. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  181. package/lib/components/LifeCycle/Task.js +17 -10
  182. package/lib/components/LifeCycle/Task.js.map +1 -1
  183. package/lib/components/LifeCycle/index.d.ts +1 -2
  184. package/lib/components/LifeCycle/index.d.ts.map +1 -1
  185. package/lib/components/LifeCycle/index.js.map +1 -1
  186. package/lib/components/ObjectPreview/ObjectPreview.d.ts +16 -0
  187. package/lib/components/ObjectPreview/ObjectPreview.d.ts.map +1 -0
  188. package/lib/components/ObjectPreview/ObjectPreview.js +25 -0
  189. package/lib/components/ObjectPreview/ObjectPreview.js.map +1 -0
  190. package/lib/components/ObjectPreview/index.d.ts +3 -0
  191. package/lib/components/ObjectPreview/index.d.ts.map +1 -0
  192. package/lib/components/ObjectPreview/index.js +3 -0
  193. package/lib/components/ObjectPreview/index.js.map +1 -0
  194. package/lib/components/ObjectSelect/ObjectPicker.d.ts +15 -0
  195. package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -0
  196. package/lib/components/ObjectSelect/ObjectPicker.js +40 -0
  197. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -0
  198. package/lib/components/ObjectSelect/ObjectSelect.d.ts +32 -0
  199. package/lib/components/ObjectSelect/ObjectSelect.d.ts.map +1 -0
  200. package/lib/components/ObjectSelect/ObjectSelect.js +41 -0
  201. package/lib/components/ObjectSelect/ObjectSelect.js.map +1 -0
  202. package/lib/components/ObjectSelect/ObjectSummary.d.ts +24 -0
  203. package/lib/components/ObjectSelect/ObjectSummary.d.ts.map +1 -0
  204. package/lib/components/ObjectSelect/ObjectSummary.js +45 -0
  205. package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -0
  206. package/lib/components/ObjectSelect/index.d.ts +3 -0
  207. package/lib/components/ObjectSelect/index.d.ts.map +1 -0
  208. package/lib/components/ObjectSelect/index.js +2 -0
  209. package/lib/components/ObjectSelect/index.js.map +1 -0
  210. package/lib/components/ObjectSelect/useCreateModal.d.ts +34 -0
  211. package/lib/components/ObjectSelect/useCreateModal.d.ts.map +1 -0
  212. package/lib/components/ObjectSelect/useCreateModal.js +61 -0
  213. package/lib/components/ObjectSelect/useCreateModal.js.map +1 -0
  214. package/lib/components/PageTemplates/GalleryPage.js +4 -4
  215. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  216. package/lib/components/PageTemplates/PageTemplates.d.ts +3 -3
  217. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  218. package/lib/components/PageTemplates/PageTemplates.js +45 -37
  219. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  220. package/lib/components/SummaryCard/SummaryCard.d.ts +2 -3
  221. package/lib/components/SummaryCard/SummaryCard.d.ts.map +1 -1
  222. package/lib/components/SummaryCard/SummaryCard.js +3 -4
  223. package/lib/components/SummaryCard/SummaryCard.js.map +1 -1
  224. package/lib/components/Workbench/ConfigurationPanel.d.ts.map +1 -1
  225. package/lib/components/Workbench/ConfigurationPanel.js +4 -15
  226. package/lib/components/Workbench/ConfigurationPanel.js.map +1 -1
  227. package/lib/components/Workbench/Toolbar.d.ts +1 -5
  228. package/lib/components/Workbench/Toolbar.d.ts.map +1 -1
  229. package/lib/components/Workbench/Toolbar.js +8 -8
  230. package/lib/components/Workbench/Toolbar.js.map +1 -1
  231. package/lib/components/Workbench/UtilityPanel.js +1 -1
  232. package/lib/components/Workbench/UtilityPanel.js.map +1 -1
  233. package/lib/components/Workbench/Workbench.d.ts.map +1 -1
  234. package/lib/components/Workbench/Workbench.js +3 -4
  235. package/lib/components/Workbench/Workbench.js.map +1 -1
  236. package/lib/components/Workbench/Workbench.styles.d.ts +1 -1
  237. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
  238. package/lib/components/Workbench/Workbench.styles.js +15 -16
  239. package/lib/components/Workbench/Workbench.styles.js.map +1 -1
  240. package/lib/components/Workbench/Workbench.types.d.ts +2 -4
  241. package/lib/components/Workbench/Workbench.types.d.ts.map +1 -1
  242. package/lib/components/Workbench/Workbench.types.js.map +1 -1
  243. package/lib/index.d.ts +6 -1
  244. package/lib/index.d.ts.map +1 -1
  245. package/lib/index.js +6 -1
  246. package/lib/index.js.map +1 -1
  247. package/lib/utils/index.d.ts +2 -0
  248. package/lib/utils/index.d.ts.map +1 -0
  249. package/lib/utils/index.js +2 -0
  250. package/lib/utils/index.js.map +1 -0
  251. package/lib/utils/utils.d.ts +14 -0
  252. package/lib/utils/utils.d.ts.map +1 -0
  253. package/lib/utils/utils.js +13 -0
  254. package/lib/utils/utils.js.map +1 -0
  255. package/package.json +23 -14
  256. package/lib/components/FlowModeller/Renderer/Connectors.d.ts +0 -13
  257. package/lib/components/FlowModeller/Renderer/Connectors.d.ts.map +0 -1
  258. package/lib/components/FlowModeller/Renderer/Connectors.js +0 -47
  259. package/lib/components/FlowModeller/Renderer/Connectors.js.map +0 -1
  260. package/lib/components/FlowModeller/Renderer/Nodes.d.ts +0 -9
  261. package/lib/components/FlowModeller/Renderer/Nodes.d.ts.map +0 -1
  262. package/lib/components/FlowModeller/Renderer/Nodes.js +0 -25
  263. package/lib/components/FlowModeller/Renderer/Nodes.js.map +0 -1
  264. package/lib/components/FlowModeller/Utils/AddNodeUtils.d.ts +0 -16
  265. package/lib/components/FlowModeller/Utils/AddNodeUtils.d.ts.map +0 -1
  266. package/lib/components/FlowModeller/Utils/AddNodeUtils.js.map +0 -1
  267. package/lib/components/Visual/Visual.d.ts +0 -17
  268. package/lib/components/Visual/Visual.d.ts.map +0 -1
  269. package/lib/components/Visual/Visual.js +0 -28
  270. package/lib/components/Visual/Visual.js.map +0 -1
  271. package/lib/components/Visual/index.d.ts +0 -3
  272. package/lib/components/Visual/index.d.ts.map +0 -1
  273. package/lib/components/Visual/index.js +0 -3
  274. package/lib/components/Visual/index.js.map +0 -1
@@ -5,11 +5,13 @@ export declare const StyledLabel: import("styled-components").StyledComponent<im
5
5
  nodeType: NodeType;
6
6
  }, never>;
7
7
  export declare const StyledIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
- export declare const StyledCardHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
8
+ export declare const StyledNodeTemplateHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
9
9
  export declare const StyledText: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").TextProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
10
- export declare const StyledCard: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").CardProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
11
- export declare const StyledCardFooter: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").CardFooterProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
12
- export declare const StyledCardContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
+ export declare const StyledNodeTemplate: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").CardProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {
11
+ highlight: boolean;
12
+ }, never>;
13
+ export declare const StyledNodeTemplateFooter: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").CardFooterProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
14
+ export declare const StyledNodeTempleteContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
13
15
  export declare const StyledAdditionalData: import("styled-components").StyledComponent<"dl", import("styled-components").DefaultTheme, {}, never>;
14
16
  export declare const StyledAdditionalDataItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
15
17
  export declare const StyledTextWithEllipsis: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").TextProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"NodeTemplate.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplate.styles.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,eAAO,MAAM,YAAY,yGAYvB,CAAC;AAIH,eAAO,MAAM,WAAW;cAA4B,QAAQ;SAW1D,CAAC;AAIH,eAAO,MAAM,UAAU,yGAWrB,CAAC;AAIH,eAAO,MAAM,gBAAgB,4GAQ3B,CAAC;AAIH,eAAO,MAAM,UAAU,mOAOrB,CAAC;AAIH,eAAO,MAAM,UAAU,mOAoBrB,CAAC;AAEH,eAAO,MAAM,gBAAgB,yOAO3B,CAAC;AAIH,eAAO,MAAM,iBAAiB,yGAa5B,CAAC;AAIH,eAAO,MAAM,oBAAoB,wGAEhC,CAAC;AAEF,eAAO,MAAM,wBAAwB,yGAMnC,CAAC;AAGH,eAAO,MAAM,sBAAsB,mOAQjC,CAAC"}
1
+ {"version":3,"file":"NodeTemplate.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplate.styles.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,eAAO,MAAM,YAAY,yGAYvB,CAAC;AAIH,eAAO,MAAM,WAAW;cAA4B,QAAQ;SAW1D,CAAC;AAIH,eAAO,MAAM,UAAU,yGAWrB,CAAC;AAIH,eAAO,MAAM,wBAAwB,4GAQnC,CAAC;AAIH,eAAO,MAAM,UAAU,mOAOrB,CAAC;AAIH,eAAO,MAAM,kBAAkB;eAA6B,OAAO;SA6BjE,CAAC;AAIH,eAAO,MAAM,wBAAwB,yOAOnC,CAAC;AAIH,eAAO,MAAM,yBAAyB,yGAapC,CAAC;AAIH,eAAO,MAAM,oBAAoB,wGAEhC,CAAC;AAEF,eAAO,MAAM,wBAAwB,yGAMnC,CAAC;AAIH,eAAO,MAAM,sBAAsB,mOAQjC,CAAC"}
@@ -40,7 +40,7 @@ export const StyledIcon = styled.div(({ theme }) => {
40
40
  `;
41
41
  });
42
42
  StyledIcon.defaultProps = defaultThemeProp;
43
- export const StyledCardHeader = styled.header(({ theme }) => {
43
+ export const StyledNodeTemplateHeader = styled.header(({ theme }) => {
44
44
  return css `
45
45
  white-space: nowrap;
46
46
  button {
@@ -49,22 +49,31 @@ export const StyledCardHeader = styled.header(({ theme }) => {
49
49
  }
50
50
  `;
51
51
  });
52
- StyledCardHeader.defaultProps = defaultThemeProp;
52
+ StyledNodeTemplateHeader.defaultProps = defaultThemeProp;
53
53
  export const StyledText = styled(Text)(({ theme }) => {
54
54
  return css `
55
55
  padding-inline-end: ${theme.base.spacing};
56
56
  overflow: hidden;
57
- min-width: 12rem;
58
57
  text-overflow: ellipsis;
58
+ max-width: 24ch;
59
59
  `;
60
60
  });
61
61
  StyledText.defaultProps = defaultThemeProp;
62
- export const StyledCard = styled(Card)(({ theme }) => {
62
+ export const StyledNodeTemplate = styled(Card)(({ highlight, theme }) => {
63
63
  return css `
64
64
  width: 17.5rem;
65
65
  height: 7.5rem;
66
66
  align-self: center;
67
67
  overflow: hidden;
68
+ ${highlight &&
69
+ css `
70
+ &&& {
71
+ color: ${theme.base.colors.black};
72
+ background-color: ${theme.base.colors.red['extra-light']};
73
+ border-radius: 0.25rem;
74
+ box-shadow: 0 0 0 0.125rem ${theme.base.colors.red.medium};
75
+ }
76
+ `}
68
77
  &&& {
69
78
  border-radius: ${theme.base['border-radius']};
70
79
  }
@@ -72,7 +81,7 @@ export const StyledCard = styled(Card)(({ theme }) => {
72
81
  &:hover {
73
82
  box-shadow: ${theme.base.shadow.focus};
74
83
  cursor: pointer;
75
- ${StyledCardHeader} {
84
+ ${StyledNodeTemplateHeader} {
76
85
  button {
77
86
  visibility: visible;
78
87
  }
@@ -80,16 +89,17 @@ export const StyledCard = styled(Card)(({ theme }) => {
80
89
  }
81
90
  `;
82
91
  });
83
- export const StyledCardFooter = styled(CardFooter)(() => {
92
+ StyledNodeTemplate.defaultProps = defaultThemeProp;
93
+ export const StyledNodeTemplateFooter = styled(CardFooter)(({ theme }) => {
84
94
  return css `
85
95
  margin-top: auto;
86
- &:not(${StyledCard} ${StyledCard} > &) {
87
- padding: 0.5rem;
96
+ &:not(${StyledNodeTemplate} ${StyledNodeTemplate} > &) {
97
+ padding: ${theme.base.spacing};
88
98
  }
89
99
  `;
90
100
  });
91
- StyledCard.defaultProps = defaultThemeProp;
92
- export const StyledCardContent = styled.div(({ theme }) => {
101
+ StyledNodeTemplateFooter.defaultProps = defaultThemeProp;
102
+ export const StyledNodeTempleteContent = styled.div(({ theme }) => {
93
103
  return css `
94
104
  padding: ${theme.base.spacing};
95
105
  padding-block-start: 0;
@@ -103,7 +113,7 @@ export const StyledCardContent = styled.div(({ theme }) => {
103
113
  word-wrap: break-word;
104
114
  `;
105
115
  });
106
- StyledCardContent.defaultProps = defaultThemeProp;
116
+ StyledNodeTempleteContent.defaultProps = defaultThemeProp;
107
117
  export const StyledAdditionalData = styled.dl `
108
118
  overflow: hidden;
109
119
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"NodeTemplate.styles.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplate.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAInF,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;;;;;;;;oBAQQ,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;GAExC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAyB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;IACtF,OAAO,GAAG,CAAA;;MAEN,QAAQ,CAAC,IAAI,KAAK,OAAO;QACzB,CAAC,CAAC,GAAG,CAAA;+BACoB,KAAK,CAAC,IAAI,CAAC,OAAO;SACxC;QACH,CAAC,CAAC,GAAG,CAAA;iCACsB,KAAK,CAAC,IAAI,CAAC,OAAO;SAC1C;GACN,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjD,OAAO,GAAG,CAAA;;;0BAGc,KAAK,CAAC,IAAI,CAAC,OAAO;yBACnB,KAAK,CAAC,IAAI,CAAC,OAAO;;;;qBAItB,K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D,OAAO,GAAG,CAAA;eACG,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;;;;;GAU9B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAAA;;CAE5C,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC/D,OAAO,GAAG,CAAA;4BACgB,KAAK,CAAC,IAAI,CAAC,OAAO;wBACtB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC;qBAC7C,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;GAC7C,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,wBAAwB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE;IACtD,OAAO,GAAG,CAAA;;;;;;GAMT,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,sBAAsB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, Card, Text, CardFooter } from '@pega/cosmos-react-core';\n\nimport { NodeType } from './Node.types';\n\nexport const StyledCircle = styled.div(({ theme }) => {\n return css`\n height: 2rem;\n width: 2rem;\n background: var(--bg-color);\n border-radius: 50%;\n align-self: center;\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledCircle.defaultProps = defaultThemeProp;\n\nexport const StyledLabel = styled(Text)<{ nodeType: NodeType }>(({ nodeType, theme }) => {\n return css`\n align-self: center;\n ${nodeType.name === 'start'\n ? css`\n padding-block-end: ${theme.base.spacing};\n `\n : css`\n padding-block-start: ${theme.base.spacing};\n `}\n `;\n});\n\nStyledLabel.defaultProps = defaultThemeProp;\n\nexport const StyledIcon = styled.div(({ theme }) => {\n return css`\n min-height: 2rem;\n min-width: 2rem;\n padding: calc(0.5 * ${theme.base.spacing});\n margin-inline-end: ${theme.base.spacing};\n text-align: center;\n background-color: var(--bg-color);\n color: var(--fg-color);\n border-radius: ${theme.base['border-radius']};\n `;\n});\n\nStyledIcon.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled.header(({ theme }) => {\n return css`\n white-space: nowrap;\n button {\n visibility: hidden;\n border-radius: ${theme.base['border-radius']};\n }\n `;\n});\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledText = styled(Text)(({ theme }) => {\n return css`\n padding-inline-end: ${theme.base.spacing};\n overflow: hidden;\n min-width: 12rem;\n text-overflow: ellipsis;\n `;\n});\n\nStyledText.defaultProps = defaultThemeProp;\n\nexport const StyledCard = styled(Card)(({ theme }) => {\n return css`\n width: 17.5rem;\n height: 7.5rem;\n align-self: center;\n overflow: hidden;\n &&& {\n border-radius: ${theme.base['border-radius']};\n }\n &:focus-within,\n &:hover {\n box-shadow: ${theme.base.shadow.focus};\n cursor: pointer;\n ${StyledCardHeader} {\n button {\n visibility: visible;\n }\n }\n }\n `;\n});\n\nexport const StyledCardFooter = styled(CardFooter)(() => {\n return css`\n margin-top: auto;\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: 0.5rem;\n }\n `;\n});\n\nStyledCard.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled.div(({ theme }) => {\n return css`\n padding: ${theme.base.spacing};\n padding-block-start: 0;\n max-height: 2.5rem;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre-wrap;\n word-wrap: break-word;\n `;\n});\n\nStyledCardContent.defaultProps = defaultThemeProp;\n\nexport const StyledAdditionalData = styled.dl`\n overflow: hidden;\n`;\n\nexport const StyledAdditionalDataItem = styled.div(({ theme }) => {\n return css`\n padding: 0 calc(0.5 * ${theme.base.spacing});\n background-color: ${theme.base.palette['secondary-background']};\n border-radius: ${theme.base['border-radius']};\n `;\n});\nStyledAdditionalDataItem.defaultProps = defaultThemeProp;\n\nexport const StyledTextWithEllipsis = styled(Text)(() => {\n return css`\n overflow: hidden;\n width: auto;\n display: inline-block;\n white-space: nowrap;\n text-overflow: ellipsis;\n `;\n});\nStyledTextWithEllipsis.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"NodeTemplate.styles.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplate.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAInF,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;;;;;;;;oBAQQ,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;GAExC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAyB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;IACtF,OAAO,GAAG,CAAA;;MAEN,QAAQ,CAAC,IAAI,KAAK,OAAO;QACzB,CAAC,CAAC,GAAG,CAAA;+BACoB,KAAK,CAAC,IAAI,CAAC,OAAO;SACxC;QACH,CAAC,CAAC,GAAG,CAAA;iCACsB,KAAK,CAAC,IAAI,CAAC,OAAO;SAC1C;GACN,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,CAAC,MAAM,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AAC;AACJ,CAAC,CAAC,CAAC;AAEH,sBAAsB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, Card, Text, CardFooter } from '@pega/cosmos-react-core';\n\nimport { NodeType } from './Node.types';\n\nexport const StyledCircle = styled.div(({ theme }) => {\n return css`\n height: 2rem;\n width: 2rem;\n background: var(--bg-color);\n border-radius: 50%;\n align-self: center;\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledCircle.defaultProps = defaultThemeProp;\n\nexport const StyledLabel = styled(Text)<{ nodeType: NodeType }>(({ nodeType, theme }) => {\n return css`\n align-self: center;\n ${nodeType.name === 'start'\n ? css`\n padding-block-end: ${theme.base.spacing};\n `\n : css`\n padding-block-start: ${theme.base.spacing};\n `}\n `;\n});\n\nStyledLabel.defaultProps = defaultThemeProp;\n\nexport const StyledIcon = styled.div(({ theme }) => {\n return css`\n min-height: 2rem;\n min-width: 2rem;\n padding: calc(0.5 * ${theme.base.spacing});\n margin-inline-end: ${theme.base.spacing};\n text-align: center;\n background-color: var(--bg-color);\n color: var(--fg-color);\n border-radius: ${theme.base['border-radius']};\n `;\n});\n\nStyledIcon.defaultProps = defaultThemeProp;\n\nexport const StyledNodeTemplateHeader = styled.header(({ theme }) => {\n return css`\n white-space: nowrap;\n button {\n visibility: hidden;\n border-radius: ${theme.base['border-radius']};\n }\n `;\n});\n\nStyledNodeTemplateHeader.defaultProps = defaultThemeProp;\n\nexport const StyledText = styled(Text)(({ theme }) => {\n return css`\n padding-inline-end: ${theme.base.spacing};\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 24ch;\n `;\n});\n\nStyledText.defaultProps = defaultThemeProp;\n\nexport const StyledNodeTemplate = styled(Card)<{ highlight: boolean }>(({ highlight, theme }) => {\n return css`\n width: 17.5rem;\n height: 7.5rem;\n align-self: center;\n overflow: hidden;\n ${highlight &&\n css`\n &&& {\n color: ${theme.base.colors.black};\n background-color: ${theme.base.colors.red['extra-light']};\n border-radius: 0.25rem;\n box-shadow: 0 0 0 0.125rem ${theme.base.colors.red.medium};\n }\n `}\n &&& {\n border-radius: ${theme.base['border-radius']};\n }\n &:focus-within,\n &:hover {\n box-shadow: ${theme.base.shadow.focus};\n cursor: pointer;\n ${StyledNodeTemplateHeader} {\n button {\n visibility: visible;\n }\n }\n }\n `;\n});\n\nStyledNodeTemplate.defaultProps = defaultThemeProp;\n\nexport const StyledNodeTemplateFooter = styled(CardFooter)(({ theme }) => {\n return css`\n margin-top: auto;\n &:not(${StyledNodeTemplate} ${StyledNodeTemplate} > &) {\n padding: ${theme.base.spacing};\n }\n `;\n});\n\nStyledNodeTemplateFooter.defaultProps = defaultThemeProp;\n\nexport const StyledNodeTempleteContent = styled.div(({ theme }) => {\n return css`\n padding: ${theme.base.spacing};\n padding-block-start: 0;\n max-height: 2.5rem;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre-wrap;\n word-wrap: break-word;\n `;\n});\n\nStyledNodeTempleteContent.defaultProps = defaultThemeProp;\n\nexport const StyledAdditionalData = styled.dl`\n overflow: hidden;\n`;\n\nexport const StyledAdditionalDataItem = styled.div(({ theme }) => {\n return css`\n padding: 0 calc(0.5 * ${theme.base.spacing});\n background-color: ${theme.base.palette['secondary-background']};\n border-radius: ${theme.base['border-radius']};\n `;\n});\n\nStyledAdditionalDataItem.defaultProps = defaultThemeProp;\n\nexport const StyledTextWithEllipsis = styled(Text)(() => {\n return css`\n overflow: hidden;\n width: auto;\n display: inline-block;\n white-space: nowrap;\n text-overflow: ellipsis;\n `;\n});\n\nStyledTextWithEllipsis.defaultProps = defaultThemeProp;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { PropsWithoutRef } from 'react';
2
2
  import { NodeProps, NodeComponentProps } from './Node.types';
3
- export declare const DefaultNode: import("react").ForwardRefExoticComponent<Pick<NodeComponentProps, "description" | "data" | "label" | "id" | "type" | "onClick" | "actions" | "additionalData" | "onActionClick"> & import("react").RefAttributes<HTMLElement>>;
3
+ export declare const DefaultNode: ({ id, label, type, description, additionalData, actions, onActionClick, onClick, onDelete, reference, error, referencedNode, ...restProps }: NodeComponentProps) => JSX.Element;
4
4
  export declare const StartNode: ({ type, label }: PropsWithoutRef<NodeProps>) => JSX.Element;
5
5
  export declare const EndNode: ({ type, label }: PropsWithoutRef<NodeProps>) => JSX.Element;
6
6
  //# sourceMappingURL=NodeTemplates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeTemplates.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplates.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAOhB,MAAM,OAAO,CAAC;AA2Bf,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAA2B,MAAM,cAAc,CAAC;AA8DtF,eAAO,MAAM,WAAW,iOAuGvB,CAAC;AAEF,eAAO,MAAM,SAAS,oBAAqB,gBAAgB,SAAS,CAAC,gBAmBpE,CAAC;AAEF,eAAO,MAAM,OAAO,oBAAqB,gBAAgB,SAAS,CAAC,gBAmBlE,CAAC"}
1
+ {"version":3,"file":"NodeTemplates.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplates.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAQhB,MAAM,OAAO,CAAC;AA8Bf,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAA2B,MAAM,cAAc,CAAC;AA8DtF,eAAO,MAAM,WAAW,gJAcrB,kBAAkB,gBAsIpB,CAAC;AAEF,eAAO,MAAM,SAAS,oBAAqB,gBAAgB,SAAS,CAAC,gBAgBpE,CAAC;AAEF,eAAO,MAAM,OAAO,oBAAqB,gBAAgB,SAAS,CAAC,gBAgBlE,CAAC"}
@@ -1,11 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useCallback, forwardRef } from 'react';
2
+ import { useCallback, useEffect, useContext } from 'react';
3
3
  import { readableColor } from 'polished';
4
4
  import { MenuButton, Icon, Flex, Tooltip, useElement, useI18n, cap, Text } from '@pega/cosmos-react-core';
5
- import { StyledLabel, StyledCircle, StyledIcon, StyledCardHeader, StyledCardContent, StyledCard, StyledText, StyledTextWithEllipsis, StyledAdditionalData, StyledCardFooter, StyledAdditionalDataItem } from './NodeTemplate.styles';
5
+ import { colorMap } from '../../../utils';
6
+ import FlowModellerContext from '../FlowModellerContext';
7
+ import { StyledLabel, StyledCircle, StyledIcon, StyledNodeTemplateHeader, StyledNodeTempleteContent, StyledNodeTemplate, StyledText, StyledTextWithEllipsis, StyledAdditionalData, StyledNodeTemplateFooter, StyledAdditionalDataItem } from './NodeTemplate.styles';
6
8
  const MetaListItem = ({ label, value }) => {
7
9
  const [nodeAdditionalDataItem, setNodeAdditionalDataItem] = useElement();
8
- return (_jsxs(_Fragment, { children: [_jsxs(Flex, { as: StyledAdditionalDataItem, container: { wrap: 'nowrap', pad: 0.25, gap: 0.25 }, item: { grow: 1 }, ref: setNodeAdditionalDataItem, children: [_jsx(StyledTextWithEllipsis, { as: 'dd', children: label }, void 0), _jsx(Text, { role: 'separator', variant: 'secondary', "aria-hidden": 'true', children: ":\u00A0" }, void 0), _jsx(StyledTextWithEllipsis, { as: 'dt', children: value }, void 0)] }, void 0), _jsx(Tooltip, { target: nodeAdditionalDataItem, hideDelay: 'none', children: `${label}:${value}` }, void 0)] }, void 0));
10
+ return (_jsxs(_Fragment, { children: [_jsxs(Flex, { as: StyledAdditionalDataItem, container: { wrap: 'nowrap', pad: 0.25, gap: 0.25 }, item: { grow: 1 }, ref: setNodeAdditionalDataItem, children: [_jsx(StyledTextWithEllipsis, { as: 'dd', children: label }), _jsx(Text, { role: 'separator', variant: 'secondary', "aria-hidden": 'true', children: ":\u00A0" }), _jsx(StyledTextWithEllipsis, { as: 'dt', children: value })] }), _jsx(Tooltip, { target: nodeAdditionalDataItem, hideDelay: 'none', children: `${label}:${value}` })] }));
9
11
  };
10
12
  const MetaList = ({ metadata }) => {
11
13
  const [nodeAdditionalData, setNodeAdditionalData] = useElement();
@@ -21,9 +23,9 @@ const MetaList = ({ metadata }) => {
21
23
  return;
22
24
  }
23
25
  return _jsx(MetaListItem, { ...data }, data.id);
24
- }), metadata && metadata.length > 2 && (_jsxs(_Fragment, { children: [_jsx(Flex, { as: StyledAdditionalDataItem, container: { pad: 0.25 }, item: { grow: 1, shrink: 0 }, ref: setNodeAdditionalData, children: _jsx(StyledTextWithEllipsis, { as: 'dt', children: `+${metadata?.length - 2}` }, void 0) }, void 0), additionalDataValue && (_jsx(Tooltip, { target: nodeAdditionalData, hideDelay: 'none', children: additionalDataValue }, void 0))] }, void 0))] }, void 0));
26
+ }), metadata && metadata.length > 2 && (_jsxs(_Fragment, { children: [_jsx(Flex, { as: StyledAdditionalDataItem, container: { pad: 0.25 }, item: { grow: 1, shrink: 0 }, ref: setNodeAdditionalData, children: _jsx(StyledTextWithEllipsis, { as: 'dt', children: `+${metadata?.length - 2}` }) }), additionalDataValue && (_jsx(Tooltip, { target: nodeAdditionalData, hideDelay: 'none', children: additionalDataValue }))] }))] }));
25
27
  };
26
- export const DefaultNode = forwardRef(({ id, label, type, description, additionalData, actions, onActionClick, onClick, ...restProps }, ref) => {
28
+ export const DefaultNode = ({ id, label, type, description, additionalData, actions, onActionClick, onClick, onDelete, reference, error, referencedNode, ...restProps }) => {
27
29
  const t = useI18n();
28
30
  const actionItems = actions?.map(actionItem => {
29
31
  return {
@@ -35,30 +37,52 @@ export const DefaultNode = forwardRef(({ id, label, type, description, additiona
35
37
  }
36
38
  };
37
39
  });
40
+ const references = referencedNode && [
41
+ { id: referencedNode?.id, label: t('reference'), value: referencedNode?.label }
42
+ ];
43
+ if (onDelete !== undefined) {
44
+ actionItems?.push({
45
+ id: 'flowmodeller-delete-node',
46
+ primary: t('delete'),
47
+ onClick: (actionId, e) => {
48
+ e.stopPropagation();
49
+ onDelete?.({ actionId, nodeId: id }, e);
50
+ }
51
+ });
52
+ }
38
53
  const handleEnterKeyDown = useCallback((e) => {
39
54
  if (e.key === 'Enter' && !e.shiftKey) {
40
- onClick?.(id);
55
+ onClick?.(id, e);
41
56
  }
42
57
  }, [onClick]);
43
58
  const [nodeLabel, setNodeLabel] = useElement();
44
59
  const [nodeDescription, setNodeDescription] = useElement();
45
60
  const [nodeIcon, setNodeIcon] = useElement();
46
- const color = readableColor(type.color);
47
- return (_jsxs(StyledCard, { "aria-label": label, onClick: () => onClick?.(id), onKeyDown: handleEnterKeyDown, ref: ref, ...restProps, children: [_jsxs(Flex, { as: StyledCardHeader, container: { alignItems: 'center', pad: 1 }, children: [_jsx(StyledIcon, { id: id, style: {
48
- '--bg-color': type.color,
49
- '--fg-color': color
50
- }, ref: setNodeIcon, children: _jsx(Icon, { name: type.icon }, void 0) }, void 0), _jsx(Tooltip, { target: nodeIcon, hideDelay: 'none', children: cap(type.name) }, void 0), _jsx(StyledText, { variant: 'h4', ref: setNodeLabel, children: label }, void 0), _jsx(Tooltip, { describeTarget: false, target: nodeLabel, hideDelay: 'none', children: label }, void 0), actionItems && (_jsx(MenuButton, { portal: true, variant: 'simple', text: t('actions'), icon: 'more', iconOnly: true, onClick: (e) => e.stopPropagation(), onKeyDown: (e) => e.stopPropagation(), menu: {
61
+ const [nodeErrorToolTip, setNodeErrorToolTip] = useElement();
62
+ const color = readableColor(colorMap[type.color]);
63
+ const { readOnly, highlights } = useContext(FlowModellerContext);
64
+ useEffect(() => {
65
+ if (error) {
66
+ setNodeDescription(null);
67
+ setNodeLabel(null);
68
+ setNodeIcon(null);
69
+ }
70
+ }, [error]);
71
+ return (_jsxs(StyledNodeTemplate, { "aria-label": error || label, onClick: (e) => onClick?.(id, e), onKeyDown: handleEnterKeyDown, ref: setNodeErrorToolTip, highlight: error ? true : !!highlights?.nodes?.[id], error: error, id: `modeller-node-${id}`, ...restProps, children: [_jsxs(Flex, { as: StyledNodeTemplateHeader, container: { alignItems: 'center', pad: 1, justify: 'between' }, children: [_jsxs(Flex, { container: { alignItems: 'center' }, children: [_jsx(StyledIcon, { id: id, style: {
72
+ '--bg-color': colorMap[type.color],
73
+ '--fg-color': color
74
+ }, ref: setNodeIcon, children: _jsx(Icon, { name: type.icon }) }), _jsx(Tooltip, { target: nodeIcon, hideDelay: 'none', children: cap(type.name) }), _jsx(StyledText, { variant: 'h4', ref: setNodeLabel, children: label }), _jsx(Tooltip, { describeTarget: false, target: nodeLabel, hideDelay: 'none', children: label })] }), !readOnly && actionItems && (_jsx(MenuButton, { portal: true, variant: 'simple', text: t('actions'), icon: 'more', iconOnly: true, onClick: (e) => e.stopPropagation(), onKeyDown: (e) => e.stopPropagation(), menu: {
51
75
  items: actionItems
52
- } }, void 0))] }, void 0), description && (_jsxs(_Fragment, { children: [_jsx(StyledCardContent, { ref: setNodeDescription, children: description }, void 0), _jsx(Tooltip, { describeTarget: false, target: nodeDescription, hideDelay: 'none', children: description }, void 0)] }, void 0)), additionalData && (_jsx(StyledCardFooter, { children: _jsx(MetaList, { metadata: additionalData }, void 0) }, void 0))] }, void 0));
53
- });
76
+ } }))] }), description && (_jsxs(_Fragment, { children: [_jsx(StyledNodeTempleteContent, { ref: setNodeDescription, children: description }), _jsx(Tooltip, { describeTarget: false, target: nodeDescription, hideDelay: 'none', children: description })] })), additionalData && type.minConnectors > 0 && (_jsx(StyledNodeTemplateFooter, { children: _jsx(MetaList, { metadata: additionalData }) })), references && type.minConnectors < 1 && (_jsx(StyledNodeTemplateFooter, { children: _jsx(MetaList, { metadata: references }) })), error && (_jsx(Tooltip, { target: nodeErrorToolTip, hideDelay: 'none', children: error }))] }));
77
+ };
54
78
  export const StartNode = ({ type, label }) => {
55
- return (_jsxs(Flex, { container: { justify: 'center', direction: 'column' }, children: [_jsx(Flex, { as: StyledLabel, nodeType: type, children: label }, void 0), _jsx(Flex, { as: StyledCircle, style: {
56
- '--bg-color': type.color
57
- }, tabIndex: '0', "aria-label": label, role: 'button' }, void 0)] }, void 0));
79
+ return (_jsxs(Flex, { container: { justify: 'center', direction: 'column' }, children: [_jsx(StyledLabel, { nodeType: type, children: label }), _jsx(StyledCircle, { style: {
80
+ '--bg-color': colorMap[type.color]
81
+ }, tabIndex: 0, "aria-label": label, role: 'button' })] }));
58
82
  };
59
83
  export const EndNode = ({ type, label }) => {
60
- return (_jsxs(Flex, { container: { justify: 'center', direction: 'column' }, children: [_jsx(Flex, { as: StyledCircle, style: {
61
- '--bg-color': type.color
62
- }, tabIndex: '0', "aria-label": label, role: 'button' }, void 0), _jsx(Flex, { as: StyledLabel, nodeType: type, children: label }, void 0)] }, void 0));
84
+ return (_jsxs(Flex, { container: { justify: 'center', direction: 'column' }, children: [_jsx(StyledCircle, { style: {
85
+ '--bg-color': colorMap[type.color]
86
+ }, tabIndex: 0, "aria-label": label, role: 'button' }), _jsx(StyledLabel, { nodeType: type, children: label })] }));
63
87
  };
64
88
  //# sourceMappingURL=NodeTemplates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeTemplates.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplates.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,WAAW,EAGX,UAAU,EAEX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,GAAG,EACH,IAAI,EACL,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAG/B,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAA2B,EAAE,EAAE;IACjE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AAC,KAAK;iBACR,EAEpB,QAAQ,EAAC,GAAG,gBACA,KAAK,EACjB,IAAI,EAAC,QAAQ,WACb,YACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAA8B,EAAE,EAAE;IACrE,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,aACzD,KAAC,IAAI,IACH,EAAE,EAAE,YAAY,EAChB,KAAK,EACH;oBACE,YAAY,EAAE,IAAI,CAAC,KAAK;iBACR,EAEpB,QAAQ,EAAC,GAAG,gBACA,KAAK,EACjB,IAAI,EAAC,QAAQ,WACb,EACF,KAAC,IAAI,IAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,YAClC,KAAK,WACD,YACF,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n PropsWithoutRef,\n CSSProperties,\n useCallback,\n MouseEvent,\n KeyboardEvent,\n forwardRef,\n FC\n} from 'react';\nimport { readableColor } from 'polished';\n\nimport {\n MenuButton,\n Icon,\n Flex,\n Tooltip,\n useElement,\n useI18n,\n cap,\n Text\n} from '@pega/cosmos-react-core';\n\nimport {\n StyledLabel,\n StyledCircle,\n StyledIcon,\n StyledCardHeader,\n StyledCardContent,\n StyledCard,\n StyledText,\n StyledTextWithEllipsis,\n StyledAdditionalData,\n StyledCardFooter,\n StyledAdditionalDataItem\n} from './NodeTemplate.styles';\nimport { NodeProps, NodeComponentProps, AdditionalDataItemProps } from './Node.types';\n\nconst MetaListItem = ({ label, value }: AdditionalDataItemProps) => {\n const [nodeAdditionalDataItem, setNodeAdditionalDataItem] = useElement();\n return (\n <>\n <Flex\n as={StyledAdditionalDataItem}\n container={{ wrap: 'nowrap', pad: 0.25, gap: 0.25 }}\n item={{ grow: 1 }}\n ref={setNodeAdditionalDataItem}\n >\n <StyledTextWithEllipsis as='dd'>{label}</StyledTextWithEllipsis>\n <Text role='separator' variant='secondary' aria-hidden='true'>\n :&nbsp;\n </Text>\n <StyledTextWithEllipsis as='dt'>{value}</StyledTextWithEllipsis>\n </Flex>\n <Tooltip target={nodeAdditionalDataItem} hideDelay='none'>\n {`${label}:${value}`}\n </Tooltip>\n </>\n );\n};\n\nconst MetaList: FC<{ metadata: NodeProps['additionalData'] }> = ({ metadata }) => {\n const [nodeAdditionalData, setNodeAdditionalData] = useElement();\n let additionalDataValue = '';\n metadata?.forEach((item: AdditionalDataItemProps, index: number) => {\n if (index > 1) {\n additionalDataValue += `${item.label}: ${item.value}\n `;\n }\n });\n return (\n <Flex as={StyledAdditionalData} container={{ wrap: 'nowrap', colGap: 1, rowGap: 0.25 }}>\n {metadata?.map((data: AdditionalDataItemProps, index: number) => {\n if (index >= 2) {\n return;\n }\n return <MetaListItem key={data.id} {...data} />;\n })}\n {metadata && metadata.length > 2 && (\n <>\n <Flex\n as={StyledAdditionalDataItem}\n container={{ pad: 0.25 }}\n item={{ grow: 1, shrink: 0 }}\n ref={setNodeAdditionalData}\n >\n <StyledTextWithEllipsis as='dt'>{`+${metadata?.length - 2}`}</StyledTextWithEllipsis>\n </Flex>\n {additionalDataValue && (\n <Tooltip target={nodeAdditionalData} hideDelay='none'>\n {additionalDataValue}\n </Tooltip>\n )}\n </>\n )}\n </Flex>\n );\n};\nexport const DefaultNode = forwardRef(\n (\n {\n id,\n label,\n type,\n description,\n additionalData,\n actions,\n onActionClick,\n onClick,\n ...restProps\n }: PropsWithoutRef<NodeComponentProps>,\n ref: NodeComponentProps['ref']\n ) => {\n const t = useI18n();\n const actionItems = actions?.map(actionItem => {\n return {\n id: actionItem.id,\n primary: actionItem.text,\n onClick: (actionId: string, e: MouseEvent) => {\n e.stopPropagation();\n onActionClick?.({ actionId, nodeId: id }, e);\n }\n };\n });\n\n const handleEnterKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n onClick?.(id);\n }\n },\n [onClick]\n );\n\n const [nodeLabel, setNodeLabel] = useElement();\n const [nodeDescription, setNodeDescription] = useElement();\n\n const [nodeIcon, setNodeIcon] = useElement();\n const color = readableColor(type.color);\n return (\n <StyledCard\n aria-label={label}\n onClick={() => onClick?.(id)}\n onKeyDown={handleEnterKeyDown}\n ref={ref}\n {...restProps}\n >\n <Flex as={StyledCardHeader} container={{ alignItems: 'center', pad: 1 }}>\n <StyledIcon\n id={id}\n style={\n {\n '--bg-color': type.color,\n '--fg-color': color\n } as CSSProperties\n }\n ref={setNodeIcon}\n >\n <Icon name={type.icon} />\n </StyledIcon>\n <Tooltip target={nodeIcon} hideDelay='none'>\n {cap(type.name)}\n </Tooltip>\n <StyledText variant='h4' ref={setNodeLabel}>\n {label}\n </StyledText>\n <Tooltip describeTarget={false} target={nodeLabel} hideDelay='none'>\n {label}\n </Tooltip>\n\n {actionItems && (\n <MenuButton\n portal\n variant='simple'\n text={t('actions')}\n icon='more'\n iconOnly\n onClick={(e: MouseEvent) => e.stopPropagation()}\n onKeyDown={(e: KeyboardEvent) => e.stopPropagation()}\n menu={{\n items: actionItems\n }}\n />\n )}\n </Flex>\n {description && (\n <>\n <StyledCardContent ref={setNodeDescription}>{description}</StyledCardContent>\n <Tooltip describeTarget={false} target={nodeDescription} hideDelay='none'>\n {description}\n </Tooltip>\n </>\n )}\n {additionalData && (\n <StyledCardFooter>\n <MetaList metadata={additionalData} />\n </StyledCardFooter>\n )}\n </StyledCard>\n );\n }\n);\n\nexport const StartNode = ({ type, label }: PropsWithoutRef<NodeProps>) => {\n return (\n <Flex container={{ justify: 'center', direction: 'column' }}>\n <Flex as={StyledLabel} nodeType={type}>\n {label}\n </Flex>\n <Flex\n as={StyledCircle}\n style={\n {\n '--bg-color': type.color\n } as CSSProperties\n }\n tabIndex='0'\n aria-label={label}\n role='button'\n />\n </Flex>\n );\n};\n\nexport const EndNode = ({ type, label }: PropsWithoutRef<NodeProps>) => {\n return (\n <Flex container={{ justify: 'center', direction: 'column' }}>\n <Flex\n as={StyledCircle}\n style={\n {\n '--bg-color': type.color\n } as CSSProperties\n }\n tabIndex='0'\n aria-label={label}\n role='button'\n />\n <Flex as={StyledLabel} nodeType={type}>\n {label}\n </Flex>\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"NodeTemplates.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplates.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,WAAW,EAIX,SAAS,EACT,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,GAAG,EACH,IAAI,EACL,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAG/B,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAA2B,EAAE,EAAE;IACjE,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,UAAU,EAAE,CAAC;IACzE,OAAO,CACL,8BACE,MAAC,IAAI,IACH,EAAE,EAAE,wBAAwB,EAC5B,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EACnD,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EACjB,GAAG,EAAE,yBAAyB,aAE9B,KAAC,sBAAsB,IAAC,EAAE,EAAC,IAAI,YAAE,K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AC;iBAClB,EAEpB,QAAQ,EAAE,CAAC,gBACC,KAAK,EACjB,IAAI,EAAC,QAAQ,GACb,IACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAA8B,EAAE,EAAE;IACrE,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,aACzD,KAAC,YAAY,IACX,KAAK,EACH;oBACE,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;iBAClB,EAEpB,QAAQ,EAAE,CAAC,gBACC,KAAK,EACjB,IAAI,EAAC,QAAQ,GACb,EACF,KAAC,WAAW,IAAC,QAAQ,EAAE,IAAI,YAAG,KAAK,GAAe,IAC7C,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n PropsWithoutRef,\n CSSProperties,\n useCallback,\n MouseEvent,\n KeyboardEvent,\n FC,\n useEffect,\n useContext\n} from 'react';\nimport { readableColor } from 'polished';\n\nimport {\n MenuButton,\n Icon,\n Flex,\n Tooltip,\n useElement,\n useI18n,\n cap,\n Text\n} from '@pega/cosmos-react-core';\n\nimport { colorMap } from '../../../utils';\nimport FlowModellerContext from '../FlowModellerContext';\n\nimport {\n StyledLabel,\n StyledCircle,\n StyledIcon,\n StyledNodeTemplateHeader,\n StyledNodeTempleteContent,\n StyledNodeTemplate,\n StyledText,\n StyledTextWithEllipsis,\n StyledAdditionalData,\n StyledNodeTemplateFooter,\n StyledAdditionalDataItem\n} from './NodeTemplate.styles';\nimport { NodeProps, NodeComponentProps, AdditionalDataItemProps } from './Node.types';\n\nconst MetaListItem = ({ label, value }: AdditionalDataItemProps) => {\n const [nodeAdditionalDataItem, setNodeAdditionalDataItem] = useElement();\n return (\n <>\n <Flex\n as={StyledAdditionalDataItem}\n container={{ wrap: 'nowrap', pad: 0.25, gap: 0.25 }}\n item={{ grow: 1 }}\n ref={setNodeAdditionalDataItem}\n >\n <StyledTextWithEllipsis as='dd'>{label}</StyledTextWithEllipsis>\n <Text role='separator' variant='secondary' aria-hidden='true'>\n :&nbsp;\n </Text>\n <StyledTextWithEllipsis as='dt'>{value}</StyledTextWithEllipsis>\n </Flex>\n <Tooltip target={nodeAdditionalDataItem} hideDelay='none'>\n {`${label}:${value}`}\n </Tooltip>\n </>\n );\n};\n\nconst MetaList: FC<{ metadata: NodeProps['additionalData'] }> = ({ metadata }) => {\n const [nodeAdditionalData, setNodeAdditionalData] = useElement();\n let additionalDataValue = '';\n metadata?.forEach((item: AdditionalDataItemProps, index: number) => {\n if (index > 1) {\n additionalDataValue += `${item.label}: ${item.value}\n `;\n }\n });\n return (\n <Flex as={StyledAdditionalData} container={{ wrap: 'nowrap', colGap: 1, rowGap: 0.25 }}>\n {metadata?.map((data: AdditionalDataItemProps, index: number) => {\n if (index >= 2) {\n return;\n }\n return <MetaListItem key={data.id} {...data} />;\n })}\n {metadata && metadata.length > 2 && (\n <>\n <Flex\n as={StyledAdditionalDataItem}\n container={{ pad: 0.25 }}\n item={{ grow: 1, shrink: 0 }}\n ref={setNodeAdditionalData}\n >\n <StyledTextWithEllipsis as='dt'>{`+${metadata?.length - 2}`}</StyledTextWithEllipsis>\n </Flex>\n {additionalDataValue && (\n <Tooltip target={nodeAdditionalData} hideDelay='none'>\n {additionalDataValue}\n </Tooltip>\n )}\n </>\n )}\n </Flex>\n );\n};\nexport const DefaultNode = ({\n id,\n label,\n type,\n description,\n additionalData,\n actions,\n onActionClick,\n onClick,\n onDelete,\n reference,\n error,\n referencedNode,\n ...restProps\n}: NodeComponentProps) => {\n const t = useI18n();\n\n const actionItems = actions?.map(actionItem => {\n return {\n id: actionItem.id,\n primary: actionItem.text,\n onClick: (actionId: string, e: MouseEvent) => {\n e.stopPropagation();\n onActionClick?.({ actionId, nodeId: id }, e);\n }\n };\n });\n\n const references = referencedNode && [\n { id: referencedNode?.id, label: t('reference'), value: referencedNode?.label }\n ];\n\n if (onDelete !== undefined) {\n actionItems?.push({\n id: 'flowmodeller-delete-node',\n primary: t('delete'),\n onClick: (actionId: string, e: MouseEvent) => {\n e.stopPropagation();\n onDelete?.({ actionId, nodeId: id }, e);\n }\n });\n }\n\n const handleEnterKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n onClick?.(id, e);\n }\n },\n [onClick]\n );\n\n const [nodeLabel, setNodeLabel] = useElement();\n const [nodeDescription, setNodeDescription] = useElement();\n\n const [nodeIcon, setNodeIcon] = useElement();\n const [nodeErrorToolTip, setNodeErrorToolTip] = useElement();\n const color = readableColor(colorMap[type.color]);\n const { readOnly, highlights } = useContext(FlowModellerContext);\n\n useEffect(() => {\n if (error) {\n setNodeDescription(null);\n setNodeLabel(null);\n setNodeIcon(null);\n }\n }, [error]);\n\n return (\n <StyledNodeTemplate\n aria-label={error || label}\n onClick={(e: MouseEvent) => onClick?.(id, e)}\n onKeyDown={handleEnterKeyDown}\n ref={setNodeErrorToolTip}\n highlight={error ? true : !!highlights?.nodes?.[id]}\n error={error}\n id={`modeller-node-${id}`}\n {...restProps}\n >\n <Flex\n as={StyledNodeTemplateHeader}\n container={{ alignItems: 'center', pad: 1, justify: 'between' }}\n >\n <Flex container={{ alignItems: 'center' }}>\n <StyledIcon\n id={id}\n style={\n {\n '--bg-color': colorMap[type.color],\n '--fg-color': color\n } as CSSProperties\n }\n ref={setNodeIcon}\n >\n <Icon name={type.icon} />\n </StyledIcon>\n <Tooltip target={nodeIcon} hideDelay='none'>\n {cap(type.name)}\n </Tooltip>\n <StyledText variant='h4' ref={setNodeLabel}>\n {label}\n </StyledText>\n <Tooltip describeTarget={false} target={nodeLabel} hideDelay='none'>\n {label}\n </Tooltip>\n </Flex>\n {!readOnly && actionItems && (\n <MenuButton\n portal\n variant='simple'\n text={t('actions')}\n icon='more'\n iconOnly\n onClick={(e: MouseEvent) => e.stopPropagation()}\n onKeyDown={(e: KeyboardEvent) => e.stopPropagation()}\n menu={{\n items: actionItems\n }}\n />\n )}\n </Flex>\n {description && (\n <>\n <StyledNodeTempleteContent ref={setNodeDescription}>\n {description}\n </StyledNodeTempleteContent>\n <Tooltip describeTarget={false} target={nodeDescription} hideDelay='none'>\n {description}\n </Tooltip>\n </>\n )}\n {additionalData && type.minConnectors > 0 && (\n <StyledNodeTemplateFooter>\n <MetaList metadata={additionalData} />\n </StyledNodeTemplateFooter>\n )}\n {references && type.minConnectors < 1 && (\n <StyledNodeTemplateFooter>\n <MetaList metadata={references} />\n </StyledNodeTemplateFooter>\n )}\n {error && (\n <Tooltip target={nodeErrorToolTip} hideDelay='none'>\n {error}\n </Tooltip>\n )}\n </StyledNodeTemplate>\n );\n};\n\nexport const StartNode = ({ type, label }: PropsWithoutRef<NodeProps>) => {\n return (\n <Flex container={{ justify: 'center', direction: 'column' }}>\n <StyledLabel nodeType={type}>{label}</StyledLabel>\n <StyledCircle\n style={\n {\n '--bg-color': colorMap[type.color]\n } as CSSProperties\n }\n tabIndex={0}\n aria-label={label}\n role='button'\n />\n </Flex>\n );\n};\n\nexport const EndNode = ({ type, label }: PropsWithoutRef<NodeProps>) => {\n return (\n <Flex container={{ justify: 'center', direction: 'column' }}>\n <StyledCircle\n style={\n {\n '--bg-color': colorMap[type.color]\n } as CSSProperties\n }\n tabIndex={0}\n aria-label={label}\n role='button'\n />\n <StyledLabel nodeType={type}>{label}</StyledLabel>\n </Flex>\n );\n};\n"]}
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { Node as GraphNode } from './Renderer/Utils/Graph';
3
+ declare const Node: FC<GraphNode>;
4
+ export default Node;
5
+ //# sourceMappingURL=Node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../../src/components/FlowModeller/Node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAiC,MAAM,OAAO,CAAC;AAU1D,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE3D,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAiCtB,CAAC;AAEH,eAAe,IAAI,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { memo, useCallback } from 'react';
3
+ import { START_NODETYPE, STOP_NODETYPE } from './Node/Node.types';
4
+ import { DefaultNode, EndNode, StartNode } from './Node/NodeTemplates';
5
+ const Node = memo(props => {
6
+ const { id, type, label, data, ...restProps } = props;
7
+ const clickHandler = useCallback((nodeId, e) => {
8
+ data?.onClick?.(nodeId, e);
9
+ }, [data?.onClick]);
10
+ if (!type) {
11
+ return null;
12
+ }
13
+ if (type?.id === START_NODETYPE.id) {
14
+ return _jsx(StartNode, { id: id, type: type, label: label.toUpperCase() });
15
+ }
16
+ if (type?.id === STOP_NODETYPE.id) {
17
+ return _jsx(EndNode, { id: id, type: type, label: label.toUpperCase() });
18
+ }
19
+ return (_jsx(DefaultNode, { ...restProps, id: id, label: label, type: type, onClick: clickHandler, onDelete: data?.onDelete, onActionClick: data?.onActionClick, actions: data?.actions }));
20
+ });
21
+ export default Node;
22
+ //# sourceMappingURL=Node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../src/components/FlowModeller/Node.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,IAAI,EAAE,WAAW,EAAc,MAAM,OAAO,CAAC;AAE1D,OAAO,EAIL,cAAc,EACd,aAAa,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGvE,MAAM,IAAI,GAAkB,IAAI,CAAC,KAAK,CAAC,EAAE;IACvC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,GAC3C,KAAsD,CAAC;IAEzD,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,MAAc,EAAE,CAAa,EAAE,EAAE;QAChC,IAAI,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC,EACD,CAAC,IAAI,EAAE,OAAO,CAAC,CAChB,CAAC;IAEF,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,IAAI,CAAC;KACb;IAED,IAAI,IAAI,EAAE,EAAE,KAAK,cAAc,CAAC,EAAE,EAAE;QAClC,OAAO,KAAC,SAAS,IAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,GAAI,CAAC;KACtE;IACD,IAAI,IAAI,EAAE,EAAE,KAAK,aAAa,CAAC,EAAE,EAAE;QACjC,OAAO,KAAC,OAAO,IAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,GAAI,CAAC;KACpE;IACD,OAAO,CACL,KAAC,WAAW,OACN,SAAS,EACb,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,YAA6C,EACtD,QAAQ,EAAE,IAAI,EAAE,QAAQ,EACxB,aAAa,EAAE,IAAI,EAAE,aAAa,EAClC,OAAO,EAAE,IAAI,EAAE,OAAO,GACtB,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC","sourcesContent":["import { FC, memo, useCallback, MouseEvent } from 'react';\n\nimport {\n ModellerNodeComponentProps,\n NodeComponentData,\n NodeComponentProps,\n START_NODETYPE,\n STOP_NODETYPE\n} from './Node/Node.types';\nimport { DefaultNode, EndNode, StartNode } from './Node/NodeTemplates';\nimport { Node as GraphNode } from './Renderer/Utils/Graph';\n\nconst Node: FC<GraphNode> = memo(props => {\n const { id, type, label, data, ...restProps } =\n props as ModellerNodeComponentProps<NodeComponentData>;\n\n const clickHandler = useCallback(\n (nodeId: string, e: MouseEvent) => {\n data?.onClick?.(nodeId, e);\n },\n [data?.onClick]\n );\n\n if (!type) {\n return null;\n }\n\n if (type?.id === START_NODETYPE.id) {\n return <StartNode id={id} type={type} label={label.toUpperCase()} />;\n }\n if (type?.id === STOP_NODETYPE.id) {\n return <EndNode id={id} type={type} label={label.toUpperCase()} />;\n }\n return (\n <DefaultNode\n {...restProps}\n id={id}\n label={label}\n type={type}\n onClick={clickHandler as NodeComponentProps['onClick']}\n onDelete={data?.onDelete}\n onActionClick={data?.onActionClick}\n actions={data?.actions}\n />\n );\n});\n\nexport default Node;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Renderer.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAI3B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAUjD,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAU/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Renderer.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAwBjD,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA+C/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,17 +1,48 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import styled from 'styled-components';
3
- import Connectors from './Connectors';
4
- import Nodes from './Nodes';
2
+ import { createElement as _createElement } from "react";
3
+ import { useContext } from 'react';
4
+ import styled, { css } from 'styled-components';
5
+ import { Flex } from '@pega/cosmos-react-core';
6
+ import FlowModellerContext from '../FlowModellerContext';
5
7
  import GraphLayout from './Utils/GraphLayout';
8
+ import { DirectedGraph } from './Utils/Graph';
6
9
  const StyledWrapper = styled.div `
7
10
  position: relative;
8
11
  width: 100%;
9
12
  height: 100%;
10
13
  `;
11
- const Renderer = ({ graphData, connector, node }) => {
14
+ const StyledContentWrapper = styled.div `
15
+ position: absolute;
16
+ top: 0;
17
+ left: 0;
18
+ `;
19
+ const StyledNodeWrapper = styled(StyledContentWrapper)(() => {
20
+ return css `
21
+ width: var(--width);
22
+ height: var(--height);
23
+ transform: translate(var(--xPos), var(--yPos));
24
+ `;
25
+ });
26
+ const Renderer = ({ graphData, connector: Connector, node: Node }) => {
12
27
  // apply the plotted positions
13
- const graphDimensions = GraphLayout.plot(graphData);
14
- return (_jsxs(StyledWrapper, { children: [_jsx(Connectors, { items: graphData.connectors, content: connector, dimensions: graphDimensions }, void 0), _jsx(Nodes, { items: graphData.nodes, content: node }, void 0)] }, void 0));
28
+ const { readOnly } = useContext(FlowModellerContext);
29
+ const graph = new DirectedGraph(graphData);
30
+ const graphDimensions = GraphLayout.plot(graphData, readOnly);
31
+ return (_jsxs(StyledWrapper, { children: [_jsx(StyledContentWrapper, { children: _jsx("svg", { width: graphDimensions.width, height: graphDimensions.height, viewBox: `0 0 ${graphDimensions.width} ${graphDimensions.height}`, children: Connector &&
32
+ graphData.connectors.map(item => {
33
+ return _createElement(Connector, { ...item, key: item.id });
34
+ }) }) }), _jsx(StyledContentWrapper, { children: graphData.nodes.map(item => {
35
+ let referencedNode;
36
+ if (item.type?.minConnectors === 0 && item.reference) {
37
+ referencedNode = graph.getNode(item.reference);
38
+ }
39
+ return (_jsx(Flex, { as: StyledNodeWrapper, id: item.id, style: {
40
+ '--width': `${item.dimensions.width}px`,
41
+ '--height': `${item.dimensions.height}px`,
42
+ '--xPos': `${item.position.x}px`,
43
+ '--yPos': `${item.position.y}px`
44
+ }, container: { justify: 'center' }, children: Node && _jsx(Node, { ...item, referencedNode: referencedNode }) }, item.id));
45
+ }) })] }));
15
46
  };
16
47
  export default Renderer;
17
48
  //# sourceMappingURL=Renderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Renderer.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAI/B,CAAC;AAEF,MAAM,QAAQ,GAAsB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE;IACrE,8BAA8B;IAC9B,MAAM,eAAe,GAAG,WAAW,CAAC,IAAI,CAA6B,SAAS,CAAC,CAAC;IAEhF,OAAO,CACL,MAAC,aAAa,eACZ,KAAC,UAAU,IAAC,KAAK,EAAE,SAAS,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,WAAI,EAC5F,KAAC,KAAK,IAAC,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,WAAI,YAClC,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { FC } from 'react';\nimport styled from 'styled-components';\n\nimport Connectors from './Connectors';\nimport { RendererProps } from './Renderer.types';\nimport Nodes from './Nodes';\nimport GraphLayout from './Utils/GraphLayout';\n\nconst StyledWrapper = styled.div`\n position: relative;\n width: 100%;\n height: 100%;\n`;\n\nconst Renderer: FC<RendererProps> = ({ graphData, connector, node }) => {\n // apply the plotted positions\n const graphDimensions = GraphLayout.plot<RendererProps['graphData']>(graphData);\n\n return (\n <StyledWrapper>\n <Connectors items={graphData.connectors} content={connector} dimensions={graphDimensions} />\n <Nodes items={graphData.nodes} content={node} />\n </StyledWrapper>\n );\n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ACR,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;4BAC9B,OAAO,eAAC,SAAS,OAAK,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAI,CAAC;wBAC/C,CAAC,CAAC,GACA,GACe,EACvB,KAAC,oBAAoB,cAClB,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;oBAC1B,IAAI,cAAc,CAAC;oBACnB,IAAI,IAAI,CAAC,IAAI,EAAE,aAAa,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE;wBACpD,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;qBAChD;oBAED,OAAO,CACL,KAAC,IAAI,IAEH,EAAE,EAAE,iBAAiB,EACrB,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,KAAK,EAAE;4BACL,SAAS,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,IAAI;4BACvC,UAAU,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI;4BACzC,QAAQ,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI;4BAChC,QAAQ,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI;yBACjC,EACD,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,YAE/B,IAAI,IAAI,KAAC,IAAI,OAAK,IAAI,EAAE,cAAc,EAAE,cAAc,GAAI,IAXtD,IAAI,CAAC,EAAE,CAYP,CACR,CAAC;gBACJ,CAAC,CAAC,GACmB,IACT,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { FC, useContext } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Flex } from '@pega/cosmos-react-core';\n\nimport FlowModellerContext from '../FlowModellerContext';\n\nimport { RendererProps } from './Renderer.types';\nimport GraphLayout from './Utils/GraphLayout';\nimport { DirectedGraph } from './Utils/Graph';\n\nconst StyledWrapper = styled.div`\n position: relative;\n width: 100%;\n height: 100%;\n`;\n\nconst StyledContentWrapper = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n`;\n\nconst StyledNodeWrapper = styled(StyledContentWrapper)(() => {\n return css`\n width: var(--width);\n height: var(--height);\n transform: translate(var(--xPos), var(--yPos));\n `;\n});\n\nconst Renderer: FC<RendererProps> = ({ graphData, connector: Connector, node: Node }) => {\n // apply the plotted positions\n const { readOnly } = useContext(FlowModellerContext);\n const graph = new DirectedGraph(graphData);\n const graphDimensions = GraphLayout.plot<RendererProps['graphData']>(graphData, readOnly);\n\n return (\n <StyledWrapper>\n <StyledContentWrapper>\n <svg\n width={graphDimensions.width}\n height={graphDimensions.height}\n viewBox={`0 0 ${graphDimensions.width} ${graphDimensions.height}`}\n >\n {Connector &&\n graphData.connectors.map(item => {\n return <Connector {...item} key={item.id} />;\n })}\n </svg>\n </StyledContentWrapper>\n <StyledContentWrapper>\n {graphData.nodes.map(item => {\n let referencedNode;\n if (item.type?.minConnectors === 0 && item.reference) {\n referencedNode = graph.getNode(item.reference);\n }\n\n return (\n <Flex\n key={item.id}\n as={StyledNodeWrapper}\n id={item.id}\n style={{\n '--width': `${item.dimensions.width}px`,\n '--height': `${item.dimensions.height}px`,\n '--xPos': `${item.position.x}px`,\n '--yPos': `${item.position.y}px`\n }}\n container={{ justify: 'center' }}\n >\n {Node && <Node {...item} referencedNode={referencedNode} />}\n </Flex>\n );\n })}\n </StyledContentWrapper>\n </StyledWrapper>\n );\n};\n\nexport default Renderer;\n"]}
@@ -1,18 +1,18 @@
1
- import { ComponentType } from 'react';
2
- import { GraphData } from './Utils/Graph';
1
+ import { FC } from 'react';
2
+ import { ConnectorProps, Node, GraphData } from './Utils/Graph';
3
3
  import { PlottedGraphConnector, PlottedGraphNode } from './Utils/GraphLayout';
4
4
  export interface AddNodeHandlerParams {
5
5
  refType: 'node' | 'connector';
6
6
  refId: string | string[];
7
7
  }
8
- export interface RendererNodeProps extends PlottedGraphNode {
9
- }
10
- export interface RendererConnectorProps extends PlottedGraphConnector {
11
- }
12
8
  export interface RendererProps {
13
- graphData: GraphData<RendererNodeProps, RendererConnectorProps>;
9
+ graphData: GraphData<PlottedGraphNode, PlottedGraphConnector>;
14
10
  disableAutoLayout?: boolean;
15
- connector?: ComponentType<RendererConnectorProps>;
16
- node?: ComponentType<RendererNodeProps>;
11
+ highlights?: {
12
+ nodes: Record<string, Node>;
13
+ connectors: Record<string, ConnectorProps>;
14
+ };
15
+ connector?: FC<PlottedGraphConnector>;
16
+ node?: FC<PlottedGraphNode>;
17
17
  }
18
18
  //# sourceMappingURL=Renderer.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Renderer.types.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC;IAC9B,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;CAAG;AAE9D,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;CAAG;AAExE,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,SAAS,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC;IAChE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;IAClD,IAAI,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;CACzC"}
1
+ {"version":3,"file":"Renderer.types.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC;IAC9B,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,SAAS,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC;IAC9D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE;QACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC5B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;KAC5C,CAAC;IACF,SAAS,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC;IACtC,IAAI,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC;CAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Renderer.types.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ComponentType } from 'react';\n\nimport { GraphData } from './Utils/Graph';\nimport { PlottedGraphConnector, PlottedGraphNode } from './Utils/GraphLayout';\n\nexport interface AddNodeHandlerParams {\n refType: 'node' | 'connector';\n refId: string | string[];\n}\n\nexport interface RendererNodeProps extends PlottedGraphNode {}\n\nexport interface RendererConnectorProps extends PlottedGraphConnector {}\n\nexport interface RendererProps {\n graphData: GraphData<RendererNodeProps, RendererConnectorProps>;\n disableAutoLayout?: boolean;\n connector?: ComponentType<RendererConnectorProps>;\n node?: ComponentType<RendererNodeProps>;\n}\n"]}
1
+ {"version":3,"file":"Renderer.types.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.types.ts"],"names":[],"mappings":"","sourcesContent":["import { FC } from 'react';\n\nimport { ConnectorProps, Node, GraphData } from './Utils/Graph';\nimport { PlottedGraphConnector, PlottedGraphNode } from './Utils/GraphLayout';\n\nexport interface AddNodeHandlerParams {\n refType: 'node' | 'connector';\n refId: string | string[];\n}\n\nexport interface RendererProps {\n graphData: GraphData<PlottedGraphNode, PlottedGraphConnector>;\n disableAutoLayout?: boolean;\n highlights?: {\n nodes: Record<string, Node>;\n connectors: Record<string, ConnectorProps>;\n };\n connector?: FC<PlottedGraphConnector>;\n node?: FC<PlottedGraphNode>;\n}\n"]}
@@ -5,9 +5,14 @@ export interface ConnectorProps<T = unknown> {
5
5
  label?: string;
6
6
  data?: T;
7
7
  }
8
+ export interface NodeType {
9
+ minConnectors: number;
10
+ }
8
11
  export interface Node<T = unknown> {
12
+ type?: NodeType;
9
13
  id: string;
10
14
  data?: T;
15
+ reference?: string;
11
16
  }
12
17
  export interface GraphData<T extends Node = Node, U extends ConnectorProps = ConnectorProps> {
13
18
  nodes: T[];
@@ -47,8 +52,8 @@ export declare class DirectedGraph<T extends Node = Node, U extends ConnectorPro
47
52
  fromNodeId?: string;
48
53
  toNodeId?: string;
49
54
  }): DirectedGraph<T, U>;
50
- getInConnectors(toNodeId: string, fromNodeId?: string): ConnectorProps[];
51
- getOutConnectors(fromNodeId: string, toNodeId?: string): ConnectorProps[];
52
- getAllNodeConnectors(nodeId: string): ConnectorProps<unknown>[] | undefined;
55
+ getInConnectors(toNodeId: string, fromNodeId?: string): U[];
56
+ getOutConnectors(fromNodeId: string, toNodeId?: string): U[];
57
+ getAllNodeConnectors(nodeId: string): U[] | undefined;
53
58
  }
54
59
  //# sourceMappingURL=Graph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Graph.d.ts","sourceRoot":"","sources":["../../../../../src/components/FlowModeller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AC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE;IAkB5D,oBAAoB,CAAC,MAAM,EAAE,MAAM;CAOpC"}
@@ -64,7 +64,13 @@ export class DirectedGraph {
64
64
  // Not necessary to clone, as this class never modifies any nodes
65
65
  graphData.nodes.forEach(item => this.addNode(item));
66
66
  // copy/clone, connectors properties 'fromNodeId' and 'toNodeId' values may get modified by this class
67
- graphData.connectors.forEach(item => this.addConnector(JSON.parse(JSON.stringify(item))));
67
+ graphData.connectors.forEach(item => {
68
+ const data = item.data;
69
+ const newItem = JSON.parse(JSON.stringify(item));
70
+ // below statement is necessary to retain the actual references of any function/instances if any
71
+ newItem.data = data;
72
+ this.addConnector(newItem);
73
+ });
68
74
  }
69
75
  getGraphData() {
70
76
  return {