(children: Descendant[])
| 154 | } |
| 155 | |
| 156 | export const getAllMentionElements = (children: Descendant[]): MentionElement[] => { |
| 157 | return children.flatMap((child) => { |
| 158 | if (isCustomTextElement(child)) { |
| 159 | return []; |
| 160 | } |
| 161 | |
| 162 | if (isMentionElement(child)) { |
| 163 | return [child]; |
| 164 | } |
| 165 | |
| 166 | return getAllMentionElements(child.children); |
| 167 | }); |
| 168 | } |
| 169 | |
| 170 | export const clearEditorHistory = (editor: CustomEditor) => { |
| 171 | // slate-history exposes `history` publicly, but does not provide a clear API. |
no test coverage detected