vue-editify 0.1.13 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
package/examples/App.vue CHANGED
@@ -1,30 +1,30 @@
1
1
  <template>
2
- <div style="padding: 10px; height: 100%; box-sizing: border-box">
3
- <button @click="handleClick">按钮</button>
4
- <Editify ref="editify" border v-model="val" :menu="menuConfig" style="height: 400px"></Editify>
2
+ <div style="padding: 80px 10px 10px 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" :custom-image-paste="customImagePaste"></Editify>
5
4
  </div>
6
5
  </template>
7
6
  <script setup lang="ts">
8
7
  import { ref } from 'vue'
9
- import { setIndentIncrease, Editify } from '../src/index'
10
- import { MenuConfigType } from '../src/core/tool'
8
+ import { Editify, insertImage, insertVideo } from '../src/index'
9
+ import { MenuConfigType } from '../src/index'
11
10
  const val = ref<string>('<p><br></p>')
12
11
  const editify = ref<InstanceType<typeof Editify> | null>(null)
13
12
  const menuConfig = ref<MenuConfigType>({
14
13
  use: true,
15
- mode: 'inner',
14
+ mode: 'fixed',
16
15
  image: {
17
16
  accept: ['jpg'],
18
17
  handleError: (error, file) => {
19
18
  console.log(error, file)
20
19
  }
20
+ },
21
+ fullScreen: {
22
+ show: true
21
23
  }
22
24
  })
23
- const handleClick = () => {
24
- setIndentIncrease(editify.value!.editor!, editify.value!.dataRangeCaches)
25
- editify.value!.editor!.formatElementStack()
26
- editify.value!.editor!.domRender()
27
- editify.value!.editor!.rangeRender()
25
+ const customImagePaste = url => {
26
+ console.log(url)
27
+ insertImage(editify.value!.editor!, url)
28
28
  }
29
29
  </script>
30
30
  <style lang="less">
@@ -13,7 +13,7 @@ declare const _default: import('vue').DefineComponent<{
13
13
  validator(value: any): boolean;
14
14
  };
15
15
  config: {
16
- type: import("vue").PropType<import("../..").ToolbarConfigType>;
16
+ type: import("vue").PropType<import("../../core/tool").ToolbarConfigType>;
17
17
  default: null;
18
18
  };
19
19
  color: {
@@ -37,7 +37,7 @@ declare const _default: import('vue').DefineComponent<{
37
37
  validator(value: any): boolean;
38
38
  };
39
39
  config: {
40
- type: import("vue").PropType<import("../..").ToolbarConfigType>;
40
+ type: import("vue").PropType<import("../../core/tool").ToolbarConfigType>;
41
41
  default: null;
42
42
  };
43
43
  color: {
@@ -51,6 +51,6 @@ declare const _default: import('vue').DefineComponent<{
51
51
  type: "link" | "text" | "image" | "video" | "table" | "codeBlock";
52
52
  modelValue: boolean;
53
53
  node: string | HTMLElement;
54
- config: import("../..").ToolbarConfigType;
54
+ config: import("../../core/tool").ToolbarConfigType;
55
55
  }, {}>;
56
56
  export default _default;
@@ -60,11 +60,15 @@ declare const _default: import('vue').DefineComponent<{
60
60
  default: boolean;
61
61
  };
62
62
  customImagePaste: {
63
- type: import("vue").PropType<(url: string) => string | Promise<string>>;
63
+ type: import("vue").PropType<(url: string) => void | Promise<void>>;
64
64
  default: null;
65
65
  };
66
66
  customVideoPaste: {
67
- type: import("vue").PropType<(url: string) => string | Promise<string>>;
67
+ type: import("vue").PropType<(url: string) => void | Promise<void>>;
68
+ default: null;
69
+ };
70
+ customFilePaste: {
71
+ type: import("vue").PropType<(url: string) => void | Promise<void>>;
68
72
  default: null;
69
73
  };
70
74
  menu: {
@@ -109,6 +113,7 @@ declare const _default: import('vue').DefineComponent<{
109
113
  customHtmlPaste: ((AlexElements: AlexElement[], html: string) => void | Promise<void>) | null;
110
114
  customImagePaste: ((url: string) => void | Promise<void>) | null;
111
115
  customVideoPaste: ((url: string) => void | Promise<void>) | null;
116
+ customFilePaste: ((url: string) => void | Promise<void>) | null;
112
117
  customMerge: ((mergeElement: AlexElement, targetElement: AlexElement) => void | Promise<void>) | null;
113
118
  customParseNode: ((el: AlexElement) => AlexElement) | null;
114
119
  useClipboard: boolean;
@@ -410,7 +415,6 @@ declare const _default: import('vue').DefineComponent<{
410
415
  text: string;
411
416
  html: string;
412
417
  } | undefined>;
413
- paste: () => Promise<void>;
414
418
  delete: () => void;
415
419
  insertText: (data: string) => void;
416
420
  insertParagraph: () => void;
@@ -604,11 +608,15 @@ declare const _default: import('vue').DefineComponent<{
604
608
  default: boolean;
605
609
  };
606
610
  customImagePaste: {
607
- type: import("vue").PropType<(url: string) => string | Promise<string>>;
611
+ type: import("vue").PropType<(url: string) => void | Promise<void>>;
608
612
  default: null;
609
613
  };
610
614
  customVideoPaste: {
611
- type: import("vue").PropType<(url: string) => string | Promise<string>>;
615
+ type: import("vue").PropType<(url: string) => void | Promise<void>>;
616
+ default: null;
617
+ };
618
+ customFilePaste: {
619
+ type: import("vue").PropType<(url: string) => void | Promise<void>>;
612
620
  default: null;
613
621
  };
614
622
  menu: {
@@ -665,8 +673,9 @@ declare const _default: import('vue').DefineComponent<{
665
673
  allowPasteHtml: boolean;
666
674
  videoRatio: number;
667
675
  showWordLength: boolean;
668
- customImagePaste: (url: string) => string | Promise<string>;
669
- customVideoPaste: (url: string) => string | Promise<string>;
676
+ customImagePaste: (url: string) => void | Promise<void>;
677
+ customVideoPaste: (url: string) => void | Promise<void>;
678
+ customFilePaste: (url: string) => void | Promise<void>;
670
679
  pasteKeepMarks: ObjectType;
671
680
  pasteKeepStyles: ObjectType;
672
681
  customParseNode: (el: AlexElement) => AlexElement;
@@ -71,11 +71,15 @@ export declare const EditifyProps: {
71
71
  default: boolean;
72
72
  };
73
73
  customImagePaste: {
74
- type: PropType<(url: string) => string | Promise<string>>;
74
+ type: PropType<(url: string) => void | Promise<void>>;
75
75
  default: null;
76
76
  };
77
77
  customVideoPaste: {
78
- type: PropType<(url: string) => string | Promise<string>>;
78
+ type: PropType<(url: string) => void | Promise<void>>;
79
+ default: null;
80
+ };
81
+ customFilePaste: {
82
+ type: PropType<(url: string) => void | Promise<void>>;
79
83
  default: null;
80
84
  };
81
85
  menu: {