@tiptap/extension-italic
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-italic@1.0.0-alpha.2...@tiptap/extension-italic@2.0.0-alpha.1) (2020-11-18) | ||
**Note:** Version bump only for package @tiptap/extension-italic | ||
# [1.0.0-alpha.2](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-italic@1.0.0-alpha.1...@tiptap/extension-italic@1.0.0-alpha.2) (2020-11-16) | ||
@@ -8,0 +16,0 @@ |
@@ -13,5 +13,13 @@ import { Command, Mark } from '@tiptap/core'; | ||
/** | ||
* Set an italic mark | ||
*/ | ||
setItalic: () => Command; | ||
/** | ||
* Toggle an italic mark | ||
*/ | ||
italic: () => Command; | ||
toggleItalic: () => Command; | ||
/** | ||
* Unset an italic mark | ||
*/ | ||
unsetItalic: () => Command; | ||
}>; | ||
@@ -18,0 +26,0 @@ export default Italic; |
@@ -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-italic"]={},e["@tiptap/core"])}(this,(function(e,t){"use strict";const s=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/gm,a=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/gm,i=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/gm,r=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/gm,n=t.Mark.create({name:"italic",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML:({HTMLAttributes:e})=>["em",e,0],addCommands:()=>({italic:()=>({commands:e})=>e.toggleMark("italic")}),addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.italic()}},addInputRules(){return[t.markInputRule(s,this.type),t.markInputRule(i,this.type)]},addPasteRules(){return[t.markPasteRule(a,this.type),t.markPasteRule(r,this.type)]}});e.default=n,e.starInputRegex=s,e.starPasteRegex=a,e.underscoreInputRegex=i,e.underscorePasteRegex=r,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-italic"]={},e["@tiptap/core"])}(this,(function(e,t){"use strict";const a=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/gm,s=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/gm,i=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/gm,r=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/gm,n=t.Mark.create({name:"italic",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML:({HTMLAttributes:e})=>["em",e,0],addCommands:()=>({setItalic:()=>({commands:e})=>e.setMark("italic"),toggleItalic:()=>({commands:e})=>e.toggleMark("italic"),unsetItalic:()=>({commands:e})=>e.unsetMark("italic")}),addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[t.markInputRule(a,this.type),t.markInputRule(i,this.type)]},addPasteRules(){return[t.markPasteRule(s,this.type),t.markPasteRule(r,this.type)]}});e.default=n,e.starInputRegex=a,e.starPasteRegex=s,e.underscoreInputRegex=i,e.underscorePasteRegex=r,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=tiptap-extension-italic.bundle.umd.min.js.map |
@@ -36,7 +36,19 @@ 'use strict'; | ||
/** | ||
* Set an italic mark | ||
*/ | ||
setItalic: () => ({ commands }) => { | ||
return commands.setMark('italic'); | ||
}, | ||
/** | ||
* Toggle an italic mark | ||
*/ | ||
italic: () => ({ commands }) => { | ||
toggleItalic: () => ({ commands }) => { | ||
return commands.toggleMark('italic'); | ||
}, | ||
/** | ||
* Unset an italic mark | ||
*/ | ||
unsetItalic: () => ({ commands }) => { | ||
return commands.unsetMark('italic'); | ||
}, | ||
}; | ||
@@ -46,3 +58,3 @@ }, | ||
return { | ||
'Mod-i': () => this.editor.commands.italic(), | ||
'Mod-i': () => this.editor.commands.toggleItalic(), | ||
}; | ||
@@ -49,0 +61,0 @@ }, |
@@ -32,7 +32,19 @@ import { Mark, markInputRule, markPasteRule } from '@tiptap/core'; | ||
/** | ||
* Set an italic mark | ||
*/ | ||
setItalic: () => ({ commands }) => { | ||
return commands.setMark('italic'); | ||
}, | ||
/** | ||
* Toggle an italic mark | ||
*/ | ||
italic: () => ({ commands }) => { | ||
toggleItalic: () => ({ commands }) => { | ||
return commands.toggleMark('italic'); | ||
}, | ||
/** | ||
* Unset an italic mark | ||
*/ | ||
unsetItalic: () => ({ commands }) => { | ||
return commands.unsetMark('italic'); | ||
}, | ||
}; | ||
@@ -42,3 +54,3 @@ }, | ||
return { | ||
'Mod-i': () => this.editor.commands.italic(), | ||
'Mod-i': () => this.editor.commands.toggleItalic(), | ||
}; | ||
@@ -45,0 +57,0 @@ }, |
@@ -36,7 +36,19 @@ (function (global, factory) { | ||
/** | ||
* Set an italic mark | ||
*/ | ||
setItalic: () => ({ commands }) => { | ||
return commands.setMark('italic'); | ||
}, | ||
/** | ||
* Toggle an italic mark | ||
*/ | ||
italic: () => ({ commands }) => { | ||
toggleItalic: () => ({ commands }) => { | ||
return commands.toggleMark('italic'); | ||
}, | ||
/** | ||
* Unset an italic mark | ||
*/ | ||
unsetItalic: () => ({ commands }) => { | ||
return commands.unsetMark('italic'); | ||
}, | ||
}; | ||
@@ -46,3 +58,3 @@ }, | ||
return { | ||
'Mod-i': () => this.editor.commands.italic(), | ||
'Mod-i': () => this.editor.commands.toggleItalic(), | ||
}; | ||
@@ -49,0 +61,0 @@ }, |
{ | ||
"name": "@tiptap/extension-italic", | ||
"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-italic | ||
## 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 |
@@ -48,7 +48,19 @@ import { | ||
/** | ||
* Set an italic mark | ||
*/ | ||
setItalic: (): Command => ({ commands }) => { | ||
return commands.setMark('italic') | ||
}, | ||
/** | ||
* Toggle an italic mark | ||
*/ | ||
italic: (): Command => ({ commands }) => { | ||
toggleItalic: (): Command => ({ commands }) => { | ||
return commands.toggleMark('italic') | ||
}, | ||
/** | ||
* Unset an italic mark | ||
*/ | ||
unsetItalic: (): Command => ({ commands }) => { | ||
return commands.unsetMark('italic') | ||
}, | ||
} | ||
@@ -59,3 +71,3 @@ }, | ||
return { | ||
'Mod-i': () => this.editor.commands.italic(), | ||
'Mod-i': () => this.editor.commands.toggleItalic(), | ||
} | ||
@@ -62,0 +74,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
28343
343