@pega/cosmos-react-build 8.0.0-build.9.0 → 8.0.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 (428) hide show
  1. package/lib/components/AppShell/AppShell.styles.d.ts +1 -1
  2. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  3. package/lib/components/AppShell/AppShell.styles.js +1 -46
  4. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  5. package/lib/components/AppShell/Header/AppHeader.d.ts +2 -3
  6. package/lib/components/AppShell/Header/AppHeader.d.ts.map +1 -1
  7. package/lib/components/AppShell/Header/AppHeader.js +4 -4
  8. package/lib/components/AppShell/Header/AppHeader.js.map +1 -1
  9. package/lib/components/AppShell/Header/AppHeader.styles.d.ts +2 -2
  10. package/lib/components/AppShell/Header/AppHeader.styles.d.ts.map +1 -1
  11. package/lib/components/BackgroundPicker/BackgroundPicker.d.ts +6 -0
  12. package/lib/components/BackgroundPicker/BackgroundPicker.d.ts.map +1 -0
  13. package/lib/components/BackgroundPicker/BackgroundPicker.js +82 -0
  14. package/lib/components/BackgroundPicker/BackgroundPicker.js.map +1 -0
  15. package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts +15 -0
  16. package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts.map +1 -0
  17. package/lib/components/BackgroundPicker/BackgroundPicker.styles.js +152 -0
  18. package/lib/components/BackgroundPicker/BackgroundPicker.styles.js.map +1 -0
  19. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts +5 -0
  20. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts.map +1 -0
  21. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js +30 -0
  22. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js.map +1 -0
  23. package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts +98 -0
  24. package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts.map +1 -0
  25. package/lib/components/BackgroundPicker/BackgroundPicker.types.js +29 -0
  26. package/lib/components/BackgroundPicker/BackgroundPicker.types.js.map +1 -0
  27. package/lib/components/BackgroundPicker/GradientConfig.d.ts +6 -0
  28. package/lib/components/BackgroundPicker/GradientConfig.d.ts.map +1 -0
  29. package/lib/components/BackgroundPicker/GradientConfig.js +149 -0
  30. package/lib/components/BackgroundPicker/GradientConfig.js.map +1 -0
  31. package/lib/components/BackgroundPicker/ImageConfig.d.ts +6 -0
  32. package/lib/components/BackgroundPicker/ImageConfig.d.ts.map +1 -0
  33. package/lib/components/BackgroundPicker/ImageConfig.js +64 -0
  34. package/lib/components/BackgroundPicker/ImageConfig.js.map +1 -0
  35. package/lib/components/BackgroundPicker/SolidColorConfig.d.ts +6 -0
  36. package/lib/components/BackgroundPicker/SolidColorConfig.d.ts.map +1 -0
  37. package/lib/components/BackgroundPicker/SolidColorConfig.js +24 -0
  38. package/lib/components/BackgroundPicker/SolidColorConfig.js.map +1 -0
  39. package/lib/components/BackgroundPicker/index.d.ts +3 -0
  40. package/lib/components/BackgroundPicker/index.d.ts.map +1 -0
  41. package/lib/components/BackgroundPicker/index.js +2 -0
  42. package/lib/components/BackgroundPicker/index.js.map +1 -0
  43. package/lib/components/BackgroundPicker/utils.d.ts +24 -0
  44. package/lib/components/BackgroundPicker/utils.d.ts.map +1 -0
  45. package/lib/components/BackgroundPicker/utils.js +186 -0
  46. package/lib/components/BackgroundPicker/utils.js.map +1 -0
  47. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +2 -3
  48. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
  49. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  50. package/lib/components/DynamicInput/BooleanControl.d.ts +3 -5
  51. package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -1
  52. package/lib/components/DynamicInput/BooleanControl.js.map +1 -1
  53. package/lib/components/DynamicInput/DynamicInput.d.ts +1 -2
  54. package/lib/components/DynamicInput/DynamicInput.d.ts.map +1 -1
  55. package/lib/components/DynamicInput/DynamicInput.js +33 -33
  56. package/lib/components/DynamicInput/DynamicInput.js.map +1 -1
  57. package/lib/components/DynamicInput/DynamicInput.styles.d.ts +2 -2
  58. package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -1
  59. package/lib/components/DynamicInput/DynamicInput.styles.js +1 -0
  60. package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -1
  61. package/lib/components/DynamicInput/DynamicInput.types.d.ts +61 -11
  62. package/lib/components/DynamicInput/DynamicInput.types.d.ts.map +1 -1
  63. package/lib/components/DynamicInput/DynamicInput.types.js.map +1 -1
  64. package/lib/components/Expression/Expression.d.ts +6 -0
  65. package/lib/components/Expression/Expression.d.ts.map +1 -0
  66. package/lib/components/Expression/Expression.js +36 -0
  67. package/lib/components/Expression/Expression.js.map +1 -0
  68. package/lib/components/Expression/Expression.styles.d.ts +7 -0
  69. package/lib/components/Expression/Expression.styles.d.ts.map +1 -0
  70. package/lib/components/Expression/Expression.styles.js +47 -0
  71. package/lib/components/Expression/Expression.styles.js.map +1 -0
  72. package/lib/components/Expression/Expression.test-ids.d.ts +2 -0
  73. package/lib/components/Expression/Expression.test-ids.d.ts.map +1 -0
  74. package/lib/components/Expression/Expression.test-ids.js +8 -0
  75. package/lib/components/Expression/Expression.test-ids.js.map +1 -0
  76. package/lib/components/Expression/Expression.types.d.ts +53 -0
  77. package/lib/components/Expression/Expression.types.d.ts.map +1 -0
  78. package/lib/components/Expression/Expression.types.js +2 -0
  79. package/lib/components/Expression/Expression.types.js.map +1 -0
  80. package/lib/components/Expression/index.d.ts +3 -0
  81. package/lib/components/Expression/index.d.ts.map +1 -0
  82. package/lib/components/Expression/index.js +2 -0
  83. package/lib/components/Expression/index.js.map +1 -0
  84. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +7 -5
  85. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
  86. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +393 -76
  87. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
  88. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +9 -2
  89. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
  90. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +100 -26
  91. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
  92. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts +2 -0
  93. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts.map +1 -0
  94. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js +6 -0
  95. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js.map +1 -0
  96. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +32 -6
  97. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -1
  98. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -1
  99. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -1
  100. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +1 -0
  101. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -1
  102. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts +3 -0
  103. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts.map +1 -0
  104. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js +34 -0
  105. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js.map +1 -0
  106. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +2 -3
  107. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
  108. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
  109. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +1 -1
  110. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -1
  111. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +3 -1
  112. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -1
  113. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -1
  114. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +2 -3
  115. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -1
  116. package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -1
  117. package/lib/components/ExpressionBuilder/ExpressionList.d.ts +2 -3
  118. package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -1
  119. package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -1
  120. package/lib/components/ExpressionBuilder/index.d.ts +1 -1
  121. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -1
  122. package/lib/components/ExpressionBuilder/index.js.map +1 -1
  123. package/lib/components/FieldReference/FieldReference.styles.d.ts +1 -0
  124. package/lib/components/FieldReference/FieldReference.styles.d.ts.map +1 -1
  125. package/lib/components/FieldReference/FieldReference.styles.js +45 -37
  126. package/lib/components/FieldReference/FieldReference.styles.js.map +1 -1
  127. package/lib/components/FieldReference/FieldReference.test-ids.d.ts +1 -0
  128. package/lib/components/FieldReference/FieldReference.test-ids.d.ts.map +1 -1
  129. package/lib/components/FieldReference/FieldReference.test-ids.js +3 -0
  130. package/lib/components/FieldReference/FieldReference.test-ids.js.map +1 -1
  131. package/lib/components/FieldReference/FieldReference.types.d.ts +6 -1
  132. package/lib/components/FieldReference/FieldReference.types.d.ts.map +1 -1
  133. package/lib/components/FieldReference/FieldReference.types.js.map +1 -1
  134. package/lib/components/FieldReference/FieldReferenceDisplay.d.ts.map +1 -1
  135. package/lib/components/FieldReference/FieldReferenceDisplay.js +11 -7
  136. package/lib/components/FieldReference/FieldReferenceDisplay.js.map +1 -1
  137. package/lib/components/FieldReference/FieldReferenceInput.d.ts.map +1 -1
  138. package/lib/components/FieldReference/FieldReferenceInput.js +17 -11
  139. package/lib/components/FieldReference/FieldReferenceInput.js.map +1 -1
  140. package/lib/components/FieldReference/FieldReferenceMenuList.d.ts +5 -4
  141. package/lib/components/FieldReference/FieldReferenceMenuList.d.ts.map +1 -1
  142. package/lib/components/FieldReference/FieldReferenceMenuList.js +7 -5
  143. package/lib/components/FieldReference/FieldReferenceMenuList.js.map +1 -1
  144. package/lib/components/FieldReference/index.d.ts +2 -2
  145. package/lib/components/FieldReference/index.d.ts.map +1 -1
  146. package/lib/components/FieldReference/index.js +1 -1
  147. package/lib/components/FieldReference/index.js.map +1 -1
  148. package/lib/components/IconTile/IconTile.d.ts +7 -3
  149. package/lib/components/IconTile/IconTile.d.ts.map +1 -1
  150. package/lib/components/IconTile/IconTile.js +40 -4
  151. package/lib/components/IconTile/IconTile.js.map +1 -1
  152. package/lib/components/IconTile/IconTile.types.d.ts +17 -15
  153. package/lib/components/IconTile/IconTile.types.d.ts.map +1 -1
  154. package/lib/components/IconTile/IconTile.types.js.map +1 -1
  155. package/lib/components/IconTile/Tiles/Ai.d.ts +1 -1
  156. package/lib/components/IconTile/Tiles/Ai.d.ts.map +1 -1
  157. package/lib/components/IconTile/Tiles/Ai.js.map +1 -1
  158. package/lib/components/IconTile/Tiles/Automation.d.ts +1 -1
  159. package/lib/components/IconTile/Tiles/Automation.d.ts.map +1 -1
  160. package/lib/components/IconTile/Tiles/Automation.js.map +1 -1
  161. package/lib/components/IconTile/Tiles/AutomationAppend.d.ts +1 -1
  162. package/lib/components/IconTile/Tiles/AutomationAppend.d.ts.map +1 -1
  163. package/lib/components/IconTile/Tiles/AutomationAppend.js.map +1 -1
  164. package/lib/components/IconTile/Tiles/AutomationCall.d.ts +1 -1
  165. package/lib/components/IconTile/Tiles/AutomationCall.d.ts.map +1 -1
  166. package/lib/components/IconTile/Tiles/AutomationCall.js.map +1 -1
  167. package/lib/components/IconTile/Tiles/AutomationForEach.d.ts +1 -1
  168. package/lib/components/IconTile/Tiles/AutomationForEach.d.ts.map +1 -1
  169. package/lib/components/IconTile/Tiles/AutomationForEach.js.map +1 -1
  170. package/lib/components/IconTile/Tiles/AutomationReturn.d.ts +1 -1
  171. package/lib/components/IconTile/Tiles/AutomationReturn.d.ts.map +1 -1
  172. package/lib/components/IconTile/Tiles/AutomationReturn.js.map +1 -1
  173. package/lib/components/IconTile/Tiles/AutomationSet.d.ts +1 -1
  174. package/lib/components/IconTile/Tiles/AutomationSet.d.ts.map +1 -1
  175. package/lib/components/IconTile/Tiles/AutomationSet.js.map +1 -1
  176. package/lib/components/IconTile/Tiles/Case.d.ts +1 -1
  177. package/lib/components/IconTile/Tiles/Case.d.ts.map +1 -1
  178. package/lib/components/IconTile/Tiles/Case.js.map +1 -1
  179. package/lib/components/IconTile/Tiles/CaseGoTo.d.ts +1 -1
  180. package/lib/components/IconTile/Tiles/CaseGoTo.d.ts.map +1 -1
  181. package/lib/components/IconTile/Tiles/CaseGoTo.js.map +1 -1
  182. package/lib/components/IconTile/Tiles/CaseProcess.d.ts +1 -1
  183. package/lib/components/IconTile/Tiles/CaseProcess.d.ts.map +1 -1
  184. package/lib/components/IconTile/Tiles/CaseProcess.js.map +1 -1
  185. package/lib/components/IconTile/Tiles/CaseSla.d.ts +1 -1
  186. package/lib/components/IconTile/Tiles/CaseSla.d.ts.map +1 -1
  187. package/lib/components/IconTile/Tiles/CaseSla.js.map +1 -1
  188. package/lib/components/IconTile/Tiles/CaseStage.d.ts +1 -1
  189. package/lib/components/IconTile/Tiles/CaseStage.d.ts.map +1 -1
  190. package/lib/components/IconTile/Tiles/CaseStage.js.map +1 -1
  191. package/lib/components/IconTile/Tiles/CaseWait.d.ts +1 -1
  192. package/lib/components/IconTile/Tiles/CaseWait.d.ts.map +1 -1
  193. package/lib/components/IconTile/Tiles/CaseWait.js.map +1 -1
  194. package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts +1 -1
  195. package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts.map +1 -1
  196. package/lib/components/IconTile/Tiles/LogicDecisionStep.js.map +1 -1
  197. package/lib/components/IconTile/Tiles/LogicFunction.d.ts +1 -1
  198. package/lib/components/IconTile/Tiles/LogicFunction.d.ts.map +1 -1
  199. package/lib/components/IconTile/Tiles/LogicFunction.js.map +1 -1
  200. package/lib/components/IconTile/Tiles/LogicValidation.d.ts +1 -1
  201. package/lib/components/IconTile/Tiles/LogicValidation.d.ts.map +1 -1
  202. package/lib/components/IconTile/Tiles/LogicValidation.js.map +1 -1
  203. package/lib/components/IconTile/Tiles/LogicWhen.d.ts +1 -1
  204. package/lib/components/IconTile/Tiles/LogicWhen.d.ts.map +1 -1
  205. package/lib/components/IconTile/Tiles/LogicWhen.js.map +1 -1
  206. package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts +1 -1
  207. package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts.map +1 -1
  208. package/lib/components/IconTile/Tiles/RuleAuthenticate.js.map +1 -1
  209. package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts +1 -1
  210. package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts.map +1 -1
  211. package/lib/components/IconTile/Tiles/RuleConfiguration.js.map +1 -1
  212. package/lib/components/IconTile/Tiles/RuleConnector.d.ts +1 -1
  213. package/lib/components/IconTile/Tiles/RuleConnector.d.ts.map +1 -1
  214. package/lib/components/IconTile/Tiles/RuleConnector.js.map +1 -1
  215. package/lib/components/IconTile/Tiles/RuleDataPage.d.ts +1 -1
  216. package/lib/components/IconTile/Tiles/RuleDataPage.d.ts.map +1 -1
  217. package/lib/components/IconTile/Tiles/RuleDataPage.js.map +1 -1
  218. package/lib/components/IconTile/Tiles/RuleField.d.ts +1 -1
  219. package/lib/components/IconTile/Tiles/RuleField.d.ts.map +1 -1
  220. package/lib/components/IconTile/Tiles/RuleField.js.map +1 -1
  221. package/lib/components/IconTile/Tiles/RuleInsight.d.ts +1 -1
  222. package/lib/components/IconTile/Tiles/RuleInsight.d.ts.map +1 -1
  223. package/lib/components/IconTile/Tiles/RuleInsight.js.map +1 -1
  224. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts +1 -1
  225. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts.map +1 -1
  226. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.js.map +1 -1
  227. package/lib/components/IconTile/Tiles/RuleLiveData.d.ts +1 -1
  228. package/lib/components/IconTile/Tiles/RuleLiveData.d.ts.map +1 -1
  229. package/lib/components/IconTile/Tiles/RuleLiveData.js.map +1 -1
  230. package/lib/components/IconTile/Tiles/RuleParagraph.d.ts +1 -1
  231. package/lib/components/IconTile/Tiles/RuleParagraph.d.ts.map +1 -1
  232. package/lib/components/IconTile/Tiles/RuleParagraph.js.map +1 -1
  233. package/lib/components/IconTile/Tiles/RulePermission.d.ts +1 -1
  234. package/lib/components/IconTile/Tiles/RulePermission.d.ts.map +1 -1
  235. package/lib/components/IconTile/Tiles/RulePermission.js.map +1 -1
  236. package/lib/components/IconTile/Tiles/RulePersona.d.ts +1 -1
  237. package/lib/components/IconTile/Tiles/RulePersona.d.ts.map +1 -1
  238. package/lib/components/IconTile/Tiles/RulePersona.js.map +1 -1
  239. package/lib/components/IconTile/Tiles/RulePortal.d.ts +1 -1
  240. package/lib/components/IconTile/Tiles/RulePortal.d.ts.map +1 -1
  241. package/lib/components/IconTile/Tiles/RulePortal.js.map +1 -1
  242. package/lib/components/IconTile/Tiles/RuleRecord.d.ts +1 -1
  243. package/lib/components/IconTile/Tiles/RuleRecord.d.ts.map +1 -1
  244. package/lib/components/IconTile/Tiles/RuleRecord.js.map +1 -1
  245. package/lib/components/IconTile/Tiles/RuleSystem.d.ts +1 -1
  246. package/lib/components/IconTile/Tiles/RuleSystem.d.ts.map +1 -1
  247. package/lib/components/IconTile/Tiles/RuleSystem.js.map +1 -1
  248. package/lib/components/IconTile/Tiles/RuleView.d.ts +1 -1
  249. package/lib/components/IconTile/Tiles/RuleView.d.ts.map +1 -1
  250. package/lib/components/IconTile/Tiles/RuleView.js.map +1 -1
  251. package/lib/components/IconTile/Tiles/Task.d.ts +1 -1
  252. package/lib/components/IconTile/Tiles/Task.d.ts.map +1 -1
  253. package/lib/components/IconTile/Tiles/Task.js.map +1 -1
  254. package/lib/components/IconTile/Tiles/TaskAction.d.ts +1 -1
  255. package/lib/components/IconTile/Tiles/TaskAction.d.ts.map +1 -1
  256. package/lib/components/IconTile/Tiles/TaskAction.js.map +1 -1
  257. package/lib/components/IconTile/iconUtils.d.ts +11 -0
  258. package/lib/components/IconTile/iconUtils.d.ts.map +1 -0
  259. package/lib/components/IconTile/iconUtils.js +41 -0
  260. package/lib/components/IconTile/iconUtils.js.map +1 -0
  261. package/lib/components/IconTile/index.d.ts +1 -0
  262. package/lib/components/IconTile/index.d.ts.map +1 -1
  263. package/lib/components/IconTile/index.js.map +1 -1
  264. package/lib/components/ItemLibrary/ItemLibrary.d.ts +10 -10
  265. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  266. package/lib/components/ItemLibrary/ItemLibrary.js +26 -18
  267. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  268. package/lib/components/LifeCycle/Category.d.ts +8 -6
  269. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  270. package/lib/components/LifeCycle/Category.js +53 -36
  271. package/lib/components/LifeCycle/Category.js.map +1 -1
  272. package/lib/components/LifeCycle/LifeCycle.d.ts +8 -4
  273. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
  274. package/lib/components/LifeCycle/LifeCycle.js +113 -19
  275. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  276. package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts +6 -0
  277. package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts.map +1 -0
  278. package/lib/components/LifeCycle/LifeCycle.test-ids.js +10 -0
  279. package/lib/components/LifeCycle/LifeCycle.test-ids.js.map +1 -0
  280. package/lib/components/LifeCycle/LifeCycle.types.d.ts +713 -58
  281. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  282. package/lib/components/LifeCycle/LifeCycle.types.js +71 -61
  283. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  284. package/lib/components/LifeCycle/LifeCycleContext.d.ts +16 -4
  285. package/lib/components/LifeCycle/LifeCycleContext.d.ts.map +1 -1
  286. package/lib/components/LifeCycle/LifeCycleContext.js +7 -1
  287. package/lib/components/LifeCycle/LifeCycleContext.js.map +1 -1
  288. package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts +21 -0
  289. package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts.map +1 -0
  290. package/lib/components/LifeCycle/LifeCycleDragDropList.js +298 -0
  291. package/lib/components/LifeCycle/LifeCycleDragDropList.js.map +1 -0
  292. package/lib/components/LifeCycle/LifeCycleList.d.ts +8 -6
  293. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  294. package/lib/components/LifeCycle/LifeCycleList.js +20 -30
  295. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  296. package/lib/components/LifeCycle/Stage.d.ts +12 -7
  297. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  298. package/lib/components/LifeCycle/Stage.js +87 -72
  299. package/lib/components/LifeCycle/Stage.js.map +1 -1
  300. package/lib/components/LifeCycle/Step.d.ts +21 -14
  301. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  302. package/lib/components/LifeCycle/Step.js +75 -51
  303. package/lib/components/LifeCycle/Step.js.map +1 -1
  304. package/lib/components/LifeCycle/Task.d.ts +18 -7
  305. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  306. package/lib/components/LifeCycle/Task.js +119 -55
  307. package/lib/components/LifeCycle/Task.js.map +1 -1
  308. package/lib/components/LifeCycle/index.d.ts +2 -1
  309. package/lib/components/LifeCycle/index.d.ts.map +1 -1
  310. package/lib/components/LifeCycle/index.js +1 -0
  311. package/lib/components/LifeCycle/index.js.map +1 -1
  312. package/lib/components/LifeCycle/utils.d.ts +14 -0
  313. package/lib/components/LifeCycle/utils.d.ts.map +1 -0
  314. package/lib/components/LifeCycle/utils.js +250 -0
  315. package/lib/components/LifeCycle/utils.js.map +1 -0
  316. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +2 -3
  317. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -1
  318. package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -1
  319. package/lib/components/ObjectSelect/ObjectPicker.d.ts +2 -2
  320. package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -1
  321. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
  322. package/lib/components/PageTemplates/GalleryPage.d.ts +2 -2
  323. package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
  324. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  325. package/lib/components/PageTemplates/PageTemplates.d.ts +5 -5
  326. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  327. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  328. package/lib/components/PageTemplates/ShowcasePage.d.ts +2 -2
  329. package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -1
  330. package/lib/components/PageTemplates/ShowcasePage.js.map +1 -1
  331. package/lib/components/RuleSelect/RuleSelect.js +3 -3
  332. package/lib/components/RuleSelect/RuleSelect.js.map +1 -1
  333. package/lib/components/Workbench/Workbench.d.ts +2 -3
  334. package/lib/components/Workbench/Workbench.d.ts.map +1 -1
  335. package/lib/components/Workbench/Workbench.js.map +1 -1
  336. package/lib/components/Workbench/Workbench.styles.d.ts +2 -2
  337. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
  338. package/lib/index.d.ts +4 -2
  339. package/lib/index.d.ts.map +1 -1
  340. package/lib/index.js +4 -2
  341. package/lib/index.js.map +1 -1
  342. package/lib/{components/FieldReference → utils}/typeIconMapping.d.ts +8 -0
  343. package/lib/utils/typeIconMapping.d.ts.map +1 -0
  344. package/lib/{components/FieldReference → utils}/typeIconMapping.js +15 -3
  345. package/lib/utils/typeIconMapping.js.map +1 -0
  346. package/package.json +16 -14
  347. package/lib/components/FieldReference/typeIconMapping.d.ts.map +0 -1
  348. package/lib/components/FieldReference/typeIconMapping.js.map +0 -1
  349. package/lib/components/FlowModeller/AddNode.d.ts +0 -18
  350. package/lib/components/FlowModeller/AddNode.d.ts.map +0 -1
  351. package/lib/components/FlowModeller/AddNode.js +0 -86
  352. package/lib/components/FlowModeller/AddNode.js.map +0 -1
  353. package/lib/components/FlowModeller/Connector.d.ts +0 -6
  354. package/lib/components/FlowModeller/Connector.d.ts.map +0 -1
  355. package/lib/components/FlowModeller/Connector.js +0 -69
  356. package/lib/components/FlowModeller/Connector.js.map +0 -1
  357. package/lib/components/FlowModeller/DeletePopover.d.ts +0 -19
  358. package/lib/components/FlowModeller/DeletePopover.d.ts.map +0 -1
  359. package/lib/components/FlowModeller/DeletePopover.js +0 -136
  360. package/lib/components/FlowModeller/DeletePopover.js.map +0 -1
  361. package/lib/components/FlowModeller/FlowModeller.d.ts +0 -5
  362. package/lib/components/FlowModeller/FlowModeller.d.ts.map +0 -1
  363. package/lib/components/FlowModeller/FlowModeller.js +0 -317
  364. package/lib/components/FlowModeller/FlowModeller.js.map +0 -1
  365. package/lib/components/FlowModeller/FlowModeller.types.d.ts +0 -27
  366. package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +0 -1
  367. package/lib/components/FlowModeller/FlowModeller.types.js +0 -2
  368. package/lib/components/FlowModeller/FlowModeller.types.js.map +0 -1
  369. package/lib/components/FlowModeller/FlowModellerContext.d.ts +0 -10
  370. package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +0 -1
  371. package/lib/components/FlowModeller/FlowModellerContext.js +0 -8
  372. package/lib/components/FlowModeller/FlowModellerContext.js.map +0 -1
  373. package/lib/components/FlowModeller/Node/Node.types.d.ts +0 -75
  374. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +0 -1
  375. package/lib/components/FlowModeller/Node/Node.types.js +0 -27
  376. package/lib/components/FlowModeller/Node/Node.types.js.map +0 -1
  377. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +0 -20
  378. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +0 -1
  379. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +0 -151
  380. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +0 -1
  381. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +0 -6
  382. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +0 -1
  383. package/lib/components/FlowModeller/Node/NodeTemplates.js +0 -69
  384. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +0 -1
  385. package/lib/components/FlowModeller/Node.d.ts +0 -5
  386. package/lib/components/FlowModeller/Node.d.ts.map +0 -1
  387. package/lib/components/FlowModeller/Node.js +0 -22
  388. package/lib/components/FlowModeller/Node.js.map +0 -1
  389. package/lib/components/FlowModeller/Renderer/Renderer.d.ts +0 -5
  390. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +0 -1
  391. package/lib/components/FlowModeller/Renderer/Renderer.js +0 -48
  392. package/lib/components/FlowModeller/Renderer/Renderer.js.map +0 -1
  393. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +0 -18
  394. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +0 -1
  395. package/lib/components/FlowModeller/Renderer/Renderer.types.js +0 -2
  396. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +0 -1
  397. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +0 -59
  398. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +0 -1
  399. package/lib/components/FlowModeller/Renderer/Utils/Graph.js +0 -258
  400. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +0 -1
  401. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +0 -36
  402. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +0 -1
  403. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +0 -120
  404. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +0 -1
  405. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +0 -28
  406. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +0 -1
  407. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +0 -172
  408. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +0 -1
  409. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +0 -18
  410. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +0 -1
  411. package/lib/components/FlowModeller/Utils/addNodeUtils.js +0 -141
  412. package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +0 -1
  413. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +0 -30
  414. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +0 -1
  415. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +0 -81
  416. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +0 -1
  417. package/lib/components/FlowModeller/helper.d.ts +0 -39
  418. package/lib/components/FlowModeller/helper.d.ts.map +0 -1
  419. package/lib/components/FlowModeller/helper.js +0 -198
  420. package/lib/components/FlowModeller/helper.js.map +0 -1
  421. package/lib/components/FlowModeller/index.d.ts +0 -20
  422. package/lib/components/FlowModeller/index.d.ts.map +0 -1
  423. package/lib/components/FlowModeller/index.js +0 -12
  424. package/lib/components/FlowModeller/index.js.map +0 -1
  425. package/lib/components/IconTile/IconTile.styles.d.ts +0 -7
  426. package/lib/components/IconTile/IconTile.styles.d.ts.map +0 -1
  427. package/lib/components/IconTile/IconTile.styles.js +0 -68
  428. package/lib/components/IconTile/IconTile.styles.js.map +0 -1
@@ -1,258 +0,0 @@
1
- export class DirectedGraph {
2
- nodes = {};
3
- connectors = {};
4
- // additional way to maintain related data - for cases where Graph is used for indirect purposes
5
- nodeData = {};
6
- connectorData = {};
7
- inConnectors = {}; // we are maintaining connector reference instead of id, to avoid iterations later on.
8
- prevNodesCount = {};
9
- outConnectors = {}; // we are maintaining connector reference instead of id, to avoid iterations later on
10
- nextNodesCount = {};
11
- nodeCount = 0;
12
- connectorsCount = 0;
13
- constructor(graphData = { nodes: [], connectors: [] }) {
14
- // Not necessary to clone, as this class never modifies any nodes
15
- graphData.nodes.forEach(item => this.addNode(item));
16
- // copy/clone, connectors properties 'fromNodeId' and 'toNodeId' values may get modified by this class
17
- graphData.connectors.forEach(item => {
18
- const data = item.data;
19
- const newItem = JSON.parse(JSON.stringify(item));
20
- // below statement is necessary to retain the actual references of any function/instances if any
21
- newItem.data = data;
22
- this.addConnector(newItem);
23
- });
24
- }
25
- getGraphData() {
26
- return {
27
- nodes: this.getNodes(),
28
- connectors: this.getConnectors()
29
- };
30
- }
31
- getNodeCount() {
32
- return this.nodeCount;
33
- }
34
- getNodes() {
35
- return Object.values(this.nodes);
36
- }
37
- addNode(node, data) {
38
- if (this.nodes[node.id] !== undefined) {
39
- this.nodes[node.id] = node;
40
- this.nodeData[node.id] = data;
41
- }
42
- else {
43
- this.nodes[node.id] = node;
44
- this.nodeData[node.id] = data;
45
- this.inConnectors[node.id] = {};
46
- this.prevNodesCount[node.id] = {};
47
- this.outConnectors[node.id] = {};
48
- this.nextNodesCount[node.id] = {};
49
- this.nodeCount += 1;
50
- }
51
- return this;
52
- }
53
- getNode(nodeId) {
54
- return this.nodes[nodeId];
55
- }
56
- hasNode(nodeId) {
57
- return this.nodes[nodeId] !== undefined;
58
- }
59
- deleteNode(nodeId, ignoreConnectors = false) {
60
- if (this.hasNode(nodeId)) {
61
- delete this.nodes[nodeId];
62
- delete this.nodeData[nodeId];
63
- if (ignoreConnectors !== true) {
64
- const removeConnector = (id) => this.removeConnector(id);
65
- // IMP NOTE its the responsibility of the callee to make sure that the connectors are cleanly reassigned, or else all attached connectors will be deleted
66
- Object.keys(this.inConnectors[nodeId]).forEach(removeConnector);
67
- delete this.inConnectors[nodeId];
68
- delete this.prevNodesCount[nodeId];
69
- Object.keys(this.outConnectors[nodeId]).forEach(removeConnector);
70
- delete this.outConnectors[nodeId];
71
- delete this.nextNodesCount[nodeId];
72
- }
73
- this.nodeCount += 1;
74
- }
75
- return this;
76
- }
77
- getPrevNodes(nodeId) {
78
- return this.prevNodesCount[nodeId]
79
- ? Object.keys(this.prevNodesCount[nodeId]).map(id => this.getNode(id))
80
- : [];
81
- }
82
- getNextNodes(nodeId) {
83
- return this.nextNodesCount[nodeId]
84
- ? Object.keys(this.nextNodesCount[nodeId]).map(id => this.getNode(id))
85
- : [];
86
- }
87
- getPrevNodesCount(nodeId) {
88
- return (this.prevNodesCount[nodeId] ? Object.values(this.prevNodesCount[nodeId]) : []).reduce((prev, current) => prev + current, 0);
89
- }
90
- getNextNodesCount(nodeId) {
91
- return (this.nextNodesCount[nodeId] ? Object.values(this.nextNodesCount[nodeId]) : []).reduce((prev, current) => prev + current, 0);
92
- }
93
- isLeaf(nodeId) {
94
- return this.getNextNodes(nodeId).length === 0;
95
- }
96
- // -- Connectors
97
- getConnectorsCount() {
98
- return this.connectorsCount;
99
- }
100
- getConnectors() {
101
- return Object.values(this.connectors);
102
- }
103
- addConnector(connector, data) {
104
- if (this.connectors[connector.id] !== undefined) {
105
- // update the map
106
- this.connectors[connector.id] = connector;
107
- this.connectorData[connector.id] = data;
108
- return this;
109
- }
110
- const id = connector.id;
111
- const fromNodeId = connector.fromNodeId;
112
- const toNodeId = connector.toNodeId;
113
- // check if nodes with given ids exist
114
- if (this.nodes[fromNodeId] === undefined || this.nodes[toNodeId] === undefined) {
115
- throw new Error(`One or more nodes does not exist, cannot add connector ${fromNodeId}-${toNodeId}`);
116
- }
117
- // add it to the map
118
- this.connectors[id] = connector;
119
- this.connectorData[id] = data;
120
- // update prev nodes count
121
- if (this.prevNodesCount[toNodeId][fromNodeId]) {
122
- this.prevNodesCount[toNodeId][fromNodeId] += 1;
123
- }
124
- else {
125
- this.prevNodesCount[toNodeId][fromNodeId] = 1;
126
- }
127
- // update next nodes count
128
- if (this.nextNodesCount[fromNodeId][toNodeId]) {
129
- this.nextNodesCount[fromNodeId][toNodeId] += 1;
130
- }
131
- else {
132
- this.nextNodesCount[fromNodeId][toNodeId] = 1;
133
- }
134
- // update in and out connectors for both the nodes
135
- this.inConnectors[toNodeId][id] = connector;
136
- this.outConnectors[fromNodeId][id] = connector;
137
- // increment total connectors count
138
- this.connectorsCount += 1;
139
- return this;
140
- }
141
- hasConnector(id) {
142
- return this.connectors[id] !== undefined;
143
- }
144
- getConnector(id) {
145
- return this.connectors[id];
146
- }
147
- removeConnector(id) {
148
- const connector = this.connectors[id];
149
- if (connector !== undefined) {
150
- const fromNodeId = connector.fromNodeId;
151
- const toNodeId = connector.toNodeId;
152
- delete this.connectors[id];
153
- delete this.connectorData[id];
154
- // update prev nodes count
155
- this.prevNodesCount[toNodeId][fromNodeId] -= 1;
156
- if (this.prevNodesCount[toNodeId][fromNodeId] === 0) {
157
- delete this.prevNodesCount[toNodeId][fromNodeId];
158
- }
159
- // update next nodes count
160
- this.nextNodesCount[fromNodeId][toNodeId] -= 1;
161
- if (this.nextNodesCount[fromNodeId][toNodeId] === 0) {
162
- delete this.nextNodesCount[fromNodeId][toNodeId];
163
- }
164
- delete this.inConnectors[toNodeId][id];
165
- delete this.outConnectors[fromNodeId][id];
166
- this.connectorsCount -= 1;
167
- }
168
- return this;
169
- }
170
- setConnector(id, data) {
171
- // VALIDATE
172
- // -connector with given id exists
173
- // -node with given fromNodeId exists
174
- // -node with given toNodeId exists
175
- if (!this.getConnector(id)) {
176
- throw new Error(`Connector with id '${id}' does not exist.`);
177
- }
178
- if (data.fromNodeId && !this.getNode(data.fromNodeId)) {
179
- throw new Error(`Node with id '${data.fromNodeId}' does not exist, to update fromNodeId.`);
180
- }
181
- if (data.toNodeId && !this.getNode(data.toNodeId)) {
182
- throw new Error(`Node with id '${data.toNodeId}' does not exist, to update toNodeId.`);
183
- }
184
- const connector = this.getConnector(id);
185
- // current references
186
- let fromNodeId = connector.fromNodeId;
187
- let toNodeId = connector.toNodeId;
188
- // update prev nodes count - unset prev values
189
- this.prevNodesCount[toNodeId][fromNodeId] -= 1;
190
- if (this.prevNodesCount[toNodeId][fromNodeId] === 0) {
191
- delete this.prevNodesCount[toNodeId][fromNodeId];
192
- }
193
- // update next nodes count - unset prev values
194
- this.nextNodesCount[fromNodeId][toNodeId] -= 1;
195
- if (this.nextNodesCount[fromNodeId][toNodeId] === 0) {
196
- delete this.nextNodesCount[fromNodeId][toNodeId];
197
- }
198
- // remove prev references
199
- delete this.inConnectors[toNodeId][id];
200
- delete this.outConnectors[fromNodeId][id];
201
- // new references
202
- fromNodeId = data.fromNodeId ? data.fromNodeId : connector.fromNodeId;
203
- toNodeId = data.toNodeId ? data.toNodeId : connector.toNodeId;
204
- connector.fromNodeId = fromNodeId;
205
- connector.toNodeId = toNodeId;
206
- // update prev nodes count
207
- if (this.prevNodesCount[toNodeId][fromNodeId]) {
208
- this.prevNodesCount[toNodeId][fromNodeId] += 1;
209
- }
210
- else {
211
- this.prevNodesCount[toNodeId][fromNodeId] = 1;
212
- }
213
- // update next nodes count
214
- if (this.nextNodesCount[fromNodeId][toNodeId]) {
215
- this.nextNodesCount[fromNodeId][toNodeId] += 1;
216
- }
217
- else {
218
- this.nextNodesCount[fromNodeId][toNodeId] = 1;
219
- }
220
- // update in and out connectors for both the nodes
221
- this.inConnectors[toNodeId][id] = connector;
222
- this.outConnectors[fromNodeId][id] = connector;
223
- return this;
224
- }
225
- getInConnectors(toNodeId, fromNodeId) {
226
- const allInConnectors = this.inConnectors[toNodeId];
227
- if (allInConnectors) {
228
- const connectorValues = Object.values(allInConnectors);
229
- if (fromNodeId === undefined) {
230
- return connectorValues;
231
- }
232
- return connectorValues.filter(connector => {
233
- return connector.fromNodeId === fromNodeId;
234
- });
235
- }
236
- return [];
237
- }
238
- getOutConnectors(fromNodeId, toNodeId) {
239
- const allOutConnectors = this.outConnectors[fromNodeId];
240
- if (allOutConnectors) {
241
- const connectorValues = Object.values(allOutConnectors);
242
- if (toNodeId === undefined) {
243
- return connectorValues;
244
- }
245
- return connectorValues.filter(connector => {
246
- return connector.toNodeId === toNodeId;
247
- });
248
- }
249
- return [];
250
- }
251
- getAllNodeConnectors(nodeId) {
252
- const inConnectors = this.getInConnectors(nodeId);
253
- if (inConnectors) {
254
- return inConnectors.concat(this.getOutConnectors(nodeId));
255
- }
256
- }
257
- }
258
- //# sourceMappingURL=Graph.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Graph.js","sourceRoot":"","sources":["../../../../../src/components/FlowModeller/Renderer/Utils/Graph.ts"],"names":[],"mappings":"AAsBA,MAAM,OAAO,aAAa;IAMhB,KAAK,GAAsB,EAAE,CAAC;IAC9B,UAAU,GAAsB,EAAE,CAAC;IAE3C,gGAAgG;IACxF,QAAQ,GAAiC,EAAE,CAAC;IAC5C,aAAa,GAAiC,EAAE,CAAC;IAEjD,YAAY,GAAsC,EAAE,CAAC,CAAC,sFAAsF;IAC5I,cAAc,GAA2C,EAAE,CAAC;IAE5D,aAAa,GAAsC,EAAE,CAAC,CAAC,qFAAqF;IAC5I,cAAc,GAA2C,EAAE,CAAC;IAE5D,SAAS,GAAG,CAAC,CAAC;IACd,eAAe,GAAG,CAAC,CAAC;IAE5B,YAAY,YAA6B,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;QACpE,iEAAiE;QACjE,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACpD,sGAAsG;QACtG,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAClC,MAAM,IAAI,GAAG,IAAI,CAAC,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,CAAC,EAAE;gBACxC,OAAO,SAAS,CAAC,UAAU,KAAK,UAAU,CAAC;YAC7C,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,gBAAgB,CAAC,UAAkB,EAAE,QAAiB;QACpD,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAExD,IAAI,gBAAgB,EAAE,CAAC;YACrB,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAExD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC3B,OAAO,eAAe,CAAC;YACzB,CAAC;YAED,OAAO,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;gBACxC,OAAO,SAAS,CAAC,QAAQ,KAAK,QAAQ,CAAC;YACzC,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,oBAAoB,CAAC,MAAc;QACjC,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAElD,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;CACF","sourcesContent":["export interface ConnectorProps<T = unknown> {\n id: string;\n fromNodeId: string;\n toNodeId: string;\n label?: string;\n data?: T;\n}\nexport interface NodeType {\n minConnectors: number;\n}\nexport interface Node<T = unknown> {\n type?: NodeType;\n id: string;\n data?: T;\n reference?: string;\n}\n\nexport interface GraphData<T extends Node = Node, U extends ConnectorProps = ConnectorProps> {\n nodes: T[];\n connectors: U[];\n}\n\nexport class DirectedGraph<\n T extends Node = Node,\n U extends ConnectorProps = ConnectorProps,\n D1 = unknown,\n D2 = unknown\n> {\n private nodes: Record<string, T> = {};\n private connectors: Record<string, U> = {};\n\n // additional way to maintain related data - for cases where Graph is used for indirect purposes\n private nodeData: Record<string, D1 | unknown> = {};\n private connectorData: Record<string, D2 | unknown> = {};\n\n private inConnectors: Record<string, Record<string, U>> = {}; // we are maintaining connector reference instead of id, to avoid iterations later on.\n private prevNodesCount: Record<string, Record<string, number>> = {};\n\n private outConnectors: Record<string, Record<string, U>> = {}; // we are maintaining connector reference instead of id, to avoid iterations later on\n private nextNodesCount: Record<string, Record<string, number>> = {};\n\n private nodeCount = 0;\n private connectorsCount = 0;\n\n constructor(graphData: GraphData<T, U> = { nodes: [], connectors: [] }) {\n // Not necessary to clone, as this class never modifies any nodes\n graphData.nodes.forEach(item => this.addNode(item));\n // copy/clone, connectors properties 'fromNodeId' and 'toNodeId' values may get modified by this class\n graphData.connectors.forEach(item => {\n const data = item.data;\n const newItem = JSON.parse(JSON.stringify(item));\n\n // below statement is necessary to retain the actual references of any function/instances if any\n newItem.data = data;\n\n this.addConnector(newItem);\n });\n }\n\n getGraphData(): GraphData<T, U> {\n return {\n nodes: this.getNodes(),\n connectors: this.getConnectors()\n };\n }\n\n getNodeCount(): number {\n return this.nodeCount;\n }\n\n getNodes() {\n return Object.values(this.nodes);\n }\n\n addNode(node: T, data?: D1): DirectedGraph {\n if (this.nodes[node.id] !== undefined) {\n this.nodes[node.id] = node;\n this.nodeData[node.id] = data;\n } else {\n this.nodes[node.id] = node;\n this.nodeData[node.id] = data;\n\n this.inConnectors[node.id] = {};\n this.prevNodesCount[node.id] = {};\n\n this.outConnectors[node.id] = {};\n this.nextNodesCount[node.id] = {};\n\n this.nodeCount += 1;\n }\n\n return this;\n }\n\n getNode(nodeId: string): T {\n return this.nodes[nodeId];\n }\n\n hasNode(nodeId: string): boolean {\n return this.nodes[nodeId] !== undefined;\n }\n\n deleteNode(nodeId: string, ignoreConnectors = false): DirectedGraph<T, U> {\n if (this.hasNode(nodeId)) {\n delete this.nodes[nodeId];\n delete this.nodeData[nodeId];\n\n if (ignoreConnectors !== true) {\n const removeConnector = (id: string) => this.removeConnector(id);\n\n // IMP NOTE its the responsibility of the callee to make sure that the connectors are cleanly reassigned, or else all attached connectors will be deleted\n\n Object.keys(this.inConnectors[nodeId]).forEach(removeConnector);\n delete this.inConnectors[nodeId];\n delete this.prevNodesCount[nodeId];\n\n Object.keys(this.outConnectors[nodeId]).forEach(removeConnector);\n delete this.outConnectors[nodeId];\n delete this.nextNodesCount[nodeId];\n }\n\n this.nodeCount += 1;\n }\n\n return this;\n }\n\n getPrevNodes(nodeId: string): T[] {\n return this.prevNodesCount[nodeId]\n ? Object.keys(this.prevNodesCount[nodeId]).map(id => this.getNode(id))\n : [];\n }\n\n getNextNodes(nodeId: string): T[] {\n return this.nextNodesCount[nodeId]\n ? Object.keys(this.nextNodesCount[nodeId]).map(id => this.getNode(id))\n : [];\n }\n\n getPrevNodesCount(nodeId: string): number {\n return (this.prevNodesCount[nodeId] ? Object.values(this.prevNodesCount[nodeId]) : []).reduce(\n (prev, current) => prev + current,\n 0\n );\n }\n\n getNextNodesCount(nodeId: string): number {\n return (this.nextNodesCount[nodeId] ? Object.values(this.nextNodesCount[nodeId]) : []).reduce(\n (prev, current) => prev + current,\n 0\n );\n }\n\n isLeaf(nodeId: string): boolean {\n return this.getNextNodes(nodeId).length === 0;\n }\n\n // -- Connectors\n getConnectorsCount(): number {\n return this.connectorsCount;\n }\n\n getConnectors() {\n return Object.values(this.connectors);\n }\n\n addConnector(connector: U, data?: D2): DirectedGraph<T, U> {\n if (this.connectors[connector.id] !== undefined) {\n // update the map\n this.connectors[connector.id] = connector;\n this.connectorData[connector.id] = data;\n\n return this;\n }\n\n const id = connector.id;\n const fromNodeId = connector.fromNodeId;\n const toNodeId = connector.toNodeId;\n\n // check if nodes with given ids exist\n if (this.nodes[fromNodeId] === undefined || this.nodes[toNodeId] === undefined) {\n throw new Error(\n `One or more nodes does not exist, cannot add connector ${fromNodeId}-${toNodeId}`\n );\n }\n\n // add it to the map\n this.connectors[id] = connector;\n this.connectorData[id] = data;\n\n // update prev nodes count\n if (this.prevNodesCount[toNodeId][fromNodeId]) {\n this.prevNodesCount[toNodeId][fromNodeId] += 1;\n } else {\n this.prevNodesCount[toNodeId][fromNodeId] = 1;\n }\n\n // update next nodes count\n if (this.nextNodesCount[fromNodeId][toNodeId]) {\n this.nextNodesCount[fromNodeId][toNodeId] += 1;\n } else {\n this.nextNodesCount[fromNodeId][toNodeId] = 1;\n }\n\n // update in and out connectors for both the nodes\n this.inConnectors[toNodeId][id] = connector;\n this.outConnectors[fromNodeId][id] = connector;\n\n // increment total connectors count\n this.connectorsCount += 1;\n\n return this;\n }\n\n hasConnector(id: string): boolean {\n return this.connectors[id] !== undefined;\n }\n\n getConnector(id: string): U {\n return this.connectors[id];\n }\n\n removeConnector(id: string): DirectedGraph<T, U> {\n const connector = this.connectors[id];\n\n if (connector !== undefined) {\n const fromNodeId = connector.fromNodeId;\n const toNodeId = connector.toNodeId;\n\n delete this.connectors[id];\n delete this.connectorData[id];\n\n // update prev nodes count\n this.prevNodesCount[toNodeId][fromNodeId] -= 1;\n if (this.prevNodesCount[toNodeId][fromNodeId] === 0) {\n delete this.prevNodesCount[toNodeId][fromNodeId];\n }\n\n // update next nodes count\n this.nextNodesCount[fromNodeId][toNodeId] -= 1;\n if (this.nextNodesCount[fromNodeId][toNodeId] === 0) {\n delete this.nextNodesCount[fromNodeId][toNodeId];\n }\n\n delete this.inConnectors[toNodeId][id];\n delete this.outConnectors[fromNodeId][id];\n\n this.connectorsCount -= 1;\n }\n\n return this;\n }\n\n setConnector(id: string, data: { fromNodeId?: string; toNodeId?: string }): DirectedGraph<T, U> {\n // VALIDATE\n // -connector with given id exists\n // -node with given fromNodeId exists\n // -node with given toNodeId exists\n if (!this.getConnector(id)) {\n throw new Error(`Connector with id '${id}' does not exist.`);\n }\n if (data.fromNodeId && !this.getNode(data.fromNodeId)) {\n throw new Error(`Node with id '${data.fromNodeId}' does not exist, to update fromNodeId.`);\n }\n if (data.toNodeId && !this.getNode(data.toNodeId)) {\n throw new Error(`Node with id '${data.toNodeId}' does not exist, to update toNodeId.`);\n }\n\n const connector = this.getConnector(id);\n\n // current references\n let fromNodeId = connector.fromNodeId;\n let toNodeId = connector.toNodeId;\n\n // update prev nodes count - unset prev values\n this.prevNodesCount[toNodeId][fromNodeId] -= 1;\n if (this.prevNodesCount[toNodeId][fromNodeId] === 0) {\n delete this.prevNodesCount[toNodeId][fromNodeId];\n }\n\n // update next nodes count - unset prev values\n this.nextNodesCount[fromNodeId][toNodeId] -= 1;\n if (this.nextNodesCount[fromNodeId][toNodeId] === 0) {\n delete this.nextNodesCount[fromNodeId][toNodeId];\n }\n\n // remove prev references\n delete this.inConnectors[toNodeId][id];\n delete this.outConnectors[fromNodeId][id];\n\n // new references\n fromNodeId = data.fromNodeId ? data.fromNodeId : connector.fromNodeId;\n toNodeId = data.toNodeId ? data.toNodeId : connector.toNodeId;\n\n connector.fromNodeId = fromNodeId;\n connector.toNodeId = toNodeId;\n\n // update prev nodes count\n if (this.prevNodesCount[toNodeId][fromNodeId]) {\n this.prevNodesCount[toNodeId][fromNodeId] += 1;\n } else {\n this.prevNodesCount[toNodeId][fromNodeId] = 1;\n }\n\n // update next nodes count\n if (this.nextNodesCount[fromNodeId][toNodeId]) {\n this.nextNodesCount[fromNodeId][toNodeId] += 1;\n } else {\n this.nextNodesCount[fromNodeId][toNodeId] = 1;\n }\n\n // update in and out connectors for both the nodes\n this.inConnectors[toNodeId][id] = connector;\n this.outConnectors[fromNodeId][id] = connector;\n\n return this;\n }\n\n getInConnectors(toNodeId: string, fromNodeId?: string): U[] {\n const allInConnectors = this.inConnectors[toNodeId];\n\n if (allInConnectors) {\n const connectorValues = Object.values(allInConnectors);\n\n if (fromNodeId === undefined) {\n return connectorValues;\n }\n\n return connectorValues.filter(connector => {\n return connector.fromNodeId === fromNodeId;\n });\n }\n\n return [];\n }\n\n getOutConnectors(fromNodeId: string, toNodeId?: string): U[] {\n const allOutConnectors = this.outConnectors[fromNodeId];\n\n if (allOutConnectors) {\n const connectorValues = Object.values(allOutConnectors);\n\n if (toNodeId === undefined) {\n return connectorValues;\n }\n\n return connectorValues.filter(connector => {\n return connector.toNodeId === toNodeId;\n });\n }\n\n return [];\n }\n\n getAllNodeConnectors(nodeId: string) {\n const inConnectors = this.getInConnectors(nodeId);\n\n if (inConnectors) {\n return inConnectors.concat(this.getOutConnectors(nodeId));\n }\n }\n}\n"]}
@@ -1,36 +0,0 @@
1
- import type { ConnectorProps, GraphData, Node } from './Graph';
2
- export interface PlottedGraphNode<T = any> extends Node<T> {
3
- dimensions: {
4
- width: number;
5
- height: number;
6
- };
7
- position: {
8
- x: number;
9
- y: number;
10
- };
11
- referencedNode?: T;
12
- }
13
- export interface PlottedGraphConnector<T = any> extends ConnectorProps<T> {
14
- points: {
15
- x: number;
16
- y: number;
17
- }[];
18
- labelLayout?: {
19
- value: any;
20
- width: number;
21
- height: number;
22
- x: number;
23
- y: number;
24
- };
25
- }
26
- export declare enum GraphLayoutDirection {
27
- LeftToRight = "LR",
28
- TopToBottom = "TB"
29
- }
30
- export default class GraphLayout {
31
- static plot<T extends GraphData<PlottedGraphNode, PlottedGraphConnector>>(graphData: T, readOnly?: boolean, direction?: GraphLayoutDirection): {
32
- width: number;
33
- height: number;
34
- };
35
- }
36
- //# sourceMappingURL=GraphLayout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GraphLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/FlowModeller/Renderer/Utils/GraphLayout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/D,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,IAAI,CAAC,CAAC,CAAC;IACxD,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,QAAQ,EAAE;QACR,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;IACF,cAAc,CAAC,EAAE,CAAC,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IACvE,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnC,WAAW,CAAC,EAAE;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACH;AAED,oBAAY,oBAAoB;IAC9B,WAAW,OAAO;IAClB,WAAW,OAAO;CACnB;AAKD,MAAM,CAAC,OAAO,OAAO,WAAW;IAE9B,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,SAAS,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,EACtE,SAAS,EAAE,CAAC,EACZ,QAAQ,GAAE,OAAe,EACzB,SAAS,GAAE,oBAAuD;;;;CAyIrE"}
@@ -1,120 +0,0 @@
1
- import dagre from 'dagre';
2
- export var GraphLayoutDirection;
3
- (function (GraphLayoutDirection) {
4
- GraphLayoutDirection["LeftToRight"] = "LR";
5
- GraphLayoutDirection["TopToBottom"] = "TB";
6
- })(GraphLayoutDirection || (GraphLayoutDirection = {}));
7
- const DEFAULT_GRAPH_WIDTH = 2000;
8
- const DEFAULT_GRAPH_HEIGHT = 2000;
9
- export default class GraphLayout {
10
- // Using Dagre layouting
11
- static plot(graphData, readOnly = false, direction = GraphLayoutDirection.TopToBottom) {
12
- const dagreGraph = new dagre.graphlib.Graph({ multigraph: true });
13
- dagreGraph.setDefaultEdgeLabel(() => ({}));
14
- const defaultNodeWidth = 280;
15
- const defaultNodeHeight = 112;
16
- dagreGraph.setGraph({
17
- rankdir: direction,
18
- ranksep: readOnly ? 2 : 4,
19
- edgesep: defaultNodeWidth / 2,
20
- nodesep: 20,
21
- // cspell:disable-next-line
22
- marginx: 200,
23
- // cspell:disable-next-line
24
- marginy: 32
25
- });
26
- graphData.nodes.forEach(node => {
27
- const height = node.dimensions.height === 0 ? 0 : node.dimensions.height || defaultNodeHeight;
28
- const width = node.dimensions.width === 0 ? 0 : node.dimensions.width || defaultNodeWidth;
29
- dagreGraph.setNode(node.id, {
30
- width,
31
- height
32
- });
33
- });
34
- graphData.connectors.forEach((con, index) => {
35
- dagreGraph.setEdge(con.fromNodeId, con.toNodeId, {
36
- weight: 1,
37
- minlen: 2,
38
- label: con.data?.label || '',
39
- width: 250,
40
- height: con.data?.label ? 90 : 40,
41
- // cspell:disable-next-line
42
- lablepos: 'c',
43
- labeloffset: 0
44
- }, index.toString());
45
- });
46
- dagre.layout(dagreGraph, {});
47
- graphData.nodes.forEach(el => {
48
- const node = dagreGraph.node(el.id);
49
- el.position.x = node.x - el.dimensions.width / 2;
50
- el.position.y = node.y - el.dimensions.height / 2;
51
- });
52
- graphData.connectors.forEach((con, index) => {
53
- const edge = dagreGraph.edge(con.fromNodeId, con.toNodeId, index.toString());
54
- con.labelLayout = {
55
- value: edge.label,
56
- x: edge.x,
57
- y: edge.y,
58
- width: edge.width,
59
- height: edge.height
60
- };
61
- const lastIndex = edge.points.length - 1;
62
- let firstPoint = edge.points[0];
63
- const secondPoint = edge.points[1];
64
- let lastPoint = edge.points[lastIndex];
65
- const secondLastPoint = edge.points[lastIndex - 1];
66
- const fromNode = dagreGraph.node(con.fromNodeId);
67
- const toNode = dagreGraph.node(con.toNodeId);
68
- firstPoint =
69
- firstPoint.x !== secondPoint.x
70
- ? {
71
- ...edge.points[0],
72
- x: fromNode.x,
73
- y: edge.points[1].y
74
- }
75
- : firstPoint;
76
- lastPoint =
77
- lastPoint.x !== secondLastPoint.x
78
- ? {
79
- ...edge.points[lastIndex],
80
- x: toNode.x,
81
- y: edge.points[lastIndex - 1].y
82
- }
83
- : lastPoint;
84
- con.points = [
85
- { x: fromNode.x, y: fromNode.y + fromNode.height / 2 },
86
- { ...firstPoint, y: firstPoint.y + 10 },
87
- { ...secondPoint, y: secondPoint.y + 10 },
88
- ...edge.points.slice(2, lastIndex),
89
- lastPoint
90
- ];
91
- // Only add the last point incase the edge has an arc at end
92
- if (edge.points[lastIndex].x !== edge.points[lastIndex - 1].x) {
93
- con.points.push({ x: toNode.x, y: toNode.y });
94
- }
95
- // if current edge source node is an placeholder node move down the starting point of placeholder node by 12
96
- if (fromNode.height === 0) {
97
- con.points[0].y += 12;
98
- }
99
- const edgeLastPointIndex = con.points.length - 1;
100
- // Move the merging arcs last point to the starting point of placeholder node
101
- if (con.points[edgeLastPointIndex].x === con.points[edgeLastPointIndex - 1].x &&
102
- toNode.height === 0) {
103
- con.points[edgeLastPointIndex].y += 12;
104
- }
105
- });
106
- const width = dagreGraph.graph().width;
107
- const height = dagreGraph.graph().height;
108
- if (width !== undefined && height !== undefined) {
109
- return {
110
- width: Number.isFinite(width) ? width : DEFAULT_GRAPH_WIDTH,
111
- height: Number.isFinite(height) ? height : DEFAULT_GRAPH_HEIGHT
112
- };
113
- }
114
- return {
115
- width: DEFAULT_GRAPH_WIDTH,
116
- height: DEFAULT_GRAPH_HEIGHT
117
- };
118
- }
119
- }
120
- //# sourceMappingURL=GraphLayout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GraphLayout.js","sourceRoot":"","sources":["../../../../../src/components/FlowModeller/Renderer/Utils/GraphLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA2B1B,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,0CAAkB,CAAA;IAClB,0CAAkB,CAAA;AACpB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B;AAED,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACjC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,WAAW;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U,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC;QACvC,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;QAEzC,IAAI,KAAK,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAChD,OAAO;gBACL,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,mBAAmB;gBAC3D,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAoB;aAChE,CAAC;QACJ,CAAC;QAED,OAAO;YACL,KAAK,EAAE,mBAAmB;YAC1B,MAAM,EAAE,oBAAoB;SAC7B,CAAC;IACJ,CAAC;CACF","sourcesContent":["import dagre from 'dagre';\n\nimport type { ConnectorProps, GraphData, Node } from './Graph';\n\nexport interface PlottedGraphNode<T = any> extends Node<T> {\n dimensions: {\n width: number;\n height: number;\n };\n position: {\n x: number;\n y: number;\n };\n referencedNode?: T;\n}\n\nexport interface PlottedGraphConnector<T = any> extends ConnectorProps<T> {\n points: { x: number; y: number }[];\n labelLayout?: {\n value: any;\n width: number;\n height: number;\n x: number;\n y: number;\n };\n}\n\nexport enum GraphLayoutDirection {\n LeftToRight = 'LR',\n TopToBottom = 'TB'\n}\n\nconst DEFAULT_GRAPH_WIDTH = 2000;\nconst DEFAULT_GRAPH_HEIGHT = 2000;\n\nexport default class GraphLayout {\n // Using Dagre layouting\n static plot<T extends GraphData<PlottedGraphNode, PlottedGraphConnector>>(\n graphData: T,\n readOnly: boolean = false,\n direction: GraphLayoutDirection = GraphLayoutDirection.TopToBottom\n ) {\n const dagreGraph = new dagre.graphlib.Graph({ multigraph: true });\n\n dagreGraph.setDefaultEdgeLabel(() => ({}));\n\n const defaultNodeWidth = 280;\n const defaultNodeHeight = 112;\n\n dagreGraph.setGraph({\n rankdir: direction,\n ranksep: readOnly ? 2 : 4,\n edgesep: defaultNodeWidth / 2,\n nodesep: 20,\n // cspell:disable-next-line\n marginx: 200,\n // cspell:disable-next-line\n marginy: 32\n });\n\n graphData.nodes.forEach(node => {\n const height = node.dimensions.height === 0 ? 0 : node.dimensions.height || defaultNodeHeight;\n const width = node.dimensions.width === 0 ? 0 : node.dimensions.width || defaultNodeWidth;\n dagreGraph.setNode(node.id, {\n width,\n height\n });\n });\n\n graphData.connectors.forEach((con, index) => {\n dagreGraph.setEdge(\n con.fromNodeId,\n con.toNodeId,\n {\n weight: 1,\n minlen: 2,\n label: con.data?.label || '',\n width: 250,\n height: con.data?.label ? 90 : 40,\n // cspell:disable-next-line\n lablepos: 'c',\n labeloffset: 0\n },\n index.toString()\n );\n });\n\n dagre.layout(dagreGraph, {});\n\n graphData.nodes.forEach(el => {\n const node = dagreGraph.node(el.id);\n el.position.x = node.x - el.dimensions.width / 2;\n el.position.y = node.y - el.dimensions.height / 2;\n });\n\n graphData.connectors.forEach((con, index) => {\n const edge = dagreGraph.edge(con.fromNodeId, con.toNodeId, index.toString());\n\n con.labelLayout = {\n value: edge.label,\n x: edge.x,\n y: edge.y,\n width: edge.width,\n height: edge.height\n };\n\n const lastIndex = edge.points.length - 1;\n let firstPoint = edge.points[0];\n const secondPoint = edge.points[1];\n let lastPoint = edge.points[lastIndex];\n const secondLastPoint = edge.points[lastIndex - 1];\n\n const fromNode = dagreGraph.node(con.fromNodeId);\n const toNode = dagreGraph.node(con.toNodeId);\n\n firstPoint =\n firstPoint.x !== secondPoint.x\n ? {\n ...edge.points[0],\n x: fromNode.x,\n y: edge.points[1].y\n }\n : firstPoint;\n\n lastPoint =\n lastPoint.x !== secondLastPoint.x\n ? {\n ...edge.points[lastIndex],\n x: toNode.x,\n y: edge.points[lastIndex - 1].y\n }\n : lastPoint;\n\n con.points = [\n { x: fromNode.x, y: fromNode.y + fromNode.height / 2 },\n { ...firstPoint, y: firstPoint.y + 10 },\n { ...secondPoint, y: secondPoint.y + 10 },\n ...edge.points.slice(2, lastIndex),\n lastPoint\n ];\n\n // Only add the last point incase the edge has an arc at end\n if (edge.points[lastIndex].x !== edge.points[lastIndex - 1].x) {\n con.points.push({ x: toNode.x, y: toNode.y });\n }\n\n // if current edge source node is an placeholder node move down the starting point of placeholder node by 12\n if (fromNode.height === 0) {\n con.points[0].y += 12;\n }\n\n const edgeLastPointIndex = con.points.length - 1;\n\n // Move the merging arcs last point to the starting point of placeholder node\n if (\n con.points[edgeLastPointIndex].x === con.points[edgeLastPointIndex - 1].x &&\n toNode.height === 0\n ) {\n con.points[edgeLastPointIndex].y += 12;\n }\n });\n\n const width = dagreGraph.graph().width;\n const height = dagreGraph.graph().height;\n\n if (width !== undefined && height !== undefined) {\n return {\n width: Number.isFinite(width) ? width : DEFAULT_GRAPH_WIDTH,\n height: Number.isFinite(height) ? height : DEFAULT_GRAPH_HEIGHT\n };\n }\n\n return {\n width: DEFAULT_GRAPH_WIDTH,\n height: DEFAULT_GRAPH_HEIGHT\n };\n }\n}\n"]}
@@ -1,28 +0,0 @@
1
- import { DirectedGraph } from './Graph';
2
- import type { ConnectorProps, GraphData, Node } from './Graph';
3
- export interface NestedArray<T> extends Array<T | NestedArray<T>> {
4
- }
5
- export interface ConvergenceData<T extends Node, U extends ConnectorProps> {
6
- nodeId: string;
7
- connectors: NestedArray<string>;
8
- summary: {
9
- nodesinvolved: Record<string, T>;
10
- connectorsInvolved: Record<string, U>;
11
- };
12
- paths?: NestedArray<ConvergenceData<T, U>>;
13
- }
14
- export default class GraphTraversal {
15
- static bfs(gd: GraphData, src?: string): string[];
16
- static dfs(gd: GraphData, src?: string): string[];
17
- static findRootNode(graph: DirectedGraph): string | false;
18
- /**
19
- * Given the graphData and the source node with morethan one branch, It calculates the convergence node, involved connectors and paths
20
- * Assuming, goTo is not supported
21
- *
22
- * @param gd graphData to process on
23
- * @param src id of the source node. This needs to be a node with multiple branches
24
- * @returns id of the destination node or null if not found
25
- */
26
- static getConvergenceData<T extends Node = Node, U extends ConnectorProps = ConnectorProps>(gd: GraphData<T, U>, src: string): ConvergenceData<T, U> | false;
27
- }
28
- //# sourceMappingURL=GraphTraversal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GraphTraversal.d.ts","sourceRoot":"","sources":["../../../../../src/components/FlowModeller/Renderer/Utils/GraphTraversal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/D,MAAM,WAAW,WAAW,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;CAAG;AAEpE,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,SAAS,cAAc;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,EAAE;QACP,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACjC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;KACvC,CAAC;IACF,KAAK,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAC5C;AAED,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;IAqCjD,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;IAyCjD,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,GAAG,KAAK;IAYzD;;;;;;;OAOG;IAEH,MAAM,CAAC,kBAAkB,CAAC,CAAC,SAAS,IAAI,G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