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};
|
|
|
|
}
|
|
|
|
`}
|
2023-04-02 22:38:32 +08:00
|
|
|
${({ hasWBAccess, isPresenter, panSelected }) => (hasWBAccess || isPresenter) && panSelected && `
|
2023-04-04 16:40:21 +08:00
|
|
|
[id^="TD-PrimaryTools-"] {
|
|
|
|
&:hover > div,
|
|
|
|
&:focus > div {
|
2023-04-02 22:38:32 +08:00
|
|
|
background-color: var(--colors-hover) !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`}
|
2023-03-10 19:30:46 +08:00
|
|
|
${({ darkTheme }) => darkTheme && `
|
|
|
|
#TD-TopPanel-Undo,
|
|
|
|
#TD-TopPanel-Redo,
|
|
|
|
#TD-Styles {
|
|
|
|
&:focus {
|
|
|
|
border: solid ${borderSize} ${colorWhite} !important;
|
|
|
|
}
|
|
|
|
}
|
2023-07-15 23:40:27 +08:00
|
|
|
[id="TD-Styles-Color-Container"],
|
|
|
|
[id="TD-StylesMenu"] {
|
|
|
|
filter: invert(0%) hue-rotate(180deg) contrast(100%) !important;
|
|
|
|
}
|
2023-03-10 19:30:46 +08:00
|
|
|
`}
|
2023-05-04 20:20:36 +08:00
|
|
|
${({ isPresenter, hasWBAccess }) => (!isPresenter && !hasWBAccess) && `
|
2023-03-27 22:32:43 +08:00
|
|
|
#presentationInnerWrapper div{
|
|
|
|
cursor: default !important;
|
|
|
|
}
|
|
|
|
`}
|
2023-04-19 02:03:22 +08:00
|
|
|
|
|
|
|
${({ isToolbarVisible }) => (!isToolbarVisible) && `
|
|
|
|
#TD-Tools {
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
#TD-Styles-Parent {
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
#WhiteboardOptionButton {
|
|
|
|
opacity: 0.2;
|
|
|
|
}
|
|
|
|
`}
|
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);
|
|
|
|
}
|
|
|
|
}
|
2023-04-13 22:20:32 +08:00
|
|
|
${({ panSelected }) => !panSelected && `
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
background-color: var(--colors-hover) !important;
|
|
|
|
}
|
|
|
|
`}
|
2023-02-24 07:47:34 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
export default {
|
2023-03-10 19:30:46 +08:00
|
|
|
TldrawGlobalStyle,
|
|
|
|
EditableWBWrapper,
|
2023-02-24 07:47:34 +08:00
|
|
|
PanTool,
|
|
|
|
};
|