Skip to content

BlockSuite API Documentation / @blocksuite/blocks / AttachmentBlockModel

Class: AttachmentBlockModel

Extends

  • AttachmentBlockModel_base

Implements

  • GfxElementGeometry

Constructors

new AttachmentBlockModel()

new AttachmentBlockModel(): AttachmentBlockModel

Returns

AttachmentBlockModel

Inherited from

AttachmentBlockModel_base.constructor

Defined in

packages/affine/model/dist/blocks/attachment/attachment-model.d.ts:50

Properties

[modelLabel]

[modelLabel]: AttachmentBlockProps

Inherited from

AttachmentBlockModel_base.[modelLabel]

Defined in

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


caption?

optional caption: string

Inherited from

AttachmentBlockModel_base.caption

Defined in

packages/affine/model/dist/blocks/attachment/attachment-model.d.ts:28


caption$

caption$: Signal<undefined | string>

Inherited from

AttachmentBlockModel_base.caption$


childMap

childMap: ReadonlySignal<Map<string, number>>

Inherited from

AttachmentBlockModel_base.childMap

Defined in

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


connectable

connectable: boolean

Inherited from

AttachmentBlockModel_base.connectable

Defined in

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


created

created: Slot<void>

Inherited from

AttachmentBlockModel_base.created

Defined in

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


deleted

deleted: Slot<void>

Inherited from

AttachmentBlockModel_base.deleted

Defined in

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


embed

embed: undefined | boolean

Whether to show the attachment as an embed view.

Inherited from

AttachmentBlockModel_base.embed

Defined in

packages/affine/model/dist/blocks/attachment/attachment-model.d.ts:33


embed$

embed$: Signal<undefined | boolean>

Inherited from

AttachmentBlockModel_base.embed$


flavour

flavour: string

Inherited from

AttachmentBlockModel_base.flavour

Defined in

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


id

id: string

Inherited from

AttachmentBlockModel_base.id

Defined in

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


index

index: string

Inherited from

AttachmentBlockModel_base.index

Defined in

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


index$

index$: Signal<string>

Inherited from

AttachmentBlockModel_base.index$


isEmpty

isEmpty: ReadonlySignal<boolean>

Inherited from

AttachmentBlockModel_base.isEmpty

Defined in

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


keys

keys: string[]

Inherited from

AttachmentBlockModel_base.keys

Defined in

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


lockedBySelf?

optional lockedBySelf: boolean

Inherited from

AttachmentBlockModel_base.lockedBySelf

Defined in

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


lockedBySelf$

lockedBySelf$: Signal<undefined | boolean>

Inherited from

AttachmentBlockModel_base.lockedBySelf$


name

name: string

Inherited from

AttachmentBlockModel_base.name

Defined in

packages/affine/model/dist/blocks/attachment/attachment-model.d.ts:22


name$

name$: Signal<string>

Inherited from

AttachmentBlockModel_base.name$


page

page: Doc

Deprecated

use doc instead

Inherited from

AttachmentBlockModel_base.page

Defined in

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


pop()

pop: (prop) => void

Parameters

prop

"xywh" | "index" | "lockedBySelf" | "caption" | "embed" | "style" | "type" | "sourceId" | "name" | "size" | "rotate"

Returns

void

Inherited from

AttachmentBlockModel_base.pop

Defined in

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


propsUpdated

propsUpdated: Slot<{ key: string; }>

Inherited from

AttachmentBlockModel_base.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.

Inherited from

AttachmentBlockModel_base.responseExtension

Defined in

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


role

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

Inherited from

AttachmentBlockModel_base.role

Defined in

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


rotate

rotate: number

Inherited from

AttachmentBlockModel_base.rotate

Defined in

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


rotate$

rotate$: Signal<number>

Inherited from

AttachmentBlockModel_base.rotate$


size

size: number

Inherited from

AttachmentBlockModel_base.size

Defined in

packages/affine/model/dist/blocks/attachment/attachment-model.d.ts:23


size$

size$: Signal<number>

Inherited from

AttachmentBlockModel_base.size$


sourceId?

optional sourceId: string

Inherited from

AttachmentBlockModel_base.sourceId

Defined in

packages/affine/model/dist/blocks/attachment/attachment-model.d.ts:29


sourceId$

sourceId$: Signal<undefined | string>

Inherited from

AttachmentBlockModel_base.sourceId$


stash()

stash: (prop) => void

Parameters

prop

"xywh" | "index" | "lockedBySelf" | "caption" | "embed" | "style" | "type" | "sourceId" | "name" | "size" | "rotate"

Returns

void

Inherited from

AttachmentBlockModel_base.stash

Defined in

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


style?

optional style: EmbedCardStyle

Inherited from

AttachmentBlockModel_base.style

Defined in

packages/affine/model/dist/blocks/attachment/attachment-model.d.ts:34


style$

style$: Signal<undefined | EmbedCardStyle>

Inherited from

AttachmentBlockModel_base.style$


text?

optional text: Text

Inherited from

AttachmentBlockModel_base.text

Defined in

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


type

type: string

MIME type

Inherited from

AttachmentBlockModel_base.type

Defined in

packages/affine/model/dist/blocks/attachment/attachment-model.d.ts:27


type$

type$: Signal<string>

Inherited from

AttachmentBlockModel_base.type$


version

version: number

Inherited from

AttachmentBlockModel_base.version

Defined in

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


xywh

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

Inherited from

AttachmentBlockModel_base.xywh

Defined in

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


xywh$

xywh$: Signal<`[${number},${number},${number},${number}]`>

Inherited from

AttachmentBlockModel_base.xywh$


yBlock

yBlock: YBlock

Inherited from

AttachmentBlockModel_base.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

AttachmentBlockModel_base.children

Defined in

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


deserializedXYWH

Get Signature

get deserializedXYWH(): XYWH

Returns

XYWH

Inherited from

AttachmentBlockModel_base.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

AttachmentBlockModel_base.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

Inherited from

AttachmentBlockModel_base.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

Inherited from

AttachmentBlockModel_base.externalBound

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

Inherited from

AttachmentBlockModel_base.externalXYWH

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

Inherited from

AttachmentBlockModel_base.group

Defined in

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


groups

Get Signature

get groups(): GfxGroupModel[]

Returns

GfxGroupModel[]

Inherited from

AttachmentBlockModel_base.groups

Defined in

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


h

Get Signature

get h(): number

Returns

number

Inherited from

AttachmentBlockModel_base.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

AttachmentBlockModel_base.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

Inherited from

AttachmentBlockModel_base.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

Inherited from

AttachmentBlockModel_base.surface

Defined in

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


w

Get Signature

get w(): number

Returns

number

Inherited from

AttachmentBlockModel_base.w

Defined in

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


x

Get Signature

get x(): number

Returns

number

Inherited from

AttachmentBlockModel_base.x

Defined in

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


y

Get Signature

get y(): number

Returns

number

Inherited from

AttachmentBlockModel_base.y

Defined in

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

Methods

[dispose]()

[dispose](): void

Returns

void

Inherited from

AttachmentBlockModel_base.[dispose]

Defined in

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


containsBound()

containsBound(bounds): boolean

Parameters

bounds

Bound

Returns

boolean

Implementation of

GfxElementGeometry.containsBound

Inherited from

AttachmentBlockModel_base.containsBound

Defined in

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


dispose()

dispose(): void

Returns

void

Inherited from

AttachmentBlockModel_base.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

AttachmentBlockModel_base.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

GfxElementGeometry.getLineIntersections

Inherited from

AttachmentBlockModel_base.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

GfxElementGeometry.getNearestPoint

Inherited from

AttachmentBlockModel_base.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

GfxElementGeometry.getRelativePointLocation

Inherited from

AttachmentBlockModel_base.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

GfxElementGeometry.includesPoint

Inherited from

AttachmentBlockModel_base.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

GfxElementGeometry.intersectsBound

Inherited from

AttachmentBlockModel_base.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

Inherited from

AttachmentBlockModel_base.isLocked

Defined in

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


isLockedByAncestor()

isLockedByAncestor(): boolean

Returns

boolean

Inherited from

AttachmentBlockModel_base.isLockedByAncestor

Defined in

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


isLockedBySelf()

isLockedBySelf(): boolean

Returns

boolean

Inherited from

AttachmentBlockModel_base.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

AttachmentBlockModel_base.lastChild

Defined in

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


lock()

lock(): void

Returns

void

Inherited from

AttachmentBlockModel_base.lock

Defined in

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


unlock()

unlock(): void

Returns

void

Inherited from

AttachmentBlockModel_base.unlock

Defined in

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