dragon-editor 2.1.1 → 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.
- package/README.md +40 -115
- package/dist/module.json +1 -1
- package/dist/module.mjs +10 -8
- package/dist/runtime/components/DragonEditor.vue +441 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.mjs +10 -0
- package/dist/runtime/scss/editor.css +262 -0
- package/dist/runtime/scss/viewer.css +129 -0
- package/dist/runtime/store.d.ts +7 -0
- package/dist/runtime/store.mjs +27 -0
- package/dist/runtime/type.d.ts +24 -0
- package/dist/runtime/utils/block.d.ts +9 -0
- package/dist/runtime/utils/block.mjs +70 -0
- package/dist/runtime/utils/cursor.d.ts +6 -0
- package/dist/runtime/utils/cursor.mjs +132 -0
- package/dist/runtime/utils/element.d.ts +3 -0
- package/dist/runtime/utils/element.mjs +39 -0
- package/dist/runtime/utils/keyboardEvent.d.ts +10 -0
- package/dist/runtime/utils/keyboardEvent.mjs +781 -0
- package/dist/runtime/utils/style.d.ts +1 -0
- package/dist/runtime/utils/style.mjs +330 -0
- package/dist/runtime/utils/ui.d.ts +1 -0
- package/dist/runtime/utils/ui.mjs +35 -0
- package/package.json +10 -4
- package/README_en.md +0 -30
- package/dist/runtime/core/components/SvgIcon.d.ts +0 -10
- package/dist/runtime/core/components/SvgIcon.mjs +0 -98
- package/dist/runtime/core/components/editor/ImageBlock.vue +0 -175
- package/dist/runtime/core/components/editor/OlBlock.vue +0 -162
- package/dist/runtime/core/components/editor/TextBlock.vue +0 -172
- package/dist/runtime/core/components/editor/UlBlock.vue +0 -162
- package/dist/runtime/core/style/common.css +0 -496
- package/dist/runtime/core/style/viewer.css +0 -205
- package/dist/runtime/core/utils/converter.d.ts +0 -2
- package/dist/runtime/core/utils/converter.mjs +0 -90
- package/dist/runtime/core/utils/cursor.d.ts +0 -4
- package/dist/runtime/core/utils/cursor.mjs +0 -84
- package/dist/runtime/core/utils/element.d.ts +0 -3
- package/dist/runtime/core/utils/element.mjs +0 -40
- package/dist/runtime/core/utils/global.d.ts +0 -3
- package/dist/runtime/core/utils/global.mjs +0 -81
- package/dist/runtime/core/utils/index.d.ts +0 -7
- package/dist/runtime/core/utils/index.mjs +0 -7
- package/dist/runtime/core/utils/keyboard.d.ts +0 -6
- package/dist/runtime/core/utils/keyboard.mjs +0 -565
- package/dist/runtime/core/utils/style.d.ts +0 -6
- package/dist/runtime/core/utils/style.mjs +0 -374
- package/dist/runtime/core/utils/ui.d.ts +0 -4
- package/dist/runtime/core/utils/ui.mjs +0 -13
- package/dist/runtime/shared/components/DragonEditor.d.ts +0 -16
- package/dist/runtime/shared/components/DragonEditor.mjs +0 -62
- package/dist/runtime/shared/components/DragonEditor.vue +0 -695
- package/dist/runtime/shared/components/DragonEditorComment.vue +0 -172
- package/dist/runtime/shared/components/DragonEditorViewer.d.ts +0 -14
- 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;
|