mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
refactor(editor): add gfx entry in bs global package (#10612)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { IS_IPAD } from '@blocksuite/global/env';
|
||||
import { nextTick, Vec } from '@blocksuite/global/utils';
|
||||
import { Vec } from '@blocksuite/global/gfx';
|
||||
import { nextTick } from '@blocksuite/global/utils';
|
||||
|
||||
import { UIEventState, UIEventStateContext } from '../base.js';
|
||||
import type { UIEventDispatcher } from '../dispatcher.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IPoint } from '@blocksuite/global/utils';
|
||||
import type { IPoint } from '@blocksuite/global/gfx';
|
||||
|
||||
export function isFarEnough(a: IPoint, b: IPoint) {
|
||||
const dx = a.x - b.x;
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import {
|
||||
assertType,
|
||||
Bound,
|
||||
DisposableGroup,
|
||||
getCommonBound,
|
||||
getCommonBoundWithRotation,
|
||||
type IBound,
|
||||
last,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import { assertType, DisposableGroup, last } from '@blocksuite/global/utils';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
import { Signal } from '@preact/signals-core';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { IBound } from '@blocksuite/global/utils';
|
||||
import type { IBound } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
Bound,
|
||||
getBoundWithRotation,
|
||||
intersects,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import type { BlockModel, Store } from '@blocksuite/store';
|
||||
|
||||
import { compare } from '../utils/layer.js';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
assertType,
|
||||
Bound,
|
||||
DisposableGroup,
|
||||
last,
|
||||
Slot,
|
||||
|
||||
@@ -5,7 +5,7 @@ import type {
|
||||
PointLocation,
|
||||
SerializedXYWH,
|
||||
XYWH,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
|
||||
import type { EditorHost } from '../../view/element/lit-host.js';
|
||||
import type { GfxGroupModel, GfxModel } from './model.js';
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import type {
|
||||
Constructor,
|
||||
IVec,
|
||||
SerializedXYWH,
|
||||
XYWH,
|
||||
} from '@blocksuite/global/utils';
|
||||
import type { IVec, SerializedXYWH, XYWH } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
Bound,
|
||||
deserializeXYWH,
|
||||
@@ -15,7 +10,8 @@ import {
|
||||
polygonGetPointTangent,
|
||||
polygonNearestPoint,
|
||||
rotatePoints,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import type { Constructor } from '@blocksuite/global/utils';
|
||||
import { BlockModel } from '@blocksuite/store';
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import {
|
||||
Bound,
|
||||
deserializeXYWH,
|
||||
DisposableGroup,
|
||||
getBoundWithRotation,
|
||||
getPointsFromBoundWithRotation,
|
||||
isEqual,
|
||||
type IVec,
|
||||
linePolygonIntersects,
|
||||
PointLocation,
|
||||
@@ -13,9 +11,9 @@ import {
|
||||
randomSeed,
|
||||
rotatePoints,
|
||||
type SerializedXYWH,
|
||||
Slot,
|
||||
type XYWH,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import { DisposableGroup, isEqual, Slot } from '@blocksuite/global/utils';
|
||||
import { createMutex } from 'lib0/mutex';
|
||||
import * as Y from 'yjs';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IVec, SerializedXYWH, XYWH } from '@blocksuite/global/utils';
|
||||
import type { IVec, SerializedXYWH, XYWH } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
Bound,
|
||||
deserializeXYWH,
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
polygonGetPointTangent,
|
||||
polygonNearestPoint,
|
||||
rotatePoints,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import { mutex } from 'lib0';
|
||||
|
||||
import type { EditorHost } from '../../../view/index.js';
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import {
|
||||
getCommonBoundWithRotation,
|
||||
type IPoint,
|
||||
} from '@blocksuite/global/gfx';
|
||||
import {
|
||||
assertType,
|
||||
DisposableGroup,
|
||||
getCommonBoundWithRotation,
|
||||
groupBy,
|
||||
type IPoint,
|
||||
Slot,
|
||||
} from '@blocksuite/global/utils';
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import type { ServiceIdentifier } from '@blocksuite/global/di';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import {
|
||||
DisposableGroup,
|
||||
type IBound,
|
||||
type IPoint,
|
||||
Slot,
|
||||
} from '@blocksuite/global/utils';
|
||||
import type { IBound, IPoint } from '@blocksuite/global/gfx';
|
||||
import { DisposableGroup, Slot } from '@blocksuite/global/utils';
|
||||
import { Signal } from '@preact/signals-core';
|
||||
|
||||
import type { PointerEventState } from '../../event/index.js';
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { type Container, createIdentifier } from '@blocksuite/global/di';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import {
|
||||
type Bound,
|
||||
DisposableGroup,
|
||||
type IVec,
|
||||
} from '@blocksuite/global/utils';
|
||||
import type { Bound, IVec } from '@blocksuite/global/gfx';
|
||||
import { DisposableGroup } from '@blocksuite/global/utils';
|
||||
import type { Extension } from '@blocksuite/store';
|
||||
|
||||
import type { PointerEventState } from '../../event/index.js';
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import {
|
||||
Bound,
|
||||
clamp,
|
||||
debounce,
|
||||
type IPoint,
|
||||
type IVec,
|
||||
Slot,
|
||||
Vec,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import { debounce, Slot } from '@blocksuite/global/utils';
|
||||
import { signal } from '@preact/signals-core';
|
||||
|
||||
import type { GfxViewportElement } from '.';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { computed } from '@preact/signals-core';
|
||||
import { nothing } from 'lit';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user