/
index.ts
86 lines (72 loc) · 2.21 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { EditorState } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
import { ComponentRef, EventEmitter } from '@angular/core';
import { Editor } from '@tiptap/core';
import { BubbleMenuPluginProps, BubbleMenuViewProps } from '@tiptap/extension-bubble-menu';
import { SuggestionsComponent } from '../../../shared';
export const DEFAULT_LANG_ID = 1;
export type DotConfigKeys = 'lang';
export interface ContentletFilters {
contentType: string;
filter: string;
currentLanguage: number;
identifier: string;
}
export enum NodeTypes {
DOT_IMAGE = 'dotImage',
LIST_ITEM = 'listItem',
BULLET_LIST = 'bulletList',
ORDERED_LIST = 'orderedList',
BLOCKQUOTE = 'blockquote',
CODE_BLOCK = 'codeBlock',
DOC = 'doc',
DOT_CONTENT = 'dotContent',
PARAGRAPH = 'paragraph',
HARD_BREAK = 'hardBreak',
HEADING = 'heading',
HORIZONTAL_RULE = 'horizontalRule',
TEXT = 'text',
TABLE_CELL = 'tableCell'
}
export const CustomNodeTypes: Array<NodeTypes> = [NodeTypes.DOT_IMAGE, NodeTypes.DOT_CONTENT];
export interface ShouldShowProps {
editor: Editor;
view: EditorView;
state: EditorState;
oldState?: EditorState;
from: number;
to: number;
}
export interface BubbleMenuItem {
icon?: string;
text?: string;
markAction: string;
active: boolean;
divider?: boolean;
}
export interface BubbleMenuComponentProps {
command: EventEmitter<BubbleMenuItem>;
items: BubbleMenuItem[];
selected: string;
toggleChangeTo: EventEmitter<void>;
}
export declare type DotBubbleMenuPluginProps = BubbleMenuPluginProps & {
component: ComponentRef<BubbleMenuComponentProps>;
changeToComponent: ComponentRef<SuggestionsComponent>;
changeToElement: HTMLElement;
};
export declare type DotBubbleMenuViewProps = BubbleMenuViewProps & {
component: ComponentRef<BubbleMenuComponentProps>;
changeToComponent: ComponentRef<SuggestionsComponent>;
changeToElement: HTMLElement;
};
/**
* If you need to to hide the bubble menu on another extension,
* add the extension name here first
*/
export interface HideBubbleMenuExtensions {
tableCell: boolean;
table: boolean;
dotVideo: boolean;
youtube: boolean;
}