vue-editify 0.1.21 → 0.1.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. package/examples/App.vue +8 -69
  2. package/examples/test.html +32 -0
  3. package/lib/components/button/button.vue.d.ts +3 -3
  4. package/lib/components/button/props.d.ts +1 -1
  5. package/lib/components/checkbox/checkbox.vue.d.ts +3 -3
  6. package/lib/components/checkbox/props.d.ts +1 -1
  7. package/lib/components/colors/colors.vue.d.ts +3 -3
  8. package/lib/components/colors/props.d.ts +1 -1
  9. package/lib/components/insertImage/insertImage.vue.d.ts +6 -6
  10. package/lib/components/insertImage/props.d.ts +2 -2
  11. package/lib/components/insertLink/insertLink.vue.d.ts +3 -3
  12. package/lib/components/insertLink/props.d.ts +2 -2
  13. package/lib/components/insertTable/insertTable.vue.d.ts +3 -3
  14. package/lib/components/insertTable/props.d.ts +2 -2
  15. package/lib/components/insertVideo/insertVideo.vue.d.ts +6 -6
  16. package/lib/components/insertVideo/props.d.ts +2 -2
  17. package/lib/components/menu/menu.vue.d.ts +3 -3
  18. package/lib/components/menu/props.d.ts +1 -1
  19. package/lib/components/toolbar/props.d.ts +1 -1
  20. package/lib/components/toolbar/toolbar.vue.d.ts +3 -3
  21. package/lib/core/rule.d.ts +1 -1
  22. package/lib/core/tool.d.ts +19 -9
  23. package/lib/editify/editify.vue.d.ts +12 -3
  24. package/lib/editify/props.d.ts +6 -2
  25. package/lib/editify.es.js +577 -188
  26. package/lib/editify.umd.js +1 -1
  27. package/lib/index.d.ts +13 -15
  28. package/lib/plugins/attachment/index.d.ts +17 -0
  29. package/lib/plugins/attachment/insertAttachment/insertAttachment.vue.d.ts +83 -0
  30. package/lib/plugins/attachment/insertAttachment/props.d.ts +38 -0
  31. package/lib/style.css +1 -1
  32. package/package.json +1 -1
  33. package/src/components/button/button.vue +4 -1
  34. package/src/components/button/props.ts +1 -1
  35. package/src/components/checkbox/props.ts +1 -1
  36. package/src/components/colors/colors.vue +1 -1
  37. package/src/components/colors/props.ts +1 -1
  38. package/src/components/insertImage/insertImage.vue +12 -10
  39. package/src/components/insertImage/props.ts +2 -2
  40. package/src/components/insertLink/insertLink.vue +1 -1
  41. package/src/components/insertLink/props.ts +2 -2
  42. package/src/components/insertTable/props.ts +2 -2
  43. package/src/components/insertVideo/insertVideo.vue +12 -10
  44. package/src/components/insertVideo/props.ts +2 -2
  45. package/src/components/menu/menu.vue +28 -13
  46. package/src/components/menu/props.ts +1 -1
  47. package/src/components/toolbar/props.ts +1 -1
  48. package/src/components/toolbar/toolbar.vue +3 -4
  49. package/src/core/function.ts +5 -5
  50. package/src/core/rule.ts +1 -1
  51. package/src/core/tool.ts +24 -11
  52. package/src/editify/editify.less +27 -0
  53. package/src/editify/editify.vue +50 -6
  54. package/src/editify/props.ts +9 -2
  55. package/src/icon/iconfont.css +4 -0
  56. package/src/icon/iconfont.ttf +0 -0
  57. package/src/icon/iconfont.woff +0 -0
  58. package/src/index.ts +23 -22
  59. package/src/locale/en_US.ts +9 -1
  60. package/src/locale/zh_CN.ts +9 -1
  61. package/src/plugins/attachment/images/attachment.png +0 -0
  62. package/src/plugins/attachment/index.ts +121 -0
  63. package/src/plugins/attachment/insertAttachment/insertAttachment.less +135 -0
  64. package/src/plugins/attachment/insertAttachment/insertAttachment.vue +189 -0
  65. package/src/plugins/attachment/insertAttachment/props.ts +48 -0
package/examples/App.vue CHANGED
@@ -1,80 +1,29 @@
1
1
  <template>
2
2
  <div style="padding: 10px; height: 100%; box-sizing: border-box">
3
- <Editify ref="editify" border v-model="val" :menu="menuConfig" style="height: 100%" placeholder="Please Enter Text..." locale="zh_CN" :customTextPaste="customTextPaste" show-word-length></Editify>
3
+ <Editify ref="editify" border v-model="val" :menu="menuConfig" style="height: 100%" placeholder="Please Enter Text..." locale="zh_CN" allow-paste-html :plugins="plugins"></Editify>
4
4
  </div>
5
5
  </template>
6
6
  <script setup lang="ts">
7
7
  import { h, ref } from 'vue'
8
- import { AlexElement, Editify, insertImage, insertVideo } from '../src/index'
9
- import { MenuConfigType } from '../src/index'
8
+ import { AlexElement, MenuConfigType, Editify, attachment, PluginType } from '../src/index'
10
9
  const val = ref<string>('<p><br></p>')
11
10
  const editify = ref<InstanceType<typeof Editify> | null>(null)
12
11
  const menuConfig = ref<MenuConfigType>({
13
12
  use: true,
14
13
  mode: 'inner',
15
- sequence: {
16
- imgList: 101
17
- },
18
- image: {
19
- accept: ['png'],
20
- handleError: (error, file) => {
21
- console.log(error, file)
22
- }
23
- },
24
14
  sourceView: {
25
15
  show: true
26
16
  },
27
17
  fullScreen: {
28
18
  show: true
29
- },
30
- extends: {
31
- imgList: {
32
- title: '自定义菜单按钮',
33
- leftBorder: true,
34
- rightBorder: false,
35
- disabled: false,
36
- active: false,
37
- type: 'select',
38
- options: [
39
- {
40
- label: '自定义功能1',
41
- value: '1',
42
- style: {
43
- color: '#f30'
44
- }
45
- },
46
- {
47
- label: '自定义功能2',
48
- value: '2',
49
- style: {
50
- fontWeight: 'bold'
51
- }
52
- },
53
- {
54
- label: '自定义功能3',
55
- value: '3'
56
- }
57
- ],
58
- onOperate: function (name, val, instance) {
59
- console.log(name, val, instance)
60
- },
61
- default: () => h('span', {}, '自定义菜单')
62
- }
63
19
  }
64
20
  })
65
- const customTextPaste = function (data: string) {
66
- const text = new AlexElement(
67
- 'text',
68
- null,
69
- null,
70
- {
71
- color: 'red',
72
- 'font-weight': 'bold'
73
- },
74
- data
75
- )
76
- editify.value!.editor!.insertElement(text)
77
- }
21
+
22
+ const plugins = ref<PluginType[]>([
23
+ attachment({
24
+ leftBorder: true
25
+ })
26
+ ])
78
27
  </script>
79
28
  <style lang="less">
80
29
  html,
@@ -89,14 +38,4 @@ body {
89
38
  height: 100%;
90
39
  overflow: auto;
91
40
  }
92
-
93
- span[data-zip] {
94
- display: inline-block;
95
- width: 40px;
96
- height: 40px;
97
- background: url(https://www.ling0523.cn/images/image_0_1702456046669.png) no-repeat center;
98
- background-size: cover;
99
- cursor: pointer;
100
- margin: 0 10px;
101
- }
102
41
  </style>
@@ -0,0 +1,32 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Document</title>
8
+ <link rel="stylesheet" href="../lib/style.css">
9
+ <script src="../node_modules/vue/dist/vue.global.prod.js"></script>
10
+ <script src="../lib/editify.umd.js"></script>
11
+ </head>
12
+
13
+ <body>
14
+ <div id="app">
15
+ <editify v-model="value" placeholder="请输入"></editify>
16
+ </div>
17
+ </body>
18
+ <script>
19
+ const { createApp } = Vue
20
+ const app = createApp({
21
+ data() {
22
+ return {
23
+ value: '<p><br></p>'
24
+ }
25
+ }
26
+ })
27
+ console.log(editify.version)
28
+ app.use(editify)
29
+ app.mount('#app')
30
+ </script>
31
+
32
+ </html>
@@ -27,7 +27,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
27
27
  default: boolean;
28
28
  };
29
29
  color: {
30
- type: StringConstructor;
30
+ type: import("vue").PropType<string | null>;
31
31
  default: string;
32
32
  };
33
33
  disabled: {
@@ -85,7 +85,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
85
85
  default: boolean;
86
86
  };
87
87
  color: {
88
- type: StringConstructor;
88
+ type: import("vue").PropType<string | null>;
89
89
  default: string;
90
90
  };
91
91
  disabled: {
@@ -114,7 +114,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
114
114
  onLayerShown?: ((...args: any[]) => any) | undefined;
115
115
  onLayerHidden?: ((...args: any[]) => any) | undefined;
116
116
  }, {
117
- color: string;
117
+ color: string | null;
118
118
  type: import("./props").ButtonTypeType;
119
119
  name: string;
120
120
  title: string;
@@ -46,7 +46,7 @@ export declare const ButtonProps: {
46
46
  default: boolean;
47
47
  };
48
48
  color: {
49
- type: StringConstructor;
49
+ type: PropType<string | null>;
50
50
  default: string;
51
51
  };
52
52
  disabled: {
@@ -27,7 +27,7 @@ declare const _default: import('vue').DefineComponent<{
27
27
  validator(value: any): boolean;
28
28
  };
29
29
  color: {
30
- type: StringConstructor;
30
+ type: import("vue").PropType<string | null>;
31
31
  default: string;
32
32
  validator(value: any): boolean;
33
33
  };
@@ -61,7 +61,7 @@ declare const _default: import('vue').DefineComponent<{
61
61
  validator(value: any): boolean;
62
62
  };
63
63
  color: {
64
- type: StringConstructor;
64
+ type: import("vue").PropType<string | null>;
65
65
  default: string;
66
66
  validator(value: any): boolean;
67
67
  };
@@ -70,7 +70,7 @@ declare const _default: import('vue').DefineComponent<{
70
70
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
71
71
  }, {
72
72
  placement: "left" | "right";
73
- color: string;
73
+ color: string | null;
74
74
  disabled: boolean;
75
75
  value: string | number | any[] | ObjectType;
76
76
  label: string;
@@ -28,7 +28,7 @@ export declare const CheckboxProps: {
28
28
  validator(value: any): boolean;
29
29
  };
30
30
  color: {
31
- type: StringConstructor;
31
+ type: PropType<string | null>;
32
32
  default: string;
33
33
  validator(value: any): boolean;
34
34
  };
@@ -10,7 +10,7 @@ declare const _default: import('vue').DefineComponent<{
10
10
  default: null;
11
11
  };
12
12
  color: {
13
- type: StringConstructor;
13
+ type: import("vue").PropType<string | null>;
14
14
  default: string;
15
15
  };
16
16
  tooltip: {
@@ -29,7 +29,7 @@ declare const _default: import('vue').DefineComponent<{
29
29
  default: null;
30
30
  };
31
31
  color: {
32
- type: StringConstructor;
32
+ type: import("vue").PropType<string | null>;
33
33
  default: string;
34
34
  };
35
35
  tooltip: {
@@ -39,7 +39,7 @@ declare const _default: import('vue').DefineComponent<{
39
39
  }>> & {
40
40
  onChange?: ((...args: any[]) => any) | undefined;
41
41
  }, {
42
- color: string;
42
+ color: string | null;
43
43
  tooltip: boolean;
44
44
  value: string;
45
45
  data: ButtonOptionsItemType[];
@@ -11,7 +11,7 @@ export declare const ColorsProps: {
11
11
  default: null;
12
12
  };
13
13
  color: {
14
- type: StringConstructor;
14
+ type: PropType<string | null>;
15
15
  default: string;
16
16
  };
17
17
  tooltip: {
@@ -1,9 +1,9 @@
1
1
  declare const _default: import('vue').DefineComponent<{
2
2
  color: {
3
- type: StringConstructor;
3
+ type: import("vue").PropType<string | null>;
4
4
  default: string;
5
5
  };
6
- accept: {
6
+ allowedFileType: {
7
7
  type: import("vue").PropType<string[]>;
8
8
  default: null;
9
9
  };
@@ -32,10 +32,10 @@ declare const _default: import('vue').DefineComponent<{
32
32
  change: (...args: any[]) => void;
33
33
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
34
34
  color: {
35
- type: StringConstructor;
35
+ type: import("vue").PropType<string | null>;
36
36
  default: string;
37
37
  };
38
- accept: {
38
+ allowedFileType: {
39
39
  type: import("vue").PropType<string[]>;
40
40
  default: null;
41
41
  };
@@ -63,8 +63,8 @@ declare const _default: import('vue').DefineComponent<{
63
63
  onChange?: ((...args: any[]) => any) | undefined;
64
64
  onInsert?: ((...args: any[]) => any) | undefined;
65
65
  }, {
66
- color: string;
67
- accept: string[];
66
+ color: string | null;
67
+ allowedFileType: string[];
68
68
  multiple: boolean;
69
69
  maxSize: number;
70
70
  minSize: number;
@@ -3,10 +3,10 @@ import { ExtractPublicPropTypes, PropType } from 'vue';
3
3
  export type InsertImageUploadErrorType = 'suffixError' | 'maxSizeError' | 'minSizeError';
4
4
  export declare const InsertImageProps: {
5
5
  color: {
6
- type: StringConstructor;
6
+ type: PropType<string | null>;
7
7
  default: string;
8
8
  };
9
- accept: {
9
+ allowedFileType: {
10
10
  type: PropType<string[]>;
11
11
  default: null;
12
12
  };
@@ -1,6 +1,6 @@
1
1
  declare const _default: import('vue').DefineComponent<{
2
2
  color: {
3
- type: StringConstructor;
3
+ type: import("vue").PropType<string | null>;
4
4
  default: string;
5
5
  };
6
6
  text: {
@@ -11,7 +11,7 @@ declare const _default: import('vue').DefineComponent<{
11
11
  insert: (...args: any[]) => void;
12
12
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
13
  color: {
14
- type: StringConstructor;
14
+ type: import("vue").PropType<string | null>;
15
15
  default: string;
16
16
  };
17
17
  text: {
@@ -21,7 +21,7 @@ declare const _default: import('vue').DefineComponent<{
21
21
  }>> & {
22
22
  onInsert?: ((...args: any[]) => any) | undefined;
23
23
  }, {
24
- color: string;
24
+ color: string | null;
25
25
  text: string;
26
26
  }, {}>;
27
27
  export default _default;
@@ -1,8 +1,8 @@
1
- import { ExtractPublicPropTypes } from 'vue';
1
+ import { ExtractPublicPropTypes, PropType } from 'vue';
2
2
 
3
3
  export declare const InsertLinkProps: {
4
4
  color: {
5
- type: StringConstructor;
5
+ type: PropType<string | null>;
6
6
  default: string;
7
7
  };
8
8
  text: {
@@ -1,6 +1,6 @@
1
1
  declare const _default: import('vue').DefineComponent<{
2
2
  color: {
3
- type: StringConstructor;
3
+ type: import("vue").PropType<string | null>;
4
4
  default: string;
5
5
  };
6
6
  maxRows: {
@@ -15,7 +15,7 @@ declare const _default: import('vue').DefineComponent<{
15
15
  insert: (...args: any[]) => void;
16
16
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
17
17
  color: {
18
- type: StringConstructor;
18
+ type: import("vue").PropType<string | null>;
19
19
  default: string;
20
20
  };
21
21
  maxRows: {
@@ -29,7 +29,7 @@ declare const _default: import('vue').DefineComponent<{
29
29
  }>> & {
30
30
  onInsert?: ((...args: any[]) => any) | undefined;
31
31
  }, {
32
- color: string;
32
+ color: string | null;
33
33
  maxRows: number;
34
34
  maxColumns: number;
35
35
  }, {}>;
@@ -1,4 +1,4 @@
1
- import { ExtractPublicPropTypes } from 'vue';
1
+ import { ExtractPublicPropTypes, PropType } from 'vue';
2
2
 
3
3
  export type InsertTableGridType = {
4
4
  x: number;
@@ -7,7 +7,7 @@ export type InsertTableGridType = {
7
7
  };
8
8
  export declare const InsertTableProps: {
9
9
  color: {
10
- type: StringConstructor;
10
+ type: PropType<string | null>;
11
11
  default: string;
12
12
  };
13
13
  maxRows: {
@@ -1,9 +1,9 @@
1
1
  declare const _default: import('vue').DefineComponent<{
2
2
  color: {
3
- type: StringConstructor;
3
+ type: import("vue").PropType<string | null>;
4
4
  default: string;
5
5
  };
6
- accept: {
6
+ allowedFileType: {
7
7
  type: import("vue").PropType<string[]>;
8
8
  default: null;
9
9
  };
@@ -32,10 +32,10 @@ declare const _default: import('vue').DefineComponent<{
32
32
  change: (...args: any[]) => void;
33
33
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
34
34
  color: {
35
- type: StringConstructor;
35
+ type: import("vue").PropType<string | null>;
36
36
  default: string;
37
37
  };
38
- accept: {
38
+ allowedFileType: {
39
39
  type: import("vue").PropType<string[]>;
40
40
  default: null;
41
41
  };
@@ -63,8 +63,8 @@ declare const _default: import('vue').DefineComponent<{
63
63
  onChange?: ((...args: any[]) => any) | undefined;
64
64
  onInsert?: ((...args: any[]) => any) | undefined;
65
65
  }, {
66
- color: string;
67
- accept: string[];
66
+ color: string | null;
67
+ allowedFileType: string[];
68
68
  multiple: boolean;
69
69
  maxSize: number;
70
70
  minSize: number;
@@ -3,10 +3,10 @@ import { ExtractPublicPropTypes, PropType } from 'vue';
3
3
  export type InsertVideoUploadErrorType = 'suffixError' | 'maxSizeError' | 'minSizeError';
4
4
  export declare const InsertVideoProps: {
5
5
  color: {
6
- type: StringConstructor;
6
+ type: PropType<string | null>;
7
7
  default: string;
8
8
  };
9
- accept: {
9
+ allowedFileType: {
10
10
  type: PropType<string[]>;
11
11
  default: null;
12
12
  };
@@ -4,7 +4,7 @@ declare const _default: import('vue').DefineComponent<{
4
4
  default: null;
5
5
  };
6
6
  color: {
7
- type: StringConstructor;
7
+ type: import("vue").PropType<string | null>;
8
8
  default: string;
9
9
  };
10
10
  }, {
@@ -15,11 +15,11 @@ declare const _default: import('vue').DefineComponent<{
15
15
  default: null;
16
16
  };
17
17
  color: {
18
- type: StringConstructor;
18
+ type: import("vue").PropType<string | null>;
19
19
  default: string;
20
20
  };
21
21
  }>>, {
22
- color: string;
22
+ color: string | null;
23
23
  config: import("../../core/tool").MenuConfigType;
24
24
  }, {}>;
25
25
  export default _default;
@@ -7,7 +7,7 @@ export declare const MenuProps: {
7
7
  default: null;
8
8
  };
9
9
  color: {
10
- type: StringConstructor;
10
+ type: PropType<string | null>;
11
11
  default: string;
12
12
  };
13
13
  };
@@ -20,7 +20,7 @@ export declare const ToolbarProps: {
20
20
  default: null;
21
21
  };
22
22
  color: {
23
- type: StringConstructor;
23
+ type: PropType<string | null>;
24
24
  default: string;
25
25
  };
26
26
  };
@@ -17,7 +17,7 @@ declare const _default: import('vue').DefineComponent<{
17
17
  default: null;
18
18
  };
19
19
  color: {
20
- type: StringConstructor;
20
+ type: import("vue").PropType<string | null>;
21
21
  default: string;
22
22
  };
23
23
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -41,13 +41,13 @@ declare const _default: import('vue').DefineComponent<{
41
41
  default: null;
42
42
  };
43
43
  color: {
44
- type: StringConstructor;
44
+ type: import("vue").PropType<string | null>;
45
45
  default: string;
46
46
  };
47
47
  }>> & {
48
48
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
49
49
  }, {
50
- color: string;
50
+ color: string | null;
51
51
  type: "link" | "text" | "image" | "video" | "table" | "codeBlock";
52
52
  modelValue: boolean;
53
53
  node: string | HTMLElement;
@@ -1,5 +1,5 @@
1
1
  import { LanguagesItemType } from '../hljs';
2
- import { default as AlexEditor, AlexElement } from 'alex-editor';
2
+ import { AlexEditor, AlexElement } from 'alex-editor';
3
3
 
4
4
  export declare const parseList: (editor: AlexEditor, element: AlexElement) => void;
5
5
  export declare const orderdListHandle: (editor: AlexEditor, element: AlexElement) => void;
@@ -1,5 +1,5 @@
1
1
  import { default as Button } from '../components/button/button.vue';
2
- import { VNode } from 'vue';
2
+ import { ComponentInternalInstance, VNode } from 'vue';
3
3
  import { InsertImageUploadErrorType } from '../components/insertImage/props';
4
4
  import { LocaleType } from '../locale';
5
5
  import { ButtonOptionsItemType, ButtonTypeType } from '../components/button/props';
@@ -32,7 +32,7 @@ export interface MenuDisplayButtonType extends MenuSelectButtonType {
32
32
  defaultValue?: string | number;
33
33
  }
34
34
  export interface MenuImageButtonType extends MenuButtonType {
35
- accept?: string[];
35
+ allowedFileType?: string[];
36
36
  multiple?: boolean;
37
37
  maxSize?: number | null;
38
38
  minSize?: number | null;
@@ -40,7 +40,7 @@ export interface MenuImageButtonType extends MenuButtonType {
40
40
  handleError?: ((error: InsertImageUploadErrorType, file: File) => void) | null;
41
41
  }
42
42
  export interface MenuVideoButtonType extends MenuButtonType {
43
- accept?: string[];
43
+ allowedFileType?: string[];
44
44
  multiple?: boolean;
45
45
  maxSize?: number | null;
46
46
  minSize?: number | null;
@@ -67,9 +67,9 @@ export type MenuCustomButtonType = {
67
67
  onLayerShown?: (name: string, btnInstance: InstanceType<typeof Button>) => void;
68
68
  onLayerHidden?: (name: string, btnInstance: InstanceType<typeof Button>) => void;
69
69
  onOperate?: (name: string, value: string | number | undefined, btnInstance: InstanceType<typeof Button>) => void;
70
- default?: () => VNode;
71
- layer?: () => VNode;
72
- option?: () => VNode;
70
+ default?: (name: string, btnInstance: InstanceType<typeof Button>) => VNode;
71
+ layer?: (name: string, btnInstance: InstanceType<typeof Button>) => VNode;
72
+ option?: (name: string, btnInstance: InstanceType<typeof Button>) => VNode;
73
73
  };
74
74
  export type CodeBlockToolbarType = {
75
75
  languages?: MenuSelectButtonType;
@@ -135,6 +135,9 @@ export type MenuSequenceType = {
135
135
  fullScreen?: number;
136
136
  };
137
137
  export type MenuModeType = 'default' | 'inner' | 'fixed';
138
+ export type MenuExtendType = {
139
+ [name: string]: MenuCustomButtonType;
140
+ };
138
141
  export type MenuConfigType = {
139
142
  use?: boolean;
140
143
  tooltip?: boolean;
@@ -171,10 +174,17 @@ export type MenuConfigType = {
171
174
  codeBlock?: MenuButtonType;
172
175
  sourceView?: MenuButtonType;
173
176
  fullScreen?: MenuButtonType;
174
- extends?: {
175
- [name: string]: MenuCustomButtonType;
176
- };
177
+ extends?: MenuExtendType;
178
+ };
179
+ export type PluginResultType = {
180
+ menu?: MenuConfigType;
181
+ updateView?: () => void;
182
+ customParseNode?: (element: AlexElement) => AlexElement;
183
+ renderRule?: (el: AlexElement) => void;
184
+ pasteKeepStyles?: ObjectType;
185
+ pasteKeepMarks?: ObjectType;
177
186
  };
187
+ export type PluginType = (editifyInstance: ComponentInternalInstance, color: string | null, editTrans: (key: string) => any) => PluginResultType;
178
188
  export declare const pasteKeepData: ObjectType;
179
189
  export declare const mergeObject: (o1: ObjectType, o2: ObjectType) => ObjectType | null;
180
190
  export declare const queryHasValue: (obj: ObjectType, name: string, value?: string | number) => boolean;
@@ -43,7 +43,7 @@ declare const _default: import('vue').DefineComponent<{
43
43
  default: boolean;
44
44
  };
45
45
  color: {
46
- type: StringConstructor;
46
+ type: import("vue").PropType<string | null>;
47
47
  default: string;
48
48
  validator(value: any): boolean;
49
49
  };
@@ -107,6 +107,10 @@ declare const _default: import('vue').DefineComponent<{
107
107
  type: BooleanConstructor;
108
108
  default: boolean;
109
109
  };
110
+ plugins: {
111
+ type: import("vue").PropType<import("../core/tool").PluginType[]>;
112
+ default: () => never[];
113
+ };
110
114
  }, {
111
115
  editor: import("vue").Ref<{
112
116
  $el: HTMLElement;
@@ -599,7 +603,7 @@ declare const _default: import('vue').DefineComponent<{
599
603
  default: boolean;
600
604
  };
601
605
  color: {
602
- type: StringConstructor;
606
+ type: import("vue").PropType<string | null>;
603
607
  default: string;
604
608
  validator(value: any): boolean;
605
609
  };
@@ -663,6 +667,10 @@ declare const _default: import('vue').DefineComponent<{
663
667
  type: BooleanConstructor;
664
668
  default: boolean;
665
669
  };
670
+ plugins: {
671
+ type: import("vue").PropType<import("../core/tool").PluginType[]>;
672
+ default: () => never[];
673
+ };
666
674
  }>> & {
667
675
  onFocus?: ((...args: any[]) => any) | undefined;
668
676
  onBlur?: ((...args: any[]) => any) | undefined;
@@ -673,7 +681,7 @@ declare const _default: import('vue').DefineComponent<{
673
681
  onRangeupdate?: ((...args: any[]) => any) | undefined;
674
682
  onUpdateview?: ((...args: any[]) => any) | undefined;
675
683
  }, {
676
- color: string;
684
+ color: string | null;
677
685
  disabled: boolean;
678
686
  menu: MenuConfigType;
679
687
  modelValue: string;
@@ -699,5 +707,6 @@ declare const _default: import('vue').DefineComponent<{
699
707
  customParseNode: (el: AlexElement) => AlexElement;
700
708
  renderRules: ((el: AlexElement) => void)[];
701
709
  tab: boolean;
710
+ plugins: import("../core/tool").PluginType[];
702
711
  }, {}>;
703
712
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { LocaleType } from '../locale';
2
2
  import { AlexElement } from 'alex-editor';
3
- import { MenuConfigType, ObjectType, ToolbarConfigType } from '../core/tool';
3
+ import { PluginType, MenuConfigType, ObjectType, ToolbarConfigType } from '../core/tool';
4
4
  import { ExtractPublicPropTypes, PropType } from 'vue';
5
5
 
6
6
  export type EditifyTableColumnResizeParamsType = {
@@ -54,7 +54,7 @@ export declare const EditifyProps: {
54
54
  default: boolean;
55
55
  };
56
56
  color: {
57
- type: StringConstructor;
57
+ type: PropType<string | null>;
58
58
  default: string;
59
59
  validator(value: any): boolean;
60
60
  };
@@ -118,5 +118,9 @@ export declare const EditifyProps: {
118
118
  type: BooleanConstructor;
119
119
  default: boolean;
120
120
  };
121
+ plugins: {
122
+ type: PropType<PluginType[]>;
123
+ default: () => never[];
124
+ };
121
125
  };
122
126
  export type EditifyPropsType = ExtractPublicPropTypes<typeof EditifyProps>;