BlockSuite API Documentation / @blocksuite/block-std / RangeManager
Class: RangeManager
Defined in: packages/framework/block-std/src/range/range-manager.ts:13
CRUD for Range and TextSelection
Extends
Constructors
new RangeManager()
new RangeManager(
std
):RangeManager
Defined in: packages/framework/block-std/src/extension/lifecycle-watcher.ts:28
Parameters
std
Returns
RangeManager
Inherited from
Properties
binding
binding:
null
|RangeBinding
=null
Defined in: packages/framework/block-std/src/range/range-manager.ts:16
std
readonly
std:BlockStdScope
Defined in: packages/framework/block-std/src/extension/lifecycle-watcher.ts:28
Inherited from
key
readonly
static
key:"rangeManager"
='rangeManager'
Defined in: packages/framework/block-std/src/range/range-manager.ts:14
Overrides
Accessors
value
Get Signature
get value():
undefined
|null
|Range
Defined in: packages/framework/block-std/src/range/range-manager.ts:18
Returns
undefined
| null
| Range
Methods
clear()
clear():
void
Defined in: packages/framework/block-std/src/range/range-manager.ts:31
Returns
void
created()
created():
void
Defined in: packages/framework/block-std/src/extension/lifecycle-watcher.ts:52
Called when std is created.
Returns
void
Inherited from
getClosestBlock()
getClosestBlock(
node
):null
|BlockComponent
<BlockModel
<object
>,BlockService
,string
>
Defined in: packages/framework/block-std/src/range/range-manager.ts:47
Parameters
node
Node
Returns
null
| BlockComponent
<BlockModel
<object
>, BlockService
, string
>
getClosestInlineEditor()
getClosestInlineEditor(
node
):null
|InlineEditor
<{bold
:null
|true
;code
:null
|true
;italic
:null
|true
;link
:null
|string
;strike
:null
|true
;underline
:null
|true
; }>
Defined in: packages/framework/block-std/src/range/range-manager.ts:56
Parameters
node
Node
Returns
null
| InlineEditor
<{ bold
: null
| true
; code
: null
| true
; italic
: null
| true
; link
: null
| string
; strike
: null
| true
; underline
: null
| true
; }>
getSelectedBlockComponentsByRange()
getSelectedBlockComponentsByRange(
range
,options
):BlockComponent
<BlockModel
<object
>,BlockService
,string
>[]
Defined in: packages/framework/block-std/src/range/range-manager.ts:81
Parameters
range
Range
options
match?
(el
) => boolean
mode?
"flat"
| "all"
| "highest"
Returns
BlockComponent
<BlockModel
<object
>, BlockService
, string
>[]
Example
aaa
b[bb
ccc
ddd
ee]e
all mode: [aaa, bbb, ccc, ddd, eee]
flat mode: [bbb, ccc, ddd, eee]
highest mode: [bbb, ddd]
match function will be evaluated before filtering using mode
mounted()
mounted():
void
Defined in: packages/framework/block-std/src/range/range-manager.ts:127
Called when editor host is mounted. Which means the editor host emit the connectedCallback
lifecycle event.
Returns
void
Overrides
queryInlineEditorByPath()
queryInlineEditorByPath(
path
):null
|InlineEditor
<{bold
:null
|true
;code
:null
|true
;italic
:null
|true
;link
:null
|string
;strike
:null
|true
;underline
:null
|true
; }>
Defined in: packages/framework/block-std/src/range/range-manager.ts:131
Parameters
path
string
Returns
null
| InlineEditor
<{ bold
: null
| true
; code
: null
| true
; italic
: null
| true
; link
: null
| string
; strike
: null
| true
; underline
: null
| true
; }>
rangeToTextSelection()
rangeToTextSelection(
range
,reverse
):null
|TextSelection
Defined in: packages/framework/block-std/src/range/range-manager.ts:145
Parameters
range
Range
reverse
boolean
= false
Returns
null
| TextSelection
rendered()
rendered():
void
Defined in: packages/framework/block-std/src/extension/lifecycle-watcher.ts:63
Called when std.render
is called.
Returns
void
Inherited from
set()
set(
range
):void
Defined in: packages/framework/block-std/src/range/range-manager.ts:184
Parameters
range
Range
Returns
void
syncRangeToTextSelection()
syncRangeToTextSelection(
range
,isRangeReversed
):void
Defined in: packages/framework/block-std/src/range/range-manager.ts:191
Parameters
range
Range
isRangeReversed
boolean
Returns
void
syncTextSelectionToRange()
syncTextSelectionToRange(
selection
):void
Defined in: packages/framework/block-std/src/range/range-manager.ts:207
Parameters
selection
Returns
void
textSelectionToRange()
textSelectionToRange(
selection
):null
|Range
Defined in: packages/framework/block-std/src/range/range-manager.ts:216
Parameters
selection
Returns
null
| Range
unmounted()
unmounted():
void
Defined in: packages/framework/block-std/src/extension/lifecycle-watcher.ts:69
Called when editor host is unmounted. Which means the editor host emit the disconnectedCallback
lifecycle event.
Returns
void
Inherited from
setup()
static
setup(di
):void
Defined in: packages/framework/block-std/src/extension/lifecycle-watcher.ts:32
Parameters
di
Container
Returns
void