diff --git a/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/CodeDropDrownItem.svelte b/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/CodeDropDrownItem.svelte index 5ca1470f..849677cc 100644 --- a/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/CodeDropDrownItem.svelte +++ b/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/CodeDropDrownItem.svelte @@ -8,7 +8,7 @@ import { $getSelection as getSelection, $isRangeSelection as isRangeSelection, - DEPRECATED_$isGridSelection, + $INTERNAL_isPointSelection as INTERNAL_PointSelection, } from 'lexical'; import {$createCodeNode as createCodeNode} from '@lexical/code'; @@ -21,10 +21,7 @@ editor.update(() => { let selection = getSelection(); - if ( - isRangeSelection(selection) || - DEPRECATED_$isGridSelection(selection) - ) { + if (INTERNAL_PointSelection(selection)) { if (selection.isCollapsed()) { setBlocksType(selection, () => createCodeNode()); } else { diff --git a/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/HeadingDropDownItem.svelte b/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/HeadingDropDownItem.svelte index 58f13588..8669a0b3 100644 --- a/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/HeadingDropDownItem.svelte +++ b/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/HeadingDropDownItem.svelte @@ -2,8 +2,7 @@ import DropDownItem from '../../generic/dropdown/DropDownItem.svelte'; import { $getSelection as getSelection, - $isRangeSelection as isRangeSelection, - DEPRECATED_$isGridSelection, + $INTERNAL_isPointSelection as INTERNAL_PointSelection, } from 'lexical'; import { $createHeadingNode as createHeadingNode, @@ -25,10 +24,7 @@ if ($blockType !== headingSize) { editor.update(() => { const selection = getSelection(); - if ( - isRangeSelection(selection) || - DEPRECATED_$isGridSelection(selection) - ) { + if (INTERNAL_PointSelection(selection)) { setBlocksType(selection, () => createHeadingNode(headingSize)); } }); diff --git a/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/ParagraphDropDownItem.svelte b/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/ParagraphDropDownItem.svelte index 082b06a6..f42eee21 100644 --- a/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/ParagraphDropDownItem.svelte +++ b/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/ParagraphDropDownItem.svelte @@ -7,7 +7,7 @@ $getSelection as getSelection, $isRangeSelection as isRangeSelection, $createParagraphNode as createParagraphNode, - DEPRECATED_$isGridSelection, + $INTERNAL_isPointSelection as INTERNAL_PointSelection, } from 'lexical'; import {$setBlocksType as setBlocksType} from '@lexical/selection'; import {getEditor} from '../../../core/composerContext'; @@ -20,10 +20,7 @@ if ($blockType !== 'paragraph') { editor.update(() => { const selection = getSelection(); - if ( - isRangeSelection(selection) || - DEPRECATED_$isGridSelection(selection) - ) + if (INTERNAL_PointSelection(selection)) setBlocksType(selection, () => createParagraphNode()); }); } diff --git a/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/QuoteDropDrownItem.svelte b/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/QuoteDropDrownItem.svelte index 086b4643..90a830df 100644 --- a/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/QuoteDropDrownItem.svelte +++ b/packages/svelte-lexical/src/components/toolbar/BlockFormatDropDown/QuoteDropDrownItem.svelte @@ -7,8 +7,7 @@ import {$setBlocksType as setBlocksType} from '@lexical/selection'; import { $getSelection as getSelection, - $isRangeSelection as isRangeSelection, - DEPRECATED_$isGridSelection, + $INTERNAL_isPointSelection as INTERNAL_PointSelection, } from 'lexical'; import {$createQuoteNode as createQuoteNode} from '@lexical/rich-text'; @@ -20,10 +19,7 @@ if ($blockType !== 'quote') { editor.update(() => { const selection = getSelection(); - if ( - isRangeSelection(selection) || - DEPRECATED_$isGridSelection(selection) - ) { + if (INTERNAL_PointSelection(selection)) { setBlocksType(selection, () => createQuoteNode()); } }); diff --git a/packages/svelte-lexical/src/core/plugins/TreeView/TreeView.svelte b/packages/svelte-lexical/src/core/plugins/TreeView/TreeView.svelte index f6fa174f..5293227f 100644 --- a/packages/svelte-lexical/src/core/plugins/TreeView/TreeView.svelte +++ b/packages/svelte-lexical/src/core/plugins/TreeView/TreeView.svelte @@ -8,6 +8,7 @@ LexicalEditor, LexicalNode, RangeSelection, + INTERNAL_PointSelection, } from 'lexical'; import {$generateHtmlFromNodes as generateHtmlFromNodes} from '@lexical/html'; @@ -533,7 +534,7 @@ function getSelectionStartEnd( node: LexicalNode, - selection: RangeSelection | GridSelection, + selection: INTERNAL_PointSelection, ): [number, number] { const anchor = selection.anchor; const focus = selection.focus;