@udecode/plate-autoformat
Advanced tools
Comparing version 3.4.0 to 4.0.0
# @udecode/plate-autoformat | ||
## 4.0.0 | ||
### Patch Changes | ||
- [#1053](https://github.com/udecode/plate/pull/1053) [`cc14dfd4`](https://github.com/udecode/plate/commit/cc14dfd4c5eddd62e9e86de2034df5c7d054dbff) Thanks [@bensquire](https://github.com/bensquire)! - Passes the most recent keystroke into auto-format rule "query" | ||
## 3.4.0 | ||
@@ -4,0 +10,0 @@ |
@@ -394,3 +394,5 @@ import { ELEMENT_DEFAULT, getRangeFromBlockStart, someNode, getText, getRangeBefore, setNodes, getPointBefore, removeMark, isCollapsed } from '@udecode/plate-common'; | ||
} = rule; | ||
if (query && !query(editor, rule)) continue; | ||
if (query && !query(editor, { ...rule, | ||
text | ||
})) continue; | ||
const autoformatter = { | ||
@@ -397,0 +399,0 @@ block: autoformatBlock, |
@@ -398,3 +398,5 @@ 'use strict'; | ||
} = rule; | ||
if (query && !query(editor, rule)) continue; | ||
if (query && !query(editor, { ...rule, | ||
text | ||
})) continue; | ||
const autoformatter = { | ||
@@ -401,0 +403,0 @@ block: autoformatBlock, |
@@ -7,2 +7,8 @@ import { TEditor } from '@udecode/plate-core'; | ||
} | ||
export interface AutoformatQueryOptions extends Omit<AutoformatCommonRule, 'query'> { | ||
/** | ||
* `insertText` text. | ||
*/ | ||
text: string; | ||
} | ||
export interface AutoformatCommonRule { | ||
@@ -30,3 +36,3 @@ /** | ||
*/ | ||
query?: (editor: TEditor, rule: Omit<AutoformatCommonRule, 'query'>) => boolean; | ||
query?: (editor: TEditor, options: AutoformatQueryOptions) => boolean; | ||
} | ||
@@ -33,0 +39,0 @@ export interface AutoformatBlockRule extends AutoformatCommonRule { |
{ | ||
"name": "@udecode/plate-autoformat", | ||
"version": "3.4.0", | ||
"version": "4.0.0", | ||
"description": "Autoformatting plugin for Plate", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
132468
1617