2023-03-10 19:30:46 +08:00
|
|
|
import styled, { createGlobalStyle } from 'styled-components';
|
|
|
|
import { borderSize, borderSizeLarge } from '/imports/ui/stylesheets/styled-components/general';
|
|
|
|
import { toolbarButtonColor, colorWhite, colorBlack } from '/imports/ui/stylesheets/styled-components/palette';
|
2023-02-24 07:47:34 +08:00
|
|
|
import {
|
2023-02-25 07:05:14 +08:00
|
|
|
fontSizeLarger,
|
2023-02-24 07:47:34 +08:00
|
|
|
} from '/imports/ui/stylesheets/styled-components/typography';
|
|
|
|
import Button from '/imports/ui/components/common/button/component';
|
|
|
|
|
2023-03-10 19:30:46 +08:00
|
|
|
const TldrawGlobalStyle = createGlobalStyle`
|
|
|
|
${({ hideContextMenu }) => hideContextMenu && `
|
|
|
|
#TD-ContextMenu {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
`}
|
2023-03-27 23:33:10 +08:00
|
|
|
${({ menuOffset }) => `
|
2023-03-10 19:30:46 +08:00
|
|
|
#TD-StylesMenu {
|
|
|
|
position: relative;
|
2023-03-27 23:33:10 +08:00
|
|
|
right: ${menuOffset};
|
2023-03-10 19:30:46 +08:00
|
|
|
}
|
|
|
|
`}
|
|
|
|
#TD-PrimaryTools-Image {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
#slide-background-shape div {
|
|
|
|
pointer-events: none;
|
2023-03-27 20:01:59 +08:00
|
|
|
user-select: none;
|
2023-03-10 19:30:46 +08:00
|
|
|
}
|
|
|
|
div[dir*="ltr"]:has(button[aria-expanded*="false"][aria-controls*="radix-"]) {
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
[aria-expanded*="false"][aria-controls*="radix-"] {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
[class$="-side-right"] {
|
|
|
|
top: -1px;
|
|
|
|
}
|
|
|
|
${({ hasWBAccess, isPresenter, size }) => (hasWBAccess || isPresenter) && `
|
|
|
|
#TD-Tools-Dots {
|
|
|
|
height: ${size}px;
|
|
|
|
width: ${size}px;
|
|
|
|
}
|
|
|
|
#TD-Delete {
|
|
|
|
& button {
|
|
|
|
height: ${size}px;
|
|
|
|
width: ${size}px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#TD-PrimaryTools button {
|
|
|
|
height: ${size}px;
|
|
|
|
width: ${size}px;
|
|
|
|
}
|
|
|
|
#TD-Styles {
|
|
|
|
border-width: ${borderSize};
|
|
|
|
}
|
|
|
|
#TD-TopPanel-Undo,
|
|
|
|
#TD-TopPanel-Redo,
|
|
|
|
#TD-Styles {
|
|
|
|
height: 92%;
|
|
|
|
border-radius: 7px;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
border: solid ${borderSize} #ECECEC;
|
|
|
|
background-color: #ECECEC;
|
|
|
|
}
|
|
|
|
&:focus {
|
|
|
|
border: solid ${borderSize} ${colorBlack};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#TD-Styles,
|
|
|
|
#TD-TopPanel-Undo,
|
|
|
|
#TD-TopPanel-Redo {
|
|
|
|
margin: ${borderSize} ${borderSizeLarge} 0px ${borderSizeLarge};
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
${({ darkTheme }) => darkTheme && `
|
|
|
|
#TD-TopPanel-Undo,
|
|
|
|
#TD-TopPanel-Redo,
|
|
|
|
#TD-Styles {
|
|
|
|
&:focus {
|
|
|
|
border: solid ${borderSize} ${colorWhite} !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`}
|
2023-03-27 22:32:43 +08:00
|
|
|
${({ isPresenter }) => (!isPresenter) && `
|
|
|
|
#presentationInnerWrapper div{
|
|
|
|
cursor: default !important;
|
|
|
|
}
|
|
|
|
`}
|
2023-03-10 19:30:46 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const EditableWBWrapper = styled.div`
|
|
|
|
&, & > :first-child {
|
|
|
|
cursor: inherit !important;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-02-24 07:47:34 +08:00
|
|
|
const PanTool = styled(Button)`
|
|
|
|
border: none !important;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
border-radius: 7px;
|
|
|
|
background-color: ${colorWhite};
|
|
|
|
color: ${toolbarButtonColor};
|
|
|
|
|
|
|
|
& > i {
|
|
|
|
font-size: ${fontSizeLarger} !important;
|
|
|
|
[dir="rtl"] & {
|
|
|
|
-webkit-transform: scale(-1, 1);
|
|
|
|
-moz-transform: scale(-1, 1);
|
|
|
|
-ms-transform: scale(-1, 1);
|
|
|
|
-o-transform: scale(-1, 1);
|
|
|
|
transform: scale(-1, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
background-color: var(--colors-hover);
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default {
|
2023-03-10 19:30:46 +08:00
|
|
|
TldrawGlobalStyle,
|
|
|
|
EditableWBWrapper,
|
2023-02-24 07:47:34 +08:00
|
|
|
PanTool,
|
|
|
|
};
|