Skip to content

Commit

Permalink
feat: wrap command
Browse files Browse the repository at this point in the history
  • Loading branch information
WindRunnerMax committed Jun 9, 2024
1 parent e321044 commit e24d35b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/plugin/src/ordered-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class OrderedListPlugin extends BlockPlugin {

public onCommand?: CommandFn = (editor, key, data) => {
if (isObject(data) && data.path) {
if (!isMatchWrapNode(editor, ORDERED_LIST_KEY, ORDERED_LIST_ITEM_KEY, data.path)) {
if (!editor.reflex.isMatchAboveBlockNode(ORDERED_LIST_KEY, data.path)) {
setWrapNodes(
editor,
{ [ORDERED_LIST_KEY]: true },
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/quote-block/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class QuoteBlockPlugin extends BlockPlugin {

public onCommand: CommandFn = (editor, key, data) => {
if (isObject(data) && data.path) {
if (!isMatchWrapNode(editor, QUOTE_BLOCK_KEY, QUOTE_BLOCK_ITEM_KEY, data.path)) {
if (!editor.reflex.isMatchAboveBlockNode(QUOTE_BLOCK_KEY, data.path)) {
setWrapNodes(
editor,
{ [QUOTE_BLOCK_KEY]: true },
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/unordered-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class UnorderedListPlugin extends BlockPlugin {

public onCommand: CommandFn = (editor, key, data) => {
if (isObject(data) && data.path) {
if (!isMatchWrapNode(editor, UNORDERED_LIST_KEY, UNORDERED_LIST_ITEM_KEY, data.path)) {
if (!editor.reflex.isMatchAboveBlockNode(UNORDERED_LIST_KEY, data.path)) {
setWrapNodes(
editor,
{ [UNORDERED_LIST_KEY]: true },
Expand Down

0 comments on commit e24d35b

Please sign in to comment.