BlockSuite API Documentation / @blocksuite/affine-model / FrameBlockModel
Class: FrameBlockModel
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:67
Extends
GfxBlockElementModel
<FrameBlockProps
,this
>
Implements
GfxElementGeometry
GfxGroupCompatibleInterface
Constructors
new FrameBlockModel()
new FrameBlockModel():
FrameBlockModel
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:42
Returns
FrameBlockModel
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).constructor
Properties
_props
_props:
SignaledProps
<FrameBlockProps
>
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:33
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel)._props
[gfxGroupCompatibleSymbol]
[gfxGroupCompatibleSymbol]:
true
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:71
Implementation of
GfxGroupCompatibleInterface.[gfxGroupCompatibleSymbol]
[modelLabel]
[modelLabel]:
FrameBlockProps
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:24
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).[modelLabel]
childMap
childMap:
ReadonlySignal
<Map
<string
,number
>>
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:17
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).childMap
connectable
connectable:
boolean
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:34
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).connectable
created
created:
Subject
<void
>
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:18
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).created
deleted
deleted:
Subject
<void
>
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:19
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).deleted
id
id:
string
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:20
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).id
keys
keys:
string
[]
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:23
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).keys
pop()
pop: (
prop
) =>void
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:25
Parameters
prop
"title"
| "xywh"
| "index"
| "lockedBySelf"
| "background"
| "childElementIds"
| "presentationIndex"
Returns
void
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).pop
propsUpdated
propsUpdated:
Subject
<{key
:string
; }>
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:26
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).propsUpdated
responseExtension
responseExtension: [
number
,number
]
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:59
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
GfxGroupCompatibleInterface.responseExtension
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).responseExtension
rotate
rotate:
number
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:60
Implementation of
GfxGroupCompatibleInterface.rotate
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).rotate
schema
schema:
object
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:21
model
model:
object
model.children?
optional
model.children:string
[]
model.flavour
model.flavour:
string
model.isFlatData?
optional
model.isFlatData:boolean
model.parent?
optional
model.parent:string
[]
model.props()?
optional
model.props: (args_0
, ...args
) =>Record
<string
,any
>
Parameters
args_0
args
...unknown
[]
Returns
Record
<string
, any
>
model.role
model.role:
"root"
|"hub"
|"content"
model.toModel()?
optional
model.toModel: (...args
) =>BlockModel
<object
>
Parameters
args
...unknown
[]
Returns
BlockModel
<object
>
transformer()?
optional
transformer: (args_0
, ...args
) =>BaseBlockTransformer
<object
>
Parameters
args_0
Map
<string
, unknown
>
args
...unknown
[]
Returns
BaseBlockTransformer
<object
>
version
version:
number
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).schema
stash()
stash: (
prop
) =>void
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:29
Parameters
prop
"title"
| "xywh"
| "index"
| "lockedBySelf"
| "background"
| "childElementIds"
| "presentationIndex"
Returns
void
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).stash
yBlock
yBlock:
YBlock
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:32
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).yBlock
Accessors
childElements
Get Signature
get childElements():
GfxModel
[]
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:73
All child element models of this container. Note that the childElements
may not contains all the children in childIds
, because some children may not be loaded.
Returns
GfxModel
[]
Implementation of
GfxGroupCompatibleInterface.childElements
childIds
Get Signature
get childIds():
string
[]
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:89
All child ids of this container.
Returns
string
[]
Implementation of
GfxGroupCompatibleInterface.childIds
children
Get Signature
get children():
BlockModel
<object
>[]
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:37
Returns
BlockModel
<object
>[]
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).children
descendantElements
Get Signature
get descendantElements():
GfxModel
[]
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:95
Returns
GfxModel
[]
Implementation of
GfxGroupCompatibleInterface.descendantElements
deserializedXYWH
Get Signature
get deserializedXYWH():
XYWH
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:61
Returns
XYWH
Implementation of
GfxGroupCompatibleInterface.deserializedXYWH
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).deserializedXYWH
doc
Get Signature
get doc():
Store
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:38
Returns
Set Signature
set doc(
doc
):void
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:39
Parameters
doc
Returns
void
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).doc
elementBound
Get Signature
get elementBound():
Bound
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:62
The bound of the element without considering the response extension.
Returns
Bound
Implementation of
GfxGroupCompatibleInterface.elementBound
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).elementBound
externalBound
Get Signature
get externalBound():
null
|Bound
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:63
Returns
null
| Bound
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).externalBound
externalXYWH
Get Signature
get externalXYWH():
undefined
|`[${number},${number},${number},${number}]`
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:64
Returns
undefined
| `[${number},${number},${number},${number}]`
Set Signature
set externalXYWH(
xywh
):void
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:65
Parameters
xywh
undefined
| `[${number},${number},${number},${number}]`
Returns
void
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).externalXYWH
flavour
Get Signature
get flavour():
string
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:35
Returns
string
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).flavour
group
Get Signature
get group():
null
|GfxGroupModel
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:66
Returns
null
| GfxGroupModel
Implementation of
GfxGroupCompatibleInterface.group
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).group
groups
Get Signature
get groups():
GfxGroupModel
[]
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:67
Returns
GfxGroupModel
[]
Implementation of
GfxGroupCompatibleInterface.groups
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).groups
h
Get Signature
get h():
number
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:68
Returns
number
Implementation of
GfxGroupCompatibleInterface.h
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).h
index
Get Signature
get index():
string
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:38
Returns
string
Set Signature
set index(
index
):void
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:40
Parameters
index
string
Returns
void
Implementation of
GfxGroupCompatibleInterface.index
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).index
index$
Get Signature
get index$():
Signal
<Props
["index"
]>
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:39
Returns
Signal
<Props
["index"
]>
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).index$
lockedBySelf
Get Signature
get lockedBySelf():
undefined
|boolean
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:41
Indicates whether the current block is explicitly locked by self. For checking the lock status of the element, use isLocked
instead. For (un)locking the element, use (un)lock
instead.
Returns
undefined
| boolean
Set Signature
set lockedBySelf(
lockedBySelf
):void
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:43
Indicates whether the current block is explicitly locked by self. For checking the lock status of the element, use isLocked
instead. For (un)locking the element, use (un)lock
instead.
Parameters
lockedBySelf
undefined
| boolean
Returns
void
Implementation of
GfxGroupCompatibleInterface.lockedBySelf
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).lockedBySelf
lockedBySelf$
Get Signature
get lockedBySelf$():
Signal
<Props
["lockedBySelf"
]>
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:42
Returns
Signal
<Props
["lockedBySelf"
]>
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).lockedBySelf$
parent
Get Signature
get parent():
null
|BlockModel
<object
>
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:40
Returns
null
| BlockModel
<object
>
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).parent
props
Get Signature
get props():
SignaledProps
<Props
>
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:34
Returns
SignaledProps
<Props
>
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).props
responseBound
Get Signature
get responseBound():
Bound
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:69
The bound of the element considering the response extension.
Returns
Bound
Implementation of
GfxGroupCompatibleInterface.responseBound
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).responseBound
role
Get Signature
get role():
"root"
|"hub"
|"content"
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:41
Returns
"root"
| "hub"
| "content"
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).role
surface
Get Signature
get surface():
null
|SurfaceBlockModel
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:70
Returns
null
| SurfaceBlockModel
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).surface
text
Get Signature
get text():
undefined
|Text
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:30
Returns
undefined
| Text
Set Signature
set text(
text
):void
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:31
Parameters
text
Returns
void
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).text
version
Get Signature
get version():
number
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:36
Returns
number
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).version
w
Get Signature
get w():
number
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:71
Returns
number
Implementation of
GfxGroupCompatibleInterface.w
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).w
x
Get Signature
get x():
number
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:72
Returns
number
Implementation of
GfxGroupCompatibleInterface.x
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).x
xywh
Get Signature
get xywh():
`[${number},${number},${number},${number}]`
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:35
Returns
`[${number},${number},${number},${number}]`
Set Signature
set xywh(
xywh
):void
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:37
Parameters
xywh
`[${number},${number},${number},${number}]`
Returns
void
Implementation of
GfxGroupCompatibleInterface.xywh
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).xywh
xywh$
Get Signature
get xywh$():
Signal
<Props
["xywh"
]>
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:36
Returns
Signal
<Props
["xywh"
]>
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).xywh$
y
Get Signature
get y():
number
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:73
Returns
number
Implementation of
GfxGroupCompatibleInterface.y
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).y
Methods
[dispose]()
[dispose]():
void
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:46
Returns
void
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).[dispose]
addChild()
addChild(
element
):void
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:99
Parameters
element
GfxModel
Returns
void
Implementation of
GfxGroupCompatibleInterface.addChild
addChildren()
addChildren(
elements
):void
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:110
Parameters
elements
GfxModel
[]
Returns
void
containsBound()
containsBound(
bound
):boolean
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:129
Parameters
bound
Bound
Returns
boolean
Implementation of
GfxElementGeometry.containsBound
Overrides
GfxCompatible<FrameBlockProps>(BlockModel).containsBound
dispose()
dispose():
void
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:43
Returns
void
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).dispose
firstChild()
firstChild():
null
|BlockModel
<object
>
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:44
Returns
null
| BlockModel
<object
>
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).firstChild
getLineIntersections()
getLineIntersections(
start
,end
):null
|PointLocation
[]
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:75
Parameters
start
IVec
end
IVec
Returns
null
| PointLocation
[]
Implementation of
GfxElementGeometry.getLineIntersections
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).getLineIntersections
getNearestPoint()
getNearestPoint(
point
):IVec
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:76
Parameters
point
IVec
Returns
IVec
Implementation of
GfxElementGeometry.getNearestPoint
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).getNearestPoint
getRelativePointLocation()
getRelativePointLocation(
relativePoint
):PointLocation
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:77
Parameters
relativePoint
IVec
Returns
PointLocation
Implementation of
GfxElementGeometry.getRelativePointLocation
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).getRelativePointLocation
hasChild()
hasChild(
element
):boolean
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:133
Parameters
element
GfxModel
Returns
boolean
Implementation of
GfxGroupCompatibleInterface.hasChild
hasDescendant()
hasDescendant(
element
):boolean
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:139
Parameters
element
GfxModel
Returns
boolean
Implementation of
GfxGroupCompatibleInterface.hasDescendant
includesPoint()
includesPoint(
x
,y
,_
):boolean
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:143
Parameters
x
number
y
number
_
PointTestOptions
Returns
boolean
Implementation of
GfxElementGeometry.includesPoint
Overrides
GfxCompatible<FrameBlockProps>(BlockModel).includesPoint
intersectsBound()
intersectsBound(
selectedBound
):boolean
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:148
Parameters
selectedBound
Bound
Returns
boolean
Implementation of
GfxElementGeometry.intersectsBound
Overrides
GfxCompatible<FrameBlockProps>(BlockModel).intersectsBound
isEmpty()
isEmpty():
boolean
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:22
Returns
boolean
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).isEmpty
isLocked()
isLocked():
boolean
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:80
Check if the element is locked. It will check the lock status of the element and its ancestors.
Returns
boolean
Implementation of
GfxGroupCompatibleInterface.isLocked
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).isLocked
isLockedByAncestor()
isLockedByAncestor():
boolean
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:81
Returns
boolean
Implementation of
GfxGroupCompatibleInterface.isLockedByAncestor
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).isLockedByAncestor
isLockedBySelf()
isLockedBySelf():
boolean
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:82
Returns
boolean
Implementation of
GfxGroupCompatibleInterface.isLockedBySelf
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).isLockedBySelf
lastChild()
lastChild():
null
|BlockModel
<object
>
Defined in: packages/framework/store/dist/model/block/block-model.d.ts:45
Returns
null
| BlockModel
<object
>
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).lastChild
lock()
lock():
void
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:83
Returns
void
Implementation of
GfxGroupCompatibleInterface.lock
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).lock
removeChild()
removeChild(
element
):void
Defined in: packages/affine/model/src/blocks/frame/frame-model.ts:155
Parameters
element
GfxModel
Returns
void
Implementation of
GfxGroupCompatibleInterface.removeChild
unlock()
unlock():
void
Defined in: packages/framework/block-std/dist/gfx/model/gfx-block-model.d.ts:84
Returns
void
Implementation of
GfxGroupCompatibleInterface.unlock
Inherited from
GfxCompatible<FrameBlockProps>(BlockModel).unlock