lakelib 0.2.4 → 0.2.6
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 +102 -79
- package/dist/lake.min.js +34 -49
- package/dist/lake.min.js.map +1 -1
- package/lib/{types/css → css}/index.d.ts +2 -0
- package/lib/{types/editor.d.ts → editor.d.ts} +1 -1
- package/lib/{types/i18n/ja → i18n/en-US}/index.d.ts +11 -0
- package/lib/{types/i18n/en-US → i18n/ja}/index.d.ts +11 -0
- package/lib/{types/i18n → i18n}/ko/index.d.ts +11 -0
- package/lib/{types/i18n → i18n}/types.d.ts +98 -9
- package/lib/{types/i18n → i18n}/zh-CN/index.d.ts +11 -0
- package/lib/lake.css +102 -79
- package/lib/lake.js +4947 -4609
- package/lib/lake.js.map +1 -1
- package/lib/{types/models → models}/box.d.ts +5 -3
- package/lib/types/corner-toolbar.d.ts +7 -0
- package/lib/types/{types/object.d.ts → object.d.ts} +3 -3
- package/lib/ui/corner-toolbar.d.ts +18 -0
- package/lib/ui/floating-toolbar.d.ts +16 -0
- package/lib/{types/ui → ui}/link-popup.d.ts +2 -2
- package/lib/{types/ui/box-resizer.d.ts → ui/resizer.d.ts} +6 -8
- package/lib/{types/ui → ui}/toolbar.d.ts +2 -2
- package/lib/{types/utils → utils}/index.d.ts +1 -1
- package/lib/utils/is-visible.d.ts +8 -0
- package/package.json +20 -20
- package/lib/types/types/box-toolbar.d.ts +0 -22
- package/lib/types/ui/box-toolbar.d.ts +0 -30
- package/lib/types/utils/node-position.d.ts +0 -9
- /package/lib/{types/boxes → boxes}/code-block.d.ts +0 -0
- /package/lib/{types/boxes → boxes}/emoji.d.ts +0 -0
- /package/lib/{types/boxes → boxes}/equation.d.ts +0 -0
- /package/lib/{types/boxes → boxes}/file.d.ts +0 -0
- /package/lib/{types/boxes → boxes}/hr.d.ts +0 -0
- /package/lib/{types/boxes → boxes}/image.d.ts +0 -0
- /package/lib/{types/boxes → boxes}/mention.d.ts +0 -0
- /package/lib/{types/boxes → boxes}/video.d.ts +0 -0
- /package/lib/{types/config → config}/element-rules.d.ts +0 -0
- /package/lib/{types/config → config}/menu-items.d.ts +0 -0
- /package/lib/{types/config → config}/slash-items.d.ts +0 -0
- /package/lib/{types/config → config}/tag-names.d.ts +0 -0
- /package/lib/{types/config → config}/toolbar-items.d.ts +0 -0
- /package/lib/{types/elements → elements}/bookmark.d.ts +0 -0
- /package/lib/{types/elements → elements}/box.d.ts +0 -0
- /package/lib/{types/i18n → i18n}/index.d.ts +0 -0
- /package/lib/{types/icons → icons}/index.d.ts +0 -0
- /package/lib/{types/index.d.ts → index.d.ts} +0 -0
- /package/lib/{types/managers → managers}/box-manager.d.ts +0 -0
- /package/lib/{types/managers → managers}/command.d.ts +0 -0
- /package/lib/{types/managers → managers}/history.d.ts +0 -0
- /package/lib/{types/managers → managers}/keystroke.d.ts +0 -0
- /package/lib/{types/managers → managers}/plugin.d.ts +0 -0
- /package/lib/{types/managers → managers}/selection.d.ts +0 -0
- /package/lib/{types/models → models}/fragment.d.ts +0 -0
- /package/lib/{types/models → models}/nodes.d.ts +0 -0
- /package/lib/{types/models → models}/range.d.ts +0 -0
- /package/lib/{types/operations → operations}/add-mark.d.ts +0 -0
- /package/lib/{types/operations → operations}/delete-contents.d.ts +0 -0
- /package/lib/{types/operations → operations}/fix-list.d.ts +0 -0
- /package/lib/{types/operations → operations}/insert-bookmark.d.ts +0 -0
- /package/lib/{types/operations → operations}/insert-box.d.ts +0 -0
- /package/lib/{types/operations → operations}/insert-fragment.d.ts +0 -0
- /package/lib/{types/operations → operations}/insert-link.d.ts +0 -0
- /package/lib/{types/operations → operations}/insert-node.d.ts +0 -0
- /package/lib/{types/operations → operations}/remove-box.d.ts +0 -0
- /package/lib/{types/operations → operations}/remove-mark.d.ts +0 -0
- /package/lib/{types/operations → operations}/set-blocks.d.ts +0 -0
- /package/lib/{types/operations → operations}/split-block.d.ts +0 -0
- /package/lib/{types/operations → operations}/split-marks.d.ts +0 -0
- /package/lib/{types/operations → operations}/to-bookmark.d.ts +0 -0
- /package/lib/{types/parsers → parsers}/html-parser.d.ts +0 -0
- /package/lib/{types/parsers → parsers}/text-parser.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/align.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/arrow-keys.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/backspace-key.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/block-quote.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/bold.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/code-block.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/code.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/copy.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/cut.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/delete-key.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/drop.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/emoji.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/enter-key.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/equation.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/escape-key.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/file.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/font-color.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/font-family.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/font-size.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/format-painter.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/heading.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/highlight.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/hr.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/image.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/indent.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/italic.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/link.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/list.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/markdown.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/mention.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/paste.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/redo.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/remove-format.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/select-all.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/shift-enter-key.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/slash.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/special-character.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/strikethrough.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/subscript.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/superscript.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/tab-key.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/underline.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/undo.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/unlink.d.ts +0 -0
- /package/lib/{types/plugins → plugins}/video.d.ts +0 -0
- /package/lib/{types/storage → storage}/box-instances.d.ts +0 -0
- /package/lib/{types/storage → storage}/boxes.d.ts +0 -0
- /package/lib/{types/storage → storage}/editors.d.ts +0 -0
- /package/lib/types/{types/box.d.ts → box.d.ts} +0 -0
- /package/lib/types/{types/dropdown.d.ts → dropdown.d.ts} +0 -0
- /package/lib/types/{types/mention.d.ts → mention.d.ts} +0 -0
- /package/lib/types/{types/native.d.ts → native.d.ts} +0 -0
- /package/lib/types/{types/node.d.ts → node.d.ts} +0 -0
- /package/lib/types/{types/plugin.d.ts → plugin.d.ts} +0 -0
- /package/lib/types/{types/request.d.ts → request.d.ts} +0 -0
- /package/lib/types/{types/slash.d.ts → slash.d.ts} +0 -0
- /package/lib/types/{types/toolbar.d.ts → toolbar.d.ts} +0 -0
- /package/lib/{types/ui → ui}/button.d.ts +0 -0
- /package/lib/{types/ui → ui}/dropdown.d.ts +0 -0
- /package/lib/{types/ui → ui}/mention-menu.d.ts +0 -0
- /package/lib/{types/ui → ui}/menu.d.ts +0 -0
- /package/lib/{types/ui → ui}/slash-menu.d.ts +0 -0
- /package/lib/{types/utils → utils}/append-break.d.ts +0 -0
- /package/lib/{types/utils → utils}/camel-case.d.ts +0 -0
- /package/lib/{types/utils → utils}/change-tag-name.d.ts +0 -0
- /package/lib/{types/utils → utils}/debug.d.ts +0 -0
- /package/lib/{types/utils → utils}/denormalize-value.d.ts +0 -0
- /package/lib/{types/utils → utils}/encode.d.ts +0 -0
- /package/lib/{types/utils → utils}/file-size.d.ts +0 -0
- /package/lib/{types/utils → utils}/fix-numbered-list.d.ts +0 -0
- /package/lib/{types/utils → utils}/from-base64.d.ts +0 -0
- /package/lib/{types/utils → utils}/get-box.d.ts +0 -0
- /package/lib/{types/utils → utils}/get-css.d.ts +0 -0
- /package/lib/{types/utils → utils}/get-deep-element.d.ts +0 -0
- /package/lib/{types/utils → utils}/in-string.d.ts +0 -0
- /package/lib/{types/utils → utils}/merge-nodes.d.ts +0 -0
- /package/lib/{types/utils → utils}/modifier-text.d.ts +0 -0
- /package/lib/{types/utils → utils}/morph.d.ts +0 -0
- /package/lib/{types/utils → utils}/normalize-value.d.ts +0 -0
- /package/lib/{types/utils → utils}/parse-style.d.ts +0 -0
- /package/lib/{types/utils → utils}/query.d.ts +0 -0
- /package/lib/{types/utils → utils}/remove-break.d.ts +0 -0
- /package/lib/{types/utils → utils}/remove-zws.d.ts +0 -0
- /package/lib/{types/utils → utils}/request.d.ts +0 -0
- /package/lib/{types/utils → utils}/safe-template.d.ts +0 -0
- /package/lib/{types/utils → utils}/scroll-to-node.d.ts +0 -0
- /package/lib/{types/utils → utils}/set-block-indent.d.ts +0 -0
- /package/lib/{types/utils → utils}/split-nodes.d.ts +0 -0
- /package/lib/{types/utils → utils}/template.d.ts +0 -0
- /package/lib/{types/utils → utils}/to-base64.d.ts +0 -0
- /package/lib/{types/utils → utils}/to-hex.d.ts +0 -0
- /package/lib/{types/utils → utils}/to-node-list.d.ts +0 -0
- /package/lib/{types/utils → utils}/upload-file.d.ts +0 -0
- /package/lib/{types/utils → utils}/wrap-node-list.d.ts +0 -0
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import EventEmitter from 'eventemitter3';
|
|
2
2
|
import type { Editor } from '../editor';
|
|
3
3
|
import { BoxType, BoxValue } from '../types/box';
|
|
4
|
-
import {
|
|
4
|
+
import { ToolbarItem } from '../types/toolbar';
|
|
5
5
|
import { Nodes } from './nodes';
|
|
6
|
+
import { FloatingToolbar } from '../ui/floating-toolbar';
|
|
6
7
|
export declare class Box {
|
|
7
8
|
node: Nodes;
|
|
8
9
|
event: EventEmitter;
|
|
10
|
+
toolbar: FloatingToolbar | null;
|
|
9
11
|
constructor(node: string | Node | Nodes);
|
|
10
|
-
private
|
|
12
|
+
private initiate;
|
|
11
13
|
get type(): BoxType;
|
|
12
14
|
get name(): string;
|
|
13
15
|
get value(): BoxValue;
|
|
@@ -16,7 +18,7 @@ export declare class Box {
|
|
|
16
18
|
updateValue(valueKey: BoxValue): void;
|
|
17
19
|
getEditor(): Editor;
|
|
18
20
|
getContainer(): Nodes;
|
|
19
|
-
setToolbar(items:
|
|
21
|
+
setToolbar(items: ToolbarItem[]): void;
|
|
20
22
|
render(): void;
|
|
21
23
|
unmount(): void;
|
|
22
24
|
getHTML(): string;
|
|
@@ -21,7 +21,7 @@ export type AppliedItem = {
|
|
|
21
21
|
};
|
|
22
22
|
export type SelectionState = {
|
|
23
23
|
appliedItems: AppliedItem[];
|
|
24
|
-
disabledNameMap
|
|
25
|
-
selectedNameMap
|
|
26
|
-
selectedValuesMap
|
|
24
|
+
disabledNameMap?: Map<string, boolean>;
|
|
25
|
+
selectedNameMap?: Map<string, boolean>;
|
|
26
|
+
selectedValuesMap?: Map<string, string[]>;
|
|
27
27
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TranslationFunctions } from '../i18n/types';
|
|
2
|
+
import { CornerToolbarItem } from '../types/corner-toolbar';
|
|
3
|
+
import { Nodes } from '../models/nodes';
|
|
4
|
+
type CornerToolbarConfig = {
|
|
5
|
+
locale?: TranslationFunctions;
|
|
6
|
+
root: Nodes;
|
|
7
|
+
items: CornerToolbarItem[];
|
|
8
|
+
};
|
|
9
|
+
export declare class CornerToolbar {
|
|
10
|
+
private config;
|
|
11
|
+
private locale;
|
|
12
|
+
private root;
|
|
13
|
+
container: Nodes;
|
|
14
|
+
constructor(config: CornerToolbarConfig);
|
|
15
|
+
private appendButton;
|
|
16
|
+
render(): void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Nodes } from '../models/nodes';
|
|
2
|
+
import { Range } from '../models/range';
|
|
3
|
+
import { Toolbar, ToolbarConfig } from './toolbar';
|
|
4
|
+
type FloatingToolbarConfig = ToolbarConfig & {
|
|
5
|
+
target: Nodes | Range;
|
|
6
|
+
};
|
|
7
|
+
export declare class FloatingToolbar extends Toolbar {
|
|
8
|
+
private range;
|
|
9
|
+
constructor(config: FloatingToolbarConfig);
|
|
10
|
+
private scrollListener;
|
|
11
|
+
private resizeListener;
|
|
12
|
+
private updatePosition;
|
|
13
|
+
render(): void;
|
|
14
|
+
unmount(): void;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -19,11 +19,11 @@ export declare class LinkPopup {
|
|
|
19
19
|
private appendOpenButton;
|
|
20
20
|
private appendSaveButton;
|
|
21
21
|
private appendUnlinkButton;
|
|
22
|
+
private save;
|
|
22
23
|
private scrollListener;
|
|
23
24
|
private resizeListener;
|
|
25
|
+
private updatePosition;
|
|
24
26
|
get visible(): boolean;
|
|
25
|
-
save(): void;
|
|
26
|
-
position(): void;
|
|
27
27
|
show(linkNode: Nodes): void;
|
|
28
28
|
hide(): void;
|
|
29
29
|
unmount(): void;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { Nodes } from '../models/nodes';
|
|
2
|
-
|
|
3
|
-
type BoxResizerConfig = {
|
|
2
|
+
type ResizerConfig = {
|
|
4
3
|
root: Nodes;
|
|
5
|
-
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
4
|
+
target: Nodes;
|
|
8
5
|
onResize?: (width: number, height: number) => void;
|
|
9
6
|
onStop: (width: number, height: number) => void;
|
|
10
7
|
};
|
|
11
|
-
export declare class
|
|
8
|
+
export declare class Resizer {
|
|
12
9
|
private config;
|
|
13
10
|
private root;
|
|
14
|
-
private
|
|
15
|
-
|
|
11
|
+
private target;
|
|
12
|
+
container: Nodes;
|
|
13
|
+
constructor(config: ResizerConfig);
|
|
16
14
|
private bindEvents;
|
|
17
15
|
render(): void;
|
|
18
16
|
}
|
|
@@ -3,8 +3,8 @@ import { SelectionState } from '../types/object';
|
|
|
3
3
|
import { ToolbarItem } from '../types/toolbar';
|
|
4
4
|
import { Nodes } from '../models/nodes';
|
|
5
5
|
type ToolbarPlacement = 'top' | 'bottom';
|
|
6
|
-
type ToolbarConfig = {
|
|
7
|
-
root
|
|
6
|
+
export type ToolbarConfig = {
|
|
7
|
+
root?: string | Node | Nodes;
|
|
8
8
|
items?: (string | ToolbarItem)[];
|
|
9
9
|
placement?: ToolbarPlacement;
|
|
10
10
|
};
|
|
@@ -25,7 +25,7 @@ export * from './append-break';
|
|
|
25
25
|
export * from './remove-break';
|
|
26
26
|
export * from './set-block-indent';
|
|
27
27
|
export * from './morph';
|
|
28
|
-
export * from './
|
|
28
|
+
export * from './is-visible';
|
|
29
29
|
export * from './scroll-to-node';
|
|
30
30
|
export * from './get-box';
|
|
31
31
|
export * from './request';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lakelib",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Lake is a browser-based rich text editor designed for creating content
|
|
3
|
+
"version": "0.2.6",
|
|
4
|
+
"description": "Lake is a browser-based rich text editor designed for creating content like blogs, comments, and emails.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rich text",
|
|
7
7
|
"wysiwyg",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"author": "Luo Longhao <luolonghao@gmail.com>",
|
|
20
20
|
"main": "./lib/lake.js",
|
|
21
|
-
"types": "./lib/
|
|
21
|
+
"types": "./lib/index.d.ts",
|
|
22
22
|
"files": [
|
|
23
23
|
"dist",
|
|
24
24
|
"lib"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@types/is-hotkey": "^0.1.10",
|
|
32
|
-
"debounce": "^2.
|
|
32
|
+
"debounce": "^2.2.0",
|
|
33
33
|
"eventemitter3": "^5.0.1",
|
|
34
34
|
"fast-deep-equal": "^3.1.3",
|
|
35
35
|
"is-hotkey": "^0.2.0",
|
|
@@ -37,41 +37,41 @@
|
|
|
37
37
|
"typesafe-i18n": "^5.26.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@rollup/plugin-commonjs": "^
|
|
40
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
|
41
41
|
"@rollup/plugin-json": "^6.1.0",
|
|
42
|
-
"@rollup/plugin-node-resolve": "^15.
|
|
42
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
43
43
|
"@rollup/plugin-terser": "^0.4.4",
|
|
44
|
-
"@rollup/plugin-typescript": "^
|
|
45
|
-
"@types/chai": "^4.3.
|
|
46
|
-
"@types/mocha": "^10.0.
|
|
44
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
|
45
|
+
"@types/chai": "^4.3.20",
|
|
46
|
+
"@types/mocha": "^10.0.9",
|
|
47
47
|
"@types/sinon": "^17.0.3",
|
|
48
48
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
49
49
|
"@typescript-eslint/parser": "^7.18.0",
|
|
50
50
|
"chai": "^4.5.0",
|
|
51
51
|
"conventional-changelog-cli": "^5.0.0",
|
|
52
|
-
"eslint": "^8.57.
|
|
52
|
+
"eslint": "^8.57.1",
|
|
53
53
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
54
54
|
"eslint-config-prettier": "^9.1.0",
|
|
55
|
-
"execa": "^9.
|
|
56
|
-
"express": "^4.
|
|
55
|
+
"execa": "^9.4.1",
|
|
56
|
+
"express": "^4.21.1",
|
|
57
57
|
"katex": "^0.16.11",
|
|
58
58
|
"lake-codemirror": "^2.0.0",
|
|
59
59
|
"mocha": "^10.7.3",
|
|
60
60
|
"multer": "1.4.5-lts.1",
|
|
61
|
-
"npm-run-all2": "^
|
|
62
|
-
"picocolors": "^1.1.
|
|
61
|
+
"npm-run-all2": "^7.0.0",
|
|
62
|
+
"picocolors": "^1.1.1",
|
|
63
63
|
"prompts": "^2.4.2",
|
|
64
|
-
"puppeteer": "^23.
|
|
64
|
+
"puppeteer": "^23.6.0",
|
|
65
65
|
"rimraf": "^6.0.1",
|
|
66
|
-
"rollup": "^4.
|
|
67
|
-
"rollup-plugin-import-css": "^3.5.
|
|
66
|
+
"rollup": "^4.24.0",
|
|
67
|
+
"rollup-plugin-import-css": "^3.5.5",
|
|
68
68
|
"rollup-plugin-svg-import": "^3.0.0",
|
|
69
69
|
"semver": "^7.6.3",
|
|
70
70
|
"simple-git-hooks": "^2.11.1",
|
|
71
|
-
"sinon": "^
|
|
71
|
+
"sinon": "^19.0.2",
|
|
72
72
|
"sort-package-json": "^2.10.1",
|
|
73
|
-
"tslib": "^2.
|
|
74
|
-
"typescript": "^5.
|
|
73
|
+
"tslib": "^2.8.0",
|
|
74
|
+
"typescript": "^5.6.3",
|
|
75
75
|
"wait-on": "^8.0.1"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Box } from '../models/box';
|
|
2
|
-
import { TranslationFunctions } from '../i18n/types';
|
|
3
|
-
import { DropdownItem } from './dropdown';
|
|
4
|
-
import { AppliedItem } from './object';
|
|
5
|
-
export type BoxToolbarButtonItem = {
|
|
6
|
-
name: string;
|
|
7
|
-
type: 'button';
|
|
8
|
-
icon?: string;
|
|
9
|
-
tooltip: string | ((locale: TranslationFunctions) => string);
|
|
10
|
-
isSelected?: (appliedItems: AppliedItem[]) => boolean;
|
|
11
|
-
isDisabled?: (appliedItems: AppliedItem[]) => boolean;
|
|
12
|
-
onClick: (box: Box, value: string) => void;
|
|
13
|
-
};
|
|
14
|
-
export type BoxToolbarDropdownItem = DropdownItem & {
|
|
15
|
-
name: string;
|
|
16
|
-
type: 'dropdown';
|
|
17
|
-
selectedValues?: (appliedItems: AppliedItem[]) => string[];
|
|
18
|
-
isDisabled?: (appliedItems: AppliedItem[]) => boolean;
|
|
19
|
-
onSelect: (box: Box, value: string) => void;
|
|
20
|
-
};
|
|
21
|
-
export type BoxToolbarItem = BoxToolbarButtonItem | BoxToolbarDropdownItem;
|
|
22
|
-
export type BoxToolbarPlacement = 'top' | 'bottom';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { TranslationFunctions } from '../i18n/types';
|
|
2
|
-
import { BoxToolbarItem, BoxToolbarPlacement } from '../types/box-toolbar';
|
|
3
|
-
import { Nodes } from '../models/nodes';
|
|
4
|
-
import { Box } from '../models/box';
|
|
5
|
-
type BoxToolbarConfig = {
|
|
6
|
-
box: Box;
|
|
7
|
-
items: ('|' | BoxToolbarItem)[];
|
|
8
|
-
locale?: TranslationFunctions;
|
|
9
|
-
placement?: BoxToolbarPlacement;
|
|
10
|
-
};
|
|
11
|
-
export declare class BoxToolbar {
|
|
12
|
-
private box;
|
|
13
|
-
private items;
|
|
14
|
-
private locale;
|
|
15
|
-
private placement;
|
|
16
|
-
private buttonItemList;
|
|
17
|
-
private dropdownItemList;
|
|
18
|
-
private dropdownList;
|
|
19
|
-
container: Nodes;
|
|
20
|
-
constructor(config: BoxToolbarConfig);
|
|
21
|
-
private appendDivider;
|
|
22
|
-
private appendButton;
|
|
23
|
-
private appendDropdown;
|
|
24
|
-
private scrollListener;
|
|
25
|
-
private resizeListener;
|
|
26
|
-
updatePosition(): void;
|
|
27
|
-
render(): void;
|
|
28
|
-
unmount(): void;
|
|
29
|
-
}
|
|
30
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|