dragon-editor 2.1.2 → 3.0.0-beta

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 (55) hide show
  1. package/README.md +40 -115
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +10 -12
  4. package/dist/runtime/components/DragonEditor.vue +441 -0
  5. package/dist/runtime/plugin.d.ts +2 -0
  6. package/dist/runtime/plugin.mjs +10 -0
  7. package/dist/runtime/scss/editor.css +262 -0
  8. package/dist/runtime/scss/viewer.css +129 -0
  9. package/dist/runtime/store.d.ts +7 -0
  10. package/dist/runtime/store.mjs +27 -0
  11. package/dist/runtime/type.d.ts +24 -0
  12. package/dist/runtime/utils/block.d.ts +9 -0
  13. package/dist/runtime/utils/block.mjs +70 -0
  14. package/dist/runtime/utils/cursor.d.ts +6 -0
  15. package/dist/runtime/utils/cursor.mjs +132 -0
  16. package/dist/runtime/utils/element.d.ts +3 -0
  17. package/dist/runtime/utils/element.mjs +39 -0
  18. package/dist/runtime/utils/keyboardEvent.d.ts +10 -0
  19. package/dist/runtime/utils/keyboardEvent.mjs +781 -0
  20. package/dist/runtime/utils/style.d.ts +1 -0
  21. package/dist/runtime/utils/style.mjs +330 -0
  22. package/dist/runtime/utils/ui.d.ts +1 -0
  23. package/dist/runtime/utils/ui.mjs +35 -0
  24. package/package.json +10 -4
  25. package/README_en.md +0 -30
  26. package/dist/runtime/core/components/SvgIcon.d.ts +0 -10
  27. package/dist/runtime/core/components/SvgIcon.mjs +0 -98
  28. package/dist/runtime/core/components/editor/ImageBlock.vue +0 -175
  29. package/dist/runtime/core/components/editor/OlBlock.vue +0 -162
  30. package/dist/runtime/core/components/editor/TextBlock.vue +0 -172
  31. package/dist/runtime/core/components/editor/UlBlock.vue +0 -162
  32. package/dist/runtime/core/style/common.css +0 -496
  33. package/dist/runtime/core/style/viewer.css +0 -205
  34. package/dist/runtime/core/utils/converter.d.ts +0 -2
  35. package/dist/runtime/core/utils/converter.mjs +0 -90
  36. package/dist/runtime/core/utils/cursor.d.ts +0 -4
  37. package/dist/runtime/core/utils/cursor.mjs +0 -84
  38. package/dist/runtime/core/utils/element.d.ts +0 -3
  39. package/dist/runtime/core/utils/element.mjs +0 -40
  40. package/dist/runtime/core/utils/global.d.ts +0 -3
  41. package/dist/runtime/core/utils/global.mjs +0 -81
  42. package/dist/runtime/core/utils/index.d.ts +0 -7
  43. package/dist/runtime/core/utils/index.mjs +0 -7
  44. package/dist/runtime/core/utils/keyboard.d.ts +0 -6
  45. package/dist/runtime/core/utils/keyboard.mjs +0 -565
  46. package/dist/runtime/core/utils/style.d.ts +0 -6
  47. package/dist/runtime/core/utils/style.mjs +0 -374
  48. package/dist/runtime/core/utils/ui.d.ts +0 -4
  49. package/dist/runtime/core/utils/ui.mjs +0 -13
  50. package/dist/runtime/shared/components/DragonEditor.vue +0 -695
  51. package/dist/runtime/shared/components/DragonEditorComment.vue +0 -172
  52. package/dist/runtime/shared/components/DragonEditorNew.d.ts +0 -16
  53. package/dist/runtime/shared/components/DragonEditorNew.mjs +0 -62
  54. package/dist/runtime/shared/components/DragonEditorViewer.d.ts +0 -14
  55. package/dist/runtime/shared/components/DragonEditorViewer.mjs +0 -15
@@ -0,0 +1,39 @@
1
+ export function _findScrollingElement($target) {
2
+ if ($target.parentElement !== null) {
3
+ if ($target.scrollHeight > $target.clientHeight) {
4
+ return $target;
5
+ } else {
6
+ if ($target.parentElement.tagName === "BODY") {
7
+ return window;
8
+ } else {
9
+ return _findScrollingElement($target.parentElement);
10
+ }
11
+ }
12
+ } else {
13
+ return window;
14
+ }
15
+ }
16
+ export function _getParentElementIfNodeIsText($target, $block) {
17
+ if ($target.constructor.name === "Text") {
18
+ const $parent = $target.parentElement;
19
+ if ($parent !== $block) {
20
+ $target = $parent;
21
+ }
22
+ }
23
+ return $target;
24
+ }
25
+ export function _findContentEditableElement($target) {
26
+ if ($target.constructor.name === "Text") {
27
+ $target = $target.parentNode;
28
+ }
29
+ const $baseElement = $target;
30
+ if ($baseElement.parentElement.tagName === "BODY") {
31
+ return null;
32
+ } else {
33
+ if ($baseElement.getAttribute("contentEditable") === null) {
34
+ return _findContentEditableElement($baseElement.parentNode);
35
+ } else {
36
+ return $baseElement;
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,10 @@
1
+ export declare function _elementKeyEvent(event: KeyboardEvent, store: any): void;
2
+ /**
3
+ * 핫 키 이벤트
4
+ */
5
+ export declare function _hotKeyEvent(event: KeyboardEvent, store: any): void;
6
+ /**
7
+ * 복사 & 붙여넣기 이벤트
8
+ */
9
+ export declare function copyEvent(event: KeyboardEvent, store: any): void;
10
+ export declare function pasteEvent(event: KeyboardEvent, store: any): void;