lakelib 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -22
- package/dist/lake.min.css +1 -1
- package/dist/lake.min.js +22 -22
- package/dist/lake.min.js.map +1 -1
- package/lib/lake.css +4 -1
- package/lib/lake.d.ts +2148 -0
- package/lib/lake.js +1211 -602
- package/lib/lake.js.map +1 -1
- package/package.json +30 -33
- package/lib/config/element-rules.d.ts +0 -1
- package/lib/config/menu-items.d.ts +0 -9
- package/lib/config/tag-names.d.ts +0 -6
- package/lib/config/toolbar-items.d.ts +0 -2
- package/lib/css/index.d.ts +0 -17
- package/lib/editor.d.ts +0 -93
- package/lib/elements/bookmark.d.ts +0 -2
- package/lib/elements/box.d.ts +0 -2
- package/lib/i18n/en-US/index.d.ts +0 -169
- package/lib/i18n/index.d.ts +0 -2
- package/lib/i18n/ja/index.d.ts +0 -169
- package/lib/i18n/ko/index.d.ts +0 -169
- package/lib/i18n/types.d.ts +0 -1233
- package/lib/i18n/zh-CN/index.d.ts +0 -169
- package/lib/icons/index.d.ts +0 -1
- package/lib/index.d.ts +0 -35
- package/lib/managers/box-manager.d.ts +0 -6
- package/lib/managers/command.d.ts +0 -23
- package/lib/managers/history.d.ts +0 -32
- package/lib/managers/keystroke.d.ts +0 -11
- package/lib/managers/plugin.d.ts +0 -7
- package/lib/managers/selection.d.ts +0 -40
- package/lib/models/box.d.ts +0 -25
- package/lib/models/fragment.d.ts +0 -8
- package/lib/models/nodes.d.ts +0 -98
- package/lib/models/range.d.ts +0 -56
- package/lib/operations/add-mark.d.ts +0 -3
- package/lib/operations/delete-contents.d.ts +0 -2
- package/lib/operations/insert-block.d.ts +0 -3
- package/lib/operations/insert-bookmark.d.ts +0 -6
- package/lib/operations/insert-box.d.ts +0 -4
- package/lib/operations/insert-contents.d.ts +0 -4
- package/lib/operations/remove-box.d.ts +0 -3
- package/lib/operations/remove-mark.d.ts +0 -2
- package/lib/operations/set-blocks.d.ts +0 -3
- package/lib/operations/split-block.d.ts +0 -3
- package/lib/operations/split-marks.d.ts +0 -3
- package/lib/operations/to-bookmark.d.ts +0 -6
- package/lib/parsers/html-parser.d.ts +0 -13
- package/lib/parsers/text-parser.d.ts +0 -6
- package/lib/plugins/align.d.ts +0 -3
- package/lib/plugins/arrow-keys.d.ts +0 -3
- package/lib/plugins/backspace-key.d.ts +0 -3
- package/lib/plugins/block-quote.d.ts +0 -3
- package/lib/plugins/bold.d.ts +0 -3
- package/lib/plugins/code-block/code-block-box.d.ts +0 -4
- package/lib/plugins/code-block/index.d.ts +0 -5
- package/lib/plugins/code.d.ts +0 -3
- package/lib/plugins/copy.d.ts +0 -3
- package/lib/plugins/cut.d.ts +0 -3
- package/lib/plugins/delete-key.d.ts +0 -3
- package/lib/plugins/drop.d.ts +0 -3
- package/lib/plugins/emoji/emoji-box.d.ts +0 -4
- package/lib/plugins/emoji/index.d.ts +0 -5
- package/lib/plugins/enter-key.d.ts +0 -3
- package/lib/plugins/equation/equation-box.d.ts +0 -4
- package/lib/plugins/equation/index.d.ts +0 -5
- package/lib/plugins/escape-key.d.ts +0 -3
- package/lib/plugins/file/file-box.d.ts +0 -4
- package/lib/plugins/file/index.d.ts +0 -5
- package/lib/plugins/font-color.d.ts +0 -3
- package/lib/plugins/font-family.d.ts +0 -3
- package/lib/plugins/font-size.d.ts +0 -3
- package/lib/plugins/format-painter.d.ts +0 -3
- package/lib/plugins/heading.d.ts +0 -3
- package/lib/plugins/highlight.d.ts +0 -3
- package/lib/plugins/hr/hr-box.d.ts +0 -4
- package/lib/plugins/hr/index.d.ts +0 -5
- package/lib/plugins/image/image-box.d.ts +0 -5
- package/lib/plugins/image/index.d.ts +0 -5
- package/lib/plugins/indent.d.ts +0 -3
- package/lib/plugins/italic.d.ts +0 -3
- package/lib/plugins/link/index.d.ts +0 -3
- package/lib/plugins/link/insert-link.d.ts +0 -3
- package/lib/plugins/link/link-popup.d.ts +0 -32
- package/lib/plugins/list.d.ts +0 -3
- package/lib/plugins/markdown.d.ts +0 -3
- package/lib/plugins/mention/index.d.ts +0 -5
- package/lib/plugins/mention/mention-box.d.ts +0 -4
- package/lib/plugins/mention/mention-menu.d.ts +0 -15
- package/lib/plugins/mention/types.d.ts +0 -6
- package/lib/plugins/paste.d.ts +0 -3
- package/lib/plugins/redo.d.ts +0 -3
- package/lib/plugins/remove-format.d.ts +0 -3
- package/lib/plugins/select-all.d.ts +0 -3
- package/lib/plugins/shift-enter-key.d.ts +0 -3
- package/lib/plugins/slash/index.d.ts +0 -3
- package/lib/plugins/slash/slash-items.d.ts +0 -2
- package/lib/plugins/slash/slash-menu.d.ts +0 -19
- package/lib/plugins/slash/types.d.ts +0 -20
- package/lib/plugins/special-character.d.ts +0 -3
- package/lib/plugins/strikethrough.d.ts +0 -3
- package/lib/plugins/subscript.d.ts +0 -3
- package/lib/plugins/superscript.d.ts +0 -3
- package/lib/plugins/tab-key.d.ts +0 -3
- package/lib/plugins/table/delete-column.d.ts +0 -2
- package/lib/plugins/table/delete-row.d.ts +0 -2
- package/lib/plugins/table/delete-table.d.ts +0 -2
- package/lib/plugins/table/index.d.ts +0 -4
- package/lib/plugins/table/insert-column.d.ts +0 -4
- package/lib/plugins/table/insert-row.d.ts +0 -4
- package/lib/plugins/table/insert-table.d.ts +0 -3
- package/lib/plugins/table/merge-cells.d.ts +0 -3
- package/lib/plugins/table/split-cell.d.ts +0 -3
- package/lib/plugins/table/utils.d.ts +0 -6
- package/lib/plugins/underline.d.ts +0 -3
- package/lib/plugins/undo.d.ts +0 -3
- package/lib/plugins/unlink.d.ts +0 -3
- package/lib/plugins/video/index.d.ts +0 -5
- package/lib/plugins/video/video-box.d.ts +0 -4
- package/lib/storage/box-instances.d.ts +0 -2
- package/lib/storage/boxes.d.ts +0 -2
- package/lib/storage/editors.d.ts +0 -2
- package/lib/types/box.d.ts +0 -15
- package/lib/types/corner-toolbar.d.ts +0 -7
- package/lib/types/dropdown.d.ts +0 -23
- package/lib/types/native.d.ts +0 -2
- package/lib/types/node.d.ts +0 -13
- package/lib/types/object.d.ts +0 -3
- package/lib/types/plugin.d.ts +0 -3
- package/lib/types/request.d.ts +0 -20
- package/lib/types/selection.d.ts +0 -14
- package/lib/types/toolbar.d.ts +0 -29
- package/lib/ui/button.d.ts +0 -19
- package/lib/ui/corner-toolbar.d.ts +0 -18
- package/lib/ui/dropdown.d.ts +0 -36
- package/lib/ui/floating-toolbar.d.ts +0 -16
- package/lib/ui/menu.d.ts +0 -33
- package/lib/ui/resizer.d.ts +0 -17
- package/lib/ui/toolbar.d.ts +0 -29
- package/lib/utils/append-break.d.ts +0 -2
- package/lib/utils/camel-case.d.ts +0 -1
- package/lib/utils/change-tag-name.d.ts +0 -2
- package/lib/utils/debug.d.ts +0 -1
- package/lib/utils/denormalize-value.d.ts +0 -1
- package/lib/utils/encode.d.ts +0 -1
- package/lib/utils/file-size.d.ts +0 -1
- package/lib/utils/fix-numbered-list.d.ts +0 -2
- package/lib/utils/from-base64.d.ts +0 -1
- package/lib/utils/get-box.d.ts +0 -3
- package/lib/utils/get-css.d.ts +0 -1
- package/lib/utils/get-deep-element.d.ts +0 -2
- package/lib/utils/in-string.d.ts +0 -1
- package/lib/utils/indent-block.d.ts +0 -2
- package/lib/utils/merge-nodes.d.ts +0 -5
- package/lib/utils/modifier-text.d.ts +0 -1
- package/lib/utils/morph.d.ts +0 -56
- package/lib/utils/normalize-value.d.ts +0 -1
- package/lib/utils/parse-style.d.ts +0 -2
- package/lib/utils/query.d.ts +0 -2
- package/lib/utils/remove-break.d.ts +0 -2
- package/lib/utils/remove-empty-marks.d.ts +0 -2
- package/lib/utils/remove-zws.d.ts +0 -2
- package/lib/utils/request.d.ts +0 -27
- package/lib/utils/scroll-to-node.d.ts +0 -2
- package/lib/utils/split-nodes.d.ts +0 -5
- package/lib/utils/template.d.ts +0 -1
- package/lib/utils/to-base64.d.ts +0 -1
- package/lib/utils/to-hex.d.ts +0 -1
- package/lib/utils/to-node-list.d.ts +0 -1
- package/lib/utils/unsafe-template.d.ts +0 -1
- package/lib/utils/upload-file.d.ts +0 -11
- package/lib/utils/visible-info.d.ts +0 -10
- package/lib/utils/wrap-node-list.d.ts +0 -2
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
toolbar: {
|
|
3
|
-
undo: string;
|
|
4
|
-
redo: string;
|
|
5
|
-
selectAll: string;
|
|
6
|
-
paragraph: string;
|
|
7
|
-
blockQuote: string;
|
|
8
|
-
numberedList: string;
|
|
9
|
-
bulletedList: string;
|
|
10
|
-
checklist: string;
|
|
11
|
-
alignLeft: string;
|
|
12
|
-
alignCenter: string;
|
|
13
|
-
alignRight: string;
|
|
14
|
-
alignJustify: string;
|
|
15
|
-
increaseIndent: string;
|
|
16
|
-
decreaseIndent: string;
|
|
17
|
-
bold: string;
|
|
18
|
-
italic: string;
|
|
19
|
-
underline: string;
|
|
20
|
-
strikethrough: string;
|
|
21
|
-
superscript: string;
|
|
22
|
-
subscript: string;
|
|
23
|
-
code: string;
|
|
24
|
-
removeFormat: string;
|
|
25
|
-
formatPainter: string;
|
|
26
|
-
link: string;
|
|
27
|
-
hr: string;
|
|
28
|
-
video: string;
|
|
29
|
-
codeBlock: string;
|
|
30
|
-
heading: string;
|
|
31
|
-
heading1: string;
|
|
32
|
-
heading2: string;
|
|
33
|
-
heading3: string;
|
|
34
|
-
heading4: string;
|
|
35
|
-
heading5: string;
|
|
36
|
-
heading6: string;
|
|
37
|
-
list: string;
|
|
38
|
-
table: string;
|
|
39
|
-
align: string;
|
|
40
|
-
indent: string;
|
|
41
|
-
fontFamily: string;
|
|
42
|
-
fontSize: string;
|
|
43
|
-
moreStyle: string;
|
|
44
|
-
fontColor: string;
|
|
45
|
-
highlight: string;
|
|
46
|
-
image: string;
|
|
47
|
-
file: string;
|
|
48
|
-
emoji: string;
|
|
49
|
-
equation: string;
|
|
50
|
-
removeColor: string;
|
|
51
|
-
};
|
|
52
|
-
slash: {
|
|
53
|
-
heading1: string;
|
|
54
|
-
heading1Desc: string;
|
|
55
|
-
heading2: string;
|
|
56
|
-
heading2Desc: string;
|
|
57
|
-
heading3: string;
|
|
58
|
-
heading3Desc: string;
|
|
59
|
-
heading4: string;
|
|
60
|
-
heading4Desc: string;
|
|
61
|
-
heading5: string;
|
|
62
|
-
heading5Desc: string;
|
|
63
|
-
heading6: string;
|
|
64
|
-
heading6Desc: string;
|
|
65
|
-
paragraph: string;
|
|
66
|
-
paragraphDesc: string;
|
|
67
|
-
blockQuote: string;
|
|
68
|
-
blockQuoteDesc: string;
|
|
69
|
-
numberedList: string;
|
|
70
|
-
numberedListDesc: string;
|
|
71
|
-
bulletedList: string;
|
|
72
|
-
bulletedListDesc: string;
|
|
73
|
-
checklist: string;
|
|
74
|
-
checklistDesc: string;
|
|
75
|
-
table: string;
|
|
76
|
-
tableDesc: string;
|
|
77
|
-
infoAlert: string;
|
|
78
|
-
infoAlertDesc: string;
|
|
79
|
-
tipAlert: string;
|
|
80
|
-
tipAlertDesc: string;
|
|
81
|
-
warningAlert: string;
|
|
82
|
-
warningAlertDesc: string;
|
|
83
|
-
dangerAlert: string;
|
|
84
|
-
dangerAlertDesc: string;
|
|
85
|
-
hr: string;
|
|
86
|
-
hrDesc: string;
|
|
87
|
-
codeBlock: string;
|
|
88
|
-
codeBlockDesc: string;
|
|
89
|
-
video: string;
|
|
90
|
-
videoDesc: string;
|
|
91
|
-
equation: string;
|
|
92
|
-
equationDesc: string;
|
|
93
|
-
image: string;
|
|
94
|
-
imageDesc: string;
|
|
95
|
-
file: string;
|
|
96
|
-
fileDesc: string;
|
|
97
|
-
};
|
|
98
|
-
link: {
|
|
99
|
-
newLink: string;
|
|
100
|
-
url: string;
|
|
101
|
-
title: string;
|
|
102
|
-
copy: string;
|
|
103
|
-
open: string;
|
|
104
|
-
save: string;
|
|
105
|
-
unlink: string;
|
|
106
|
-
};
|
|
107
|
-
table: {
|
|
108
|
-
fitTable: string;
|
|
109
|
-
cellBackground: string;
|
|
110
|
-
column: string;
|
|
111
|
-
insertColumnLeft: string;
|
|
112
|
-
insertColumnRight: string;
|
|
113
|
-
deleteColumn: string;
|
|
114
|
-
row: string;
|
|
115
|
-
insertRowAbove: string;
|
|
116
|
-
insertRowBelow: string;
|
|
117
|
-
deleteRow: string;
|
|
118
|
-
merge: string;
|
|
119
|
-
mergeUp: string;
|
|
120
|
-
mergeRight: string;
|
|
121
|
-
mergeDown: string;
|
|
122
|
-
mergeLeft: string;
|
|
123
|
-
split: string;
|
|
124
|
-
splitLeftRight: string;
|
|
125
|
-
splitTopBottom: string;
|
|
126
|
-
remove: string;
|
|
127
|
-
};
|
|
128
|
-
image: {
|
|
129
|
-
view: string;
|
|
130
|
-
remove: string;
|
|
131
|
-
previous: string;
|
|
132
|
-
next: string;
|
|
133
|
-
close: string;
|
|
134
|
-
loadingError: string;
|
|
135
|
-
zoomOut: string;
|
|
136
|
-
zoomIn: string;
|
|
137
|
-
align: string;
|
|
138
|
-
alignLeft: string;
|
|
139
|
-
alignCenter: string;
|
|
140
|
-
alignRight: string;
|
|
141
|
-
resize: string;
|
|
142
|
-
pageWidth: string;
|
|
143
|
-
originalWidth: string;
|
|
144
|
-
imageWidth: "{0} 图片大小";
|
|
145
|
-
open: string;
|
|
146
|
-
caption: string;
|
|
147
|
-
captionPlaceholder: string;
|
|
148
|
-
};
|
|
149
|
-
file: {
|
|
150
|
-
download: string;
|
|
151
|
-
remove: string;
|
|
152
|
-
};
|
|
153
|
-
video: {
|
|
154
|
-
embed: string;
|
|
155
|
-
remove: string;
|
|
156
|
-
description: string;
|
|
157
|
-
url: string;
|
|
158
|
-
urlError: string;
|
|
159
|
-
};
|
|
160
|
-
codeBlock: {
|
|
161
|
-
langType: string;
|
|
162
|
-
};
|
|
163
|
-
equation: {
|
|
164
|
-
save: string;
|
|
165
|
-
help: string;
|
|
166
|
-
placeholder: string;
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
export default _default;
|
package/lib/icons/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const icons: Map<string, string>;
|
package/lib/index.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import './css';
|
|
2
|
-
import './elements/box';
|
|
3
|
-
import './elements/bookmark';
|
|
4
|
-
import { BoxComponent, BoxValue } from './types/box';
|
|
5
|
-
import { ToolbarItem } from './types/toolbar';
|
|
6
|
-
import { DropdownMenuItem } from './types/dropdown';
|
|
7
|
-
import { MentionItem } from './plugins/mention/types';
|
|
8
|
-
import { SlashItem } from './plugins/slash/types';
|
|
9
|
-
import { icons } from './icons';
|
|
10
|
-
import { query } from './utils/query';
|
|
11
|
-
import { template } from './utils/template';
|
|
12
|
-
import { toHex } from './utils/to-hex';
|
|
13
|
-
import { Nodes } from './models/nodes';
|
|
14
|
-
import { Fragment } from './models/fragment';
|
|
15
|
-
import { Range } from './models/range';
|
|
16
|
-
import { Box } from './models/box';
|
|
17
|
-
import { HTMLParser } from './parsers/html-parser';
|
|
18
|
-
import { TextParser } from './parsers/text-parser';
|
|
19
|
-
import { insertBookmark } from './operations/insert-bookmark';
|
|
20
|
-
import { toBookmark } from './operations/to-bookmark';
|
|
21
|
-
import { insertContents } from './operations/insert-contents';
|
|
22
|
-
import { deleteContents } from './operations/delete-contents';
|
|
23
|
-
import { setBlocks } from './operations/set-blocks';
|
|
24
|
-
import { splitBlock } from './operations/split-block';
|
|
25
|
-
import { insertBlock } from './operations/insert-block';
|
|
26
|
-
import { splitMarks } from './operations/split-marks';
|
|
27
|
-
import { addMark } from './operations/add-mark';
|
|
28
|
-
import { removeMark } from './operations/remove-mark';
|
|
29
|
-
import { insertBox } from './operations/insert-box';
|
|
30
|
-
import { removeBox } from './operations/remove-box';
|
|
31
|
-
import { Button } from './ui/button';
|
|
32
|
-
import { Dropdown } from './ui/dropdown';
|
|
33
|
-
import { Editor } from './editor';
|
|
34
|
-
import { Toolbar } from './ui/toolbar';
|
|
35
|
-
export { icons, ToolbarItem, DropdownMenuItem, MentionItem, SlashItem, BoxComponent, BoxValue, Editor, Toolbar, Button, Dropdown, Nodes, Fragment, Range, Box, HTMLParser, TextParser, query, template, toHex, insertBookmark, toBookmark, insertContents, deleteContents, setBlocks, splitBlock, insertBlock, splitMarks, addMark, removeMark, insertBox, removeBox, };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ActiveItem } from '../types/selection';
|
|
2
|
-
import { Selection } from './selection';
|
|
3
|
-
type CommmandItem = {
|
|
4
|
-
isDisabled?: (activeItems: ActiveItem[]) => boolean;
|
|
5
|
-
isSelected?: (activeItems: ActiveItem[]) => boolean;
|
|
6
|
-
selectedValues?: (activeItems: ActiveItem[]) => string[];
|
|
7
|
-
execute: (...data: any[]) => void;
|
|
8
|
-
};
|
|
9
|
-
export declare class Command {
|
|
10
|
-
private selection;
|
|
11
|
-
private commandMap;
|
|
12
|
-
constructor(selection: Selection);
|
|
13
|
-
add(name: string, commandItem: CommmandItem): void;
|
|
14
|
-
delete(name: string): void;
|
|
15
|
-
getNames(): string[];
|
|
16
|
-
has(name: string): boolean;
|
|
17
|
-
getItem(name: string): CommmandItem;
|
|
18
|
-
isDisabled(name: string): boolean;
|
|
19
|
-
isSelected(name: string): boolean;
|
|
20
|
-
selectedValues(name: string): string[];
|
|
21
|
-
execute(name: string, ...data: any[]): void;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import EventEmitter from 'eventemitter3';
|
|
2
|
-
import { Nodes } from '../models/nodes';
|
|
3
|
-
import { Selection } from './selection';
|
|
4
|
-
type SaveOptions = {
|
|
5
|
-
inputType?: string;
|
|
6
|
-
update?: boolean;
|
|
7
|
-
emitEvent?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare class History {
|
|
10
|
-
private selection;
|
|
11
|
-
private container;
|
|
12
|
-
private canSave;
|
|
13
|
-
list: Nodes[];
|
|
14
|
-
index: number;
|
|
15
|
-
limit: number;
|
|
16
|
-
event: EventEmitter;
|
|
17
|
-
constructor(selection: Selection);
|
|
18
|
-
private removeBookmark;
|
|
19
|
-
private getValue;
|
|
20
|
-
private addIdToBoxes;
|
|
21
|
-
private removeIdfromBoxes;
|
|
22
|
-
private morphContainer;
|
|
23
|
-
get canUndo(): boolean;
|
|
24
|
-
get canRedo(): boolean;
|
|
25
|
-
cloneContainer(): Nodes;
|
|
26
|
-
undo(): void;
|
|
27
|
-
redo(): void;
|
|
28
|
-
continue(): void;
|
|
29
|
-
pause(): void;
|
|
30
|
-
save(options?: SaveOptions): void;
|
|
31
|
-
}
|
|
32
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Nodes } from '../models/nodes';
|
|
2
|
-
export declare class Keystroke {
|
|
3
|
-
private container;
|
|
4
|
-
private keydownEventList;
|
|
5
|
-
private keyupEventList;
|
|
6
|
-
constructor(container: Nodes);
|
|
7
|
-
setKeydown(type: string, listener: EventListener): void;
|
|
8
|
-
setKeyup(type: string, listener: EventListener): void;
|
|
9
|
-
keydown(type: string): void;
|
|
10
|
-
keyup(type: string): void;
|
|
11
|
-
}
|
package/lib/managers/plugin.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '../editor';
|
|
2
|
-
import { InitializePlugin, UnmountPlugin } from '../types/plugin';
|
|
3
|
-
export declare class Plugin {
|
|
4
|
-
private pluginMap;
|
|
5
|
-
add(name: string, plugin: InitializePlugin): void;
|
|
6
|
-
loadAll(editor: Editor): Map<string, UnmountPlugin>;
|
|
7
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ActiveItem } from '../types/selection';
|
|
2
|
-
import { Nodes } from '../models/nodes';
|
|
3
|
-
import { Range } from '../models/range';
|
|
4
|
-
import { Box } from '../models/box';
|
|
5
|
-
import { insertBookmark } from '../operations/insert-bookmark';
|
|
6
|
-
import { toBookmark } from '../operations/to-bookmark';
|
|
7
|
-
import { insertContents } from '../operations/insert-contents';
|
|
8
|
-
import { deleteContents } from '../operations/delete-contents';
|
|
9
|
-
import { setBlocks } from '../operations/set-blocks';
|
|
10
|
-
import { splitBlock } from '../operations/split-block';
|
|
11
|
-
import { insertBlock } from '../operations/insert-block';
|
|
12
|
-
import { splitMarks } from '../operations/split-marks';
|
|
13
|
-
import { addMark } from '../operations/add-mark';
|
|
14
|
-
import { removeMark } from '../operations/remove-mark';
|
|
15
|
-
import { insertBox } from '../operations/insert-box';
|
|
16
|
-
import { removeBox } from '../operations/remove-box';
|
|
17
|
-
export declare class Selection {
|
|
18
|
-
private selection;
|
|
19
|
-
container: Nodes;
|
|
20
|
-
range: Range;
|
|
21
|
-
constructor(container: Nodes);
|
|
22
|
-
getCurrentRange(): Range;
|
|
23
|
-
sync(): void;
|
|
24
|
-
updateByRange(): void;
|
|
25
|
-
updateByBookmark(): void;
|
|
26
|
-
getActiveItems(): ActiveItem[];
|
|
27
|
-
insertBookmark(): ReturnType<typeof insertBookmark>;
|
|
28
|
-
toBookmark(bookmark: Parameters<typeof toBookmark>[1]): ReturnType<typeof toBookmark>;
|
|
29
|
-
insertContents(contents: Parameters<typeof insertContents>[1]): ReturnType<typeof insertContents>;
|
|
30
|
-
deleteContents(): ReturnType<typeof deleteContents>;
|
|
31
|
-
setBlocks(value: Parameters<typeof setBlocks>[1]): ReturnType<typeof setBlocks>;
|
|
32
|
-
splitBlock(): ReturnType<typeof splitBlock>;
|
|
33
|
-
insertBlock(value: Parameters<typeof insertBlock>[1]): ReturnType<typeof insertBlock>;
|
|
34
|
-
splitMarks(removeEmptyMark?: Parameters<typeof splitMarks>[1]): ReturnType<typeof splitMarks>;
|
|
35
|
-
addMark(value: Parameters<typeof addMark>[1]): ReturnType<typeof addMark>;
|
|
36
|
-
removeMark(value?: Parameters<typeof removeMark>[1]): ReturnType<typeof removeMark>;
|
|
37
|
-
selectBox(box: Box | Nodes): void;
|
|
38
|
-
insertBox(boxName: Parameters<typeof insertBox>[1], boxValue?: Parameters<typeof insertBox>[2]): Box;
|
|
39
|
-
removeBox(box?: Box | Nodes | null): ReturnType<typeof removeBox>;
|
|
40
|
-
}
|
package/lib/models/box.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import EventEmitter from 'eventemitter3';
|
|
2
|
-
import type { Editor } from '../editor';
|
|
3
|
-
import { BoxType, BoxValue } from '../types/box';
|
|
4
|
-
import { ToolbarItem } from '../types/toolbar';
|
|
5
|
-
import { Nodes } from './nodes';
|
|
6
|
-
import { FloatingToolbar } from '../ui/floating-toolbar';
|
|
7
|
-
export declare class Box {
|
|
8
|
-
readonly node: Nodes;
|
|
9
|
-
readonly event: EventEmitter;
|
|
10
|
-
toolbar: FloatingToolbar | null;
|
|
11
|
-
constructor(node: string | Node | Nodes);
|
|
12
|
-
private initiate;
|
|
13
|
-
get type(): BoxType;
|
|
14
|
-
get name(): string;
|
|
15
|
-
get value(): BoxValue;
|
|
16
|
-
set value(value: BoxValue);
|
|
17
|
-
updateValue(keyName: string, keyValue: string): void;
|
|
18
|
-
updateValue(keyName: BoxValue): void;
|
|
19
|
-
getEditor(): Editor;
|
|
20
|
-
getContainer(): Nodes;
|
|
21
|
-
getHTML(): string;
|
|
22
|
-
setToolbar(items: ToolbarItem[]): void;
|
|
23
|
-
render(): void;
|
|
24
|
-
unmount(): void;
|
|
25
|
-
}
|
package/lib/models/fragment.d.ts
DELETED
package/lib/models/nodes.d.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { KeyValue } from '../types/object';
|
|
2
|
-
import { NodePath } from '../types/node';
|
|
3
|
-
type EventItem = {
|
|
4
|
-
type: string;
|
|
5
|
-
listener: EventListener;
|
|
6
|
-
};
|
|
7
|
-
export declare class Nodes {
|
|
8
|
-
private readonly nodeList;
|
|
9
|
-
readonly length: number;
|
|
10
|
-
constructor(node?: Node | Node[] | null);
|
|
11
|
-
get id(): number;
|
|
12
|
-
get name(): string;
|
|
13
|
-
get isElement(): boolean;
|
|
14
|
-
get isText(): boolean;
|
|
15
|
-
get isBlock(): boolean;
|
|
16
|
-
get isMark(): boolean;
|
|
17
|
-
get isVoid(): boolean;
|
|
18
|
-
get isHeading(): boolean;
|
|
19
|
-
get isList(): boolean;
|
|
20
|
-
get isTable(): boolean;
|
|
21
|
-
get isBookmark(): boolean;
|
|
22
|
-
get isBox(): boolean;
|
|
23
|
-
get isInlineBox(): boolean;
|
|
24
|
-
get isBlockBox(): boolean;
|
|
25
|
-
get isContainer(): boolean;
|
|
26
|
-
get isOutside(): boolean;
|
|
27
|
-
get isInside(): boolean;
|
|
28
|
-
get isTopInside(): boolean;
|
|
29
|
-
get isContentEditable(): boolean;
|
|
30
|
-
get isIndivisible(): boolean;
|
|
31
|
-
get isEmpty(): boolean;
|
|
32
|
-
get(index: number): Node;
|
|
33
|
-
getAll(): Node[];
|
|
34
|
-
eq(index: number): Nodes;
|
|
35
|
-
each(callback: (node: Node, index: number) => boolean | void): this;
|
|
36
|
-
eachElement(callback: (element: Element, index: number) => boolean | void): this;
|
|
37
|
-
reverse(): Nodes;
|
|
38
|
-
matches(selector: string): boolean;
|
|
39
|
-
contains(otherNode: Nodes): boolean;
|
|
40
|
-
isSibling(otherNode: Nodes): boolean;
|
|
41
|
-
find(selector: string | NodePath): Nodes;
|
|
42
|
-
closest(selector: string): Nodes;
|
|
43
|
-
closestBlock(): Nodes;
|
|
44
|
-
closestOperableBlock(): Nodes;
|
|
45
|
-
closestContainer(): Nodes;
|
|
46
|
-
closestScroller(): Nodes;
|
|
47
|
-
parent(): Nodes;
|
|
48
|
-
prev(): Nodes;
|
|
49
|
-
next(): Nodes;
|
|
50
|
-
first(): Nodes;
|
|
51
|
-
last(): Nodes;
|
|
52
|
-
index(): number;
|
|
53
|
-
path(): NodePath;
|
|
54
|
-
children(): Nodes[];
|
|
55
|
-
getWalker(): Generator<Nodes>;
|
|
56
|
-
on(type: string, listener: EventListener): this;
|
|
57
|
-
off(type?: string, listener?: EventListener): this;
|
|
58
|
-
emit(type: string, event?: Event): this;
|
|
59
|
-
getEventListeners(index: number): EventItem[];
|
|
60
|
-
focus(): this;
|
|
61
|
-
blur(): this;
|
|
62
|
-
clone(deep?: boolean): Nodes;
|
|
63
|
-
hasAttr(attributeName: string): boolean;
|
|
64
|
-
attr(attributeName: string): string;
|
|
65
|
-
attr(attributeName: string, value: string): this;
|
|
66
|
-
attr(attributeName: KeyValue): this;
|
|
67
|
-
removeAttr(attributeName: string): this;
|
|
68
|
-
hasClass(className: string): boolean;
|
|
69
|
-
addClass(className: string | string[]): this;
|
|
70
|
-
removeClass(className: string | string[]): this;
|
|
71
|
-
computedCSS(propertyName: string): string;
|
|
72
|
-
css(propertyName: string): string;
|
|
73
|
-
css(propertyName: KeyValue): this;
|
|
74
|
-
css(propertyName: string, value: string): this;
|
|
75
|
-
width(): number;
|
|
76
|
-
innerWidth(): number;
|
|
77
|
-
height(): number;
|
|
78
|
-
show(displayType?: string): this;
|
|
79
|
-
hide(): this;
|
|
80
|
-
html(): string;
|
|
81
|
-
html(value: string): this;
|
|
82
|
-
text(): string;
|
|
83
|
-
text(value: string): this;
|
|
84
|
-
value(): string;
|
|
85
|
-
value(value: string): this;
|
|
86
|
-
outerHTML(): string;
|
|
87
|
-
empty(): this;
|
|
88
|
-
prepend(content: string | Node | DocumentFragment | Nodes): this;
|
|
89
|
-
append(content: string | Node | DocumentFragment | Nodes): this;
|
|
90
|
-
before(content: string | Node | DocumentFragment | Nodes): this;
|
|
91
|
-
after(content: string | Node | DocumentFragment | Nodes): this;
|
|
92
|
-
replaceWith(newContent: string | Node | Nodes): this;
|
|
93
|
-
remove(keepChildren?: boolean): this;
|
|
94
|
-
splitText(offset: number): Nodes;
|
|
95
|
-
toString(): string;
|
|
96
|
-
info(): void;
|
|
97
|
-
}
|
|
98
|
-
export {};
|
package/lib/models/range.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { NativeRange } from '../types/native';
|
|
2
|
-
import { Nodes } from './nodes';
|
|
3
|
-
export declare class Range {
|
|
4
|
-
private readonly range;
|
|
5
|
-
constructor(range?: NativeRange);
|
|
6
|
-
get startNode(): Nodes;
|
|
7
|
-
get startOffset(): number;
|
|
8
|
-
get endNode(): Nodes;
|
|
9
|
-
get endOffset(): number;
|
|
10
|
-
get commonAncestor(): Nodes;
|
|
11
|
-
get isCollapsed(): boolean;
|
|
12
|
-
get isBox(): boolean;
|
|
13
|
-
get isBoxStart(): boolean;
|
|
14
|
-
get isBoxCenter(): boolean;
|
|
15
|
-
get isBoxEnd(): boolean;
|
|
16
|
-
get isInsideBox(): boolean;
|
|
17
|
-
get isInoperative(): boolean;
|
|
18
|
-
get(): NativeRange;
|
|
19
|
-
getRect(): DOMRect;
|
|
20
|
-
comparePoint(node: Nodes, offset: number): number;
|
|
21
|
-
compareBeforeNode(node: Nodes): number;
|
|
22
|
-
compareAfterNode(node: Nodes): number;
|
|
23
|
-
intersectsNode(node: Nodes): boolean;
|
|
24
|
-
setStart(node: Nodes, offset: number): void;
|
|
25
|
-
setStartBefore(node: Nodes): void;
|
|
26
|
-
setStartAfter(node: Nodes): void;
|
|
27
|
-
setEnd(node: Nodes, offset: number): void;
|
|
28
|
-
setEndBefore(node: Nodes): void;
|
|
29
|
-
setEndAfter(node: Nodes): void;
|
|
30
|
-
collapseToStart(): void;
|
|
31
|
-
collapseToEnd(): void;
|
|
32
|
-
selectNode(node: Nodes): void;
|
|
33
|
-
selectNodeContents(node: Nodes): void;
|
|
34
|
-
selectBox(boxNode: Nodes): void;
|
|
35
|
-
selectBoxStart(boxNode: Nodes): void;
|
|
36
|
-
selectBoxEnd(boxNode: Nodes): void;
|
|
37
|
-
shrinkBefore(node: Nodes): void;
|
|
38
|
-
shrinkAfter(node: Nodes): void;
|
|
39
|
-
shrink(): void;
|
|
40
|
-
adjustBox(): void;
|
|
41
|
-
adjustTable(): void;
|
|
42
|
-
adjustBlock(): void;
|
|
43
|
-
adjust(): void;
|
|
44
|
-
adjustBr(): void;
|
|
45
|
-
getPrevNode(): Nodes;
|
|
46
|
-
getNextNode(): Nodes;
|
|
47
|
-
getBoxes(): Nodes[];
|
|
48
|
-
getBlocks(): Nodes[];
|
|
49
|
-
getMarks(hasText?: boolean): Nodes[];
|
|
50
|
-
getStartText(): string;
|
|
51
|
-
getEndText(): string;
|
|
52
|
-
getCharacterRange(character: string): Range | null;
|
|
53
|
-
clone(): Range;
|
|
54
|
-
cloneContents(): DocumentFragment;
|
|
55
|
-
info(): void;
|
|
56
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Nodes } from '../models/nodes';
|
|
2
|
-
export declare class HTMLParser {
|
|
3
|
-
private readonly rules;
|
|
4
|
-
private readonly source;
|
|
5
|
-
constructor(content: string | Nodes, rules?: any);
|
|
6
|
-
private parseHTML;
|
|
7
|
-
private static matchRule;
|
|
8
|
-
private static getOpenTagString;
|
|
9
|
-
private static getClosedTagString;
|
|
10
|
-
private static getTrimmedText;
|
|
11
|
-
getHTML(): string;
|
|
12
|
-
getFragment(): DocumentFragment;
|
|
13
|
-
}
|
package/lib/plugins/align.d.ts
DELETED
package/lib/plugins/bold.d.ts
DELETED
package/lib/plugins/code.d.ts
DELETED
package/lib/plugins/copy.d.ts
DELETED