mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 12:06:35 +08:00
refactor(editor): unify directories naming (#11516)
**Directory Structure Changes** - Renamed multiple block-related directories by removing the "block-" prefix: - `block-attachment` → `attachment` - `block-bookmark` → `bookmark` - `block-callout` → `callout` - `block-code` → `code` - `block-data-view` → `data-view` - `block-database` → `database` - `block-divider` → `divider` - `block-edgeless-text` → `edgeless-text` - `block-embed` → `embed`
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import type { DirectiveResult } from 'lit/directive.js';
|
||||
import { styleMap, type StyleMapDirective } from 'lit/directives/style-map.js';
|
||||
|
||||
import type { SelectionRect } from './doc-remote-selection.js';
|
||||
|
||||
export function selectionStyle(
|
||||
rect: SelectionRect,
|
||||
color: string
|
||||
): DirectiveResult<typeof StyleMapDirective> {
|
||||
return styleMap({
|
||||
position: 'absolute',
|
||||
width: `${rect.width}px`,
|
||||
height: `${rect.height}px`,
|
||||
top: `${rect.top}px`,
|
||||
left: `${rect.left}px`,
|
||||
backgroundColor: rect.transparent ? 'transparent' : color,
|
||||
pointerEvent: 'none',
|
||||
opacity: '20%',
|
||||
borderRadius: '3px',
|
||||
});
|
||||
}
|
||||
|
||||
export function cursorStyle(
|
||||
rect: SelectionRect,
|
||||
color: string
|
||||
): DirectiveResult<typeof StyleMapDirective> {
|
||||
return styleMap({
|
||||
position: 'absolute',
|
||||
width: `${rect.width}px`,
|
||||
height: `${rect.height}px`,
|
||||
top: `${rect.top}px`,
|
||||
left: `${rect.left}px`,
|
||||
backgroundColor: color,
|
||||
pointerEvent: 'none',
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user