vue-editify 0.1.46 → 0.1.48
Sign up to get free protection for your applications and to get access to all the features.
- package/examples/App.vue +30 -51
- package/lib/core/function.d.ts +50 -63
- package/lib/editify.es.js +18653 -18044
- package/lib/editify.umd.js +1 -1
- package/lib/index.d.ts +6 -2
- package/lib/plugins/infoBlock/index.d.ts +55 -0
- package/lib/plugins/panel/index.d.ts +48 -0
- package/lib/style.css +1 -1
- package/package.json +2 -2
- package/src/components/menu/menu.vue +14 -13
- package/src/components/toolbar/toolbar.vue +146 -111
- package/src/core/function.ts +249 -183
- package/src/core/rule.ts +78 -48
- package/src/editify/editify.less +52 -1
- package/src/editify/editify.vue +29 -29
- package/src/icon/iconfont.css +8 -0
- package/src/icon/iconfont.ttf +0 -0
- package/src/icon/iconfont.woff +0 -0
- package/src/index.ts +8 -2
- package/src/locale/en_US.ts +9 -1
- package/src/locale/zh_CN.ts +9 -1
- package/src/plugins/attachment/index.ts +10 -6
- package/src/plugins/infoBlock/index.ts +238 -0
- package/src/plugins/mathformula/index.ts +1 -3
- package/src/plugins/panel/index.ts +228 -0
package/lib/index.d.ts
CHANGED
@@ -6,13 +6,17 @@ 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
8
|
export type { ElementMatchConfigType } from './core/function';
|
9
|
-
export { elementIsMatch, getMatchElementByElement,
|
9
|
+
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';
|
10
10
|
declare const install: FunctionPlugin;
|
11
|
-
declare const version = "0.1.
|
11
|
+
declare const version = "0.1.48";
|
12
12
|
export { AlexElement } from 'alex-editor';
|
13
13
|
export type { AttachmentOptionsType } from './plugins/attachment';
|
14
14
|
export type { InsertAttachmentUploadErrorType } from './plugins/attachment/insertAttachment/props';
|
15
15
|
export { attachment, isAttachment, hasAttachmentInRange } from './plugins/attachment';
|
16
16
|
export type { MathformulaOptionsType } from './plugins/mathformula';
|
17
17
|
export { mathformula, isMathformula, isUnderMathformula, getMathformulaElement, hasMathformulaInRange, getMathformulaElementByRange } from './plugins/mathformula';
|
18
|
+
export type { PanelOptionsType } from './plugins/panel';
|
19
|
+
export { panel, isPanel, isUnderPanel, getPanelElement, hasPanelInRange, getPanelElementByRange } from './plugins/panel';
|
20
|
+
export type { InfoBlockOptionsType } from './plugins/infoBlock';
|
21
|
+
export { infoBlock, isInfoBlock, isUnderInfoBlock, getInfoBlockElement, hasInfoBlockInRange, getInfoBlockElementByRange } from './plugins/infoBlock';
|
18
22
|
export { install as default, install, Editify, version };
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { PluginType } from '../../core/tool';
|
2
|
+
import { AlexEditor, AlexElement, AlexElementsRangeType } from 'alex-editor';
|
3
|
+
|
4
|
+
export type InfoBlockOptionsType = {
|
5
|
+
sequence?: number;
|
6
|
+
title?: string;
|
7
|
+
leftBorder?: boolean;
|
8
|
+
rightBorder?: boolean;
|
9
|
+
disabled?: boolean;
|
10
|
+
};
|
11
|
+
/**
|
12
|
+
* 是否信息元素
|
13
|
+
* @param el
|
14
|
+
* @returns
|
15
|
+
*/
|
16
|
+
export declare const isInfoBlock: (el: AlexElement) => any;
|
17
|
+
/**
|
18
|
+
* 判断某个元素是否在信息元素内
|
19
|
+
* @param el
|
20
|
+
* @returns
|
21
|
+
*/
|
22
|
+
export declare const isUnderInfoBlock: (el: AlexElement) => boolean;
|
23
|
+
/**
|
24
|
+
* 根据某个元素获取所在的信息元素,如果不在信息元素内则返回null
|
25
|
+
* @param el
|
26
|
+
* @returns
|
27
|
+
*/
|
28
|
+
export declare const getInfoBlockElement: (el: AlexElement) => AlexElement | null;
|
29
|
+
/**
|
30
|
+
* 选区是否含有信息元素
|
31
|
+
* @param editor
|
32
|
+
* @param dataRangeCaches
|
33
|
+
* @returns
|
34
|
+
*/
|
35
|
+
export declare const hasInfoBlockInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
36
|
+
/**
|
37
|
+
* 选区是否都在信息块内
|
38
|
+
* @param editor
|
39
|
+
* @param dataRangeCaches
|
40
|
+
* @returns
|
41
|
+
*/
|
42
|
+
export declare const isRangeInInfoBlock: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
43
|
+
/**
|
44
|
+
* 选区是否在某个信息元素下,如果是返回该信息元素否则返回null
|
45
|
+
* @param editor
|
46
|
+
* @param dataRangeCaches
|
47
|
+
* @returns
|
48
|
+
*/
|
49
|
+
export declare const getInfoBlockElementByRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => AlexElement | null;
|
50
|
+
/**
|
51
|
+
* 信息插件
|
52
|
+
* @param options
|
53
|
+
* @returns
|
54
|
+
*/
|
55
|
+
export declare const infoBlock: (options?: InfoBlockOptionsType) => PluginType;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { PluginType } from '../../core/tool';
|
2
|
+
import { AlexEditor, AlexElement, AlexElementsRangeType } from 'alex-editor';
|
3
|
+
|
4
|
+
export type PanelOptionsType = {
|
5
|
+
sequence?: number;
|
6
|
+
title?: string;
|
7
|
+
leftBorder?: boolean;
|
8
|
+
rightBorder?: boolean;
|
9
|
+
disabled?: boolean;
|
10
|
+
};
|
11
|
+
/**
|
12
|
+
* 是否面板元素
|
13
|
+
* @param el
|
14
|
+
* @returns
|
15
|
+
*/
|
16
|
+
export declare const isPanel: (el: AlexElement) => any;
|
17
|
+
/**
|
18
|
+
* 判断某个元素是否在面板元素内
|
19
|
+
* @param el
|
20
|
+
* @returns
|
21
|
+
*/
|
22
|
+
export declare const isUnderPanel: (el: AlexElement) => boolean;
|
23
|
+
/**
|
24
|
+
* 根据某个元素获取所在的面板元素,如果不在面板元素内则返回null
|
25
|
+
* @param el
|
26
|
+
* @returns
|
27
|
+
*/
|
28
|
+
export declare const getPanelElement: (el: AlexElement) => AlexElement | null;
|
29
|
+
/**
|
30
|
+
* 选区是否含有面板元素
|
31
|
+
* @param editor
|
32
|
+
* @param dataRangeCaches
|
33
|
+
* @returns
|
34
|
+
*/
|
35
|
+
export declare const hasPanelInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
36
|
+
/**
|
37
|
+
* 选区是否在某个面板元素下,如果是返回该面板元素否则返回null
|
38
|
+
* @param editor
|
39
|
+
* @param dataRangeCaches
|
40
|
+
* @returns
|
41
|
+
*/
|
42
|
+
export declare const getPanelElementByRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => AlexElement | null;
|
43
|
+
/**
|
44
|
+
* 面板插件
|
45
|
+
* @param options
|
46
|
+
* @returns
|
47
|
+
*/
|
48
|
+
export declare const panel: (options?: PanelOptionsType) => PluginType;
|