-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/16 - Sidebar, Nodes, Node selection move to meta-diagram theme, add variables #17
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
3197831
#16 Add more variables for sidebar customisation, move styles for no…
vidhya-metacell 06cd2bb
#16 Update canvas styles
vidhya-metacell 113653d
#16 Add Nodes UI and color variants
vidhya-metacell 17c0f0d
#16 Linter updates
vidhya-metacell 6d589be
#16 chore: Update dist folder
afonsobspinto d7d2eb0
#16 Update build folder
vidhya-metacell a4be292
Merge branch 'feature/16' of github.com:MetaCell/meta-diagram into fe…
vidhya-metacell ffbf87b
#16 Variables for node color options
vidhya-metacell 843b552
#16 Sidebar selected state for optionns availble in list
vidhya-metacell 5959de3
#16 Node selection
vidhya-metacell 76cca14
#16 Update color option for node
vidhya-metacell bfeb598
#16 Build files
vidhya-metacell 806236f
#16 Resolve merge conflicts
vidhya-metacell be962bb
#16 Linter fixes
vidhya-metacell 5fc0394
#16 Make components DRY
vidhya-metacell d1791e8
#16 Keep the node base styles and a default calue of color in meta theme
vidhya-metacell edb552b
#16 Add color options for node in example's theme
vidhya-metacell cb0d701
#16 Remove style options from node widget in example
vidhya-metacell 156c8bc
#16 Linter updates
vidhya-metacell 162f501
#16 Build updates
vidhya-metacell 7f18fb3
#16 Update material version to integrate theme
vidhya-metacell 9545f85
#16 Icon addition from theme to node
vidhya-metacell b58c1b6
#16 Add icon example to the nodes
vidhya-metacell 8348966
#16 Build files
vidhya-metacell 988ca22
#16 chore: Add variant attribute to entities
afonsobspinto 1ab69b1
#16 chore: Fix linting
afonsobspinto 0c90c00
Merge branch 'develop' into feature/16
afonsobspinto 3b5eaed
#16 chore: Strictly compare against undefined
afonsobspinto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,90 @@ | ||
declare type ThemeVars = { | ||
[key: string]: any; | ||
}; | ||
declare const _default: (customVariables: ThemeVars) => { | ||
components: { | ||
MuiCssBaseline: { | ||
styleOverrides: string; | ||
}; | ||
MuiList: { | ||
styleOverrides: { | ||
root: { | ||
'&.customSwitch': { | ||
padding: string; | ||
background: any; | ||
borderRadius: string; | ||
display: string; | ||
'& .MuiListItemButton-root': { | ||
padding: string; | ||
borderRadius: string; | ||
width: string; | ||
display: string; | ||
alignItems: string; | ||
justifyContent: string; | ||
'&:not(:last-child)': { | ||
marginBottom: string; | ||
}; | ||
'&.Mui-disabled': { | ||
opacity: number; | ||
}; | ||
'&.Mui-selected': { | ||
background: any; | ||
boxShadow: any; | ||
border: string; | ||
'& .MuiTypography-root': { | ||
color: any; | ||
}; | ||
}; | ||
}; | ||
'& .MuiChip-root': { | ||
marginLeft: string; | ||
}; | ||
'& .MuiTypography-root': { | ||
fontWeight: number; | ||
fontSize: string; | ||
lineHeight: string; | ||
letterSpacing: string; | ||
color: any; | ||
margin: number; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
MuiListItemIcon: { | ||
styleOverrides: { | ||
root: { | ||
minWidth: string; | ||
}; | ||
}; | ||
}; | ||
MuiListItemButton: { | ||
styleOverrides: { | ||
root: { | ||
padding: number; | ||
width: string; | ||
height: string; | ||
borderRadius: string; | ||
justifyContent: string; | ||
backgroundColor: any; | ||
'&:hover': { | ||
backgroundColor: any; | ||
}; | ||
'&:not(:last-child)': { | ||
marginBottom: string; | ||
}; | ||
'&.Mui-selected': { | ||
backgroundColor: any; | ||
'&:hover': { | ||
backgroundColor: any; | ||
}; | ||
}; | ||
'&.Mui-disabled': { | ||
opacity: number; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
export default _default; | ||
declare type ThemeVars = { | ||
[key: string]: any; | ||
}; | ||
declare const _default: (customVariables: ThemeVars) => { | ||
components: { | ||
MuiCssBaseline: { | ||
styleOverrides: string; | ||
}; | ||
MuiList: { | ||
styleOverrides: { | ||
root: { | ||
'&.customSwitch': { | ||
padding: string; | ||
background: any; | ||
borderRadius: string; | ||
display: string; | ||
'& .MuiListItemButton-root': { | ||
padding: string; | ||
borderRadius: string; | ||
width: string; | ||
display: string; | ||
alignItems: string; | ||
justifyContent: string; | ||
'&:not(:last-child)': { | ||
marginBottom: string; | ||
}; | ||
'&.Mui-disabled': { | ||
opacity: number; | ||
}; | ||
'&.Mui-selected': { | ||
background: any; | ||
boxShadow: any; | ||
border: string; | ||
'& .MuiTypography-root': { | ||
color: any; | ||
}; | ||
}; | ||
}; | ||
'& .MuiChip-root': { | ||
marginLeft: string; | ||
}; | ||
'& .MuiTypography-root': { | ||
fontWeight: number; | ||
fontSize: string; | ||
lineHeight: string; | ||
letterSpacing: string; | ||
color: any; | ||
margin: number; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
MuiListItemIcon: { | ||
styleOverrides: { | ||
root: { | ||
minWidth: string; | ||
}; | ||
}; | ||
}; | ||
MuiListItemButton: { | ||
styleOverrides: { | ||
root: { | ||
padding: number; | ||
width: string; | ||
height: string; | ||
borderRadius: string; | ||
justifyContent: string; | ||
backgroundColor: any; | ||
'&:hover': { | ||
backgroundColor: any; | ||
}; | ||
'&:not(:last-child)': { | ||
marginBottom: string; | ||
}; | ||
'&.Mui-selected': { | ||
backgroundColor: any; | ||
'&:hover': { | ||
backgroundColor: any; | ||
}; | ||
}; | ||
'&.Mui-disabled': { | ||
opacity: number; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
export default _default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const nodeRed = { | ||
nodeRedBackgroundColor: '#F4D4D4', | ||
nodeRedTextColor: '#9D6666', | ||
nodeRedBorderColor: 'rgba(157, 139, 102, 0.2)', | ||
nodeRedBoxShadow: '0 0.25rem 0.625rem -0.25rem rgba(157, 139, 102, 0.3)', | ||
}; | ||
|
||
const nodeBlue = { | ||
nodeBlueBackgroundColor: '#D4E6F4', | ||
nodeBlueTextColor: '#66829D', | ||
nodeBlueBorderColor: 'rgba(102, 130, 157, 0.2)', | ||
nodeBlueBoxShadow: '0 0.125rem 0.375rem -0.25rem rgba(102, 130, 157, 0.2)', | ||
}; | ||
|
||
const nodeGray = { | ||
nodeGrayBackgroundColor: '#E4E4E4', | ||
nodeGrayTextColor: '#818181', | ||
nodeGrayBorderColor: 'rgba(130, 130, 130, 0.2)', | ||
nodeGrayBoxShadow: '0 0.25rem 0.625rem -0.25rem rgba(129, 129, 129, 0.3)', | ||
}; | ||
|
||
const vars = { | ||
...nodeRed, | ||
...nodeBlue, | ||
...nodeGray, | ||
}; | ||
|
||
export default vars; |
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Box, Button } from "@mui/material"; | ||
import { DiagramEngine, PortWidget } from "@projectstorm/react-diagrams"; | ||
import * as React from "react"; | ||
import PortWigetComp from "./PortWidgetComp"; | ||
|
||
export interface NodeSelectionProps { | ||
engine: DiagramEngine; | ||
port: any; | ||
} | ||
|
||
class NodeSelection extends React.Component<NodeSelectionProps> { | ||
render() { | ||
const { engine, port } = this.props; | ||
const selectionPoint = '-0.375rem'; | ||
const IN = 'in'; | ||
const OUT = 'out'; | ||
return ( | ||
<> | ||
<Button className="node-button"> | ||
<Box | ||
className="icon" | ||
/> | ||
Show properties | ||
</Button> | ||
|
||
<Box className="nodes"> | ||
<PortWigetComp engine={engine} port={port} direction={IN} startPoints={{ left: selectionPoint, top: selectionPoint }} /> | ||
<PortWigetComp engine={engine} port={port} direction={OUT} startPoints={{ right: selectionPoint, top: selectionPoint }} /> | ||
<PortWigetComp engine={engine} port={port} direction={IN} startPoints={{ left: selectionPoint, bottom: selectionPoint }} /> | ||
<PortWigetComp engine={engine} port={port} direction={OUT} startPoints={{ right: selectionPoint, bottom: selectionPoint }} /> | ||
</Box> | ||
</> | ||
) | ||
} | ||
} | ||
|
||
export default NodeSelection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as React from "react"; | ||
import { Box } from "@mui/material"; | ||
import { PortWidget } from "@projectstorm/react-diagrams"; | ||
|
||
const PortWigetComp = (props) => { | ||
const { engine, port, direction, startPoints } = props; | ||
return ( | ||
<PortWidget | ||
engine={engine} | ||
port={port.getPort(direction)} | ||
> | ||
<Box style={startPoints} className="pointer" /> | ||
</PortWidget> | ||
) | ||
} | ||
export default PortWigetComp; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afonsobspinto @vidhya-metacell I would like to see this refactored , this is not so DRY (see https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)