@pega/cosmos-react-build 3.0.0-dev.1.0 → 3.0.0-dev.10.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 (219) 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 +9 -8
  4. package/lib/components/AppHeader/AppHeader.js.map +1 -1
  5. package/lib/components/AppHeader/AppHeader.styles.d.ts +1 -1
  6. package/lib/components/AppHeader/AppHeader.styles.d.ts.map +1 -1
  7. package/lib/components/AppHeader/AppHeader.styles.js +3 -18
  8. package/lib/components/AppHeader/AppHeader.styles.js.map +1 -1
  9. package/lib/components/AppHeader/BranchButton.js +1 -1
  10. package/lib/components/AppHeader/BranchButton.js.map +1 -1
  11. package/lib/components/AppShell/AppShell.d.ts +1 -0
  12. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppShell.js +15 -20
  14. package/lib/components/AppShell/AppShell.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.styles.d.ts +1 -0
  16. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  17. package/lib/components/AppShell/AppShell.styles.js +17 -2
  18. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  19. package/lib/components/AppShell/AppShell.types.d.ts +6 -9
  20. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  21. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  22. package/lib/components/AppShell/AppShellContext.d.ts +1 -0
  23. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  24. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +9 -0
  25. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -0
  26. package/lib/components/DynamicContentEditor/DynamicContentEditor.js +235 -0
  27. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -0
  28. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts +23 -0
  29. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts.map +1 -0
  30. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.js +2 -0
  31. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.js.map +1 -0
  32. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts +308 -0
  33. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts.map +1 -0
  34. package/lib/components/DynamicContentEditor/PegaCustomElement.js +23 -0
  35. package/lib/components/DynamicContentEditor/PegaCustomElement.js.map +1 -0
  36. package/lib/components/DynamicContentEditor/index.d.ts +3 -0
  37. package/lib/components/DynamicContentEditor/index.d.ts.map +1 -0
  38. package/lib/components/DynamicContentEditor/index.js +2 -0
  39. package/lib/components/DynamicContentEditor/index.js.map +1 -0
  40. package/lib/components/FlowModeller/AddNode.d.ts +9 -7
  41. package/lib/components/FlowModeller/AddNode.d.ts.map +1 -1
  42. package/lib/components/FlowModeller/AddNode.js +9 -3
  43. package/lib/components/FlowModeller/AddNode.js.map +1 -1
  44. package/lib/components/FlowModeller/Connector.d.ts +7 -0
  45. package/lib/components/FlowModeller/Connector.d.ts.map +1 -0
  46. package/lib/components/FlowModeller/Connector.js +34 -0
  47. package/lib/components/FlowModeller/Connector.js.map +1 -0
  48. package/lib/components/FlowModeller/DeletePopover.d.ts +19 -0
  49. package/lib/components/FlowModeller/DeletePopover.d.ts.map +1 -0
  50. package/lib/components/FlowModeller/DeletePopover.js +105 -0
  51. package/lib/components/FlowModeller/DeletePopover.js.map +1 -0
  52. package/lib/components/FlowModeller/FlowModeller.d.ts +6 -2
  53. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -1
  54. package/lib/components/FlowModeller/FlowModeller.js +108 -57
  55. package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
  56. package/lib/components/FlowModeller/Node/Node.types.d.ts +14 -9
  57. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -1
  58. package/lib/components/FlowModeller/Node/Node.types.js +2 -3
  59. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -1
  60. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +7 -4
  61. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
  62. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +21 -11
  63. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
  64. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +1 -1
  65. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
  66. package/lib/components/FlowModeller/Node/NodeTemplates.js +37 -18
  67. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
  68. package/lib/components/FlowModeller/Node.d.ts +5 -0
  69. package/lib/components/FlowModeller/Node.d.ts.map +1 -0
  70. package/lib/components/FlowModeller/Node.js +22 -0
  71. package/lib/components/FlowModeller/Node.js.map +1 -0
  72. package/lib/components/FlowModeller/Renderer/Connectors.d.ts +2 -0
  73. package/lib/components/FlowModeller/Renderer/Connectors.d.ts.map +1 -1
  74. package/lib/components/FlowModeller/Renderer/Connectors.js +5 -3
  75. package/lib/components/FlowModeller/Renderer/Connectors.js.map +1 -1
  76. package/lib/components/FlowModeller/Renderer/Nodes.d.ts +2 -0
  77. package/lib/components/FlowModeller/Renderer/Nodes.d.ts.map +1 -1
  78. package/lib/components/FlowModeller/Renderer/Nodes.js +3 -3
  79. package/lib/components/FlowModeller/Renderer/Nodes.js.map +1 -1
  80. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +1 -1
  81. package/lib/components/FlowModeller/Renderer/Renderer.js +2 -2
  82. package/lib/components/FlowModeller/Renderer/Renderer.js.map +1 -1
  83. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +10 -4
  84. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +1 -1
  85. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +1 -1
  86. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +3 -3
  87. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +1 -1
  88. package/lib/components/FlowModeller/Renderer/Utils/Graph.js +7 -1
  89. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -1
  90. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +8 -4
  91. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +1 -1
  92. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +23 -3
  93. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +1 -1
  94. package/lib/components/FlowModeller/Utils/{AddNodeUtils.d.ts → addNodeUtils.d.ts} +1 -1
  95. package/lib/components/FlowModeller/Utils/{AddNodeUtils.d.ts.map → addNodeUtils.d.ts.map} +1 -1
  96. package/lib/components/FlowModeller/Utils/{AddNodeUtils.js → addNodeUtils.js} +1 -1
  97. package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +1 -0
  98. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +29 -0
  99. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +1 -0
  100. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +71 -0
  101. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +1 -0
  102. package/lib/components/FlowModeller/helper.d.ts +4 -7
  103. package/lib/components/FlowModeller/helper.d.ts.map +1 -1
  104. package/lib/components/FlowModeller/helper.js +67 -43
  105. package/lib/components/FlowModeller/helper.js.map +1 -1
  106. package/lib/components/FlowModeller/index.d.ts +5 -1
  107. package/lib/components/FlowModeller/index.d.ts.map +1 -1
  108. package/lib/components/FlowModeller/index.js +5 -1
  109. package/lib/components/FlowModeller/index.js.map +1 -1
  110. package/lib/components/ItemLibrary/ItemLibrary.d.ts +8 -6
  111. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  112. package/lib/components/ItemLibrary/ItemLibrary.js +6 -5
  113. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  114. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  115. package/lib/components/LifeCycle/Category.js +11 -8
  116. package/lib/components/LifeCycle/Category.js.map +1 -1
  117. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
  118. package/lib/components/LifeCycle/LifeCycle.js +2 -3
  119. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  120. package/lib/components/LifeCycle/LifeCycle.types.d.ts +2 -4
  121. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  122. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  123. package/lib/components/LifeCycle/LifeCycleList.d.ts +1 -1
  124. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  125. package/lib/components/LifeCycle/LifeCycleList.js +3 -2
  126. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  127. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  128. package/lib/components/LifeCycle/Stage.js +8 -17
  129. package/lib/components/LifeCycle/Stage.js.map +1 -1
  130. package/lib/components/LifeCycle/Step.d.ts +3 -6
  131. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  132. package/lib/components/LifeCycle/Step.js +20 -42
  133. package/lib/components/LifeCycle/Step.js.map +1 -1
  134. package/lib/components/LifeCycle/Task.d.ts +4 -1
  135. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  136. package/lib/components/LifeCycle/Task.js +17 -10
  137. package/lib/components/LifeCycle/Task.js.map +1 -1
  138. package/lib/components/LifeCycle/index.d.ts +1 -2
  139. package/lib/components/LifeCycle/index.d.ts.map +1 -1
  140. package/lib/components/LifeCycle/index.js.map +1 -1
  141. package/lib/components/ObjectPreview/ObjectPreview.d.ts +16 -0
  142. package/lib/components/ObjectPreview/ObjectPreview.d.ts.map +1 -0
  143. package/lib/components/ObjectPreview/ObjectPreview.js +25 -0
  144. package/lib/components/ObjectPreview/ObjectPreview.js.map +1 -0
  145. package/lib/components/ObjectPreview/index.d.ts +3 -0
  146. package/lib/components/ObjectPreview/index.d.ts.map +1 -0
  147. package/lib/components/ObjectPreview/index.js +3 -0
  148. package/lib/components/ObjectPreview/index.js.map +1 -0
  149. package/lib/components/ObjectSelect/ObjectConfig.d.ts +18 -0
  150. package/lib/components/ObjectSelect/ObjectConfig.d.ts.map +1 -0
  151. package/lib/components/ObjectSelect/ObjectConfig.js +14 -0
  152. package/lib/components/ObjectSelect/ObjectConfig.js.map +1 -0
  153. package/lib/components/ObjectSelect/ObjectPicker.d.ts +11 -0
  154. package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -0
  155. package/lib/components/ObjectSelect/ObjectPicker.js +26 -0
  156. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -0
  157. package/lib/components/ObjectSelect/ObjectSelect.d.ts +27 -0
  158. package/lib/components/ObjectSelect/ObjectSelect.d.ts.map +1 -0
  159. package/lib/components/ObjectSelect/ObjectSelect.js +25 -0
  160. package/lib/components/ObjectSelect/ObjectSelect.js.map +1 -0
  161. package/lib/components/ObjectSelect/ObjectSummary.d.ts +22 -0
  162. package/lib/components/ObjectSelect/ObjectSummary.d.ts.map +1 -0
  163. package/lib/components/ObjectSelect/ObjectSummary.js +50 -0
  164. package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -0
  165. package/lib/components/ObjectSelect/index.d.ts +3 -0
  166. package/lib/components/ObjectSelect/index.d.ts.map +1 -0
  167. package/lib/components/ObjectSelect/index.js +2 -0
  168. package/lib/components/ObjectSelect/index.js.map +1 -0
  169. package/lib/components/PageTemplates/GalleryPage.js +4 -4
  170. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  171. package/lib/components/PageTemplates/PageTemplates.d.ts +3 -3
  172. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  173. package/lib/components/PageTemplates/PageTemplates.js +29 -47
  174. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  175. package/lib/components/SummaryCard/SummaryCard.d.ts +2 -3
  176. package/lib/components/SummaryCard/SummaryCard.d.ts.map +1 -1
  177. package/lib/components/SummaryCard/SummaryCard.js +3 -4
  178. package/lib/components/SummaryCard/SummaryCard.js.map +1 -1
  179. package/lib/components/Workbench/ConfigurationPanel.d.ts.map +1 -1
  180. package/lib/components/Workbench/ConfigurationPanel.js +3 -4
  181. package/lib/components/Workbench/ConfigurationPanel.js.map +1 -1
  182. package/lib/components/Workbench/Toolbar.d.ts +1 -5
  183. package/lib/components/Workbench/Toolbar.d.ts.map +1 -1
  184. package/lib/components/Workbench/Toolbar.js +8 -8
  185. package/lib/components/Workbench/Toolbar.js.map +1 -1
  186. package/lib/components/Workbench/UtilityPanel.js +1 -1
  187. package/lib/components/Workbench/UtilityPanel.js.map +1 -1
  188. package/lib/components/Workbench/Workbench.d.ts.map +1 -1
  189. package/lib/components/Workbench/Workbench.js +2 -3
  190. package/lib/components/Workbench/Workbench.js.map +1 -1
  191. package/lib/components/Workbench/Workbench.styles.d.ts +2 -3
  192. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
  193. package/lib/components/Workbench/Workbench.styles.js +23 -23
  194. package/lib/components/Workbench/Workbench.styles.js.map +1 -1
  195. package/lib/components/Workbench/Workbench.types.d.ts +0 -2
  196. package/lib/components/Workbench/Workbench.types.d.ts.map +1 -1
  197. package/lib/components/Workbench/Workbench.types.js.map +1 -1
  198. package/lib/index.d.ts +6 -1
  199. package/lib/index.d.ts.map +1 -1
  200. package/lib/index.js +6 -1
  201. package/lib/index.js.map +1 -1
  202. package/lib/utils/index.d.ts +2 -0
  203. package/lib/utils/index.d.ts.map +1 -0
  204. package/lib/utils/index.js +2 -0
  205. package/lib/utils/index.js.map +1 -0
  206. package/lib/utils/utils.d.ts +14 -0
  207. package/lib/utils/utils.d.ts.map +1 -0
  208. package/lib/utils/utils.js +13 -0
  209. package/lib/utils/utils.js.map +1 -0
  210. package/package.json +19 -14
  211. package/lib/components/FlowModeller/Utils/AddNodeUtils.js.map +0 -1
  212. package/lib/components/Visual/Visual.d.ts +0 -17
  213. package/lib/components/Visual/Visual.d.ts.map +0 -1
  214. package/lib/components/Visual/Visual.js +0 -28
  215. package/lib/components/Visual/Visual.js.map +0 -1
  216. package/lib/components/Visual/index.d.ts +0 -3
  217. package/lib/components/Visual/index.d.ts.map +0 -1
  218. package/lib/components/Visual/index.js +0 -3
  219. package/lib/components/Visual/index.js.map +0 -1
@@ -1,14 +1,17 @@
1
+ /// <reference types="react" />
1
2
  import { NodeType } from './Node.types';
2
3
  export declare const StyledCircle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
4
  export declare const StyledLabel: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").TextProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {
4
5
  nodeType: NodeType;
5
6
  }, never>;
6
7
  export declare const StyledIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
- 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>;
8
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>;
9
- 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>;
10
- 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>;
11
- 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>;
12
15
  export declare const StyledAdditionalData: import("styled-components").StyledComponent<"dl", import("styled-components").DefaultTheme, {}, never>;
13
16
  export declare const StyledAdditionalDataItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
14
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,KAAK,CAAC,IAAI,CAAC,e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,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,UAAU,GAAG,MAAM,CAAC,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AAC;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, highlight, error, ...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,EAOhB,MAAM,OAAO,CAAC;AA6Bf,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAA2B,MAAM,cAAc,CAAC;AA8DtF,eAAO,MAAM,WAAW,gIAarB,kBAAkB,gBA6HpB,CAAC;AAEF,eAAO,MAAM,SAAS,oBAAqB,gBAAgB,SAAS,CAAC,gBAmBpE,CAAC;AAEF,eAAO,MAAM,OAAO,oBAAqB,gBAAgB,SAAS,CAAC,gBAmBlE,CAAC"}
@@ -1,11 +1,12 @@
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 } 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 { StyledLabel, StyledCircle, StyledIcon, StyledNodeTemplateHeader, StyledNodeTempleteContent, StyledNodeTemplate, StyledText, StyledTextWithEllipsis, StyledAdditionalData, StyledNodeTemplateFooter, StyledAdditionalDataItem } from './NodeTemplate.styles';
6
7
  const MetaListItem = ({ label, value }) => {
7
8
  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));
9
+ 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
10
  };
10
11
  const MetaList = ({ metadata }) => {
11
12
  const [nodeAdditionalData, setNodeAdditionalData] = useElement();
@@ -21,9 +22,9 @@ const MetaList = ({ metadata }) => {
21
22
  return;
22
23
  }
23
24
  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));
25
+ }), 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
26
  };
26
- export const DefaultNode = forwardRef(({ id, label, type, description, additionalData, actions, onActionClick, onClick, ...restProps }, ref) => {
27
+ export const DefaultNode = ({ id, label, type, description, additionalData, actions, onActionClick, onClick, onDelete, highlight, error, ...restProps }) => {
27
28
  const t = useI18n();
28
29
  const actionItems = actions?.map(actionItem => {
29
30
  return {
@@ -35,30 +36,48 @@ export const DefaultNode = forwardRef(({ id, label, type, description, additiona
35
36
  }
36
37
  };
37
38
  });
39
+ if (onDelete !== undefined) {
40
+ actionItems?.push({
41
+ id: 'flowmodeller-delete-node',
42
+ primary: t('delete'),
43
+ onClick: (actionId, e) => {
44
+ e.stopPropagation();
45
+ onDelete?.({ actionId, nodeId: id }, e);
46
+ }
47
+ });
48
+ }
38
49
  const handleEnterKeyDown = useCallback((e) => {
39
50
  if (e.key === 'Enter' && !e.shiftKey) {
40
- onClick?.(id);
51
+ onClick?.(id, e);
41
52
  }
42
53
  }, [onClick]);
43
54
  const [nodeLabel, setNodeLabel] = useElement();
44
55
  const [nodeDescription, setNodeDescription] = useElement();
45
56
  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: {
57
+ const [nodeErrorToolTip, setNodeErrorToolTip] = useElement();
58
+ const color = readableColor(colorMap[type.color]);
59
+ useEffect(() => {
60
+ if (error) {
61
+ setNodeDescription(null);
62
+ setNodeLabel(null);
63
+ setNodeIcon(null);
64
+ }
65
+ }, [error]);
66
+ return (_jsxs(StyledNodeTemplate, { "aria-label": error || label, onClick: (e) => onClick?.(id, e), onKeyDown: handleEnterKeyDown, ref: setNodeErrorToolTip, highlight: error ? true : highlight, 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: {
67
+ '--bg-color': colorMap[type.color],
68
+ '--fg-color': color
69
+ }, 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 })] }), actionItems && (_jsx(MenuButton, { portal: true, variant: 'simple', text: t('actions'), icon: 'more', iconOnly: true, onClick: (e) => e.stopPropagation(), onKeyDown: (e) => e.stopPropagation(), menu: {
51
70
  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
- });
71
+ } }))] }), description && (_jsxs(_Fragment, { children: [_jsx(StyledNodeTempleteContent, { ref: setNodeDescription, children: description }), _jsx(Tooltip, { describeTarget: false, target: nodeDescription, hideDelay: 'none', children: description })] })), additionalData && (_jsx(StyledNodeTemplateFooter, { children: _jsx(MetaList, { metadata: additionalData }) })), error && (_jsx(Tooltip, { target: nodeErrorToolTip, hideDelay: 'none', children: error }))] }));
72
+ };
54
73
  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));
74
+ return (_jsxs(Flex, { container: { justify: 'center', direction: 'column' }, children: [_jsx(Flex, { as: StyledLabel, nodeType: type, children: label }), _jsx(Flex, { as: StyledCircle, style: {
75
+ '--bg-color': colorMap[type.color]
76
+ }, tabIndex: '0', "aria-label": label, role: 'button' })] }));
58
77
  };
59
78
  export const EndNode = ({ type, label }) => {
60
79
  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));
80
+ '--bg-color': colorMap[type.color]
81
+ }, tabIndex: '0', "aria-label": label, role: 'button' }), _jsx(Flex, { as: StyledLabel, nodeType: type, children: label })] }));
63
82
  };
64
83
  //# 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,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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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,EACV,MAAM,OA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,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAA8B,EAAE,EAAE;IACvE,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,aACzD,KAAC,IAAI,IAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,YAClC,KAAK,GACD,EACP,KAAC,IAAI,IACH,EAAE,EAAE,YAAY,EAChB,KAAK,EACH;oBACE,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;iBAClB,EAEpB,QAAQ,EAAC,GAAG,gBACA,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,IAAI,IACH,EAAE,EAAE,YAAY,EAChB,KAAK,EACH;oBACE,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;iBAClB,EAEpB,QAAQ,EAAC,GAAG,gBACA,KAAK,EACjB,IAAI,EAAC,QAAQ,GACb,EACF,KAAC,IAAI,IAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,YAClC,KAAK,GACD,IACF,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n PropsWithoutRef,\n CSSProperties,\n useCallback,\n MouseEvent,\n KeyboardEvent,\n FC,\n useEffect\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';\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 highlight,\n error,\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 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\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 : highlight}\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\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 <StyledNodeTempleteContent ref={setNodeDescription}>\n {description}\n </StyledNodeTempleteContent>\n <Tooltip describeTarget={false} target={nodeDescription} hideDelay='none'>\n {description}\n </Tooltip>\n </>\n )}\n {additionalData && (\n <StyledNodeTemplateFooter>\n <MetaList metadata={additionalData} />\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 <Flex as={StyledLabel} nodeType={type}>\n {label}\n </Flex>\n <Flex\n as={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 <Flex\n as={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 as={StyledLabel} nodeType={type}>\n {label}\n </Flex>\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,CAoCtB,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, description, additionalData, highlight, data, error } = 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, { id: id, label: label, type: type, description: description, onClick: clickHandler, onDelete: data?.onDelete, onActionClick: data?.onActionClick, actions: data?.actions, additionalData: additionalData, highlight: highlight, error: error }));
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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GACZ,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, description, additionalData, highlight, data, error } =\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 id={id}\n label={label}\n type={type}\n description={description}\n onClick={clickHandler as NodeComponentProps['onClick']}\n onDelete={data?.onDelete}\n onActionClick={data?.onActionClick}\n actions={data?.actions}\n additionalData={additionalData}\n highlight={highlight}\n error={error}\n />\n );\n});\n\nexport default Node;\n"]}
@@ -1,4 +1,5 @@
1
1
  import { FC, ComponentType } from 'react';
2
+ import { ConnectorProps as GraphConnectorProps } from './Utils/Graph';
2
3
  import { RendererConnectorProps } from './Renderer.types';
3
4
  export interface ConnectorProps {
4
5
  items: RendererConnectorProps[];
@@ -7,6 +8,7 @@ export interface ConnectorProps {
7
8
  height: number;
8
9
  };
9
10
  content?: ComponentType<RendererConnectorProps>;
11
+ highlights?: Record<string, GraphConnectorProps>;
10
12
  }
11
13
  declare const Connectors: FC<ConnectorProps>;
12
14
  export default Connectors;
@@ -1 +1 @@
1
- {"version":3,"file":"Connectors.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Connectors.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAyD1D,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;CACjD;AACD,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,cAAc,CAqClC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"Connectors.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Connectors.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,cAAc,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAyD1D,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CAClD;AACD,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,cAAc,CA2ClC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -37,11 +37,13 @@ const StyledConnectorContainer = styled.div `
37
37
  top: 0;
38
38
  left: 0;
39
39
  `;
40
- const Connectors = ({ items, dimensions, content: Content }) => {
40
+ const Connectors = ({ items, dimensions, content: Content, highlights }) => {
41
41
  const theme = useTheme();
42
42
  return (_jsx(StyledConnectorContainer, { children: _jsx("svg", { width: dimensions.width, height: dimensions.height, xmlns: 'http://www.w3.org/2000/svg', viewBox: `0 0 ${dimensions.width} ${dimensions.height}`, children: items.map(item => {
43
- return (_jsxs("g", { children: [_jsx("path", { id: item.id, d: genLine(item.points), stroke: theme.base.colors.slate.dark, strokeWidth: '1', fill: 'none' }, void 0), item.labelLayout && (_jsx("foreignObject", { x: item.labelLayout.x - item.labelLayout.width, y: item.points.length > 10 ? item.points[3].y - 15 : item.labelLayout.y - 7.5, width: item.labelLayout.width, height: item.labelLayout.height, children: Content && _jsx(Content, { ...item }, void 0) }, void 0))] }, item.id));
44
- }) }, void 0) }, void 0));
43
+ return (_jsxs("g", { children: [_jsx("path", { id: item.id, d: genLine(item.points), stroke: highlights && highlights[item.id]
44
+ ? theme.base.colors.red.medium
45
+ : theme.base.colors.slate.dark, strokeWidth: highlights && highlights[item.id] ? 2 : 1, fill: 'none' }), item.labelLayout && (_jsx("foreignObject", { x: item.labelLayout.x - item.labelLayout.width, y: item.points.length > 10 ? item.points[3].y - 15 : item.labelLayout.y - 7.5, width: item.labelLayout.width, height: item.labelLayout.height, children: Content && (_jsx(Content, { ...item, highlight: !!(highlights && highlights[item.id]) })) }))] }, item.id));
46
+ }) }) }));
45
47
  };
46
48
  export default Connectors;
47
49
  //# sourceMappingURL=Connectors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Connectors.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Connectors.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AASnD,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,OAAO,GAAG,CAAC,MAAgB,EAAE,EAAE;IACnC,MAAM,OAAO,GAAW,MAAM;SAC3B,GAAG,CAAC,CAAC,KAAa,EAAE,GAAW,EAAE,GAAa,EAAE,EA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AAW,CAAC,MAAM,YAE9B,OAAO,IAAI,KAAC,OAAO,OAAK,IAAI,WAAI,WACnB,CACjB,KAjBK,IAAI,CAAC,EAAE,CAkBX,CACL,CAAC;YACJ,CAAC,CAAC,WACE,WACmB,CAC5B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FC, ComponentType } from 'react';\nimport styled from 'styled-components';\n\nimport { useTheme } from '@pega/cosmos-react-core';\n\nimport { RendererConnectorProps } from './Renderer.types';\n\ninterface Points {\n x: number;\n y: number;\n}\n\nconst CURVE_RADIUS = 16;\nconst genLine = (points: Points[]) => {\n const lineStr: string = points\n .map((point: Points, idx: number, arr: Points[]) => {\n const { x, y } = point;\n const prev = arr[idx - 1];\n const next = arr[idx + 1];\n const line = `L${x},${y}`;\n\n // if the point is extream end, no need to add a curve\n if (!prev || !next) return line;\n\n // if point is colinear with prev and next, no need to add a curve\n if (prev.x === next.x || prev.y === next.y) return line;\n\n if (point.x > next.x)\n // BOTTOM-RIGHT ↲\n return `L${x},${\n y - CURVE_RADIUS\n }a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 1 -${CURVE_RADIUS},${CURVE_RADIUS}`;\n\n // BOTTOM-LEFT ↳\n if (point.x < next.x)\n return `L${x},${\n y - CURVE_RADIUS\n }a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 0 ${CURVE_RADIUS},${CURVE_RADIUS}`;\n\n // TOP-LEFT ↱\n if (point.x < prev.x)\n return `L${\n x + CURVE_RADIUS\n },${y}a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 0 -${CURVE_RADIUS},${CURVE_RADIUS}`;\n\n // TOP-RIGHT ↴\n if (point.x > prev.x)\n return `L${\n x - CURVE_RADIUS\n },${y}a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 1 ${CURVE_RADIUS},${CURVE_RADIUS}`;\n\n return `L${x},${y}`;\n })\n .join('');\n return `M${lineStr.substr(1)}`;\n};\n\nconst StyledConnectorContainer = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n`;\nexport interface ConnectorProps {\n items: RendererConnectorProps[];\n dimensions: {\n width: number;\n height: number;\n };\n content?: ComponentType<RendererConnectorProps>;\n}\nconst Connectors: FC<ConnectorProps> = ({ items, dimensions, content: Content }) => {\n const theme = useTheme();\n\n return (\n <StyledConnectorContainer>\n <svg\n width={dimensions.width}\n height={dimensions.height}\n xmlns='http://www.w3.org/2000/svg'\n viewBox={`0 0 ${dimensions.width} ${dimensions.height}`}\n >\n {items.map(item => {\n return (\n <g key={item.id}>\n <path\n id={item.id}\n d={genLine(item.points)}\n stroke={theme.base.colors.slate.dark}\n strokeWidth='1'\n fill='none'\n />\n {item.labelLayout && (\n <foreignObject\n x={item.labelLayout.x - item.labelLayout.width}\n y={item.points.length > 10 ? item.points[3].y - 15 : item.labelLayout.y - 7.5}\n width={item.labelLayout.width}\n height={item.labelLayout.height}\n >\n {Content && <Content {...item} />}\n </foreignObject>\n )}\n </g>\n );\n })}\n </svg>\n </StyledConnectorContainer>\n );\n};\n\nexport default Connectors;\n"]}
1
+ {"version":3,"file":"Connectors.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Connectors.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAUnD,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,OAAO,GAAG,CAAC,MAAgB,EAAE,EAAE;IACnC,MAAM,OAAO,GAAW,MAAM;SAC3B,GAAG,CAAC,CAAC,KAAa,EAAE,GAAW,EAAE,GAAa,EAAE,EAAE;QACjD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC;QACvB,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QAC1B,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QAC1B,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CAAC,KAAK,EAC7B,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,YAE9B,OAAO,IAAI,CACV,KAAC,OAAO,OAAK,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAI,CACxE,GACa,CACjB,KAvBK,IAAI,CAAC,EAAE,CAwBX,CACL,CAAC;YACJ,CAAC,CAAC,GACE,GACmB,CAC5B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FC, ComponentType } from 'react';\nimport styled from 'styled-components';\n\nimport { useTheme } from '@pega/cosmos-react-core';\n\nimport { ConnectorProps as GraphConnectorProps } from './Utils/Graph';\nimport { RendererConnectorProps } from './Renderer.types';\n\ninterface Points {\n x: number;\n y: number;\n}\n\nconst CURVE_RADIUS = 16;\nconst genLine = (points: Points[]) => {\n const lineStr: string = points\n .map((point: Points, idx: number, arr: Points[]) => {\n const { x, y } = point;\n const prev = arr[idx - 1];\n const next = arr[idx + 1];\n const line = `L${x},${y}`;\n\n // if the point is extream end, no need to add a curve\n if (!prev || !next) return line;\n\n // if point is colinear with prev and next, no need to add a curve\n if (prev.x === next.x || prev.y === next.y) return line;\n\n if (point.x > next.x)\n // BOTTOM-RIGHT ↲\n return `L${x},${\n y - CURVE_RADIUS\n }a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 1 -${CURVE_RADIUS},${CURVE_RADIUS}`;\n\n // BOTTOM-LEFT ↳\n if (point.x < next.x)\n return `L${x},${\n y - CURVE_RADIUS\n }a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 0 ${CURVE_RADIUS},${CURVE_RADIUS}`;\n\n // TOP-LEFT ↱\n if (point.x < prev.x)\n return `L${\n x + CURVE_RADIUS\n },${y}a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 0 -${CURVE_RADIUS},${CURVE_RADIUS}`;\n\n // TOP-RIGHT ↴\n if (point.x > prev.x)\n return `L${\n x - CURVE_RADIUS\n },${y}a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 1 ${CURVE_RADIUS},${CURVE_RADIUS}`;\n\n return `L${x},${y}`;\n })\n .join('');\n return `M${lineStr.substr(1)}`;\n};\n\nconst StyledConnectorContainer = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n`;\nexport interface ConnectorProps {\n items: RendererConnectorProps[];\n dimensions: {\n width: number;\n height: number;\n };\n content?: ComponentType<RendererConnectorProps>;\n highlights?: Record<string, GraphConnectorProps>;\n}\nconst Connectors: FC<ConnectorProps> = ({ items, dimensions, content: Content, highlights }) => {\n const theme = useTheme();\n\n return (\n <StyledConnectorContainer>\n <svg\n width={dimensions.width}\n height={dimensions.height}\n xmlns='http://www.w3.org/2000/svg'\n viewBox={`0 0 ${dimensions.width} ${dimensions.height}`}\n >\n {items.map(item => {\n return (\n <g key={item.id}>\n <path\n id={item.id}\n d={genLine(item.points)}\n stroke={\n highlights && highlights[item.id]\n ? theme.base.colors.red.medium\n : theme.base.colors.slate.dark\n }\n strokeWidth={highlights && highlights[item.id] ? 2 : 1}\n fill='none'\n />\n {item.labelLayout && (\n <foreignObject\n x={item.labelLayout.x - item.labelLayout.width}\n y={item.points.length > 10 ? item.points[3].y - 15 : item.labelLayout.y - 7.5}\n width={item.labelLayout.width}\n height={item.labelLayout.height}\n >\n {Content && (\n <Content {...item} highlight={!!(highlights && highlights[item.id])} />\n )}\n </foreignObject>\n )}\n </g>\n );\n })}\n </svg>\n </StyledConnectorContainer>\n );\n};\n\nexport default Connectors;\n"]}
@@ -1,8 +1,10 @@
1
1
  import { ComponentType, FC } from 'react';
2
+ import { Node as GraphNode } from './Utils/Graph';
2
3
  import { RendererNodeProps } from './Renderer.types';
3
4
  export interface NodesProps {
4
5
  items: RendererNodeProps[];
5
6
  content?: ComponentType<RendererNodeProps>;
7
+ highlights?: Record<string, GraphNode>;
6
8
  }
7
9
  declare const Nodes: FC<NodesProps>;
8
10
  export default Nodes;
@@ -1 +1 @@
1
- {"version":3,"file":"Nodes.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Nodes.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAoBrD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAC5C;AACD,QAAA,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAmBzB,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Nodes.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Nodes.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAqBrD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACxC;AACD,QAAA,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAmBzB,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -16,10 +16,10 @@ const StyledNodeContainer = styled.div `
16
16
  top: 0;
17
17
  left: 0;
18
18
  `;
19
- const Nodes = ({ items, content: Node }) => {
19
+ const Nodes = ({ items, content: Node, highlights }) => {
20
20
  return (_jsx(StyledNodeContainer, { children: items.map(item => {
21
- return (_jsx(Flex, { as: StyledNodeWrapper, id: item.id, dimensions: item.dimensions, position: item.position, container: { justify: 'center' }, children: Node && _jsx(Node, { ...item }, void 0) }, item.id));
22
- }) }, void 0));
21
+ return (_jsx(Flex, { as: StyledNodeWrapper, id: `render-node-${item.id}`, dimensions: item.dimensions, position: item.position, container: { justify: 'center' }, children: Node && _jsx(Node, { ...item, highlight: !!(highlights && highlights[item.id]) }) }, item.id));
22
+ }) }));
23
23
  };
24
24
  export default Nodes;
25
25
  //# sourceMappingURL=Nodes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Nodes.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Nodes.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAI/C,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAGjC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9B,OAAO,GAAG,CAAA;;;;aAIC,UAAU,CAAC,KAAK;cACf,UAAU,CAAC,MAAM;2BACJ,QAAQ,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC;GACnD,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIrC,CAAC;AAKF,MAAM,KAAK,GAAmB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;IACzD,OAAO,CACL,KAAC,mBAAmB,cACjB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAChB,OAAO,CACL,KAAC,IAAI,IAEH,EAAE,EAAE,iBAAiB,EACrB,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,YAE/B,IAAI,IAAI,KAAC,IAAI,OAAK,IAAI,WAAI,IAPtB,IAAI,CAAC,EAAE,CAQP,CACR,CAAC;QACJ,CAAC,CAAC,WACkB,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import { ComponentType, FC } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Flex } from '@pega/cosmos-react-core';\n\nimport { RendererNodeProps } from './Renderer.types';\n\nconst StyledNodeWrapper = styled.div<{\n dimensions: RendererNodeProps['dimensions'];\n position: RendererNodeProps['position'];\n}>(({ dimensions, position }) => {\n return css`\n position: absolute;\n top: 0;\n left: 0;\n width: ${dimensions.width}px;\n height: ${dimensions.height}px;\n transform: translate(${position.x}px, ${position.y}px);\n `;\n});\nconst StyledNodeContainer = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n`;\nexport interface NodesProps {\n items: RendererNodeProps[];\n content?: ComponentType<RendererNodeProps>;\n}\nconst Nodes: FC<NodesProps> = ({ items, content: Node }) => {\n return (\n <StyledNodeContainer>\n {items.map(item => {\n return (\n <Flex\n key={item.id}\n as={StyledNodeWrapper}\n id={item.id}\n dimensions={item.dimensions}\n position={item.position}\n container={{ justify: 'center' }}\n >\n {Node && <Node {...item} />}\n </Flex>\n );\n })}\n </StyledNodeContainer>\n );\n};\n\nexport default Nodes;\n"]}
1
+ {"version":3,"file":"Nodes.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Nodes.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAK/C,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAGjC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9B,OAAO,GAAG,CAAA;;;;aAIC,UAAU,CAAC,KAAK;cACf,UAAU,CAAC,MAAM;2BACJ,QAAQ,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC;GACnD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIrC,CAAC;AAMF,MAAM,KAAK,GAAmB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE;IACrE,OAAO,CACL,KAAC,mBAAmB,cACjB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAChB,OAAO,CACL,KAAC,IAAI,IAEH,EAAE,EAAE,iBAAiB,EACrB,EAAE,EAAE,eAAe,IAAI,CAAC,EAAE,EAAE,EAC5B,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,YAE/B,IAAI,IAAI,KAAC,IAAI,OAAK,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAI,IAPxE,IAAI,CAAC,EAAE,CAQP,CACR,CAAC;QACJ,CAAC,CAAC,GACkB,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import { ComponentType, FC } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Flex } from '@pega/cosmos-react-core';\n\nimport { Node as GraphNode } from './Utils/Graph';\nimport { RendererNodeProps } from './Renderer.types';\n\nconst StyledNodeWrapper = styled.div<{\n dimensions: RendererNodeProps['dimensions'];\n position: RendererNodeProps['position'];\n}>(({ dimensions, position }) => {\n return css`\n position: absolute;\n top: 0;\n left: 0;\n width: ${dimensions.width}px;\n height: ${dimensions.height}px;\n transform: translate(${position.x}px, ${position.y}px);\n `;\n});\n\nconst StyledNodeContainer = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n`;\nexport interface NodesProps {\n items: RendererNodeProps[];\n content?: ComponentType<RendererNodeProps>;\n highlights?: Record<string, GraphNode>;\n}\nconst Nodes: FC<NodesProps> = ({ items, content: Node, highlights }) => {\n return (\n <StyledNodeContainer>\n {items.map(item => {\n return (\n <Flex\n key={item.id}\n as={StyledNodeWrapper}\n id={`render-node-${item.id}`}\n dimensions={item.dimensions}\n position={item.position}\n container={{ justify: 'center' }}\n >\n {Node && <Node {...item} highlight={!!(highlights && highlights[item.id])} />}\n </Flex>\n );\n })}\n </StyledNodeContainer>\n );\n};\n\nexport default Nodes;\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,EAAE,MAAM,OAAO,CAAC;AAI3B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAUjD,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAe/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -8,10 +8,10 @@ const StyledWrapper = styled.div `
8
8
  width: 100%;
9
9
  height: 100%;
10
10
  `;
11
- const Renderer = ({ graphData, connector, node }) => {
11
+ const Renderer = ({ graphData, connector, node, highlights }) => {
12
12
  // apply the plotted positions
13
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));
14
+ return (_jsxs(StyledWrapper, { children: [_jsx(Connectors, { items: graphData.connectors, content: connector, dimensions: graphDimensions, highlights: highlights?.connectors }), _jsx(Nodes, { items: graphData.nodes, content: node, highlights: highlights?.nodes })] }));
15
15
  };
16
16
  export default Renderer;
17
17
  //# 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};\n\nexport default Renderer;\n"]}
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,UAAU,EAAE,EAAE,EAAE;IACjF,8BAA8B;IAC9B,MAAM,eAAe,GAAG,WAAW,CAAC,IAAI,CAA6B,SAAS,CAAC,CAAC;IAEhF,OAAO,CACL,MAAC,aAAa,eACZ,KAAC,UAAU,IACT,KAAK,EAAE,SAAS,CAAC,UAAU,EAC3B,OAAO,EAAE,SAAS,EAClB,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,UAAU,EAAE,UAAU,GAClC,EACF,KAAC,KAAK,IAAC,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,GAAI,IACjE,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, highlights }) => {\n // apply the plotted positions\n const graphDimensions = GraphLayout.plot<RendererProps['graphData']>(graphData);\n\n return (\n <StyledWrapper>\n <Connectors\n items={graphData.connectors}\n content={connector}\n dimensions={graphDimensions}\n highlights={highlights?.connectors}\n />\n <Nodes items={graphData.nodes} content={node} highlights={highlights?.nodes} />\n </StyledWrapper>\n );\n};\n\nexport default Renderer;\n"]}
@@ -1,18 +1,24 @@
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
8
  export interface RendererNodeProps extends PlottedGraphNode {
9
+ highlight?: boolean;
9
10
  }
10
11
  export interface RendererConnectorProps extends PlottedGraphConnector {
12
+ highlight?: boolean;
11
13
  }
12
14
  export interface RendererProps {
13
15
  graphData: GraphData<RendererNodeProps, RendererConnectorProps>;
14
16
  disableAutoLayout?: boolean;
15
- connector?: ComponentType<RendererConnectorProps>;
16
- node?: ComponentType<RendererNodeProps>;
17
+ highlights?: {
18
+ nodes: Record<string, Node>;
19
+ connectors: Record<string, ConnectorProps>;
20
+ };
21
+ connector?: FC<RendererConnectorProps>;
22
+ node?: FC<Node>;
17
23
  }
18
24
  //# 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,WA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AC,MAAM,EAAE,cAAc,CAAC,CAAC;KAC5C,CAAC;IACF,SAAS,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,CAAC;IACvC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;CACjB"}
@@ -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 RendererNodeProps extends PlottedGraphNode {\n highlight?: boolean;\n}\n\nexport interface RendererConnectorProps extends PlottedGraphConnector {\n highlight?: boolean;\n}\n\nexport interface RendererProps {\n graphData: GraphData<RendererNodeProps, RendererConnectorProps>;\n disableAutoLayout?: boolean;\n highlights?: {\n nodes: Record<string, Node>;\n connectors: Record<string, ConnectorProps>;\n };\n connector?: FC<RendererConnectorProps>;\n node?: FC<Node>;\n}\n"]}
@@ -47,8 +47,8 @@ export declare class DirectedGraph<T extends Node = Node, U extends ConnectorPro
47
47
  fromNodeId?: string;
48
48
  toNodeId?: string;
49
49
  }): DirectedGraph<T, U>;
50
- getInConnectors(toNodeId: string, fromNodeId?: string): ConnectorProps[];
51
- getOutConnectors(fromNodeId: string, toNodeId?: string): ConnectorProps[];
52
- getAllNodeConnectors(nodeId: string): ConnectorProps<unknown>[] | undefined;
50
+ getInConnectors(toNodeId: string, fromNodeId?: string): U[];
51
+ getOutConnectors(fromNodeId: string, toNodeId?: string): U[];
52
+ getAllNodeConnectors(nodeId: string): U[] | undefined;
53
53
  }
54
54
  //# sourceMappingURL=Graph.d.ts.map