@tiptap/extension-code
Advanced tools
Comparing version 1.0.0-alpha.2 to 2.0.0-alpha.1
@@ -6,2 +6,10 @@ # Change Log | ||
# [2.0.0-alpha.1](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-code@1.0.0-alpha.2...@tiptap/extension-code@2.0.0-alpha.1) (2020-11-18) | ||
**Note:** Version bump only for package @tiptap/extension-code | ||
# [1.0.0-alpha.2](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-code@1.0.0-alpha.1...@tiptap/extension-code@1.0.0-alpha.2) (2020-11-16) | ||
@@ -8,0 +16,0 @@ |
@@ -11,5 +11,13 @@ import { Command, Mark } from '@tiptap/core'; | ||
/** | ||
* Set a code mark | ||
*/ | ||
setCode: () => Command; | ||
/** | ||
* Toggle inline code | ||
*/ | ||
code: () => Command; | ||
toggleCode: () => Command; | ||
/** | ||
* Unset a code mark | ||
*/ | ||
unsetCode: () => Command; | ||
}>; | ||
@@ -16,0 +24,0 @@ export default Code; |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tiptap/core")):"function"==typeof define&&define.amd?define(["exports","@tiptap/core"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@tiptap/extension-code"]={},e["@tiptap/core"])}(this,(function(e,t){"use strict";const o=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/gm,d=t.Mark.create({name:"code",defaultOptions:{HTMLAttributes:{}},excludes:"_",parseHTML:()=>[{tag:"code"}],renderHTML:({HTMLAttributes:e})=>["code",e,0],addCommands:()=>({code:()=>({commands:e})=>e.toggleMark("code")}),addKeyboardShortcuts(){return{"Mod-`":()=>this.editor.commands.code()}},addInputRules(){return[t.markInputRule(o,this.type)]},addPasteRules(){return[t.markPasteRule(o,this.type)]}});e.default=d,e.inputRegex=o,e.pasteRegex=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/gm,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tiptap/core")):"function"==typeof define&&define.amd?define(["exports","@tiptap/core"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@tiptap/extension-code"]={},e["@tiptap/core"])}(this,(function(e,t){"use strict";const o=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/gm,d=t.Mark.create({name:"code",defaultOptions:{HTMLAttributes:{}},excludes:"_",parseHTML:()=>[{tag:"code"}],renderHTML:({HTMLAttributes:e})=>["code",e,0],addCommands:()=>({setCode:()=>({commands:e})=>e.setMark("code"),toggleCode:()=>({commands:e})=>e.toggleMark("code"),unsetCode:()=>({commands:e})=>e.unsetMark("code")}),addKeyboardShortcuts(){return{"Mod-`":()=>this.editor.commands.toggleCode()}},addInputRules(){return[t.markInputRule(o,this.type)]},addPasteRules(){return[t.markPasteRule(o,this.type)]}});e.default=d,e.inputRegex=o,e.pasteRegex=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/gm,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=tiptap-extension-code.bundle.umd.min.js.map |
@@ -26,7 +26,19 @@ 'use strict'; | ||
/** | ||
* Set a code mark | ||
*/ | ||
setCode: () => ({ commands }) => { | ||
return commands.setMark('code'); | ||
}, | ||
/** | ||
* Toggle inline code | ||
*/ | ||
code: () => ({ commands }) => { | ||
toggleCode: () => ({ commands }) => { | ||
return commands.toggleMark('code'); | ||
}, | ||
/** | ||
* Unset a code mark | ||
*/ | ||
unsetCode: () => ({ commands }) => { | ||
return commands.unsetMark('code'); | ||
}, | ||
}; | ||
@@ -36,3 +48,3 @@ }, | ||
return { | ||
'Mod-`': () => this.editor.commands.code(), | ||
'Mod-`': () => this.editor.commands.toggleCode(), | ||
}; | ||
@@ -39,0 +51,0 @@ }, |
@@ -22,7 +22,19 @@ import { Mark, markInputRule, markPasteRule } from '@tiptap/core'; | ||
/** | ||
* Set a code mark | ||
*/ | ||
setCode: () => ({ commands }) => { | ||
return commands.setMark('code'); | ||
}, | ||
/** | ||
* Toggle inline code | ||
*/ | ||
code: () => ({ commands }) => { | ||
toggleCode: () => ({ commands }) => { | ||
return commands.toggleMark('code'); | ||
}, | ||
/** | ||
* Unset a code mark | ||
*/ | ||
unsetCode: () => ({ commands }) => { | ||
return commands.unsetMark('code'); | ||
}, | ||
}; | ||
@@ -32,3 +44,3 @@ }, | ||
return { | ||
'Mod-`': () => this.editor.commands.code(), | ||
'Mod-`': () => this.editor.commands.toggleCode(), | ||
}; | ||
@@ -35,0 +47,0 @@ }, |
@@ -26,7 +26,19 @@ (function (global, factory) { | ||
/** | ||
* Set a code mark | ||
*/ | ||
setCode: () => ({ commands }) => { | ||
return commands.setMark('code'); | ||
}, | ||
/** | ||
* Toggle inline code | ||
*/ | ||
code: () => ({ commands }) => { | ||
toggleCode: () => ({ commands }) => { | ||
return commands.toggleMark('code'); | ||
}, | ||
/** | ||
* Unset a code mark | ||
*/ | ||
unsetCode: () => ({ commands }) => { | ||
return commands.unsetMark('code'); | ||
}, | ||
}; | ||
@@ -36,3 +48,3 @@ }, | ||
return { | ||
'Mod-`': () => this.editor.commands.code(), | ||
'Mod-`': () => this.editor.commands.toggleCode(), | ||
}; | ||
@@ -39,0 +51,0 @@ }, |
{ | ||
"name": "@tiptap/extension-code", | ||
"version": "1.0.0-alpha.2", | ||
"version": "2.0.0-alpha.1", | ||
"homepage": "https://tiptap.dev", | ||
@@ -24,5 +24,5 @@ "keywords": [ | ||
"peerDependencies": { | ||
"@tiptap/core": "2.0.0-alpha.3" | ||
"@tiptap/core": "^2.0.0-alpha.0" | ||
}, | ||
"gitHead": "a8a578edb78db7763e2eda83960c25b02e8488c5" | ||
"gitHead": "276118e48eef313fb435088dee3dc58b91363109" | ||
} |
@@ -8,3 +8,3 @@ # @tiptap/extension-code | ||
## Introduction | ||
tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich-text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*. | ||
tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*. | ||
@@ -11,0 +11,0 @@ ## Offical Documentation |
@@ -39,7 +39,19 @@ import { | ||
/** | ||
* Set a code mark | ||
*/ | ||
setCode: (): Command => ({ commands }) => { | ||
return commands.setMark('code') | ||
}, | ||
/** | ||
* Toggle inline code | ||
*/ | ||
code: (): Command => ({ commands }) => { | ||
toggleCode: (): Command => ({ commands }) => { | ||
return commands.toggleMark('code') | ||
}, | ||
/** | ||
* Unset a code mark | ||
*/ | ||
unsetCode: (): Command => ({ commands }) => { | ||
return commands.unsetMark('code') | ||
}, | ||
} | ||
@@ -50,3 +62,3 @@ }, | ||
return { | ||
'Mod-`': () => this.editor.commands.code(), | ||
'Mod-`': () => this.editor.commands.toggleCode(), | ||
} | ||
@@ -53,0 +65,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
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
22418
288