@hufe921/canvas-editor 0.9.9

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 (112) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +53 -0
  3. package/dist/canvas-editor.es.js +11339 -0
  4. package/dist/canvas-editor.es.js.map +1 -0
  5. package/dist/canvas-editor.umd.js +59 -0
  6. package/dist/canvas-editor.umd.js.map +1 -0
  7. package/dist/src/editor/core/command/Command.d.ts +148 -0
  8. package/dist/src/editor/core/command/CommandAdapt.d.ts +91 -0
  9. package/dist/src/editor/core/contextmenu/ContextMenu.d.ts +25 -0
  10. package/dist/src/editor/core/contextmenu/menus/controlMenus.d.ts +2 -0
  11. package/dist/src/editor/core/contextmenu/menus/globalMenus.d.ts +2 -0
  12. package/dist/src/editor/core/contextmenu/menus/hyperlinkMenus.d.ts +2 -0
  13. package/dist/src/editor/core/contextmenu/menus/imageMenus.d.ts +2 -0
  14. package/dist/src/editor/core/contextmenu/menus/tableMenus.d.ts +2 -0
  15. package/dist/src/editor/core/cursor/Cursor.d.ts +15 -0
  16. package/dist/src/editor/core/cursor/CursorAgent.d.ts +15 -0
  17. package/dist/src/editor/core/draw/Draw.d.ts +134 -0
  18. package/dist/src/editor/core/draw/control/Control.d.ts +35 -0
  19. package/dist/src/editor/core/draw/control/checkbox/CheckboxControl.d.ts +15 -0
  20. package/dist/src/editor/core/draw/control/select/SelectControl.d.ts +21 -0
  21. package/dist/src/editor/core/draw/control/text/TextControl.d.ts +13 -0
  22. package/dist/src/editor/core/draw/frame/Background.d.ts +6 -0
  23. package/dist/src/editor/core/draw/frame/Header.d.ts +7 -0
  24. package/dist/src/editor/core/draw/frame/Margin.d.ts +7 -0
  25. package/dist/src/editor/core/draw/frame/PageNumber.d.ts +7 -0
  26. package/dist/src/editor/core/draw/frame/Watermark.d.ts +7 -0
  27. package/dist/src/editor/core/draw/interactive/Search.d.ts +26 -0
  28. package/dist/src/editor/core/draw/particle/CheckboxParticle.d.ts +7 -0
  29. package/dist/src/editor/core/draw/particle/HyperlinkParticle.d.ts +16 -0
  30. package/dist/src/editor/core/draw/particle/ImageParticle.d.ts +9 -0
  31. package/dist/src/editor/core/draw/particle/PageBreak.d.ts +12 -0
  32. package/dist/src/editor/core/draw/particle/Separator.d.ts +4 -0
  33. package/dist/src/editor/core/draw/particle/Subscript.d.ts +4 -0
  34. package/dist/src/editor/core/draw/particle/Superscript.d.ts +4 -0
  35. package/dist/src/editor/core/draw/particle/TextParticle.d.ts +18 -0
  36. package/dist/src/editor/core/draw/particle/block/BlockParticle.d.ts +14 -0
  37. package/dist/src/editor/core/draw/particle/block/modules/BaseBlock.d.ts +15 -0
  38. package/dist/src/editor/core/draw/particle/block/modules/IFrameBlock.d.ts +7 -0
  39. package/dist/src/editor/core/draw/particle/block/modules/VideoBlock.d.ts +6 -0
  40. package/dist/src/editor/core/draw/particle/date/DateParticle.d.ts +14 -0
  41. package/dist/src/editor/core/draw/particle/date/DatePicker.d.ts +41 -0
  42. package/dist/src/editor/core/draw/particle/latex/LaTexParticle.d.ts +7 -0
  43. package/dist/src/editor/core/draw/particle/latex/utils/LaTexUtils.d.ts +47 -0
  44. package/dist/src/editor/core/draw/particle/latex/utils/hershey.d.ts +10 -0
  45. package/dist/src/editor/core/draw/particle/latex/utils/symbols.d.ts +8 -0
  46. package/dist/src/editor/core/draw/particle/previewer/Previewer.d.ts +34 -0
  47. package/dist/src/editor/core/draw/particle/table/TableParticle.d.ts +11 -0
  48. package/dist/src/editor/core/draw/particle/table/TableTool.d.ts +22 -0
  49. package/dist/src/editor/core/draw/richtext/AbstractRichText.d.ts +14 -0
  50. package/dist/src/editor/core/draw/richtext/Highlight.d.ts +7 -0
  51. package/dist/src/editor/core/draw/richtext/Strikeout.d.ts +7 -0
  52. package/dist/src/editor/core/draw/richtext/Underline.d.ts +7 -0
  53. package/dist/src/editor/core/event/CanvasEvent.d.ts +37 -0
  54. package/dist/src/editor/core/event/GlobalEvent.d.ts +20 -0
  55. package/dist/src/editor/core/history/HistoryManager.d.ts +10 -0
  56. package/dist/src/editor/core/listener/Listener.d.ts +13 -0
  57. package/dist/src/editor/core/observer/ScrollObserver.d.ts +9 -0
  58. package/dist/src/editor/core/observer/SelectionObserver.d.ts +16 -0
  59. package/dist/src/editor/core/position/Position.d.ts +19 -0
  60. package/dist/src/editor/core/range/RangeManager.d.ts +21 -0
  61. package/dist/src/editor/core/register/Register.d.ts +14 -0
  62. package/dist/src/editor/core/shortcut/Shortcut.d.ts +14 -0
  63. package/dist/src/editor/core/shortcut/keys/richtextKeys.d.ts +2 -0
  64. package/dist/src/editor/core/worker/WorkerManager.d.ts +7 -0
  65. package/dist/src/editor/core/worker/works/wordCount.d.ts +1 -0
  66. package/dist/src/editor/dataset/constant/Checkbox.d.ts +2 -0
  67. package/dist/src/editor/dataset/constant/Common.d.ts +4 -0
  68. package/dist/src/editor/dataset/constant/ContextMenu.d.ts +3 -0
  69. package/dist/src/editor/dataset/constant/Control.d.ts +2 -0
  70. package/dist/src/editor/dataset/constant/Cursor.d.ts +1 -0
  71. package/dist/src/editor/dataset/constant/Editor.d.ts +1 -0
  72. package/dist/src/editor/dataset/constant/Element.d.ts +6 -0
  73. package/dist/src/editor/dataset/constant/Header.d.ts +2 -0
  74. package/dist/src/editor/dataset/constant/Regular.d.ts +4 -0
  75. package/dist/src/editor/dataset/constant/Watermark.d.ts +2 -0
  76. package/dist/src/editor/dataset/enum/Block.d.ts +4 -0
  77. package/dist/src/editor/dataset/enum/Control.d.ts +16 -0
  78. package/dist/src/editor/dataset/enum/Editor.d.ts +21 -0
  79. package/dist/src/editor/dataset/enum/Element.d.ts +16 -0
  80. package/dist/src/editor/dataset/enum/ElementStyle.d.ts +12 -0
  81. package/dist/src/editor/dataset/enum/Event.d.ts +5 -0
  82. package/dist/src/editor/dataset/enum/KeyMap.d.ts +82 -0
  83. package/dist/src/editor/dataset/enum/Observer.d.ts +6 -0
  84. package/dist/src/editor/dataset/enum/Row.d.ts +6 -0
  85. package/dist/src/editor/dataset/enum/table/TableTool.d.ts +4 -0
  86. package/dist/src/editor/index.d.ts +25 -0
  87. package/dist/src/editor/interface/Block.d.ts +12 -0
  88. package/dist/src/editor/interface/Checkbox.d.ts +13 -0
  89. package/dist/src/editor/interface/Common.d.ts +5 -0
  90. package/dist/src/editor/interface/Control.d.ts +50 -0
  91. package/dist/src/editor/interface/Draw.d.ts +30 -0
  92. package/dist/src/editor/interface/Editor.d.ts +55 -0
  93. package/dist/src/editor/interface/Element.d.ts +99 -0
  94. package/dist/src/editor/interface/Header.d.ts +6 -0
  95. package/dist/src/editor/interface/Listener.d.ts +29 -0
  96. package/dist/src/editor/interface/Margin.d.ts +1 -0
  97. package/dist/src/editor/interface/Position.d.ts +37 -0
  98. package/dist/src/editor/interface/Previewer.d.ts +11 -0
  99. package/dist/src/editor/interface/Range.d.ts +11 -0
  100. package/dist/src/editor/interface/Row.d.ts +14 -0
  101. package/dist/src/editor/interface/Search.d.ts +14 -0
  102. package/dist/src/editor/interface/Watermark.d.ts +7 -0
  103. package/dist/src/editor/interface/contextmenu/ContextMenu.d.ts +20 -0
  104. package/dist/src/editor/interface/shortcut/Shortcut.d.ts +10 -0
  105. package/dist/src/editor/interface/table/Colgroup.d.ts +4 -0
  106. package/dist/src/editor/interface/table/Td.d.ts +19 -0
  107. package/dist/src/editor/interface/table/Tr.d.ts +6 -0
  108. package/dist/src/editor/utils/clipboard.d.ts +5 -0
  109. package/dist/src/editor/utils/element.d.ts +10 -0
  110. package/dist/src/editor/utils/index.d.ts +8 -0
  111. package/dist/src/editor/utils/print.d.ts +1 -0
  112. package/package.json +60 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021-present, hufe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ <h1 align="center">canvas-editor</h1>
2
+
3
+ <p align="center"> a rich text editor by canvas/svg</p>
4
+
5
+ ## tips
6
+
7
+ 1. The render layer by svg is under development, see [feature/svg](https://github.com/Hufe921/canvas-editor/tree/feature/svg)
8
+ 2. The export pdf feature is available now, see [feature/pdf](https://github.com/Hufe921/canvas-editor/tree/feature/pdf)
9
+
10
+ ## usage
11
+
12
+ ```bash
13
+ npm i @hufe921/canvas-editor --save
14
+ ```
15
+ ```html
16
+ <div class="canvas-editor"></div>
17
+ ```
18
+ ```javascript
19
+ import Editor from "@hufe921/canvas-editor"
20
+
21
+ new Editor(document.querySelector(".canvas-editor"), [
22
+ {
23
+ value: "Hello World"
24
+ }
25
+ ])
26
+ ```
27
+
28
+ ## snapshot
29
+
30
+ ![image](https://github.com/Hufe921/canvas-editor/blob/main/src/assets/snapshots/main_v0.9.8.png)
31
+
32
+ ## next features
33
+
34
+ 1. optimize content block
35
+ 2. control rules
36
+ 3. table paging
37
+ 4. docs
38
+
39
+ ## install
40
+
41
+ `yarn`
42
+
43
+ ## dev
44
+
45
+ `yarn run dev`
46
+
47
+ ## build
48
+
49
+ #### app
50
+ `yarn run build`
51
+
52
+ #### lib
53
+ `yarn run lib`