@tiptap/extension-code-block
Advanced tools
Comparing version 2.0.0-beta.31 to 2.0.0-beta.32
@@ -109,2 +109,24 @@ 'use strict'; | ||
}, | ||
// escape node on arrow down | ||
ArrowDown: ({ editor }) => { | ||
const { state } = editor; | ||
const { selection, doc } = state; | ||
const { $from, empty } = selection; | ||
if (!empty || $from.parent.type !== this.type) { | ||
return false; | ||
} | ||
const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2; | ||
if (!isAtEnd) { | ||
return false; | ||
} | ||
const after = $from.after(); | ||
if (after === undefined) { | ||
return false; | ||
} | ||
const nodeAfter = doc.nodeAt(after); | ||
if (nodeAfter) { | ||
return false; | ||
} | ||
return editor.commands.exitCode(); | ||
}, | ||
}; | ||
@@ -111,0 +133,0 @@ }, |
@@ -105,2 +105,24 @@ import { Node, textblockTypeInputRule } from '@tiptap/core'; | ||
}, | ||
// escape node on arrow down | ||
ArrowDown: ({ editor }) => { | ||
const { state } = editor; | ||
const { selection, doc } = state; | ||
const { $from, empty } = selection; | ||
if (!empty || $from.parent.type !== this.type) { | ||
return false; | ||
} | ||
const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2; | ||
if (!isAtEnd) { | ||
return false; | ||
} | ||
const after = $from.after(); | ||
if (after === undefined) { | ||
return false; | ||
} | ||
const nodeAfter = doc.nodeAt(after); | ||
if (nodeAfter) { | ||
return false; | ||
} | ||
return editor.commands.exitCode(); | ||
}, | ||
}; | ||
@@ -107,0 +129,0 @@ }, |
@@ -108,2 +108,24 @@ (function (global, factory) { | ||
}, | ||
// escape node on arrow down | ||
ArrowDown: ({ editor }) => { | ||
const { state } = editor; | ||
const { selection, doc } = state; | ||
const { $from, empty } = selection; | ||
if (!empty || $from.parent.type !== this.type) { | ||
return false; | ||
} | ||
const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2; | ||
if (!isAtEnd) { | ||
return false; | ||
} | ||
const after = $from.after(); | ||
if (after === undefined) { | ||
return false; | ||
} | ||
const nodeAfter = doc.nodeAt(after); | ||
if (nodeAfter) { | ||
return false; | ||
} | ||
return editor.commands.exitCode(); | ||
}, | ||
}; | ||
@@ -110,0 +132,0 @@ }, |
{ | ||
"name": "@tiptap/extension-code-block", | ||
"description": "code block extension for tiptap", | ||
"version": "2.0.0-beta.31", | ||
"version": "2.0.0-beta.32", | ||
"homepage": "https://tiptap.dev", | ||
@@ -34,3 +34,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "4cb9fe0e27345ffa4a794e5341d2976e4bc00de4" | ||
"gitHead": "209b3547e6f16b0a3b1bb768c9020b033d9db1fe" | ||
} |
@@ -149,2 +149,33 @@ import { Node, textblockTypeInputRule } from '@tiptap/core' | ||
}, | ||
// escape node on arrow down | ||
ArrowDown: ({ editor }) => { | ||
const { state } = editor | ||
const { selection, doc } = state | ||
const { $from, empty } = selection | ||
if (!empty || $from.parent.type !== this.type) { | ||
return false | ||
} | ||
const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2 | ||
if (!isAtEnd) { | ||
return false | ||
} | ||
const after = $from.after() | ||
if (after === undefined) { | ||
return false | ||
} | ||
const nodeAfter = doc.nodeAt(after) | ||
if (nodeAfter) { | ||
return false | ||
} | ||
return editor.commands.exitCode() | ||
}, | ||
} | ||
@@ -151,0 +182,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
70734
812