vue-editify 0.1.39 → 0.1.41
Sign up to get free protection for your applications and to get access to all the features.
- package/examples/App.vue +11 -6
- package/lib/core/function.d.ts +18 -6
- package/lib/core/tool.d.ts +0 -6
- package/lib/editify.es.js +325 -210
- package/lib/editify.umd.js +1 -1
- package/lib/index.d.ts +4 -3
- package/lib/plugins/mathformula/index.d.ts +18 -0
- package/lib/plugins/mathformula/insertMathformula/insertMathformula.vue.d.ts +9 -0
- package/lib/plugins/mathformula/insertMathformula/props.d.ts +4 -0
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/src/components/button/button.less +1 -1
- package/src/components/icon/icon.less +1 -1
- package/src/components/menu/menu.vue +2 -2
- package/src/components/toolbar/toolbar.vue +91 -85
- package/src/core/function.ts +89 -58
- package/src/core/rule.ts +60 -4
- package/src/core/tool.ts +2 -23
- package/src/editify/editify.less +35 -3
- package/src/editify/editify.vue +37 -32
- package/src/icon/iconfont.ttf +0 -0
- package/src/icon/iconfont.woff +0 -0
- package/src/index.ts +4 -3
- package/src/locale/en_US.ts +1 -0
- package/src/locale/zh_CN.ts +1 -0
- package/src/plugins/mathformula/index.ts +114 -27
- package/src/plugins/mathformula/insertMathformula/insertMathformula.vue +12 -2
- package/src/plugins/mathformula/insertMathformula/props.ts +5 -0
package/lib/index.d.ts
CHANGED
@@ -5,13 +5,14 @@ export type { ButtonTypeType, ButtonOptionsItemType, ButtonSelectConfigType, But
|
|
5
5
|
export type { InsertImageUploadErrorType } from './components/insertImage/props';
|
6
6
|
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
|
-
export {
|
8
|
+
export type { ElementMatchConfig } from './core/function';
|
9
|
+
export { elementIsMatch, getMatchElementByElement, getMatchElementsByRange, 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
10
|
declare const install: FunctionPlugin;
|
10
|
-
declare const version = "0.1.
|
11
|
+
declare const version = "0.1.41";
|
11
12
|
export { AlexElement } from 'alex-editor';
|
12
13
|
export type { AttachmentOptionsType } from './plugins/attachment';
|
13
14
|
export type { InsertAttachmentUploadErrorType } from './plugins/attachment/insertAttachment/props';
|
14
15
|
export { attachment, isAttachment, hasAttachmentInRange } from './plugins/attachment';
|
15
16
|
export type { MathformulaOptionsType } from './plugins/mathformula';
|
16
|
-
export { mathformula, isMathformula, isUnderMathformula, getMathformulaElement } from './plugins/mathformula';
|
17
|
+
export { mathformula, isMathformula, isUnderMathformula, getMathformulaElement, hasMathformulaInRange, getMathformulaElementByRange } from './plugins/mathformula';
|
17
18
|
export { install as default, install, Editify, version };
|
@@ -7,6 +7,7 @@ export type MathformulaOptionsType = {
|
|
7
7
|
leftBorder?: boolean;
|
8
8
|
rightBorder?: boolean;
|
9
9
|
disabled?: boolean;
|
10
|
+
handleError?: (error: Error) => void;
|
10
11
|
};
|
11
12
|
/**
|
12
13
|
* 是否公式元素
|
@@ -14,7 +15,17 @@ export type MathformulaOptionsType = {
|
|
14
15
|
* @returns
|
15
16
|
*/
|
16
17
|
export declare const isMathformula: (el: AlexElement) => any;
|
18
|
+
/**
|
19
|
+
* 判断某个元素是否在公式元素内
|
20
|
+
* @param el
|
21
|
+
* @returns
|
22
|
+
*/
|
17
23
|
export declare const isUnderMathformula: (el: AlexElement) => boolean;
|
24
|
+
/**
|
25
|
+
* 根据某个元素获取所在的公式元素,如果不在公式元素内则返回null
|
26
|
+
* @param el
|
27
|
+
* @returns
|
28
|
+
*/
|
18
29
|
export declare const getMathformulaElement: (el: AlexElement) => AlexElement | null;
|
19
30
|
/**
|
20
31
|
* 选区是否含有公式元素
|
@@ -23,6 +34,13 @@ export declare const getMathformulaElement: (el: AlexElement) => AlexElement | n
|
|
23
34
|
* @returns
|
24
35
|
*/
|
25
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;
|
26
44
|
/**
|
27
45
|
* 数学公式插件
|
28
46
|
* @param options
|
@@ -3,6 +3,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
3
3
|
type: import('vue').PropType<string | null>;
|
4
4
|
default: string;
|
5
5
|
};
|
6
|
+
defaultLaTexContent: {
|
7
|
+
type: StringConstructor;
|
8
|
+
default: string;
|
9
|
+
};
|
6
10
|
}, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
7
11
|
insert: (...args: any[]) => void;
|
8
12
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
@@ -10,9 +14,14 @@ declare const _default: import('vue').DefineComponent<{
|
|
10
14
|
type: import('vue').PropType<string | null>;
|
11
15
|
default: string;
|
12
16
|
};
|
17
|
+
defaultLaTexContent: {
|
18
|
+
type: StringConstructor;
|
19
|
+
default: string;
|
20
|
+
};
|
13
21
|
}>> & {
|
14
22
|
onInsert?: ((...args: any[]) => any) | undefined;
|
15
23
|
}, {
|
16
24
|
color: string | null;
|
25
|
+
defaultLaTexContent: string;
|
17
26
|
}, {}>;
|
18
27
|
export default _default;
|
@@ -5,5 +5,9 @@ export declare const InsertMathformulaProps: {
|
|
5
5
|
type: PropType<string | null>;
|
6
6
|
default: string;
|
7
7
|
};
|
8
|
+
defaultLaTexContent: {
|
9
|
+
type: StringConstructor;
|
10
|
+
default: string;
|
11
|
+
};
|
8
12
|
};
|
9
13
|
export type InsertMathformulaPropsType = ExtractPublicPropTypes<typeof InsertMathformulaProps>;
|