@pega/cosmos-react-build 8.0.0-build.9.1 → 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.
- package/lib/components/AppShell/AppShell.styles.d.ts +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +1 -46
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.d.ts +2 -3
- package/lib/components/AppShell/Header/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.js +4 -4
- package/lib/components/AppShell/Header/AppHeader.js.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.styles.d.ts +2 -2
- package/lib/components/AppShell/Header/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/BackgroundPicker/BackgroundPicker.d.ts +6 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.js +82 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.js.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts +15 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.styles.js +152 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.styles.js.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts +5 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js +30 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts +98 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.types.js +29 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.types.js.map +1 -0
- package/lib/components/BackgroundPicker/GradientConfig.d.ts +6 -0
- package/lib/components/BackgroundPicker/GradientConfig.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/GradientConfig.js +149 -0
- package/lib/components/BackgroundPicker/GradientConfig.js.map +1 -0
- package/lib/components/BackgroundPicker/ImageConfig.d.ts +6 -0
- package/lib/components/BackgroundPicker/ImageConfig.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/ImageConfig.js +64 -0
- package/lib/components/BackgroundPicker/ImageConfig.js.map +1 -0
- package/lib/components/BackgroundPicker/SolidColorConfig.d.ts +6 -0
- package/lib/components/BackgroundPicker/SolidColorConfig.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/SolidColorConfig.js +24 -0
- package/lib/components/BackgroundPicker/SolidColorConfig.js.map +1 -0
- package/lib/components/BackgroundPicker/index.d.ts +3 -0
- package/lib/components/BackgroundPicker/index.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/index.js +2 -0
- package/lib/components/BackgroundPicker/index.js.map +1 -0
- package/lib/components/BackgroundPicker/utils.d.ts +24 -0
- package/lib/components/BackgroundPicker/utils.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/utils.js +186 -0
- package/lib/components/BackgroundPicker/utils.js.map +1 -0
- package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +2 -3
- package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
- package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
- package/lib/components/DynamicInput/BooleanControl.d.ts +3 -5
- package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -1
- package/lib/components/DynamicInput/BooleanControl.js.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.d.ts +1 -2
- package/lib/components/DynamicInput/DynamicInput.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.js +33 -33
- package/lib/components/DynamicInput/DynamicInput.js.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.styles.d.ts +2 -2
- package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.styles.js +1 -0
- package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.types.d.ts +61 -11
- package/lib/components/DynamicInput/DynamicInput.types.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.types.js.map +1 -1
- package/lib/components/Expression/Expression.d.ts +6 -0
- package/lib/components/Expression/Expression.d.ts.map +1 -0
- package/lib/components/Expression/Expression.js +36 -0
- package/lib/components/Expression/Expression.js.map +1 -0
- package/lib/components/Expression/Expression.styles.d.ts +7 -0
- package/lib/components/Expression/Expression.styles.d.ts.map +1 -0
- package/lib/components/Expression/Expression.styles.js +47 -0
- package/lib/components/Expression/Expression.styles.js.map +1 -0
- package/lib/components/Expression/Expression.test-ids.d.ts +2 -0
- package/lib/components/Expression/Expression.test-ids.d.ts.map +1 -0
- package/lib/components/Expression/Expression.test-ids.js +8 -0
- package/lib/components/Expression/Expression.test-ids.js.map +1 -0
- package/lib/components/Expression/Expression.types.d.ts +53 -0
- package/lib/components/Expression/Expression.types.d.ts.map +1 -0
- package/lib/components/Expression/Expression.types.js +2 -0
- package/lib/components/Expression/Expression.types.js.map +1 -0
- package/lib/components/Expression/index.d.ts +3 -0
- package/lib/components/Expression/index.d.ts.map +1 -0
- package/lib/components/Expression/index.js +2 -0
- package/lib/components/Expression/index.js.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +7 -5
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +393 -76
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +9 -2
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +100 -26
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts +2 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js +6 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +32 -6
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts +3 -0
- package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js +34 -0
- package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js.map +1 -0
- package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +2 -3
- package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +3 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +2 -3
- package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionList.d.ts +2 -3
- package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -1
- package/lib/components/ExpressionBuilder/index.d.ts +1 -1
- package/lib/components/ExpressionBuilder/index.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/index.js.map +1 -1
- package/lib/components/FieldReference/FieldReference.styles.d.ts +1 -0
- package/lib/components/FieldReference/FieldReference.styles.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReference.styles.js +45 -37
- package/lib/components/FieldReference/FieldReference.styles.js.map +1 -1
- package/lib/components/FieldReference/FieldReference.test-ids.d.ts +1 -0
- package/lib/components/FieldReference/FieldReference.test-ids.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReference.test-ids.js +3 -0
- package/lib/components/FieldReference/FieldReference.test-ids.js.map +1 -1
- package/lib/components/FieldReference/FieldReference.types.d.ts +6 -1
- package/lib/components/FieldReference/FieldReference.types.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReference.types.js.map +1 -1
- package/lib/components/FieldReference/FieldReferenceDisplay.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReferenceDisplay.js +11 -7
- package/lib/components/FieldReference/FieldReferenceDisplay.js.map +1 -1
- package/lib/components/FieldReference/FieldReferenceInput.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReferenceInput.js +17 -11
- package/lib/components/FieldReference/FieldReferenceInput.js.map +1 -1
- package/lib/components/FieldReference/FieldReferenceMenuList.d.ts +5 -4
- package/lib/components/FieldReference/FieldReferenceMenuList.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReferenceMenuList.js +7 -5
- package/lib/components/FieldReference/FieldReferenceMenuList.js.map +1 -1
- package/lib/components/FieldReference/index.d.ts +2 -2
- package/lib/components/FieldReference/index.d.ts.map +1 -1
- package/lib/components/FieldReference/index.js +1 -1
- package/lib/components/FieldReference/index.js.map +1 -1
- package/lib/components/IconTile/IconTile.d.ts +7 -3
- package/lib/components/IconTile/IconTile.d.ts.map +1 -1
- package/lib/components/IconTile/IconTile.js +40 -4
- package/lib/components/IconTile/IconTile.js.map +1 -1
- package/lib/components/IconTile/IconTile.types.d.ts +17 -15
- package/lib/components/IconTile/IconTile.types.d.ts.map +1 -1
- package/lib/components/IconTile/IconTile.types.js.map +1 -1
- package/lib/components/IconTile/Tiles/Ai.d.ts +1 -1
- package/lib/components/IconTile/Tiles/Ai.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/Ai.js.map +1 -1
- package/lib/components/IconTile/Tiles/Automation.d.ts +1 -1
- package/lib/components/IconTile/Tiles/Automation.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/Automation.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationAppend.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationAppend.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationAppend.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationCall.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationCall.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationCall.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationForEach.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationForEach.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationForEach.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationReturn.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationReturn.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationReturn.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationSet.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationSet.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationSet.js.map +1 -1
- package/lib/components/IconTile/Tiles/Case.d.ts +1 -1
- package/lib/components/IconTile/Tiles/Case.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/Case.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseGoTo.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseGoTo.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseGoTo.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseProcess.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseProcess.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseProcess.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseSla.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseSla.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseSla.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseStage.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseStage.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseStage.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseWait.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseWait.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseWait.js.map +1 -1
- package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts +1 -1
- package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/LogicDecisionStep.js.map +1 -1
- package/lib/components/IconTile/Tiles/LogicFunction.d.ts +1 -1
- package/lib/components/IconTile/Tiles/LogicFunction.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/LogicFunction.js.map +1 -1
- package/lib/components/IconTile/Tiles/LogicValidation.d.ts +1 -1
- package/lib/components/IconTile/Tiles/LogicValidation.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/LogicValidation.js.map +1 -1
- package/lib/components/IconTile/Tiles/LogicWhen.d.ts +1 -1
- package/lib/components/IconTile/Tiles/LogicWhen.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/LogicWhen.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleAuthenticate.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleConfiguration.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleConnector.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleConnector.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleConnector.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleDataPage.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleDataPage.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleDataPage.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleField.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleField.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleField.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleInsight.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleInsight.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleInsight.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleLiveData.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleLiveData.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleLiveData.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleParagraph.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleParagraph.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleParagraph.js.map +1 -1
- package/lib/components/IconTile/Tiles/RulePermission.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RulePermission.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RulePermission.js.map +1 -1
- package/lib/components/IconTile/Tiles/RulePersona.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RulePersona.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RulePersona.js.map +1 -1
- package/lib/components/IconTile/Tiles/RulePortal.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RulePortal.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RulePortal.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleRecord.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleRecord.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleRecord.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleSystem.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleSystem.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleSystem.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleView.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleView.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleView.js.map +1 -1
- package/lib/components/IconTile/Tiles/Task.d.ts +1 -1
- package/lib/components/IconTile/Tiles/Task.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/Task.js.map +1 -1
- package/lib/components/IconTile/Tiles/TaskAction.d.ts +1 -1
- package/lib/components/IconTile/Tiles/TaskAction.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/TaskAction.js.map +1 -1
- package/lib/components/IconTile/iconUtils.d.ts +11 -0
- package/lib/components/IconTile/iconUtils.d.ts.map +1 -0
- package/lib/components/IconTile/iconUtils.js +41 -0
- package/lib/components/IconTile/iconUtils.js.map +1 -0
- package/lib/components/IconTile/index.d.ts +1 -0
- package/lib/components/IconTile/index.d.ts.map +1 -1
- package/lib/components/IconTile/index.js.map +1 -1
- package/lib/components/ItemLibrary/ItemLibrary.d.ts +10 -10
- package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
- package/lib/components/ItemLibrary/ItemLibrary.js +26 -18
- package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
- package/lib/components/LifeCycle/Category.d.ts +8 -6
- package/lib/components/LifeCycle/Category.d.ts.map +1 -1
- package/lib/components/LifeCycle/Category.js +53 -36
- package/lib/components/LifeCycle/Category.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.d.ts +8 -4
- package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.js +113 -19
- package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts +6 -0
- package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts.map +1 -0
- package/lib/components/LifeCycle/LifeCycle.test-ids.js +10 -0
- package/lib/components/LifeCycle/LifeCycle.test-ids.js.map +1 -0
- package/lib/components/LifeCycle/LifeCycle.types.d.ts +713 -58
- package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.types.js +71 -61
- package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycleContext.d.ts +16 -4
- package/lib/components/LifeCycle/LifeCycleContext.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycleContext.js +7 -1
- package/lib/components/LifeCycle/LifeCycleContext.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts +21 -0
- package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts.map +1 -0
- package/lib/components/LifeCycle/LifeCycleDragDropList.js +298 -0
- package/lib/components/LifeCycle/LifeCycleDragDropList.js.map +1 -0
- package/lib/components/LifeCycle/LifeCycleList.d.ts +8 -6
- package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycleList.js +20 -30
- package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
- package/lib/components/LifeCycle/Stage.d.ts +12 -7
- package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
- package/lib/components/LifeCycle/Stage.js +87 -72
- package/lib/components/LifeCycle/Stage.js.map +1 -1
- package/lib/components/LifeCycle/Step.d.ts +21 -14
- package/lib/components/LifeCycle/Step.d.ts.map +1 -1
- package/lib/components/LifeCycle/Step.js +75 -51
- package/lib/components/LifeCycle/Step.js.map +1 -1
- package/lib/components/LifeCycle/Task.d.ts +18 -7
- package/lib/components/LifeCycle/Task.d.ts.map +1 -1
- package/lib/components/LifeCycle/Task.js +119 -55
- package/lib/components/LifeCycle/Task.js.map +1 -1
- package/lib/components/LifeCycle/index.d.ts +2 -1
- package/lib/components/LifeCycle/index.d.ts.map +1 -1
- package/lib/components/LifeCycle/index.js +1 -0
- package/lib/components/LifeCycle/index.js.map +1 -1
- package/lib/components/LifeCycle/utils.d.ts +14 -0
- package/lib/components/LifeCycle/utils.d.ts.map +1 -0
- package/lib/components/LifeCycle/utils.js +250 -0
- package/lib/components/LifeCycle/utils.js.map +1 -0
- package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +2 -3
- package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -1
- package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -1
- package/lib/components/ObjectSelect/ObjectPicker.d.ts +2 -2
- package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -1
- package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
- package/lib/components/PageTemplates/GalleryPage.d.ts +2 -2
- package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +5 -5
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/PageTemplates/ShowcasePage.d.ts +2 -2
- package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -1
- package/lib/components/PageTemplates/ShowcasePage.js.map +1 -1
- package/lib/components/RuleSelect/RuleSelect.js +3 -3
- package/lib/components/RuleSelect/RuleSelect.js.map +1 -1
- package/lib/components/Workbench/Workbench.d.ts +2 -3
- package/lib/components/Workbench/Workbench.d.ts.map +1 -1
- package/lib/components/Workbench/Workbench.js.map +1 -1
- package/lib/components/Workbench/Workbench.styles.d.ts +2 -2
- package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/lib/{components/FieldReference → utils}/typeIconMapping.d.ts +8 -0
- package/lib/utils/typeIconMapping.d.ts.map +1 -0
- package/lib/{components/FieldReference → utils}/typeIconMapping.js +15 -3
- package/lib/utils/typeIconMapping.js.map +1 -0
- package/package.json +16 -14
- package/lib/components/FieldReference/typeIconMapping.d.ts.map +0 -1
- package/lib/components/FieldReference/typeIconMapping.js.map +0 -1
- package/lib/components/FlowModeller/AddNode.d.ts +0 -18
- package/lib/components/FlowModeller/AddNode.d.ts.map +0 -1
- package/lib/components/FlowModeller/AddNode.js +0 -86
- package/lib/components/FlowModeller/AddNode.js.map +0 -1
- package/lib/components/FlowModeller/Connector.d.ts +0 -6
- package/lib/components/FlowModeller/Connector.d.ts.map +0 -1
- package/lib/components/FlowModeller/Connector.js +0 -69
- package/lib/components/FlowModeller/Connector.js.map +0 -1
- package/lib/components/FlowModeller/DeletePopover.d.ts +0 -19
- package/lib/components/FlowModeller/DeletePopover.d.ts.map +0 -1
- package/lib/components/FlowModeller/DeletePopover.js +0 -136
- package/lib/components/FlowModeller/DeletePopover.js.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.d.ts +0 -5
- package/lib/components/FlowModeller/FlowModeller.d.ts.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.js +0 -317
- package/lib/components/FlowModeller/FlowModeller.js.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.types.d.ts +0 -27
- package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.types.js +0 -2
- package/lib/components/FlowModeller/FlowModeller.types.js.map +0 -1
- package/lib/components/FlowModeller/FlowModellerContext.d.ts +0 -10
- package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +0 -1
- package/lib/components/FlowModeller/FlowModellerContext.js +0 -8
- package/lib/components/FlowModeller/FlowModellerContext.js.map +0 -1
- package/lib/components/FlowModeller/Node/Node.types.d.ts +0 -75
- package/lib/components/FlowModeller/Node/Node.types.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node/Node.types.js +0 -27
- package/lib/components/FlowModeller/Node/Node.types.js.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +0 -20
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +0 -151
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +0 -6
- package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplates.js +0 -69
- package/lib/components/FlowModeller/Node/NodeTemplates.js.map +0 -1
- package/lib/components/FlowModeller/Node.d.ts +0 -5
- package/lib/components/FlowModeller/Node.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node.js +0 -22
- package/lib/components/FlowModeller/Node.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.d.ts +0 -5
- package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.js +0 -48
- package/lib/components/FlowModeller/Renderer/Renderer.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +0 -18
- package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.types.js +0 -2
- package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +0 -59
- package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/Graph.js +0 -258
- package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +0 -36
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +0 -120
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +0 -28
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +0 -172
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +0 -1
- package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +0 -18
- package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +0 -1
- package/lib/components/FlowModeller/Utils/addNodeUtils.js +0 -141
- package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +0 -1
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +0 -30
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +0 -1
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +0 -81
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +0 -1
- package/lib/components/FlowModeller/helper.d.ts +0 -39
- package/lib/components/FlowModeller/helper.d.ts.map +0 -1
- package/lib/components/FlowModeller/helper.js +0 -198
- package/lib/components/FlowModeller/helper.js.map +0 -1
- package/lib/components/FlowModeller/index.d.ts +0 -20
- package/lib/components/FlowModeller/index.d.ts.map +0 -1
- package/lib/components/FlowModeller/index.js +0 -12
- package/lib/components/FlowModeller/index.js.map +0 -1
- package/lib/components/IconTile/IconTile.styles.d.ts +0 -7
- package/lib/components/IconTile/IconTile.styles.d.ts.map +0 -1
- package/lib/components/IconTile/IconTile.styles.js +0 -68
- package/lib/components/IconTile/IconTile.styles.js.map +0 -1
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { DirectedGraph } from './Graph';
|
|
2
|
-
export default class GraphTraversal {
|
|
3
|
-
static bfs(gd, src) {
|
|
4
|
-
const graph = new DirectedGraph(gd);
|
|
5
|
-
if (!src) {
|
|
6
|
-
const rootNodeId = GraphTraversal.findRootNode(graph);
|
|
7
|
-
if (!rootNodeId) {
|
|
8
|
-
throw Error('Invalid graph, cannot find root node.');
|
|
9
|
-
}
|
|
10
|
-
src = rootNodeId;
|
|
11
|
-
}
|
|
12
|
-
const queue = [src];
|
|
13
|
-
const result = [];
|
|
14
|
-
const map = {
|
|
15
|
-
src
|
|
16
|
-
}; // needed for duplicate comparision
|
|
17
|
-
while (queue.length > 0) {
|
|
18
|
-
const source = queue.shift();
|
|
19
|
-
if (source !== undefined) {
|
|
20
|
-
result.push(source);
|
|
21
|
-
const nextNodes = graph.getNextNodes(source);
|
|
22
|
-
nextNodes.forEach((node) => {
|
|
23
|
-
if (!map[node.id]) {
|
|
24
|
-
queue.push(node.id);
|
|
25
|
-
map[node.id] = node.id;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
static dfs(gd, src) {
|
|
33
|
-
const graph = new DirectedGraph(gd);
|
|
34
|
-
// finding the start node automatically
|
|
35
|
-
if (!src) {
|
|
36
|
-
const rootNodeId = GraphTraversal.findRootNode(graph);
|
|
37
|
-
if (!rootNodeId) {
|
|
38
|
-
throw Error('Invalid graph, cannot find root node.');
|
|
39
|
-
}
|
|
40
|
-
src = rootNodeId;
|
|
41
|
-
}
|
|
42
|
-
const stack = [src];
|
|
43
|
-
const result = [];
|
|
44
|
-
const map = {
|
|
45
|
-
src
|
|
46
|
-
}; // needed for duplicate comparision
|
|
47
|
-
while (stack.length > 0) {
|
|
48
|
-
const source = stack.pop();
|
|
49
|
-
if (source !== undefined) {
|
|
50
|
-
result.push(source);
|
|
51
|
-
const nextNodes = graph.getNextNodes(source);
|
|
52
|
-
nextNodes.forEach(node => {
|
|
53
|
-
if (map[node.id] === undefined) {
|
|
54
|
-
stack.push(node.id);
|
|
55
|
-
map[node.id] = node.id;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return result;
|
|
61
|
-
}
|
|
62
|
-
// Assuming the given graph has no unconnected nodes and the graph is not cyclic(if start node have in-connectors(ie., cyclic), this will fail).
|
|
63
|
-
// - returns first encountered node with no in-connectors as a rootnode, if more than one exists
|
|
64
|
-
static findRootNode(graph) {
|
|
65
|
-
const nodes = graph.getNodes();
|
|
66
|
-
for (let i = 0; i < nodes.length; i += 1) {
|
|
67
|
-
if (graph.getPrevNodesCount(nodes[i].id) === 0) {
|
|
68
|
-
return nodes[i].id;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Given the graphData and the source node with morethan one branch, It calculates the convergence node, involved connectors and paths
|
|
75
|
-
* Assuming, goTo is not supported
|
|
76
|
-
*
|
|
77
|
-
* @param gd graphData to process on
|
|
78
|
-
* @param src id of the source node. This needs to be a node with multiple branches
|
|
79
|
-
* @returns id of the destination node or null if not found
|
|
80
|
-
*/
|
|
81
|
-
// TODO-OPTIMIZE Memoize, for a given GraphData
|
|
82
|
-
static getConvergenceData(gd, src) {
|
|
83
|
-
const graph = new DirectedGraph(gd);
|
|
84
|
-
// return false, if there is no node with given source node id
|
|
85
|
-
if (graph.getNode(src) === undefined || graph.getNextNodesCount(src) < 2) {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
// traverse the nodes -- and record the paths of each connector
|
|
89
|
-
const path = []; // array of path-arrays
|
|
90
|
-
const initialConnectors = graph.getOutConnectors(src);
|
|
91
|
-
// iterate the initial set of connectors
|
|
92
|
-
initialConnectors.forEach((item, index) => {
|
|
93
|
-
path[index] = [];
|
|
94
|
-
let currentConnector = item;
|
|
95
|
-
// traverse through each connector and push the encountered nodes
|
|
96
|
-
while (currentConnector && currentConnector.toNodeId !== undefined) {
|
|
97
|
-
path[index].push({
|
|
98
|
-
nodeId: currentConnector.toNodeId,
|
|
99
|
-
connectors: [currentConnector.id],
|
|
100
|
-
summary: {
|
|
101
|
-
nodesinvolved: {
|
|
102
|
-
[currentConnector.toNodeId]: graph.getNode(currentConnector.toNodeId)
|
|
103
|
-
},
|
|
104
|
-
connectorsInvolved: { [currentConnector.id]: currentConnector }
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
const inConnectors = graph.getInConnectors(currentConnector.toNodeId);
|
|
108
|
-
// if this node has multiple in connectors, that means this is a join [IMP TODO NOTE until we support goTo option]
|
|
109
|
-
if (inConnectors.length > 1) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
let outConnectors = graph.getOutConnectors(currentConnector.toNodeId);
|
|
113
|
-
let newCurrentNodeId = currentConnector.toNodeId;
|
|
114
|
-
// check if this node has multiple branches and call recursively
|
|
115
|
-
while (outConnectors.length > 1) {
|
|
116
|
-
const result = GraphTraversal.getConvergenceData(gd, newCurrentNodeId);
|
|
117
|
-
// handle resultNodeId val as false use case: just cancel futher processing and return false
|
|
118
|
-
if (result === false) {
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
|
-
// add result node to the path
|
|
122
|
-
path[index].push(result);
|
|
123
|
-
// handle, resultNode as destination shape of alternate connector too
|
|
124
|
-
const tempInConnectors = graph.getInConnectors(result.nodeId);
|
|
125
|
-
// if this node has multiple in connectors and more than expected count, that means this is a join [IMP TODO NOTE until we support goTo option]
|
|
126
|
-
if (tempInConnectors.length > outConnectors.length) {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
// handle, resultNode as decision shape
|
|
130
|
-
outConnectors = graph.getOutConnectors(result.nodeId);
|
|
131
|
-
newCurrentNodeId = result.nodeId;
|
|
132
|
-
}
|
|
133
|
-
// else if out connectors is 1
|
|
134
|
-
currentConnector = outConnectors[0];
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
// validate and return false if no convergence node found
|
|
138
|
-
for (let i = 1; i < path.length; i += 1) {
|
|
139
|
-
if (path[i][path[i].length - 1].nodeId !== path[i - 1][path[i - 1].length - 1].nodeId) {
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
const result = {
|
|
144
|
-
nodeId: path[0][path[0].length - 1].nodeId,
|
|
145
|
-
connectors: [],
|
|
146
|
-
paths: [],
|
|
147
|
-
summary: {
|
|
148
|
-
nodesinvolved: {},
|
|
149
|
-
connectorsInvolved: {}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
for (let i = 0; i < path.length; i += 1) {
|
|
153
|
-
const current = path[i];
|
|
154
|
-
result.connectors.push(current[current.length - 1].connectors);
|
|
155
|
-
if (result.paths !== undefined) {
|
|
156
|
-
result.paths[i] = current;
|
|
157
|
-
}
|
|
158
|
-
current.forEach(item => {
|
|
159
|
-
result.summary.nodesinvolved = {
|
|
160
|
-
...result.summary.nodesinvolved,
|
|
161
|
-
...item.summary.nodesinvolved
|
|
162
|
-
};
|
|
163
|
-
result.summary.connectorsInvolved = {
|
|
164
|
-
...result.summary.connectorsInvolved,
|
|
165
|
-
...item.summary.connectorsInvolved
|
|
166
|
-
};
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
return result;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
//# sourceMappingURL=GraphTraversal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GraphTraversal.js","sourceRoot":"","sources":["../../../../../src/components/FlowModeller/Renderer/Utils/GraphTraversal.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,IAAI,CAAC,EAAE;gBACrB,MAAM,CAAC,OAAO,CAAC,aAAa,GAAG;oBAC7B,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa;oBAC/B,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa;iBAC9B,CAAC;gBAEF,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG;oBAClC,GAAG,MAAM,CAAC,OAAO,CAAC,kBAAkB;oBACpC,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB;iBACnC,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import { DirectedGraph } from './Graph';\nimport type { ConnectorProps, GraphData, Node } from './Graph';\n\nexport interface NestedArray<T> extends Array<T | NestedArray<T>> {}\n\nexport interface ConvergenceData<T extends Node, U extends ConnectorProps> {\n nodeId: string;\n connectors: NestedArray<string>;\n summary: {\n nodesinvolved: Record<string, T>;\n connectorsInvolved: Record<string, U>;\n };\n paths?: NestedArray<ConvergenceData<T, U>>;\n}\n\nexport default class GraphTraversal {\n static bfs(gd: GraphData, src?: string): string[] {\n const graph = new DirectedGraph(gd);\n\n if (!src) {\n const rootNodeId = GraphTraversal.findRootNode(graph);\n\n if (!rootNodeId) {\n throw Error('Invalid graph, cannot find root node.');\n }\n\n src = rootNodeId;\n }\n\n const queue: string[] = [src];\n const result: string[] = [];\n const map: Record<string, string> = {\n src\n }; // needed for duplicate comparision\n\n while (queue.length > 0) {\n const source = queue.shift();\n if (source !== undefined) {\n result.push(source);\n\n const nextNodes = graph.getNextNodes(source);\n nextNodes.forEach((node: Node) => {\n if (!map[node.id]) {\n queue.push(node.id);\n map[node.id] = node.id;\n }\n });\n }\n }\n\n return result;\n }\n\n static dfs(gd: GraphData, src?: string): string[] {\n const graph = new DirectedGraph(gd);\n\n // finding the start node automatically\n if (!src) {\n const rootNodeId = GraphTraversal.findRootNode(graph);\n\n if (!rootNodeId) {\n throw Error('Invalid graph, cannot find root node.');\n }\n\n src = rootNodeId;\n }\n\n const stack: string[] = [src];\n const result: string[] = [];\n const map: Record<string, string> = {\n src\n }; // needed for duplicate comparision\n\n while (stack.length > 0) {\n const source = stack.pop();\n if (source !== undefined) {\n result.push(source);\n\n const nextNodes = graph.getNextNodes(source);\n\n nextNodes.forEach(node => {\n if (map[node.id] === undefined) {\n stack.push(node.id);\n map[node.id] = node.id;\n }\n });\n }\n }\n\n return result;\n }\n\n // Assuming the given graph has no unconnected nodes and the graph is not cyclic(if start node have in-connectors(ie., cyclic), this will fail).\n // - returns first encountered node with no in-connectors as a rootnode, if more than one exists\n static findRootNode(graph: DirectedGraph): string | false {\n const nodes = graph.getNodes();\n\n for (let i = 0; i < nodes.length; i += 1) {\n if (graph.getPrevNodesCount(nodes[i].id) === 0) {\n return nodes[i].id;\n }\n }\n\n return false;\n }\n\n /**\n * Given the graphData and the source node with morethan one branch, It calculates the convergence node, involved connectors and paths\n * Assuming, goTo is not supported\n *\n * @param gd graphData to process on\n * @param src id of the source node. This needs to be a node with multiple branches\n * @returns id of the destination node or null if not found\n */\n // TODO-OPTIMIZE Memoize, for a given GraphData\n static getConvergenceData<T extends Node = Node, U extends ConnectorProps = ConnectorProps>(\n gd: GraphData<T, U>,\n src: string\n ): ConvergenceData<T, U> | false {\n const graph = new DirectedGraph<T, U>(gd);\n\n // return false, if there is no node with given source node id\n if (graph.getNode(src) === undefined || graph.getNextNodesCount(src) < 2) {\n return false;\n }\n\n // traverse the nodes -- and record the paths of each connector\n const path: ConvergenceData<T, U>[][] = []; // array of path-arrays\n const initialConnectors = graph.getOutConnectors(src);\n\n // iterate the initial set of connectors\n initialConnectors.forEach((item, index) => {\n path[index] = [];\n\n let currentConnector = item;\n // traverse through each connector and push the encountered nodes\n while (currentConnector && currentConnector.toNodeId !== undefined) {\n path[index].push({\n nodeId: currentConnector.toNodeId,\n connectors: [currentConnector.id],\n summary: {\n nodesinvolved: {\n [currentConnector.toNodeId]: graph.getNode(currentConnector.toNodeId)\n },\n connectorsInvolved: { [currentConnector.id]: currentConnector }\n }\n });\n\n const inConnectors = graph.getInConnectors(currentConnector.toNodeId);\n // if this node has multiple in connectors, that means this is a join [IMP TODO NOTE until we support goTo option]\n if (inConnectors.length > 1) {\n return;\n }\n\n let outConnectors = graph.getOutConnectors(currentConnector.toNodeId);\n\n let newCurrentNodeId = currentConnector.toNodeId;\n // check if this node has multiple branches and call recursively\n while (outConnectors.length > 1) {\n const result = GraphTraversal.getConvergenceData(gd, newCurrentNodeId);\n\n // handle resultNodeId val as false use case: just cancel futher processing and return false\n if (result === false) {\n return false;\n }\n\n // add result node to the path\n path[index].push(result);\n\n // handle, resultNode as destination shape of alternate connector too\n const tempInConnectors = graph.getInConnectors(result.nodeId);\n // if this node has multiple in connectors and more than expected count, that means this is a join [IMP TODO NOTE until we support goTo option]\n if (tempInConnectors.length > outConnectors.length) {\n return;\n }\n\n // handle, resultNode as decision shape\n outConnectors = graph.getOutConnectors(result.nodeId);\n newCurrentNodeId = result.nodeId;\n }\n\n // else if out connectors is 1\n currentConnector = outConnectors[0];\n }\n });\n\n // validate and return false if no convergence node found\n for (let i = 1; i < path.length; i += 1) {\n if (path[i][path[i].length - 1].nodeId !== path[i - 1][path[i - 1].length - 1].nodeId) {\n return false;\n }\n }\n\n const result: ConvergenceData<T, U> = {\n nodeId: path[0][path[0].length - 1].nodeId,\n connectors: [],\n paths: [],\n summary: {\n nodesinvolved: {},\n connectorsInvolved: {}\n }\n };\n\n for (let i = 0; i < path.length; i += 1) {\n const current = path[i];\n result.connectors.push(current[current.length - 1].connectors);\n\n if (result.paths !== undefined) {\n result.paths[i] = current;\n }\n\n current.forEach(item => {\n result.summary.nodesinvolved = {\n ...result.summary.nodesinvolved,\n ...item.summary.nodesinvolved\n };\n\n result.summary.connectorsInvolved = {\n ...result.summary.connectorsInvolved,\n ...item.summary.connectorsInvolved\n };\n });\n }\n\n return result;\n }\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { AddNodeHandlerParams } from '../Renderer/Renderer.types';
|
|
2
|
-
import { DirectedGraph } from '../Renderer/Utils/Graph';
|
|
3
|
-
import type { ConnectorProps, GraphData, Node } from '../Renderer/Utils/Graph';
|
|
4
|
-
import type { PlottedGraphNode, PlottedGraphConnector } from '../Renderer/Utils/GraphLayout';
|
|
5
|
-
export interface PlaceHolderNode extends PlottedGraphNode {
|
|
6
|
-
realConnectors: string[];
|
|
7
|
-
}
|
|
8
|
-
export interface PlaceHolderConnector extends PlottedGraphConnector {
|
|
9
|
-
realConnectors: string[];
|
|
10
|
-
}
|
|
11
|
-
export declare const isPlaceHolderNode: (node: PlaceHolderNode | Node) => node is PlaceHolderNode;
|
|
12
|
-
export declare const isPlaceHolderConnector: (connector: PlaceHolderConnector | ConnectorProps) => connector is PlaceHolderConnector;
|
|
13
|
-
declare const PlaceHolderHelper: {
|
|
14
|
-
insertAtConnectorsMerge: (graph: DirectedGraph, getNewPHNodeCB: (addNodeMeta: AddNodeHandlerParams) => PlottedGraphNode, getNewPHConnectorCB: (fromNode: string, toNode: string, addNodeMeta: AddNodeHandlerParams) => PlottedGraphConnector) => void;
|
|
15
|
-
injectPlaceholderNodes: (graphData: GraphData<PlottedGraphNode, PlottedGraphConnector>, onGetNewNode: (metaData: AddNodeHandlerParams) => PlottedGraphNode, onGetNewConnector: (fromNodeId: string, toNodeId: string, metaData: AddNodeHandlerParams) => PlottedGraphConnector) => GraphData<PlottedGraphNode<any>, PlottedGraphConnector<any>>;
|
|
16
|
-
};
|
|
17
|
-
export default PlaceHolderHelper;
|
|
18
|
-
//# sourceMappingURL=addNodeUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addNodeUtils.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Utils/addNodeUtils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAI7F,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AACD,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB;IACjE,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAGD,eAAO,MAAM,iBAAiB,SAAU,eAAe,GAAG,IAAI,KAAG,IAAI,IAAI,eAExE,CAAC;AAGF,eAAO,MAAM,sBAAsB,cACtB,oBAAoB,GAAG,cAAc,KAC/C,SAAS,IAAI,oBAEf,CAAC;AAwBF,QAAA,MAAM,iBAAiB;qCAEZ,aAAa,kBACJ,CAAC,WAAW,EAAE,oBAAoB,KAAK,gBAAgB,uBAClD,CACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,oBAAoB,KAC9B,qBAAqB;wCAyEf,SAAS,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,gBAC/C,CAAC,QAAQ,EAAE,oBAAoB,KAAK,gBAAgB,qBAC/C,CACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,oBAAoB,KAC3B,qBAAqB;CA8D7B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { DirectedGraph } from '../Renderer/Utils/Graph';
|
|
2
|
-
import GraphTraversal from '../Renderer/Utils/GraphTraversal';
|
|
3
|
-
// type-guard PlaceHolderNode
|
|
4
|
-
export const isPlaceHolderNode = (node) => {
|
|
5
|
-
return node.realConnectors !== undefined;
|
|
6
|
-
};
|
|
7
|
-
// type-guard PlaceHolderConnector
|
|
8
|
-
export const isPlaceHolderConnector = (connector) => {
|
|
9
|
-
return connector.realConnectors !== undefined;
|
|
10
|
-
};
|
|
11
|
-
const countInvisibleConnectors = (graph, connectors) => {
|
|
12
|
-
let invisibleConnectorsCount = 0;
|
|
13
|
-
for (let i = 0; i < connectors.length; i += 1) {
|
|
14
|
-
if (Array.isArray(connectors[i]))
|
|
15
|
-
invisibleConnectorsCount += countInvisibleConnectors(graph, connectors[i]);
|
|
16
|
-
else {
|
|
17
|
-
const connectorData = graph.getConnector(connectors[i]);
|
|
18
|
-
const fromNode = graph.getNode(connectorData.fromNodeId);
|
|
19
|
-
if (fromNode?.type?.minConnectors === 0) {
|
|
20
|
-
invisibleConnectorsCount += 1;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return invisibleConnectorsCount;
|
|
25
|
-
};
|
|
26
|
-
const PlaceHolderHelper = {
|
|
27
|
-
insertAtConnectorsMerge: (graph, getNewPHNodeCB, getNewPHConnectorCB) => {
|
|
28
|
-
const gd = graph.getGraphData();
|
|
29
|
-
// process the graph and find the first node automatically. We can find it easily by iterating and finding the node with no in-connectors
|
|
30
|
-
const bfs = GraphTraversal.bfs(gd);
|
|
31
|
-
bfs.reverse().forEach(nodeId => {
|
|
32
|
-
const node = graph.getNode(nodeId);
|
|
33
|
-
// get the node's convergence data
|
|
34
|
-
const result = GraphTraversal.getConvergenceData(graph.getGraphData(), node.id);
|
|
35
|
-
// if node has more than one out-connector and has convergence data
|
|
36
|
-
if (result !== false) {
|
|
37
|
-
// iterate over the resultant connectors
|
|
38
|
-
for (let i = 0; i < result.connectors.length; i += 1) {
|
|
39
|
-
const connectorsToUpdate = result.connectors[i];
|
|
40
|
-
let invisibleConnectorsCount = 0;
|
|
41
|
-
/** Count number of invisible connectors originating from go to shapes forming a convergence/join
|
|
42
|
-
* compare invisible connectors count with connectors forming a convergence
|
|
43
|
-
*/
|
|
44
|
-
if (typeof connectorsToUpdate !== 'string' && connectorsToUpdate.length > 1) {
|
|
45
|
-
invisibleConnectorsCount = countInvisibleConnectors(graph, connectorsToUpdate);
|
|
46
|
-
// ensure connectors converging are greater than invisible connectors
|
|
47
|
-
if (connectorsToUpdate.length > invisibleConnectorsCount) {
|
|
48
|
-
let refConnectorIdsArray = [];
|
|
49
|
-
connectorsToUpdate.forEach(itrConId => {
|
|
50
|
-
let conId = itrConId;
|
|
51
|
-
if (Array.isArray(conId)) {
|
|
52
|
-
conId = itrConId[0];
|
|
53
|
-
}
|
|
54
|
-
const connector = graph.getConnector(conId);
|
|
55
|
-
if (isPlaceHolderConnector(connector)) {
|
|
56
|
-
refConnectorIdsArray = [...refConnectorIdsArray, ...connector.realConnectors];
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
refConnectorIdsArray.push(conId);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
const addNodeMeta = {
|
|
63
|
-
refType: 'connector',
|
|
64
|
-
refId: refConnectorIdsArray
|
|
65
|
-
};
|
|
66
|
-
const newNode = getNewPHNodeCB(addNodeMeta);
|
|
67
|
-
const newPNode = {
|
|
68
|
-
...newNode,
|
|
69
|
-
realConnectors: refConnectorIdsArray
|
|
70
|
-
};
|
|
71
|
-
graph.addNode(newPNode);
|
|
72
|
-
connectorsToUpdate.forEach(item => {
|
|
73
|
-
graph.setConnector(item, {
|
|
74
|
-
toNodeId: newNode.id
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
const newConnector = getNewPHConnectorCB(newNode.id, result.nodeId, addNodeMeta);
|
|
78
|
-
const newPConnector = {
|
|
79
|
-
...newConnector,
|
|
80
|
-
realConnectors: refConnectorIdsArray
|
|
81
|
-
};
|
|
82
|
-
graph.addConnector(newPConnector);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
},
|
|
89
|
-
injectPlaceholderNodes: (graphData, onGetNewNode, onGetNewConnector) => {
|
|
90
|
-
// gets GraphData<RendererNodeProps, RendererConnectorProps>
|
|
91
|
-
const targetGraph = new DirectedGraph(graphData);
|
|
92
|
-
// insert placeholder-nodes at connector convergence point for nodes with multiple out connectors.
|
|
93
|
-
PlaceHolderHelper.insertAtConnectorsMerge(targetGraph, onGetNewNode, onGetNewConnector);
|
|
94
|
-
// iterate all nodes with more than one in-connectors and insert addNode before current one.
|
|
95
|
-
targetGraph.getNodes().forEach(node => {
|
|
96
|
-
// should not add a node before a placeholder node
|
|
97
|
-
if (isPlaceHolderNode(node)) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
if (targetGraph.getPrevNodesCount(node.id) > 1) {
|
|
101
|
-
let refConnectorIdsArray = [];
|
|
102
|
-
// connect all in-connectors to a new node and create a new connector that connects from new node to the actual toNodeId.
|
|
103
|
-
targetGraph.getInConnectors(node.id).forEach(con => {
|
|
104
|
-
const connector = targetGraph.getConnector(con.id);
|
|
105
|
-
if (isPlaceHolderConnector(connector)) {
|
|
106
|
-
refConnectorIdsArray = [...refConnectorIdsArray, ...connector.realConnectors];
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
refConnectorIdsArray.push(con.id);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
const metaData = {
|
|
113
|
-
refType: 'connector',
|
|
114
|
-
refId: refConnectorIdsArray
|
|
115
|
-
};
|
|
116
|
-
// create a new placeholder node
|
|
117
|
-
const newNode = onGetNewNode(metaData);
|
|
118
|
-
const placeHolderNode = {
|
|
119
|
-
...newNode,
|
|
120
|
-
realConnectors: refConnectorIdsArray
|
|
121
|
-
};
|
|
122
|
-
targetGraph.addNode(placeHolderNode);
|
|
123
|
-
// connect all in-connectors to a new node and create a new connector that connects from new node to the actual toNodeId.
|
|
124
|
-
targetGraph.getInConnectors(node.id).forEach(con => {
|
|
125
|
-
targetGraph.setConnector(con.id, {
|
|
126
|
-
toNodeId: placeHolderNode.id
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
const newConnector = onGetNewConnector(placeHolderNode.id, node.id, metaData);
|
|
130
|
-
const placeholderConnector = {
|
|
131
|
-
...newConnector,
|
|
132
|
-
realConnectors: refConnectorIdsArray
|
|
133
|
-
};
|
|
134
|
-
targetGraph.addConnector(placeholderConnector);
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
return targetGraph.getGraphData();
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
export default PlaceHolderHelper;
|
|
141
|
-
//# sourceMappingURL=addNodeUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addNodeUtils.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Utils/addNodeUtils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAU9D,6BAA6B;AAC7B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAA4B,EAA2B,EAAE;IACzF,OAAQ,IAAwB,CAAC,cAAc,KAAK,SAAS,CAAC;AAChE,CAAC,CAAC;AAEF,kCAAkC;AAClC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,SAAgD,EACb,EAAE;IACrC,OAAQ,SAAkC,CAAC,cAAc,KAAK,SAAS,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,wBAAwB,GAAG,CAC/B,KAAoB,EACpB,UAA+B,EACvB,EAAE;IACV,IAAI,wBAAwB,GAAG,CAAC,CAAC;IACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC9B,wBAAwB,IAAI,wBAAwB,CAClD,KAAK,EACL,UAAU,CAAC,CAAC,CAAwB,CACrC,CAAC;aACC,CAAC;YACJ,MAAM,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC,UAAU,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EH,MAAM,QAAQ,GAAyB;oBACrC,OAAO,EAAE,WAAW;oBACpB,KAAK,EAAE,oBAAoB;iBAC5B,CAAC;gBAEF,gCAAgC;gBAChC,MAAM,OAAO,GACX,YAAY,CAAC,QAAQ,CAAC,CAAC;gBACzB,MAAM,eAAe,GAAoB;oBACvC,GAAG,OAAO;oBACV,cAAc,EAAE,oBAAoB;iBACrC,CAAC;gBAEF,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;gBAErC,yHAAyH;gBACzH,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;oBACjD,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,EAAE;wBAC/B,QAAQ,EAAE,eAAe,CAAC,EAAE;qBAC7B,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;gBAEH,MAAM,YAAY,GAAG,iBAAiB,CAAC,eAAe,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;gBAC9E,MAAM,oBAAoB,GAAyB;oBACjD,GAAG,YAAY;oBACf,cAAc,EAAE,oBAAoB;iBACrC,CAAC;gBAEF,WAAW,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;YACjD,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC,YAAY,EAAE,CAAC;IACpC,CAAC;CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport type { AddNodeProps } from '../AddNode';\nimport type { AddNodeHandlerParams } from '../Renderer/Renderer.types';\nimport { DirectedGraph } from '../Renderer/Utils/Graph';\nimport type { ConnectorProps, GraphData, Node } from '../Renderer/Utils/Graph';\nimport type { PlottedGraphNode, PlottedGraphConnector } from '../Renderer/Utils/GraphLayout';\nimport GraphTraversal from '../Renderer/Utils/GraphTraversal';\nimport type { NestedArray } from '../Renderer/Utils/GraphTraversal';\n\nexport interface PlaceHolderNode extends PlottedGraphNode {\n realConnectors: string[];\n}\nexport interface PlaceHolderConnector extends PlottedGraphConnector {\n realConnectors: string[];\n}\n\n// type-guard PlaceHolderNode\nexport const isPlaceHolderNode = (node: PlaceHolderNode | Node): node is PlaceHolderNode => {\n return (node as PlaceHolderNode).realConnectors !== undefined;\n};\n\n// type-guard PlaceHolderConnector\nexport const isPlaceHolderConnector = (\n connector: PlaceHolderConnector | ConnectorProps\n): connector is PlaceHolderConnector => {\n return (connector as PlaceHolderConnector).realConnectors !== undefined;\n};\n\nconst countInvisibleConnectors = (\n graph: DirectedGraph,\n connectors: NestedArray<string>\n): number => {\n let invisibleConnectorsCount = 0;\n for (let i = 0; i < connectors.length; i += 1) {\n if (Array.isArray(connectors[i]))\n invisibleConnectorsCount += countInvisibleConnectors(\n graph,\n connectors[i] as NestedArray<string>\n );\n else {\n const connectorData = graph.getConnector(connectors[i] as string);\n const fromNode = graph.getNode(connectorData.fromNodeId);\n if (fromNode?.type?.minConnectors === 0) {\n invisibleConnectorsCount += 1;\n }\n }\n }\n return invisibleConnectorsCount;\n};\n\nconst PlaceHolderHelper = {\n insertAtConnectorsMerge: (\n graph: DirectedGraph,\n getNewPHNodeCB: (addNodeMeta: AddNodeHandlerParams) => PlottedGraphNode,\n getNewPHConnectorCB: (\n fromNode: string,\n toNode: string,\n addNodeMeta: AddNodeHandlerParams\n ) => PlottedGraphConnector\n ) => {\n const gd = graph.getGraphData();\n\n // process the graph and find the first node automatically. We can find it easily by iterating and finding the node with no in-connectors\n const bfs = GraphTraversal.bfs(gd);\n bfs.reverse().forEach(nodeId => {\n const node = graph.getNode(nodeId);\n\n // get the node's convergence data\n const result = GraphTraversal.getConvergenceData(graph.getGraphData(), node.id);\n\n // if node has more than one out-connector and has convergence data\n if (result !== false) {\n // iterate over the resultant connectors\n for (let i = 0; i < result.connectors.length; i += 1) {\n const connectorsToUpdate = result.connectors[i];\n let invisibleConnectorsCount = 0;\n\n /** Count number of invisible connectors originating from go to shapes forming a convergence/join\n * compare invisible connectors count with connectors forming a convergence\n */\n if (typeof connectorsToUpdate !== 'string' && connectorsToUpdate.length > 1) {\n invisibleConnectorsCount = countInvisibleConnectors(graph, connectorsToUpdate);\n\n // ensure connectors converging are greater than invisible connectors\n if (connectorsToUpdate.length > invisibleConnectorsCount) {\n let refConnectorIdsArray: string[] = [];\n\n connectorsToUpdate.forEach(itrConId => {\n let conId = itrConId;\n if (Array.isArray(conId)) {\n conId = itrConId[0] as string;\n }\n\n const connector = graph.getConnector(conId);\n if (isPlaceHolderConnector(connector)) {\n refConnectorIdsArray = [...refConnectorIdsArray, ...connector.realConnectors];\n } else {\n refConnectorIdsArray.push(conId);\n }\n });\n\n const addNodeMeta: AddNodeHandlerParams = {\n refType: 'connector',\n refId: refConnectorIdsArray\n };\n const newNode = getNewPHNodeCB(addNodeMeta);\n const newPNode: PlaceHolderNode = {\n ...newNode,\n realConnectors: refConnectorIdsArray\n };\n graph.addNode(newPNode);\n\n connectorsToUpdate.forEach(item => {\n graph.setConnector(item as string, {\n toNodeId: newNode.id\n });\n });\n\n const newConnector = getNewPHConnectorCB(newNode.id, result.nodeId, addNodeMeta);\n const newPConnector: PlaceHolderConnector = {\n ...newConnector,\n realConnectors: refConnectorIdsArray\n };\n graph.addConnector(newPConnector);\n }\n }\n }\n }\n });\n },\n injectPlaceholderNodes: (\n graphData: GraphData<PlottedGraphNode, PlottedGraphConnector>,\n onGetNewNode: (metaData: AddNodeHandlerParams) => PlottedGraphNode,\n onGetNewConnector: (\n fromNodeId: string,\n toNodeId: string,\n metaData: AddNodeHandlerParams\n ) => PlottedGraphConnector\n ) => {\n // gets GraphData<RendererNodeProps, RendererConnectorProps>\n const targetGraph = new DirectedGraph(graphData);\n\n // insert placeholder-nodes at connector convergence point for nodes with multiple out connectors.\n PlaceHolderHelper.insertAtConnectorsMerge(targetGraph, onGetNewNode, onGetNewConnector);\n\n // iterate all nodes with more than one in-connectors and insert addNode before current one.\n targetGraph.getNodes().forEach(node => {\n // should not add a node before a placeholder node\n if (isPlaceHolderNode(node)) {\n return;\n }\n\n if (targetGraph.getPrevNodesCount(node.id) > 1) {\n let refConnectorIdsArray: string[] = [];\n\n // connect all in-connectors to a new node and create a new connector that connects from new node to the actual toNodeId.\n targetGraph.getInConnectors(node.id).forEach(con => {\n const connector = targetGraph.getConnector(con.id);\n if (isPlaceHolderConnector(connector)) {\n refConnectorIdsArray = [...refConnectorIdsArray, ...connector.realConnectors];\n } else {\n refConnectorIdsArray.push(con.id);\n }\n });\n\n const metaData: AddNodeHandlerParams = {\n refType: 'connector',\n refId: refConnectorIdsArray\n };\n\n // create a new placeholder node\n const newNode: OmitStrict<AddNodeProps, 'highlight' | 'addNodeHandler'> =\n onGetNewNode(metaData);\n const placeHolderNode: PlaceHolderNode = {\n ...newNode,\n realConnectors: refConnectorIdsArray\n };\n\n targetGraph.addNode(placeHolderNode);\n\n // connect all in-connectors to a new node and create a new connector that connects from new node to the actual toNodeId.\n targetGraph.getInConnectors(node.id).forEach(con => {\n targetGraph.setConnector(con.id, {\n toNodeId: placeHolderNode.id\n });\n });\n\n const newConnector = onGetNewConnector(placeHolderNode.id, node.id, metaData);\n const placeholderConnector: PlaceHolderConnector = {\n ...newConnector,\n realConnectors: refConnectorIdsArray\n };\n\n targetGraph.addConnector(placeholderConnector);\n }\n });\n\n return targetGraph.getGraphData();\n }\n};\n\nexport default PlaceHolderHelper;\n"]}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { NodeProps } from '../Node/Node.types';
|
|
2
|
-
import type { Node, ConnectorProps, DirectedGraph, GraphData } from '../Renderer/Utils/Graph';
|
|
3
|
-
export interface GraphDataAsMap {
|
|
4
|
-
nodes: Record<string, Node>;
|
|
5
|
-
connectors: Record<string, ConnectorProps>;
|
|
6
|
-
}
|
|
7
|
-
export interface DeleteNodeModalOption {
|
|
8
|
-
connector: ConnectorProps;
|
|
9
|
-
pathItems: GraphDataAsMap;
|
|
10
|
-
restItems: GraphDataAsMap;
|
|
11
|
-
}
|
|
12
|
-
export interface DeleteNodeModalResult {
|
|
13
|
-
options: DeleteNodeModalOption[];
|
|
14
|
-
selectedNodeId: string;
|
|
15
|
-
destinationNodeId?: string;
|
|
16
|
-
allItems: GraphDataAsMap;
|
|
17
|
-
}
|
|
18
|
-
export interface DeleteNodeOutcome {
|
|
19
|
-
graphData: GraphData<NodeProps, ConnectorProps>;
|
|
20
|
-
updates?: {
|
|
21
|
-
connectors: ConnectorProps[];
|
|
22
|
-
};
|
|
23
|
-
deletes: GraphDataAsMap;
|
|
24
|
-
error: boolean;
|
|
25
|
-
}
|
|
26
|
-
declare const deleteNodeUtils: {
|
|
27
|
-
getDeleteNodeOptions: (graph: DirectedGraph, nodeId: string) => DeleteNodeModalResult;
|
|
28
|
-
};
|
|
29
|
-
export default deleteNodeUtils;
|
|
30
|
-
//# sourceMappingURL=deleteNodeUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deleteNodeUtils.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Utils/deleteNodeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAI9F,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAChD,OAAO,CAAC,EAAE;QACR,UAAU,EAAE,cAAc,EAAE,CAAC;KAC9B,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,QAAA,MAAM,eAAe;kCACW,aAAa,UAAU,MAAM,KAAG,qBAAqB;CA0FpF,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import GraphTraversal from '../Renderer/Utils/GraphTraversal';
|
|
2
|
-
const deleteNodeUtils = {
|
|
3
|
-
getDeleteNodeOptions: (graph, nodeId) => {
|
|
4
|
-
const convergenceData = GraphTraversal.getConvergenceData(graph.getGraphData(), nodeId);
|
|
5
|
-
if (convergenceData && convergenceData.paths) {
|
|
6
|
-
const options = convergenceData.paths.map(path => {
|
|
7
|
-
if (Array.isArray(path) &&
|
|
8
|
-
!Array.isArray(path[0]) &&
|
|
9
|
-
typeof path[0].connectors[0] === 'string') {
|
|
10
|
-
let nodes = {};
|
|
11
|
-
let connectors = {};
|
|
12
|
-
// rest of the overall items
|
|
13
|
-
const restItems = {
|
|
14
|
-
nodes: {
|
|
15
|
-
...convergenceData.summary.nodesinvolved
|
|
16
|
-
},
|
|
17
|
-
connectors: {
|
|
18
|
-
...convergenceData.summary.connectorsInvolved
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
path.forEach(item => {
|
|
22
|
-
if (!Array.isArray(item)) {
|
|
23
|
-
nodes = {
|
|
24
|
-
...nodes,
|
|
25
|
-
...item.summary.nodesinvolved
|
|
26
|
-
};
|
|
27
|
-
delete nodes[convergenceData.nodeId];
|
|
28
|
-
// remove the above nodes from the restItems
|
|
29
|
-
Object.keys(nodes).forEach(id => {
|
|
30
|
-
delete restItems.nodes[id];
|
|
31
|
-
});
|
|
32
|
-
connectors = {
|
|
33
|
-
...connectors,
|
|
34
|
-
...item.summary.connectorsInvolved
|
|
35
|
-
};
|
|
36
|
-
// remove the above connectors from the restItems
|
|
37
|
-
Object.keys(connectors).forEach(id => {
|
|
38
|
-
delete restItems.connectors[id];
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
// ignore the destination node
|
|
43
|
-
delete restItems.nodes[convergenceData.nodeId];
|
|
44
|
-
return {
|
|
45
|
-
connector: graph.getConnector(path[0].connectors[0]),
|
|
46
|
-
pathItems: {
|
|
47
|
-
nodes,
|
|
48
|
-
connectors
|
|
49
|
-
},
|
|
50
|
-
restItems
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
return [];
|
|
54
|
-
});
|
|
55
|
-
const result = {
|
|
56
|
-
options: options,
|
|
57
|
-
selectedNodeId: nodeId,
|
|
58
|
-
destinationNodeId: convergenceData.nodeId,
|
|
59
|
-
allItems: {
|
|
60
|
-
nodes: convergenceData.summary.nodesinvolved,
|
|
61
|
-
connectors: convergenceData.summary.connectorsInvolved
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
// ignore the destination node
|
|
65
|
-
if (result.allItems)
|
|
66
|
-
delete result.allItems.nodes[convergenceData.nodeId];
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
options: [],
|
|
71
|
-
selectedNodeId: nodeId,
|
|
72
|
-
destinationNodeId: undefined,
|
|
73
|
-
allItems: {
|
|
74
|
-
nodes: {},
|
|
75
|
-
connectors: {}
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
export default deleteNodeUtils;
|
|
81
|
-
//# sourceMappingURL=deleteNodeUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deleteNodeUtils.js","sourceRoot":"","sources":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AAiB,EAAE,SAAS;YAC5B,QAAQ,EAAE;gBACR,KAAK,EAAE,EAAE;gBACT,UAAU,EAAE,EAAE;aACf;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import type { NodeProps } from '../Node/Node.types';\nimport type { Node, ConnectorProps, DirectedGraph, GraphData } from '../Renderer/Utils/Graph';\nimport GraphTraversal from '../Renderer/Utils/GraphTraversal';\nimport type { ConvergenceData } from '../Renderer/Utils/GraphTraversal';\n\nexport interface GraphDataAsMap {\n nodes: Record<string, Node>;\n connectors: Record<string, ConnectorProps>;\n}\n\nexport interface DeleteNodeModalOption {\n connector: ConnectorProps;\n pathItems: GraphDataAsMap;\n restItems: GraphDataAsMap;\n}\n\nexport interface DeleteNodeModalResult {\n options: DeleteNodeModalOption[];\n selectedNodeId: string;\n destinationNodeId?: string;\n allItems: GraphDataAsMap;\n}\n\nexport interface DeleteNodeOutcome {\n graphData: GraphData<NodeProps, ConnectorProps>;\n updates?: {\n connectors: ConnectorProps[];\n };\n deletes: GraphDataAsMap;\n error: boolean;\n}\n\nconst deleteNodeUtils = {\n getDeleteNodeOptions: (graph: DirectedGraph, nodeId: string): DeleteNodeModalResult => {\n const convergenceData: ConvergenceData<Node, ConnectorProps> | false =\n GraphTraversal.getConvergenceData(graph.getGraphData(), nodeId);\n\n if (convergenceData && convergenceData.paths) {\n const options = convergenceData.paths.map(path => {\n if (\n Array.isArray(path) &&\n !Array.isArray(path[0]) &&\n typeof path[0].connectors[0] === 'string'\n ) {\n let nodes: GraphDataAsMap['nodes'] = {};\n let connectors: GraphDataAsMap['connectors'] = {};\n\n // rest of the overall items\n const restItems = {\n nodes: {\n ...convergenceData.summary.nodesinvolved\n },\n connectors: {\n ...convergenceData.summary.connectorsInvolved\n }\n };\n\n path.forEach(item => {\n if (!Array.isArray(item)) {\n nodes = {\n ...nodes,\n ...item.summary.nodesinvolved\n };\n\n delete nodes[convergenceData.nodeId];\n\n // remove the above nodes from the restItems\n Object.keys(nodes).forEach(id => {\n delete restItems.nodes[id];\n });\n\n connectors = {\n ...connectors,\n ...item.summary.connectorsInvolved\n };\n\n // remove the above connectors from the restItems\n Object.keys(connectors).forEach(id => {\n delete restItems.connectors[id];\n });\n }\n });\n\n // ignore the destination node\n delete restItems.nodes[convergenceData.nodeId];\n\n return {\n connector: graph.getConnector(path[0].connectors[0]),\n pathItems: {\n nodes,\n connectors\n },\n restItems\n };\n }\n return [];\n });\n\n const result: DeleteNodeModalResult = {\n options: options as DeleteNodeModalOption[],\n selectedNodeId: nodeId,\n destinationNodeId: convergenceData.nodeId,\n allItems: {\n nodes: convergenceData.summary.nodesinvolved,\n connectors: convergenceData.summary.connectorsInvolved\n }\n };\n\n // ignore the destination node\n if (result.allItems) delete result.allItems.nodes[convergenceData.nodeId];\n\n return result;\n }\n return {\n options: [],\n selectedNodeId: nodeId,\n destinationNodeId: undefined,\n allItems: {\n nodes: {},\n connectors: {}\n }\n };\n }\n};\n\nexport default deleteNodeUtils;\n"]}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { GraphData, ConnectorProps } from './Renderer/Utils/Graph';
|
|
2
|
-
import type { AddNodeHandlerParams } from './Renderer/Renderer.types';
|
|
3
|
-
import type { NodeProps, NodeType } from './Node/Node.types';
|
|
4
|
-
import type { DeleteNodeOutcome } from './Utils/deleteNodeUtils';
|
|
5
|
-
export interface AddHelperParams {
|
|
6
|
-
nodeType: NodeType;
|
|
7
|
-
graphData: GraphData<NodeProps, ConnectorProps>;
|
|
8
|
-
metaData: AddNodeHandlerParams;
|
|
9
|
-
connectorsCount?: number;
|
|
10
|
-
getNewNode?: () => NodeProps;
|
|
11
|
-
isBranchNode: boolean;
|
|
12
|
-
getNewConnector?: (fromNodeId: string, toNodeId: string) => ConnectorProps;
|
|
13
|
-
}
|
|
14
|
-
export interface NodeInfo<T extends NodeProps = NodeProps, U extends ConnectorProps = ConnectorProps> {
|
|
15
|
-
node: T;
|
|
16
|
-
inConnectors: U[];
|
|
17
|
-
outConnectors: U[];
|
|
18
|
-
}
|
|
19
|
-
declare const helpers: {
|
|
20
|
-
addConnector(graphData: GraphData<NodeProps, ConnectorProps>, nodeId: string, label?: string, getNewConnector?: AddHelperParams["getNewConnector"]): {
|
|
21
|
-
graphData: GraphData<NodeProps, ConnectorProps<unknown>>;
|
|
22
|
-
connector: ConnectorProps<unknown>;
|
|
23
|
-
} | {
|
|
24
|
-
graphData: {
|
|
25
|
-
nodes: never[];
|
|
26
|
-
connectors: never[];
|
|
27
|
-
};
|
|
28
|
-
connector: {};
|
|
29
|
-
};
|
|
30
|
-
deleteConnector: (graphData: GraphData<NodeProps, ConnectorProps>, connector: ConnectorProps) => DeleteNodeOutcome;
|
|
31
|
-
addNode: ({ graphData, nodeType, isBranchNode, metaData, getNewNode, getNewConnector, connectorsCount }: AddHelperParams) => {
|
|
32
|
-
graphData: GraphData<NodeProps, ConnectorProps<unknown>>;
|
|
33
|
-
node: NodeProps;
|
|
34
|
-
};
|
|
35
|
-
deleteNode(graphData: GraphData<NodeProps, ConnectorProps>, nodeId: string): DeleteNodeOutcome | false;
|
|
36
|
-
selectNode(graphData: GraphData<NodeProps, ConnectorProps>, nodeId: NodeProps["id"]): NodeInfo;
|
|
37
|
-
};
|
|
38
|
-
export default helpers;
|
|
39
|
-
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/components/FlowModeller/helper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7D,OAAO,KAAK,EAAE,iBAAiB,EAAkB,MAAM,yBAAyB,CAAC;AAEjF,MAAM,WAA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