vue-editify 0.1.21 → 0.1.22

Sign up to get free protection for your applications and to get access to all the features.
package/examples/App.vue CHANGED
@@ -1,80 +1,23 @@
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"></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 } 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
- }
78
21
  </script>
79
22
  <style lang="less">
80
23
  html,
@@ -89,14 +32,4 @@ body {
89
32
  height: 100%;
90
33
  overflow: auto;
91
34
  }
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
35
  </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>
package/lib/editify.es.js CHANGED
@@ -25750,25 +25750,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25750
25750
  }
25751
25751
  });
25752
25752
  const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3f87ab8c"]]);
25753
- const version = "0.1.21";
25753
+ const version = "0.1.22";
25754
25754
  const install = (app) => {
25755
25755
  app.component(Editify.name, Editify);
25756
25756
  };
25757
- const stdin_default = {
25758
- install,
25759
- version
25760
- };
25761
25757
  export {
25762
25758
  AlexElement,
25763
25759
  Editify,
25764
- stdin_default as default,
25760
+ install as default,
25765
25761
  elementIsInList,
25766
25762
  elementIsInTask,
25767
- elementToList,
25768
- elementToParagraph,
25769
- elementToTask,
25770
25763
  getCurrentParsedomElement,
25771
- getFlatElementsByRange,
25772
25764
  getParsedomElementByElement,
25773
25765
  getRangeText,
25774
25766
  hasImageInRange,
@@ -25796,7 +25788,6 @@ export {
25796
25788
  removeTextMark,
25797
25789
  removeTextStyle,
25798
25790
  setAlign,
25799
- setHeading,
25800
25791
  setIndentDecrease,
25801
25792
  setIndentIncrease,
25802
25793
  setLineHeight,