Editor Commands (#1450)
* add commands hook * add commands in editor * add command auto complete menu * add commands in room input * remove old reply code from room input * fix video component css * do not auto focus input on android or ios * fix crash on enable block after selection * fix circular deps in editor * fix autocomplete return focus move editor cursor * remove unwanted keydown from room input * fix emoji alignment in editor * test ipad user agent * refactor isAndroidOrIOS to mobileOrTablet * update slate & slate-react * downgrade slate-react to 0.98.4 0.99.0 has breaking changes with ReactEditor.focus * add sql to readable ext mimetype * fix empty editor formatting gets saved as draft * add option to use enter for newline * remove empty msg draft from atom family * prevent msg ctx menu from open on text selection
This commit is contained in:
10
src/app/components/editor/slate.d.ts
vendored
10
src/app/components/editor/slate.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import { BaseEditor } from 'slate';
|
||||
import { ReactEditor } from 'slate-react';
|
||||
import { HistoryEditor } from 'slate-history';
|
||||
import { BlockType } from './Elements';
|
||||
import { BlockType } from './types';
|
||||
|
||||
export type HeadingLevel = 1 | 2 | 3;
|
||||
|
||||
@@ -39,8 +39,13 @@ export type EmoticonElement = {
|
||||
shortcode: string;
|
||||
children: Text[];
|
||||
};
|
||||
export type CommandElement = {
|
||||
type: BlockType.Command;
|
||||
command: string;
|
||||
children: Text[];
|
||||
};
|
||||
|
||||
export type InlineElement = Text | LinkElement | MentionElement | EmoticonElement;
|
||||
export type InlineElement = Text | LinkElement | MentionElement | EmoticonElement | CommandElement;
|
||||
|
||||
export type ParagraphElement = {
|
||||
type: BlockType.Paragraph;
|
||||
@@ -84,6 +89,7 @@ export type CustomElement =
|
||||
| LinkElement
|
||||
| MentionElement
|
||||
| EmoticonElement
|
||||
| CommandElement
|
||||
| ParagraphElement
|
||||
| HeadingElement
|
||||
| CodeLineElement
|
||||
|
||||
Reference in New Issue
Block a user