@tiptap/extension-strike
Advanced tools
Comparing version 2.0.0-alpha.10 to 2.0.0-alpha.11
@@ -6,2 +6,10 @@ # Change Log | ||
# [2.0.0-alpha.11](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-strike@2.0.0-alpha.10...@tiptap/extension-strike@2.0.0-alpha.11) (2021-02-16) | ||
**Note:** Version bump only for package @tiptap/extension-strike | ||
# [2.0.0-alpha.10](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-strike@2.0.0-alpha.9...@tiptap/extension-strike@2.0.0-alpha.10) (2021-02-07) | ||
@@ -8,0 +16,0 @@ |
@@ -7,22 +7,22 @@ import { Command, Mark } from '@tiptap/core'; | ||
} | ||
export declare const inputRegex: RegExp; | ||
export declare const pasteRegex: RegExp; | ||
export declare const Strike: Mark<StrikeOptions, { | ||
/** | ||
* Set a strike mark | ||
*/ | ||
setStrike: () => Command; | ||
/** | ||
* Toggle a strike mark | ||
*/ | ||
toggleStrike: () => Command; | ||
/** | ||
* Unset a strike mark | ||
*/ | ||
unsetStrike: () => Command; | ||
}>; | ||
declare module '@tiptap/core' { | ||
interface AllExtensions { | ||
Strike: typeof Strike; | ||
interface Commands { | ||
strike: { | ||
/** | ||
* Set a strike mark | ||
*/ | ||
setStrike: () => Command; | ||
/** | ||
* Toggle a strike mark | ||
*/ | ||
toggleStrike: () => Command; | ||
/** | ||
* Unset a strike mark | ||
*/ | ||
unsetStrike: () => Command; | ||
}; | ||
} | ||
} | ||
export declare const inputRegex: RegExp; | ||
export declare const pasteRegex: RegExp; | ||
export declare const Strike: Mark<StrikeOptions>; |
@@ -35,17 +35,8 @@ 'use strict'; | ||
return { | ||
/** | ||
* Set a strike mark | ||
*/ | ||
setStrike: () => ({ commands }) => { | ||
return commands.setMark('strike'); | ||
}, | ||
/** | ||
* Toggle a strike mark | ||
*/ | ||
toggleStrike: () => ({ commands }) => { | ||
return commands.toggleMark('strike'); | ||
}, | ||
/** | ||
* Unset a strike mark | ||
*/ | ||
unsetStrike: () => ({ commands }) => { | ||
@@ -52,0 +43,0 @@ return commands.unsetMark('strike'); |
@@ -31,17 +31,8 @@ import { Mark, mergeAttributes, markInputRule, markPasteRule } from '@tiptap/core'; | ||
return { | ||
/** | ||
* Set a strike mark | ||
*/ | ||
setStrike: () => ({ commands }) => { | ||
return commands.setMark('strike'); | ||
}, | ||
/** | ||
* Toggle a strike mark | ||
*/ | ||
toggleStrike: () => ({ commands }) => { | ||
return commands.toggleMark('strike'); | ||
}, | ||
/** | ||
* Unset a strike mark | ||
*/ | ||
unsetStrike: () => ({ commands }) => { | ||
@@ -48,0 +39,0 @@ return commands.unsetMark('strike'); |
@@ -35,17 +35,8 @@ (function (global, factory) { | ||
return { | ||
/** | ||
* Set a strike mark | ||
*/ | ||
setStrike: () => ({ commands }) => { | ||
return commands.setMark('strike'); | ||
}, | ||
/** | ||
* Toggle a strike mark | ||
*/ | ||
toggleStrike: () => ({ commands }) => { | ||
return commands.toggleMark('strike'); | ||
}, | ||
/** | ||
* Unset a strike mark | ||
*/ | ||
unsetStrike: () => ({ commands }) => { | ||
@@ -52,0 +43,0 @@ return commands.unsetMark('strike'); |
{ | ||
"name": "@tiptap/extension-strike", | ||
"description": "strike extension for tiptap", | ||
"version": "2.0.0-alpha.10", | ||
"version": "2.0.0-alpha.11", | ||
"homepage": "https://tiptap.dev", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "6bdeb4615c7b6afba4a2fcac4e3c35d7a7c0030a" | ||
"gitHead": "71d8fbbcb1eacd664bb6992e0086a589e4684e69" | ||
} |
@@ -15,9 +15,28 @@ import { | ||
declare module '@tiptap/core' { | ||
interface Commands { | ||
strike: { | ||
/** | ||
* Set a strike mark | ||
*/ | ||
setStrike: () => Command, | ||
/** | ||
* Toggle a strike mark | ||
*/ | ||
toggleStrike: () => Command, | ||
/** | ||
* Unset a strike mark | ||
*/ | ||
unsetStrike: () => Command, | ||
} | ||
} | ||
} | ||
export const inputRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/gm | ||
export const pasteRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/gm | ||
export const Strike = Mark.create({ | ||
export const Strike = Mark.create<StrikeOptions>({ | ||
name: 'strike', | ||
defaultOptions: <StrikeOptions>{ | ||
defaultOptions: { | ||
HTMLAttributes: {}, | ||
@@ -49,18 +68,9 @@ }, | ||
return { | ||
/** | ||
* Set a strike mark | ||
*/ | ||
setStrike: (): Command => ({ commands }) => { | ||
setStrike: () => ({ commands }) => { | ||
return commands.setMark('strike') | ||
}, | ||
/** | ||
* Toggle a strike mark | ||
*/ | ||
toggleStrike: (): Command => ({ commands }) => { | ||
toggleStrike: () => ({ commands }) => { | ||
return commands.toggleMark('strike') | ||
}, | ||
/** | ||
* Unset a strike mark | ||
*/ | ||
unsetStrike: (): Command => ({ commands }) => { | ||
unsetStrike: () => ({ commands }) => { | ||
return commands.unsetMark('strike') | ||
@@ -89,7 +99,1 @@ }, | ||
}) | ||
declare module '@tiptap/core' { | ||
interface AllExtensions { | ||
Strike: typeof Strike, | ||
} | ||
} |
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
27564
313