Tweaks to OutlinePanel

This commit is contained in:
Aria Minaei 2021-07-30 22:00:02 +02:00
parent 78935499ff
commit 66b6247d68
2 changed files with 59 additions and 13 deletions

View file

@ -29,6 +29,9 @@ const Header = styled(BaseHeader)`
display: flex; display: flex;
align-items: center; align-items: center;
pointer-events: none; pointer-events: none;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: ${baseFontColor}; color: ${baseFontColor};
--item-bg: ${baseBg}; --item-bg: ${baseBg};

View file

@ -8,7 +8,7 @@ const Container = styled.div`
pointer-events: none; pointer-events: none;
position: absolute; position: absolute;
left: 0; left: 0;
top: 50px; top: 12px;
bottom: 0px; bottom: 0px;
right: 0; right: 0;
z-index: ${panelZIndexes.outlinePanel}; z-index: ${panelZIndexes.outlinePanel};
@ -23,43 +23,86 @@ const Container = styled.div`
width: 20px; width: 20px;
pointer-events: auto; pointer-events: auto;
} }
&:hover:before {
top: -12px;
width: 300px;
}
`
const TriggerContainer = styled.div`
top: 0;
` `
const Content = styled.div` const Content = styled.div`
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0;
left: 0; left: 0;
overflow-y: hidden; right: 0;
display: flex; bottom: 0;
flex-direction: column;
transform: translateX(-100%); transform: translateX(-100%);
pointer-events: auto; pointer-events: none;
user-select: none;
/* background-color: blue; */
${Container}:hover & { ${Container}:hover & {
transform: translateX(0); transform: translateX(0);
} }
` `
const Title = styled.div` const headerHeight = `32px`
width: 100%;
`
const Header = styled.div` 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` 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-y: scroll;
overflow-x: visible;
padding: 0; padding: 0;
user-select: none;
` `
const OutlinePanel: React.FC<{}> = (props) => { const OutlinePanel: React.FC<{}> = (props) => {
return ( return (
<Container> <Container>
<TriggerContainer>
{/* <ToolbarIconButton icon={} label="Outline" /> */}
</TriggerContainer>
<Content> <Content>
<Header> <Header>
<Title>Outline</Title> <Title>Outline</Title>