dragon-editor 3.5.17 → 3.5.19
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/dist/module.json +1 -1
- package/dist/runtime/components/DragonEditor.vue +12 -2
- package/dist/runtime/components/DragonEditorViewer.vue +1 -0
- package/dist/runtime/scss/editor.css +1 -0
- package/dist/runtime/scss/viewer.css +1 -0
- package/dist/runtime/utils/layout/menuBar.js +10 -2
- package/dist/runtime/utils/style/anchor.js +0 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component :is="
|
|
2
|
+
<component :is="editorStructure"></component>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup lang="ts">
|
|
6
|
-
import { ref, h, onMounted, onBeforeUnmount } from "vue";
|
|
6
|
+
import { ref, h, onMounted, onBeforeUnmount, watch } from "vue";
|
|
7
7
|
import { _getBodyVNodeStructure, _getMenuBarVNodeStructure, _getControlbarVNodeStructure } from "../utils/layout";
|
|
8
8
|
import { _eidtorMountEvent, _eidtorUnmountEvent, _editorMousemoveEvent, _editorMouseupEvent, _editorMouseleaveEvent, _editorTouchmoveEvent, _editorTouchendEvent, _checkOthersideClick, _parentWrapScollEvent, _editorContextMenuEvent, _windowResizeEvent } from "../utils/event";
|
|
9
9
|
import { _addBlock } from "../utils/node";
|
|
@@ -127,6 +127,7 @@ const editorStore = ref<DragonEditorStore>({
|
|
|
127
127
|
_parentWrapScollEvent(event, editorStore);
|
|
128
128
|
},
|
|
129
129
|
});
|
|
130
|
+
const editorStructure = ref<VNode>(mainStrucutre());
|
|
130
131
|
|
|
131
132
|
function mainStrucutre(): VNode {
|
|
132
133
|
const childList: VNode[] = [];
|
|
@@ -193,6 +194,14 @@ function setAlign(align: DETextalign): void {
|
|
|
193
194
|
_setTextAlign(align, editorStore);
|
|
194
195
|
}
|
|
195
196
|
|
|
197
|
+
watch(
|
|
198
|
+
() => props.modelValue,
|
|
199
|
+
(newData) => {
|
|
200
|
+
editorStore.value.firstData = newData;
|
|
201
|
+
editorStructure.value = mainStrucutre();
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
|
|
196
205
|
onMounted(() => {
|
|
197
206
|
_eidtorMountEvent(editorStore);
|
|
198
207
|
});
|
|
@@ -565,6 +574,7 @@ defineExpose({
|
|
|
565
574
|
}
|
|
566
575
|
.dragon-editor .de-heading-block {
|
|
567
576
|
min-height: 1.6em;
|
|
577
|
+
font-weight: bold;
|
|
568
578
|
word-break: break-all;
|
|
569
579
|
outline: 0;
|
|
570
580
|
}
|
|
@@ -39,8 +39,16 @@ export function _getMenuBarVNodeStructure(store) {
|
|
|
39
39
|
store.value.controlStatus.anchorHref = event.currentTarget.value;
|
|
40
40
|
}
|
|
41
41
|
}),
|
|
42
|
-
h(
|
|
43
|
-
|
|
42
|
+
h(
|
|
43
|
+
"button",
|
|
44
|
+
{
|
|
45
|
+
class: ["de-btn"],
|
|
46
|
+
onClick: () => {
|
|
47
|
+
_setAnchorTag(store.value.controlStatus.anchorHref, true, store);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"Set"
|
|
51
|
+
)
|
|
44
52
|
]) : h(
|
|
45
53
|
"div",
|
|
46
54
|
{ class: ["de-link-heading-area"] },
|
|
@@ -3,7 +3,6 @@ import { _findContentEditableElement, _findPoverTextNode } from "../node/index.j
|
|
|
3
3
|
export function _setAnchorTag(url, isOutsideLink, store) {
|
|
4
4
|
if (store.value.controlStatus.previousCorsorData !== null && store.value.controlStatus.$currentBlock !== null) {
|
|
5
5
|
const cursorData = store.value.controlStatus.previousCorsorData;
|
|
6
|
-
const $block = store.value.controlStatus.$currentBlock;
|
|
7
6
|
const typeIgnoreList = ["image", "code", "custom"];
|
|
8
7
|
const hrefValue = isOutsideLink === true ? url : `#${url}`;
|
|
9
8
|
const $element = _findContentEditableElement(cursorData.startNode);
|