vue-editify 0.2.19 → 0.2.21
Sign up to get free protection for your applications and to get access to all the features.
- package/examples/App.vue +10 -1
- package/lib/components/button/button.vue.d.ts +1 -0
- package/lib/core/tool.d.ts +1 -1
- package/lib/editify/menu/menu.vue.d.ts +8 -1
- package/lib/editify.es.js +274 -252
- package/lib/editify.umd.js +2 -2
- package/lib/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/button/button.vue +2 -1
- package/src/core/shortcut.ts +48 -201
- package/src/core/tool.ts +1 -1
- package/src/editify/editify.vue +20 -4
- package/src/editify/menu/menu.vue +15 -6
- package/src/editify/toolbar/toolbar.vue +1 -1
- package/src/feature/align.ts +9 -2
- package/src/feature/attachment.ts +5 -1
- package/src/feature/backColor.ts +7 -1
- package/src/feature/bold.ts +8 -1
- package/src/feature/code.ts +8 -1
- package/src/feature/codeBlock.ts +8 -1
- package/src/feature/fontFamily.ts +10 -1
- package/src/feature/fontSize.ts +8 -1
- package/src/feature/foreColor.ts +5 -1
- package/src/feature/formatClear.ts +8 -1
- package/src/feature/fullScreen.ts +9 -2
- package/src/feature/heading.ts +9 -2
- package/src/feature/image.ts +5 -1
- package/src/feature/indent.ts +9 -2
- package/src/feature/infoBlock.ts +9 -2
- package/src/feature/italic.ts +8 -1
- package/src/feature/lineHeight.ts +9 -2
- package/src/feature/link.ts +5 -1
- package/src/feature/mathformula.ts +5 -1
- package/src/feature/orderList.ts +9 -2
- package/src/feature/quote.ts +9 -2
- package/src/feature/redo.ts +9 -2
- package/src/feature/separator.ts +9 -2
- package/src/feature/sourceView.ts +9 -2
- package/src/feature/strikethrough.ts +8 -1
- package/src/feature/sub.ts +8 -1
- package/src/feature/super.ts +8 -1
- package/src/feature/table.ts +5 -1
- package/src/feature/task.ts +9 -2
- package/src/feature/underline.ts +8 -1
- package/src/feature/undo.ts +9 -2
- package/src/feature/unorderList.ts +9 -2
- package/src/feature/video.ts +5 -1
- package/src/index.ts +1 -1
package/examples/App.vue
CHANGED
@@ -22,7 +22,11 @@ const menuConfig = ref({
|
|
22
22
|
sourceView: {
|
23
23
|
show: true
|
24
24
|
},
|
25
|
-
heading: {
|
25
|
+
heading: {
|
26
|
+
shortcut: {
|
27
|
+
operation: null
|
28
|
+
}
|
29
|
+
},
|
26
30
|
fullScreen: {
|
27
31
|
show: true
|
28
32
|
},
|
@@ -49,6 +53,11 @@ const menuConfig = ref({
|
|
49
53
|
default: () => h('span', dark.value ? '深色模式' : '浅色模式'),
|
50
54
|
onOperate: () => {
|
51
55
|
dark.value = !dark.value
|
56
|
+
},
|
57
|
+
shortcut: {
|
58
|
+
title: 'Command + ]',
|
59
|
+
define: event => event.key == ']' && event.metaKey,
|
60
|
+
useDefault: true
|
52
61
|
}
|
53
62
|
}
|
54
63
|
}
|
@@ -345,6 +345,7 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
345
345
|
default?(_: {}): any;
|
346
346
|
};
|
347
347
|
}) | null>;
|
348
|
+
handleClick: () => void;
|
348
349
|
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
349
350
|
operate: (...args: any[]) => void;
|
350
351
|
layerShow: (...args: any[]) => void;
|
package/lib/core/tool.d.ts
CHANGED
@@ -23,7 +23,7 @@ export type ShortcutType = {
|
|
23
23
|
define: ((event: KeyboardEvent) => boolean | {
|
24
24
|
[code: string]: boolean;
|
25
25
|
}) | null;
|
26
|
-
operation
|
26
|
+
operation: ((editor: AlexEditor, dataRangeCaches: AlexElementsRangeType, isSourceView: Ref<boolean>, isFullScreen: Ref<boolean>, code?: string) => void) | null;
|
27
27
|
};
|
28
28
|
export interface MenuButtonType {
|
29
29
|
show?: boolean;
|
@@ -1,5 +1,9 @@
|
|
1
|
-
import { Ref } from 'vue';
|
1
|
+
import { Ref, ComponentPublicInstance } from 'vue';
|
2
|
+
import { Button } from '../../components/button';
|
2
3
|
|
4
|
+
type MenuItemComponentPublicInstance = ComponentPublicInstance & {
|
5
|
+
btnRef: InstanceType<typeof Button>;
|
6
|
+
};
|
3
7
|
declare const _default: import('vue').DefineComponent<{
|
4
8
|
config: {
|
5
9
|
type: import('vue').PropType<import('../../core/tool').MenuConfigType>;
|
@@ -15,6 +19,9 @@ declare const _default: import('vue').DefineComponent<{
|
|
15
19
|
};
|
16
20
|
}, {
|
17
21
|
height: Ref<number>;
|
22
|
+
menuItemRefs: Ref<{
|
23
|
+
[name: string]: MenuItemComponentPublicInstance;
|
24
|
+
}>;
|
18
25
|
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
19
26
|
config: {
|
20
27
|
type: import('vue').PropType<import('../../core/tool').MenuConfigType>;
|