BlockSuite API Documentation / @blocksuite/blocks / CopilotTool
Class: CopilotTool
Extends
BaseTool
Constructors
new CopilotTool()
new CopilotTool(
gfx
):CopilotTool
Parameters
• gfx: GfxController
Returns
Inherited from
BaseTool.constructor
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:23
Properties
activatedOption
activatedOption:
Record
<string
,unknown
>
Inherited from
BaseTool.activatedOption
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:11
addHook()
addHook: <
K
>(evtName
,handler
) =>void
Type Parameters
• K extends "click"
| "doubleClick"
| "tripleClick"
| "pointerDown"
| "pointerMove"
| "pointerUp"
| "pointerOut"
| "dragStart"
| "dragMove"
| "dragEnd"
| "contextMenu"
| keyof BuiltInEventMap
Parameters
• evtName: K
• handler
Returns
void
Inherited from
BaseTool.addHook
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:12
disposable
protected
readonly
disposable:DisposableGroup
The disposable
will be disposed when the tool is unloaded.
Inherited from
BaseTool.disposable
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:16
draggingAreaUpdated
draggingAreaUpdated:
Slot
<boolean
|void
>
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:18
dragLastPoint
dragLastPoint: [
number
,number
]
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:20
dragStartPoint
dragStartPoint: [
number
,number
]
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:22
gfx
readonly
gfx:GfxController
Inherited from
BaseTool.gfx
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:8
toolName
static
toolName:string
='copilot'
Overrides
BaseTool.toolName
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:14
Accessors
active
get
active():boolean
Returns
boolean
Inherited from
BaseTool.active
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:17
allowDragWithRightButton
get
allowDragWithRightButton():boolean
Returns
boolean
Overrides
BaseTool.allowDragWithRightButton
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:24
area
get
area():DOMRect
Returns
DOMRect
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:28
controller
get
controller():ToolController
Returns
ToolController
Inherited from
BaseTool.controller
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:19
doc
get
doc():Doc
Returns
Inherited from
BaseTool.doc
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:20
processing
get
processing():boolean
Returns
boolean
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:41
selectedElements
get
selectedElements():GfxModel
[]
Returns
GfxModel
[]
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:49
std
get
std():BlockStdScope
Returns
Inherited from
BaseTool.std
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:21
toolName
get
toolName():string
Returns
string
Inherited from
BaseTool.toolName
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:22
Methods
abort()
abort():
void
Returns
void
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:58
activate()
activate():
void
Called when the tool is activated.
Returns
void
Overrides
BaseTool.activate
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:65
click()
click(
_
):void
Parameters
• _: PointerEventState
Returns
void
Inherited from
BaseTool.click
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:30
contextMenu()
contextMenu(
_
):void
Parameters
• _: PointerEventState
Returns
void
Inherited from
BaseTool.contextMenu
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:31
deactivate()
deactivate():
void
Called when the tool is deactivated.
Returns
void
Overrides
BaseTool.deactivate
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:73
doubleClick()
doubleClick(
_
):void
Parameters
• _: PointerEventState
Returns
void
Inherited from
BaseTool.doubleClick
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:36
dragEnd()
dragEnd():
void
Returns
void
Overrides
BaseTool.dragEnd
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:77
dragMove()
dragMove(
e
):void
Parameters
• e: PointerEventState
Returns
void
Overrides
BaseTool.dragMove
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:84
dragStart()
dragStart(
e
):void
Parameters
• e: PointerEventState
Returns
void
Overrides
BaseTool.dragStart
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:107
mounted()
mounted():
void
Called when the tool is registered.
Returns
void
Overrides
BaseTool.mounted
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:115
onContainerPointerDown()
onContainerPointerDown(
e
):void
Parameters
• e: PointerEventState
Returns
void
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:129
pointerDown()
pointerDown(
_
):void
Parameters
• _: PointerEventState
Returns
void
Inherited from
BaseTool.pointerDown
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:44
pointerMove()
pointerMove(
_
):void
Parameters
• _: PointerEventState
Returns
void
Inherited from
BaseTool.pointerMove
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:45
pointerOut()
pointerOut(
_
):void
Parameters
• _: PointerEventState
Returns
void
Inherited from
BaseTool.pointerOut
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:46
pointerUp()
pointerUp(
_
):void
Parameters
• _: PointerEventState
Returns
void
Inherited from
BaseTool.pointerUp
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:47
tripleClick()
tripleClick(
_
):void
Parameters
• _: PointerEventState
Returns
void
Inherited from
BaseTool.tripleClick
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:48
unmounted()
unmounted():
void
Called when the tool is unloaded, usually when the whole ToolController
is destroyed.
Returns
void
Inherited from
BaseTool.unmounted
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:52
updateDragPointsWith()
updateDragPointsWith(
selectedElements
,padding
):void
Parameters
• selectedElements: GfxModel
[]
• padding: number
= 0
Returns
void
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:138
updateSelectionWith()
updateSelectionWith(
selectedElements
,padding
):void
Parameters
• selectedElements: GfxModel
[]
• padding: number
= 0
Returns
void
Defined in
packages/blocks/src/root-block/edgeless/gfx-tool/copilot-tool.ts:150
setup()
static
setup(di
):void
Parameters
• di: Container
Returns
void
Inherited from
BaseTool.setup
Defined in
packages/framework/block-std/dist/gfx/tool/tool.d.ts:24