fx-platform-ui 0.0.13-alpha11 → 0.0.13-alpha12
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/lib/fx-platform-ui.mjs +30630 -62715
- package/lib/fx-platform-ui.umd.js +68 -112
- package/lib/packages/components/editor/src/hook/useEditorState.d.ts +18 -2
- package/lib/packages/components/editor/src/index.vue.d.ts +18 -2
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/components/editor/src/hook/useEditorState.ts +49 -28
- package/packages/components/editor/src/index.vue +21 -21
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
import { computed, ref, watchEffect } from 'vue'
|
|
2
|
-
import tinymce from 'tinymce/tinymce'
|
|
2
|
+
// import tinymce from 'tinymce/tinymce'
|
|
3
3
|
import { message } from 'ant-design-vue'
|
|
4
4
|
import { PlatEditorProps } from '../plat-editor-props'
|
|
5
5
|
import { isFunction } from '../../../../utils/is'
|
|
6
6
|
|
|
7
7
|
const DEFAULT_INIT = {
|
|
8
8
|
selector: 'textarea',
|
|
9
|
-
placeholder: '在这里输入文字'
|
|
9
|
+
placeholder: '在这里输入文字',
|
|
10
|
+
language_url: '/tinymce/langs/zh-Hans.js', // 语言包的路径,具体路径看自己的项目,文档后面附上中文js文件
|
|
11
|
+
language: 'zh-Hans', //语言
|
|
12
|
+
skin_url: '/tinymce/skins/ui/oxide', // skin路径,具体路径看自己的项目
|
|
13
|
+
height: 500, //编辑器高度
|
|
14
|
+
branding: false, //是否禁用“Powered by TinyMCE”
|
|
15
|
+
menubar: true, //顶部菜单栏显示
|
|
16
|
+
image_dimensions: true, //图片宽高属性
|
|
17
|
+
promotion: false, // 去除高级功能升级的促销按钮
|
|
18
|
+
plugins:
|
|
19
|
+
'wordcount table searchreplace pagebreak fullscreen codesample autolink anchor autolink image media lists link code image', //这里的数据是在props里面就定义好了的
|
|
20
|
+
toolbar:
|
|
21
|
+
'fontsize fontfamily fontsizeselect fontselect bold italic lineheight underline alignleft aligncenter alignright alignjustify anchor | undo redo | formatselect | forecolor backcolor | bullist numlist outdent indent | lists link image axupimgs media table | removeformat | fullscreen|preview code codesample|searchreplace', //这里的数据是在props里面就定义好了的
|
|
22
|
+
paste_webkit_styles: 'all',
|
|
23
|
+
paste_merge_formats: true,
|
|
24
|
+
nonbreaking_force_tab: false,
|
|
25
|
+
paste_auto_cleanup_on_paste: false,
|
|
26
|
+
file_picker_types: 'file image media',
|
|
27
|
+
fontsize_formats: '8pt 10pt 12pt 14pt 16pt 18pt 20pt 22pt 24pt 36pt',
|
|
28
|
+
font_formats:
|
|
29
|
+
"微软雅黑='微软雅黑';宋体='宋体';黑体='黑体';仿宋='仿宋';楷体='楷体';隶书='隶书';幼圆='幼圆';Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings",
|
|
30
|
+
content_css: '/tinymce/skins/content/default/content.css' //以css文件方式自定义可编辑区域的css样式,css文件需自己创建并引入
|
|
10
31
|
}
|
|
11
32
|
|
|
12
33
|
export const useEditorState = (props: PlatEditorProps) => {
|
|
@@ -14,32 +35,32 @@ export const useEditorState = (props: PlatEditorProps) => {
|
|
|
14
35
|
const init = computed(() => {
|
|
15
36
|
return {
|
|
16
37
|
...DEFAULT_INIT,
|
|
17
|
-
images_upload_handler: (blobInfo) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
file_picker_callback: (callback) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
38
|
+
// images_upload_handler: (blobInfo) => {
|
|
39
|
+
// return new Promise((resolve, reject) => {
|
|
40
|
+
// imgBeforeUpload(blobInfo.blob())
|
|
41
|
+
// .then((res) => {
|
|
42
|
+
// resolve(res)
|
|
43
|
+
// })
|
|
44
|
+
// .catch((err) => {
|
|
45
|
+
// reject(err)
|
|
46
|
+
// })
|
|
47
|
+
// })
|
|
48
|
+
// },
|
|
49
|
+
// file_picker_callback: (callback) => {
|
|
50
|
+
// const filetype = props.mediaSetting.fileTypeLimit.toString()
|
|
51
|
+
// const inputElem: any = document.createElement('input') //创建文件选择
|
|
52
|
+
// inputElem.setAttribute('type', 'file')
|
|
53
|
+
// inputElem.setAttribute('accept', filetype)
|
|
54
|
+
// inputElem.click()
|
|
55
|
+
// inputElem.onchange = function () {
|
|
56
|
+
// const file = inputElem.files[0]
|
|
57
|
+
// tinymce.activeEditor?.setProgressState(true)
|
|
58
|
+
// mediaBeforeUpload(file).then((res) => {
|
|
59
|
+
// tinymce.activeEditor?.setProgressState(false)
|
|
60
|
+
// callback(res)
|
|
61
|
+
// })
|
|
62
|
+
// }
|
|
63
|
+
// },
|
|
43
64
|
...props.editorSetting
|
|
44
65
|
}
|
|
45
66
|
})
|
|
@@ -8,28 +8,28 @@
|
|
|
8
8
|
import { onMounted, watch, ref } from 'vue'
|
|
9
9
|
//在js中引入所需的主题和组件
|
|
10
10
|
import tinymce from 'tinymce/tinymce'
|
|
11
|
-
import 'tinymce/skins/content/default/content.css'
|
|
11
|
+
// import 'tinymce/skins/content/default/content.css'
|
|
12
12
|
import Editor from '@tinymce/tinymce-vue'
|
|
13
|
-
import 'tinymce/themes/silver'
|
|
14
|
-
import 'tinymce/themes/silver/theme'
|
|
15
|
-
import 'tinymce/icons/default' //引入编辑器图标icon,不引入则不显示对应图标
|
|
16
|
-
import 'tinymce/models/dom' // 这里是个坑 一定要引入
|
|
17
|
-
|
|
18
|
-
//在TinyMce.vue中接着引入相关插件
|
|
19
|
-
import 'tinymce/icons/default/icons'
|
|
20
|
-
import 'tinymce/plugins/image' // 插入上传图片插件
|
|
21
|
-
import 'tinymce/plugins/media' // 插入视频插件
|
|
22
|
-
import 'tinymce/plugins/table' // 插入表格插件
|
|
23
|
-
import 'tinymce/plugins/lists' // 列表插件
|
|
24
|
-
import 'tinymce/plugins/wordcount' // 字数统计插件
|
|
25
|
-
import 'tinymce/plugins/code' // 源码
|
|
26
|
-
import 'tinymce/plugins/fullscreen' //全屏
|
|
27
|
-
import 'tinymce/plugins/pagebreak' //插入分页符
|
|
28
|
-
import 'tinymce/plugins/codesample'
|
|
29
|
-
import 'tinymce/plugins/searchreplace'
|
|
30
|
-
import 'tinymce/plugins/link'
|
|
31
|
-
import 'tinymce/plugins/autolink'
|
|
32
|
-
import 'tinymce/plugins/anchor'
|
|
13
|
+
// import 'tinymce/themes/silver'
|
|
14
|
+
// import 'tinymce/themes/silver/theme'
|
|
15
|
+
// import 'tinymce/icons/default' //引入编辑器图标icon,不引入则不显示对应图标
|
|
16
|
+
// import 'tinymce/models/dom' // 这里是个坑 一定要引入
|
|
17
|
+
//
|
|
18
|
+
// //在TinyMce.vue中接着引入相关插件
|
|
19
|
+
// import 'tinymce/icons/default/icons'
|
|
20
|
+
// import 'tinymce/plugins/image' // 插入上传图片插件
|
|
21
|
+
// import 'tinymce/plugins/media' // 插入视频插件
|
|
22
|
+
// import 'tinymce/plugins/table' // 插入表格插件
|
|
23
|
+
// import 'tinymce/plugins/lists' // 列表插件
|
|
24
|
+
// import 'tinymce/plugins/wordcount' // 字数统计插件
|
|
25
|
+
// import 'tinymce/plugins/code' // 源码
|
|
26
|
+
// import 'tinymce/plugins/fullscreen' //全屏
|
|
27
|
+
// import 'tinymce/plugins/pagebreak' //插入分页符
|
|
28
|
+
// import 'tinymce/plugins/codesample'
|
|
29
|
+
// import 'tinymce/plugins/searchreplace'
|
|
30
|
+
// import 'tinymce/plugins/link'
|
|
31
|
+
// import 'tinymce/plugins/autolink'
|
|
32
|
+
// import 'tinymce/plugins/anchor'
|
|
33
33
|
|
|
34
34
|
import { platEditorProps } from './plat-editor-props'
|
|
35
35
|
import { platEditorEmits } from './plat-editor-emits'
|