vue-editify 0.1.37 → 0.1.40
Sign up to get free protection for your applications and to get access to all the features.
- package/examples/App.vue +6 -10
- package/lib/components/button/button.vue.d.ts +13 -13
- package/lib/components/button/props.d.ts +1 -1
- package/lib/components/checkbox/checkbox.vue.d.ts +10 -10
- package/lib/components/checkbox/props.d.ts +1 -1
- package/lib/components/colors/colors.vue.d.ts +6 -6
- package/lib/components/colors/props.d.ts +1 -1
- package/lib/components/icon/icon.vue.d.ts +1 -1
- package/lib/components/insertImage/insertImage.vue.d.ts +11 -11
- package/lib/components/insertLink/insertLink.vue.d.ts +4 -4
- package/lib/components/insertTable/insertTable.vue.d.ts +4 -4
- package/lib/components/insertVideo/insertVideo.vue.d.ts +11 -11
- package/lib/components/layer/layer.vue.d.ts +9 -9
- package/lib/components/menu/menu.vue.d.ts +6 -6
- package/lib/components/menu/props.d.ts +1 -1
- package/lib/components/toolbar/props.d.ts +1 -1
- package/lib/components/toolbar/toolbar.vue.d.ts +11 -11
- package/lib/components/tooltip/tooltip.vue.d.ts +1 -1
- package/lib/components/triangle/triangle.vue.d.ts +4 -4
- package/lib/core/function.d.ts +1 -1
- package/lib/core/rule.d.ts +1 -1
- package/lib/core/tool.d.ts +8 -11
- package/lib/editify/editify.vue.d.ts +110 -84
- package/lib/editify/props.d.ts +9 -5
- package/lib/editify.es.js +15225 -404
- package/lib/editify.umd.js +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/plugins/attachment/index.d.ts +3 -2
- package/lib/plugins/attachment/insertAttachment/insertAttachment.vue.d.ts +11 -11
- package/lib/plugins/mathformula/index.d.ts +49 -0
- package/lib/plugins/mathformula/insertMathformula/insertMathformula.vue.d.ts +27 -0
- package/lib/plugins/mathformula/insertMathformula/props.d.ts +13 -0
- package/lib/style.css +1 -1
- package/package.json +4 -2
- package/src/components/insertImage/insertImage.less +1 -0
- package/src/components/insertLink/insertLink.less +1 -0
- package/src/components/insertVideo/insertVideo.less +1 -0
- package/src/core/function.ts +4 -12
- package/src/core/rule.ts +7 -0
- package/src/core/tool.ts +3 -33
- package/src/editify/editify.less +28 -3
- package/src/editify/editify.vue +111 -26
- package/src/editify/props.ts +11 -4
- package/src/icon/iconfont.css +4 -0
- package/src/icon/iconfont.ttf +0 -0
- package/src/icon/iconfont.woff +0 -0
- package/src/index.ts +4 -1
- package/src/locale/en_US.ts +6 -1
- package/src/locale/zh_CN.ts +7 -2
- package/src/plugins/attachment/index.ts +26 -15
- package/src/plugins/attachment/insertAttachment/insertAttachment.less +1 -0
- package/src/plugins/mathformula/index.ts +298 -0
- package/src/plugins/mathformula/insertMathformula/insertMathformula.less +64 -0
- package/src/plugins/mathformula/insertMathformula/insertMathformula.vue +50 -0
- package/src/plugins/mathformula/insertMathformula/props.ts +16 -0
package/lib/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { default as Editify } from './editify/editify.vue';
|
2
1
|
import { FunctionPlugin } from 'vue';
|
2
|
+
import { default as Editify } from './editify/editify.vue';
|
3
3
|
|
4
4
|
export type { ButtonTypeType, ButtonOptionsItemType, ButtonSelectConfigType, ButtonDisplayConfigType } from './components/button/props';
|
5
5
|
export type { InsertImageUploadErrorType } from './components/insertImage/props';
|
@@ -7,9 +7,11 @@ export type { InsertVideoUploadErrorType } from './components/insertVideo/props'
|
|
7
7
|
export type { MenuButtonType, MenuSelectButtonType, MenuDisplayButtonType, MenuImageButtonType, MenuVideoButtonType, MenuTableButtonType, MenuCustomButtonType, CodeBlockToolbarType, TextToolbarType, ToolbarConfigType, MenuSequenceType, MenuModeType, MenuExtendType, MenuConfigType, PluginType, PluginResultType } from './core/tool';
|
8
8
|
export { getParsedomElementByElement, getCurrentParsedomElement, elementIsInList, elementIsInTask, isList, isTask, hasPreInRange, isRangeInPre, hasQuoteInRange, isRangeInQuote, hasListInRange, isRangeInList, hasTaskInRange, isRangeInTask, hasLinkInRange, hasTableInRange, hasImageInRange, hasVideoInRange, queryTextStyle, queryTextMark, getRangeText, setIndentIncrease, setIndentDecrease, setQuote, setAlign, setList, setTask, setTextStyle, setTextMark, removeTextStyle, removeTextMark, setLineHeight, insertLink, insertImage, insertVideo, insertTable, insertCodeBlock } from './core/function';
|
9
9
|
declare const install: FunctionPlugin;
|
10
|
-
declare const version = "0.1.
|
10
|
+
declare const version = "0.1.40";
|
11
11
|
export { AlexElement } from 'alex-editor';
|
12
12
|
export type { AttachmentOptionsType } from './plugins/attachment';
|
13
13
|
export type { InsertAttachmentUploadErrorType } from './plugins/attachment/insertAttachment/props';
|
14
14
|
export { attachment, isAttachment, hasAttachmentInRange } from './plugins/attachment';
|
15
|
+
export type { MathformulaOptionsType } from './plugins/mathformula';
|
16
|
+
export { mathformula, isMathformula, isUnderMathformula, getMathformulaElement, hasMathformulaInRange, getMathformulaElementByRange } from './plugins/mathformula';
|
15
17
|
export { install as default, install, Editify, version };
|
@@ -1,12 +1,13 @@
|
|
1
|
-
import { InsertAttachmentUploadErrorType } from './insertAttachment/props';
|
2
|
-
import { PluginType } from '../../core/tool';
|
3
1
|
import { AlexEditor, AlexElement, AlexElementsRangeType } from 'alex-editor';
|
2
|
+
import { PluginType } from '../../core/tool';
|
3
|
+
import { InsertAttachmentUploadErrorType } from './insertAttachment/props';
|
4
4
|
|
5
5
|
export type AttachmentOptionsType = {
|
6
6
|
sequence?: number;
|
7
7
|
title?: string;
|
8
8
|
leftBorder?: boolean;
|
9
9
|
rightBorder?: boolean;
|
10
|
+
disabled?: boolean;
|
10
11
|
accept?: string;
|
11
12
|
allowedFileType?: string[];
|
12
13
|
multiple?: boolean;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
declare const _default: import('vue').DefineComponent<{
|
2
2
|
color: {
|
3
|
-
type: import(
|
3
|
+
type: import('vue').PropType<string | null>;
|
4
4
|
default: string;
|
5
5
|
};
|
6
6
|
accept: {
|
@@ -8,7 +8,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
8
8
|
default: null;
|
9
9
|
};
|
10
10
|
allowedFileType: {
|
11
|
-
type: import(
|
11
|
+
type: import('vue').PropType<string[]>;
|
12
12
|
default: null;
|
13
13
|
};
|
14
14
|
multiple: {
|
@@ -24,19 +24,19 @@ declare const _default: import('vue').DefineComponent<{
|
|
24
24
|
default: null;
|
25
25
|
};
|
26
26
|
customUpload: {
|
27
|
-
type: import(
|
27
|
+
type: import('vue').PropType<(files: File[]) => string[] | Promise<string[]>>;
|
28
28
|
default: null;
|
29
29
|
};
|
30
30
|
handleError: {
|
31
|
-
type: import(
|
31
|
+
type: import('vue').PropType<(error: import('./props').InsertAttachmentUploadErrorType, file: File) => void>;
|
32
32
|
default: null;
|
33
33
|
};
|
34
|
-
}, {}, unknown, {}, {}, import(
|
34
|
+
}, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
35
35
|
insert: (...args: any[]) => void;
|
36
36
|
change: (...args: any[]) => void;
|
37
|
-
}, string, import(
|
37
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
38
38
|
color: {
|
39
|
-
type: import(
|
39
|
+
type: import('vue').PropType<string | null>;
|
40
40
|
default: string;
|
41
41
|
};
|
42
42
|
accept: {
|
@@ -44,7 +44,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
44
44
|
default: null;
|
45
45
|
};
|
46
46
|
allowedFileType: {
|
47
|
-
type: import(
|
47
|
+
type: import('vue').PropType<string[]>;
|
48
48
|
default: null;
|
49
49
|
};
|
50
50
|
multiple: {
|
@@ -60,11 +60,11 @@ declare const _default: import('vue').DefineComponent<{
|
|
60
60
|
default: null;
|
61
61
|
};
|
62
62
|
customUpload: {
|
63
|
-
type: import(
|
63
|
+
type: import('vue').PropType<(files: File[]) => string[] | Promise<string[]>>;
|
64
64
|
default: null;
|
65
65
|
};
|
66
66
|
handleError: {
|
67
|
-
type: import(
|
67
|
+
type: import('vue').PropType<(error: import('./props').InsertAttachmentUploadErrorType, file: File) => void>;
|
68
68
|
default: null;
|
69
69
|
};
|
70
70
|
}>> & {
|
@@ -77,7 +77,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
77
77
|
maxSize: number;
|
78
78
|
minSize: number;
|
79
79
|
customUpload: (files: File[]) => string[] | Promise<string[]>;
|
80
|
-
handleError: (error: import(
|
80
|
+
handleError: (error: import('./props').InsertAttachmentUploadErrorType, file: File) => void;
|
81
81
|
accept: string;
|
82
82
|
}, {}>;
|
83
83
|
export default _default;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { PluginType } from '../../core/tool';
|
2
|
+
import { AlexEditor, AlexElement, AlexElementsRangeType } from 'alex-editor';
|
3
|
+
|
4
|
+
export type MathformulaOptionsType = {
|
5
|
+
sequence?: number;
|
6
|
+
title?: string;
|
7
|
+
leftBorder?: boolean;
|
8
|
+
rightBorder?: boolean;
|
9
|
+
disabled?: boolean;
|
10
|
+
handleError?: (error: Error) => void;
|
11
|
+
};
|
12
|
+
/**
|
13
|
+
* 是否公式元素
|
14
|
+
* @param el
|
15
|
+
* @returns
|
16
|
+
*/
|
17
|
+
export declare const isMathformula: (el: AlexElement) => any;
|
18
|
+
/**
|
19
|
+
* 判断某个元素是否在公式元素内
|
20
|
+
* @param el
|
21
|
+
* @returns
|
22
|
+
*/
|
23
|
+
export declare const isUnderMathformula: (el: AlexElement) => boolean;
|
24
|
+
/**
|
25
|
+
* 根据某个元素获取所在的公式元素,如果不在公式元素内则返回null
|
26
|
+
* @param el
|
27
|
+
* @returns
|
28
|
+
*/
|
29
|
+
export declare const getMathformulaElement: (el: AlexElement) => AlexElement | null;
|
30
|
+
/**
|
31
|
+
* 选区是否含有公式元素
|
32
|
+
* @param editor
|
33
|
+
* @param dataRangeCaches
|
34
|
+
* @returns
|
35
|
+
*/
|
36
|
+
export declare const hasMathformulaInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
37
|
+
/**
|
38
|
+
* 选区是否在某个公式元素下,如果是返回该公式元素否则返回null
|
39
|
+
* @param editor
|
40
|
+
* @param dataRangeCaches
|
41
|
+
* @returns
|
42
|
+
*/
|
43
|
+
export declare const getMathformulaElementByRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => AlexElement | null;
|
44
|
+
/**
|
45
|
+
* 数学公式插件
|
46
|
+
* @param options
|
47
|
+
* @returns
|
48
|
+
*/
|
49
|
+
export declare const mathformula: (options?: MathformulaOptionsType) => PluginType;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{
|
2
|
+
color: {
|
3
|
+
type: import('vue').PropType<string | null>;
|
4
|
+
default: string;
|
5
|
+
};
|
6
|
+
defaultLaTexContent: {
|
7
|
+
type: StringConstructor;
|
8
|
+
default: string;
|
9
|
+
};
|
10
|
+
}, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
11
|
+
insert: (...args: any[]) => void;
|
12
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
13
|
+
color: {
|
14
|
+
type: import('vue').PropType<string | null>;
|
15
|
+
default: string;
|
16
|
+
};
|
17
|
+
defaultLaTexContent: {
|
18
|
+
type: StringConstructor;
|
19
|
+
default: string;
|
20
|
+
};
|
21
|
+
}>> & {
|
22
|
+
onInsert?: ((...args: any[]) => any) | undefined;
|
23
|
+
}, {
|
24
|
+
color: string | null;
|
25
|
+
defaultLaTexContent: string;
|
26
|
+
}, {}>;
|
27
|
+
export default _default;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { ExtractPublicPropTypes, PropType } from 'vue';
|
2
|
+
|
3
|
+
export declare const InsertMathformulaProps: {
|
4
|
+
color: {
|
5
|
+
type: PropType<string | null>;
|
6
|
+
default: string;
|
7
|
+
};
|
8
|
+
defaultLaTexContent: {
|
9
|
+
type: StringConstructor;
|
10
|
+
default: string;
|
11
|
+
};
|
12
|
+
};
|
13
|
+
export type InsertMathformulaPropsType = ExtractPublicPropTypes<typeof InsertMathformulaProps>;
|