@tiptap/extension-code-block
Advanced tools
Comparing version 2.0.0-beta.5 to 2.0.0-beta.6
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.0.0-beta.6](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-code-block@2.0.0-beta.5...@tiptap/extension-code-block@2.0.0-beta.6) (2021-04-21) | ||
### Bug Fixes | ||
* don’t use state in KeyboardShortcutCommand anymore ([92ced9f](https://github.com/ueberdosis/tiptap-next/commit/92ced9f9987d59ac672da65b2a685d296307c6b0)) | ||
# [2.0.0-beta.5](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-code-block@2.0.0-beta.4...@tiptap/extension-code-block@2.0.0-beta.5) (2021-04-16) | ||
@@ -8,0 +19,0 @@ |
import { Command, Node } from '@tiptap/core'; | ||
export interface CodeBlockOptions { | ||
languageClassPrefix: string; | ||
HTMLAttributes: { | ||
[key: string]: any; | ||
}; | ||
HTMLAttributes: Record<string, any>; | ||
} | ||
@@ -8,0 +6,0 @@ declare module '@tiptap/core' { |
@@ -72,6 +72,6 @@ 'use strict'; | ||
// remove code block when at start of document or code block is empty | ||
Backspace: state => { | ||
const { empty, $anchor } = state.selection; | ||
Backspace: () => { | ||
const { empty, $anchor } = this.editor.state.selection; | ||
const isAtStart = $anchor.pos === 1; | ||
if (!empty || $anchor.parent.type.name !== 'codeBlock') { | ||
if (!empty || $anchor.parent.type.name !== this.name) { | ||
return false; | ||
@@ -78,0 +78,0 @@ } |
@@ -68,6 +68,6 @@ import { Node } from '@tiptap/core'; | ||
// remove code block when at start of document or code block is empty | ||
Backspace: state => { | ||
const { empty, $anchor } = state.selection; | ||
Backspace: () => { | ||
const { empty, $anchor } = this.editor.state.selection; | ||
const isAtStart = $anchor.pos === 1; | ||
if (!empty || $anchor.parent.type.name !== 'codeBlock') { | ||
if (!empty || $anchor.parent.type.name !== this.name) { | ||
return false; | ||
@@ -74,0 +74,0 @@ } |
@@ -71,6 +71,6 @@ (function (global, factory) { | ||
// remove code block when at start of document or code block is empty | ||
Backspace: state => { | ||
const { empty, $anchor } = state.selection; | ||
Backspace: () => { | ||
const { empty, $anchor } = this.editor.state.selection; | ||
const isAtStart = $anchor.pos === 1; | ||
if (!empty || $anchor.parent.type.name !== 'codeBlock') { | ||
if (!empty || $anchor.parent.type.name !== this.name) { | ||
return false; | ||
@@ -77,0 +77,0 @@ } |
{ | ||
"name": "@tiptap/extension-code-block", | ||
"description": "code block extension for tiptap", | ||
"version": "2.0.0-beta.5", | ||
"version": "2.0.0-beta.6", | ||
"homepage": "https://tiptap.dev", | ||
@@ -30,3 +30,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "ea9f5410915f45f7ba12d5c816965976f1956862" | ||
"gitHead": "8fd618a788f288a9005e8e049d2f8f8df5523b6d" | ||
} |
@@ -6,5 +6,3 @@ import { Command, Node } from '@tiptap/core' | ||
languageClassPrefix: string, | ||
HTMLAttributes: { | ||
[key: string]: any | ||
}, | ||
HTMLAttributes: Record<string, any>, | ||
} | ||
@@ -107,7 +105,7 @@ | ||
// remove code block when at start of document or code block is empty | ||
Backspace: state => { | ||
const { empty, $anchor } = state.selection | ||
Backspace: () => { | ||
const { empty, $anchor } = this.editor.state.selection | ||
const isAtStart = $anchor.pos === 1 | ||
if (!empty || $anchor.parent.type.name !== 'codeBlock') { | ||
if (!empty || $anchor.parent.type.name !== this.name) { | ||
return false | ||
@@ -114,0 +112,0 @@ } |
Sorry, the diff of this file is too big to display
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
479250
740