vue-editify 0.0.44 → 0.0.45

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/examples/App.vue CHANGED
@@ -11,7 +11,7 @@ export default {
11
11
  name: 'App',
12
12
  data() {
13
13
  return {
14
- value: '<p><span>这是一个基于<img src="https://www.ling0523.cn/images/image_0_1701164609409.jpg"/> </span><code>Vue3 + alex-editor</code><span> 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: #ec1a0a;">富文本编辑器</span></p>',
14
+ value: '<p><span><span>这是一个基于</span><img src="https://www.ling0523.cn/images/image_0_1702452766522.png" data-editify-element="5" style="width: auto;"><span> </span></span><span data-editify-code="true">Vue3 + alex-editor</span><span> 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><pre data-editify-element="61"><span class="editify-hljs-type">Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文3333333本编辑器Vue3</span><span> </span><span class="editify-hljs-operator">+</span><span> alex</span><span class="editify-hljs-operator">-</span><span>editor 构建的一套精美</span><span class="editify-hljs-type">UI样式的开箱即用的富文本编辑器箱即用的富文本编辑器</span></pre><p><br></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>Vue3 + alex-editor 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: rgb(236, 26, 10);">富文本编辑器</span></p><p><span>v</span></p><p><br></p>',
15
15
  menuConfig: {
16
16
  mode: 'inner',
17
17
  sequence: {
@@ -100,10 +100,10 @@ export default {
100
100
  // this.value = '<p><br></p>'
101
101
  // }, 3000)
102
102
  setTimeout(() => {
103
- const el = this.$refs.editify.editor.getElementByKey(4)
104
- this.$refs.editify.editor.range.anchor.moveToStart(el)
105
- this.$refs.editify.editor.range.focus.moveToStart(el)
106
- this.$refs.editify.editor.rangeRender()
103
+ // const el = this.$refs.editify.editor.getElementByKey(4)
104
+ // this.$refs.editify.editor.range.anchor.moveToStart(el)
105
+ // this.$refs.editify.editor.range.focus.moveToStart(el)
106
+ // this.$refs.editify.editor.rangeRender()
107
107
  }, 100)
108
108
  },
109
109
  methods: {
package/lib/editify.es.js CHANGED
@@ -2994,7 +2994,7 @@ const setRangeInVisible = function() {
2994
2994
  const childRect = target.getBoundingClientRect();
2995
2995
  const parentRect = root.getBoundingClientRect();
2996
2996
  if (root.clientHeight < scrollHeight) {
2997
- if (childRect.top < parentRect.top) {
2997
+ if (childRect.bottom < parentRect.top) {
2998
2998
  await obj$1.element.setScrollTop({
2999
2999
  el: root,
3000
3000
  number: 0
@@ -3003,9 +3003,9 @@ const setRangeInVisible = function() {
3003
3003
  const tempParentRect = root.getBoundingClientRect();
3004
3004
  obj$1.element.setScrollTop({
3005
3005
  el: root,
3006
- number: tempChildRect.top - tempParentRect.top - tempChildRect.height * 2
3006
+ number: tempChildRect.top - tempParentRect.top
3007
3007
  });
3008
- } else if (childRect.bottom > parentRect.bottom) {
3008
+ } else if (childRect.top > parentRect.bottom) {
3009
3009
  await obj$1.element.setScrollTop({
3010
3010
  el: root,
3011
3011
  number: 0
@@ -3014,12 +3014,12 @@ const setRangeInVisible = function() {
3014
3014
  const tempParentRect = root.getBoundingClientRect();
3015
3015
  obj$1.element.setScrollTop({
3016
3016
  el: root,
3017
- number: tempChildRect.bottom - tempParentRect.bottom + tempChildRect.height * 2
3017
+ number: tempChildRect.bottom - tempParentRect.bottom
3018
3018
  });
3019
3019
  }
3020
3020
  }
3021
3021
  if (root.clientWidth < scrollWidth) {
3022
- if (childRect.left < parentRect.left) {
3022
+ if (childRect.right < parentRect.left) {
3023
3023
  await obj$1.element.setScrollLeft({
3024
3024
  el: root,
3025
3025
  number: 0
@@ -3028,9 +3028,9 @@ const setRangeInVisible = function() {
3028
3028
  const tempParentRect = root.getBoundingClientRect();
3029
3029
  obj$1.element.setScrollLeft({
3030
3030
  el: root,
3031
- number: tempChildRect.left - tempParentRect.left - tempChildRect.width * 2 - (tempChildRect.width * 2 > 20 ? 0 : 20)
3031
+ number: tempChildRect.left - tempParentRect.left + 20
3032
3032
  });
3033
- } else if (childRect.right > parentRect.right) {
3033
+ } else if (childRect.left > parentRect.right) {
3034
3034
  await obj$1.element.setScrollLeft({
3035
3035
  el: root,
3036
3036
  number: 0
@@ -3039,7 +3039,7 @@ const setRangeInVisible = function() {
3039
3039
  const tempParentRect = root.getBoundingClientRect();
3040
3040
  obj$1.element.setScrollLeft({
3041
3041
  el: root,
3042
- number: tempChildRect.right - tempParentRect.right + tempChildRect.width * 2 + (tempChildRect.width * 2 > 20 ? 0 : 20)
3042
+ number: tempChildRect.right - tempParentRect.right + 20
3043
3043
  });
3044
3044
  }
3045
3045
  }
@@ -23064,7 +23064,7 @@ const i18n = (locale) => {
23064
23064
  return translations[locale][key];
23065
23065
  };
23066
23066
  };
23067
- const version = "0.0.44";
23067
+ const version = "0.0.45";
23068
23068
  const install = (app, props) => {
23069
23069
  const locale = (props ? props.locale : "zh_CN") || "zh_CN";
23070
23070
  app.provide("$editTrans", i18n(locale));