lakelib 0.0.1

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 (126) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -0
  3. package/dist/codemirror.min.js +1 -0
  4. package/dist/lake-all.css +1328 -0
  5. package/dist/lake-all.min.js +84 -0
  6. package/dist/lake.css +907 -0
  7. package/dist/lake.min.js +75 -0
  8. package/lib/lake.css +907 -0
  9. package/lib/lake.js +8315 -0
  10. package/lib/types/boxes/code-block.d.ts +2 -0
  11. package/lib/types/boxes/hr.d.ts +2 -0
  12. package/lib/types/boxes/image.d.ts +3 -0
  13. package/lib/types/codemirror.d.ts +8 -0
  14. package/lib/types/config/element-rules.d.ts +1 -0
  15. package/lib/types/config/menu-items.d.ts +9 -0
  16. package/lib/types/config/tag-names.d.ts +6 -0
  17. package/lib/types/config/toolbar-items.d.ts +2 -0
  18. package/lib/types/css/index.d.ts +15 -0
  19. package/lib/types/editor.d.ts +73 -0
  20. package/lib/types/elements/bookmark.d.ts +2 -0
  21. package/lib/types/elements/box.d.ts +2 -0
  22. package/lib/types/icons/index.d.ts +1 -0
  23. package/lib/types/index.d.ts +29 -0
  24. package/lib/types/managers/box-manager.d.ts +13 -0
  25. package/lib/types/managers/command.d.ts +11 -0
  26. package/lib/types/managers/history.d.ts +26 -0
  27. package/lib/types/managers/keystroke.d.ts +12 -0
  28. package/lib/types/managers/plugin.d.ts +9 -0
  29. package/lib/types/managers/selection.d.ts +41 -0
  30. package/lib/types/models/box.d.ts +28 -0
  31. package/lib/types/models/fragment.d.ts +7 -0
  32. package/lib/types/models/nodes.d.ts +96 -0
  33. package/lib/types/models/range.d.ts +53 -0
  34. package/lib/types/operations/add-mark.d.ts +3 -0
  35. package/lib/types/operations/delete-contents.d.ts +2 -0
  36. package/lib/types/operations/fix-list.d.ts +2 -0
  37. package/lib/types/operations/insert-bookmark.d.ts +6 -0
  38. package/lib/types/operations/insert-box.d.ts +4 -0
  39. package/lib/types/operations/insert-contents.d.ts +2 -0
  40. package/lib/types/operations/insert-fragment.d.ts +2 -0
  41. package/lib/types/operations/insert-link.d.ts +3 -0
  42. package/lib/types/operations/insert-node.d.ts +4 -0
  43. package/lib/types/operations/remove-box.d.ts +3 -0
  44. package/lib/types/operations/remove-mark.d.ts +2 -0
  45. package/lib/types/operations/set-blocks.d.ts +3 -0
  46. package/lib/types/operations/split-block.d.ts +3 -0
  47. package/lib/types/operations/split-marks.d.ts +3 -0
  48. package/lib/types/operations/to-bookmark.d.ts +6 -0
  49. package/lib/types/parsers/html-parser.d.ts +14 -0
  50. package/lib/types/parsers/text-parser.d.ts +6 -0
  51. package/lib/types/plugins/align.d.ts +3 -0
  52. package/lib/types/plugins/arrow-keys.d.ts +3 -0
  53. package/lib/types/plugins/backspace-key.d.ts +3 -0
  54. package/lib/types/plugins/block-quote.d.ts +3 -0
  55. package/lib/types/plugins/bold.d.ts +3 -0
  56. package/lib/types/plugins/code-block.d.ts +3 -0
  57. package/lib/types/plugins/code.d.ts +3 -0
  58. package/lib/types/plugins/copy.d.ts +3 -0
  59. package/lib/types/plugins/cut.d.ts +3 -0
  60. package/lib/types/plugins/delete-key.d.ts +3 -0
  61. package/lib/types/plugins/enter-key.d.ts +3 -0
  62. package/lib/types/plugins/font-color.d.ts +3 -0
  63. package/lib/types/plugins/font-family.d.ts +3 -0
  64. package/lib/types/plugins/font-size.d.ts +3 -0
  65. package/lib/types/plugins/format-painter.d.ts +3 -0
  66. package/lib/types/plugins/heading.d.ts +3 -0
  67. package/lib/types/plugins/highlight.d.ts +3 -0
  68. package/lib/types/plugins/hr.d.ts +3 -0
  69. package/lib/types/plugins/image.d.ts +3 -0
  70. package/lib/types/plugins/indent.d.ts +3 -0
  71. package/lib/types/plugins/italic.d.ts +3 -0
  72. package/lib/types/plugins/link.d.ts +3 -0
  73. package/lib/types/plugins/list.d.ts +3 -0
  74. package/lib/types/plugins/markdown.d.ts +3 -0
  75. package/lib/types/plugins/paste.d.ts +3 -0
  76. package/lib/types/plugins/redo.d.ts +3 -0
  77. package/lib/types/plugins/remove-format.d.ts +3 -0
  78. package/lib/types/plugins/select-all.d.ts +3 -0
  79. package/lib/types/plugins/shift-enter-key.d.ts +3 -0
  80. package/lib/types/plugins/strikethrough.d.ts +3 -0
  81. package/lib/types/plugins/subscript.d.ts +3 -0
  82. package/lib/types/plugins/superscript.d.ts +3 -0
  83. package/lib/types/plugins/tab-key.d.ts +3 -0
  84. package/lib/types/plugins/underline.d.ts +3 -0
  85. package/lib/types/plugins/undo.d.ts +3 -0
  86. package/lib/types/plugins/unlink.d.ts +3 -0
  87. package/lib/types/storage/box-instances.d.ts +2 -0
  88. package/lib/types/storage/boxes.d.ts +2 -0
  89. package/lib/types/storage/editors.d.ts +2 -0
  90. package/lib/types/types/box.d.ts +15 -0
  91. package/lib/types/types/native.d.ts +33 -0
  92. package/lib/types/types/node.d.ts +1 -0
  93. package/lib/types/types/object.d.ts +21 -0
  94. package/lib/types/types/request.d.ts +20 -0
  95. package/lib/types/types/toolbar.d.ts +40 -0
  96. package/lib/types/ui/link-popup.d.ts +16 -0
  97. package/lib/types/ui/toolbar.d.ts +30 -0
  98. package/lib/types/ui/upload.d.ts +10 -0
  99. package/lib/types/utils/append-deepest.d.ts +2 -0
  100. package/lib/types/utils/camel-case.d.ts +1 -0
  101. package/lib/types/utils/change-tag-name.d.ts +2 -0
  102. package/lib/types/utils/debug.d.ts +1 -0
  103. package/lib/types/utils/denormalize-value.d.ts +1 -0
  104. package/lib/types/utils/encode.d.ts +1 -0
  105. package/lib/types/utils/fix-numbered-list.d.ts +2 -0
  106. package/lib/types/utils/for-each.d.ts +5 -0
  107. package/lib/types/utils/get-css.d.ts +1 -0
  108. package/lib/types/utils/get-deepest.d.ts +2 -0
  109. package/lib/types/utils/in-string.d.ts +1 -0
  110. package/lib/types/utils/index.d.ts +26 -0
  111. package/lib/types/utils/merge-nodes.d.ts +5 -0
  112. package/lib/types/utils/morph.d.ts +56 -0
  113. package/lib/types/utils/normalize-value.d.ts +1 -0
  114. package/lib/types/utils/parse-style.d.ts +2 -0
  115. package/lib/types/utils/query.d.ts +3 -0
  116. package/lib/types/utils/remove-br.d.ts +2 -0
  117. package/lib/types/utils/remove-zws.d.ts +2 -0
  118. package/lib/types/utils/request.d.ts +27 -0
  119. package/lib/types/utils/safe-template.d.ts +1 -0
  120. package/lib/types/utils/set-block-indent.d.ts +2 -0
  121. package/lib/types/utils/split-nodes.d.ts +5 -0
  122. package/lib/types/utils/template.d.ts +1 -0
  123. package/lib/types/utils/to-hex.d.ts +1 -0
  124. package/lib/types/utils/to-node-list.d.ts +2 -0
  125. package/lib/types/utils/wrap-node-list.d.ts +2 -0
  126. package/package.json +81 -0
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "lakelib",
3
+ "description": "Rich text editor based on the browser",
4
+ "version": "0.0.1",
5
+ "author": "Luo Longhao <luolonghao@gmail.com>",
6
+ "license": "MIT",
7
+ "homepage": "http://lakejs.com",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/lakejs/lake.git"
11
+ },
12
+ "main": "./lib/lake",
13
+ "files": [
14
+ "dist",
15
+ "lib"
16
+ ],
17
+ "keywords": [
18
+ "rich text",
19
+ "wysiwyg",
20
+ "editor"
21
+ ],
22
+ "bugs": {
23
+ "url": "https://github.com/lakejs/lake/issues"
24
+ },
25
+ "dependencies": {
26
+ "@codemirror/commands": "^6.3.3",
27
+ "@codemirror/lang-javascript": "^6.2.2",
28
+ "@codemirror/view": "^6.26.0",
29
+ "@types/blueimp-md5": "^2.18.2",
30
+ "@types/lodash": "^4.14.202",
31
+ "blueimp-md5": "^2.19.0",
32
+ "codemirror": "^6.0.1",
33
+ "eventemitter3": "^4.0.7",
34
+ "js-base64": "^3.7.6",
35
+ "lodash": "^4.17.21",
36
+ "photoswipe": "^5.4.3",
37
+ "tinykeys": "^2.1.0"
38
+ },
39
+ "devDependencies": {
40
+ "@rollup/plugin-commonjs": "^25.0.7",
41
+ "@rollup/plugin-json": "^6.1.0",
42
+ "@rollup/plugin-node-resolve": "^15.2.3",
43
+ "@rollup/plugin-terser": "^0.4.4",
44
+ "@rollup/plugin-typescript": "^11.1.6",
45
+ "@types/chai": "^4.3.11",
46
+ "@types/mocha": "^10.0.6",
47
+ "@types/sinon": "^17.0.3",
48
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
49
+ "@typescript-eslint/parser": "^6.21.0",
50
+ "chai": "^4.4.1",
51
+ "eslint": "^8.56.0",
52
+ "eslint-config-airbnb-base": "^15.0.0",
53
+ "eslint-config-prettier": "^8.10.0",
54
+ "express": "^4.18.2",
55
+ "mocha": "^10.3.0",
56
+ "multer": "1.4.5-lts.1",
57
+ "npm-run-all": "^4.1.5",
58
+ "puppeteer": "^22.6.1",
59
+ "rimraf": "^5.0.5",
60
+ "rollup": "^3.29.4",
61
+ "rollup-plugin-import-css": "^3.4.0",
62
+ "rollup-plugin-svg-import": "^3.0.0",
63
+ "simple-git-hooks": "^2.9.0",
64
+ "sinon": "^17.0.1",
65
+ "tslib": "^2.6.2",
66
+ "typescript": "^5.3.3"
67
+ },
68
+ "simple-git-hooks": {
69
+ "pre-commit": "pnpm lint"
70
+ },
71
+ "packageManager": "pnpm@8.7.5",
72
+ "scripts": {
73
+ "start": "npm-run-all --parallel --print-label express watch",
74
+ "express": "node ./scripts/start-server.mjs",
75
+ "watch": "rollup --watch --config rollup.config.mjs",
76
+ "build": "rimraf ./dist ./lib & rollup --config rollup.config.mjs",
77
+ "lint": "eslint . --config .eslintrc.cjs --ext \".ts,.js,.cjs,.mjs\"",
78
+ "test": "node ./scripts/run-tests.mjs",
79
+ "clean": "rimraf ./dist ./lib ./temp"
80
+ }
81
+ }