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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "nuxt": ">=3.0.0"
5
5
  },
6
6
  "configKey": "dragon-editor",
7
- "version": "3.5.17",
7
+ "version": "3.5.19",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <component :is="mainStrucutre()"></component>
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
  }
@@ -211,6 +211,7 @@ function structure(): VNode {
211
211
  }
212
212
  .dragon-editor-viewer .de-heading-block {
213
213
  min-height: 1.6em;
214
+ font-weight: bold;
214
215
  word-break: break-all;
215
216
  outline: 0;
216
217
  }
@@ -354,6 +354,7 @@
354
354
  }
355
355
  .dragon-editor .de-heading-block {
356
356
  min-height: 1.6em;
357
+ font-weight: bold;
357
358
  word-break: break-all;
358
359
  outline: 0;
359
360
  }
@@ -176,6 +176,7 @@
176
176
  }
177
177
  .dragon-editor-viewer .de-heading-block {
178
178
  min-height: 1.6em;
179
+ font-weight: bold;
179
180
  word-break: break-all;
180
181
  outline: 0;
181
182
  }
@@ -39,8 +39,16 @@ export function _getMenuBarVNodeStructure(store) {
39
39
  store.value.controlStatus.anchorHref = event.currentTarget.value;
40
40
  }
41
41
  }),
42
- h("button", { class: ["de-btn"], onClick: () => {
43
- } }, "Set")
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dragon-editor",
3
- "version": "3.5.17",
3
+ "version": "3.5.19",
4
4
  "description": "Javascript WYSIWYG editor in Nuxt3!",
5
5
  "repository": {
6
6
  "type": "git",