-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #192 from gridaco/staging
2022W49 - Isolated Inspection mode & Improved Scenes Management (WIP)
- Loading branch information
Showing
42 changed files
with
3,786 additions
and
3,080 deletions.
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
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
84 changes: 84 additions & 0 deletions
84
editor-packages/editor-dashboard/components/dashbaord-grid-placement-auxilary-drop-guide.tsx
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,84 @@ | ||
import React from "react"; | ||
import styled from "@emotion/styled"; | ||
import assert from "assert"; | ||
|
||
export type AuxilaryGridDropGuideLeftOrRightSpecification = { | ||
left?: boolean; | ||
right?: boolean; | ||
}; | ||
type AuxilaryGridDropGuide = AuxilaryGridDropGuideLeftOrRightSpecification & { | ||
onClick?: () => void; | ||
over?: boolean; | ||
}; | ||
|
||
/** | ||
* This is a guide placed between items | ||
* | ||
* Functions | ||
* 1. Highlight on drop | ||
* 2. Highlight on hover (if new section can be created) | ||
*/ | ||
export const AuxilaryDashbaordGridPlacementGuide = React.forwardRef(function ( | ||
{ left, right, over, onClick }: AuxilaryGridDropGuide, | ||
ref: React.Ref<HTMLDivElement> | ||
) { | ||
assert(left !== right, 'You can only have one of "left" or "right"'); | ||
|
||
return ( | ||
<Guide | ||
ref={ref} | ||
onClick={onClick} | ||
data-over={over} | ||
data-left={left} | ||
data-right={right} | ||
/> | ||
); | ||
}); | ||
|
||
const GUIDE_MARGIN = 4; | ||
const GUIDE_ACCESSIBLE_WIDTH = 32; | ||
|
||
const Guide = styled.div` | ||
--guide-margin-vertical: 24px; | ||
--color-highlight: rgb(0, 179, 255); | ||
position: absolute; | ||
width: ${GUIDE_ACCESSIBLE_WIDTH}px; | ||
top: var(--guide-margin-vertical); | ||
bottom: calc(var(--guide-margin-vertical) + 44px); | ||
&[data-left="true"] { | ||
left: ${-(GUIDE_MARGIN + GUIDE_ACCESSIBLE_WIDTH)}px; | ||
} | ||
&[data-right="true"] { | ||
right: ${-(GUIDE_MARGIN + GUIDE_ACCESSIBLE_WIDTH)}px; | ||
} | ||
::after { | ||
content: ""; | ||
position: absolute; | ||
opacity: 0; | ||
top: 0; | ||
/* center under parent */ | ||
left: 50%; | ||
width: 2px; | ||
height: 100%; | ||
background: var(--color-highlight); | ||
transition: opacity 0.2s ease-in-out; | ||
} | ||
&[data-over="true"] { | ||
::after { | ||
opacity: 1; | ||
} | ||
} | ||
&:hover { | ||
::after { | ||
opacity: 1; | ||
} | ||
} | ||
`; |
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
Oops, something went wrong.
e20359f
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.
Successfully deployed to the following URLs:
code – ./
designto-codes.vercel.app
code-grida.vercel.app
code.grida.co
designto.codes
code-git-main-grida.vercel.app
figma.codes