Tweaks to OutlinePanel
This commit is contained in:
parent
78935499ff
commit
66b6247d68
2 changed files with 59 additions and 13 deletions
|
@ -29,6 +29,9 @@ const Header = styled(BaseHeader)`
|
|||
display: flex;
|
||||
align-items: center;
|
||||
pointer-events: none;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
color: ${baseFontColor};
|
||||
--item-bg: ${baseBg};
|
||||
|
|
|
@ -8,7 +8,7 @@ const Container = styled.div`
|
|||
pointer-events: none;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50px;
|
||||
top: 12px;
|
||||
bottom: 0px;
|
||||
right: 0;
|
||||
z-index: ${panelZIndexes.outlinePanel};
|
||||
|
@ -23,43 +23,86 @@ const Container = styled.div`
|
|||
width: 20px;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
&:hover:before {
|
||||
top: -12px;
|
||||
width: 300px;
|
||||
}
|
||||
`
|
||||
|
||||
const TriggerContainer = styled.div`
|
||||
top: 0;
|
||||
`
|
||||
|
||||
const Content = styled.div`
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow-y: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
transform: translateX(-100%);
|
||||
pointer-events: auto;
|
||||
user-select: none;
|
||||
/* background-color: blue; */
|
||||
pointer-events: none;
|
||||
|
||||
${Container}:hover & {
|
||||
transform: translateX(0);
|
||||
}
|
||||
`
|
||||
|
||||
const Title = styled.div`
|
||||
width: 100%;
|
||||
`
|
||||
const headerHeight = `32px`
|
||||
|
||||
const Header = styled.div`
|
||||
display: none;
|
||||
height: ${headerHeight};
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 180px;
|
||||
pointer-events: auto;
|
||||
|
||||
&:after {
|
||||
position: absolute;
|
||||
inset: 4px 0px;
|
||||
display: block;
|
||||
content: ' ';
|
||||
pointer-events: none;
|
||||
z-index: -1;
|
||||
background-color: #69777947;
|
||||
border-radius: 0 2px 2px 0;
|
||||
}
|
||||
`
|
||||
|
||||
const Title = styled.div`
|
||||
margin: 0 10px;
|
||||
color: #ffffffc2;
|
||||
font-weight: 500;
|
||||
font-size: 10px;
|
||||
user-select: none;
|
||||
pointer-events: auto;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
`
|
||||
|
||||
const Body = styled.div`
|
||||
flex-grow: 1;
|
||||
pointer-events: auto;
|
||||
position: absolute;
|
||||
top: ${headerHeight};
|
||||
left: 0;
|
||||
height: auto;
|
||||
max-height: calc(100% - ${headerHeight});
|
||||
overflow-y: scroll;
|
||||
overflow-x: visible;
|
||||
padding: 0;
|
||||
user-select: none;
|
||||
`
|
||||
|
||||
const OutlinePanel: React.FC<{}> = (props) => {
|
||||
return (
|
||||
<Container>
|
||||
<TriggerContainer>
|
||||
{/* <ToolbarIconButton icon={} label="Outline" /> */}
|
||||
</TriggerContainer>
|
||||
<Content>
|
||||
<Header>
|
||||
<Title>Outline</Title>
|
||||
|
|
Loading…
Reference in a new issue