lakelib 0.0.1 → 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 +56 -5
- package/dist/codemirror.min.js +1 -1
- package/dist/lake.css +749 -296
- package/dist/lake.min.js +44 -45
- package/dist/lake.min.js.map +1 -0
- package/lib/lake.css +328 -296
- package/lib/lake.js +1913 -1253
- 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 +3 -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 -1328
- package/dist/lake-all.min.js +0 -84
- package/lib/types/codemirror.d.ts +0 -8
package/README.md
CHANGED
|
@@ -2,11 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|
# Lake
|
|
4
4
|
|
|
5
|
-
Lake is a
|
|
5
|
+
Lake is a rich text editor for the web. It has a good user experience and provides easy-to-use programming interface to allow further extension.
|
|
6
6
|
|
|
7
7
|
### Getting Started
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
#### Downloading Lake from CDN
|
|
10
|
+
|
|
11
|
+
Compressed copies of Lake files are available, you can download them from jsDelivr or UNPKG.
|
|
12
|
+
|
|
13
|
+
* jsDelivr: https://www.jsdelivr.com/package/npm/lakelib?path=dist&tab=files
|
|
14
|
+
* UNPKG: https://unpkg.com/browse/lakelib@latest/dist/
|
|
15
|
+
|
|
16
|
+
Note: `lake.min.js` is not built with CodeMirror, so if you need the code block feature, addtioanaly including `codemirror.min.js` to your page is needed. But if you do not need it, there is no need to include external CodeMirror file. To find out more, take a look at the [IIFE example](https://github.com/lakejs/lake/blob/master/examples/iife.html) and [Rollup configuration](https://github.com/lakejs/lake/blob/master/rollup.config.mjs).
|
|
17
|
+
|
|
18
|
+
#### Downloading Lake using npm
|
|
19
|
+
|
|
20
|
+
Lake is registered as a package on npm. You can install the latest version of Lake with the following npm command.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install lakelib
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
#### Quick start
|
|
27
|
+
|
|
28
|
+
First, add the following lines of code in the `<head>` of an HTML page.
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lakelib@latest/dist/lake.css" />
|
|
32
|
+
<script src="https://cdn.jsdelivr.net/npm/lakelib@latest/dist/lake.min.js"></script>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Then, in the HTML page add the following HTML code that will serve as a placeholder for an editor instance.
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<div class="lake-editor">
|
|
39
|
+
<div class="lake-toolbar-root"></div>
|
|
40
|
+
<div class="lake-root"></div>
|
|
41
|
+
</div>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Finally, call the following JavaScript code to render the editor.
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
const editor = new Lake.Editor({
|
|
48
|
+
root: '.lake-root',
|
|
49
|
+
value: '<p><br /><focus /></p>',
|
|
50
|
+
});
|
|
51
|
+
editor.render();
|
|
52
|
+
new Lake.Toolbar({
|
|
53
|
+
editor,
|
|
54
|
+
root: '.lake-toolbar-root',
|
|
55
|
+
}).render();
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Development
|
|
59
|
+
|
|
60
|
+
To build Lake or change source code, you need to download the repository and start a development server that contains an HTTP service and real-time bundling.
|
|
10
61
|
|
|
11
62
|
``` bash
|
|
12
63
|
# clone the repository
|
|
@@ -15,13 +66,13 @@ git clone https://github.com/lakejs/lake.git
|
|
|
15
66
|
cd lake
|
|
16
67
|
# install all dependencies
|
|
17
68
|
pnpm install
|
|
18
|
-
# build
|
|
19
|
-
pnpm
|
|
69
|
+
# build CodeMirror
|
|
70
|
+
pnpm codemirror
|
|
20
71
|
# start a local server
|
|
21
72
|
pnpm start
|
|
22
73
|
```
|
|
23
74
|
|
|
24
|
-
You can now view all demos by
|
|
75
|
+
You can now view all demos by visiting `http://localhost:8080/examples/`.
|
|
25
76
|
|
|
26
77
|
### Running tests
|
|
27
78
|
|