-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add draghandle to doc page title (#9079)
fix AF-1846
- Loading branch information
Showing
11 changed files
with
161 additions
and
75 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
19 changes: 19 additions & 0 deletions
19
packages/frontend/component/src/ui/drag-handle/index.css.ts
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,19 @@ | ||
import { cssVarV2 } from '@toeverything/theme/v2'; | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
export const root = style({ | ||
cursor: 'grab', | ||
color: cssVarV2.icon.secondary, | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}); | ||
|
||
export const svg = style({ | ||
borderRadius: 8, | ||
selectors: { | ||
[`${root}[data-dragging="true"] &, ${root}:hover &`]: { | ||
backgroundColor: cssVarV2.layer.background.hoverOverlay, | ||
}, | ||
}, | ||
}); |
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,39 @@ | ||
import { clsx } from 'clsx'; | ||
import { forwardRef } from 'react'; | ||
|
||
import * as styles from './index.css'; | ||
|
||
export const DragHandle = forwardRef< | ||
HTMLDivElement, | ||
{ | ||
className?: string; | ||
dragging?: boolean; | ||
} | ||
>(({ className, dragging, ...props }, ref) => { | ||
return ( | ||
<div | ||
{...props} | ||
ref={ref} | ||
data-dragging={dragging} | ||
className={clsx(styles.root, className)} | ||
> | ||
<svg | ||
width="10" | ||
height="22" | ||
viewBox="0 0 10 22" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
className={styles.svg} | ||
> | ||
<circle cx="3" cy="7" r="1" fill="currentColor" /> | ||
<circle cx="7" cy="7" r="1" fill="currentColor" /> | ||
<circle cx="3" cy="11" r="1" fill="currentColor" /> | ||
<circle cx="7" cy="11" r="1" fill="currentColor" /> | ||
<circle cx="3" cy="15" r="1" fill="currentColor" /> | ||
<circle cx="7" cy="15" r="1" fill="currentColor" /> | ||
</svg> | ||
</div> | ||
); | ||
}); | ||
|
||
DragHandle.displayName = 'DragHandle'; |
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
61 changes: 0 additions & 61 deletions
61
packages/frontend/core/src/components/hooks/use-block-suite-workspace-page-title.ts
This file was deleted.
Oops, something went wrong.
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
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