BlockSuite API Documentation / @blocksuite/block-std / RangeManager
Class: RangeManager
CRUD for Range and TextSelection
Extends
Constructors
new RangeManager()
new RangeManager(
std
):RangeManager
Parameters
• std: BlockStdScope
Returns
Inherited from
Defined in
packages/framework/block-std/src/extension/lifecycle-watcher.ts:30
Properties
binding
binding:
null
|RangeBinding
=null
Defined in
packages/framework/block-std/src/range/range-manager.ts:17
std
readonly
std:BlockStdScope
Inherited from
Defined in
packages/framework/block-std/src/extension/lifecycle-watcher.ts:30
key
readonly
static
key:"rangeManager"
='rangeManager'
Overrides
Defined in
packages/framework/block-std/src/range/range-manager.ts:15
Accessors
value
get
value():undefined
|null
|Range
Returns
undefined
| null
| Range
Defined in
packages/framework/block-std/src/range/range-manager.ts:19
Methods
clear()
clear():
void
Returns
void
Defined in
packages/framework/block-std/src/range/range-manager.ts:32
created()
created():
void
Called when std is created.
Returns
void
Inherited from
Defined in
packages/framework/block-std/src/extension/lifecycle-watcher.ts:54
getClosestBlock()
getClosestBlock(
node
):null
|BlockComponent
<BlockModel
<object
,SignaledProps
<object
>>,BlockService
,string
>
Parameters
• node: Node
Returns
null
| BlockComponent
<BlockModel
<object
, SignaledProps
<object
>>, BlockService
, string
>
Defined in
packages/framework/block-std/src/range/range-manager.ts:48
getClosestInlineEditor()
getClosestInlineEditor(
node
):null
|InlineEditor
<object
>
Parameters
• node: Node
Returns
null
| InlineEditor
<object
>
Defined in
packages/framework/block-std/src/range/range-manager.ts:57
getSelectedBlockComponentsByRange()
getSelectedBlockComponentsByRange(
range
,options
):BlockComponent
<BlockModel
<object
,SignaledProps
<object
>>,BlockService
,string
>[]
Parameters
• range: Range
• options = {}
• options.match?
• options.mode?: "flat"
| "all"
| "highest"
Returns
BlockComponent
<BlockModel
<object
, SignaledProps
<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
Defined in
packages/framework/block-std/src/range/range-manager.ts:82
mounted()
mounted():
void
Called when editor host is mounted. Which means the editor host emit the connectedCallback
lifecycle event.
Returns
void
Overrides
Defined in
packages/framework/block-std/src/range/range-manager.ts:131
queryInlineEditorByPath()
queryInlineEditorByPath(
path
):null
|InlineEditor
<object
>
Parameters
• path: string
Returns
null
| InlineEditor
<object
>
Defined in
packages/framework/block-std/src/range/range-manager.ts:135
rangeToTextSelection()
rangeToTextSelection(
range
,reverse
):null
|TextSelection
Parameters
• range: Range
• reverse: boolean
= false
Returns
null
| TextSelection
Defined in
packages/framework/block-std/src/range/range-manager.ts:149
rendered()
rendered():
void
Called when std.render
is called.
Returns
void
Inherited from
Defined in
packages/framework/block-std/src/extension/lifecycle-watcher.ts:65
set()
set(
range
):void
Parameters
• range: Range
Returns
void
Defined in
packages/framework/block-std/src/range/range-manager.ts:188
syncRangeToTextSelection()
syncRangeToTextSelection(
range
,isRangeReversed
):void
Parameters
• range: Range
• isRangeReversed: boolean
Returns
void
Defined in
packages/framework/block-std/src/range/range-manager.ts:195
syncTextSelectionToRange()
syncTextSelectionToRange(
selection
):void
Parameters
• selection: TextSelection
Returns
void
Defined in
packages/framework/block-std/src/range/range-manager.ts:211
textSelectionToRange()
textSelectionToRange(
selection
):null
|Range
Parameters
• selection: TextSelection
Returns
null
| Range
Defined in
packages/framework/block-std/src/range/range-manager.ts:220
unmounted()
unmounted():
void
Called when editor host is unmounted. Which means the editor host emit the disconnectedCallback
lifecycle event.
Returns
void
Inherited from
Defined in
packages/framework/block-std/src/extension/lifecycle-watcher.ts:71
setup()
static
setup(di
):void
Parameters
• di: Container
Returns
void
Inherited from
Defined in
packages/framework/block-std/src/extension/lifecycle-watcher.ts:34