@tiptap/extension-strike
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-strike@1.0.0-alpha.2...@tiptap/extension-strike@2.0.0-alpha.1) (2020-11-18) | ||
**Note:** Version bump only for package @tiptap/extension-strike | ||
# [1.0.0-alpha.2](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-strike@1.0.0-alpha.1...@tiptap/extension-strike@1.0.0-alpha.2) (2020-11-16) | ||
@@ -8,0 +16,0 @@ |
@@ -11,5 +11,13 @@ import { Command, Mark } from '@tiptap/core'; | ||
/** | ||
* Set a strike mark | ||
*/ | ||
setStrike: () => Command; | ||
/** | ||
* Toggle a strike mark | ||
*/ | ||
strike: () => Command; | ||
toggleStrike: () => Command; | ||
/** | ||
* Unset a strike mark | ||
*/ | ||
unsetStrike: () => Command; | ||
}>; | ||
@@ -16,0 +24,0 @@ export default Strike; |
@@ -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-strike"]={},e["@tiptap/core"])}(this,(function(e,t){"use strict";const s=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/gm,r=t.Mark.create({name:"strike",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration=line-through"}],renderHTML:({HTMLAttributes:e})=>["s",e,0],addCommands:()=>({strike:()=>({commands:e})=>e.toggleMark("strike")}),addKeyboardShortcuts(){return{"Mod-d":()=>this.editor.commands.strike()}},addInputRules(){return[t.markInputRule(s,this.type)]},addPasteRules(){return[t.markPasteRule(s,this.type)]}});e.default=r,e.inputRegex=s,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-strike"]={},e["@tiptap/core"])}(this,(function(e,t){"use strict";const s=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/gm,r=t.Mark.create({name:"strike",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration=line-through"}],renderHTML:({HTMLAttributes:e})=>["s",e,0],addCommands:()=>({setStrike:()=>({commands:e})=>e.setMark("strike"),toggleStrike:()=>({commands:e})=>e.toggleMark("strike"),unsetStrike:()=>({commands:e})=>e.unsetMark("strike")}),addKeyboardShortcuts(){return{"Mod-d":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[t.markInputRule(s,this.type)]},addPasteRules(){return[t.markPasteRule(s,this.type)]}});e.default=r,e.inputRegex=s,e.pasteRegex=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/gm,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=tiptap-extension-strike.bundle.umd.min.js.map |
@@ -36,7 +36,19 @@ 'use strict'; | ||
/** | ||
* Set a strike mark | ||
*/ | ||
setStrike: () => ({ commands }) => { | ||
return commands.setMark('strike'); | ||
}, | ||
/** | ||
* Toggle a strike mark | ||
*/ | ||
strike: () => ({ commands }) => { | ||
toggleStrike: () => ({ commands }) => { | ||
return commands.toggleMark('strike'); | ||
}, | ||
/** | ||
* Unset a strike mark | ||
*/ | ||
unsetStrike: () => ({ commands }) => { | ||
return commands.unsetMark('strike'); | ||
}, | ||
}; | ||
@@ -46,3 +58,3 @@ }, | ||
return { | ||
'Mod-d': () => this.editor.commands.strike(), | ||
'Mod-d': () => this.editor.commands.toggleStrike(), | ||
}; | ||
@@ -49,0 +61,0 @@ }, |
@@ -32,7 +32,19 @@ import { Mark, markInputRule, markPasteRule } from '@tiptap/core'; | ||
/** | ||
* Set a strike mark | ||
*/ | ||
setStrike: () => ({ commands }) => { | ||
return commands.setMark('strike'); | ||
}, | ||
/** | ||
* Toggle a strike mark | ||
*/ | ||
strike: () => ({ commands }) => { | ||
toggleStrike: () => ({ commands }) => { | ||
return commands.toggleMark('strike'); | ||
}, | ||
/** | ||
* Unset a strike mark | ||
*/ | ||
unsetStrike: () => ({ commands }) => { | ||
return commands.unsetMark('strike'); | ||
}, | ||
}; | ||
@@ -42,3 +54,3 @@ }, | ||
return { | ||
'Mod-d': () => this.editor.commands.strike(), | ||
'Mod-d': () => this.editor.commands.toggleStrike(), | ||
}; | ||
@@ -45,0 +57,0 @@ }, |
@@ -36,7 +36,19 @@ (function (global, factory) { | ||
/** | ||
* Set a strike mark | ||
*/ | ||
setStrike: () => ({ commands }) => { | ||
return commands.setMark('strike'); | ||
}, | ||
/** | ||
* Toggle a strike mark | ||
*/ | ||
strike: () => ({ commands }) => { | ||
toggleStrike: () => ({ commands }) => { | ||
return commands.toggleMark('strike'); | ||
}, | ||
/** | ||
* Unset a strike mark | ||
*/ | ||
unsetStrike: () => ({ commands }) => { | ||
return commands.unsetMark('strike'); | ||
}, | ||
}; | ||
@@ -46,3 +58,3 @@ }, | ||
return { | ||
'Mod-d': () => this.editor.commands.strike(), | ||
'Mod-d': () => this.editor.commands.toggleStrike(), | ||
}; | ||
@@ -49,0 +61,0 @@ }, |
{ | ||
"name": "@tiptap/extension-strike", | ||
"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-strike | ||
## 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 a strike mark | ||
*/ | ||
setStrike: (): Command => ({ commands }) => { | ||
return commands.setMark('strike') | ||
}, | ||
/** | ||
* Toggle a strike mark | ||
*/ | ||
strike: (): Command => ({ commands }) => { | ||
toggleStrike: (): Command => ({ commands }) => { | ||
return commands.toggleMark('strike') | ||
}, | ||
/** | ||
* Unset a strike mark | ||
*/ | ||
unsetStrike: (): Command => ({ commands }) => { | ||
return commands.unsetMark('strike') | ||
}, | ||
} | ||
@@ -59,3 +71,3 @@ }, | ||
return { | ||
'Mod-d': () => this.editor.commands.strike(), | ||
'Mod-d': () => this.editor.commands.toggleStrike(), | ||
} | ||
@@ -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
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
24481
329