Skip to content

Commit

Permalink
Merge branch 'master' into six7/add-support-for-loading-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
SorsOps authored Oct 9, 2023
2 parents e5850e5 + 0f96a26 commit 858520e
Show file tree
Hide file tree
Showing 13 changed files with 1,152 additions and 107 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-houses-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tokens-studio/graph-editor": patch
---

Adjusts error styling for nodes
5 changes: 5 additions & 0 deletions .changeset/swift-lobsters-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tokens-studio/graph-editor": patch
---

Changes markerEnd to not include arrow head
5 changes: 5 additions & 0 deletions .changeset/tall-actors-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tokens-studio/graph-engine-ui": patch
---

Fixes Preview code changes not being saved
27 changes: 18 additions & 9 deletions packages/graph-editor/src/components/flow/wrapper/node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,22 @@ export const Collapser = ({ icon, children, collapsed, showContent }) => {
);
};

const NodeWrapper = styled('div', {
minWidth: '300px',
position: 'relative',
borderRadius: '$medium',
background: '$bgDefault',
variants: {
error: {
true: {
'--nodeBorderColor': 'var(--colors-dangerFg)',
'--nodeBgColor': 'var(--colors-dangerBg)',
'--nodeTextColor': 'var(--colors-dangerFg)',
},
},
},
});

export const Node = (props: NodeProps) => {
const { id, icon, title, error, isAsync, children, controls, ...rest } =
props;
Expand Down Expand Up @@ -182,14 +198,7 @@ export const Node = (props: NodeProps) => {
const onDetach = () => detachNodes([id]);

return (
<Box
css={{
minWidth: '300px',
position: 'relative',
borderRadius: '$medium',
background: error ? '$dangerBg' : '$bgDefault',
}}
>
<NodeWrapper error={Boolean(error)} className={error ? 'error' : ''}>
<NodeToolbar className="nodrag">
<Stack
direction="row"
Expand Down Expand Up @@ -314,7 +323,7 @@ export const Node = (props: NodeProps) => {
</Stack>
</FocusTrap>
</HandleContainerContext.Provider>
</Box>
</NodeWrapper>
);
};

Expand Down
3 changes: 0 additions & 3 deletions packages/graph-editor/src/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ const defaultEdgeOptions = {
style: {
strokeWidth: 2,
},
markerEnd: {
type: MarkerType.ArrowClosed,
},
};

export const EditorApp = React.forwardRef<ImperativeEditorRef, EditorProps>(
Expand Down
1 change: 0 additions & 1 deletion packages/graph-engine/tests/data/raw/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"edges": [
{
"style": { "strokeWidth": 2 },
"markerEnd": { "type": "arrowclosed" },
"source": "c15d874f-f7e7-42a6-a6b3-8f238da52007",
"sourceHandle": "xxx",
"target": "33952fc4-eced-4c10-a56d-7bdb65182b34",
Expand Down
3 changes: 0 additions & 3 deletions packages/graph-engine/tests/data/raw/inputDisconnected.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"edges": [
{
"style": { "strokeWidth": 2 },
"markerEnd": { "type": "arrowclosed" },
"source": "4e629553-6fe2-444a-8a29-9b30abe26e1b",
"sourceHandle": "output",
"target": "5531dd87-f2a0-4e2a-89b9-9d382cd793d9",
Expand All @@ -57,7 +56,6 @@
},
{
"style": { "strokeWidth": 2 },
"markerEnd": { "type": "arrowclosed" },
"source": "734907ed-5f93-4b34-b24c-f262709470ac",
"sourceHandle": "colors.tertiary",
"target": "4e629553-6fe2-444a-8a29-9b30abe26e1b",
Expand All @@ -68,7 +66,6 @@
},
{
"style": { "strokeWidth": 2 },
"markerEnd": { "type": "arrowclosed" },
"source": "734907ed-5f93-4b34-b24c-f262709470ac",
"sourceHandle": "colors.primary",
"target": "4e629553-6fe2-444a-8a29-9b30abe26e1b",
Expand Down
3 changes: 0 additions & 3 deletions packages/graph-engine/tests/data/raw/noInput.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"edges": [
{
"style": { "strokeWidth": 2 },
"markerEnd": { "type": "arrowclosed" },
"source": "4e629553-6fe2-444a-8a29-9b30abe26e1b",
"sourceHandle": "output",
"target": "5531dd87-f2a0-4e2a-89b9-9d382cd793d9",
Expand All @@ -48,7 +47,6 @@
},
{
"style": { "strokeWidth": 2 },
"markerEnd": { "type": "arrowclosed" },
"source": "734907ed-5f93-4b34-b24c-f262709470ac",
"sourceHandle": "colors.tertiary",
"target": "4e629553-6fe2-444a-8a29-9b30abe26e1b",
Expand All @@ -59,7 +57,6 @@
},
{
"style": { "strokeWidth": 2 },
"markerEnd": { "type": "arrowclosed" },
"source": "734907ed-5f93-4b34-b24c-f262709470ac",
"sourceHandle": "colors.primary",
"target": "4e629553-6fe2-444a-8a29-9b30abe26e1b",
Expand Down
2 changes: 0 additions & 2 deletions packages/graph-engine/tests/data/raw/outputObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"edges": [
{
"style": { "strokeWidth": 2 },
"markerEnd": { "type": "arrowclosed" },
"source": "4afda872-881c-4e2b-905c-b5995ad0ebda",
"sourceHandle": "background",
"target": "ef251584-99f2-4976-8f0e-e265a12223ce",
Expand All @@ -48,7 +47,6 @@
},
{
"style": { "strokeWidth": 2 },
"markerEnd": { "type": "arrowclosed" },
"source": "ef251584-99f2-4976-8f0e-e265a12223ce",
"sourceHandle": "output",
"target": "3a2f6a06-c2a5-4b82-9f93-f9afa00aaacf",
Expand Down
3 changes: 0 additions & 3 deletions packages/graph-engine/tests/data/raw/tokenSetInput.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"edges": [
{
"style": { "strokeWidth": 2 },
"markerEnd": { "type": "arrowclosed" },
"source": "80182fd6-c10d-4adb-810b-15d555b73c12",
"sourceHandle": "background-color",
"target": "413a4ad6-65ca-4d6d-9f68-f12a52ae8185",
Expand All @@ -57,7 +56,6 @@
},
{
"style": { "strokeWidth": 2 },
"markerEnd": { "type": "arrowclosed" },
"source": "413a4ad6-65ca-4d6d-9f68-f12a52ae8185",
"sourceHandle": "output",
"target": "db665864-d7fe-4345-a084-9f020ef5ee9c",
Expand All @@ -67,7 +65,6 @@
},
{
"style": { "strokeWidth": 2 },
"markerEnd": { "type": "arrowclosed" },
"source": "95b28e18-149f-42df-a61c-891748baeff6",
"sourceHandle": "colorSet",
"target": "80182fd6-c10d-4adb-810b-15d555b73c12",
Expand Down
Loading

0 comments on commit 858520e

Please sign in to comment.