@hufe921/canvas-editor 0.9.95 → 0.9.97

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 (32) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +53 -18
  3. package/dist/canvas-editor.es.js +757 -136
  4. package/dist/canvas-editor.es.js.map +1 -1
  5. package/dist/canvas-editor.umd.js +32 -31
  6. package/dist/canvas-editor.umd.js.map +1 -1
  7. package/dist/src/editor/core/command/Command.d.ts +4 -0
  8. package/dist/src/editor/core/command/CommandAdapt.d.ts +6 -1
  9. package/dist/src/editor/core/cursor/Cursor.d.ts +1 -0
  10. package/dist/src/editor/core/draw/Draw.d.ts +3 -0
  11. package/dist/src/editor/core/draw/control/Control.d.ts +5 -2
  12. package/dist/src/editor/core/draw/interactive/Area.d.ts +18 -0
  13. package/dist/src/editor/core/draw/particle/table/TableOperate.d.ts +2 -1
  14. package/dist/src/editor/core/draw/particle/table/TableParticle.d.ts +1 -0
  15. package/dist/src/editor/core/draw/particle/table/TableTool.d.ts +2 -0
  16. package/dist/src/editor/core/range/RangeManager.d.ts +6 -1
  17. package/dist/src/editor/dataset/constant/ContextMenu.d.ts +2 -0
  18. package/dist/src/editor/dataset/constant/Element.d.ts +1 -0
  19. package/dist/src/editor/dataset/enum/Area.d.ts +5 -0
  20. package/dist/src/editor/dataset/enum/Control.d.ts +4 -0
  21. package/dist/src/editor/dataset/enum/Element.d.ts +1 -0
  22. package/dist/src/editor/dataset/enum/table/Table.d.ts +3 -1
  23. package/dist/src/editor/index.d.ts +6 -5
  24. package/dist/src/editor/interface/Area.d.ts +41 -0
  25. package/dist/src/editor/interface/Control.d.ts +15 -2
  26. package/dist/src/editor/interface/Element.d.ts +13 -2
  27. package/dist/src/editor/interface/Listener.d.ts +2 -2
  28. package/dist/src/editor/interface/Range.d.ts +2 -1
  29. package/dist/src/editor/interface/Row.d.ts +1 -0
  30. package/dist/src/editor/utils/element.d.ts +1 -0
  31. package/dist/src/editor/utils/index.d.ts +1 -0
  32. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,62 @@
1
+ ## [0.9.97](https://github.com/Hufe921/canvas-editor/compare/v0.9.96...v0.9.97) (2024-11-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add the first character of area ([1a3f062](https://github.com/Hufe921/canvas-editor/commit/1a3f0626514615d3b5c48dfca9d4d5a03b673ad3))
7
+ * cursor position is on the top margin calculation error #882 ([992e4ed](https://github.com/Hufe921/canvas-editor/commit/992e4edb2a7ade02847a0be234d3ca4f429949ff)), closes [#882](https://github.com/Hufe921/canvas-editor/issues/882)
8
+ * data retrieval error when control was destroyed #884 ([1c5ef78](https://github.com/Hufe921/canvas-editor/commit/1c5ef7801ac1fb18fe131912cbd2547023e35982)), closes [#884](https://github.com/Hufe921/canvas-editor/issues/884)
9
+ * destroy control boundary error #895 ([6bed83b](https://github.com/Hufe921/canvas-editor/commit/6bed83b645f67c5c59ba5c4ee811e985e1dbc60f)), closes [#895](https://github.com/Hufe921/canvas-editor/issues/895)
10
+ * disable highlight style in print mode #893 ([49360fd](https://github.com/Hufe921/canvas-editor/commit/49360fda0eff9ae24f5b79b742bd8cdf1f99ca20)), closes [#893](https://github.com/Hufe921/canvas-editor/issues/893)
11
+ * insert area error when cursor is within table #891 ([b16aa71](https://github.com/Hufe921/canvas-editor/commit/b16aa71798c440327d49c6c8f4c3166ea5bc5ee7)), closes [#891](https://github.com/Hufe921/canvas-editor/issues/891)
12
+ * line break rendering error for control placeholder #883 ([679c4fa](https://github.com/Hufe921/canvas-editor/commit/679c4fac5f3eba524f582cb090390b2e302a1b81)), closes [#883](https://github.com/Hufe921/canvas-editor/issues/883)
13
+ * set alignment error when row width is not enough #885 ([c71d99c](https://github.com/Hufe921/canvas-editor/commit/c71d99cbd4d827b8af6788663f46403b141e2797)), closes [#885](https://github.com/Hufe921/canvas-editor/issues/885)
14
+ * virtual input location boundary error #878 ([2d43343](https://github.com/Hufe921/canvas-editor/commit/2d43343d83917ea35340a8610958df4e09d67e8b)), closes [#878](https://github.com/Hufe921/canvas-editor/issues/878)
15
+
16
+
17
+ ### Chores
18
+
19
+ * export controlId and titleId ([30b405c](https://github.com/Hufe921/canvas-editor/commit/30b405c270a7ca6a09f5824b3cf4a5bd552e0478))
20
+ * update add control method ([c370df7](https://github.com/Hufe921/canvas-editor/commit/c370df7d3666ab0ed99fc2538b50e3bb5fbd0bf1))
21
+
22
+
23
+ ### Features
24
+
25
+ * add area element #216 ([204a886](https://github.com/Hufe921/canvas-editor/commit/204a886c1dcd01c3b56695eef74c3c39221bcdb3)), closes [#216](https://github.com/Hufe921/canvas-editor/issues/216)
26
+ * add control state property to the ControlChange event #884 ([e5480a3](https://github.com/Hufe921/canvas-editor/commit/e5480a3f00044e901b255c77f6b8ae7fb91ef4f4)), closes [#884](https://github.com/Hufe921/canvas-editor/issues/884)
27
+ * handle copy area context boundary ([64b4100](https://github.com/Hufe921/canvas-editor/commit/64b41009c42dbba1600e92301a6db89cd8fb421d))
28
+ * style settings when range is collapsed #870 ([fbdd5f6](https://github.com/Hufe921/canvas-editor/commit/fbdd5f62786398e66c7740da28b1656c4f36f131)), closes [#870](https://github.com/Hufe921/canvas-editor/issues/870)
29
+
30
+
31
+
32
+ ## [0.9.96](https://github.com/Hufe921/canvas-editor/compare/v0.9.95...v0.9.96) (2024-11-09)
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * adjust column width after adding new columns #855 ([2439c24](https://github.com/Hufe921/canvas-editor/commit/2439c24e120bdfb0553d5f32ef9af25517bb6baa)), closes [#855](https://github.com/Hufe921/canvas-editor/issues/855)
38
+ * focus editor when selection exists #871 ([85cc2b7](https://github.com/Hufe921/canvas-editor/commit/85cc2b7f68726fbecb1484f420a6d20bda004dfe)), closes [#871](https://github.com/Hufe921/canvas-editor/issues/871)
39
+ * margin height in continuous page mode ([c0403b8](https://github.com/Hufe921/canvas-editor/commit/c0403b8f8d069d0c4b3fcb8bb23159cb1fb00fe5))
40
+ * table rendering error after pagination when scaled #867 ([a1472c2](https://github.com/Hufe921/canvas-editor/commit/a1472c23aacef239f00cab9ab365d261599d1bee)), closes [#867](https://github.com/Hufe921/canvas-editor/issues/867)
41
+
42
+
43
+ ### Chores
44
+
45
+ * export EDITOR_CLIPBOARD constant #860 ([7e56297](https://github.com/Hufe921/canvas-editor/commit/7e562970031a4227d3d8ac66f2447cf2c52f25d1)), closes [#860](https://github.com/Hufe921/canvas-editor/issues/860)
46
+ * update README.md ([3a81d56](https://github.com/Hufe921/canvas-editor/commit/3a81d56974e1e30bb01985f9a79de7f31785a8fc))
47
+
48
+
49
+ ### Features
50
+
51
+ * add control paste disabled rule #853 ([2bb84ab](https://github.com/Hufe921/canvas-editor/commit/2bb84abb5f3fb6670ca9ae88e96f5790de4b6a9d)), closes [#853](https://github.com/Hufe921/canvas-editor/issues/853)
52
+ * add getElementById api ([8eabd07](https://github.com/Hufe921/canvas-editor/commit/8eabd0719981b16f4ba87005d5759c6710848bde))
53
+ * add table dashed border #858 ([dffac63](https://github.com/Hufe921/canvas-editor/commit/dffac639739d82e50cb122b3c95af12805351bb9)), closes [#858](https://github.com/Hufe921/canvas-editor/issues/858)
54
+ * add table internal border #869 ([5cc4f13](https://github.com/Hufe921/canvas-editor/commit/5cc4f1349cacc974918068619dc9b258f6c9cad5)), closes [#869](https://github.com/Hufe921/canvas-editor/issues/869)
55
+ * optimize previewer interactive in readonly mode #875 ([09b8bac](https://github.com/Hufe921/canvas-editor/commit/09b8baca888453685eba03e205f91187a101427c)), closes [#875](https://github.com/Hufe921/canvas-editor/issues/875)
56
+ * quick select table row and col tool ([c6a1703](https://github.com/Hufe921/canvas-editor/commit/c6a170367fbcb9822bce3040ebd63bed8ea27355))
57
+
58
+
59
+
1
60
  ## [0.9.95](https://github.com/Hufe921/canvas-editor/compare/v0.9.94...v0.9.95) (2024-10-19)
2
61
 
3
62
 
package/README.md CHANGED
@@ -1,21 +1,40 @@
1
1
  <h1 align="center">canvas-editor</h1>
2
2
 
3
3
  <p align="center">
4
- <a href="https://www.npmjs.com/package/@hufe921/canvas-editor"><img src="https://img.shields.io/npm/v/@hufe921/canvas-editor.svg?sanitize=true" alt="Version"></a>
5
- <a href="https://www.npmjs.com/package/@hufe921/canvas-editor"><img src="https://img.shields.io/npm/l/@hufe921/canvas-editor.svg?sanitize=true" alt="License"></a>
6
- <a href="https://github.com/Hufe921/canvas-editor/issues/new/choose"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs"></a>
4
+ <a href="https://www.npmjs.com/package/@hufe921/canvas-editor" target="_blank"><img src="https://img.shields.io/npm/v/@hufe921/canvas-editor.svg?sanitize=true" alt="Version"></a>
5
+ <a href="https://github.com/hufe921/canvas-editor/actions" target="_blank">
6
+ <img alt="Cypress Passing" src="https://github.com/hufe921/canvas-editor/workflows/cypress/badge.svg" />
7
+ </a>
8
+ <a href="https://github.com/hufe921/canvas-editor/graphs/contributors" target="_blank">
9
+ <img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/hufe921/canvas-editor" />
10
+ </a>
11
+ <a href="https://www.npmjs.com/package/@hufe921/canvas-editor" target="_blank"><img src="https://img.shields.io/npm/l/@hufe921/canvas-editor.svg?sanitize=true" alt="License"></a>
12
+ <a href="https://github.com/Hufe921/canvas-editor/issues/new/choose" target="_blank"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs"></a>
7
13
  </p>
8
14
 
9
15
  <p align="center"> a rich text editor by canvas/svg</p>
10
16
 
11
- ## tips
17
+ <p align="center">
18
+ <a href="https://hufe.club/canvas-editor" target="_blank">View Demo</a>
19
+ ·
20
+ <a href="https://hufe.club/canvas-editor-docs" target="_blank">View Docs</a>
21
+ ·
22
+ <a href="https://github.com/Hufe921/canvas-editor/issues/new?assignees=&labels=&projects=&template=bug_report.yml" target="_blank">Report Bug</a>
23
+ ·
24
+ <a href="https://github.com/Hufe921/canvas-editor/issues/new?assignees=&labels=%3Asparkles%3A+feature+request&projects=&template=feature_request.yml" target="_blank">Request Feature</a>
25
+ ·
26
+ <a href="https://github.com/Hufe921/canvas-editor/discussions" target="_blank">FAQ</a>
27
+ </p>
28
+
29
+ <p align="center">Love the project? Please consider <a href="https://hufe.club/donate.jpg" target="_blank">donating</a> to help it improve!</p>
12
30
 
13
- 1. [docs](https://hufe.club/canvas-editor-docs/)
14
- 2. [canvas-editor-plugin](https://github.com/Hufe921/canvas-editor-plugin)
15
- 3. The render layer by svg is under development, see [feature/svg](https://github.com/Hufe921/canvas-editor/tree/feature/svg)
16
- 4. The export pdf feature is available now, see [feature/pdf](https://github.com/Hufe921/canvas-editor/tree/feature/pdf)
31
+ ## Tips
17
32
 
18
- ## usage
33
+ 1. Official plugin: [canvas-editor-plugin](https://github.com/Hufe921/canvas-editor-plugin)
34
+ 2. The render layer by svg is under development, see [feature/svg](https://github.com/Hufe921/canvas-editor/tree/feature/svg)
35
+ 3. The export pdf feature is available now, see [feature/pdf](https://github.com/Hufe921/canvas-editor/tree/feature/pdf)
36
+
37
+ ## Basic usage
19
38
 
20
39
  ```bash
21
40
  npm i @hufe921/canvas-editor --save
@@ -37,26 +56,42 @@ new Editor(document.querySelector('.canvas-editor'), {
37
56
  })
38
57
  ```
39
58
 
40
- ## next features
41
-
42
- 1. table paging
43
- 2. improve performance
44
- 3. control rules
59
+ ## Features
60
+
61
+ - Rich text operations (Undo, Redo, Font, Size, Bold, Italic, Underline, Strikeout, Superscript, Alignment, Title, List, ...)
62
+ - Insert elements (Table, Image, Link, Code Block, Page Break, Math Formula, Date Picker, Block, ...)
63
+ - Print (Based on canvas to picture, pdf drawing)
64
+ - Controls (Select, Text, Date, Radio, Checkbox)
65
+ - Contextmenu (Internal, Custom)
66
+ - Shortcut keys (Internal, Custom)
67
+ - Drag and Drop(Text, Element, Control)
68
+ - Header, Footer, Page Number
69
+ - Page Margin
70
+ - Watermark
71
+ - Pagination
72
+ - Comment
73
+ - Catalog
74
+
75
+ ## Roadmap
76
+
77
+ 1. Table paging
78
+ 2. Control rules
79
+ 3. Improve performance
45
80
  4. [CRDT](https://github.com/Hufe921/canvas-editor/tree/feature/CRDT)
46
81
 
47
- ## snapshot
82
+ ## Snapshot
48
83
 
49
84
  ![image](https://github.com/Hufe921/canvas-editor/blob/main/src/assets/snapshots/main_v0.9.35.png)
50
85
 
51
- ## install
86
+ ## Install
52
87
 
53
88
  `yarn`
54
89
 
55
- ## dev
90
+ ## Dev
56
91
 
57
92
  `npm run dev`
58
93
 
59
- ## build
94
+ ## Build
60
95
 
61
96
  #### app
62
97