chore: merge blocksuite source code (#9213)

This commit is contained in:
Mirone
2024-12-20 15:38:06 +08:00
committed by GitHub
parent 2c9ef916f4
commit 30200ff86d
2031 changed files with 238888 additions and 229 deletions
@@ -0,0 +1,17 @@
import type { IPoint } from '@blocksuite/global/utils';
export function isFarEnough(a: IPoint, b: IPoint) {
const dx = a.x - b.x;
const dy = a.y - b.y;
return Math.pow(dx, 2) + Math.pow(dy, 2) > 4;
}
export function center(a: IPoint, b: IPoint) {
return {
x: (a.x + b.x) / 2,
y: (a.y + b.y) / 2,
};
}
export const toLowerCase = <T extends string>(str: T): Lowercase<T> =>
str.toLowerCase() as Lowercase<T>;