vue-editify 0.2.10 → 0.2.11
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/lib/editify.es.js +5 -25
- package/lib/editify.umd.js +2 -2
- package/lib/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/layer/layer.vue +2 -24
- package/src/index.ts +1 -1
    
        package/lib/index.d.ts
    CHANGED
    
    | @@ -804,7 +804,7 @@ export type { MenuButtonType, MenuSelectButtonType, MenuDisplayButtonType, MenuI | |
| 804 804 | 
             
            export type { ElementMatchConfigType } from './core/function';
         | 
| 805 805 | 
             
            export { elementIsMatch, getMatchElementByElement, getMatchElementByRange, isList, isTask, elementIsInList, elementIsInTask, hasPreInRange, hasQuoteInRange, hasListInRange, hasTaskInRange, hasLinkInRange, hasTableInRange, hasImageInRange, hasVideoInRange, isRangeInQuote, isRangeInList, isRangeInTask, queryTextStyle, queryTextMark, getRangeText, setIndentIncrease, setIndentDecrease, setQuote, setAlign, setList, setTask, setTextStyle, setTextMark, removeTextStyle, removeTextMark, setLineHeight, insertLink, insertImage, insertVideo, insertTable, insertCodeBlock, insertSeparator } from './core/function';
         | 
| 806 806 | 
             
            declare const install: (app: App) => void;
         | 
| 807 | 
            -
            declare const version = "0.2. | 
| 807 | 
            +
            declare const version = "0.2.11";
         | 
| 808 808 | 
             
            export { AlexElement } from 'alex-editor';
         | 
| 809 809 | 
             
            export type { AttachmentOptionsType } from './plugins/attachment';
         | 
| 810 810 | 
             
            export type { InsertAttachmentUploadErrorType } from './plugins/attachment/insertAttachment/props';
         | 
    
        package/package.json
    CHANGED
    
    
| @@ -11,7 +11,7 @@ | |
| 11 11 | 
             
            	</Teleport>
         | 
| 12 12 | 
             
            </template>
         | 
| 13 13 | 
             
            <script setup lang="ts">
         | 
| 14 | 
            -
            import { computed, getCurrentInstance, nextTick,  | 
| 14 | 
            +
            import { computed, getCurrentInstance, nextTick, onMounted, ref } from 'vue'
         | 
| 15 15 | 
             
            import { element as DapElement, event as DapEvent } from 'dap-util'
         | 
| 16 16 | 
             
            import Triangle from '@/components/triangle/triangle.vue'
         | 
| 17 17 | 
             
            import { TrianglePlacementType } from '@/components/triangle/props'
         | 
| @@ -29,8 +29,6 @@ const realPlacement = ref<LayerPlacementType | null>(null) | |
| 29 29 | 
             
            const wrapRef = ref<HTMLElement | null>(null)
         | 
| 30 30 | 
             
            const elRef = ref<HTMLElement | null>(null)
         | 
| 31 31 | 
             
            const triangleRef = ref<InstanceType<typeof Triangle> | null>(null)
         | 
| 32 | 
            -
            const MOUSEDOWN = ref<boolean>(false)
         | 
| 33 | 
            -
            const MOUSEMOVE = ref<boolean>(false)
         | 
| 34 32 |  | 
| 35 33 | 
             
            //三角形位置
         | 
| 36 34 | 
             
            const triPlacement = computed<TrianglePlacementType>(() => {
         | 
| @@ -576,10 +574,6 @@ const handleResize = () => { | |
| 576 574 | 
             
            }
         | 
| 577 575 | 
             
            //点击定位元素和自身以外的元素关闭浮层
         | 
| 578 576 | 
             
            const handleClick = (e: Event) => {
         | 
| 579 | 
            -
            	//如果鼠标移动了则不是点击事件
         | 
| 580 | 
            -
            	if (MOUSEMOVE.value) {
         | 
| 581 | 
            -
            		return
         | 
| 582 | 
            -
            	}
         | 
| 583 577 | 
             
            	if (!DapElement.isElement(elRef.value)) {
         | 
| 584 578 | 
             
            		return
         | 
| 585 579 | 
             
            	}
         | 
| @@ -598,25 +592,9 @@ onMounted(() => { | |
| 598 592 | 
             
            	if (props.modelValue) {
         | 
| 599 593 | 
             
            		setPosition()
         | 
| 600 594 | 
             
            	}
         | 
| 601 | 
            -
            	DapEvent.on(window, `mousedown.editify_layer_${instance.uid} | 
| 602 | 
            -
            		if (e.type == 'mousedown') {
         | 
| 603 | 
            -
            			MOUSEDOWN.value = true
         | 
| 604 | 
            -
            			MOUSEMOVE.value = false
         | 
| 605 | 
            -
            		} else if (e.type == 'mousemove') {
         | 
| 606 | 
            -
            			if (MOUSEDOWN.value) {
         | 
| 607 | 
            -
            				MOUSEMOVE.value = true
         | 
| 608 | 
            -
            			}
         | 
| 609 | 
            -
            		} else if (e.type == 'mouseup') {
         | 
| 610 | 
            -
            			MOUSEDOWN.value = false
         | 
| 611 | 
            -
            		}
         | 
| 612 | 
            -
            	})
         | 
| 613 | 
            -
             | 
| 614 | 
            -
            	DapEvent.on(window, `click.editify_layer_${instance.uid}`, handleClick)
         | 
| 595 | 
            +
            	DapEvent.on(window, `mousedown.editify_layer_${instance.uid}`, handleClick)
         | 
| 615 596 | 
             
            	DapEvent.on(window, `resize.editify_layer_${instance.uid}`, handleResize)
         | 
| 616 597 | 
             
            })
         | 
| 617 | 
            -
            onBeforeUnmount(() => {
         | 
| 618 | 
            -
            	DapEvent.off(window, `click.editify_layer_${instance.uid} resize.editify_layer_${instance.uid}`)
         | 
| 619 | 
            -
            })
         | 
| 620 598 |  | 
| 621 599 | 
             
            defineExpose({
         | 
| 622 600 | 
             
            	setPosition
         |