vue-editify 0.2.14 → 0.2.16
Sign up to get free protection for your applications and to get access to all the features.
- package/examples/App.vue +41 -88
- package/lib/components/button/button.vue.d.ts +62 -60
- package/lib/components/button/index.d.ts +4 -0
- package/lib/components/button/props.d.ts +12 -1
- package/lib/components/checkbox/checkbox.vue.d.ts +9 -9
- package/lib/components/checkbox/index.d.ts +4 -0
- package/lib/components/checkbox/props.d.ts +2 -2
- package/lib/components/colors/colors.vue.d.ts +4 -4
- package/lib/components/colors/index.d.ts +4 -0
- package/lib/components/colors/props.d.ts +2 -2
- package/lib/components/icon/index.d.ts +4 -0
- package/lib/components/insertAttachment/index.d.ts +4 -0
- package/lib/{plugins/attachment → components}/insertAttachment/insertAttachment.vue.d.ts +3 -3
- package/lib/{plugins/attachment → components}/insertAttachment/props.d.ts +1 -1
- package/lib/components/insertImage/index.d.ts +4 -0
- package/lib/components/insertImage/insertImage.vue.d.ts +3 -3
- package/lib/components/insertImage/props.d.ts +1 -1
- package/lib/components/insertLink/index.d.ts +4 -0
- package/lib/components/insertLink/insertLink.vue.d.ts +6 -6
- package/lib/components/insertLink/props.d.ts +3 -3
- package/lib/components/insertMathformula/index.d.ts +4 -0
- package/lib/{plugins/mathformula → components}/insertMathformula/insertMathformula.vue.d.ts +3 -3
- package/lib/{plugins/mathformula → components}/insertMathformula/props.d.ts +2 -2
- package/lib/components/insertTable/index.d.ts +4 -0
- package/lib/components/insertTable/insertTable.vue.d.ts +3 -3
- package/lib/components/insertTable/props.d.ts +2 -2
- package/lib/components/insertVideo/index.d.ts +4 -0
- package/lib/components/insertVideo/insertVideo.vue.d.ts +3 -3
- package/lib/components/insertVideo/props.d.ts +1 -1
- package/lib/components/layer/index.d.ts +4 -0
- package/lib/components/layer/layer.vue.d.ts +10 -8
- package/lib/components/tooltip/index.d.ts +4 -0
- package/lib/components/tooltip/tooltip.vue.d.ts +6 -4
- package/lib/components/triangle/index.d.ts +4 -0
- package/lib/components/triangle/triangle.vue.d.ts +1 -1
- package/lib/components/updateLink/index.d.ts +4 -0
- package/lib/components/updateLink/props.d.ts +17 -0
- package/lib/components/updateLink/updateLink.vue.d.ts +38 -0
- package/lib/core/function.d.ts +113 -36
- package/lib/core/rule.d.ts +20 -0
- package/lib/core/tool.d.ts +36 -34
- package/lib/editify/editify.vue.d.ts +18 -28
- package/lib/editify/menu/index.d.ts +4 -0
- package/lib/{components → editify}/menu/menu.vue.d.ts +3 -4
- package/lib/{components → editify}/menu/props.d.ts +1 -1
- package/lib/editify/props.d.ts +3 -7
- package/lib/editify/toolbar/index.d.ts +4 -0
- package/lib/{components → editify}/toolbar/props.d.ts +2 -2
- package/lib/{components → editify}/toolbar/toolbar.vue.d.ts +53 -53
- package/lib/editify.es.js +38964 -37727
- package/lib/editify.umd.js +2 -2
- package/lib/feature/align.d.ts +32 -0
- package/lib/feature/attachment.d.ts +18 -0
- package/lib/feature/backColor.d.ts +32 -0
- package/lib/feature/bold.d.ts +32 -0
- package/lib/feature/code.d.ts +32 -0
- package/lib/feature/codeBlock.d.ts +32 -0
- package/lib/feature/fontFamily.d.ts +32 -0
- package/lib/feature/fontSize.d.ts +32 -0
- package/lib/feature/foreColor.d.ts +32 -0
- package/lib/feature/formatClear.d.ts +32 -0
- package/lib/feature/fullScreen.d.ts +18 -0
- package/lib/feature/heading.d.ts +32 -0
- package/lib/feature/image.d.ts +32 -0
- package/lib/feature/indent.d.ts +18 -0
- package/lib/feature/infoBlock.d.ts +18 -0
- package/lib/feature/italic.d.ts +32 -0
- package/lib/feature/lineHeight.d.ts +32 -0
- package/lib/feature/link.d.ts +26 -0
- package/lib/feature/mathformula.d.ts +22 -0
- package/lib/feature/orderList.d.ts +32 -0
- package/lib/feature/panel.d.ts +18 -0
- package/lib/feature/quote.d.ts +18 -0
- package/lib/feature/redo.d.ts +18 -0
- package/lib/feature/separator.d.ts +18 -0
- package/lib/feature/sourceView.d.ts +18 -0
- package/lib/feature/strikethrough.d.ts +32 -0
- package/lib/feature/sub.d.ts +32 -0
- package/lib/feature/super.d.ts +32 -0
- package/lib/feature/table.d.ts +32 -0
- package/lib/feature/task.d.ts +32 -0
- package/lib/feature/underline.d.ts +32 -0
- package/lib/feature/undo.d.ts +18 -0
- package/lib/feature/unorderList.d.ts +32 -0
- package/lib/feature/video.d.ts +38 -0
- package/lib/index.d.ts +194 -202
- package/package.json +5 -5
- package/src/components/button/button.vue +21 -24
- package/src/components/button/index.ts +5 -0
- package/src/components/button/props.ts +14 -1
- package/src/components/checkbox/checkbox.vue +1 -1
- package/src/components/checkbox/index.ts +5 -0
- package/src/components/checkbox/props.ts +1 -1
- package/src/components/colors/colors.vue +3 -3
- package/src/components/colors/index.ts +5 -0
- package/src/components/colors/props.ts +2 -2
- package/src/components/icon/index.ts +5 -0
- package/src/components/insertAttachment/index.ts +5 -0
- package/src/{plugins/attachment → components}/insertAttachment/insertAttachment.vue +4 -2
- package/src/{plugins/attachment → components}/insertAttachment/props.ts +1 -1
- package/src/components/insertImage/index.ts +5 -0
- package/src/components/insertImage/insertImage.vue +5 -5
- package/src/components/insertImage/props.ts +1 -1
- package/src/components/insertLink/index.ts +5 -0
- package/src/components/insertLink/insertLink.vue +10 -10
- package/src/components/insertLink/props.ts +3 -3
- package/src/components/insertMathformula/index.ts +5 -0
- package/src/{plugins/mathformula → components}/insertMathformula/props.ts +2 -2
- package/src/components/insertTable/index.ts +5 -0
- package/src/components/insertTable/props.ts +2 -2
- package/src/components/insertVideo/index.ts +5 -0
- package/src/components/insertVideo/insertVideo.vue +2 -2
- package/src/components/insertVideo/props.ts +1 -1
- package/src/components/layer/index.ts +5 -0
- package/src/components/layer/layer.vue +42 -4
- package/src/components/tooltip/index.ts +5 -0
- package/src/components/tooltip/tooltip.vue +1 -1
- package/src/components/triangle/index.ts +5 -0
- package/src/components/triangle/triangle.vue +1 -1
- package/src/components/updateLink/index.ts +5 -0
- package/src/components/updateLink/props.ts +21 -0
- package/src/components/{toolbar/toolbar.less → updateLink/updateLink.less} +4 -20
- package/src/components/updateLink/updateLink.vue +74 -0
- package/src/core/function.ts +289 -97
- package/src/core/rule.ts +108 -29
- package/src/core/tool.ts +237 -81
- package/src/editify/editify.less +4 -0
- package/src/editify/editify.vue +183 -194
- package/src/editify/menu/index.ts +5 -0
- package/src/editify/menu/menu.vue +215 -0
- package/src/{components → editify}/menu/props.ts +1 -1
- package/src/editify/props.ts +7 -11
- package/src/editify/toolbar/index.ts +5 -0
- package/src/{components → editify}/toolbar/props.ts +1 -1
- package/src/editify/toolbar/toolbar.less +10 -0
- package/src/editify/toolbar/toolbar.vue +103 -0
- package/src/feature/align.ts +126 -0
- package/src/feature/attachment.ts +108 -0
- package/src/feature/backColor.ts +169 -0
- package/src/feature/bold.ts +134 -0
- package/src/feature/code.ts +134 -0
- package/src/feature/codeBlock.ts +201 -0
- package/src/feature/fontFamily.ts +138 -0
- package/src/feature/fontSize.ts +140 -0
- package/src/feature/foreColor.ts +171 -0
- package/src/feature/formatClear.ts +116 -0
- package/src/feature/fullScreen.ts +57 -0
- package/src/feature/heading.ts +152 -0
- package/src/feature/image.ts +222 -0
- package/src/feature/indent.ts +72 -0
- package/src/feature/infoBlock.ts +93 -0
- package/src/feature/italic.ts +134 -0
- package/src/feature/lineHeight.ts +163 -0
- package/src/feature/link.ts +146 -0
- package/src/feature/mathformula.ts +146 -0
- package/src/feature/orderList.ts +114 -0
- package/src/feature/panel.ts +107 -0
- package/src/feature/quote.ts +60 -0
- package/src/feature/redo.ts +56 -0
- package/src/feature/separator.ts +61 -0
- package/src/feature/sourceView.ts +59 -0
- package/src/feature/strikethrough.ts +134 -0
- package/src/feature/sub.ts +134 -0
- package/src/feature/super.ts +134 -0
- package/src/feature/table.ts +981 -0
- package/src/feature/task.ts +114 -0
- package/src/feature/underline.ts +134 -0
- package/src/feature/undo.ts +56 -0
- package/src/feature/unorderList.ts +114 -0
- package/src/feature/video.ts +335 -0
- package/src/hljs/index.ts +1 -1
- package/src/index.ts +82 -25
- package/src/locale/en_US.ts +3 -3
- package/src/locale/zh_CN.ts +3 -3
- package/lib/plugins/attachment/index.d.ts +0 -37
- package/lib/plugins/infoBlock/index.d.ts +0 -55
- package/lib/plugins/mathformula/index.d.ts +0 -49
- package/lib/plugins/panel/index.d.ts +0 -48
- package/src/components/menu/menu.vue +0 -1655
- package/src/components/toolbar/toolbar.vue +0 -1677
- package/src/plugins/attachment/index.ts +0 -237
- package/src/plugins/infoBlock/index.ts +0 -238
- package/src/plugins/mathformula/index.ts +0 -295
- package/src/plugins/panel/index.ts +0 -228
- package/tsconfig.json +0 -31
- package/tsconfig.node.json +0 -11
- /package/src/{plugins/attachment → components}/insertAttachment/insertAttachment.less +0 -0
- /package/src/{plugins/mathformula → components}/insertMathformula/insertMathformula.less +0 -0
- /package/src/{plugins/mathformula → components}/insertMathformula/insertMathformula.vue +0 -0
- /package/src/{components → editify}/menu/menu.less +0 -0
@@ -1,20 +1,9 @@
|
|
1
|
-
.editify-
|
2
|
-
display: flex;
|
3
|
-
justify-content: flex-start;
|
4
|
-
align-items: center;
|
5
|
-
padding: 6px 10px;
|
6
|
-
|
7
|
-
.editify-icon-rotate {
|
8
|
-
transform: rotate(180deg);
|
9
|
-
}
|
10
|
-
}
|
11
|
-
|
12
|
-
.editify-toolbar-link {
|
1
|
+
.editify-link {
|
13
2
|
display: block;
|
14
3
|
width: 280px;
|
15
4
|
padding: 4px;
|
16
5
|
|
17
|
-
.editify-
|
6
|
+
.editify-link-label {
|
18
7
|
display: block;
|
19
8
|
text-align: left;
|
20
9
|
margin-bottom: 10px;
|
@@ -46,14 +35,9 @@
|
|
46
35
|
font-size: inherit;
|
47
36
|
vertical-align: middle;
|
48
37
|
}
|
49
|
-
|
50
|
-
&[disabled] {
|
51
|
-
background-color: transparent;
|
52
|
-
opacity: 0.6;
|
53
|
-
}
|
54
38
|
}
|
55
39
|
|
56
|
-
.editify-
|
40
|
+
.editify-link-footer {
|
57
41
|
display: flex;
|
58
42
|
justify-content: space-between;
|
59
43
|
align-items: center;
|
@@ -61,7 +45,7 @@
|
|
61
45
|
font-size: var(--editify-font-size);
|
62
46
|
color: var(--editify-font-color-light);
|
63
47
|
|
64
|
-
.editify-
|
48
|
+
.editify-link-operations {
|
65
49
|
display: flex;
|
66
50
|
justify-content: flex-start;
|
67
51
|
align-items: center;
|
@@ -0,0 +1,74 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="editify-link">
|
3
|
+
<div class="editify-link-label">{{ $editTrans('linkAddress') }}</div>
|
4
|
+
<input @change="modifyLink" @focus="handleInputFocus" @blur="handleInputBlur" :placeholder="$editTrans('linkUrlEnterPlaceholder')" v-model.trim="url" type="url" />
|
5
|
+
<div class="editify-link-footer">
|
6
|
+
<Checkbox @change="modifyLink" v-model="newOpen" :label="$editTrans('newWindowOpen')" :color="color" :size="10"></Checkbox>
|
7
|
+
<div class="editify-link-operations">
|
8
|
+
<span @click="removeLink">{{ $editTrans('removeLink') }}</span>
|
9
|
+
<a :href="url" target="_blank" :style="{ color: color || '' }">{{ $editTrans('viewLink') }}</a>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</template>
|
14
|
+
<script setup lang="ts">
|
15
|
+
import { inject, onBeforeUnmount, ref, watch } from 'vue'
|
16
|
+
import { Checkbox } from '@/components/checkbox'
|
17
|
+
import { UpdateLinkProps } from './props'
|
18
|
+
|
19
|
+
defineOptions({
|
20
|
+
name: 'UpdateLink'
|
21
|
+
})
|
22
|
+
const props = defineProps(UpdateLinkProps)
|
23
|
+
const emits = defineEmits(['remove', 'modify'])
|
24
|
+
|
25
|
+
const $editTrans = inject<(key: string) => any>('$editTrans')!
|
26
|
+
|
27
|
+
//链接地址
|
28
|
+
const url = ref<string>('')
|
29
|
+
//是否新窗口打开
|
30
|
+
const newOpen = ref<boolean>(false)
|
31
|
+
|
32
|
+
watch(
|
33
|
+
() => props.presetNewOpen,
|
34
|
+
newVal => {
|
35
|
+
newOpen.value = !!newVal
|
36
|
+
},
|
37
|
+
{
|
38
|
+
immediate: true
|
39
|
+
}
|
40
|
+
)
|
41
|
+
watch(
|
42
|
+
() => props.presetUrl,
|
43
|
+
newVal => {
|
44
|
+
url.value = newVal || ''
|
45
|
+
},
|
46
|
+
{
|
47
|
+
immediate: true
|
48
|
+
}
|
49
|
+
)
|
50
|
+
//输入框获取焦点
|
51
|
+
const handleInputFocus = (e: Event) => {
|
52
|
+
if (props.color) {
|
53
|
+
;(e.currentTarget as HTMLInputElement).style.borderColor = props.color
|
54
|
+
}
|
55
|
+
}
|
56
|
+
//输入框失去焦点
|
57
|
+
const handleInputBlur = (e: Event) => {
|
58
|
+
;(e.currentTarget as HTMLInputElement).style.borderColor = ''
|
59
|
+
}
|
60
|
+
//移除链接
|
61
|
+
const removeLink = () => {
|
62
|
+
emits('remove')
|
63
|
+
}
|
64
|
+
//修改链接
|
65
|
+
const modifyLink = () => {
|
66
|
+
emits('modify', url.value, newOpen.value)
|
67
|
+
}
|
68
|
+
|
69
|
+
//组件销毁前触发修改,解决组件销毁时change事件触发不了emits的问题
|
70
|
+
onBeforeUnmount(() => {
|
71
|
+
emits('modify', url.value, newOpen.value)
|
72
|
+
})
|
73
|
+
</script>
|
74
|
+
<style scoped src="./updateLink.less"></style>
|