Skip to content

BlockSuite API Documentation / @blocksuite/blocks / EdgelessBlockModel

Class: EdgelessBlockModel<Props>

The graphic block model that can be rendered in the graphics mode. All the graphic block model should extend this class. You can use GfxCompatibleBlockModel to convert a BlockModel to a subclass that extends it.

Extends

Extended by

Type Parameters

Props extends GfxCompatibleProps = GfxCompatibleProps

Implements

  • GfxCompatibleInterface

Constructors

new EdgelessBlockModel()

new EdgelessBlockModel<Props>(): EdgelessBlockModel<Props>

Returns

EdgelessBlockModel<Props>

Inherited from

BlockModel<Props>.constructor

Defined in

packages/framework/store/dist/schema/base.d.ts:129

Properties

[modelLabel]

[modelLabel]: Props

Inherited from

BlockModel.[modelLabel]

Defined in

packages/framework/store/dist/schema/base.d.ts:115


childMap

childMap: ReadonlySignal<Map<string, number>>

Inherited from

BlockModel.childMap

Defined in

packages/framework/store/dist/schema/base.d.ts:108


connectable

connectable: boolean

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:33


created

created: Slot<void>

Inherited from

BlockModel.created

Defined in

packages/framework/store/dist/schema/base.d.ts:109


deleted

deleted: Slot<void>

Inherited from

BlockModel.deleted

Defined in

packages/framework/store/dist/schema/base.d.ts:110


flavour

flavour: string

Inherited from

BlockModel.flavour

Defined in

packages/framework/store/dist/schema/base.d.ts:111


id

id: string

Inherited from

BlockModel.id

Defined in

packages/framework/store/dist/schema/base.d.ts:112


index

index: string

Implementation of

GfxCompatibleInterface.index

Inherited from

BlockModel.index

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:13


index$

index$: Signal<Props["index"]>

Inherited from

BlockModel.index$


isEmpty

isEmpty: ReadonlySignal<boolean>

Inherited from

BlockModel.isEmpty

Defined in

packages/framework/store/dist/schema/base.d.ts:113


keys

keys: string[]

Inherited from

BlockModel.keys

Defined in

packages/framework/store/dist/schema/base.d.ts:114


lockedBySelf?

optional lockedBySelf: boolean

Implementation of

GfxCompatibleInterface.lockedBySelf

Inherited from

BlockModel.lockedBySelf

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:14


lockedBySelf$

lockedBySelf$: Signal<Props["lockedBySelf"]>

Inherited from

BlockModel.lockedBySelf$


page

page: Doc

Deprecated

use doc instead

Inherited from

BlockModel.page

Defined in

packages/framework/store/dist/schema/base.d.ts:104


pop()

pop: (prop) => void

Parameters

prop

keyof Props & string

Returns

void

Inherited from

BlockModel.pop

Defined in

packages/framework/store/dist/schema/base.d.ts:116


propsUpdated

propsUpdated: Slot<{ key: string; }>

Inherited from

BlockModel.propsUpdated

Defined in

packages/framework/store/dist/schema/base.d.ts:117


responseExtension

responseExtension: [number, number]

Defines the extension of the response area beyond the element's bounding box. This tuple specifies the horizontal and vertical margins to be added to the element's [x, y, width, height].

The first value represents the horizontal extension (added to both left and right sides), and the second value represents the vertical extension (added to both top and bottom sides).

The response area is computed as: [x - horizontal, y - vertical, width + 2 * horizontal, height + 2 * vertical].

Example:

  • Bounding box: [0, 0, 100, 100], responseExtension: [10, 20] Resulting response area: [-10, -20, 120, 140].
  • responseExtension: [0, 0] keeps the response area equal to the bounding box.

Implementation of

GfxCompatibleInterface.responseExtension

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:49


role

role: "root" | "hub" | "content"

Inherited from

BlockModel.role

Defined in

packages/framework/store/dist/schema/base.d.ts:120


rotate

rotate: number

Implementation of

GfxCompatibleInterface.rotate

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:50


stash()

stash: (prop) => void

Parameters

prop

keyof Props & string

Returns

void

Inherited from

BlockModel.stash

Defined in

packages/framework/store/dist/schema/base.d.ts:121


text?

optional text: Text

Inherited from

BlockModel.text

Defined in

packages/framework/store/dist/schema/base.d.ts:122


version

version: number

Inherited from

BlockModel.version

Defined in

packages/framework/store/dist/schema/base.d.ts:123


xywh

xywh: `[${number},${number},${number},${number}]`

Implementation of

GfxCompatibleInterface.xywh

Inherited from

BlockModel.xywh

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:12


xywh$

xywh$: Signal<Props["xywh"]>

Inherited from

BlockModel.xywh$


yBlock

yBlock: YBlock

Inherited from

BlockModel.yBlock

Defined in

packages/framework/store/dist/schema/base.d.ts:124

Accessors

children

Get Signature

get children(): BlockModel<object, SignaledProps<object>>[]

Returns

BlockModel<object, SignaledProps<object>>[]

Inherited from

BlockModel.children

Defined in

packages/framework/store/dist/schema/base.d.ts:125


deserializedXYWH

Get Signature

get deserializedXYWH(): XYWH

Returns

XYWH

Implementation of

GfxCompatibleInterface.deserializedXYWH

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:51


doc

Get Signature

get doc(): Doc

Returns

Doc

Set Signature

set doc(doc): void

Parameters
doc

Doc

Returns

void

Inherited from

BlockModel.doc

Defined in

packages/framework/store/dist/schema/base.d.ts:126


elementBound

Get Signature

get elementBound(): Bound

The bound of the element without considering the response extension.

Returns

Bound

Implementation of

GfxCompatibleInterface.elementBound

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:52


externalBound

Get Signature

get externalBound(): null | Bound

Returns

null | Bound

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:53


externalXYWH

Get Signature

get externalXYWH(): undefined | `[${number},${number},${number},${number}]`

Returns

undefined | `[${number},${number},${number},${number}]`

Set Signature

set externalXYWH(xywh): void

Parameters
xywh

undefined | `[${number},${number},${number},${number}]`

Returns

void

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:54


group

Get Signature

get group(): null | GfxGroupModel

Returns

null | GfxGroupModel

Implementation of

GfxCompatibleInterface.group

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:56


groups

Get Signature

get groups(): GfxGroupModel[]

Returns

GfxGroupModel[]

Implementation of

GfxCompatibleInterface.groups

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:57


h

Get Signature

get h(): number

Returns

number

Implementation of

GfxCompatibleInterface.h

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:58


parent

Get Signature

get parent(): null | BlockModel<object, SignaledProps<object>>

Returns

null | BlockModel<object, SignaledProps<object>>

Inherited from

BlockModel.parent

Defined in

packages/framework/store/dist/schema/base.d.ts:128


responseBound

Get Signature

get responseBound(): Bound

The bound of the element considering the response extension.

Returns

Bound

Implementation of

GfxCompatibleInterface.responseBound

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:59


surface

Get Signature

get surface(): null | SurfaceBlockModel

Returns

null | SurfaceBlockModel

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:60


w

Get Signature

get w(): number

Returns

number

Implementation of

GfxCompatibleInterface.w

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:61


x

Get Signature

get x(): number

Returns

number

Implementation of

GfxCompatibleInterface.x

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:62


y

Get Signature

get y(): number

Returns

number

Implementation of

GfxCompatibleInterface.y

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:63

Methods

[dispose]()

[dispose](): void

Returns

void

Inherited from

BlockModel.[dispose]

Defined in

packages/framework/store/dist/schema/base.d.ts:133


containsBound()

containsBound(bounds): boolean

Parameters

bounds

Bound

Returns

boolean

Implementation of

GfxCompatibleInterface.containsBound

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:64


dispose()

dispose(): void

Returns

void

Inherited from

BlockModel.dispose

Defined in

packages/framework/store/dist/schema/base.d.ts:130


firstChild()

firstChild(): null | BlockModel<object, SignaledProps<object>>

Returns

null | BlockModel<object, SignaledProps<object>>

Inherited from

BlockModel.firstChild

Defined in

packages/framework/store/dist/schema/base.d.ts:131


getLineIntersections()

getLineIntersections(start, end): null | PointLocation[]

Parameters

start

IVec

end

IVec

Returns

null | PointLocation[]

Implementation of

GfxCompatibleInterface.getLineIntersections

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:65


getNearestPoint()

getNearestPoint(point): IVec

Parameters

point

IVec

Returns

IVec

Implementation of

GfxCompatibleInterface.getNearestPoint

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:66


getRelativePointLocation()

getRelativePointLocation(relativePoint): PointLocation

Parameters

relativePoint

IVec

Returns

PointLocation

Implementation of

GfxCompatibleInterface.getRelativePointLocation

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:67


includesPoint()

includesPoint(x, y, opt, __): boolean

Parameters

x

number

y

number

opt

PointTestOptions

__

EditorHost

Returns

boolean

Implementation of

GfxCompatibleInterface.includesPoint

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:68


intersectsBound()

intersectsBound(bound): boolean

Parameters

bound

Bound

Returns

boolean

Implementation of

GfxCompatibleInterface.intersectsBound

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:69


isLocked()

isLocked(): boolean

Check if the element is locked. It will check the lock status of the element and its ancestors.

Returns

boolean

Implementation of

GfxCompatibleInterface.isLocked

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:70


isLockedByAncestor()

isLockedByAncestor(): boolean

Returns

boolean

Implementation of

GfxCompatibleInterface.isLockedByAncestor

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:71


isLockedBySelf()

isLockedBySelf(): boolean

Returns

boolean

Implementation of

GfxCompatibleInterface.isLockedBySelf

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:72


lastChild()

lastChild(): null | BlockModel<object, SignaledProps<object>>

Returns

null | BlockModel<object, SignaledProps<object>>

Inherited from

BlockModel.lastChild

Defined in

packages/framework/store/dist/schema/base.d.ts:132


lock()

lock(): void

Returns

void

Implementation of

GfxCompatibleInterface.lock

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:73


unlock()

unlock(): void

Returns

void

Implementation of

GfxCompatibleInterface.unlock

Defined in

packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:74