lakelib 0.0.2 → 0.0.3
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 +6 -6
- package/dist/codemirror.min.js +1 -1
- package/dist/lake.css +748 -298
- package/dist/lake.min.js +44 -45
- package/dist/lake.min.js.map +1 -0
- package/lib/lake.css +327 -298
- package/lib/lake.js +1909 -1252
- package/lib/lake.js.map +1 -0
- package/lib/types/boxes/code-block.d.ts +1 -1
- package/lib/types/config/menu-items.d.ts +9 -9
- package/lib/types/css/index.d.ts +3 -1
- package/lib/types/editor.d.ts +15 -7
- package/lib/types/i18n/en-US/index.d.ts +70 -0
- package/lib/types/i18n/index.d.ts +2 -0
- package/lib/types/i18n/ja/index.d.ts +70 -0
- package/lib/types/i18n/ko/index.d.ts +70 -0
- package/lib/types/i18n/types.d.ts +500 -0
- package/lib/types/i18n/zh-CN/index.d.ts +70 -0
- package/lib/types/index.d.ts +4 -2
- package/lib/types/managers/command.d.ts +15 -3
- package/lib/types/managers/plugin.d.ts +0 -1
- package/lib/types/managers/selection.d.ts +0 -1
- package/lib/types/models/nodes.d.ts +1 -0
- package/lib/types/types/dropdown.d.ts +16 -0
- package/lib/types/types/toolbar.d.ts +9 -21
- package/lib/types/ui/button.d.ts +17 -0
- package/lib/types/ui/dropdown.d.ts +23 -0
- package/lib/types/ui/link-popup.d.ts +10 -5
- package/lib/types/ui/toolbar.d.ts +2 -11
- package/lib/types/utils/index.d.ts +1 -0
- package/lib/types/utils/modifier-text.d.ts +1 -0
- package/package.json +46 -28
- package/dist/lake-all.css +0 -1331
- package/dist/lake-all.min.js +0 -84
- package/lib/types/codemirror.d.ts +0 -5
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Nodes } from '../models/nodes';
|
|
2
|
+
export type ButtonConfig = {
|
|
3
|
+
root: Nodes;
|
|
4
|
+
name: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
text?: string;
|
|
7
|
+
tooltip?: string;
|
|
8
|
+
tabIndex?: number;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare class Button {
|
|
12
|
+
private config;
|
|
13
|
+
private root;
|
|
14
|
+
node: Nodes;
|
|
15
|
+
constructor(config: ButtonConfig);
|
|
16
|
+
render(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DropdownItem, DropdownMenuItem } from '../types/dropdown';
|
|
2
|
+
import { Nodes } from '../models/nodes';
|
|
3
|
+
export type DropdownConfig = DropdownItem & {
|
|
4
|
+
root: Nodes;
|
|
5
|
+
tabIndex?: number;
|
|
6
|
+
onSelect: (value: string) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare class Dropdown {
|
|
9
|
+
private config;
|
|
10
|
+
private root;
|
|
11
|
+
node: Nodes;
|
|
12
|
+
constructor(config: DropdownConfig);
|
|
13
|
+
static getValue(node: Nodes): string[];
|
|
14
|
+
static setValue(node: Nodes, value: string[]): void;
|
|
15
|
+
static getMenuMap(menuItems: DropdownMenuItem[]): Map<string, string>;
|
|
16
|
+
private updateColorAccent;
|
|
17
|
+
private apppendMenuItems;
|
|
18
|
+
private documentClickListener;
|
|
19
|
+
private showMenu;
|
|
20
|
+
private bindEvents;
|
|
21
|
+
render(): void;
|
|
22
|
+
unmount(): void;
|
|
23
|
+
}
|
|
@@ -2,15 +2,20 @@ import EventEmitter from 'eventemitter3';
|
|
|
2
2
|
import { Nodes } from '../models/nodes';
|
|
3
3
|
export declare class LinkPopup {
|
|
4
4
|
private linkNode;
|
|
5
|
-
root
|
|
5
|
+
private root;
|
|
6
|
+
container: Nodes;
|
|
6
7
|
event: EventEmitter;
|
|
7
|
-
constructor(
|
|
8
|
+
constructor(root: Nodes);
|
|
8
9
|
private writeClipboardText;
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private
|
|
10
|
+
private appendCopyButton;
|
|
11
|
+
private appendOpenButton;
|
|
12
|
+
private appendSaveButton;
|
|
13
|
+
private appendUnlinkButton;
|
|
14
|
+
getInputValue(name: string): string;
|
|
15
|
+
setInputValue(name: string, value: string): void;
|
|
12
16
|
save(): void;
|
|
13
17
|
updatePosition(): void;
|
|
18
|
+
render(): void;
|
|
14
19
|
show(linkNode: Nodes): void;
|
|
15
20
|
hide(): void;
|
|
16
21
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import EventEmitter from 'eventemitter3';
|
|
2
1
|
import type { Editor } from '../editor';
|
|
3
2
|
import { NativeNode } from '../types/native';
|
|
4
3
|
import { ToolbarItem } from '../types/toolbar';
|
|
@@ -10,22 +9,14 @@ type ToolbarConfig = {
|
|
|
10
9
|
};
|
|
11
10
|
export declare class Toolbar {
|
|
12
11
|
private items;
|
|
13
|
-
editor
|
|
14
|
-
root
|
|
12
|
+
private editor;
|
|
13
|
+
private root;
|
|
15
14
|
container: Nodes;
|
|
16
|
-
event: EventEmitter;
|
|
17
15
|
constructor(config: ToolbarConfig);
|
|
18
|
-
getValue(node: Nodes): string[];
|
|
19
|
-
setValue(node: Nodes, value: string[]): void;
|
|
20
16
|
private appendDivider;
|
|
21
17
|
private appendButton;
|
|
22
|
-
private getMenuMap;
|
|
23
|
-
private updateColorAccent;
|
|
24
|
-
private addDropdownMenu;
|
|
25
|
-
private bindDropdownEvents;
|
|
26
18
|
private appendDropdown;
|
|
27
19
|
private appendUpload;
|
|
28
|
-
private getUpdateStateHandler;
|
|
29
20
|
render(): void;
|
|
30
21
|
}
|
|
31
22
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function modifierText(value: string, userAgent?: string): string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lakelib",
|
|
3
3
|
"description": "Rich text editor based on the browser",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"author": "Luo Longhao <luolonghao@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "http://lakejs.com",
|
|
@@ -23,59 +23,77 @@
|
|
|
23
23
|
"url": "https://github.com/lakejs/lake/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@codemirror/commands": "^6.3.3",
|
|
27
|
-
"@codemirror/lang-javascript": "^6.2.2",
|
|
28
|
-
"@codemirror/view": "^6.26.0",
|
|
29
26
|
"@types/blueimp-md5": "^2.18.2",
|
|
30
|
-
"@types/lodash": "^4.
|
|
27
|
+
"@types/lodash": "^4.17.0",
|
|
31
28
|
"blueimp-md5": "^2.19.0",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"js-base64": "^3.7.6",
|
|
29
|
+
"eventemitter3": "^5.0.1",
|
|
30
|
+
"js-base64": "^3.7.7",
|
|
35
31
|
"lodash": "^4.17.21",
|
|
36
32
|
"photoswipe": "^5.4.3",
|
|
37
|
-
"tinykeys": "^2.1.0"
|
|
33
|
+
"tinykeys": "^2.1.0",
|
|
34
|
+
"typesafe-i18n": "^5.26.2"
|
|
38
35
|
},
|
|
39
36
|
"devDependencies": {
|
|
37
|
+
"@codemirror/commands": "^6.3.3",
|
|
38
|
+
"@codemirror/lang-cpp": "^6.0.2",
|
|
39
|
+
"@codemirror/lang-css": "^6.2.1",
|
|
40
|
+
"@codemirror/lang-go": "^6.0.0",
|
|
41
|
+
"@codemirror/lang-html": "^6.4.8",
|
|
42
|
+
"@codemirror/lang-java": "^6.0.1",
|
|
43
|
+
"@codemirror/lang-javascript": "^6.2.2",
|
|
44
|
+
"@codemirror/lang-json": "^6.0.1",
|
|
45
|
+
"@codemirror/lang-markdown": "^6.2.4",
|
|
46
|
+
"@codemirror/lang-php": "^6.0.1",
|
|
47
|
+
"@codemirror/lang-python": "^6.1.5",
|
|
48
|
+
"@codemirror/lang-rust": "^6.0.1",
|
|
49
|
+
"@codemirror/lang-sql": "^6.6.3",
|
|
50
|
+
"@codemirror/lang-xml": "^6.1.0",
|
|
51
|
+
"@codemirror/lang-yaml": "^6.1.0",
|
|
52
|
+
"@codemirror/language": "^6.10.1",
|
|
53
|
+
"@codemirror/state": "^6.4.1",
|
|
54
|
+
"@codemirror/view": "^6.26.1",
|
|
55
|
+
"@lezer/highlight": "^1.2.0",
|
|
40
56
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
41
57
|
"@rollup/plugin-json": "^6.1.0",
|
|
42
58
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
43
59
|
"@rollup/plugin-terser": "^0.4.4",
|
|
44
60
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
45
|
-
"@types/chai": "^4.3.
|
|
61
|
+
"@types/chai": "^4.3.14",
|
|
46
62
|
"@types/mocha": "^10.0.6",
|
|
47
63
|
"@types/sinon": "^17.0.3",
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
49
|
-
"@typescript-eslint/parser": "^
|
|
64
|
+
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
|
65
|
+
"@typescript-eslint/parser": "^7.5.0",
|
|
50
66
|
"chai": "^4.4.1",
|
|
51
|
-
"eslint": "^8.
|
|
67
|
+
"eslint": "^8.57.0",
|
|
52
68
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
53
|
-
"eslint-config-prettier": "^
|
|
54
|
-
"express": "^4.
|
|
55
|
-
"mocha": "^10.
|
|
69
|
+
"eslint-config-prettier": "^9.1.0",
|
|
70
|
+
"express": "^4.19.2",
|
|
71
|
+
"mocha": "^10.4.0",
|
|
56
72
|
"multer": "1.4.5-lts.1",
|
|
57
73
|
"npm-run-all": "^4.1.5",
|
|
58
|
-
"puppeteer": "^22.6.
|
|
74
|
+
"puppeteer": "^22.6.2",
|
|
59
75
|
"rimraf": "^5.0.5",
|
|
60
|
-
"rollup": "^
|
|
61
|
-
"rollup-plugin-import-css": "^3.
|
|
76
|
+
"rollup": "^4.14.0",
|
|
77
|
+
"rollup-plugin-import-css": "^3.5.0",
|
|
62
78
|
"rollup-plugin-svg-import": "^3.0.0",
|
|
63
|
-
"simple-git-hooks": "^2.
|
|
79
|
+
"simple-git-hooks": "^2.11.1",
|
|
64
80
|
"sinon": "^17.0.1",
|
|
65
81
|
"tslib": "^2.6.2",
|
|
66
|
-
"typescript": "^5.
|
|
82
|
+
"typescript": "^5.4.4"
|
|
67
83
|
},
|
|
68
|
-
"simple-git-hooks": {
|
|
69
|
-
"pre-commit": "pnpm lint"
|
|
70
|
-
},
|
|
71
|
-
"packageManager": "pnpm@8.7.5",
|
|
72
84
|
"scripts": {
|
|
73
85
|
"start": "npm-run-all --parallel --print-label express watch",
|
|
74
86
|
"express": "node ./scripts/start-server.mjs",
|
|
75
87
|
"watch": "rollup --watch --config rollup.config.mjs",
|
|
76
|
-
"build": "rimraf ./
|
|
88
|
+
"build": "rimraf ./lib & rollup --config rollup.config.mjs",
|
|
89
|
+
"codemirror": "rollup --config rollup.config.mjs --codemirror",
|
|
90
|
+
"i18n": "typesafe-i18n --no-watch",
|
|
77
91
|
"lint": "eslint . --config .eslintrc.cjs --ext \".ts,.js,.cjs,.mjs\"",
|
|
78
92
|
"test": "node ./scripts/run-tests.mjs",
|
|
79
93
|
"clean": "rimraf ./dist ./lib ./temp"
|
|
80
|
-
}
|
|
81
|
-
|
|
94
|
+
},
|
|
95
|
+
"simple-git-hooks": {
|
|
96
|
+
"pre-commit": "pnpm lint"
|
|
97
|
+
},
|
|
98
|
+
"packageManager": "pnpm@8.15.6"
|
|
99
|
+
}
|