lakelib 0.2.6 → 0.3.0
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 +3 -3
- package/dist/lake.css +377 -363
- package/dist/lake.min.js +40 -40
- package/dist/lake.min.js.map +1 -1
- package/lib/css/index.d.ts +0 -11
- package/lib/i18n/en-US/index.d.ts +24 -0
- package/lib/i18n/ja/index.d.ts +24 -0
- package/lib/i18n/ko/index.d.ts +24 -0
- package/lib/i18n/types.d.ts +182 -2
- package/lib/i18n/zh-CN/index.d.ts +24 -0
- package/lib/index.d.ts +8 -8
- package/lib/lake.css +126 -112
- package/lib/lake.js +5674 -4655
- package/lib/lake.js.map +1 -1
- package/lib/managers/command.d.ts +4 -4
- package/lib/managers/selection.d.ts +6 -10
- package/lib/operations/insert-block.d.ts +3 -0
- package/lib/operations/insert-contents.d.ts +4 -0
- package/lib/operations/split-block.d.ts +1 -1
- package/lib/operations/split-marks.d.ts +1 -1
- package/lib/plugins/align.d.ts +1 -1
- package/lib/plugins/arrow-keys.d.ts +1 -1
- package/lib/plugins/backspace-key.d.ts +1 -1
- package/lib/plugins/block-quote.d.ts +1 -1
- package/lib/plugins/bold.d.ts +1 -1
- package/lib/plugins/code-block/code-block-box.d.ts +4 -0
- package/lib/plugins/code-block/index.d.ts +5 -0
- package/lib/plugins/code.d.ts +1 -1
- package/lib/plugins/copy.d.ts +1 -1
- package/lib/plugins/cut.d.ts +1 -1
- package/lib/plugins/delete-key.d.ts +1 -1
- package/lib/plugins/drop.d.ts +1 -1
- package/lib/plugins/emoji/emoji-box.d.ts +4 -0
- package/lib/plugins/emoji/index.d.ts +5 -0
- package/lib/plugins/enter-key.d.ts +1 -1
- package/lib/plugins/equation/equation-box.d.ts +4 -0
- package/lib/plugins/equation/index.d.ts +5 -0
- package/lib/plugins/escape-key.d.ts +1 -1
- package/lib/plugins/file/file-box.d.ts +4 -0
- package/lib/plugins/file/index.d.ts +5 -0
- package/lib/plugins/font-color.d.ts +1 -1
- package/lib/plugins/font-family.d.ts +1 -1
- package/lib/plugins/font-size.d.ts +1 -1
- package/lib/plugins/format-painter.d.ts +1 -1
- package/lib/plugins/heading.d.ts +1 -1
- package/lib/plugins/highlight.d.ts +1 -1
- package/lib/plugins/hr/hr-box.d.ts +4 -0
- package/lib/plugins/hr/index.d.ts +5 -0
- package/lib/{boxes/image.d.ts → plugins/image/image-box.d.ts} +2 -1
- package/lib/plugins/image/index.d.ts +5 -0
- package/lib/plugins/indent.d.ts +1 -1
- package/lib/plugins/italic.d.ts +1 -1
- package/lib/plugins/{link.d.ts → link/index.d.ts} +1 -1
- package/lib/plugins/link/insert-link.d.ts +3 -0
- package/lib/{ui → plugins/link}/link-popup.d.ts +3 -2
- package/lib/plugins/list.d.ts +1 -1
- package/lib/plugins/markdown.d.ts +1 -1
- package/lib/plugins/mention/index.d.ts +5 -0
- package/lib/plugins/mention/mention-box.d.ts +4 -0
- package/lib/{ui → plugins/mention}/mention-menu.d.ts +4 -3
- package/lib/plugins/paste.d.ts +1 -1
- package/lib/plugins/redo.d.ts +1 -1
- package/lib/plugins/remove-format.d.ts +1 -1
- package/lib/plugins/select-all.d.ts +1 -1
- package/lib/plugins/shift-enter-key.d.ts +1 -1
- package/lib/plugins/{mention.d.ts → slash/index.d.ts} +1 -1
- package/lib/{config → plugins/slash}/slash-items.d.ts +1 -1
- package/lib/{ui → plugins/slash}/slash-menu.d.ts +5 -4
- package/lib/{types/slash.d.ts → plugins/slash/types.d.ts} +2 -2
- package/lib/plugins/special-character.d.ts +1 -1
- package/lib/plugins/strikethrough.d.ts +1 -1
- package/lib/plugins/subscript.d.ts +1 -1
- package/lib/plugins/superscript.d.ts +1 -1
- package/lib/plugins/tab-key.d.ts +1 -1
- package/lib/plugins/table/delete-column.d.ts +2 -0
- package/lib/plugins/table/delete-row.d.ts +2 -0
- package/lib/plugins/table/delete-table.d.ts +2 -0
- package/lib/plugins/{slash.d.ts → table/index.d.ts} +2 -1
- package/lib/plugins/table/insert-column.d.ts +4 -0
- package/lib/plugins/table/insert-row.d.ts +4 -0
- package/lib/plugins/table/insert-table.d.ts +3 -0
- package/lib/plugins/table/merge-cells.d.ts +3 -0
- package/lib/plugins/table/split-cell.d.ts +3 -0
- package/lib/plugins/table/utils.d.ts +6 -0
- package/lib/plugins/underline.d.ts +1 -1
- package/lib/plugins/undo.d.ts +1 -1
- package/lib/plugins/unlink.d.ts +1 -1
- package/lib/plugins/video/index.d.ts +5 -0
- package/lib/plugins/video/video-box.d.ts +4 -0
- package/lib/storage/editors.d.ts +1 -1
- package/lib/types/dropdown.d.ts +1 -0
- package/lib/types/native.d.ts +0 -8
- package/lib/types/node.d.ts +12 -0
- package/lib/types/object.d.ts +0 -24
- package/lib/types/selection.d.ts +14 -0
- package/lib/types/toolbar.d.ts +5 -5
- package/lib/ui/toolbar.d.ts +2 -2
- package/lib/utils/indent-block.d.ts +2 -0
- package/lib/utils/remove-empty-marks.d.ts +2 -0
- package/lib/utils/unsafe-template.d.ts +1 -0
- package/lib/utils/visible-info.d.ts +10 -0
- package/package.json +14 -13
- package/lib/boxes/code-block.d.ts +0 -3
- package/lib/boxes/emoji.d.ts +0 -3
- package/lib/boxes/equation.d.ts +0 -3
- package/lib/boxes/file.d.ts +0 -3
- package/lib/boxes/hr.d.ts +0 -3
- package/lib/boxes/mention.d.ts +0 -3
- package/lib/boxes/video.d.ts +0 -3
- package/lib/operations/fix-list.d.ts +0 -2
- package/lib/operations/insert-fragment.d.ts +0 -3
- package/lib/operations/insert-link.d.ts +0 -3
- package/lib/operations/insert-node.d.ts +0 -3
- package/lib/plugins/code-block.d.ts +0 -3
- package/lib/plugins/emoji.d.ts +0 -3
- package/lib/plugins/equation.d.ts +0 -3
- package/lib/plugins/file.d.ts +0 -3
- package/lib/plugins/hr.d.ts +0 -3
- package/lib/plugins/image.d.ts +0 -3
- package/lib/plugins/video.d.ts +0 -3
- package/lib/utils/index.d.ts +0 -33
- package/lib/utils/is-visible.d.ts +0 -8
- package/lib/utils/safe-template.d.ts +0 -1
- package/lib/utils/set-block-indent.d.ts +0 -2
- /package/lib/{types/mention.d.ts → plugins/mention/types.d.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActiveItem } from '../types/selection';
|
|
2
2
|
import { Selection } from './selection';
|
|
3
3
|
type CommmandItem = {
|
|
4
|
-
isDisabled?: (
|
|
5
|
-
isSelected?: (
|
|
6
|
-
selectedValues?: (
|
|
4
|
+
isDisabled?: (activeItems: ActiveItem[]) => boolean;
|
|
5
|
+
isSelected?: (activeItems: ActiveItem[]) => boolean;
|
|
6
|
+
selectedValues?: (activeItems: ActiveItem[]) => string[];
|
|
7
7
|
execute: (...data: any[]) => void;
|
|
8
8
|
};
|
|
9
9
|
export declare class Command {
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActiveItem } from '../types/selection';
|
|
2
2
|
import { Nodes } from '../models/nodes';
|
|
3
3
|
import { Range } from '../models/range';
|
|
4
4
|
import { Box } from '../models/box';
|
|
5
5
|
import { insertBookmark } from '../operations/insert-bookmark';
|
|
6
6
|
import { toBookmark } from '../operations/to-bookmark';
|
|
7
|
-
import {
|
|
8
|
-
import { insertFragment } from '../operations/insert-fragment';
|
|
7
|
+
import { insertContents } from '../operations/insert-contents';
|
|
9
8
|
import { deleteContents } from '../operations/delete-contents';
|
|
10
9
|
import { setBlocks } from '../operations/set-blocks';
|
|
11
10
|
import { splitBlock } from '../operations/split-block';
|
|
11
|
+
import { insertBlock } from '../operations/insert-block';
|
|
12
12
|
import { splitMarks } from '../operations/split-marks';
|
|
13
13
|
import { addMark } from '../operations/add-mark';
|
|
14
14
|
import { removeMark } from '../operations/remove-mark';
|
|
15
|
-
import { fixList } from '../operations/fix-list';
|
|
16
|
-
import { insertLink } from '../operations/insert-link';
|
|
17
15
|
import { insertBox } from '../operations/insert-box';
|
|
18
16
|
import { removeBox } from '../operations/remove-box';
|
|
19
17
|
export declare class Selection {
|
|
@@ -25,19 +23,17 @@ export declare class Selection {
|
|
|
25
23
|
sync(): void;
|
|
26
24
|
updateByRange(): void;
|
|
27
25
|
updateByBookmark(): void;
|
|
28
|
-
|
|
26
|
+
getActiveItems(): ActiveItem[];
|
|
29
27
|
insertBookmark(): ReturnType<typeof insertBookmark>;
|
|
30
28
|
toBookmark(bookmark: Parameters<typeof toBookmark>[1]): ReturnType<typeof toBookmark>;
|
|
31
|
-
|
|
32
|
-
insertFragment(fragment: Parameters<typeof insertFragment>[1]): ReturnType<typeof insertFragment>;
|
|
29
|
+
insertContents(contents: Parameters<typeof insertContents>[1]): ReturnType<typeof insertContents>;
|
|
33
30
|
deleteContents(): ReturnType<typeof deleteContents>;
|
|
34
31
|
setBlocks(value: Parameters<typeof setBlocks>[1]): ReturnType<typeof setBlocks>;
|
|
35
32
|
splitBlock(): ReturnType<typeof splitBlock>;
|
|
33
|
+
insertBlock(value: Parameters<typeof insertBlock>[1]): ReturnType<typeof insertBlock>;
|
|
36
34
|
splitMarks(removeEmptyMark?: Parameters<typeof splitMarks>[1]): ReturnType<typeof splitMarks>;
|
|
37
35
|
addMark(value: Parameters<typeof addMark>[1]): ReturnType<typeof addMark>;
|
|
38
36
|
removeMark(value?: Parameters<typeof removeMark>[1]): ReturnType<typeof removeMark>;
|
|
39
|
-
fixList(): ReturnType<typeof fixList>;
|
|
40
|
-
insertLink(value: Parameters<typeof insertLink>[1]): ReturnType<typeof insertLink>;
|
|
41
37
|
selectBox(box: Box | Nodes): void;
|
|
42
38
|
insertBox(boxName: Parameters<typeof insertBox>[1], boxValue?: Parameters<typeof insertBox>[2]): Box;
|
|
43
39
|
removeBox(box?: Box | Nodes | null): ReturnType<typeof removeBox>;
|
package/lib/plugins/align.d.ts
CHANGED
package/lib/plugins/bold.d.ts
CHANGED
package/lib/plugins/code.d.ts
CHANGED
package/lib/plugins/copy.d.ts
CHANGED
package/lib/plugins/cut.d.ts
CHANGED
package/lib/plugins/drop.d.ts
CHANGED
package/lib/plugins/heading.d.ts
CHANGED
package/lib/plugins/indent.d.ts
CHANGED
package/lib/plugins/italic.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import './link-popup.css';
|
|
2
|
+
import { TranslationFunctions } from 'lakelib/i18n/types';
|
|
3
|
+
import { Nodes } from 'lakelib/models/nodes';
|
|
3
4
|
type LinkPopupConfig = {
|
|
4
5
|
locale?: TranslationFunctions;
|
|
5
6
|
onCopy?: (error: boolean) => void;
|
package/lib/plugins/list.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Nodes } from '
|
|
3
|
-
import { Menu, MenuConfig } from '
|
|
1
|
+
import './mention-menu.css';
|
|
2
|
+
import { Nodes } from 'lakelib/models/nodes';
|
|
3
|
+
import { Menu, MenuConfig } from 'lakelib/ui/menu';
|
|
4
|
+
import { MentionItem } from './types';
|
|
4
5
|
type OnSelect = (event: Event, item: MentionItem) => void;
|
|
5
6
|
type MentionMenuConfig = MenuConfig<MentionItem> & {
|
|
6
7
|
onSelect?: OnSelect;
|
package/lib/plugins/paste.d.ts
CHANGED
package/lib/plugins/redo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SlashItem } from '
|
|
1
|
+
import { SlashItem } from './types';
|
|
2
2
|
export declare const slashItems: SlashItem[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { Nodes } from '
|
|
4
|
-
import { Menu, MenuConfig } from '
|
|
1
|
+
import './slash-menu.css';
|
|
2
|
+
import { TranslationFunctions } from 'lakelib/i18n/types';
|
|
3
|
+
import { Nodes } from 'lakelib/models/nodes';
|
|
4
|
+
import { Menu, MenuConfig } from 'lakelib/ui/menu';
|
|
5
|
+
import { SlashItem } from './types';
|
|
5
6
|
type OnSelect = (event: Event, item: SlashItem, fileNode?: Nodes) => void;
|
|
6
7
|
type SlashMenuConfig = MenuConfig<string | SlashItem> & {
|
|
7
8
|
locale?: TranslationFunctions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Editor } from '
|
|
2
|
-
import { TranslationFunctions } from '
|
|
1
|
+
import type { Editor } from 'lakelib/editor';
|
|
2
|
+
import { TranslationFunctions } from 'lakelib/i18n/types';
|
|
3
3
|
export type SlashButtonItem = {
|
|
4
4
|
name: string;
|
|
5
5
|
type: 'button';
|
package/lib/plugins/tab-key.d.ts
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type TableMap = HTMLTableCellElement[][];
|
|
2
|
+
export declare function getTableMap(table: HTMLTableElement): TableMap;
|
|
3
|
+
export declare function getColumnIndex(tableMap: TableMap, rowIndex: number, currentCell: HTMLTableCellElement): number;
|
|
4
|
+
export declare function getCellIndex(tableMap: TableMap, rowIndex: number, columnIndex: number): number;
|
|
5
|
+
export declare function isNormalColumn(tableMap: TableMap, columnIndex: number): boolean;
|
|
6
|
+
export {};
|
package/lib/plugins/undo.d.ts
CHANGED
package/lib/plugins/unlink.d.ts
CHANGED
package/lib/storage/editors.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Editor } from '
|
|
1
|
+
import type { Editor } from '../editor';
|
|
2
2
|
export declare const editors: Map<number, Editor>;
|
package/lib/types/dropdown.d.ts
CHANGED
package/lib/types/native.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
export type NativeRange = Range;
|
|
2
|
-
export declare const NativeRange: {
|
|
3
|
-
new (): Range;
|
|
4
|
-
prototype: Range;
|
|
5
|
-
readonly START_TO_START: 0;
|
|
6
|
-
readonly START_TO_END: 1;
|
|
7
|
-
readonly END_TO_END: 2;
|
|
8
|
-
readonly END_TO_START: 3;
|
|
9
|
-
};
|
|
10
2
|
export type NativeSelection = Selection;
|
package/lib/types/node.d.ts
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
+
import type { Nodes } from '../models/nodes';
|
|
2
|
+
export type TwoParts = {
|
|
3
|
+
start: Nodes | null;
|
|
4
|
+
end: Nodes | null;
|
|
5
|
+
};
|
|
6
|
+
export type ThreeParts = TwoParts & {
|
|
7
|
+
center: Nodes | null;
|
|
8
|
+
};
|
|
9
|
+
export type Point = {
|
|
10
|
+
node: Nodes;
|
|
11
|
+
offset: number;
|
|
12
|
+
};
|
|
1
13
|
export type NodePath = number[];
|
package/lib/types/object.d.ts
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
import type { Nodes } from '../models/nodes';
|
|
2
1
|
export type KeyValue = {
|
|
3
2
|
[key: string]: string;
|
|
4
3
|
};
|
|
5
|
-
export type TwoParts = {
|
|
6
|
-
start: Nodes | null;
|
|
7
|
-
end: Nodes | null;
|
|
8
|
-
};
|
|
9
|
-
export type ThreeParts = TwoParts & {
|
|
10
|
-
center: Nodes | null;
|
|
11
|
-
};
|
|
12
|
-
export type Point = {
|
|
13
|
-
node: Nodes;
|
|
14
|
-
offset: number;
|
|
15
|
-
};
|
|
16
|
-
export type AppliedItem = {
|
|
17
|
-
node: Nodes;
|
|
18
|
-
name: string;
|
|
19
|
-
attributes: KeyValue;
|
|
20
|
-
styles: KeyValue;
|
|
21
|
-
};
|
|
22
|
-
export type SelectionState = {
|
|
23
|
-
appliedItems: AppliedItem[];
|
|
24
|
-
disabledNameMap?: Map<string, boolean>;
|
|
25
|
-
selectedNameMap?: Map<string, boolean>;
|
|
26
|
-
selectedValuesMap?: Map<string, string[]>;
|
|
27
|
-
};
|