@ebl-vue/editor-full 1.0.13 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +665 -543
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
- package/src/components/Editor/Editor.vue +16 -5
- package/src/plugins/imageResizeCrop/ImageTune.ts +900 -0
- package/src/plugins/imageResizeCrop/index.css +234 -0
- package/src/plugins/imageResizeCrop/index.ts +5 -0
- package/src/plugins/imageResizeCrop/types.d.ts +23 -0
- package/src/plugins/imageTool/index.css +1 -1
- package/src/plugins/imageTool/index.ts +30 -11
- package/src/plugins/imageTool/types/types.ts +2 -0
- package/src/plugins/imageTool/ui.ts +3 -2
- package/src/plugins/imageTool/uploader.ts +137 -103
- package/src/plugins/imageTool/utils/index.ts +73 -0
- package/src/utils/AxiosService.ts +87 -0
- package/types/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebl-vue/editor-full",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "lrj525@sina.com",
|
|
6
6
|
"description": "结构化编辑器",
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"url": "ssh://git@git.jianguodata.com:9082/lirujin/ebl-vue.git"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@codexteam/ajax": "^4.2.0",
|
|
43
42
|
"@editorjs/caret": "^1.0.3",
|
|
44
43
|
"@editorjs/dom": "^1.0.1",
|
|
45
44
|
"axios": "^1.13.2",
|
|
@@ -42,9 +42,7 @@ import Underline from "../../plugins/underline";
|
|
|
42
42
|
import InlineCode from "../../plugins/inline-code";
|
|
43
43
|
import Table from '../../plugins/table';
|
|
44
44
|
import ImageTool from "../../plugins/imageTool";
|
|
45
|
-
import
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
import {ImageToolTune } from "../../plugins/imageResizeCrop";
|
|
48
46
|
|
|
49
47
|
const EblEditorSettings: IEblEditorSettings | undefined = inject("EblEditorSettings");
|
|
50
48
|
|
|
@@ -63,7 +61,8 @@ interface Props {
|
|
|
63
61
|
title: string,
|
|
64
62
|
lastUpdateTime: string,
|
|
65
63
|
data: OutputData,
|
|
66
|
-
locale:any
|
|
64
|
+
locale: any,
|
|
65
|
+
userStore:any
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -80,6 +79,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
80
79
|
|
|
81
80
|
const title = ref(props.title);
|
|
82
81
|
let editor: EditorJS | null = null;
|
|
82
|
+
const tunes = ['indent', 'blockAlignment'];
|
|
83
83
|
onMounted(() => {
|
|
84
84
|
const editorData=toRaw(props.data);
|
|
85
85
|
editor = new EditorJS({
|
|
@@ -87,7 +87,7 @@ onMounted(() => {
|
|
|
87
87
|
autofocus: true,
|
|
88
88
|
defaultBlock: 'paragraph',
|
|
89
89
|
placeholder: props.placeholder,
|
|
90
|
-
tunes:
|
|
90
|
+
tunes: tunes,
|
|
91
91
|
tools: {
|
|
92
92
|
inlineCode: InlineCode,
|
|
93
93
|
underline: Underline,
|
|
@@ -167,7 +167,10 @@ onMounted(() => {
|
|
|
167
167
|
image: {
|
|
168
168
|
class: ImageTool,
|
|
169
169
|
inlineToolbar: true,
|
|
170
|
+
tunes: tunes.concat(['imageResize']),
|
|
170
171
|
config: {
|
|
172
|
+
types:".png,.jpeg,.jpg,.gif,.webp",
|
|
173
|
+
userStore: props.userStore,
|
|
171
174
|
endpoints: {
|
|
172
175
|
byFile: EblEditorSettings?.fileUploadEndpoint,
|
|
173
176
|
byUrl: EblEditorSettings?.urlUploadEndpoint
|
|
@@ -182,6 +185,14 @@ onMounted(() => {
|
|
|
182
185
|
|
|
183
186
|
}
|
|
184
187
|
},
|
|
188
|
+
imageResize: {
|
|
189
|
+
class: ImageToolTune ,
|
|
190
|
+
config: {
|
|
191
|
+
resize: true,
|
|
192
|
+
crop: false
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
|
|
185
196
|
|
|
186
197
|
|
|
187
198
|
},
|