@pega/cosmos-react-build 5.0.0-dev.1.0 → 5.0.0-dev.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +185 -0
- package/lib/components/AppShell/AppShell.d.ts +2 -2
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js.map +1 -1
- 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 +2 -2
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +4 -4
- package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.types.js.map +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.d.ts +3 -3
- package/lib/components/AppShell/Header/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.js.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.types.d.ts +4 -4
- package/lib/components/AppShell/Header/AppHeader.types.d.ts.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.types.js.map +1 -1
- package/lib/components/AppShell/Header/BranchButton.d.ts +5 -3
- package/lib/components/AppShell/Header/BranchButton.d.ts.map +1 -1
- package/lib/components/AppShell/Header/BranchButton.js.map +1 -1
- package/lib/components/AppShell/NavigationList.d.ts +2 -2
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationList.js +1 -1
- package/lib/components/AppShell/NavigationList.js.map +1 -1
- package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +3 -3
- package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
- package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
- package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts +3 -3
- package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts.map +1 -1
- package/lib/components/DynamicContentEditor/DynamicContentEditor.types.js.map +1 -1
- package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts +7 -0
- package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +3 -3
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +3 -3
- 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 +2 -2
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +3 -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.styles.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +3 -3
- 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/ExpressionBuilderContext.d.ts +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilderContext.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +3 -3
- package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionItem.d.ts +3 -3
- package/lib/components/ExpressionBuilder/ExpressionItem.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionItem.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionList.d.ts +3 -3
- package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -1
- package/lib/components/FlowModeller/AddNode.d.ts +5 -5
- package/lib/components/FlowModeller/AddNode.d.ts.map +1 -1
- package/lib/components/FlowModeller/AddNode.js.map +1 -1
- package/lib/components/FlowModeller/Connector.d.ts +2 -2
- package/lib/components/FlowModeller/Connector.d.ts.map +1 -1
- package/lib/components/FlowModeller/Connector.js.map +1 -1
- package/lib/components/FlowModeller/DeletePopover.d.ts +5 -5
- package/lib/components/FlowModeller/DeletePopover.d.ts.map +1 -1
- package/lib/components/FlowModeller/DeletePopover.js.map +1 -1
- package/lib/components/FlowModeller/FlowModeller.d.ts +2 -2
- package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -1
- package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
- package/lib/components/FlowModeller/FlowModeller.types.d.ts +5 -5
- package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +1 -1
- package/lib/components/FlowModeller/FlowModeller.types.js.map +1 -1
- package/lib/components/FlowModeller/FlowModellerContext.d.ts +2 -2
- package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +1 -1
- package/lib/components/FlowModeller/FlowModellerContext.js.map +1 -1
- package/lib/components/FlowModeller/Node/Node.types.d.ts +4 -4
- package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -1
- package/lib/components/FlowModeller/Node/Node.types.js.map +1 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +2 -3
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
- package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +2 -2
- package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
- package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
- package/lib/components/FlowModeller/Node.d.ts +2 -2
- package/lib/components/FlowModeller/Node.d.ts.map +1 -1
- package/lib/components/FlowModeller/Node.js.map +1 -1
- package/lib/components/FlowModeller/Renderer/Renderer.d.ts +2 -2
- package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +1 -1
- package/lib/components/FlowModeller/Renderer/Renderer.js.map +1 -1
- package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +3 -3
- package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +1 -1
- package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +1 -1
- package/lib/components/FlowModeller/Renderer/Utils/Graph.js +11 -61
- package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +1 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +1 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +1 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +2 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +1 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +1 -1
- package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +4 -3
- package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +1 -1
- package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +1 -1
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +2 -2
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +1 -1
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +1 -1
- package/lib/components/FlowModeller/helper.d.ts +4 -4
- package/lib/components/FlowModeller/helper.d.ts.map +1 -1
- package/lib/components/FlowModeller/helper.js.map +1 -1
- package/lib/components/ItemLibrary/ItemLibrary.d.ts +3 -3
- package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
- package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
- package/lib/components/LifeCycle/Category.d.ts +3 -3
- package/lib/components/LifeCycle/Category.d.ts.map +1 -1
- package/lib/components/LifeCycle/Category.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.d.ts +3 -3
- package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.types.d.ts +4 -4
- package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycleContext.d.ts +1 -1
- package/lib/components/LifeCycle/LifeCycleContext.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycleContext.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycleList.d.ts +3 -3
- package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
- package/lib/components/LifeCycle/Stage.d.ts +4 -4
- package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
- package/lib/components/LifeCycle/Stage.js.map +1 -1
- package/lib/components/LifeCycle/Step.d.ts +5 -5
- package/lib/components/LifeCycle/Step.d.ts.map +1 -1
- package/lib/components/LifeCycle/Step.js.map +1 -1
- package/lib/components/LifeCycle/Task.d.ts +4 -4
- package/lib/components/LifeCycle/Task.d.ts.map +1 -1
- package/lib/components/LifeCycle/Task.js.map +1 -1
- package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +3 -3
- package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -1
- package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -1
- package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts +2 -2
- package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts.map +1 -1
- package/lib/components/MobileBuildSummary/MobileBuildSummary.types.js.map +1 -1
- package/lib/components/ObjectPreview/ObjectPreview.d.ts +3 -3
- package/lib/components/ObjectPreview/ObjectPreview.d.ts.map +1 -1
- package/lib/components/ObjectPreview/ObjectPreview.js +1 -1
- package/lib/components/ObjectPreview/ObjectPreview.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/ObjectSelect/ObjectSelect.d.ts +5 -5
- package/lib/components/ObjectSelect/ObjectSelect.d.ts.map +1 -1
- package/lib/components/ObjectSelect/ObjectSelect.js.map +1 -1
- package/lib/components/ObjectSelect/ObjectSummary.d.ts +3 -3
- package/lib/components/ObjectSelect/ObjectSummary.d.ts.map +1 -1
- package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -1
- package/lib/components/ObjectSelect/useCreateModal.d.ts +2 -2
- package/lib/components/ObjectSelect/useCreateModal.d.ts.map +1 -1
- package/lib/components/ObjectSelect/useCreateModal.js.map +1 -1
- package/lib/components/PageBanner/PageBanner.d.ts +2 -2
- package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
- package/lib/components/PageBanner/PageBanner.js.map +1 -1
- package/lib/components/PageTemplates/GalleryPage.d.ts +4 -4
- 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 +2 -2
- 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 +3 -3
- package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -1
- package/lib/components/PageTemplates/ShowcasePage.js.map +1 -1
- package/lib/components/SummaryCard/SummaryCard.d.ts +3 -2
- package/lib/components/SummaryCard/SummaryCard.d.ts.map +1 -1
- package/lib/components/SummaryCard/SummaryCard.js.map +1 -1
- package/lib/components/Workbench/ConfigurationPanel.d.ts +2 -2
- package/lib/components/Workbench/ConfigurationPanel.d.ts.map +1 -1
- package/lib/components/Workbench/ConfigurationPanel.js.map +1 -1
- package/lib/components/Workbench/Toolbar.d.ts +2 -2
- package/lib/components/Workbench/Toolbar.d.ts.map +1 -1
- package/lib/components/Workbench/Toolbar.js.map +1 -1
- package/lib/components/Workbench/UtilityPanel.d.ts +2 -2
- package/lib/components/Workbench/UtilityPanel.d.ts.map +1 -1
- package/lib/components/Workbench/UtilityPanel.js.map +1 -1
- package/lib/components/Workbench/Workbench.d.ts +3 -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.types.d.ts +2 -2
- package/lib/components/Workbench/Workbench.types.d.ts.map +1 -1
- package/lib/components/Workbench/Workbench.types.js.map +1 -1
- package/package.json +12 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowModeller.js","sourceRoot":"","sources":["../../../src/components/FlowModeller/FlowModeller.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,SAAS,EAET,UAAU,EAEV,WAAW,EACX,MAAM,EACN,OAAO,EACR,MAAM,OAAO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IAAI,EAAE,KAAK,CAAC,OAAO,EACnB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,EACrC,WAAW,EAAE,CAAC,CAAC,cAAc,CAAC,EAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,mBAAmB,EAC5B,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAC,QAAQ,GACjB,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import {\n PropsWithoutRef,\n useEffect,\n MouseEvent,\n useReducer,\n Reducer,\n useCallback,\n useRef,\n useMemo\n} from 'react';\n\nimport {\n PopoverProps,\n createUID,\n useElement,\n useOuterEvent,\n useI18n,\n OmitStrict\n} from '@pega/cosmos-react-core';\n\nimport ItemLibrary, { LibraryItem } from '../ItemLibrary/ItemLibrary';\n\nimport { GraphData, DirectedGraph } from './Renderer/Utils/Graph';\nimport { AddNodeHandlerParams } from './Renderer/Renderer.types';\nimport FlowRenderer from './Renderer/Renderer';\nimport {\n ActionParams,\n NodeLibraryItem,\n START_NODETYPE,\n STOP_NODETYPE,\n NodeComponentData\n} from './Node/Node.types';\nimport PlaceHolderHelper from './Utils/addNodeUtils';\nimport { AddButton } from './AddNode';\nimport FlowModellerHelper from './helper';\nimport DeletePopover, { DeletePopoverProps } from './DeletePopover';\nimport Connector from './Connector';\nimport Node from './Node';\nimport { DeleteNodeModalOption, DeleteNodeOutcome } from './Utils/deleteNodeUtils';\nimport FlowModellerContext from './FlowModellerContext';\nimport { FlowModellerProps } from './FlowModeller.types';\nimport { PlottedGraphNode, PlottedGraphConnector } from './Renderer/Utils/GraphLayout';\n\ntype ModellerState = {\n showLib: boolean;\n allowNonBranchNode: boolean;\n activeItem: Element | null;\n activeAddBtnMeta: {\n target: null; // we will maintain ref of an Element\n meta: AddNodeHandlerParams;\n };\n graphData: GraphData<PlottedGraphNode, PlottedGraphConnector>;\n highlightItems?: DeleteNodeModalOption['pathItems'];\n showDeletePopover: boolean;\n deleteProps:\n | OmitStrict<DeletePopoverProps & { target: PopoverProps['target'] }, 'show'>\n | undefined;\n};\n\nconst initState: ModellerState = {\n showLib: false,\n activeItem: null,\n allowNonBranchNode: false,\n activeAddBtnMeta: {\n target: null,\n meta: {\n refType: 'node',\n refId: ''\n }\n },\n graphData: { nodes: [], connectors: [] },\n highlightItems: undefined,\n showDeletePopover: false,\n deleteProps: undefined\n};\n\nconst reducer = (state: ModellerState, action: { type: string; payload: any }) => {\n switch (action.type) {\n case 'showLibrary':\n // minor optimization, not to update state.. if no change in the value\n return action.payload.show === state.showLib\n ? state\n : { ...state, showLib: action.payload.show, allowNonBranchNode: false };\n case 'setActiveItem':\n return {\n ...state,\n activeItem: action.payload.target\n };\n case 'setActiveAddButton':\n state.activeAddBtnMeta = {\n ...action.payload\n };\n\n return {\n ...state,\n showLib: true,\n allowNonBranchNode: action.payload.allowNonBranchNode\n };\n case 'setGraphData':\n return {\n ...state,\n graphData: action.payload.graphData,\n highlightItems: action.payload.highlightItems\n };\n case 'highlight':\n // minor optimization to avoid unnecessary re-render\n if (action.payload.hideDeletePopover === !state.showDeletePopover) {\n return state;\n }\n\n return {\n ...state,\n highlightItems: action.payload.highlightItems,\n showDeletePopover: action.payload.hideDeletePopover !== true && state.showDeletePopover\n };\n case 'showDeletePopover':\n return {\n ...state,\n showDeletePopover: action.payload.showDeletePopover,\n deleteProps: action.payload.deleteProps\n };\n default:\n return state;\n }\n};\n\nconst FlowModeller = ({\n graphData,\n highlightData,\n onNodeActionClick,\n onNodeAdd,\n nodeLibrary,\n onNodeClick,\n onDelete,\n actions,\n readOnly,\n selectedNodeId\n}: PropsWithoutRef<FlowModellerProps>) => {\n const [state, dispatch] = useReducer<Reducer<ModellerState, any>>(reducer, initState);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const [deletePopoverEl, setDeletePopoverEl] = useElement<HTMLElement>(null);\n const stateRef = useRef<ModellerState>(initState);\n\n // stateRef always refers to the same state obj\n // \"fixed\" callbacks can refer to this object whenever\n // it need the current value. Note: the callbacks will not\n // be reactive - they will not re-run the instant state changes,\n // but they *will* see the current value whenever they do run\n stateRef.current = state;\n const t = useI18n();\n\n const onNodeCreate = (el: HTMLElement | SVGForeignObjectElement, meta: AddNodeHandlerParams) => {\n const graph = new DirectedGraph(graphData);\n let isAllowNonBranchNode = false;\n if (meta.refType === 'connector') {\n if (!Array.isArray(meta.refId)) meta.refId = [meta.refId];\n const connectorData = graph.getConnector(meta.refId[0]);\n const toNode = graph.getNode(connectorData.toNodeId);\n const inConnectors = graph.getInConnectors(toNode.id);\n let hiddenConnectorsCount = 0;\n inConnectors.forEach(connector => {\n const node = graph.getNode(connector.fromNodeId);\n if (node.type.minConnectors === 0) hiddenConnectorsCount += 1;\n });\n const isPlaceholderConnector = meta.refId.length > 1;\n\n /** if node is being added on a placeholder connector then reduce number of in connectors of destination node\n * by total number of connectors converging/joining to form placeholder connector and add one to the in connector count\n */\n const inConnectorsCount = isPlaceholderConnector\n ? inConnectors.length - meta.refId.length + 1\n : inConnectors.length;\n\n /** if node is being added on a placeholder connector then reduce number of hidden connectors of destination node\n * by total number of connectors converging/joining to from placeholder connector and are originating from go to nodes\n */\n if (isPlaceholderConnector) {\n meta.refId.forEach(connector => {\n if (graph.getNode(graph.getConnector(connector).fromNodeId).type.minConnectors === 0)\n hiddenConnectorsCount -= 1;\n });\n }\n\n /** check destination/target node in connectors count is more than one\n * check non-hidden/visible connectors among in connectors of destination/target node are more than 1\n * check connectors converging/joining to form a placeholder connector are not equal to total number of in connectors\n */\n if (\n inConnectorsCount > 1 &&\n inConnectorsCount - hiddenConnectorsCount > 1 &&\n inConnectors.length !== meta.refId.length\n ) {\n isAllowNonBranchNode = true;\n } else {\n isAllowNonBranchNode = false;\n }\n }\n dispatch({\n type: 'setActiveAddButton',\n payload: {\n target: el,\n meta,\n allowNonBranchNode: isAllowNonBranchNode\n }\n });\n };\n\n const closeMenu = () => {\n dispatch({\n type: 'showLibrary',\n payload: {\n show: false\n }\n });\n };\n\n const closeDeleteModel = () => {\n // un-highlight the nodes and connectors\n dispatch({\n type: 'highlight',\n payload: {\n highlightItems: undefined,\n hideDeletePopover: true\n }\n });\n };\n\n const onDeleteWrapper = (params: ActionParams, e: MouseEvent) => {\n const result: DeleteNodeOutcome | false = FlowModellerHelper.deleteNode(\n graphData,\n params.nodeId\n );\n if (result) {\n if (!result.updates && result.error) {\n onDelete?.({ ...params, additionalData: result }, t('delete_referenced_step_error'), e);\n } else if (result.error) {\n onDelete?.({ ...params, additionalData: result }, t('delete_step_error'), e);\n }\n onDelete?.({ ...params, additionalData: result }, '', e);\n } else {\n dispatch({\n type: 'showDeletePopover',\n payload: {\n showDeletePopover: true,\n deleteProps: {\n flowGraphData: graphData,\n rendererGraphData: stateRef.current.graphData,\n nodeId: params.nodeId,\n target: {\n getBoundingClientRect: () =>\n document\n .getElementById(`modeller-node-${stateRef.current.deleteProps?.nodeId}`)\n ?.getBoundingClientRect()\n } as PopoverProps['target'],\n onChange: highlights => {\n dispatch({\n type: 'highlight',\n payload: {\n highlightItems: highlights\n }\n });\n },\n onSubmit: outcome => {\n // un-highlight the nodes and connectors\n closeDeleteModel();\n if (outcome.error) {\n onDelete?.({ ...params, additionalData: outcome }, t('delete_step_error'), e);\n } else {\n onDelete?.({ ...params, additionalData: outcome }, '', e);\n }\n },\n onCancel: closeDeleteModel\n } as ModellerState['deleteProps']\n }\n });\n }\n };\n\n useEffect(() => {\n const graph = new DirectedGraph(graphData);\n const onGetNewPHNode: (metaData: AddNodeHandlerParams) => PlottedGraphNode = metaData => {\n return {\n id: createUID(),\n children: (\n <AddButton\n addNodeHandler={(e: MouseEvent<HTMLButtonElement>) => {\n onNodeCreate(e.currentTarget as HTMLElement, metaData);\n }}\n />\n ),\n position: { x: 0, y: 0 },\n dimensions: { width: 1, height: 0 }\n };\n };\n\n const onGetNewPHConnector: (\n fromNodeId: string,\n toNodeId: string,\n metaData: AddNodeHandlerParams\n ) => PlottedGraphConnector = (fromNodeId, toNodeId) => {\n return {\n id: createUID(),\n fromNodeId,\n toNodeId,\n points: [],\n data: {\n onNodeCreate,\n type: 'default'\n }\n };\n };\n\n const flowNodes: PlottedGraphNode[] = graphData.nodes.map(node => {\n const flowNode: PlottedGraphNode = {\n ...node,\n dimensions: {\n width: 280,\n height: 120\n },\n position: {\n x: 0,\n y: 0\n },\n data: {\n selected: selectedNodeId === node.id,\n actions,\n onDelete: onDeleteWrapper,\n onActionClick: onNodeActionClick,\n onClick: onNodeClick\n } as NodeComponentData\n };\n\n if (node.type.id === START_NODETYPE.id || node.type.id === STOP_NODETYPE.id) {\n flowNode.dimensions.width = 59;\n flowNode.dimensions.height = 59;\n }\n return flowNode;\n });\n\n const connectors: PlottedGraphConnector[] = graphData.connectors.map(connector => {\n const nodeData = graph.getNode(connector.fromNodeId);\n const isBranchNode = nodeData.type.minConnectors === 0;\n return {\n ...connector,\n points: [],\n data: {\n label: connector.label,\n onNodeCreate,\n type: !isBranchNode ? 'default' : 'hidden'\n }\n };\n });\n\n // inject the placeholderAddNodes dynamically\n const newGraphData: GraphData<PlottedGraphNode, PlottedGraphConnector> =\n PlaceHolderHelper.injectPlaceholderNodes(\n { nodes: flowNodes, connectors },\n onGetNewPHNode,\n onGetNewPHConnector\n );\n\n dispatch({\n type: 'setGraphData',\n payload: {\n graphData: newGraphData\n }\n });\n }, [graphData, selectedNodeId]);\n\n // Library popover functionality\n const onLibraryItemSelect = useCallback(\n (libItem: LibraryItem) => {\n const metaData = state.activeAddBtnMeta.meta;\n closeMenu();\n onNodeAdd((libItem as NodeLibraryItem).type, metaData);\n },\n [state.activeAddBtnMeta]\n );\n\n const onKeydown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n closeMenu();\n }\n },\n [closeMenu]\n );\n\n useOuterEvent('mousedown', [popoverEl], closeMenu);\n useOuterEvent('mousedown', [deletePopoverEl], closeDeleteModel);\n\n useEffect(() => {\n document.addEventListener('keydown', onKeydown);\n\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }, []);\n\n let items: NodeLibraryItem[] = nodeLibrary !== undefined ? nodeLibrary : [];\n\n if (!state.allowNonBranchNode) {\n items = items.filter(shapeTypes => {\n if (shapeTypes.type) {\n return shapeTypes.type.minConnectors !== 0;\n }\n return true;\n });\n }\n const ctxValue = useMemo(\n () => ({\n readOnly,\n highlights: highlightData ?? state.highlightItems,\n showNodeLibrary: state.showLib\n }),\n [readOnly, state.highlightItems, highlightData, state.showLib]\n );\n\n return (\n <div>\n <FlowModellerContext.Provider value={ctxValue}>\n <FlowRenderer graphData={state.graphData} connector={Connector} node={Node} />\n </FlowModellerContext.Provider>\n {state.showDeletePopover && state.deleteProps && (\n <DeletePopover\n show={state.showDeletePopover}\n ref={setDeletePopoverEl}\n {...state.deleteProps}\n />\n )}\n <ItemLibrary\n show={state.showLib}\n target={state.activeAddBtnMeta.target}\n placeholder={t('search_nodes')}\n items={items}\n onClick={onLibraryItemSelect}\n ref={setPopoverEl}\n position='bottom'\n />\n </div>\n );\n};\n\nexport default FlowModeller;\n"]}
|
|
1
|
+
{"version":3,"file":"FlowModeller.js","sourceRoot":"","sources":["../../../src/components/FlowModeller/FlowModeller.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAG5E,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAGxF,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACt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KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;YAChC,IAAI,UAAU,CAAC,IAAI,EAAE;gBACnB,OAAO,UAAU,CAAC,IAAI,CAAC,aAAa,KAAK,CAAC,CAAC;aAC5C;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;KACJ;IACD,MAAM,QAAQ,GAAG,OAAO,CACtB,GAAG,EAAE,CAAC,CAAC;QACL,QAAQ;QACR,UAAU,EAAE,aAAa,IAAI,KAAK,CAAC,cAAc;QACjD,eAAe,EAAE,KAAK,CAAC,OAAO;KAC/B,CAAC,EACF,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAAE,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAC/D,CAAC;IAEF,OAAO,CACL,0BACE,KAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,YAC3C,KAAC,YAAY,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAI,GACjD,EAC9B,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,WAAW,IAAI,CAC/C,KAAC,aAAa,IACZ,IAAI,EAAE,KAAK,CAAC,iBAAiB,EAC7B,GAAG,EAAE,kBAAkB,KACnB,KAAK,CAAC,WAAW,GACrB,CACH,EACD,KAAC,WAAW,IACV,IAAI,EAAE,KAAK,CAAC,OAAO,EACnB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,EACrC,WAAW,EAAE,CAAC,CAAC,cAAc,CAAC,EAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,mBAAmB,EAC5B,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAC,QAAQ,GACjB,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { useEffect, useReducer, useCallback, useRef, useMemo } from 'react';\nimport type { PropsWithoutRef, MouseEvent, Reducer } from 'react';\n\nimport { createUID, useElement, useOuterEvent, useI18n } from '@pega/cosmos-react-core';\nimport type { PopoverProps, OmitStrict } from '@pega/cosmos-react-core';\n\nimport ItemLibrary from '../ItemLibrary/ItemLibrary';\nimport type { LibraryItem } from '../ItemLibrary/ItemLibrary';\n\nimport { DirectedGraph } from './Renderer/Utils/Graph';\nimport type { GraphData } from './Renderer/Utils/Graph';\nimport type { AddNodeHandlerParams } from './Renderer/Renderer.types';\nimport FlowRenderer from './Renderer/Renderer';\nimport { START_NODETYPE, STOP_NODETYPE } from './Node/Node.types';\nimport type { ActionParams, NodeLibraryItem, NodeComponentData } from './Node/Node.types';\nimport PlaceHolderHelper from './Utils/addNodeUtils';\nimport { AddButton } from './AddNode';\nimport FlowModellerHelper from './helper';\nimport DeletePopover from './DeletePopover';\nimport type { DeletePopoverProps } from './DeletePopover';\nimport Connector from './Connector';\nimport Node from './Node';\nimport type { DeleteNodeModalOption, DeleteNodeOutcome } from './Utils/deleteNodeUtils';\nimport FlowModellerContext from './FlowModellerContext';\nimport type { FlowModellerProps } from './FlowModeller.types';\nimport type { PlottedGraphNode, PlottedGraphConnector } from './Renderer/Utils/GraphLayout';\n\ntype ModellerState = {\n showLib: boolean;\n allowNonBranchNode: boolean;\n activeItem: Element | null;\n activeAddBtnMeta: {\n target: null; // we will maintain ref of an Element\n meta: AddNodeHandlerParams;\n };\n graphData: GraphData<PlottedGraphNode, PlottedGraphConnector>;\n highlightItems?: DeleteNodeModalOption['pathItems'];\n showDeletePopover: boolean;\n deleteProps:\n | OmitStrict<DeletePopoverProps & { target: PopoverProps['target'] }, 'show'>\n | undefined;\n};\n\nconst initState: ModellerState = {\n showLib: false,\n activeItem: null,\n allowNonBranchNode: false,\n activeAddBtnMeta: {\n target: null,\n meta: {\n refType: 'node',\n refId: ''\n }\n },\n graphData: { nodes: [], connectors: [] },\n highlightItems: undefined,\n showDeletePopover: false,\n deleteProps: undefined\n};\n\nconst reducer = (state: ModellerState, action: { type: string; payload: any }) => {\n switch (action.type) {\n case 'showLibrary':\n // minor optimization, not to update state.. if no change in the value\n return action.payload.show === state.showLib\n ? state\n : { ...state, showLib: action.payload.show, allowNonBranchNode: false };\n case 'setActiveItem':\n return {\n ...state,\n activeItem: action.payload.target\n };\n case 'setActiveAddButton':\n state.activeAddBtnMeta = {\n ...action.payload\n };\n\n return {\n ...state,\n showLib: true,\n allowNonBranchNode: action.payload.allowNonBranchNode\n };\n case 'setGraphData':\n return {\n ...state,\n graphData: action.payload.graphData,\n highlightItems: action.payload.highlightItems\n };\n case 'highlight':\n // minor optimization to avoid unnecessary re-render\n if (action.payload.hideDeletePopover === !state.showDeletePopover) {\n return state;\n }\n\n return {\n ...state,\n highlightItems: action.payload.highlightItems,\n showDeletePopover: action.payload.hideDeletePopover !== true && state.showDeletePopover\n };\n case 'showDeletePopover':\n return {\n ...state,\n showDeletePopover: action.payload.showDeletePopover,\n deleteProps: action.payload.deleteProps\n };\n default:\n return state;\n }\n};\n\nconst FlowModeller = ({\n graphData,\n highlightData,\n onNodeActionClick,\n onNodeAdd,\n nodeLibrary,\n onNodeClick,\n onDelete,\n actions,\n readOnly,\n selectedNodeId\n}: PropsWithoutRef<FlowModellerProps>) => {\n const [state, dispatch] = useReducer<Reducer<ModellerState, any>>(reducer, initState);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const [deletePopoverEl, setDeletePopoverEl] = useElement<HTMLElement>(null);\n const stateRef = useRef<ModellerState>(initState);\n\n // stateRef always refers to the same state obj\n // \"fixed\" callbacks can refer to this object whenever\n // it need the current value. Note: the callbacks will not\n // be reactive - they will not re-run the instant state changes,\n // but they *will* see the current value whenever they do run\n stateRef.current = state;\n const t = useI18n();\n\n const onNodeCreate = (el: HTMLElement | SVGForeignObjectElement, meta: AddNodeHandlerParams) => {\n const graph = new DirectedGraph(graphData);\n let isAllowNonBranchNode = false;\n if (meta.refType === 'connector') {\n if (!Array.isArray(meta.refId)) meta.refId = [meta.refId];\n const connectorData = graph.getConnector(meta.refId[0]);\n const toNode = graph.getNode(connectorData.toNodeId);\n const inConnectors = graph.getInConnectors(toNode.id);\n let hiddenConnectorsCount = 0;\n inConnectors.forEach(connector => {\n const node = graph.getNode(connector.fromNodeId);\n if (node.type.minConnectors === 0) hiddenConnectorsCount += 1;\n });\n const isPlaceholderConnector = meta.refId.length > 1;\n\n /** if node is being added on a placeholder connector then reduce number of in connectors of destination node\n * by total number of connectors converging/joining to form placeholder connector and add one to the in connector count\n */\n const inConnectorsCount = isPlaceholderConnector\n ? inConnectors.length - meta.refId.length + 1\n : inConnectors.length;\n\n /** if node is being added on a placeholder connector then reduce number of hidden connectors of destination node\n * by total number of connectors converging/joining to from placeholder connector and are originating from go to nodes\n */\n if (isPlaceholderConnector) {\n meta.refId.forEach(connector => {\n if (graph.getNode(graph.getConnector(connector).fromNodeId).type.minConnectors === 0)\n hiddenConnectorsCount -= 1;\n });\n }\n\n /** check destination/target node in connectors count is more than one\n * check non-hidden/visible connectors among in connectors of destination/target node are more than 1\n * check connectors converging/joining to form a placeholder connector are not equal to total number of in connectors\n */\n if (\n inConnectorsCount > 1 &&\n inConnectorsCount - hiddenConnectorsCount > 1 &&\n inConnectors.length !== meta.refId.length\n ) {\n isAllowNonBranchNode = true;\n } else {\n isAllowNonBranchNode = false;\n }\n }\n dispatch({\n type: 'setActiveAddButton',\n payload: {\n target: el,\n meta,\n allowNonBranchNode: isAllowNonBranchNode\n }\n });\n };\n\n const closeMenu = () => {\n dispatch({\n type: 'showLibrary',\n payload: {\n show: false\n }\n });\n };\n\n const closeDeleteModel = () => {\n // un-highlight the nodes and connectors\n dispatch({\n type: 'highlight',\n payload: {\n highlightItems: undefined,\n hideDeletePopover: true\n }\n });\n };\n\n const onDeleteWrapper = (params: ActionParams, e: MouseEvent) => {\n const result: DeleteNodeOutcome | false = FlowModellerHelper.deleteNode(\n graphData,\n params.nodeId\n );\n if (result) {\n if (!result.updates && result.error) {\n onDelete?.({ ...params, additionalData: result }, t('delete_referenced_step_error'), e);\n } else if (result.error) {\n onDelete?.({ ...params, additionalData: result }, t('delete_step_error'), e);\n }\n onDelete?.({ ...params, additionalData: result }, '', e);\n } else {\n dispatch({\n type: 'showDeletePopover',\n payload: {\n showDeletePopover: true,\n deleteProps: {\n flowGraphData: graphData,\n rendererGraphData: stateRef.current.graphData,\n nodeId: params.nodeId,\n target: {\n getBoundingClientRect: () =>\n document\n .getElementById(`modeller-node-${stateRef.current.deleteProps?.nodeId}`)\n ?.getBoundingClientRect()\n } as PopoverProps['target'],\n onChange: highlights => {\n dispatch({\n type: 'highlight',\n payload: {\n highlightItems: highlights\n }\n });\n },\n onSubmit: outcome => {\n // un-highlight the nodes and connectors\n closeDeleteModel();\n if (outcome.error) {\n onDelete?.({ ...params, additionalData: outcome }, t('delete_step_error'), e);\n } else {\n onDelete?.({ ...params, additionalData: outcome }, '', e);\n }\n },\n onCancel: closeDeleteModel\n } as ModellerState['deleteProps']\n }\n });\n }\n };\n\n useEffect(() => {\n const graph = new DirectedGraph(graphData);\n const onGetNewPHNode: (metaData: AddNodeHandlerParams) => PlottedGraphNode = metaData => {\n return {\n id: createUID(),\n children: (\n <AddButton\n addNodeHandler={(e: MouseEvent<HTMLButtonElement>) => {\n onNodeCreate(e.currentTarget as HTMLElement, metaData);\n }}\n />\n ),\n position: { x: 0, y: 0 },\n dimensions: { width: 1, height: 0 }\n };\n };\n\n const onGetNewPHConnector: (\n fromNodeId: string,\n toNodeId: string,\n metaData: AddNodeHandlerParams\n ) => PlottedGraphConnector = (fromNodeId, toNodeId) => {\n return {\n id: createUID(),\n fromNodeId,\n toNodeId,\n points: [],\n data: {\n onNodeCreate,\n type: 'default'\n }\n };\n };\n\n const flowNodes: PlottedGraphNode[] = graphData.nodes.map(node => {\n const flowNode: PlottedGraphNode = {\n ...node,\n dimensions: {\n width: 280,\n height: 120\n },\n position: {\n x: 0,\n y: 0\n },\n data: {\n selected: selectedNodeId === node.id,\n actions,\n onDelete: onDeleteWrapper,\n onActionClick: onNodeActionClick,\n onClick: onNodeClick\n } as NodeComponentData\n };\n\n if (node.type.id === START_NODETYPE.id || node.type.id === STOP_NODETYPE.id) {\n flowNode.dimensions.width = 59;\n flowNode.dimensions.height = 59;\n }\n return flowNode;\n });\n\n const connectors: PlottedGraphConnector[] = graphData.connectors.map(connector => {\n const nodeData = graph.getNode(connector.fromNodeId);\n const isBranchNode = nodeData.type.minConnectors === 0;\n return {\n ...connector,\n points: [],\n data: {\n label: connector.label,\n onNodeCreate,\n type: !isBranchNode ? 'default' : 'hidden'\n }\n };\n });\n\n // inject the placeholderAddNodes dynamically\n const newGraphData: GraphData<PlottedGraphNode, PlottedGraphConnector> =\n PlaceHolderHelper.injectPlaceholderNodes(\n { nodes: flowNodes, connectors },\n onGetNewPHNode,\n onGetNewPHConnector\n );\n\n dispatch({\n type: 'setGraphData',\n payload: {\n graphData: newGraphData\n }\n });\n }, [graphData, selectedNodeId]);\n\n // Library popover functionality\n const onLibraryItemSelect = useCallback(\n (libItem: LibraryItem) => {\n const metaData = state.activeAddBtnMeta.meta;\n closeMenu();\n onNodeAdd((libItem as NodeLibraryItem).type, metaData);\n },\n [state.activeAddBtnMeta]\n );\n\n const onKeydown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n closeMenu();\n }\n },\n [closeMenu]\n );\n\n useOuterEvent('mousedown', [popoverEl], closeMenu);\n useOuterEvent('mousedown', [deletePopoverEl], closeDeleteModel);\n\n useEffect(() => {\n document.addEventListener('keydown', onKeydown);\n\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }, []);\n\n let items: NodeLibraryItem[] = nodeLibrary !== undefined ? nodeLibrary : [];\n\n if (!state.allowNonBranchNode) {\n items = items.filter(shapeTypes => {\n if (shapeTypes.type) {\n return shapeTypes.type.minConnectors !== 0;\n }\n return true;\n });\n }\n const ctxValue = useMemo(\n () => ({\n readOnly,\n highlights: highlightData ?? state.highlightItems,\n showNodeLibrary: state.showLib\n }),\n [readOnly, state.highlightItems, highlightData, state.showLib]\n );\n\n return (\n <div>\n <FlowModellerContext.Provider value={ctxValue}>\n <FlowRenderer graphData={state.graphData} connector={Connector} node={Node} />\n </FlowModellerContext.Provider>\n {state.showDeletePopover && state.deleteProps && (\n <DeletePopover\n show={state.showDeletePopover}\n ref={setDeletePopoverEl}\n {...state.deleteProps}\n />\n )}\n <ItemLibrary\n show={state.showLib}\n target={state.activeAddBtnMeta.target}\n placeholder={t('search_nodes')}\n items={items}\n onClick={onLibraryItemSelect}\n ref={setPopoverEl}\n position='bottom'\n />\n </div>\n );\n};\n\nexport default FlowModeller;\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { MouseEvent } from 'react';
|
|
2
|
-
import { Action } from '@pega/cosmos-react-core';
|
|
3
|
-
import { GraphData, ConnectorProps } from './Renderer/Utils/Graph';
|
|
4
|
-
import { AddNodeHandlerParams, RendererProps } from './Renderer/Renderer.types';
|
|
5
|
-
import { ActionParams, NodeProps, NodeLibraryItem, NodeType } from './Node/Node.types';
|
|
1
|
+
import type { MouseEvent } from 'react';
|
|
2
|
+
import type { Action } from '@pega/cosmos-react-core';
|
|
3
|
+
import type { GraphData, ConnectorProps } from './Renderer/Utils/Graph';
|
|
4
|
+
import type { AddNodeHandlerParams, RendererProps } from './Renderer/Renderer.types';
|
|
5
|
+
import type { ActionParams, NodeProps, NodeLibraryItem, NodeType } from './Node/Node.types';
|
|
6
6
|
export interface FlowModellerProps {
|
|
7
7
|
graphData: GraphData<NodeProps, ConnectorProps>;
|
|
8
8
|
/** Node actions */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowModeller.types.d.ts","sourceRoot":"","sources":["../../../src/components/FlowModeller/FlowModeller.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FlowModeller.types.d.ts","sourceRoot":"","sources":["../../../src/components/FlowModeller/FlowModeller.types.ts"],"names":[],"mappings":"AAA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ources":["../../../src/components/FlowModeller/FlowModeller.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent } from 'react';\n\nimport { Action } from '@pega/cosmos-react-core';\n\nimport { GraphData, ConnectorProps } from './Renderer/Utils/Graph';\nimport { AddNodeHandlerParams, RendererProps } from './Renderer/Renderer.types';\nimport { ActionParams, NodeProps, NodeLibraryItem, NodeType } from './Node/Node.types';\n\nexport interface FlowModellerProps {\n graphData: GraphData<NodeProps, ConnectorProps>;\n /** Node actions */\n actions?: Action[];\n /** Callback to add node from connector */\n onNodeAdd: (nodeType: NodeType, params: AddNodeHandlerParams) => void;\n /** Callback for handling the click on the node */\n onNodeClick?: (nodeId: string) => void;\n /** Callback for actions on Node */\n onNodeActionClick?: (param: ActionParams, e: MouseEvent) => void;\n /** Callback for node deletion */\n onDelete?: (param: ActionParams, error: string, e: MouseEvent) => void;\n /** Types of nodes */\n nodeLibrary: NodeLibraryItem[];\n /** Highlights */\n highlightData?: RendererProps['highlights'];\n /** To make FlowModeller readOnly state */\n readOnly?: boolean;\n /** Current selected node */\n selectedNodeId?: NodeProps['id'];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FlowModeller.types.js","sourceRoot":"","sources":["../../../src/components/FlowModeller/FlowModeller.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MouseEvent } from 'react';\n\nimport type { Action } from '@pega/cosmos-react-core';\n\nimport type { GraphData, ConnectorProps } from './Renderer/Utils/Graph';\nimport type { AddNodeHandlerParams, RendererProps } from './Renderer/Renderer.types';\nimport type { ActionParams, NodeProps, NodeLibraryItem, NodeType } from './Node/Node.types';\n\nexport interface FlowModellerProps {\n graphData: GraphData<NodeProps, ConnectorProps>;\n /** Node actions */\n actions?: Action[];\n /** Callback to add node from connector */\n onNodeAdd: (nodeType: NodeType, params: AddNodeHandlerParams) => void;\n /** Callback for handling the click on the node */\n onNodeClick?: (nodeId: string) => void;\n /** Callback for actions on Node */\n onNodeActionClick?: (param: ActionParams, e: MouseEvent) => void;\n /** Callback for node deletion */\n onDelete?: (param: ActionParams, error: string, e: MouseEvent) => void;\n /** Types of nodes */\n nodeLibrary: NodeLibraryItem[];\n /** Highlights */\n highlightData?: RendererProps['highlights'];\n /** To make FlowModeller readOnly state */\n readOnly?: boolean;\n /** Current selected node */\n selectedNodeId?: NodeProps['id'];\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { FlowModellerProps } from './FlowModeller.types';
|
|
3
|
-
import { RendererProps } from './Renderer/Renderer.types';
|
|
2
|
+
import type { FlowModellerProps } from './FlowModeller.types';
|
|
3
|
+
import type { RendererProps } from './Renderer/Renderer.types';
|
|
4
4
|
export interface FlowModellerContextValue {
|
|
5
5
|
readOnly: FlowModellerProps['readOnly'];
|
|
6
6
|
highlights: RendererProps['highlights'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowModellerContext.d.ts","sourceRoot":"","sources":["../../../src/components/FlowModeller/FlowModellerContext.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"FlowModellerContext.d.ts","sourceRoot":"","sources":["../../../src/components/FlowModeller/FlowModellerContext.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACxC,UAAU,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACxC,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,mBAAmB,mDAIvB,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowModellerContext.js","sourceRoot":"","sources":["../../../src/components/FlowModeller/FlowModellerContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAWtC,MAAM,mBAAmB,GAAG,aAAa,CAA2B;IAClE,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IACzC,eAAe,EAAE,KAAK;CACvB,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC","sourcesContent":["import { createContext } from 'react';\n\nimport { FlowModellerProps } from './FlowModeller.types';\nimport { RendererProps } from './Renderer/Renderer.types';\n\nexport interface FlowModellerContextValue {\n readOnly: FlowModellerProps['readOnly'];\n highlights: RendererProps['highlights'];\n showNodeLibrary: boolean;\n}\n\nconst FlowModellerContext = createContext<FlowModellerContextValue>({\n readOnly: false,\n highlights: { nodes: {}, connectors: {} },\n showNodeLibrary: false\n});\n\nexport default FlowModellerContext;\n"]}
|
|
1
|
+
{"version":3,"file":"FlowModellerContext.js","sourceRoot":"","sources":["../../../src/components/FlowModeller/FlowModellerContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAWtC,MAAM,mBAAmB,GAAG,aAAa,CAA2B;IAClE,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IACzC,eAAe,EAAE,KAAK;CACvB,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC","sourcesContent":["import { createContext } from 'react';\n\nimport type { FlowModellerProps } from './FlowModeller.types';\nimport type { RendererProps } from './Renderer/Renderer.types';\n\nexport interface FlowModellerContextValue {\n readOnly: FlowModellerProps['readOnly'];\n highlights: RendererProps['highlights'];\n showNodeLibrary: boolean;\n}\n\nconst FlowModellerContext = createContext<FlowModellerContextValue>({\n readOnly: false,\n highlights: { nodes: {}, connectors: {} },\n showNodeLibrary: false\n});\n\nexport default FlowModellerContext;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MouseEvent, KeyboardEvent } from 'react';
|
|
2
|
-
import { Action, OmitStrict } from '@pega/cosmos-react-core';
|
|
3
|
-
import { Node } from '../Renderer/Utils/Graph';
|
|
4
|
-
import { ItemVisual, LibraryItem } from '../../ItemLibrary/ItemLibrary';
|
|
1
|
+
import type { MouseEvent, KeyboardEvent } from 'react';
|
|
2
|
+
import type { Action, OmitStrict } from '@pega/cosmos-react-core';
|
|
3
|
+
import type { Node } from '../Renderer/Utils/Graph';
|
|
4
|
+
import type { ItemVisual, LibraryItem } from '../../ItemLibrary/ItemLibrary';
|
|
5
5
|
export interface NodeType extends ItemVisual {
|
|
6
6
|
/** node type id. this must be unique */
|
|
7
7
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Node.types.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/Node.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Node.types.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/Node.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE7E,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE;QACR,IAAI,EAAE,UAAU,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AAE,MAAM;SACd;QACD,SAAS,EAAE,EAAE;KACd;CACF,CAAC,CAAC","sourcesContent":["import { MouseEvent, KeyboardEvent } from 'react';\n\nimport { Action, OmitStrict } from '@pega/cosmos-react-core';\n\nimport { Node } from '../Renderer/Utils/Graph';\nimport { ItemVisual, LibraryItem } from '../../ItemLibrary/ItemLibrary';\n\nexport interface NodeType extends ItemVisual {\n /** node type id. this must be unique */\n id: string;\n /** human readable name of the type */\n name: string;\n /** min no. of connectors */\n minConnectors: number;\n defaults: {\n node: OmitStrict<NodeProps, 'type' | 'id'>;\n connector: {\n label: string;\n }[];\n };\n}\n\nexport interface ReferenceProps {\n /** id of the reference node */\n id: string;\n /** label of the reference node */\n label: string;\n}\n\nexport interface NodeProps extends Node {\n /** Unique id for Node */\n id: string;\n /** Label for Node */\n label: string;\n /** Description for Node */\n description?: string;\n /** Referenced Node id */\n reference?: NodeProps['id'];\n /** Additional data for Node */\n additionalData?: AdditionalDataItemProps[];\n /** type of the Node */\n type: NodeType;\n /** error message for node */\n error?: string;\n}\n\nexport interface ModellerNodeComponentProps<NodeComponentData> extends NodeProps {\n data: NodeComponentData;\n}\n\nexport interface NodeComponentData {\n /** Callback for the node actions click */\n onActionClick?: (params: ActionParams, e: MouseEvent | KeyboardEvent) => void;\n /** Callback for the node click */\n onClick?: (nodeId: NodeProps['id'], e: MouseEvent | KeyboardEvent) => void;\n /** Callback for node deletion */\n onDelete?: (params: ActionParams, e: MouseEvent | KeyboardEvent) => void;\n /** Actions for the node click */\n actions?: Action[];\n /** If node is selected */\n selected?: boolean;\n}\n\nexport interface NodeComponentProps extends NodeProps, NodeComponentData {\n referencedNode?: NodeProps;\n}\n\nexport interface AdditionalDataItemProps {\n id: string;\n label: string;\n value: string;\n}\nexport interface ActionParams {\n actionId: string;\n nodeId: NodeProps['id'];\n additionalData?: unknown;\n}\n\nexport interface NodeLibraryItem extends LibraryItem {\n type: NodeType;\n items?: NodeLibraryItem[];\n}\n\nexport const START_NODETYPE: NodeType = Object.freeze({\n id: 'start',\n name: 'start',\n color: 'green',\n icon: 'circle',\n minConnectors: 1,\n defaults: {\n node: {\n label: 'Start'\n },\n connector: []\n }\n});\n\nexport const STOP_NODETYPE: NodeType = Object.freeze({\n id: 'stop',\n name: 'stop',\n color: 'red',\n icon: 'circle',\n minConnectors: 0,\n defaults: {\n node: {\n label: 'Stop'\n },\n connector: []\n }\n});\n"]}
|
|
1
|
+
{"version":3,"file":"Node.types.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/Node.types.ts"],"names":[],"mappings":"AAmFA,MAAM,CAAC,MAAM,cAAc,GAAa,MAAM,CAAC,MAAM,CAAC;IACpD,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,QAAQ;IACd,aAAa,EAAE,CAAC;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,KAAK,EAAE,OAAO;SACf;QACD,SAAS,EAAE,EAAE;KACd;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAa,MAAM,CAAC,MAAM,CAAC;IACnD,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,QAAQ;IACd,aAAa,EAAE,CAAC;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;SACd;QACD,SAAS,EAAE,EAAE;KACd;CACF,CAAC,CAAC","sourcesContent":["import type { MouseEvent, KeyboardEvent } from 'react';\n\nimport type { Action, OmitStrict } from '@pega/cosmos-react-core';\n\nimport type { Node } from '../Renderer/Utils/Graph';\nimport type { ItemVisual, LibraryItem } from '../../ItemLibrary/ItemLibrary';\n\nexport interface NodeType extends ItemVisual {\n /** node type id. this must be unique */\n id: string;\n /** human readable name of the type */\n name: string;\n /** min no. of connectors */\n minConnectors: number;\n defaults: {\n node: OmitStrict<NodeProps, 'type' | 'id'>;\n connector: {\n label: string;\n }[];\n };\n}\n\nexport interface ReferenceProps {\n /** id of the reference node */\n id: string;\n /** label of the reference node */\n label: string;\n}\n\nexport interface NodeProps extends Node {\n /** Unique id for Node */\n id: string;\n /** Label for Node */\n label: string;\n /** Description for Node */\n description?: string;\n /** Referenced Node id */\n reference?: NodeProps['id'];\n /** Additional data for Node */\n additionalData?: AdditionalDataItemProps[];\n /** type of the Node */\n type: NodeType;\n /** error message for node */\n error?: string;\n}\n\nexport interface ModellerNodeComponentProps<NodeComponentData> extends NodeProps {\n data: NodeComponentData;\n}\n\nexport interface NodeComponentData {\n /** Callback for the node actions click */\n onActionClick?: (params: ActionParams, e: MouseEvent | KeyboardEvent) => void;\n /** Callback for the node click */\n onClick?: (nodeId: NodeProps['id'], e: MouseEvent | KeyboardEvent) => void;\n /** Callback for node deletion */\n onDelete?: (params: ActionParams, e: MouseEvent | KeyboardEvent) => void;\n /** Actions for the node click */\n actions?: Action[];\n /** If node is selected */\n selected?: boolean;\n}\n\nexport interface NodeComponentProps extends NodeProps, NodeComponentData {\n referencedNode?: NodeProps;\n}\n\nexport interface AdditionalDataItemProps {\n id: string;\n label: string;\n value: string;\n}\nexport interface ActionParams {\n actionId: string;\n nodeId: NodeProps['id'];\n additionalData?: unknown;\n}\n\nexport interface NodeLibraryItem extends LibraryItem {\n type: NodeType;\n items?: NodeLibraryItem[];\n}\n\nexport const START_NODETYPE: NodeType = Object.freeze({\n id: 'start',\n name: 'start',\n color: 'green',\n icon: 'circle',\n minConnectors: 1,\n defaults: {\n node: {\n label: 'Start'\n },\n connector: []\n }\n});\n\nexport const STOP_NODETYPE: NodeType = Object.freeze({\n id: 'stop',\n name: 'stop',\n color: 'red',\n icon: 'circle',\n minConnectors: 0,\n defaults: {\n node: {\n label: 'Stop'\n },\n connector: []\n }\n});\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { NodeType } from './Node.types';
|
|
2
|
+
import type { NodeType } from './Node.types';
|
|
4
3
|
export declare const StyledCircle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
4
|
export declare const StyledLabel: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").TextProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {
|
|
6
5
|
nodeType: NodeType;
|
|
@@ -18,5 +17,5 @@ export declare const StyledNodeTempleteContent: import("styled-components").Styl
|
|
|
18
17
|
export declare const StyledAdditionalData: import("styled-components").StyledComponent<"dl", import("styled-components").DefaultTheme, {}, never>;
|
|
19
18
|
export declare const StyledAdditionalDataItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
19
|
export declare const StyledTextWithEllipsis: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").TextProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
21
|
-
export declare const StyledErrorIcon:
|
|
20
|
+
export declare const StyledErrorIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
22
21
|
//# sourceMappingURL=NodeTemplate.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTemplate.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplate.styles.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"NodeTemplate.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplate.styles.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,eAAO,MAAM,YAAY,yGAYvB,CAAC;AAIH,eAAO,MAAM,WAAW;cAA4B,QAAQ;SAW1D,CAAC;AAIH,eAAO,MAAM,UAAU,yGAWrB,CAAC;AAI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AAC,IAAI,CAAC,eAAe,CAAC;GAC7C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,wBAAwB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE;IACtD,OAAO,GAAG,CAAA;;;;;;GAMT,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,sBAAsB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEvD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,OAAO,GAAG,CAAA;aACC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM;yBACb,KAAK,CAAC,IAAI,CAAC,OAAO;GACxC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, Card, Text, CardFooter, Icon } from '@pega/cosmos-react-core';\n\nimport type { NodeType } from './Node.types';\n\nexport const StyledCircle = styled.div(({ theme }) => {\n return css`\n height: 2rem;\n width: 2rem;\n background: var(--bg-color);\n border-radius: 50%;\n align-self: center;\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledCircle.defaultProps = defaultThemeProp;\n\nexport const StyledLabel = styled(Text)<{ nodeType: NodeType }>(({ nodeType, theme }) => {\n return css`\n align-self: center;\n ${nodeType.name === 'start'\n ? css`\n padding-block-end: ${theme.base.spacing};\n `\n : css`\n padding-block-start: ${theme.base.spacing};\n `}\n `;\n});\n\nStyledLabel.defaultProps = defaultThemeProp;\n\nexport const StyledIcon = styled.div(({ theme }) => {\n return css`\n min-height: 2rem;\n min-width: 2rem;\n padding: calc(0.5 * ${theme.base.spacing});\n margin-inline-end: ${theme.base.spacing};\n text-align: center;\n background-color: var(--bg-color);\n color: var(--fg-color);\n border-radius: ${theme.base['border-radius']};\n `;\n});\n\nStyledIcon.defaultProps = defaultThemeProp;\n\nexport const StyledNodeTemplateHeader = styled.header(({ theme }) => {\n return css`\n white-space: nowrap;\n button {\n border-radius: ${theme.base['border-radius']};\n }\n `;\n});\n\nStyledNodeTemplateHeader.defaultProps = defaultThemeProp;\n\nexport const StyledText = styled(Text)<{ error?: string | undefined }>(({ error, theme }) => {\n return css`\n padding-inline-end: ${theme.base.spacing};\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: ${error ? '20ch' : '23ch'};\n `;\n});\n\nStyledText.defaultProps = defaultThemeProp;\n\nexport const StyledNodeTemplate = styled(Card)<{ highlight: boolean }>(({ highlight, theme }) => {\n return css`\n width: 17.5rem;\n height: 7.5rem;\n align-self: center;\n overflow: hidden;\n border: 0.125rem solid transparent;\n\n ${highlight &&\n css`\n &&& {\n color: ${theme.base.colors.black};\n background-color: ${theme.base.colors.red['extra-light']};\n border-radius: 0.25rem;\n box-shadow: 0 0 0 0.125rem ${theme.base.colors.red.medium};\n }\n `}\n\n &&& {\n border-radius: ${theme.base['border-radius']};\n }\n\n &:hover {\n cursor: pointer;\n }\n\n :focus-visible {\n box-shadow: ${theme.base.shadow.focus};\n }\n\n &[aria-current='location'] {\n box-shadow: none;\n border: 0.125rem solid ${theme.base.palette.interactive};\n cursor: pointer;\n }\n `;\n});\n\nStyledNodeTemplate.defaultProps = defaultThemeProp;\n\nexport const StyledNodeTemplateFooter = styled(CardFooter)(({ theme }) => {\n return css`\n margin-top: auto;\n &:not(${StyledNodeTemplate} ${StyledNodeTemplate} > &) {\n padding: ${theme.base.spacing};\n }\n `;\n});\n\nStyledNodeTemplateFooter.defaultProps = defaultThemeProp;\n\nexport const StyledNodeTempleteContent = styled.div(({ theme }) => {\n return css`\n padding: ${theme.base.spacing};\n padding-block-start: 0;\n max-height: 2.5rem;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre-wrap;\n word-wrap: break-word;\n `;\n});\n\nStyledNodeTempleteContent.defaultProps = defaultThemeProp;\n\nexport const StyledAdditionalData = styled.dl`\n overflow: hidden;\n`;\n\nexport const StyledAdditionalDataItem = styled.div(({ theme }) => {\n return css`\n padding: 0 calc(0.5 * ${theme.base.spacing});\n background-color: ${theme.base.palette['secondary-background']};\n border-radius: ${theme.base['border-radius']};\n `;\n});\n\nStyledAdditionalDataItem.defaultProps = defaultThemeProp;\n\nexport const StyledTextWithEllipsis = styled(Text)(() => {\n return css`\n overflow: hidden;\n width: auto;\n display: inline-block;\n white-space: nowrap;\n text-overflow: ellipsis;\n `;\n});\n\nStyledTextWithEllipsis.defaultProps = defaultThemeProp;\n\nexport const StyledErrorIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n margin-inline-end: ${theme.base.spacing};\n `;\n});\n\nStyledErrorIcon.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PropsWithoutRef } from 'react';
|
|
2
|
-
import { NodeProps, NodeComponentProps } from './Node.types';
|
|
1
|
+
import type { PropsWithoutRef } from 'react';
|
|
2
|
+
import type { NodeProps, NodeComponentProps } from './Node.types';
|
|
3
3
|
export declare const DefaultNode: ({ id, label, type, description, additionalData, actions, onActionClick, onClick, onDelete, reference, error, selected, referencedNode, ...restProps }: NodeComponentProps) => JSX.Element;
|
|
4
4
|
export declare const StartNode: ({ type, label }: PropsWithoutRef<NodeProps>) => JSX.Element;
|
|
5
5
|
export declare const EndNode: ({ type, label }: PropsWithoutRef<NodeProps>) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTemplates.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplates.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeTemplates.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplates.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAgD,MAAM,OAAO,CAAC;AAuB3F,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAA2B,MAAM,cAAc,CAAC;AAqC3F,eAAO,MAAM,WAAW,0JAerB,kBAAkB,gBAkGpB,CAAC;AAEF,eAAO,MAAM,SAAS,oBAAqB,gBAAgB,SAAS,CAAC,gBAgBpE,CAAC;AAEF,eAAO,MAAM,OAAO,oBAAqB,gBAAgB,SAAS,CAAC,gBAgBlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTemplates.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplates.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,WAAW,EAIX,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AAEnG,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,YAAY,CAAC,aAAa,CAAC,CAAC;AAE5B,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAA2B,EAAE,EAAE;IACjE,OAAO,CACL,MAAC,IAAI,IACH,EAAE,EAAE,wBAAwB,EAC5B,SAAS,EAAE,EAAE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CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAA8B,EAAE,EAAE;IACrE,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,aACzD,KAAC,YAAY,IACX,KAAK,EACH;oBACE,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;iBAClB,EAEpB,QAAQ,EAAE,CAAC,gBACC,KAAK,EACjB,IAAI,EAAC,QAAQ,GACb,EACF,KAAC,WAAW,IAAC,QAAQ,EAAE,IAAI,YAAG,KAAK,GAAe,IAC7C,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n PropsWithoutRef,\n CSSProperties,\n useCallback,\n MouseEvent,\n KeyboardEvent,\n FC,\n useContext\n} from 'react';\nimport { readableColor } from 'polished';\n\nimport { MenuButton, Icon, Flex, useI18n, Text, registerIcon } from '@pega/cosmos-react-core';\nimport * as warnSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/warn-solid.icon';\n\nimport { colorMap } from '../../../utils';\nimport FlowModellerContext from '../FlowModellerContext';\n\nimport {\n StyledLabel,\n StyledCircle,\n StyledIcon,\n StyledNodeTemplateHeader,\n StyledNodeTempleteContent,\n StyledNodeTemplate,\n StyledText,\n StyledTextWithEllipsis,\n StyledAdditionalData,\n StyledNodeTemplateFooter,\n StyledAdditionalDataItem,\n StyledErrorIcon\n} from './NodeTemplate.styles';\nimport { NodeProps, NodeComponentProps, AdditionalDataItemProps } from './Node.types';\n\nregisterIcon(warnSolidIcon);\n\nconst MetaListItem = ({ label, value }: AdditionalDataItemProps) => {\n return (\n <Flex\n as={StyledAdditionalDataItem}\n container={{ wrap: 'nowrap', pad: 0.25, gap: 0.25 }}\n item={{ grow: 1 }}\n >\n <StyledTextWithEllipsis as='dd'>{label}</StyledTextWithEllipsis>\n <Text role='separator' variant='secondary' aria-hidden='true'>\n : \n </Text>\n <StyledTextWithEllipsis as='dt'>{value}</StyledTextWithEllipsis>\n </Flex>\n );\n};\n\nconst MetaList: FC<{ metadata: NodeProps['additionalData'] }> = ({ metadata }) => {\n return (\n <Flex as={StyledAdditionalData} container={{ wrap: 'nowrap', colGap: 1, rowGap: 0.25 }}>\n {metadata?.map((data: AdditionalDataItemProps, index: number) => {\n if (index >= 2) {\n return;\n }\n return <MetaListItem key={data.id} {...data} />;\n })}\n {metadata && metadata.length > 2 && (\n <Flex as={StyledAdditionalDataItem} container={{ pad: 0.25 }} item={{ grow: 1, shrink: 0 }}>\n <StyledTextWithEllipsis as='dt'>{`+${metadata.length - 2}`}</StyledTextWithEllipsis>\n </Flex>\n )}\n </Flex>\n );\n};\nexport const DefaultNode = ({\n id,\n label,\n type,\n description,\n additionalData,\n actions,\n onActionClick,\n onClick,\n onDelete,\n reference,\n error,\n selected,\n referencedNode,\n ...restProps\n}: NodeComponentProps) => {\n const t = useI18n();\n\n const actionItems = actions?.map(actionItem => {\n return {\n id: actionItem.id,\n primary: actionItem.text,\n onClick: (actionId: string, e: MouseEvent) => {\n e.stopPropagation();\n onActionClick?.({ actionId, nodeId: id }, e);\n }\n };\n });\n\n const references = referencedNode && [\n { id: referencedNode?.id, label: t('go_to_noun'), value: referencedNode?.label }\n ];\n\n if (onDelete !== undefined) {\n actionItems?.push({\n id: 'flowmodeller-delete-node',\n primary: t('delete'),\n onClick: (actionId: string, e: MouseEvent) => {\n e.stopPropagation();\n onDelete?.({ actionId, nodeId: id }, e);\n }\n });\n }\n\n const handleEnterKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n onClick?.(id, e);\n }\n },\n [onClick]\n );\n\n const color = readableColor(colorMap[type.color]);\n const { readOnly, highlights } = useContext(FlowModellerContext);\n\n return (\n <StyledNodeTemplate\n aria-label={error ? t('step_name_error', [label]) : label}\n aria-current={selected ? 'location' : undefined}\n onClick={(e: MouseEvent) => onClick?.(id, e)}\n onKeyDown={handleEnterKeyDown}\n id={`modeller-node-${id}`}\n highlight={!!highlights?.nodes?.[id]}\n {...restProps}\n >\n <Flex\n as={StyledNodeTemplateHeader}\n container={{ alignItems: 'center', pad: 1, justify: 'between' }}\n >\n <Flex container={{ alignItems: 'center' }}>\n {error && <StyledErrorIcon name='warn-solid' />}\n <StyledIcon\n id={id}\n style={\n {\n '--bg-color': colorMap[type.color],\n '--fg-color': color\n } as CSSProperties\n }\n >\n <Icon name={type.icon} />\n </StyledIcon>\n <StyledText variant='h4'>{label}</StyledText>\n </Flex>\n {!readOnly && actionItems && (\n <MenuButton\n portal\n variant='simple'\n text={t('actions')}\n icon='more'\n iconOnly\n onClick={(e: MouseEvent) => e.stopPropagation()}\n onKeyDown={(e: KeyboardEvent) => e.stopPropagation()}\n menu={{\n items: actionItems\n }}\n />\n )}\n </Flex>\n {description && <StyledNodeTempleteContent>{description}</StyledNodeTempleteContent>}\n {additionalData && type.minConnectors > 0 && (\n <StyledNodeTemplateFooter>\n <MetaList metadata={additionalData} />\n </StyledNodeTemplateFooter>\n )}\n {references && type.minConnectors < 1 && (\n <StyledNodeTemplateFooter>\n <MetaList metadata={references} />\n </StyledNodeTemplateFooter>\n )}\n </StyledNodeTemplate>\n );\n};\n\nexport const StartNode = ({ type, label }: PropsWithoutRef<NodeProps>) => {\n return (\n <Flex container={{ justify: 'center', direction: 'column' }}>\n <StyledLabel nodeType={type}>{label}</StyledLabel>\n <StyledCircle\n style={\n {\n '--bg-color': colorMap[type.color]\n } as CSSProperties\n }\n tabIndex={0}\n aria-label={label}\n role='button'\n />\n </Flex>\n );\n};\n\nexport const EndNode = ({ type, label }: PropsWithoutRef<NodeProps>) => {\n return (\n <Flex container={{ justify: 'center', direction: 'column' }}>\n <StyledCircle\n style={\n {\n '--bg-color': colorMap[type.color]\n } as CSSProperties\n }\n tabIndex={0}\n aria-label={label}\n role='button'\n />\n <StyledLabel nodeType={type}>{label}</StyledLabel>\n </Flex>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"NodeTemplates.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplates.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AAEnG,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,YAAY,CAAC,aAAa,CAAC,CAAC;AAE5B,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAA2B,EAAE,EAAE;IACjE,OAAO,CACL,MAAC,IAAI,IACH,EAAE,EAAE,wBAAwB,EAC5B,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EACnD,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aAEjB,KAAC,sBAAsB,IAAC,EAAE,EAAC,IAAI,YAAE,KAAK,GAA0B,EAChE,KAAC,IAAI,IAAC,IAAI,EAAC,WAAW,EAAC,OAAO,EAAC,WAAW,iBAAa,MAAM,wBAEtD,EACP,KAAC,sBAAsB,IAAC,EAAE,EAAC,IAAI,YAAE,KAAK,GAA0B,IAC3D,CACR,CAAC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jB,IAAI,EAAC,QAAQ,GACb,EACF,KAAC,WAAW,IAAC,QAAQ,EAAE,IAAI,YAAG,KAAK,GAAe,IAC7C,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useCallback, useContext } from 'react';\nimport type { PropsWithoutRef, CSSProperties, MouseEvent, KeyboardEvent, FC } from 'react';\nimport { readableColor } from 'polished';\n\nimport { MenuButton, Icon, Flex, useI18n, Text, registerIcon } from '@pega/cosmos-react-core';\nimport * as warnSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/warn-solid.icon';\n\nimport { colorMap } from '../../../utils';\nimport FlowModellerContext from '../FlowModellerContext';\n\nimport {\n StyledLabel,\n StyledCircle,\n StyledIcon,\n StyledNodeTemplateHeader,\n StyledNodeTempleteContent,\n StyledNodeTemplate,\n StyledText,\n StyledTextWithEllipsis,\n StyledAdditionalData,\n StyledNodeTemplateFooter,\n StyledAdditionalDataItem,\n StyledErrorIcon\n} from './NodeTemplate.styles';\nimport type { NodeProps, NodeComponentProps, AdditionalDataItemProps } from './Node.types';\n\nregisterIcon(warnSolidIcon);\n\nconst MetaListItem = ({ label, value }: AdditionalDataItemProps) => {\n return (\n <Flex\n as={StyledAdditionalDataItem}\n container={{ wrap: 'nowrap', pad: 0.25, gap: 0.25 }}\n item={{ grow: 1 }}\n >\n <StyledTextWithEllipsis as='dd'>{label}</StyledTextWithEllipsis>\n <Text role='separator' variant='secondary' aria-hidden='true'>\n : \n </Text>\n <StyledTextWithEllipsis as='dt'>{value}</StyledTextWithEllipsis>\n </Flex>\n );\n};\n\nconst MetaList: FC<{ metadata: NodeProps['additionalData'] }> = ({ metadata }) => {\n return (\n <Flex as={StyledAdditionalData} container={{ wrap: 'nowrap', colGap: 1, rowGap: 0.25 }}>\n {metadata?.map((data: AdditionalDataItemProps, index: number) => {\n if (index >= 2) {\n return;\n }\n return <MetaListItem key={data.id} {...data} />;\n })}\n {metadata && metadata.length > 2 && (\n <Flex as={StyledAdditionalDataItem} container={{ pad: 0.25 }} item={{ grow: 1, shrink: 0 }}>\n <StyledTextWithEllipsis as='dt'>{`+${metadata.length - 2}`}</StyledTextWithEllipsis>\n </Flex>\n )}\n </Flex>\n );\n};\nexport const DefaultNode = ({\n id,\n label,\n type,\n description,\n additionalData,\n actions,\n onActionClick,\n onClick,\n onDelete,\n reference,\n error,\n selected,\n referencedNode,\n ...restProps\n}: NodeComponentProps) => {\n const t = useI18n();\n\n const actionItems = actions?.map(actionItem => {\n return {\n id: actionItem.id,\n primary: actionItem.text,\n onClick: (actionId: string, e: MouseEvent) => {\n e.stopPropagation();\n onActionClick?.({ actionId, nodeId: id }, e);\n }\n };\n });\n\n const references = referencedNode && [\n { id: referencedNode?.id, label: t('go_to_noun'), value: referencedNode?.label }\n ];\n\n if (onDelete !== undefined) {\n actionItems?.push({\n id: 'flowmodeller-delete-node',\n primary: t('delete'),\n onClick: (actionId: string, e: MouseEvent) => {\n e.stopPropagation();\n onDelete?.({ actionId, nodeId: id }, e);\n }\n });\n }\n\n const handleEnterKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n onClick?.(id, e);\n }\n },\n [onClick]\n );\n\n const color = readableColor(colorMap[type.color]);\n const { readOnly, highlights } = useContext(FlowModellerContext);\n\n return (\n <StyledNodeTemplate\n aria-label={error ? t('step_name_error', [label]) : label}\n aria-current={selected ? 'location' : undefined}\n onClick={(e: MouseEvent) => onClick?.(id, e)}\n onKeyDown={handleEnterKeyDown}\n id={`modeller-node-${id}`}\n highlight={!!highlights?.nodes?.[id]}\n {...restProps}\n >\n <Flex\n as={StyledNodeTemplateHeader}\n container={{ alignItems: 'center', pad: 1, justify: 'between' }}\n >\n <Flex container={{ alignItems: 'center' }}>\n {error && <StyledErrorIcon name='warn-solid' />}\n <StyledIcon\n id={id}\n style={\n {\n '--bg-color': colorMap[type.color],\n '--fg-color': color\n } as CSSProperties\n }\n >\n <Icon name={type.icon} />\n </StyledIcon>\n <StyledText variant='h4'>{label}</StyledText>\n </Flex>\n {!readOnly && actionItems && (\n <MenuButton\n portal\n variant='simple'\n text={t('actions')}\n icon='more'\n iconOnly\n onClick={(e: MouseEvent) => e.stopPropagation()}\n onKeyDown={(e: KeyboardEvent) => e.stopPropagation()}\n menu={{\n items: actionItems\n }}\n />\n )}\n </Flex>\n {description && <StyledNodeTempleteContent>{description}</StyledNodeTempleteContent>}\n {additionalData && type.minConnectors > 0 && (\n <StyledNodeTemplateFooter>\n <MetaList metadata={additionalData} />\n </StyledNodeTemplateFooter>\n )}\n {references && type.minConnectors < 1 && (\n <StyledNodeTemplateFooter>\n <MetaList metadata={references} />\n </StyledNodeTemplateFooter>\n )}\n </StyledNodeTemplate>\n );\n};\n\nexport const StartNode = ({ type, label }: PropsWithoutRef<NodeProps>) => {\n return (\n <Flex container={{ justify: 'center', direction: 'column' }}>\n <StyledLabel nodeType={type}>{label}</StyledLabel>\n <StyledCircle\n style={\n {\n '--bg-color': colorMap[type.color]\n } as CSSProperties\n }\n tabIndex={0}\n aria-label={label}\n role='button'\n />\n </Flex>\n );\n};\n\nexport const EndNode = ({ type, label }: PropsWithoutRef<NodeProps>) => {\n return (\n <Flex container={{ justify: 'center', direction: 'column' }}>\n <StyledCircle\n style={\n {\n '--bg-color': colorMap[type.color]\n } as CSSProperties\n }\n tabIndex={0}\n aria-label={label}\n role='button'\n />\n <StyledLabel nodeType={type}>{label}</StyledLabel>\n </Flex>\n );\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { Node as GraphNode } from './Renderer/Utils/Graph';
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { Node as GraphNode } from './Renderer/Utils/Graph';
|
|
3
3
|
declare const Node: FC<GraphNode>;
|
|
4
4
|
export default Node;
|
|
5
5
|
//# sourceMappingURL=Node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../../src/components/FlowModeller/Node.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../../src/components/FlowModeller/Node.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAS5C,OAAO,KAAK,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEhE,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAkCtB,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../src/components/FlowModeller/Node.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../src/components/FlowModeller/Node.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMlE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGvE,MAAM,IAAI,GAAkB,IAAI,CAAC,KAAK,CAAC,EAAE;IACvC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,GAC3C,KAAsD,CAAC;IAEzD,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,MAAc,EAAE,CAAa,EAAE,EAAE;QAChC,IAAI,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC,EACD,CAAC,IAAI,EAAE,OAAO,CAAC,CAChB,CAAC;IAEF,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,IAAI,CAAC;KACb;IAED,IAAI,IAAI,EAAE,EAAE,KAAK,cAAc,CAAC,EAAE,EAAE;QAClC,OAAO,KAAC,SAAS,IAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,GAAI,CAAC;KACtE;IACD,IAAI,IAAI,EAAE,EAAE,KAAK,aAAa,CAAC,EAAE,EAAE;QACjC,OAAO,KAAC,OAAO,IAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,GAAI,CAAC;KACpE;IACD,OAAO,CACL,KAAC,WAAW,OACN,SAAS,EACb,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,YAA6C,EACtD,QAAQ,EAAE,IAAI,EAAE,QAAQ,EACxB,aAAa,EAAE,IAAI,EAAE,aAAa,EAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACvB,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC","sourcesContent":["import { memo, useCallback } from 'react';\nimport type { FC, MouseEvent } from 'react';\n\nimport { START_NODETYPE, STOP_NODETYPE } from './Node/Node.types';\nimport type {\n ModellerNodeComponentProps,\n NodeComponentData,\n NodeComponentProps\n} from './Node/Node.types';\nimport { DefaultNode, EndNode, StartNode } from './Node/NodeTemplates';\nimport type { Node as GraphNode } from './Renderer/Utils/Graph';\n\nconst Node: FC<GraphNode> = memo(props => {\n const { id, type, label, data, ...restProps } =\n props as ModellerNodeComponentProps<NodeComponentData>;\n\n const clickHandler = useCallback(\n (nodeId: string, e: MouseEvent) => {\n data?.onClick?.(nodeId, e);\n },\n [data?.onClick]\n );\n\n if (!type) {\n return null;\n }\n\n if (type?.id === START_NODETYPE.id) {\n return <StartNode id={id} type={type} label={label.toUpperCase()} />;\n }\n if (type?.id === STOP_NODETYPE.id) {\n return <EndNode id={id} type={type} label={label.toUpperCase()} />;\n }\n return (\n <DefaultNode\n {...restProps}\n id={id}\n label={label}\n type={type}\n onClick={clickHandler as NodeComponentProps['onClick']}\n onDelete={data?.onDelete}\n onActionClick={data?.onActionClick}\n actions={data?.actions}\n selected={data.selected}\n />\n );\n});\n\nexport default Node;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { RendererProps } from './Renderer.types';
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { RendererProps } from './Renderer.types';
|
|
3
3
|
declare const Renderer: FC<RendererProps>;
|
|
4
4
|
export default Renderer;
|
|
5
5
|
//# sourceMappingURL=Renderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Renderer.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Renderer.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAOhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAwBtD,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA+C/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Renderer.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.tsx"],"names":[],"mappings":";;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Renderer.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CA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c,CAAC;oBACnB,IAAI,IAAI,CAAC,IAAI,EAAE,aAAa,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE;wBACpD,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;qBAChD;oBAED,OAAO,CACL,KAAC,IAAI,IAEH,EAAE,EAAE,iBAAiB,EACrB,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,KAAK,EAAE;4BACL,SAAS,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,IAAI;4BACvC,UAAU,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI;4BACzC,QAAQ,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI;4BAChC,QAAQ,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI;yBACjC,EACD,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,YAE/B,IAAI,IAAI,KAAC,IAAI,OAAK,IAAI,EAAE,cAAc,EAAE,cAAc,GAAI,IAXtD,IAAI,CAAC,EAAE,CAYP,CACR,CAAC;gBACJ,CAAC,CAAC,GACmB,IACT,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { useContext } from 'react';\nimport type { FC } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Flex } from '@pega/cosmos-react-core';\n\nimport FlowModellerContext from '../FlowModellerContext';\n\nimport type { RendererProps } from './Renderer.types';\nimport GraphLayout from './Utils/GraphLayout';\nimport { DirectedGraph } from './Utils/Graph';\n\nconst StyledWrapper = styled.div`\n position: relative;\n width: 100%;\n height: 100%;\n`;\n\nconst StyledContentWrapper = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n`;\n\nconst StyledNodeWrapper = styled(StyledContentWrapper)(() => {\n return css`\n width: var(--width);\n height: var(--height);\n transform: translate(var(--xPos), var(--yPos));\n `;\n});\n\nconst Renderer: FC<RendererProps> = ({ graphData, connector: Connector, node: Node }) => {\n // apply the plotted positions\n const { readOnly } = useContext(FlowModellerContext);\n const graph = new DirectedGraph(graphData);\n const graphDimensions = GraphLayout.plot<RendererProps['graphData']>(graphData, readOnly);\n\n return (\n <StyledWrapper>\n <StyledContentWrapper>\n <svg\n width={graphDimensions.width}\n height={graphDimensions.height}\n viewBox={`0 0 ${graphDimensions.width} ${graphDimensions.height}`}\n >\n {Connector &&\n graphData.connectors.map(item => {\n return <Connector {...item} key={item.id} />;\n })}\n </svg>\n </StyledContentWrapper>\n <StyledContentWrapper>\n {graphData.nodes.map(item => {\n let referencedNode;\n if (item.type?.minConnectors === 0 && item.reference) {\n referencedNode = graph.getNode(item.reference);\n }\n\n return (\n <Flex\n key={item.id}\n as={StyledNodeWrapper}\n id={item.id}\n style={{\n '--width': `${item.dimensions.width}px`,\n '--height': `${item.dimensions.height}px`,\n '--xPos': `${item.position.x}px`,\n '--yPos': `${item.position.y}px`\n }}\n container={{ justify: 'center' }}\n >\n {Node && <Node {...item} referencedNode={referencedNode} />}\n </Flex>\n );\n })}\n </StyledContentWrapper>\n </StyledWrapper>\n );\n};\n\nexport default Renderer;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ConnectorProps, Node, GraphData } from './Utils/Graph';
|
|
3
|
-
import { PlottedGraphConnector, PlottedGraphNode } from './Utils/GraphLayout';
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { ConnectorProps, Node, GraphData } from './Utils/Graph';
|
|
3
|
+
import type { PlottedGraphConnector, PlottedGraphNode } from './Utils/GraphLayout';
|
|
4
4
|
export interface AddNodeHandlerParams {
|
|
5
5
|
refType: 'node' | 'connector';
|
|
6
6
|
refId: string | string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Renderer.types.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Renderer.types.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEnF,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC;IAC9B,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,SAAS,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC;IAC9D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE;QACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC5B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;KAC5C,CAAC;IACF,SAAS,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC;IACtC,IAAI,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC;CAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Renderer.types.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.types.ts"],"names":[],"mappings":"","sourcesContent":["import { FC } from 'react';\n\nimport { ConnectorProps, Node, GraphData } from './Utils/Graph';\nimport { PlottedGraphConnector, PlottedGraphNode } from './Utils/GraphLayout';\n\nexport interface AddNodeHandlerParams {\n refType: 'node' | 'connector';\n refId: string | string[];\n}\n\nexport interface RendererProps {\n graphData: GraphData<PlottedGraphNode, PlottedGraphConnector>;\n disableAutoLayout?: boolean;\n highlights?: {\n nodes: Record<string, Node>;\n connectors: Record<string, ConnectorProps>;\n };\n connector?: FC<PlottedGraphConnector>;\n node?: FC<PlottedGraphNode>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Renderer.types.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { FC } from 'react';\n\nimport type { ConnectorProps, Node, GraphData } from './Utils/Graph';\nimport type { PlottedGraphConnector, PlottedGraphNode } from './Utils/GraphLayout';\n\nexport interface AddNodeHandlerParams {\n refType: 'node' | 'connector';\n refId: string | string[];\n}\n\nexport interface RendererProps {\n graphData: GraphData<PlottedGraphNode, PlottedGraphConnector>;\n disableAutoLayout?: boolean;\n highlights?: {\n nodes: Record<string, Node>;\n connectors: Record<string, ConnectorProps>;\n };\n connector?: FC<PlottedGraphConnector>;\n node?: FC<PlottedGraphNode>;\n}\n"]}
|
|
@@ -1,66 +1,16 @@
|
|
|
1
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;
|
|
2
13
|
constructor(graphData = { nodes: [], connectors: [] }) {
|
|
3
|
-
Object.defineProperty(this, "nodes", {
|
|
4
|
-
enumerable: true,
|
|
5
|
-
configurable: true,
|
|
6
|
-
writable: true,
|
|
7
|
-
value: {}
|
|
8
|
-
});
|
|
9
|
-
Object.defineProperty(this, "connectors", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
configurable: true,
|
|
12
|
-
writable: true,
|
|
13
|
-
value: {}
|
|
14
|
-
});
|
|
15
|
-
// additional way to maintain related data - for cases where Graph is used for indirect purposes
|
|
16
|
-
Object.defineProperty(this, "nodeData", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
configurable: true,
|
|
19
|
-
writable: true,
|
|
20
|
-
value: {}
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(this, "connectorData", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
configurable: true,
|
|
25
|
-
writable: true,
|
|
26
|
-
value: {}
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(this, "inConnectors", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true,
|
|
32
|
-
value: {}
|
|
33
|
-
}); // we are maintaining connector reference instead of id, to avoid iterations later on.
|
|
34
|
-
Object.defineProperty(this, "prevNodesCount", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true,
|
|
38
|
-
value: {}
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(this, "outConnectors", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
writable: true,
|
|
44
|
-
value: {}
|
|
45
|
-
}); // we are maintaining connector reference instead of id, to avoid iterations later on
|
|
46
|
-
Object.defineProperty(this, "nextNodesCount", {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
configurable: true,
|
|
49
|
-
writable: true,
|
|
50
|
-
value: {}
|
|
51
|
-
});
|
|
52
|
-
Object.defineProperty(this, "nodeCount", {
|
|
53
|
-
enumerable: true,
|
|
54
|
-
configurable: true,
|
|
55
|
-
writable: true,
|
|
56
|
-
value: 0
|
|
57
|
-
});
|
|
58
|
-
Object.defineProperty(this, "connectorsCount", {
|
|
59
|
-
enumerable: true,
|
|
60
|
-
configurable: true,
|
|
61
|
-
writable: true,
|
|
62
|
-
value: 0
|
|
63
|
-
});
|
|
64
14
|
// Not necessary to clone, as this class never modifies any nodes
|
|
65
15
|
graphData.nodes.forEach(item => this.addNode(item));
|
|
66
16
|
// copy/clone, connectors properties 'fromNodeId' and 'toNodeId' values may get modified by this class
|