refactor(editor): rename block-std to std (#11250)

Closes: BS-2946
This commit is contained in:
Saul-Mirone
2025-03-28 07:20:34 +00:00
parent 4498676a96
commit 205cd7a86d
1029 changed files with 1580 additions and 1698 deletions
@@ -5,10 +5,10 @@ import {
isInsideEdgelessEditor,
isInsidePageEditor,
} from '@blocksuite/affine-shared/utils';
import { type BlockComponent, WidgetComponent } from '@blocksuite/block-std';
import type { GfxModel } from '@blocksuite/block-std/gfx';
import { DisposableGroup } from '@blocksuite/global/disposable';
import type { IVec, Point, Rect } from '@blocksuite/global/gfx';
import { type BlockComponent, WidgetComponent } from '@blocksuite/std';
import type { GfxModel } from '@blocksuite/std/gfx';
import { computed, type ReadonlySignal, signal } from '@preact/signals-core';
import { html, nothing } from 'lit';
import { query, state } from 'lit/decorators.js';
@@ -12,8 +12,8 @@ import {
BlockStdScope,
BlockViewIdentifier,
LifeCycleWatcher,
} from '@blocksuite/block-std';
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
} from '@blocksuite/std';
import { GfxControllerIdentifier } from '@blocksuite/std/gfx';
import type {
BlockModel,
BlockViewType,
@@ -1,6 +1,6 @@
import { getCurrentNativeRange } from '@blocksuite/affine-shared/utils';
import type { BlockComponent } from '@blocksuite/block-std';
import { Rect } from '@blocksuite/global/gfx';
import type { BlockComponent } from '@blocksuite/std';
import {
DRAG_HANDLE_CONTAINER_WIDTH,
@@ -4,7 +4,7 @@ import {
BlockSelection,
SurfaceSelection,
TextSelection,
} from '@blocksuite/block-std';
} from '@blocksuite/std';
import type { AffineDragHandleWidget } from '../drag-handle.js';
@@ -1,4 +1,4 @@
import { WidgetViewExtension } from '@blocksuite/block-std';
import { WidgetViewExtension } from '@blocksuite/std';
import { literal, unsafeStatic } from 'lit/static-html.js';
import { AFFINE_DRAG_HANDLE_WIDGET } from './consts';
@@ -1,13 +1,13 @@
import type { SurfaceBlockModel } from '@blocksuite/affine-block-surface';
import type { ConnectorElementModel } from '@blocksuite/affine-model';
import type { BlockStdScope } from '@blocksuite/block-std';
import type { IVec, SerializedXYWH } from '@blocksuite/global/gfx';
import { assertType } from '@blocksuite/global/utils';
import type { BlockStdScope } from '@blocksuite/std';
import {
GfxController,
type GfxModel,
isGfxGroupCompatibleModel,
} from '@blocksuite/block-std/gfx';
import type { IVec, SerializedXYWH } from '@blocksuite/global/gfx';
import { assertType } from '@blocksuite/global/utils';
} from '@blocksuite/std/gfx';
import type { TransformerMiddleware } from '@blocksuite/store';
/**
@@ -1,6 +1,6 @@
import { DatabaseBlockModel } from '@blocksuite/affine-model';
import { matchModels } from '@blocksuite/affine-shared/utils';
import type { BlockStdScope } from '@blocksuite/block-std';
import type { BlockStdScope } from '@blocksuite/std';
import type { TransformerMiddleware } from '@blocksuite/store';
export const newIdCrossDoc =
@@ -1,7 +1,7 @@
import { correctNumberedListsOrderToPrev } from '@blocksuite/affine-block-list';
import { ListBlockModel } from '@blocksuite/affine-model';
import { matchModels } from '@blocksuite/affine-shared/utils';
import type { BlockStdScope } from '@blocksuite/block-std';
import type { BlockStdScope } from '@blocksuite/std';
import type { TransformerMiddleware } from '@blocksuite/store';
export const reorderList =
@@ -18,13 +18,13 @@ import {
getClosestBlockComponentByPoint,
matchModels,
} from '@blocksuite/affine-shared/utils';
import type { BlockComponent, EditorHost } from '@blocksuite/block-std';
import {
Bound,
Point,
Rect,
type SerializedXYWH,
} from '@blocksuite/global/gfx';
import type { BlockComponent, EditorHost } from '@blocksuite/std';
import type {
BaseSelection,
BlockModel,
@@ -30,13 +30,21 @@ import {
getScrollContainer,
matchModels,
} from '@blocksuite/affine-shared/utils';
import {
Bound,
type IVec,
Point,
Rect,
type SerializedXYWH,
} from '@blocksuite/global/gfx';
import { assertType } from '@blocksuite/global/utils';
import {
BlockComponent,
type BlockStdScope,
type DragFromBlockSuite,
type DragPayload,
type DropPayload,
} from '@blocksuite/block-std';
} from '@blocksuite/std';
import {
GfxBlockElementModel,
GfxControllerIdentifier,
@@ -46,15 +54,7 @@ import {
isGfxGroupCompatibleModel,
SURFACE_YMAP_UNIQ_IDENTIFIER,
SurfaceBlockModel,
} from '@blocksuite/block-std/gfx';
import {
Bound,
type IVec,
Point,
Rect,
type SerializedXYWH,
} from '@blocksuite/global/gfx';
import { assertType } from '@blocksuite/global/utils';
} from '@blocksuite/std/gfx';
import {
type BlockModel,
type BlockSnapshot,
@@ -92,7 +92,7 @@ export type DragBlockEntity = {
export type DragBlockPayload = DragPayload<DragBlockEntity, DragFromBlockSuite>;
declare module '@blocksuite/block-std' {
declare module '@blocksuite/std' {
interface DNDEntity {
blocks: DragBlockPayload;
}
@@ -3,11 +3,11 @@ import {
type SurfaceBlockComponent,
} from '@blocksuite/affine-block-surface';
import { getSelectedRect } from '@blocksuite/affine-shared/utils';
import { type IVec, Rect } from '@blocksuite/global/gfx';
import {
GfxControllerIdentifier,
type GfxToolsFullOptionValue,
} from '@blocksuite/block-std/gfx';
import { type IVec, Rect } from '@blocksuite/global/gfx';
} from '@blocksuite/std/gfx';
import { effect } from '@preact/signals-core';
import {
@@ -1,4 +1,4 @@
import type { UIEventHandler } from '@blocksuite/block-std';
import type { UIEventHandler } from '@blocksuite/std';
import type { AffineDragHandleWidget } from '../drag-handle.js';
@@ -1,13 +1,13 @@
import type { NoteBlockComponent } from '@blocksuite/affine-block-note';
import { captureEventTarget } from '@blocksuite/affine-shared/utils';
import { Point } from '@blocksuite/global/gfx';
import {
BLOCK_ID_ATTR,
type BlockComponent,
type PointerEventState,
type UIEventHandler,
} from '@blocksuite/block-std';
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
import { Point } from '@blocksuite/global/gfx';
} from '@blocksuite/std';
import { GfxControllerIdentifier } from '@blocksuite/std/gfx';
import { computed } from '@preact/signals-core';
import throttle from 'lodash-es/throttle';