lakelib 0.3.2 → 0.3.4
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 +28 -22
- package/dist/lake.min.css +1 -1
- package/dist/lake.min.js +22 -22
- package/dist/lake.min.js.map +1 -1
- package/lib/lake.css +4 -1
- package/lib/lake.d.ts +2148 -0
- package/lib/lake.js +1211 -605
- package/lib/lake.js.map +1 -1
- package/package.json +30 -33
- package/lib/config/element-rules.d.ts +0 -1
- package/lib/config/menu-items.d.ts +0 -9
- package/lib/config/tag-names.d.ts +0 -6
- package/lib/config/toolbar-items.d.ts +0 -2
- package/lib/css/index.d.ts +0 -17
- package/lib/editor.d.ts +0 -93
- package/lib/elements/bookmark.d.ts +0 -2
- package/lib/elements/box.d.ts +0 -2
- package/lib/i18n/en-US/index.d.ts +0 -169
- package/lib/i18n/index.d.ts +0 -2
- package/lib/i18n/ja/index.d.ts +0 -169
- package/lib/i18n/ko/index.d.ts +0 -169
- package/lib/i18n/types.d.ts +0 -1233
- package/lib/i18n/zh-CN/index.d.ts +0 -169
- package/lib/icons/index.d.ts +0 -1
- package/lib/index.d.ts +0 -35
- package/lib/managers/box-manager.d.ts +0 -6
- package/lib/managers/command.d.ts +0 -23
- package/lib/managers/history.d.ts +0 -32
- package/lib/managers/keystroke.d.ts +0 -11
- package/lib/managers/plugin.d.ts +0 -7
- package/lib/managers/selection.d.ts +0 -40
- package/lib/models/box.d.ts +0 -25
- package/lib/models/fragment.d.ts +0 -8
- package/lib/models/nodes.d.ts +0 -98
- package/lib/models/range.d.ts +0 -56
- package/lib/operations/add-mark.d.ts +0 -3
- package/lib/operations/delete-contents.d.ts +0 -2
- package/lib/operations/insert-block.d.ts +0 -3
- package/lib/operations/insert-bookmark.d.ts +0 -6
- package/lib/operations/insert-box.d.ts +0 -4
- package/lib/operations/insert-contents.d.ts +0 -4
- package/lib/operations/remove-box.d.ts +0 -3
- package/lib/operations/remove-mark.d.ts +0 -2
- package/lib/operations/set-blocks.d.ts +0 -3
- package/lib/operations/split-block.d.ts +0 -3
- package/lib/operations/split-marks.d.ts +0 -3
- package/lib/operations/to-bookmark.d.ts +0 -6
- package/lib/parsers/html-parser.d.ts +0 -13
- package/lib/parsers/text-parser.d.ts +0 -6
- package/lib/plugins/align.d.ts +0 -3
- package/lib/plugins/arrow-keys.d.ts +0 -3
- package/lib/plugins/backspace-key.d.ts +0 -3
- package/lib/plugins/block-quote.d.ts +0 -3
- package/lib/plugins/bold.d.ts +0 -3
- package/lib/plugins/code-block/code-block-box.d.ts +0 -4
- package/lib/plugins/code-block/index.d.ts +0 -5
- package/lib/plugins/code.d.ts +0 -3
- package/lib/plugins/copy.d.ts +0 -3
- package/lib/plugins/cut.d.ts +0 -3
- package/lib/plugins/delete-key.d.ts +0 -3
- package/lib/plugins/drop.d.ts +0 -3
- package/lib/plugins/emoji/emoji-box.d.ts +0 -4
- package/lib/plugins/emoji/index.d.ts +0 -5
- package/lib/plugins/enter-key.d.ts +0 -3
- package/lib/plugins/equation/equation-box.d.ts +0 -4
- package/lib/plugins/equation/index.d.ts +0 -5
- package/lib/plugins/escape-key.d.ts +0 -3
- package/lib/plugins/file/file-box.d.ts +0 -4
- package/lib/plugins/file/index.d.ts +0 -5
- package/lib/plugins/font-color.d.ts +0 -3
- package/lib/plugins/font-family.d.ts +0 -3
- package/lib/plugins/font-size.d.ts +0 -3
- package/lib/plugins/format-painter.d.ts +0 -3
- package/lib/plugins/heading.d.ts +0 -3
- package/lib/plugins/highlight.d.ts +0 -3
- package/lib/plugins/hr/hr-box.d.ts +0 -4
- package/lib/plugins/hr/index.d.ts +0 -5
- package/lib/plugins/image/image-box.d.ts +0 -5
- package/lib/plugins/image/index.d.ts +0 -5
- package/lib/plugins/indent.d.ts +0 -3
- package/lib/plugins/italic.d.ts +0 -3
- package/lib/plugins/link/index.d.ts +0 -3
- package/lib/plugins/link/insert-link.d.ts +0 -3
- package/lib/plugins/link/link-popup.d.ts +0 -32
- package/lib/plugins/list.d.ts +0 -3
- package/lib/plugins/markdown.d.ts +0 -3
- package/lib/plugins/mention/index.d.ts +0 -5
- package/lib/plugins/mention/mention-box.d.ts +0 -4
- package/lib/plugins/mention/mention-menu.d.ts +0 -15
- package/lib/plugins/mention/types.d.ts +0 -6
- package/lib/plugins/paste.d.ts +0 -3
- package/lib/plugins/redo.d.ts +0 -3
- package/lib/plugins/remove-format.d.ts +0 -3
- package/lib/plugins/select-all.d.ts +0 -3
- package/lib/plugins/shift-enter-key.d.ts +0 -3
- package/lib/plugins/slash/index.d.ts +0 -3
- package/lib/plugins/slash/slash-items.d.ts +0 -2
- package/lib/plugins/slash/slash-menu.d.ts +0 -19
- package/lib/plugins/slash/types.d.ts +0 -20
- package/lib/plugins/special-character.d.ts +0 -3
- package/lib/plugins/strikethrough.d.ts +0 -3
- package/lib/plugins/subscript.d.ts +0 -3
- package/lib/plugins/superscript.d.ts +0 -3
- package/lib/plugins/tab-key.d.ts +0 -3
- package/lib/plugins/table/delete-column.d.ts +0 -2
- package/lib/plugins/table/delete-row.d.ts +0 -2
- package/lib/plugins/table/delete-table.d.ts +0 -2
- package/lib/plugins/table/index.d.ts +0 -4
- package/lib/plugins/table/insert-column.d.ts +0 -4
- package/lib/plugins/table/insert-row.d.ts +0 -4
- package/lib/plugins/table/insert-table.d.ts +0 -3
- package/lib/plugins/table/merge-cells.d.ts +0 -3
- package/lib/plugins/table/split-cell.d.ts +0 -3
- package/lib/plugins/table/utils.d.ts +0 -6
- package/lib/plugins/underline.d.ts +0 -3
- package/lib/plugins/undo.d.ts +0 -3
- package/lib/plugins/unlink.d.ts +0 -3
- package/lib/plugins/video/index.d.ts +0 -5
- package/lib/plugins/video/video-box.d.ts +0 -4
- package/lib/storage/box-instances.d.ts +0 -2
- package/lib/storage/boxes.d.ts +0 -2
- package/lib/storage/editors.d.ts +0 -2
- package/lib/types/box.d.ts +0 -15
- package/lib/types/corner-toolbar.d.ts +0 -7
- package/lib/types/dropdown.d.ts +0 -23
- package/lib/types/native.d.ts +0 -2
- package/lib/types/node.d.ts +0 -13
- package/lib/types/object.d.ts +0 -3
- package/lib/types/plugin.d.ts +0 -3
- package/lib/types/request.d.ts +0 -20
- package/lib/types/selection.d.ts +0 -14
- package/lib/types/toolbar.d.ts +0 -29
- package/lib/ui/button.d.ts +0 -19
- package/lib/ui/corner-toolbar.d.ts +0 -18
- package/lib/ui/dropdown.d.ts +0 -36
- package/lib/ui/floating-toolbar.d.ts +0 -16
- package/lib/ui/menu.d.ts +0 -33
- package/lib/ui/resizer.d.ts +0 -17
- package/lib/ui/toolbar.d.ts +0 -29
- package/lib/utils/append-break.d.ts +0 -2
- package/lib/utils/camel-case.d.ts +0 -1
- package/lib/utils/change-tag-name.d.ts +0 -2
- package/lib/utils/debug.d.ts +0 -1
- package/lib/utils/denormalize-value.d.ts +0 -1
- package/lib/utils/encode.d.ts +0 -1
- package/lib/utils/file-size.d.ts +0 -1
- package/lib/utils/fix-numbered-list.d.ts +0 -2
- package/lib/utils/from-base64.d.ts +0 -1
- package/lib/utils/get-box.d.ts +0 -3
- package/lib/utils/get-css.d.ts +0 -1
- package/lib/utils/get-deep-element.d.ts +0 -2
- package/lib/utils/in-string.d.ts +0 -1
- package/lib/utils/indent-block.d.ts +0 -2
- package/lib/utils/merge-nodes.d.ts +0 -5
- package/lib/utils/modifier-text.d.ts +0 -1
- package/lib/utils/morph.d.ts +0 -56
- package/lib/utils/normalize-value.d.ts +0 -1
- package/lib/utils/parse-style.d.ts +0 -2
- package/lib/utils/query.d.ts +0 -2
- package/lib/utils/remove-break.d.ts +0 -2
- package/lib/utils/remove-empty-marks.d.ts +0 -2
- package/lib/utils/remove-zws.d.ts +0 -2
- package/lib/utils/request.d.ts +0 -27
- package/lib/utils/scroll-to-node.d.ts +0 -2
- package/lib/utils/split-nodes.d.ts +0 -5
- package/lib/utils/template.d.ts +0 -1
- package/lib/utils/to-base64.d.ts +0 -1
- package/lib/utils/to-hex.d.ts +0 -1
- package/lib/utils/to-node-list.d.ts +0 -1
- package/lib/utils/unsafe-template.d.ts +0 -1
- package/lib/utils/upload-file.d.ts +0 -11
- package/lib/utils/visible-info.d.ts +0 -10
- package/lib/utils/wrap-node-list.d.ts +0 -2
package/README.md
CHANGED
|
@@ -6,44 +6,50 @@
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
Lake is a browser-based rich text editor
|
|
9
|
+
Lake is a browser-based rich text editor built for modern applications that require content creation like blog posts, user comments, and email composition. It aims to provide as many features as possible through a simple structure while remaining free for commercial use.
|
|
10
10
|
|
|
11
11
|
[Examples](https://lakejs.org/examples/) · [Getting started](https://lakejs.org/guide/) · [Reference](https://lakejs.org/reference/)
|
|
12
12
|
|
|
13
13
|
## Development
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Want to customize Lake? Follow these steps to set up a local development environment:
|
|
16
16
|
|
|
17
17
|
``` bash
|
|
18
18
|
# Clone the repository
|
|
19
19
|
git clone https://github.com/lakejs/lake.git
|
|
20
|
+
|
|
20
21
|
# Install dependencies
|
|
21
22
|
pnpm install
|
|
22
|
-
|
|
23
|
+
|
|
24
|
+
# Start the development server
|
|
23
25
|
pnpm dev
|
|
24
26
|
```
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
Once the server is running, you can open `http://localhost:8080/examples/` to try the demos.
|
|
29
|
+
|
|
30
|
+
## Testing
|
|
31
|
+
|
|
32
|
+
Since Lake relies on various browser APIs, tests need to run in a real browser environment. You have two options:
|
|
27
33
|
|
|
28
|
-
|
|
34
|
+
* Open `http://localhost:8080/tests/` to run tests in a visible browser window.
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
* Run tests in headless mode with the `pnpm test` command.
|
|
31
37
|
|
|
32
38
|
## License
|
|
33
39
|
|
|
34
|
-
Lake is released under the [MIT](https://github.com/lakejs/lake/blob/main/LICENSE) license.
|
|
35
|
-
|
|
36
|
-
| Dependency | License |
|
|
37
|
-
| ------------- | ------------- |
|
|
38
|
-
| [Phosphor Icons](https://phosphoricons.com/) | MIT |
|
|
39
|
-
| [Fluent Icons](https://fluenticons.co/) | MIT |
|
|
40
|
-
| [CodeMirror](https://codemirror.net/) | MIT |
|
|
41
|
-
| [debounce](https://github.com/sindresorhus/debounce) | MIT |
|
|
42
|
-
| [EventEmitter3](https://github.com/primus/eventemitter3) | MIT |
|
|
43
|
-
| [fast-deep-equal](https://github.com/epoberezkin/fast-deep-equal) | MIT |
|
|
44
|
-
| [Idiomorph](https://github.com/bigskysoftware/idiomorph) | BSD 2-Clause |
|
|
45
|
-
| [is-hotkey](https://github.com/ianstormtaylor/is-hotkey) | MIT |
|
|
46
|
-
| [KaTeX](https://katex.org/) | MIT |
|
|
47
|
-
| [rc-upload](https://github.com/react-component/upload) | MIT |
|
|
48
|
-
| [PhotoSwipe](https://photoswipe.com/) | MIT |
|
|
49
|
-
| [typesafe-i18n](https://github.com/ivanhofer/typesafe-i18n) | MIT |
|
|
40
|
+
Lake is released under the [MIT](https://github.com/lakejs/lake/blob/main/LICENSE) license. Below is a list of licenses for its dependencies:
|
|
41
|
+
|
|
42
|
+
| Dependency | License | Author |
|
|
43
|
+
| ------------- | ------------- | ------------- |
|
|
44
|
+
| [Phosphor Icons](https://phosphoricons.com/) | MIT | Tobias Fried |
|
|
45
|
+
| [Fluent Icons](https://fluenticons.co/) | MIT | Microsoft |
|
|
46
|
+
| [CodeMirror](https://codemirror.net/) | MIT | Marijn Haverbeke |
|
|
47
|
+
| [debounce](https://github.com/sindresorhus/debounce) | MIT | Sindre Sorhus |
|
|
48
|
+
| [EventEmitter3](https://github.com/primus/eventemitter3) | MIT | Arnout Kazemier |
|
|
49
|
+
| [fast-deep-equal](https://github.com/epoberezkin/fast-deep-equal) | MIT | Evgeny Poberezkin |
|
|
50
|
+
| [Idiomorph](https://github.com/bigskysoftware/idiomorph) | BSD 2-Clause | Big Sky Software |
|
|
51
|
+
| [is-hotkey](https://github.com/ianstormtaylor/is-hotkey) | MIT | Ian Storm Taylor |
|
|
52
|
+
| [KaTeX](https://katex.org/) | MIT | Khan Academy |
|
|
53
|
+
| [rc-upload](https://github.com/react-component/upload) | MIT | Ant Design Team |
|
|
54
|
+
| [PhotoSwipe](https://photoswipe.com/) | MIT | Dmitry Semenov |
|
|
55
|
+
| [typesafe-i18n](https://github.com/ivanhofer/typesafe-i18n) | MIT | Hofer Ivan |
|
package/dist/lake.min.css
CHANGED
|
@@ -27,4 +27,4 @@ lake-box[name=hr]{margin-bottom:8px}.lake-hr{height:21px;display:flex;align-item
|
|
|
27
27
|
.lake-equation{position:relative;font-weight:400;border:1px solid transparent;border-radius:4px}.lake-container[contenteditable=true] .lake-equation{user-select:none}lake-box[name=equation] .lake-box-strip{align-self:center}lake-box[name=equation] .lake-box-selected .lake-equation{background-color:var(--lake-selection-background-color)}lake-box[name=equation] .lake-box-focused .lake-equation{background-color:var(--lake-selection-background-color)}.lake-equation .lake-equation-view{padding:0 6px}.lake-equation .lake-equation-form{position:absolute;top:28px;left:0;z-index:1;border:1px solid var(--lake-border-color);border-radius:5px;padding:16px;width:fit-content;background-color:#fff;box-shadow:var(--lake-popup-shadow);display:none}lake-box[name=equation] .lake-box-activated .lake-equation-form,lake-box[name=equation] .lake-box-focused .lake-equation-form{display:flex}.lake-equation .lake-equation-form textarea{border:0;font-family:Consolas,Courier,monospace;font-size:14px;color:var(--lake-text-color);padding:0;margin-right:8px;width:300px;height:80px;resize:none;scrollbar-width:thin}.lake-equation .lake-equation-form textarea:focus-visible{outline:0}.lake-equation .lake-equation-form .lake-button-row{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end}.lake-equation-error{padding:0 6px;font-size:14px;color:var(--lake-error-color);background-color:var(--lake-box-background-color)}
|
|
28
28
|
.lake-mention-menu{max-height:208px}.lake-mention-menu .lake-mention-avatar{margin-inline-end:8px;line-height:0}.lake-mention-menu .lake-mention-avatar img{border-radius:100%;width:32px;height:32px}.lake-mention-menu .lake-mention-nickname{margin-inline-end:4px;font-weight:500;color:var(--lake-text-color);white-space:nowrap}.lake-mention-menu .lake-mention-name{color:#8c8c8c}
|
|
29
29
|
.lake-mention{border:1px solid transparent;border-radius:2px}.lake-container[readonly=false] .lake-mention a:hover{color:var(--lake-link-color);text-decoration:none}lake-box[name=mention] .lake-box-focused .lake-mention{border-color:var(--lake-selection-background-color);background-color:var(--lake-selection-background-color)}
|
|
30
|
-
.lake-slash-menu{max-height:
|
|
30
|
+
.lake-slash-menu{max-height:332px}.lake-slash-menu .lake-menu-item{height:54px}.lake-slash-menu .lake-menu-item input[type=file]{display:none}.lake-slash-menu .lake-slash-icon{margin-inline-end:8px;border-radius:5px;border:1px solid var(--lake-border-color);background-color:#fff;line-height:0}.lake-slash-menu .lake-slash-icon img,.lake-slash-menu .lake-slash-icon svg{width:32px;height:32px;margin:6px}.lake-slash-menu .lake-slash-text{display:flex;flex-direction:column;justify-content:center}.lake-slash-menu .lake-slash-title{font-weight:500;color:var(--lake-text-color)}.lake-slash-menu .lake-slash-description{color:#8c8c8c}
|