Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tiptap/extension-code-block

Package Overview
Dependencies
Maintainers
2
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-code-block - npm Package Compare versions

Comparing version 2.0.0-alpha.10 to 2.0.0-alpha.11

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

# [2.0.0-alpha.11](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-code-block@2.0.0-alpha.10...@tiptap/extension-code-block@2.0.0-alpha.11) (2021-02-16)
**Note:** Version bump only for package @tiptap/extension-code-block
# [2.0.0-alpha.10](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-code-block@2.0.0-alpha.9...@tiptap/extension-code-block@2.0.0-alpha.10) (2021-02-07)

@@ -8,0 +16,0 @@

36

dist/packages/extension-code-block/src/code-block.d.ts

@@ -8,22 +8,22 @@ import { Command, Node } from '@tiptap/core';

}
export declare const backtickInputRegex: RegExp;
export declare const tildeInputRegex: RegExp;
export declare const CodeBlock: Node<CodeBlockOptions, {
/**
* Set a code block
*/
setCodeBlock: (attributes?: {
language: string;
} | undefined) => Command;
/**
* Toggle a code block
*/
toggleCodeBlock: (attributes?: {
language: string;
} | undefined) => Command;
}>;
declare module '@tiptap/core' {
interface AllExtensions {
CodeBlock: typeof CodeBlock;
interface Commands {
codeBlock: {
/**
* Set a code block
*/
setCodeBlock: (attributes?: {
language: string;
}) => Command;
/**
* Toggle a code block
*/
toggleCodeBlock: (attributes?: {
language: string;
}) => Command;
};
}
}
export declare const backtickInputRegex: RegExp;
export declare const tildeInputRegex: RegExp;
export declare const CodeBlock: Node<CodeBlockOptions>;

@@ -60,12 +60,6 @@ 'use strict';

return {
/**
* Set a code block
*/
setCodeBlock: (attributes) => ({ commands }) => {
setCodeBlock: attributes => ({ commands }) => {
return commands.setNode('codeBlock', attributes);
},
/**
* Toggle a code block
*/
toggleCodeBlock: (attributes) => ({ commands }) => {
toggleCodeBlock: attributes => ({ commands }) => {
return commands.toggleNode('codeBlock', 'paragraph', attributes);

@@ -72,0 +66,0 @@ },

@@ -56,12 +56,6 @@ import { Node } from '@tiptap/core';

return {
/**
* Set a code block
*/
setCodeBlock: (attributes) => ({ commands }) => {
setCodeBlock: attributes => ({ commands }) => {
return commands.setNode('codeBlock', attributes);
},
/**
* Toggle a code block
*/
toggleCodeBlock: (attributes) => ({ commands }) => {
toggleCodeBlock: attributes => ({ commands }) => {
return commands.toggleNode('codeBlock', 'paragraph', attributes);

@@ -68,0 +62,0 @@ },

@@ -59,12 +59,6 @@ (function (global, factory) {

return {
/**
* Set a code block
*/
setCodeBlock: (attributes) => ({ commands }) => {
setCodeBlock: attributes => ({ commands }) => {
return commands.setNode('codeBlock', attributes);
},
/**
* Toggle a code block
*/
toggleCodeBlock: (attributes) => ({ commands }) => {
toggleCodeBlock: attributes => ({ commands }) => {
return commands.toggleNode('codeBlock', 'paragraph', attributes);

@@ -71,0 +65,0 @@ },

{
"name": "@tiptap/extension-code-block",
"description": "code block extension for tiptap",
"version": "2.0.0-alpha.10",
"version": "2.0.0-alpha.11",
"homepage": "https://tiptap.dev",

@@ -30,3 +30,3 @@ "keywords": [

},
"gitHead": "6bdeb4615c7b6afba4a2fcac4e3c35d7a7c0030a"
"gitHead": "71d8fbbcb1eacd664bb6992e0086a589e4684e69"
}

@@ -11,9 +11,24 @@ import { Command, Node } from '@tiptap/core'

declare module '@tiptap/core' {
interface Commands {
codeBlock: {
/**
* Set a code block
*/
setCodeBlock: (attributes?: { language: string }) => Command,
/**
* Toggle a code block
*/
toggleCodeBlock: (attributes?: { language: string }) => Command,
}
}
}
export const backtickInputRegex = /^```(?<language>[a-z]*)? $/
export const tildeInputRegex = /^~~~(?<language>[a-z]*)? $/
export const CodeBlock = Node.create({
export const CodeBlock = Node.create<CodeBlockOptions>({
name: 'codeBlock',
defaultOptions: <CodeBlockOptions>{
defaultOptions: {
languageClassPrefix: 'language-',

@@ -78,12 +93,6 @@ HTMLAttributes: {},

return {
/**
* Set a code block
*/
setCodeBlock: (attributes?: { language: string }): Command => ({ commands }) => {
setCodeBlock: attributes => ({ commands }) => {
return commands.setNode('codeBlock', attributes)
},
/**
* Toggle a code block
*/
toggleCodeBlock: (attributes?: { language: string }): Command => ({ commands }) => {
toggleCodeBlock: attributes => ({ commands }) => {
return commands.toggleNode('codeBlock', 'paragraph', attributes)

@@ -107,7 +116,1 @@ },

})
declare module '@tiptap/core' {
interface AllExtensions {
CodeBlock: typeof CodeBlock,
}
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc