lakelib 0.0.5 → 0.0.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 +2 -2
- package/dist/lake.min.js +20 -20
- package/dist/lake.min.js.map +1 -1
- package/lib/lake.js +59 -24
- package/lib/lake.js.map +1 -1
- package/lib/types/editor.d.ts +1 -0
- package/lib/types/managers/history.d.ts +1 -1
- package/lib/types/types/object.d.ts +6 -0
- package/lib/types/ui/toolbar.d.ts +2 -8
- package/package.json +18 -13
package/lib/types/editor.d.ts
CHANGED
|
@@ -19,3 +19,9 @@ export type AppliedItem = {
|
|
|
19
19
|
attributes: KeyValue;
|
|
20
20
|
styles: KeyValue;
|
|
21
21
|
};
|
|
22
|
+
export type StateData = {
|
|
23
|
+
appliedItems: AppliedItem[];
|
|
24
|
+
disabledNameMap: Map<string, boolean>;
|
|
25
|
+
selectedNameMap: Map<string, boolean>;
|
|
26
|
+
selectedValuesMap: Map<string, string[]>;
|
|
27
|
+
};
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import type { Editor } from '../editor';
|
|
2
2
|
import { NativeNode } from '../types/native';
|
|
3
|
-
import {
|
|
3
|
+
import { StateData } from '../types/object';
|
|
4
4
|
import { ToolbarItem } from '../types/toolbar';
|
|
5
5
|
import { Nodes } from '../models/nodes';
|
|
6
6
|
type ToolbarConfig = {
|
|
7
7
|
root: string | Nodes | NativeNode;
|
|
8
8
|
items?: (string | ToolbarItem)[];
|
|
9
9
|
};
|
|
10
|
-
type StateData = {
|
|
11
|
-
appliedItems: AppliedItem[];
|
|
12
|
-
disabledNameMap: Map<string, boolean>;
|
|
13
|
-
selectedNameMap: Map<string, boolean>;
|
|
14
|
-
selectedValuesMap: Map<string, string[]>;
|
|
15
|
-
};
|
|
16
10
|
export declare class Toolbar {
|
|
17
11
|
private items;
|
|
18
12
|
private root;
|
|
@@ -25,7 +19,7 @@ export declare class Toolbar {
|
|
|
25
19
|
private appendButton;
|
|
26
20
|
private appendDropdown;
|
|
27
21
|
private appendUpload;
|
|
28
|
-
updateState(
|
|
22
|
+
updateState(stateData: StateData): void;
|
|
29
23
|
render(editor: Editor): void;
|
|
30
24
|
}
|
|
31
25
|
export {};
|
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.6",
|
|
5
5
|
"author": "Luo Longhao <luolonghao@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "http://lakejs.com",
|
|
@@ -68,33 +68,38 @@
|
|
|
68
68
|
"eslint": "^8.57.0",
|
|
69
69
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
70
70
|
"eslint-config-prettier": "^9.1.0",
|
|
71
|
+
"execa": "^8.0.1",
|
|
71
72
|
"express": "^4.19.2",
|
|
72
73
|
"mocha": "^10.4.0",
|
|
73
74
|
"multer": "1.4.5-lts.1",
|
|
74
75
|
"npm-run-all": "^4.1.5",
|
|
76
|
+
"picocolors": "^1.0.0",
|
|
77
|
+
"prompts": "^2.4.2",
|
|
75
78
|
"puppeteer": "^22.6.2",
|
|
76
79
|
"rimraf": "^5.0.5",
|
|
77
80
|
"rollup": "^4.14.0",
|
|
78
81
|
"rollup-plugin-import-css": "^3.5.0",
|
|
79
82
|
"rollup-plugin-svg-import": "^3.0.0",
|
|
83
|
+
"semver": "^7.6.0",
|
|
80
84
|
"simple-git-hooks": "^2.11.1",
|
|
81
85
|
"sinon": "^17.0.1",
|
|
82
86
|
"tslib": "^2.6.2",
|
|
83
87
|
"typescript": "^5.4.4"
|
|
84
88
|
},
|
|
89
|
+
"simple-git-hooks": {
|
|
90
|
+
"pre-commit": "pnpm lint"
|
|
91
|
+
},
|
|
92
|
+
"packageManager": "pnpm@8.15.6",
|
|
85
93
|
"scripts": {
|
|
86
|
-
"
|
|
87
|
-
"express": "node ./scripts/start-server.mjs",
|
|
88
|
-
"
|
|
89
|
-
"build": "rimraf ./lib
|
|
90
|
-
"
|
|
94
|
+
"dev": "npm-run-all --parallel --print-label dev:express dev:rollup",
|
|
95
|
+
"dev:express": "node ./scripts/start-server.mjs",
|
|
96
|
+
"dev:rollup": "rollup --watch --config rollup.config.mjs",
|
|
97
|
+
"build": "rimraf ./dist ./lib && pnpm build:lake && pnpm build:codemirror",
|
|
98
|
+
"build:lake": "rollup --config rollup.config.mjs",
|
|
99
|
+
"build:codemirror": "rollup --config rollup.config.mjs --codemirror",
|
|
91
100
|
"i18n": "typesafe-i18n --no-watch",
|
|
92
101
|
"lint": "eslint . --config .eslintrc.cjs --ext \".ts,.js,.cjs,.mjs\"",
|
|
93
102
|
"test": "node ./scripts/run-tests.mjs",
|
|
94
|
-
"
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
"pre-commit": "pnpm lint"
|
|
98
|
-
},
|
|
99
|
-
"packageManager": "pnpm@8.15.6"
|
|
100
|
-
}
|
|
103
|
+
"release": "node ./scripts/release.mjs"
|
|
104
|
+
}
|
|
105
|
+
}
|