lakelib 0.3.3 → 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.
Files changed (173) hide show
  1. package/README.md +28 -22
  2. package/dist/lake.min.css +1 -1
  3. package/dist/lake.min.js +22 -22
  4. package/dist/lake.min.js.map +1 -1
  5. package/lib/lake.css +4 -1
  6. package/lib/lake.d.ts +2148 -0
  7. package/lib/lake.js +1211 -602
  8. package/lib/lake.js.map +1 -1
  9. package/package.json +30 -33
  10. package/lib/config/element-rules.d.ts +0 -1
  11. package/lib/config/menu-items.d.ts +0 -9
  12. package/lib/config/tag-names.d.ts +0 -6
  13. package/lib/config/toolbar-items.d.ts +0 -2
  14. package/lib/css/index.d.ts +0 -17
  15. package/lib/editor.d.ts +0 -93
  16. package/lib/elements/bookmark.d.ts +0 -2
  17. package/lib/elements/box.d.ts +0 -2
  18. package/lib/i18n/en-US/index.d.ts +0 -169
  19. package/lib/i18n/index.d.ts +0 -2
  20. package/lib/i18n/ja/index.d.ts +0 -169
  21. package/lib/i18n/ko/index.d.ts +0 -169
  22. package/lib/i18n/types.d.ts +0 -1233
  23. package/lib/i18n/zh-CN/index.d.ts +0 -169
  24. package/lib/icons/index.d.ts +0 -1
  25. package/lib/index.d.ts +0 -35
  26. package/lib/managers/box-manager.d.ts +0 -6
  27. package/lib/managers/command.d.ts +0 -23
  28. package/lib/managers/history.d.ts +0 -32
  29. package/lib/managers/keystroke.d.ts +0 -11
  30. package/lib/managers/plugin.d.ts +0 -7
  31. package/lib/managers/selection.d.ts +0 -40
  32. package/lib/models/box.d.ts +0 -25
  33. package/lib/models/fragment.d.ts +0 -8
  34. package/lib/models/nodes.d.ts +0 -98
  35. package/lib/models/range.d.ts +0 -56
  36. package/lib/operations/add-mark.d.ts +0 -3
  37. package/lib/operations/delete-contents.d.ts +0 -2
  38. package/lib/operations/insert-block.d.ts +0 -3
  39. package/lib/operations/insert-bookmark.d.ts +0 -6
  40. package/lib/operations/insert-box.d.ts +0 -4
  41. package/lib/operations/insert-contents.d.ts +0 -4
  42. package/lib/operations/remove-box.d.ts +0 -3
  43. package/lib/operations/remove-mark.d.ts +0 -2
  44. package/lib/operations/set-blocks.d.ts +0 -3
  45. package/lib/operations/split-block.d.ts +0 -3
  46. package/lib/operations/split-marks.d.ts +0 -3
  47. package/lib/operations/to-bookmark.d.ts +0 -6
  48. package/lib/parsers/html-parser.d.ts +0 -13
  49. package/lib/parsers/text-parser.d.ts +0 -6
  50. package/lib/plugins/align.d.ts +0 -3
  51. package/lib/plugins/arrow-keys.d.ts +0 -3
  52. package/lib/plugins/backspace-key.d.ts +0 -3
  53. package/lib/plugins/block-quote.d.ts +0 -3
  54. package/lib/plugins/bold.d.ts +0 -3
  55. package/lib/plugins/code-block/code-block-box.d.ts +0 -4
  56. package/lib/plugins/code-block/index.d.ts +0 -5
  57. package/lib/plugins/code.d.ts +0 -3
  58. package/lib/plugins/copy.d.ts +0 -3
  59. package/lib/plugins/cut.d.ts +0 -3
  60. package/lib/plugins/delete-key.d.ts +0 -3
  61. package/lib/plugins/drop.d.ts +0 -3
  62. package/lib/plugins/emoji/emoji-box.d.ts +0 -4
  63. package/lib/plugins/emoji/index.d.ts +0 -5
  64. package/lib/plugins/enter-key.d.ts +0 -3
  65. package/lib/plugins/equation/equation-box.d.ts +0 -4
  66. package/lib/plugins/equation/index.d.ts +0 -5
  67. package/lib/plugins/escape-key.d.ts +0 -3
  68. package/lib/plugins/file/file-box.d.ts +0 -4
  69. package/lib/plugins/file/index.d.ts +0 -5
  70. package/lib/plugins/font-color.d.ts +0 -3
  71. package/lib/plugins/font-family.d.ts +0 -3
  72. package/lib/plugins/font-size.d.ts +0 -3
  73. package/lib/plugins/format-painter.d.ts +0 -3
  74. package/lib/plugins/heading.d.ts +0 -3
  75. package/lib/plugins/highlight.d.ts +0 -3
  76. package/lib/plugins/hr/hr-box.d.ts +0 -4
  77. package/lib/plugins/hr/index.d.ts +0 -5
  78. package/lib/plugins/image/image-box.d.ts +0 -5
  79. package/lib/plugins/image/index.d.ts +0 -5
  80. package/lib/plugins/indent.d.ts +0 -3
  81. package/lib/plugins/italic.d.ts +0 -3
  82. package/lib/plugins/link/index.d.ts +0 -3
  83. package/lib/plugins/link/insert-link.d.ts +0 -3
  84. package/lib/plugins/link/link-popup.d.ts +0 -32
  85. package/lib/plugins/list.d.ts +0 -3
  86. package/lib/plugins/markdown.d.ts +0 -3
  87. package/lib/plugins/mention/index.d.ts +0 -5
  88. package/lib/plugins/mention/mention-box.d.ts +0 -4
  89. package/lib/plugins/mention/mention-menu.d.ts +0 -15
  90. package/lib/plugins/mention/types.d.ts +0 -6
  91. package/lib/plugins/paste.d.ts +0 -3
  92. package/lib/plugins/redo.d.ts +0 -3
  93. package/lib/plugins/remove-format.d.ts +0 -3
  94. package/lib/plugins/select-all.d.ts +0 -3
  95. package/lib/plugins/shift-enter-key.d.ts +0 -3
  96. package/lib/plugins/slash/index.d.ts +0 -3
  97. package/lib/plugins/slash/slash-items.d.ts +0 -2
  98. package/lib/plugins/slash/slash-menu.d.ts +0 -19
  99. package/lib/plugins/slash/types.d.ts +0 -20
  100. package/lib/plugins/special-character.d.ts +0 -3
  101. package/lib/plugins/strikethrough.d.ts +0 -3
  102. package/lib/plugins/subscript.d.ts +0 -3
  103. package/lib/plugins/superscript.d.ts +0 -3
  104. package/lib/plugins/tab-key.d.ts +0 -3
  105. package/lib/plugins/table/delete-column.d.ts +0 -2
  106. package/lib/plugins/table/delete-row.d.ts +0 -2
  107. package/lib/plugins/table/delete-table.d.ts +0 -2
  108. package/lib/plugins/table/index.d.ts +0 -4
  109. package/lib/plugins/table/insert-column.d.ts +0 -4
  110. package/lib/plugins/table/insert-row.d.ts +0 -4
  111. package/lib/plugins/table/insert-table.d.ts +0 -3
  112. package/lib/plugins/table/merge-cells.d.ts +0 -3
  113. package/lib/plugins/table/split-cell.d.ts +0 -3
  114. package/lib/plugins/table/utils.d.ts +0 -6
  115. package/lib/plugins/underline.d.ts +0 -3
  116. package/lib/plugins/undo.d.ts +0 -3
  117. package/lib/plugins/unlink.d.ts +0 -3
  118. package/lib/plugins/video/index.d.ts +0 -5
  119. package/lib/plugins/video/video-box.d.ts +0 -4
  120. package/lib/storage/box-instances.d.ts +0 -2
  121. package/lib/storage/boxes.d.ts +0 -2
  122. package/lib/storage/editors.d.ts +0 -2
  123. package/lib/types/box.d.ts +0 -15
  124. package/lib/types/corner-toolbar.d.ts +0 -7
  125. package/lib/types/dropdown.d.ts +0 -23
  126. package/lib/types/native.d.ts +0 -2
  127. package/lib/types/node.d.ts +0 -13
  128. package/lib/types/object.d.ts +0 -3
  129. package/lib/types/plugin.d.ts +0 -3
  130. package/lib/types/request.d.ts +0 -20
  131. package/lib/types/selection.d.ts +0 -14
  132. package/lib/types/toolbar.d.ts +0 -29
  133. package/lib/ui/button.d.ts +0 -19
  134. package/lib/ui/corner-toolbar.d.ts +0 -18
  135. package/lib/ui/dropdown.d.ts +0 -36
  136. package/lib/ui/floating-toolbar.d.ts +0 -16
  137. package/lib/ui/menu.d.ts +0 -33
  138. package/lib/ui/resizer.d.ts +0 -17
  139. package/lib/ui/toolbar.d.ts +0 -29
  140. package/lib/utils/append-break.d.ts +0 -2
  141. package/lib/utils/camel-case.d.ts +0 -1
  142. package/lib/utils/change-tag-name.d.ts +0 -2
  143. package/lib/utils/debug.d.ts +0 -1
  144. package/lib/utils/denormalize-value.d.ts +0 -1
  145. package/lib/utils/encode.d.ts +0 -1
  146. package/lib/utils/file-size.d.ts +0 -1
  147. package/lib/utils/fix-numbered-list.d.ts +0 -2
  148. package/lib/utils/from-base64.d.ts +0 -1
  149. package/lib/utils/get-box.d.ts +0 -3
  150. package/lib/utils/get-css.d.ts +0 -1
  151. package/lib/utils/get-deep-element.d.ts +0 -2
  152. package/lib/utils/in-string.d.ts +0 -1
  153. package/lib/utils/indent-block.d.ts +0 -2
  154. package/lib/utils/merge-nodes.d.ts +0 -5
  155. package/lib/utils/modifier-text.d.ts +0 -1
  156. package/lib/utils/morph.d.ts +0 -56
  157. package/lib/utils/normalize-value.d.ts +0 -1
  158. package/lib/utils/parse-style.d.ts +0 -2
  159. package/lib/utils/query.d.ts +0 -2
  160. package/lib/utils/remove-break.d.ts +0 -2
  161. package/lib/utils/remove-empty-marks.d.ts +0 -2
  162. package/lib/utils/remove-zws.d.ts +0 -2
  163. package/lib/utils/request.d.ts +0 -27
  164. package/lib/utils/scroll-to-node.d.ts +0 -2
  165. package/lib/utils/split-nodes.d.ts +0 -5
  166. package/lib/utils/template.d.ts +0 -1
  167. package/lib/utils/to-base64.d.ts +0 -1
  168. package/lib/utils/to-hex.d.ts +0 -1
  169. package/lib/utils/to-node-list.d.ts +0 -1
  170. package/lib/utils/unsafe-template.d.ts +0 -1
  171. package/lib/utils/upload-file.d.ts +0 -11
  172. package/lib/utils/visible-info.d.ts +0 -10
  173. 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 designed for creating content such as blogs, comments, and emails. It tries to keep a balance between being feature-rich and lightweight, offering an easy-to-use programming interface for further extension.
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
- If you want to customize Lake, download the source code and run a local server that includes an HTTP service and real-time bundling.
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
- # Start a local server
23
+
24
+ # Start the development server
23
25
  pnpm dev
24
26
  ```
25
27
 
26
- You can now visit `http://localhost:8080/examples/` to try the demos in your local environment.
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
- ## Test
34
+ * Open `http://localhost:8080/tests/` to run tests in a visible browser window.
29
35
 
30
- Lake depends on many browser APIs, so running its test cases needs a real browser environment. You can run the tests visibly by visiting `http://localhost:8080/tests/`, or execute the `pnpm test` command to run them in headless mode.
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. The following table shows the licenses of the packages that Lake depends on.
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:330px}.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}
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}