lakelib 0.1.13 → 0.1.15
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 +4 -4
- package/dist/lake.css +268 -218
- package/dist/lake.min.js +40 -38
- package/dist/lake.min.js.map +1 -1
- package/lib/lake.css +268 -218
- package/lib/lake.js +727 -677
- package/lib/lake.js.map +1 -1
- package/lib/types/boxes/emoji.d.ts +2 -0
- package/lib/types/css/index.d.ts +5 -5
- package/lib/types/editor.d.ts +7 -9
- package/lib/types/i18n/en-US/index.d.ts +1 -0
- package/lib/types/i18n/ja/index.d.ts +1 -0
- package/lib/types/i18n/ko/index.d.ts +1 -0
- package/lib/types/i18n/types.d.ts +8 -0
- package/lib/types/i18n/zh-CN/index.d.ts +1 -0
- package/lib/types/index.d.ts +4 -2
- package/lib/types/managers/command.d.ts +0 -2
- package/lib/types/managers/history.d.ts +11 -5
- package/lib/types/managers/selection.d.ts +0 -2
- package/lib/types/models/box.d.ts +0 -2
- package/lib/types/models/fragment.d.ts +3 -1
- package/lib/types/operations/insert-fragment.d.ts +2 -1
- package/lib/types/plugins/emoji.d.ts +3 -0
- package/lib/types/types/dropdown.d.ts +4 -3
- package/lib/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/lib/types/operations/insert-contents.d.ts +0 -2
- /package/lib/types/{ui/upload.d.ts → utils/upload-file.d.ts} +0 -0
package/lib/types/css/index.d.ts
CHANGED
|
@@ -2,21 +2,21 @@ import './custom-properties.css';
|
|
|
2
2
|
import './keyframes.css';
|
|
3
3
|
import './core.css';
|
|
4
4
|
import './mark.css';
|
|
5
|
+
import './box.css';
|
|
5
6
|
import './button.css';
|
|
6
7
|
import './dropdown.css';
|
|
7
8
|
import './popup.css';
|
|
8
9
|
import './resizer.css';
|
|
9
|
-
import './toolbar.css';
|
|
10
|
-
import './box-toolbar.css';
|
|
11
10
|
import './format-painter.css';
|
|
12
11
|
import './heading.css';
|
|
12
|
+
import './link.css';
|
|
13
13
|
import './list.css';
|
|
14
14
|
import './block-quote.css';
|
|
15
15
|
import './table.css';
|
|
16
|
-
import './box.css';
|
|
17
16
|
import './hr.css';
|
|
18
|
-
import './video.css';
|
|
19
17
|
import './code-block.css';
|
|
20
18
|
import './image.css';
|
|
19
|
+
import './video.css';
|
|
21
20
|
import './file.css';
|
|
22
|
-
import './
|
|
21
|
+
import './emoji.css';
|
|
22
|
+
import './toolbar.css';
|
package/lib/types/editor.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ type Config = {
|
|
|
19
19
|
indentWithTab: boolean;
|
|
20
20
|
lang: string;
|
|
21
21
|
minChangeSize: number;
|
|
22
|
+
historySize: number;
|
|
22
23
|
onMessage: MessageCallback;
|
|
23
24
|
[name: string]: any;
|
|
24
25
|
};
|
|
@@ -37,11 +38,12 @@ type EditorConfig = {
|
|
|
37
38
|
[name: string]: any;
|
|
38
39
|
};
|
|
39
40
|
export declare class Editor {
|
|
41
|
+
private unsavedInputData;
|
|
42
|
+
private unsavedInputCount;
|
|
43
|
+
private state;
|
|
40
44
|
static version: string;
|
|
41
45
|
static box: BoxManager;
|
|
42
46
|
static plugin: Plugin;
|
|
43
|
-
private unsavedInputData;
|
|
44
|
-
private state;
|
|
45
47
|
root: Nodes;
|
|
46
48
|
toolbar: Toolbar | undefined;
|
|
47
49
|
config: Config;
|
|
@@ -61,23 +63,19 @@ export declare class Editor {
|
|
|
61
63
|
private copyListener;
|
|
62
64
|
private cutListener;
|
|
63
65
|
private pasteListener;
|
|
64
|
-
private beforeunloadListener;
|
|
65
66
|
private selectionchangeListener;
|
|
66
67
|
private clickListener;
|
|
67
68
|
private resizeListener;
|
|
68
69
|
private updateBoxSelectionStyle;
|
|
69
70
|
private emitStateChangeEvent;
|
|
70
|
-
private emitChangeEvent;
|
|
71
71
|
private togglePlaceholderClass;
|
|
72
|
-
private
|
|
72
|
+
private moveBoxStripText;
|
|
73
|
+
private resetUnsavedInputData;
|
|
73
74
|
private bindInputEvents;
|
|
74
75
|
private bindHistoryEvents;
|
|
75
76
|
get hasFocus(): boolean;
|
|
76
77
|
get locale(): TranslationFunctions;
|
|
77
|
-
fixContent():
|
|
78
|
-
commitUnsavedInputData(): void;
|
|
79
|
-
prepareOperation(): void;
|
|
80
|
-
commitOperation(): void;
|
|
78
|
+
fixContent(): boolean;
|
|
81
79
|
setPluginConfig(name: string, config: {
|
|
82
80
|
[key: string]: any;
|
|
83
81
|
}): void;
|
|
@@ -182,6 +182,10 @@ type RootTranslation = {
|
|
|
182
182
|
* File
|
|
183
183
|
*/
|
|
184
184
|
file: string;
|
|
185
|
+
/**
|
|
186
|
+
* Emoji
|
|
187
|
+
*/
|
|
188
|
+
emoji: string;
|
|
185
189
|
/**
|
|
186
190
|
* Remove color
|
|
187
191
|
*/
|
|
@@ -468,6 +472,10 @@ export type TranslationFunctions = {
|
|
|
468
472
|
* File
|
|
469
473
|
*/
|
|
470
474
|
file: () => LocalizedString;
|
|
475
|
+
/**
|
|
476
|
+
* Emoji
|
|
477
|
+
*/
|
|
478
|
+
emoji: () => LocalizedString;
|
|
471
479
|
/**
|
|
472
480
|
* Remove color
|
|
473
481
|
*/
|
package/lib/types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import './elements/box';
|
|
|
3
3
|
import './elements/bookmark';
|
|
4
4
|
import { BoxComponent } from './types/box';
|
|
5
5
|
import { ToolbarItem } from './types/toolbar';
|
|
6
|
+
import { DropdownMenuItem } from './types/dropdown';
|
|
6
7
|
import { icons } from './icons';
|
|
7
8
|
import * as Utils from './utils';
|
|
8
9
|
import { Nodes } from './models/nodes';
|
|
@@ -15,7 +16,6 @@ import { insertBookmark } from './operations/insert-bookmark';
|
|
|
15
16
|
import { toBookmark } from './operations/to-bookmark';
|
|
16
17
|
import { insertNode } from './operations/insert-node';
|
|
17
18
|
import { insertFragment } from './operations/insert-fragment';
|
|
18
|
-
import { insertContents } from './operations/insert-contents';
|
|
19
19
|
import { deleteContents } from './operations/delete-contents';
|
|
20
20
|
import { setBlocks } from './operations/set-blocks';
|
|
21
21
|
import { splitBlock } from './operations/split-block';
|
|
@@ -24,8 +24,10 @@ import { addMark } from './operations/add-mark';
|
|
|
24
24
|
import { removeMark } from './operations/remove-mark';
|
|
25
25
|
import { fixList } from './operations/fix-list';
|
|
26
26
|
import { insertLink } from './operations/insert-link';
|
|
27
|
+
import { insertBox } from './operations/insert-box';
|
|
28
|
+
import { removeBox } from './operations/remove-box';
|
|
27
29
|
import { Button } from './ui/button';
|
|
28
30
|
import { Dropdown } from './ui/dropdown';
|
|
29
31
|
import { Editor } from './editor';
|
|
30
32
|
import { Toolbar } from './ui/toolbar';
|
|
31
|
-
export { Editor, Toolbar, ToolbarItem, BoxComponent, icons, Utils, Nodes, Fragment, Range, Box, HTMLParser, TextParser, insertBookmark, toBookmark, insertNode, insertFragment,
|
|
33
|
+
export { Editor, Toolbar, ToolbarItem, DropdownMenuItem, BoxComponent, icons, Utils, Nodes, Fragment, Range, Box, HTMLParser, TextParser, insertBookmark, toBookmark, insertNode, insertFragment, deleteContents, setBlocks, splitBlock, splitMarks, addMark, removeMark, fixList, insertLink, insertBox, removeBox, Button, Dropdown, };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import EventEmitter from 'eventemitter3';
|
|
2
1
|
import { AppliedItem } from '../types/object';
|
|
3
2
|
import { Selection } from './selection';
|
|
4
3
|
type CommmandItem = {
|
|
@@ -10,7 +9,6 @@ type CommmandItem = {
|
|
|
10
9
|
export declare class Command {
|
|
11
10
|
private selection;
|
|
12
11
|
private commandMap;
|
|
13
|
-
event: EventEmitter;
|
|
14
12
|
constructor(selection: Selection);
|
|
15
13
|
add(name: string, commandItem: CommmandItem): void;
|
|
16
14
|
delete(name: string): void;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import EventEmitter from 'eventemitter3';
|
|
2
|
+
import { Nodes } from '../models/nodes';
|
|
2
3
|
import { Selection } from './selection';
|
|
4
|
+
type SaveOptions = {
|
|
5
|
+
inputType?: string;
|
|
6
|
+
update?: boolean;
|
|
7
|
+
emitEvent?: boolean;
|
|
8
|
+
};
|
|
3
9
|
export declare class History {
|
|
4
10
|
private selection;
|
|
5
11
|
private container;
|
|
6
|
-
private list;
|
|
7
|
-
private index;
|
|
8
12
|
private canSave;
|
|
13
|
+
list: Nodes[];
|
|
14
|
+
index: number;
|
|
9
15
|
limit: number;
|
|
10
16
|
event: EventEmitter;
|
|
11
17
|
constructor(selection: Selection);
|
|
@@ -14,13 +20,13 @@ export declare class History {
|
|
|
14
20
|
private addIdToBoxes;
|
|
15
21
|
private removeIdfromBoxes;
|
|
16
22
|
private morphContainer;
|
|
17
|
-
private cloneContainer;
|
|
18
|
-
get count(): number;
|
|
19
23
|
get canUndo(): boolean;
|
|
20
24
|
get canRedo(): boolean;
|
|
25
|
+
cloneContainer(): Nodes;
|
|
21
26
|
undo(): void;
|
|
22
27
|
redo(): void;
|
|
23
28
|
continue(): void;
|
|
24
29
|
pause(): void;
|
|
25
|
-
save(
|
|
30
|
+
save(options?: SaveOptions): void;
|
|
26
31
|
}
|
|
32
|
+
export {};
|
|
@@ -6,7 +6,6 @@ import { insertBookmark } from '../operations/insert-bookmark';
|
|
|
6
6
|
import { toBookmark } from '../operations/to-bookmark';
|
|
7
7
|
import { insertNode } from '../operations/insert-node';
|
|
8
8
|
import { insertFragment } from '../operations/insert-fragment';
|
|
9
|
-
import { insertContents } from '../operations/insert-contents';
|
|
10
9
|
import { deleteContents } from '../operations/delete-contents';
|
|
11
10
|
import { setBlocks } from '../operations/set-blocks';
|
|
12
11
|
import { splitBlock } from '../operations/split-block';
|
|
@@ -31,7 +30,6 @@ export declare class Selection {
|
|
|
31
30
|
toBookmark(bookmark: Parameters<typeof toBookmark>[1]): ReturnType<typeof toBookmark>;
|
|
32
31
|
insertNode(node: Parameters<typeof insertNode>[1]): ReturnType<typeof insertNode>;
|
|
33
32
|
insertFragment(fragment: Parameters<typeof insertFragment>[1]): ReturnType<typeof insertFragment>;
|
|
34
|
-
insertContents(value: Parameters<typeof insertContents>[1]): ReturnType<typeof insertContents>;
|
|
35
33
|
deleteContents(): ReturnType<typeof deleteContents>;
|
|
36
34
|
setBlocks(value: Parameters<typeof setBlocks>[1]): ReturnType<typeof setBlocks>;
|
|
37
35
|
splitBlock(): ReturnType<typeof splitBlock>;
|
|
@@ -15,8 +15,6 @@ export declare class Box {
|
|
|
15
15
|
set value(value: BoxValue);
|
|
16
16
|
updateValue(valueKey: string, valueValue: string): void;
|
|
17
17
|
updateValue(valueKey: BoxValue): void;
|
|
18
|
-
getData(key: string): any;
|
|
19
|
-
setData(key: string, value: any): void;
|
|
20
18
|
getEditor(): Editor | undefined;
|
|
21
19
|
getContainer(): Nodes;
|
|
22
20
|
setToolbar(items: ('|' | BoxToolbarItem)[]): void;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { NativeNode } from '../types/native';
|
|
1
2
|
import { Nodes } from './nodes';
|
|
2
3
|
export declare class Fragment {
|
|
3
4
|
private fragment;
|
|
4
5
|
constructor(fragment?: DocumentFragment);
|
|
6
|
+
get(): DocumentFragment;
|
|
5
7
|
find(selector: string): Nodes;
|
|
6
|
-
append(node: Nodes): void;
|
|
8
|
+
append(node: string | NativeNode | Nodes): void;
|
|
7
9
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Range } from '../models/range';
|
|
2
|
-
|
|
2
|
+
import { Fragment } from '../models/fragment';
|
|
3
|
+
export declare function insertFragment(range: Range, fragment: DocumentFragment | Fragment): void;
|
|
@@ -9,9 +9,10 @@ export type DropdownItem = {
|
|
|
9
9
|
icon?: string;
|
|
10
10
|
accentIcon?: string;
|
|
11
11
|
downIcon?: string;
|
|
12
|
-
defaultValue
|
|
12
|
+
defaultValue?: string;
|
|
13
13
|
tooltip: string | ((locale: TranslationFunctions) => string);
|
|
14
|
-
width
|
|
15
|
-
menuType: 'list' | 'color';
|
|
14
|
+
width?: string;
|
|
15
|
+
menuType: 'list' | 'icon' | 'color';
|
|
16
16
|
menuItems: DropdownMenuItem[];
|
|
17
|
+
menuWidth?: string;
|
|
17
18
|
};
|
package/package.json
CHANGED
|
File without changes
|