@pega/cosmos-react-build 2.0.0-dev.20.0 → 2.0.0-dev.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  2. package/lib/components/AppShell/AppShell.js +41 -44
  3. package/lib/components/AppShell/AppShell.js.map +1 -1
  4. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  5. package/lib/components/AppShell/AppShell.styles.js +22 -17
  6. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  7. package/lib/components/AppShell/AppShell.types.d.ts +14 -9
  8. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  9. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  10. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  11. package/lib/components/AppShell/AppShellContext.js +5 -3
  12. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  13. package/lib/components/FlowModeller/FlowModeller.d.ts +6 -5
  14. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -1
  15. package/lib/components/FlowModeller/FlowModeller.js +184 -61
  16. package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
  17. package/lib/components/FlowModeller/Node/Node.types.d.ts +26 -16
  18. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -1
  19. package/lib/components/FlowModeller/Node/Node.types.js +27 -1
  20. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -1
  21. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +10 -5
  22. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
  23. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +38 -31
  24. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
  25. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +1 -4
  26. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
  27. package/lib/components/FlowModeller/Node/NodeTemplates.js +25 -19
  28. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
  29. package/lib/components/FlowModeller/NodeLibrary.d.ts +12 -0
  30. package/lib/components/FlowModeller/NodeLibrary.d.ts.map +1 -0
  31. package/lib/components/FlowModeller/NodeLibrary.js +49 -0
  32. package/lib/components/FlowModeller/NodeLibrary.js.map +1 -0
  33. package/lib/components/FlowModeller/Renderer/AddNode.d.ts +10 -0
  34. package/lib/components/FlowModeller/Renderer/AddNode.d.ts.map +1 -0
  35. package/lib/components/FlowModeller/Renderer/AddNode.js +42 -0
  36. package/lib/components/FlowModeller/Renderer/AddNode.js.map +1 -0
  37. package/lib/components/FlowModeller/Renderer/Connector.d.ts +5 -0
  38. package/lib/components/FlowModeller/Renderer/Connector.d.ts.map +1 -0
  39. package/lib/components/FlowModeller/Renderer/Connector.js +50 -0
  40. package/lib/components/FlowModeller/Renderer/Connector.js.map +1 -0
  41. package/lib/components/FlowModeller/Renderer/ConnectorsContainer.d.ts +12 -0
  42. package/lib/components/FlowModeller/Renderer/ConnectorsContainer.d.ts.map +1 -0
  43. package/lib/components/FlowModeller/Renderer/ConnectorsContainer.js +15 -0
  44. package/lib/components/FlowModeller/Renderer/ConnectorsContainer.js.map +1 -0
  45. package/lib/components/FlowModeller/Renderer/Node.d.ts +5 -0
  46. package/lib/components/FlowModeller/Renderer/Node.d.ts.map +1 -0
  47. package/lib/components/FlowModeller/Renderer/Node.js +18 -0
  48. package/lib/components/FlowModeller/Renderer/Node.js.map +1 -0
  49. package/lib/components/FlowModeller/Renderer/NodesContainer.d.ts +8 -0
  50. package/lib/components/FlowModeller/Renderer/NodesContainer.d.ts.map +1 -0
  51. package/lib/components/FlowModeller/Renderer/NodesContainer.js +15 -0
  52. package/lib/components/FlowModeller/Renderer/NodesContainer.js.map +1 -0
  53. package/lib/components/FlowModeller/Renderer/Renderer.d.ts +5 -0
  54. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +1 -0
  55. package/lib/components/FlowModeller/Renderer/Renderer.js +17 -0
  56. package/lib/components/FlowModeller/Renderer/Renderer.js.map +1 -0
  57. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +18 -0
  58. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +1 -0
  59. package/lib/components/FlowModeller/Renderer/Renderer.types.js +2 -0
  60. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +1 -0
  61. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +51 -0
  62. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +1 -0
  63. package/lib/components/FlowModeller/Renderer/Utils/Graph.js +247 -0
  64. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -0
  65. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +35 -0
  66. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +1 -0
  67. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +104 -0
  68. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +1 -0
  69. package/lib/components/FlowModeller/helper.d.ts +22 -0
  70. package/lib/components/FlowModeller/helper.d.ts.map +1 -0
  71. package/lib/components/FlowModeller/helper.js +97 -0
  72. package/lib/components/FlowModeller/helper.js.map +1 -0
  73. package/lib/components/LifeCycle/Stage.d.ts +3 -1
  74. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  75. package/lib/components/LifeCycle/Stage.js +9 -2
  76. package/lib/components/LifeCycle/Stage.js.map +1 -1
  77. package/lib/components/LifeCycle/Step.d.ts +4 -1
  78. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  79. package/lib/components/LifeCycle/Step.js +12 -2
  80. package/lib/components/LifeCycle/Step.js.map +1 -1
  81. package/lib/components/LifeCycle/Task.d.ts +3 -1
  82. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  83. package/lib/components/LifeCycle/Task.js +11 -2
  84. package/lib/components/LifeCycle/Task.js.map +1 -1
  85. package/lib/components/SummaryCard/SummaryCard.d.ts.map +1 -1
  86. package/lib/components/SummaryCard/SummaryCard.js +2 -1
  87. package/lib/components/SummaryCard/SummaryCard.js.map +1 -1
  88. package/package.json +4 -3
  89. package/lib/components/FlowModeller/Connector.d.ts +0 -30
  90. package/lib/components/FlowModeller/Connector.d.ts.map +0 -1
  91. package/lib/components/FlowModeller/Connector.js +0 -89
  92. package/lib/components/FlowModeller/Connector.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"NodeTemplate.styles.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplate.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAI9E,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IAC3E,MAAM,OAAO,GAAG,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;IAChG,OAAO,GAAG,CAAA;;;kBAGM,OAAO;;;;;oBAKL,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;GAExC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAmB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7E,OAAO,GAAG,CAAA;;MAEN,IAAI,K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AAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;0BACc,KAAK,CAAC,IAAI,CAAC,OAAO;;;;GAIzC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;;;;;;kCAMsB,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;;;oBAIzC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;QAEnC,gBAAgB;;;;;;GAMrB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,OAAO,GAAG,CAAA;eACG,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;;;;GAS9B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3D,OAAO,GAAG,CAAA;eACG,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;;;;GAS9B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport { Label, defaultThemeProp, Card, Text } from '@pega/cosmos-react-core';\n\nimport { NodeProps } from './Node.types';\n\nexport const StyledCircle = styled.div<{ type: string }>(({ theme, type }) => {\n const bgColor = type === 'start' ? theme.base.colors.green.medium : theme.base.colors.red.light;\n return css`\n height: 2rem;\n width: 2rem;\n background: ${bgColor};\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(Label)<{ type: string }>(({ type, theme }) => {\n return css`\n align-self: center;\n ${type === '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<Pick<NodeProps, 'type'>>(({ theme, type }) => {\n const visualBg: { [key: string]: string } = {\n assignment: theme.base.colors.green.medium,\n decision: theme.base.colors.purple.medium,\n question: theme.base.colors.green.dark,\n message: theme.base.colors.orange.medium,\n automation: theme.base.colors.blue.light\n };\n\n const contrastColor = readableColor(visualBg[type]);\n\n return css`\n min-height: 2rem;\n min-width: 2rem;\n background: ${visualBg[type]};\n padding: calc(0.5 * ${theme.base.spacing});\n margin-inline-end: ${theme.base.spacing};\n text-align: center;\n color: ${contrastColor};\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n `;\n});\n\nStyledIcon.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled.header(() => {\n return css`\n white-space: nowrap;\n button {\n visibility: hidden;\n }\n `;\n});\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledText = styled(Text)(({ theme }) => {\n return css`\n padding-inline-end: ${theme.base.spacing};\n overflow: hidden;\n max-width: 12rem;\n text-overflow: ellipsis;\n `;\n});\n\nStyledText.defaultProps = defaultThemeProp;\n\nexport const StyledCard = styled(Card)(({ theme }) => {\n return css`\n min-width: 17.5rem;\n min-height: 7rem;\n align-self: center;\n overflow: hidden;\n &&& {\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n }\n &:focus-within,\n &:hover {\n box-shadow: ${theme.base.shadow.focus};\n cursor: pointer;\n ${StyledCardHeader} {\n button {\n visibility: visible;\n }\n }\n }\n `;\n});\n\nStyledCard.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled.div(({ theme }) => {\n return css`\n padding: ${theme.base.spacing};\n padding-block-start: 0;\n max-width: 17.5rem;\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 `;\n});\n\nStyledCardContent.defaultProps = defaultThemeProp;\n\nexport const StyledAdditionalData = styled.div(({ theme }) => {\n return css`\n padding: ${theme.base.spacing};\n padding-block-start: 0;\n max-width: 17.5rem;\n max-height: 1rem;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n `;\n});\n\nStyledAdditionalData.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"NodeTemplate.styles.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplate.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAI1F,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAA+B,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IACxF,OAAO,GAAG,CAAA;;;kBAGM,KAAK;;;;;oBAKH,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;GAExC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB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AC,CAAC;AACH,wBAAwB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE;IACtD,OAAO,GAAG,CAAA;;;;;;GAMT,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,sBAAsB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport { Label, defaultThemeProp, Card, Text, CardFooter } from '@pega/cosmos-react-core';\n\nimport { NodeType } from './Node.types';\n\nexport const StyledCircle = styled.div<{ color: NodeType['color'] }>(({ theme, color }) => {\n return css`\n height: 2rem;\n width: 2rem;\n background: ${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(Label)<{ type: NodeType }>(({ type, theme }) => {\n return css`\n align-self: center;\n ${type.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<{ color: string }>(({ theme, color }) => {\n const contrastColor = readableColor(color);\n\n return css`\n min-height: 2rem;\n min-width: 2rem;\n background: ${color};\n padding: calc(0.5 * ${theme.base.spacing});\n margin-inline-end: ${theme.base.spacing};\n text-align: center;\n color: ${contrastColor};\n border-radius: ${theme.base['border-radius']};\n `;\n});\n\nStyledIcon.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled.header(({ theme }) => {\n return css`\n white-space: nowrap;\n button {\n visibility: hidden;\n border-radius: ${theme.base['border-radius']};\n }\n `;\n});\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledText = styled(Text)(({ theme }) => {\n return css`\n padding-inline-end: ${theme.base.spacing};\n overflow: hidden;\n min-width: 12rem;\n text-overflow: ellipsis;\n `;\n});\n\nStyledText.defaultProps = defaultThemeProp;\n\nexport const StyledCard = styled(Card)(({ theme }) => {\n return css`\n width: 17.5rem;\n height: 7.5rem;\n align-self: center;\n overflow: hidden;\n &&& {\n border-radius: ${theme.base['border-radius']};\n }\n &:focus-within,\n &:hover {\n box-shadow: ${theme.base.shadow.focus};\n cursor: pointer;\n ${StyledCardHeader} {\n button {\n visibility: visible;\n }\n }\n }\n `;\n});\n\nexport const StyledCardFooter = styled(CardFooter)(() => {\n return css`\n margin-top: auto;\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: 0.5rem;\n }\n `;\n});\n\nStyledCard.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled.div(({ theme }) => {\n return css`\n padding: ${theme.base.spacing};\n padding-block-start: 0;\n max-height: 2.5rem;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n `;\n});\n\nStyledCardContent.defaultProps = defaultThemeProp;\n\nexport const StyledAdditionalData = styled.dl`\n overflow: hidden;\n`;\n\nexport const StyledAdditionalDataItem = styled.div(({ theme }) => {\n return css`\n padding: 0 calc(0.5 * ${theme.base.spacing});\n background-color: ${theme.base.palette['secondary-background']};\n border-radius: ${theme.base['border-radius']};\n `;\n});\nStyledAdditionalDataItem.defaultProps = defaultThemeProp;\n\nexport const StyledTextWithEllipsis = styled(Text)(() => {\n return css`\n overflow: hidden;\n width: auto;\n display: inline-block;\n white-space: nowrap;\n text-overflow: ellipsis;\n `;\n});\nStyledTextWithEllipsis.defaultProps = defaultThemeProp;\n"]}
@@ -1,9 +1,6 @@
1
1
  import { PropsWithoutRef } from 'react';
2
2
  import { NodeProps, NodeComponentProps } from './Node.types';
3
- export declare const assignmentVisual: {
4
- [key in NodeProps['type']]: string;
5
- };
6
- export declare const DefaultNode: import("react").ForwardRefExoticComponent<Pick<NodeComponentProps, "description" | "label" | "id" | "type" | "onClick" | "actions" | "additionalData" | "connectors" | "onActionClick"> & import("react").RefAttributes<HTMLElement>>;
3
+ export declare const DefaultNode: import("react").ForwardRefExoticComponent<Pick<NodeComponentProps, "description" | "data" | "label" | "id" | "type" | "onClick" | "actions" | "additionalData" | "onActionClick"> & import("react").RefAttributes<HTMLElement>>;
7
4
  export declare const StartNode: ({ type, label }: PropsWithoutRef<NodeProps>) => JSX.Element;
8
5
  export declare const EndNode: ({ type, label }: PropsWithoutRef<NodeProps>) => JSX.Element;
9
6
  //# sourceMappingURL=NodeTemplates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeTemplates.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplates.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAsD,MAAM,OAAO,CAAC;AAuB5F,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE7D,eAAO,MAAM,gBAAgB,EAAE;KAAG,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM;CAQlE,CAAC;AAEF,eAAO,MAAM,WAAW,uOA2GvB,CAAC;AAEF,eAAO,MAAM,SAAS,oBAAqB,gBAAgB,SAAS,CAAC,gBASpE,CAAC;AAEF,eAAO,MAAM,OAAO,oBAAqB,gBAAgB,SAAS,CAAC,gBASlE,CAAC"}
1
+ {"version":3,"file":"NodeTemplates.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplates.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA0D,MAAM,OAAO,CAAC;AA0BhG,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAA2B,MAAM,cAAc,CAAC;AA8DtF,eAAO,MAAM,WAAW,iOA8FvB,CAAC;AAEF,eAAO,MAAM,SAAS,oBAAqB,gBAAgB,SAAS,CAAC,gBASpE,CAAC;AAEF,eAAO,MAAM,OAAO,oBAAqB,gBAAgB,SAAS,CAAC,gBASlE,CAAC"}
@@ -1,17 +1,28 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, forwardRef } from 'react';
3
3
  import { MenuButton, Icon, Flex, Tooltip, useElement, useI18n, cap, Text } from '@pega/cosmos-react-core';
4
- import { StyledLabel, StyledCircle, StyledIcon, StyledCardHeader, StyledCardContent, StyledCard, StyledText, StyledAdditionalData } from './NodeTemplate.styles';
5
- export const assignmentVisual = {
6
- start: '',
7
- stop: '',
8
- decision: 'arrow-bend-left',
9
- question: 'chat-help',
10
- message: 'chat',
11
- assignment: 'clipboard-data',
12
- automation: 'polaris'
4
+ import { StyledLabel, StyledCircle, StyledIcon, StyledCardHeader, StyledCardContent, StyledCard, StyledText, StyledTextWithEllipsis, StyledAdditionalData, StyledCardFooter, StyledAdditionalDataItem } from './NodeTemplate.styles';
5
+ const MetaListItem = ({ label, value }) => {
6
+ const [nodeAdditionalDataItem, setNodeAdditionalDataItem] = useElement();
7
+ return (_jsxs(_Fragment, { children: [_jsxs(Flex, { as: StyledAdditionalDataItem, container: { wrap: 'nowrap', pad: 0.25, gap: 0.25 }, item: { grow: 1 }, ref: setNodeAdditionalDataItem, children: [_jsx(StyledTextWithEllipsis, { as: 'dd', children: label }, void 0), _jsx(Text, { role: 'separator', variant: 'secondary', "aria-hidden": 'true', children: ":\u00A0" }, void 0), _jsx(StyledTextWithEllipsis, { as: 'dt', children: value }, void 0)] }, void 0), _jsx(Tooltip, { target: nodeAdditionalDataItem, hideDelay: 'none', children: `${label}:${value}` }, void 0)] }, void 0));
13
8
  };
14
- export const DefaultNode = forwardRef(({ id, label, type = 'assignment', description, additionalData, actions = [], onActionClick, onClick, ...restProps }, ref) => {
9
+ const MetaList = ({ metadata }) => {
10
+ const [nodeAdditionalData, setNodeAdditionalData] = useElement();
11
+ let additionalDataValue = '';
12
+ metadata?.forEach((item, index) => {
13
+ if (index > 1) {
14
+ additionalDataValue += `${item.label}: ${item.value}
15
+ `;
16
+ }
17
+ });
18
+ return (_jsxs(Flex, { as: StyledAdditionalData, container: { wrap: 'nowrap', colGap: 1, rowGap: 0.25 }, children: [metadata?.map((data, index) => {
19
+ if (index >= 2) {
20
+ return;
21
+ }
22
+ return _jsx(MetaListItem, { ...data }, data.id);
23
+ }), metadata && metadata.length > 2 && (_jsxs(_Fragment, { children: [_jsx(Flex, { as: StyledAdditionalDataItem, container: { pad: 0.25 }, item: { grow: 1, shrink: 0 }, ref: setNodeAdditionalData, children: _jsx(StyledTextWithEllipsis, { as: 'dt', children: `+${metadata?.length - 2}` }, void 0) }, void 0), additionalDataValue && (_jsx(Tooltip, { target: nodeAdditionalData, hideDelay: 'none', children: additionalDataValue }, void 0))] }, void 0))] }, void 0));
24
+ };
25
+ export const DefaultNode = forwardRef(({ id, label, type, description, additionalData, actions, onActionClick, onClick, ...restProps }, ref) => {
15
26
  const t = useI18n();
16
27
  const actionItems = actions?.map(actionItem => {
17
28
  return {
@@ -28,22 +39,17 @@ export const DefaultNode = forwardRef(({ id, label, type = 'assignment', descrip
28
39
  onClick?.(id);
29
40
  }
30
41
  }, [onClick]);
31
- const additionalDataValue = additionalData &&
32
- additionalData.map((data, index) => {
33
- return `${data.label}: ${data.value}${index === additionalData.length - 1 ? '' : ', '}`;
34
- });
35
42
  const [nodeLabel, setNodeLabel] = useElement();
36
43
  const [nodeDescription, setNodeDescription] = useElement();
37
- const [nodeAdditionalData, setNodeAdditionalData] = useElement();
38
44
  const [nodeIcon, setNodeIcon] = useElement();
39
- return (_jsxs(StyledCard, { "aria-label": label, onClick: () => onClick?.(id), onKeyDown: handleEnterKeyDown, ref: ref, ...restProps, children: [_jsxs(Flex, { as: StyledCardHeader, container: { alignItems: 'center', justify: 'between', pad: 1, gap: 1 }, children: [_jsxs(Flex, { container: { alignItems: 'center', wrap: 'nowrap' }, children: [_jsx(StyledIcon, { id: id, type: type, ref: setNodeIcon, children: _jsx(Icon, { name: assignmentVisual[type] }, void 0) }, void 0), _jsx(Tooltip, { target: nodeIcon, hideDelay: 'none', children: cap(type) }, void 0), _jsx(StyledText, { variant: 'h4', ref: setNodeLabel, children: label }, void 0), _jsx(Tooltip, { describeTarget: false, target: nodeLabel, hideDelay: 'none', children: label }, void 0)] }, void 0), _jsx(MenuButton, { portal: true, variant: 'simple', text: t('actions'), icon: 'more', iconOnly: true, onClick: (e) => e.stopPropagation(), onKeyDown: (e) => e.stopPropagation(), menu: {
45
+ return (_jsxs(StyledCard, { "aria-label": label, onClick: () => onClick?.(id), onKeyDown: handleEnterKeyDown, ref: ref, ...restProps, children: [_jsxs(Flex, { as: StyledCardHeader, container: { alignItems: 'center', pad: 1 }, children: [_jsx(StyledIcon, { id: id, color: type.color, ref: setNodeIcon, children: _jsx(Icon, { name: type.icon }, void 0) }, void 0), _jsx(Tooltip, { target: nodeIcon, hideDelay: 'none', children: cap(type.name) }, void 0), _jsx(StyledText, { variant: 'h4', ref: setNodeLabel, children: label }, void 0), _jsx(Tooltip, { describeTarget: false, target: nodeLabel, hideDelay: 'none', children: label }, void 0), actionItems && (_jsx(MenuButton, { portal: true, variant: 'simple', text: t('actions'), icon: 'more', iconOnly: true, onClick: (e) => e.stopPropagation(), onKeyDown: (e) => e.stopPropagation(), menu: {
40
46
  items: actionItems
41
- } }, void 0)] }, void 0), description && (_jsxs(_Fragment, { children: [_jsx(StyledCardContent, { ref: setNodeDescription, children: description }, void 0), _jsx(Tooltip, { describeTarget: false, target: nodeDescription, hideDelay: 'none', children: description }, void 0)] }, void 0)), additionalDataValue && (_jsxs(_Fragment, { children: [_jsx(StyledAdditionalData, { ref: setNodeAdditionalData, children: _jsx(Text, { variant: 'secondary', children: additionalDataValue }, void 0) }, void 0), _jsx(Tooltip, { describeTarget: false, target: nodeAdditionalData, hideDelay: 'none', children: additionalDataValue }, void 0)] }, void 0))] }, void 0));
47
+ } }, void 0))] }, void 0), description && (_jsxs(_Fragment, { children: [_jsx(StyledCardContent, { ref: setNodeDescription, children: description }, void 0), _jsx(Tooltip, { describeTarget: false, target: nodeDescription, hideDelay: 'none', children: description }, void 0)] }, void 0)), additionalData && (_jsx(StyledCardFooter, { children: _jsx(MetaList, { metadata: additionalData }, void 0) }, void 0))] }, void 0));
42
48
  });
43
49
  export const StartNode = ({ type, label }) => {
44
- return (_jsxs(Flex, { container: { justify: 'center', direction: 'column' }, children: [_jsx(Flex, { as: StyledLabel, type: type, children: label }, void 0), _jsx(Flex, { as: StyledCircle, type: type, tabIndex: '0', "aria-label": label, role: 'button' }, void 0)] }, void 0));
50
+ return (_jsxs(Flex, { container: { justify: 'center', direction: 'column' }, children: [_jsx(Flex, { as: StyledLabel, type: type, children: label }, void 0), _jsx(Flex, { as: StyledCircle, color: type.color, tabIndex: '0', "aria-label": label, role: 'button' }, void 0)] }, void 0));
45
51
  };
46
52
  export const EndNode = ({ type, label }) => {
47
- return (_jsxs(Flex, { container: { justify: 'center', direction: 'column' }, children: [_jsx(Flex, { as: StyledCircle, type: type, tabIndex: '0', "aria-label": label, role: 'button' }, void 0), _jsx(Flex, { as: StyledLabel, type: type, children: label }, void 0)] }, void 0));
53
+ return (_jsxs(Flex, { container: { justify: 'center', direction: 'column' }, children: [_jsx(Flex, { as: StyledCircle, color: type.color, tabIndex: '0', "aria-label": label, role: 'button' }, void 0), _jsx(Flex, { as: StyledLabel, type: type, children: label }, void 0)] }, void 0));
48
54
  };
49
55
  //# sourceMappingURL=NodeTemplates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeTemplates.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplates.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmB,WAAW,EAA6B,UAAU,EAAE,MAAM,OAAO,CAAC;AAE5F,OAAO,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,GAAG,EACH,IAAI,EACL,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,gB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IAAI,IAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,YAC9B,KAAK,WACD,EACP,KAAC,IAAI,IAAC,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAC,GAAG,gBAAa,KAAK,EAAE,IAAI,EAAC,QAAQ,WAAG,YAC/E,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAA8B,EAAE,EAAE;IACrE,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,aACzD,KAAC,IAAI,IAAC,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAC,GAAG,gBAAa,KAAK,EAAE,IAAI,EAAC,QAAQ,WAAG,EACpF,KAAC,IAAI,IAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,YAC9B,KAAK,WACD,YACF,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { PropsWithoutRef, useCallback, MouseEvent, KeyboardEvent, forwardRef } from 'react';\n\nimport {\n MenuButton,\n Icon,\n Flex,\n Tooltip,\n useElement,\n useI18n,\n cap,\n Text\n} from '@pega/cosmos-react-core';\n\nimport {\n StyledLabel,\n StyledCircle,\n StyledIcon,\n StyledCardHeader,\n StyledCardContent,\n StyledCard,\n StyledText,\n StyledAdditionalData\n} from './NodeTemplate.styles';\nimport { NodeProps, NodeComponentProps } from './Node.types';\n\nexport const assignmentVisual: { [key in NodeProps['type']]: string } = {\n start: '',\n stop: '',\n decision: 'arrow-bend-left',\n question: 'chat-help',\n message: 'chat',\n assignment: 'clipboard-data',\n automation: 'polaris'\n};\n\nexport const DefaultNode = forwardRef(\n (\n {\n id,\n label,\n type = 'assignment',\n description,\n additionalData,\n actions = [],\n onActionClick,\n onClick,\n ...restProps\n }: PropsWithoutRef<NodeComponentProps>,\n ref: NodeComponentProps['ref']\n ) => {\n const t = useI18n();\n const actionItems = actions?.map(actionItem => {\n return {\n id: actionItem.id,\n primary: actionItem.text,\n onClick: (actionId: string, e: MouseEvent) => {\n e.stopPropagation();\n onActionClick?.({ actionId, nodeId: id }, e);\n }\n };\n });\n\n const handleEnterKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n onClick?.(id);\n }\n },\n [onClick]\n );\n\n const additionalDataValue =\n additionalData &&\n additionalData.map((data, index) => {\n return `${data.label}: ${data.value}${index === additionalData.length - 1 ? '' : ', '}`;\n });\n\n const [nodeLabel, setNodeLabel] = useElement();\n const [nodeDescription, setNodeDescription] = useElement();\n const [nodeAdditionalData, setNodeAdditionalData] = useElement();\n const [nodeIcon, setNodeIcon] = useElement();\n\n return (\n <StyledCard\n aria-label={label}\n onClick={() => onClick?.(id)}\n onKeyDown={handleEnterKeyDown}\n ref={ref}\n {...restProps}\n >\n <Flex\n as={StyledCardHeader}\n container={{ alignItems: 'center', justify: 'between', pad: 1, gap: 1 }}\n >\n <Flex container={{ alignItems: 'center', wrap: 'nowrap' }}>\n <StyledIcon id={id} type={type} ref={setNodeIcon}>\n <Icon name={assignmentVisual[type]} />\n </StyledIcon>\n <Tooltip target={nodeIcon} hideDelay='none'>\n {cap(type)}\n </Tooltip>\n <StyledText variant='h4' ref={setNodeLabel}>\n {label}\n </StyledText>\n <Tooltip describeTarget={false} target={nodeLabel} hideDelay='none'>\n {label}\n </Tooltip>\n </Flex>\n <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 </Flex>\n {description && (\n <>\n <StyledCardContent ref={setNodeDescription}>{description}</StyledCardContent>\n <Tooltip describeTarget={false} target={nodeDescription} hideDelay='none'>\n {description}\n </Tooltip>\n </>\n )}\n {additionalDataValue && (\n <>\n <StyledAdditionalData ref={setNodeAdditionalData}>\n <Text variant='secondary'>{additionalDataValue}</Text>\n </StyledAdditionalData>\n <Tooltip describeTarget={false} target={nodeAdditionalData} hideDelay='none'>\n {additionalDataValue}\n </Tooltip>\n </>\n )}\n </StyledCard>\n );\n }\n);\n\nexport const StartNode = ({ type, label }: PropsWithoutRef<NodeProps>) => {\n return (\n <Flex container={{ justify: 'center', direction: 'column' }}>\n <Flex as={StyledLabel} type={type}>\n {label}\n </Flex>\n <Flex as={StyledCircle} type={type} tabIndex='0' aria-label={label} role='button' />\n </Flex>\n );\n};\n\nexport const EndNode = ({ type, label }: PropsWithoutRef<NodeProps>) => {\n return (\n <Flex container={{ justify: 'center', direction: 'column' }}>\n <Flex as={StyledCircle} type={type} tabIndex='0' aria-label={label} role='button' />\n <Flex as={StyledLabel} type={type}>\n {label}\n </Flex>\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"NodeTemplates.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Node/NodeTemplates.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmB,WAAW,EAA6B,UAAU,EAAM,MAAM,OAAO,CAAC;AAEhG,OAAO,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,GAAG,EACH,IAAI,EACL,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAG/B,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAA2B,EAAE,EAAE;IACjE,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,UAAU,EAAE,CAAC;IACzE,OAAO,CACL,8BACE,MAAC,IAAI,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AAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,aACzD,KAAC,IAAI,IAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAC,GAAG,gBAAa,KAAK,EAAE,IAAI,EAAC,QAAQ,WAAG,EAC3F,KAAC,IAAI,IAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,YAC9B,KAAK,WACD,YACF,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { PropsWithoutRef, useCallback, MouseEvent, KeyboardEvent, forwardRef, FC } from 'react';\n\nimport {\n MenuButton,\n Icon,\n Flex,\n Tooltip,\n useElement,\n useI18n,\n cap,\n Text\n} from '@pega/cosmos-react-core';\n\nimport {\n StyledLabel,\n StyledCircle,\n StyledIcon,\n StyledCardHeader,\n StyledCardContent,\n StyledCard,\n StyledText,\n StyledTextWithEllipsis,\n StyledAdditionalData,\n StyledCardFooter,\n StyledAdditionalDataItem\n} from './NodeTemplate.styles';\nimport { NodeProps, NodeComponentProps, AdditionalDataItemProps } from './Node.types';\n\nconst MetaListItem = ({ label, value }: AdditionalDataItemProps) => {\n const [nodeAdditionalDataItem, setNodeAdditionalDataItem] = useElement();\n return (\n <>\n <Flex\n as={StyledAdditionalDataItem}\n container={{ wrap: 'nowrap', pad: 0.25, gap: 0.25 }}\n item={{ grow: 1 }}\n ref={setNodeAdditionalDataItem}\n >\n <StyledTextWithEllipsis as='dd'>{label}</StyledTextWithEllipsis>\n <Text role='separator' variant='secondary' aria-hidden='true'>\n :&nbsp;\n </Text>\n <StyledTextWithEllipsis as='dt'>{value}</StyledTextWithEllipsis>\n </Flex>\n <Tooltip target={nodeAdditionalDataItem} hideDelay='none'>\n {`${label}:${value}`}\n </Tooltip>\n </>\n );\n};\n\nconst MetaList: FC<{ metadata: NodeProps['additionalData'] }> = ({ metadata }) => {\n const [nodeAdditionalData, setNodeAdditionalData] = useElement();\n let additionalDataValue = '';\n metadata?.forEach((item: AdditionalDataItemProps, index: number) => {\n if (index > 1) {\n additionalDataValue += `${item.label}: ${item.value}\n `;\n }\n });\n return (\n <Flex as={StyledAdditionalData} container={{ wrap: 'nowrap', colGap: 1, rowGap: 0.25 }}>\n {metadata?.map((data: AdditionalDataItemProps, index: number) => {\n if (index >= 2) {\n return;\n }\n return <MetaListItem key={data.id} {...data} />;\n })}\n {metadata && metadata.length > 2 && (\n <>\n <Flex\n as={StyledAdditionalDataItem}\n container={{ pad: 0.25 }}\n item={{ grow: 1, shrink: 0 }}\n ref={setNodeAdditionalData}\n >\n <StyledTextWithEllipsis as='dt'>{`+${metadata?.length - 2}`}</StyledTextWithEllipsis>\n </Flex>\n {additionalDataValue && (\n <Tooltip target={nodeAdditionalData} hideDelay='none'>\n {additionalDataValue}\n </Tooltip>\n )}\n </>\n )}\n </Flex>\n );\n};\nexport const DefaultNode = forwardRef(\n (\n {\n id,\n label,\n type,\n description,\n additionalData,\n actions,\n onActionClick,\n onClick,\n ...restProps\n }: PropsWithoutRef<NodeComponentProps>,\n ref: NodeComponentProps['ref']\n ) => {\n const t = useI18n();\n const actionItems = actions?.map(actionItem => {\n return {\n id: actionItem.id,\n primary: actionItem.text,\n onClick: (actionId: string, e: MouseEvent) => {\n e.stopPropagation();\n onActionClick?.({ actionId, nodeId: id }, e);\n }\n };\n });\n\n const handleEnterKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n onClick?.(id);\n }\n },\n [onClick]\n );\n\n const [nodeLabel, setNodeLabel] = useElement();\n const [nodeDescription, setNodeDescription] = useElement();\n\n const [nodeIcon, setNodeIcon] = useElement();\n\n return (\n <StyledCard\n aria-label={label}\n onClick={() => onClick?.(id)}\n onKeyDown={handleEnterKeyDown}\n ref={ref}\n {...restProps}\n >\n <Flex as={StyledCardHeader} container={{ alignItems: 'center', pad: 1 }}>\n <StyledIcon id={id} color={type.color} ref={setNodeIcon}>\n <Icon name={type.icon} />\n </StyledIcon>\n <Tooltip target={nodeIcon} hideDelay='none'>\n {cap(type.name)}\n </Tooltip>\n <StyledText variant='h4' ref={setNodeLabel}>\n {label}\n </StyledText>\n <Tooltip describeTarget={false} target={nodeLabel} hideDelay='none'>\n {label}\n </Tooltip>\n\n {actionItems && (\n <MenuButton\n portal\n variant='simple'\n text={t('actions')}\n icon='more'\n iconOnly\n onClick={(e: MouseEvent) => e.stopPropagation()}\n onKeyDown={(e: KeyboardEvent) => e.stopPropagation()}\n menu={{\n items: actionItems\n }}\n />\n )}\n </Flex>\n {description && (\n <>\n <StyledCardContent ref={setNodeDescription}>{description}</StyledCardContent>\n <Tooltip describeTarget={false} target={nodeDescription} hideDelay='none'>\n {description}\n </Tooltip>\n </>\n )}\n {additionalData && (\n <StyledCardFooter>\n <MetaList metadata={additionalData} />\n </StyledCardFooter>\n )}\n </StyledCard>\n );\n }\n);\n\nexport const StartNode = ({ type, label }: PropsWithoutRef<NodeProps>) => {\n return (\n <Flex container={{ justify: 'center', direction: 'column' }}>\n <Flex as={StyledLabel} type={type}>\n {label}\n </Flex>\n <Flex as={StyledCircle} color={type.color} tabIndex='0' aria-label={label} role='button' />\n </Flex>\n );\n};\n\nexport const EndNode = ({ type, label }: PropsWithoutRef<NodeProps>) => {\n return (\n <Flex container={{ justify: 'center', direction: 'column' }}>\n <Flex as={StyledCircle} color={type.color} tabIndex='0' aria-label={label} role='button' />\n <Flex as={StyledLabel} type={type}>\n {label}\n </Flex>\n </Flex>\n );\n};\n"]}
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { ForwardProps } from '@pega/cosmos-react-core';
3
+ import { NodeLibraryItem } from './Node/Node.types';
4
+ export interface NodeLibraryProps {
5
+ show: boolean;
6
+ target: HTMLElement | null;
7
+ items: NodeLibraryItem[];
8
+ onClick: (libItem: NodeLibraryItem) => void;
9
+ }
10
+ declare const NodeLibrary: FC<NodeLibraryProps & ForwardProps>;
11
+ export default NodeLibrary;
12
+ //# sourceMappingURL=NodeLibrary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeLibrary.d.ts","sourceRoot":"","sources":["../../../src/components/FlowModeller/NodeLibrary.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EASH,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,YAAY,EAUb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOpD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,OAAO,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;CAC7C;AAED,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,GAAG,YAAY,CA4EpD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
+ import styled from 'styled-components';
4
+ import { Icon, Menu, menuHelpers, Popover, SearchInput, useI18n, escapeRegExp } from '@pega/cosmos-react-core';
5
+ import { StyledIcon } from './Node/NodeTemplate.styles';
6
+ const StyledPopover = styled(Popover) `
7
+ min-width: 40ch;
8
+ `;
9
+ const NodeLibrary = forwardRef(({ show, target, items, onClick }, ref) => {
10
+ const [search, setSearch] = useState('');
11
+ const t = useI18n();
12
+ const searchEleRef = useRef(null);
13
+ useEffect(() => {
14
+ if (show) {
15
+ setSearch('');
16
+ searchEleRef?.current?.focus();
17
+ }
18
+ }, [show, searchEleRef.current]);
19
+ const searchRegex = useMemo(() => {
20
+ return new RegExp(escapeRegExp(search));
21
+ }, [search]);
22
+ const itemsToRender = useMemo(() => {
23
+ return menuHelpers.mapTree(search
24
+ ? menuHelpers.flatten(items).filter(({ primary }) => {
25
+ return searchRegex.test(primary);
26
+ })
27
+ : items, node => {
28
+ let selectable = false;
29
+ if (!node.items) {
30
+ selectable = true;
31
+ }
32
+ const nodeItem = node;
33
+ return {
34
+ ...node,
35
+ visual: nodeItem.type ? (_jsx(StyledIcon, { id: node.id, color: nodeItem.type.color, children: _jsx(Icon, { name: nodeItem.type.icon }, void 0) }, void 0)) : undefined,
36
+ count: node.items ? node.items.length : undefined,
37
+ secondary: node.secondary,
38
+ selected: selectable ? !!node.selected : undefined
39
+ };
40
+ });
41
+ }, [items, searchRegex]);
42
+ const onItemSelect = useCallback((id) => {
43
+ const selectedNode = menuHelpers.getItem(items, id);
44
+ onClick(selectedNode);
45
+ }, [onClick]);
46
+ return (_jsx(StyledPopover, { show: show, target: target, ref: ref, children: _jsx(Menu, { items: itemsToRender, onItemClick: onItemSelect, header: _jsx(SearchInput, { ref: searchEleRef, onSearchChange: setSearch, value: search, searchInputAriaLabel: t('search_nodes'), placeholder: t('search_nodes') }, void 0) }, void 0) }, void 0));
47
+ });
48
+ export default NodeLibrary;
49
+ //# sourceMappingURL=NodeLibrary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeLibrary.js","sourceRoot":"","sources":["../../../src/components/FlowModeller/NodeLibrary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAGV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAEL,IAAI,EACJ,IAAI,EAEJ,WAAW,EAEX,OAAO,EACP,WAAW,EACX,OAAO,EACP,YAAY,EACb,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,aAAa,GAAmB,MAAM,CAAC,OAAO,CAAC,CAAA;;CAEpD,CAAC;AASF,MAAM,WAAW,GAAwC,UAAU,CACjE,CACE,EAAE,IAAI,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Memo,\n useRef,\n useState\n} from 'react';\nimport styled from 'styled-components';\n\nimport {\n ForwardProps,\n Icon,\n Menu,\n MenuGroupProps,\n menuHelpers,\n MenuItemProps,\n Popover,\n SearchInput,\n useI18n,\n escapeRegExp\n} from '@pega/cosmos-react-core';\n\nimport { NodeLibraryItem } from './Node/Node.types';\nimport { StyledIcon } from './Node/NodeTemplate.styles';\n\nconst StyledPopover: typeof Popover = styled(Popover)`\n min-width: 40ch;\n`;\n\nexport interface NodeLibraryProps {\n show: boolean;\n target: HTMLElement | null;\n items: NodeLibraryItem[];\n onClick: (libItem: NodeLibraryItem) => void;\n}\n\nconst NodeLibrary: FC<NodeLibraryProps & ForwardProps> = forwardRef(\n (\n { show, target, items, onClick }: PropsWithoutRef<NodeLibraryProps>,\n ref: Ref<HTMLDivElement>\n ) => {\n const [search, setSearch] = useState('');\n\n const t = useI18n();\n const searchEleRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (show) {\n setSearch('');\n searchEleRef?.current?.focus();\n }\n }, [show, searchEleRef.current]);\n\n const searchRegex = useMemo(() => {\n return new RegExp(escapeRegExp(search));\n }, [search]);\n\n const itemsToRender: (MenuItemProps | MenuGroupProps)[] = useMemo(() => {\n return menuHelpers.mapTree(\n search\n ? menuHelpers.flatten(items).filter(({ primary }: MenuItemProps) => {\n return searchRegex.test(primary);\n })\n : items,\n node => {\n let selectable = false;\n if (!node.items) {\n selectable = true;\n }\n\n const nodeItem: NodeLibraryItem = node as NodeLibraryItem;\n return {\n ...node,\n visual: nodeItem.type ? (\n <StyledIcon id={node.id} color={nodeItem.type.color}>\n <Icon name={nodeItem.type.icon} />\n </StyledIcon>\n ) : undefined,\n count: node.items ? node.items.length : undefined,\n secondary: node.secondary,\n selected: selectable ? !!node.selected : undefined\n };\n }\n );\n }, [items, searchRegex]);\n\n const onItemSelect = useCallback(\n (id: MenuItemProps['id']) => {\n const selectedNode = menuHelpers.getItem(items, id) as NodeLibraryItem;\n onClick(selectedNode);\n },\n [onClick]\n );\n\n return (\n <StyledPopover show={show} target={target} ref={ref}>\n <Menu\n items={itemsToRender}\n onItemClick={onItemSelect}\n header={\n <SearchInput\n ref={searchEleRef}\n onSearchChange={setSearch}\n value={search}\n searchInputAriaLabel={t('search_nodes')}\n placeholder={t('search_nodes')}\n />\n }\n />\n </StyledPopover>\n );\n }\n);\n\nexport default NodeLibrary;\n"]}
@@ -0,0 +1,10 @@
1
+ import { FC, MouseEvent } from 'react';
2
+ export declare const StyledDot: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").IconProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const StyledWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const StyledButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
5
+ interface AddBtnProps {
6
+ addNodeHandler: (e: MouseEvent<HTMLButtonElement>) => void;
7
+ }
8
+ export declare const AddButton: FC<AddBtnProps>;
9
+ export {};
10
+ //# sourceMappingURL=AddNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddNode.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/AddNode.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAWvC,eAAO,MAAM,SAAS,mOAKpB,CAAC;AAIH,eAAO,MAAM,aAAa,yGASxB,CAAC;AAIH,eAAO,MAAM,YAAY,qOAcvB,CAAC;AAIH,UAAU,WAAW;IACnB,cAAc,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC5D;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,WAAW,CAWrC,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import styled, { css } from 'styled-components';
3
+ import { Button, defaultThemeProp, Flex, Icon, useI18n, StyledTooltip } from '@pega/cosmos-react-core';
4
+ export const StyledDot = styled(Icon)(({ theme }) => {
5
+ return css `
6
+ position: absolute;
7
+ color: ${theme.base.colors.slate.dark};
8
+ `;
9
+ });
10
+ StyledDot.defaultProps = defaultThemeProp;
11
+ export const StyledWrapper = styled.div(() => {
12
+ return css `
13
+ ${StyledTooltip} {
14
+ ${css `
15
+ min-width: 12ch;
16
+ text-align: center;
17
+ `}
18
+ }
19
+ `;
20
+ });
21
+ StyledWrapper.defaultProps = defaultThemeProp;
22
+ export const StyledButton = styled(Button)(({ theme }) => {
23
+ return css `
24
+ opacity: 0;
25
+ top: -0.25rem;
26
+ border: 0;
27
+ color: ${theme.base.colors.black};
28
+ background: ${theme.base.colors.white};
29
+ &:hover,
30
+ &:active,
31
+ &:focus {
32
+ opacity: 1;
33
+ background: ${theme.base.colors.white};
34
+ }
35
+ `;
36
+ });
37
+ StyledButton.defaultProps = defaultThemeProp;
38
+ export const AddButton = ({ addNodeHandler }) => {
39
+ const t = useI18n();
40
+ return (_jsxs(Flex, { container: { justify: 'center' }, as: StyledWrapper, children: [_jsx(StyledDot, { name: 'circle-solid' }, void 0), _jsx(StyledButton, { label: t('add_noun', [t('node').toLowerCase()]), icon: true, onClick: addNodeHandler, children: _jsx(Icon, { name: 'plus' }, void 0) }, void 0)] }, void 0));
41
+ };
42
+ //# sourceMappingURL=AddNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddNode.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/AddNode.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,aAAa,EACd,MAAM,yBAAy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W,EAAE,CAAC,CAAC,EAAE,IAAI,QAAC,OAAO,EAAE,cAAc,YACzF,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,WAAG,WACP,YACV,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { FC, MouseEvent } from 'react';\n\nimport {\n Button,\n defaultThemeProp,\n Flex,\n Icon,\n useI18n,\n StyledTooltip\n} from '@pega/cosmos-react-core';\n\nexport const StyledDot = styled(Icon)(({ theme }) => {\n return css`\n position: absolute;\n color: ${theme.base.colors.slate.dark};\n `;\n});\n\nStyledDot.defaultProps = defaultThemeProp;\n\nexport const StyledWrapper = styled.div(() => {\n return css`\n ${StyledTooltip} {\n ${css`\n min-width: 12ch;\n text-align: center;\n `}\n }\n `;\n});\n\nStyledWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledButton = styled(Button)(({ theme }) => {\n return css`\n opacity: 0;\n top: -0.25rem;\n border: 0;\n color: ${theme.base.colors.black};\n background: ${theme.base.colors.white};\n &:hover,\n &:active,\n &:focus {\n opacity: 1;\n background: ${theme.base.colors.white};\n }\n `;\n});\n\nStyledButton.defaultProps = defaultThemeProp;\n\ninterface AddBtnProps {\n addNodeHandler: (e: MouseEvent<HTMLButtonElement>) => void;\n}\n\nexport const AddButton: FC<AddBtnProps> = ({ addNodeHandler }) => {\n const t = useI18n();\n\n return (\n <Flex container={{ justify: 'center' }} as={StyledWrapper}>\n <StyledDot name='circle-solid' />\n <StyledButton label={t('add_noun', [t('node').toLowerCase()])} icon onClick={addNodeHandler}>\n <Icon name='plus' />\n </StyledButton>\n </Flex>\n );\n};\n"]}
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { RendererConnectorProps } from './Renderer.types';
3
+ declare const Connector: FC<RendererConnectorProps>;
4
+ export default Connector;
5
+ //# sourceMappingURL=Connector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Connector.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Connector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAK3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAgE1D,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC,sBAAsB,CAoBzC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import styled, { css } from 'styled-components';
3
+ import { defaultThemeProp, Flex, Label, useTheme } from '@pega/cosmos-react-core';
4
+ const CURVE_RADIUS = 16;
5
+ const genLine = (points) => {
6
+ const lineStr = points
7
+ .map((point, idx, arr) => {
8
+ const { x, y } = point;
9
+ const prev = arr[idx - 1];
10
+ const next = arr[idx + 1];
11
+ const line = `L${x},${y}`;
12
+ // if the point is extream end, no need to add a curve
13
+ if (!prev || !next)
14
+ return line;
15
+ // if point is colinear with prev and next, no need to add a curve
16
+ if (prev.x === next.x || prev.y === next.y)
17
+ return line;
18
+ if (point.x > next.x)
19
+ // BOTTOM-RIGHT ↲
20
+ return `L${x},${y - CURVE_RADIUS}a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 1 -${CURVE_RADIUS},${CURVE_RADIUS}`;
21
+ // BOTTOM-LEFT ↳
22
+ if (point.x < next.x)
23
+ return `L${x},${y - CURVE_RADIUS}a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 0 ${CURVE_RADIUS},${CURVE_RADIUS}`;
24
+ // TOP-LEFT ↱
25
+ if (point.x < prev.x)
26
+ return `L${x + CURVE_RADIUS},${y}a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 0 -${CURVE_RADIUS},${CURVE_RADIUS}`;
27
+ // TOP-RIGHT ↴
28
+ if (point.x > prev.x)
29
+ return `L${x - CURVE_RADIUS},${y}a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 1 ${CURVE_RADIUS},${CURVE_RADIUS}`;
30
+ return `L${x},${y}`;
31
+ })
32
+ .join('');
33
+ return `M${lineStr.substr(1)}`;
34
+ };
35
+ const StyledLabel = styled(Label)(({ theme }) => {
36
+ return css `
37
+ border-radius: ${theme.base['border-radius']};
38
+ background: ${theme.base.colors.slate.dark};
39
+ color: ${theme.base.colors.white};
40
+ text-align: center;
41
+ padding: calc(0.5 * ${theme.base.spacing});
42
+ `;
43
+ });
44
+ StyledLabel.defaultProps = defaultThemeProp;
45
+ const Connector = ({ points, labelLayout }) => {
46
+ const theme = useTheme();
47
+ return (_jsxs("g", { children: [_jsx("path", { d: genLine(points), stroke: theme.base.colors.slate.dark, strokeWidth: '1', fill: 'none' }, void 0), labelLayout?.value && (_jsx("foreignObject", { x: labelLayout.x - labelLayout.width, y: labelLayout.y + 15, width: labelLayout.width, height: labelLayout.height, children: _jsx(Flex, { container: { justify: 'center' }, children: _jsx(StyledLabel, { children: labelLayout.value }, void 0) }, void 0) }, void 0))] }, void 0));
48
+ };
49
+ export default Connector;
50
+ //# sourceMappingURL=Connector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Connector.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Connector.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AASlF,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,OAAO,GAAG,CAAC,MAAgB,EAAE,EAAE;IACnC,MAAM,OAAO,GAAW,MAAM;SAC3B,GAAG,CAAC,CAAC,KAAa,EAAE,GAAW,EAAE,GAAa,EAAE,EAAE;QACjD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC;QACvB,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QAC1B,MAAM,IAAI,GAAG,G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AAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9C,OAAO,GAAG,CAAA;qBACS,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;kBAC9B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI;aACjC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;0BAEV,KAAK,CAAC,IAAI,CAAC,OAAO;GACzC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,SAAS,GAA+B,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE;IACxE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,OAAO,CACL,wBACE,eAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,EAAC,GAAG,EAAC,IAAI,EAAC,MAAM,WAAG,EAC7F,WAAW,EAAE,KAAK,IAAI,CACrB,wBACE,CAAC,EAAE,WAAW,CAAC,CAAC,GAAG,WAAW,CAAC,KAAK,EACpC,CAAC,EAAE,WAAW,CAAC,CAAC,GAAG,EAAE,EACrB,KAAK,EAAE,WAAW,CAAC,KAAK,EACxB,MAAM,EAAE,WAAW,CAAC,MAAM,YAE1B,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,YACpC,KAAC,WAAW,cAAE,WAAW,CAAC,KAAK,WAAe,WACzC,WACO,CACjB,YACC,CACL,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { FC } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, Flex, Label, useTheme } from '@pega/cosmos-react-core';\n\nimport { RendererConnectorProps } from './Renderer.types';\n\ninterface Points {\n x: number;\n y: number;\n}\n\nconst CURVE_RADIUS = 16;\nconst genLine = (points: Points[]) => {\n const lineStr: string = points\n .map((point: Points, idx: number, arr: Points[]) => {\n const { x, y } = point;\n const prev = arr[idx - 1];\n const next = arr[idx + 1];\n const line = `L${x},${y}`;\n\n // if the point is extream end, no need to add a curve\n if (!prev || !next) return line;\n\n // if point is colinear with prev and next, no need to add a curve\n if (prev.x === next.x || prev.y === next.y) return line;\n\n if (point.x > next.x)\n // BOTTOM-RIGHT ↲\n return `L${x},${\n y - CURVE_RADIUS\n }a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 1 -${CURVE_RADIUS},${CURVE_RADIUS}`;\n\n // BOTTOM-LEFT ↳\n if (point.x < next.x)\n return `L${x},${\n y - CURVE_RADIUS\n }a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 0 ${CURVE_RADIUS},${CURVE_RADIUS}`;\n\n // TOP-LEFT ↱\n if (point.x < prev.x)\n return `L${\n x + CURVE_RADIUS\n },${y}a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 0 -${CURVE_RADIUS},${CURVE_RADIUS}`;\n\n // TOP-RIGHT ↴\n if (point.x > prev.x)\n return `L${\n x - CURVE_RADIUS\n },${y}a${CURVE_RADIUS},${CURVE_RADIUS} 0 0 1 ${CURVE_RADIUS},${CURVE_RADIUS}`;\n\n return `L${x},${y}`;\n })\n .join('');\n return `M${lineStr.substr(1)}`;\n};\n\nconst StyledLabel = styled(Label)(({ theme }) => {\n return css`\n border-radius: ${theme.base['border-radius']};\n background: ${theme.base.colors.slate.dark};\n color: ${theme.base.colors.white};\n text-align: center;\n padding: calc(0.5 * ${theme.base.spacing});\n `;\n});\n\nStyledLabel.defaultProps = defaultThemeProp;\n\nconst Connector: FC<RendererConnectorProps> = ({ points, labelLayout }) => {\n const theme = useTheme();\n\n return (\n <g>\n <path d={genLine(points)} stroke={theme.base.colors.slate.dark} strokeWidth='1' fill='none' />\n {labelLayout?.value && (\n <foreignObject\n x={labelLayout.x - labelLayout.width}\n y={labelLayout.y + 15}\n width={labelLayout.width}\n height={labelLayout.height}\n >\n <Flex container={{ justify: 'center' }}>\n <StyledLabel>{labelLayout.value}</StyledLabel>\n </Flex>\n </foreignObject>\n )}\n </g>\n );\n};\n\nexport default Connector;\n"]}
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { RendererConnectorProps } from './Renderer.types';
3
+ export interface ConnectorsContainerProps {
4
+ items: RendererConnectorProps[];
5
+ dimensions: {
6
+ width: number;
7
+ height: number;
8
+ };
9
+ }
10
+ declare const ConnectorsContainer: FC<ConnectorsContainerProps>;
11
+ export default ConnectorsContainer;
12
+ //# sourceMappingURL=ConnectorsContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectorsContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/ConnectorsContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAI3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAQ1D,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,QAAA,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAerD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import styled from 'styled-components';
3
+ import Connector from './Connector';
4
+ const StyledConnectorContainer = styled.div `
5
+ position: absolute;
6
+ top: 0;
7
+ left: 0;
8
+ `;
9
+ const ConnectorsContainer = ({ items, dimensions }) => {
10
+ return (_jsx(StyledConnectorContainer, { children: _jsx("svg", { width: dimensions.width, height: dimensions.height, xmlns: 'http://www.w3.org/2000/svg', viewBox: `0 0 ${dimensions.width} ${dimensions.height}`, children: items.map(item => {
11
+ return _jsx(Connector, { ...item }, item.id);
12
+ }) }, void 0) }, void 0));
13
+ };
14
+ export default ConnectorsContainer;
15
+ //# sourceMappingURL=ConnectorsContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectorsContainer.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/ConnectorsContainer.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAI1C,CAAC;AAUF,MAAM,mBAAmB,GAAiC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE;IAClF,OAAO,CACL,KAAC,wBAAwB,cACvB,cACE,KAAK,EAAE,UAAU,CAAC,KAAK,EACvB,MAAM,EAAE,UAAU,CAAC,MAAM,EACzB,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAE,OAAO,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,MAAM,EAAE,YAEtD,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gBAChB,OAAO,KAAC,SAAS,OAAmB,IAAI,IAAjB,IAAI,CAAC,EAAE,CAAc,CAAC;YAC/C,CAAC,CAAC,WACE,WACmB,CAC5B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { FC } from 'react';\nimport styled from 'styled-components';\n\nimport Connector from './Connector';\nimport { RendererConnectorProps } from './Renderer.types';\n\nconst StyledConnectorContainer = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n`;\n\nexport interface ConnectorsContainerProps {\n items: RendererConnectorProps[];\n dimensions: {\n width: number;\n height: number;\n };\n}\n\nconst ConnectorsContainer: FC<ConnectorsContainerProps> = ({ items, dimensions }) => {\n return (\n <StyledConnectorContainer>\n <svg\n width={dimensions.width}\n height={dimensions.height}\n xmlns='http://www.w3.org/2000/svg'\n viewBox={`0 0 ${dimensions.width} ${dimensions.height}`}\n >\n {items.map(item => {\n return <Connector key={item.id} {...item} />;\n })}\n </svg>\n </StyledConnectorContainer>\n );\n};\n\nexport default ConnectorsContainer;\n"]}
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { RendererNodeProps } from './Renderer.types';
3
+ declare const Node: FC<RendererNodeProps>;
4
+ export default Node;
5
+ //# sourceMappingURL=Node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAK3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAgBrD,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAM/B,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import styled, { css } from 'styled-components';
3
+ import { Flex } from '@pega/cosmos-react-core';
4
+ const StyledNodeWrapper = styled.div(({ dimensions, position }) => {
5
+ return css `
6
+ position: absolute;
7
+ top: 0;
8
+ left: 0;
9
+ width: ${dimensions.width}px;
10
+ height: ${dimensions.height}px;
11
+ transform: translate(${position.x}px, ${position.y}px);
12
+ `;
13
+ });
14
+ const Node = ({ children, ...restprops }) => {
15
+ return (_jsx(Flex, { as: StyledNodeWrapper, ...restprops, container: { justify: 'center' }, children: _jsx("div", { children: children }, void 0) }, void 0));
16
+ };
17
+ export default Node;
18
+ //# sourceMappingURL=Node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Node.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAI/C,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAGjC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9B,OAAO,GAAG,CAAA;;;;aAIC,UAAU,CAAC,KAAK;cACf,UAAU,CAAC,MAAM;2BACJ,QAAQ,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC;GACnD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,IAAI,GAA0B,CAAC,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,EAAE;IACjE,OAAO,CACL,KAAC,IAAI,IAAC,EAAE,EAAE,iBAAiB,KAAM,SAAS,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,YAC1E,wBAAM,QAAQ,WAAO,WAChB,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { FC } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Flex } from '@pega/cosmos-react-core';\n\nimport { RendererNodeProps } from './Renderer.types';\n\nconst StyledNodeWrapper = styled.div<{\n dimensions: RendererNodeProps['dimensions'];\n position: RendererNodeProps['position'];\n}>(({ dimensions, position }) => {\n return css`\n position: absolute;\n top: 0;\n left: 0;\n width: ${dimensions.width}px;\n height: ${dimensions.height}px;\n transform: translate(${position.x}px, ${position.y}px);\n `;\n});\n\nconst Node: FC<RendererNodeProps> = ({ children, ...restprops }) => {\n return (\n <Flex as={StyledNodeWrapper} {...restprops} container={{ justify: 'center' }}>\n <div>{children}</div>\n </Flex>\n );\n};\n\nexport default Node;\n"]}
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { RendererNodeProps } from './Renderer.types';
3
+ export interface NodesContainerProps {
4
+ items: RendererNodeProps[];
5
+ }
6
+ declare const NodesContainer: FC<NodesContainerProps>;
7
+ export default NodesContainer;
8
+ //# sourceMappingURL=NodesContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodesContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/NodesContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAI3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAQrD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAED,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAQ3C,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import styled from 'styled-components';
3
+ import Node from './Node';
4
+ const StyledNodeContainer = styled.div `
5
+ position: absolute;
6
+ top: 0;
7
+ left: 0;
8
+ `;
9
+ const NodesContainer = ({ items }) => {
10
+ return (_jsx(StyledNodeContainer, { children: items.map(item => {
11
+ return _jsx(Node, { ...item }, item.id);
12
+ }) }, void 0));
13
+ };
14
+ export default NodesContainer;
15
+ //# sourceMappingURL=NodesContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodesContainer.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/NodesContainer.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAG1B,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIrC,CAAC;AAMF,MAAM,cAAc,GAA4B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5D,OAAO,CACL,KAAC,mBAAmB,cACjB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAChB,OAAO,KAAC,IAAI,OAAmB,IAAI,IAAjB,IAAI,CAAC,EAAE,CAAc,CAAC;QAC1C,CAAC,CAAC,WACkB,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FC } from 'react';\nimport styled from 'styled-components';\n\nimport Node from './Node';\nimport { RendererNodeProps } from './Renderer.types';\n\nconst StyledNodeContainer = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n`;\n\nexport interface NodesContainerProps {\n items: RendererNodeProps[];\n}\n\nconst NodesContainer: FC<NodesContainerProps> = ({ items }) => {\n return (\n <StyledNodeContainer>\n {items.map(item => {\n return <Node key={item.id} {...item} />;\n })}\n </StyledNodeContainer>\n );\n};\n\nexport default NodesContainer;\n"]}
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { RendererProps } from './Renderer.types';
3
+ declare const Renderer: FC<RendererProps>;
4
+ export default Renderer;
5
+ //# sourceMappingURL=Renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Renderer.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAI3B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAUjD,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAU/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import styled from 'styled-components';
3
+ import ConnectorsContainer from './ConnectorsContainer';
4
+ import NodesContainer from './NodesContainer';
5
+ import GraphLayout from './Utils/GraphLayout';
6
+ const StyledWrapper = styled.div `
7
+ position: relative;
8
+ width: 100%;
9
+ height: 100%;
10
+ `;
11
+ const Renderer = ({ graphData }) => {
12
+ // apply the plotted positions
13
+ const graphDimensions = GraphLayout.plot(graphData);
14
+ return (_jsxs(StyledWrapper, { children: [_jsx(ConnectorsContainer, { items: graphData.connectors, dimensions: graphDimensions }, void 0), _jsx(NodesContainer, { items: graphData.nodes }, void 0)] }, void 0));
15
+ };
16
+ export default Renderer;
17
+ //# sourceMappingURL=Renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Renderer.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAI/B,CAAC;AAEF,MAAM,QAAQ,GAAsB,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;IACpD,8BAA8B;IAC9B,MAAM,eAAe,GAAG,WAAW,CAAC,IAAI,CAA6B,SAAS,CAAC,CAAC;IAEhF,OAAO,CACL,MAAC,aAAa,eACZ,KAAC,mBAAmB,IAAC,KAAK,EAAE,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,WAAI,EACjF,KAAC,cAAc,IAAC,KAAK,EAAE,SAAS,CAAC,KAAK,WAAI,YAC5B,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { FC } from 'react';\nimport styled from 'styled-components';\n\nimport ConnectorsContainer from './ConnectorsContainer';\nimport { RendererProps } from './Renderer.types';\nimport NodesContainer from './NodesContainer';\nimport GraphLayout from './Utils/GraphLayout';\n\nconst StyledWrapper = styled.div`\n position: relative;\n width: 100%;\n height: 100%;\n`;\n\nconst Renderer: FC<RendererProps> = ({ graphData }) => {\n // apply the plotted positions\n const graphDimensions = GraphLayout.plot<RendererProps['graphData']>(graphData);\n\n return (\n <StyledWrapper>\n <ConnectorsContainer items={graphData.connectors} dimensions={graphDimensions} />\n <NodesContainer items={graphData.nodes} />\n </StyledWrapper>\n );\n};\n\nexport default Renderer;\n"]}
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ import { GraphData } from './Utils/Graph';
3
+ import { PlottedGraphConnector, PlottedGraphNode } from './Utils/GraphLayout';
4
+ export interface AddNodeHandlerParams {
5
+ refType: 'node' | 'connector';
6
+ refId: string;
7
+ }
8
+ export interface RendererNodeProps extends PlottedGraphNode {
9
+ children: ReactNode;
10
+ }
11
+ export interface RendererConnectorProps extends PlottedGraphConnector {
12
+ children?: ReactNode;
13
+ }
14
+ export interface RendererProps {
15
+ graphData: GraphData<RendererNodeProps, RendererConnectorProps>;
16
+ disableAutoLayout?: boolean;
17
+ }
18
+ //# sourceMappingURL=Renderer.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Renderer.types.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;IACnE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,SAAS,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC;IAChE,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Renderer.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Renderer.types.js","sourceRoot":"","sources":["../../../../src/components/FlowModeller/Renderer/Renderer.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode } from 'react';\n\nimport { GraphData } from './Utils/Graph';\nimport { PlottedGraphConnector, PlottedGraphNode } from './Utils/GraphLayout';\n\nexport interface AddNodeHandlerParams {\n refType: 'node' | 'connector';\n refId: string;\n}\n\nexport interface RendererNodeProps extends PlottedGraphNode {\n children: ReactNode;\n}\n\nexport interface RendererConnectorProps extends PlottedGraphConnector {\n children?: ReactNode;\n}\n\nexport interface RendererProps {\n graphData: GraphData<RendererNodeProps, RendererConnectorProps>;\n disableAutoLayout?: boolean;\n}\n"]}