chore: 更新依赖,tinymce 到 6.1.2,echarts 到 5.3.1,qrcode.react 到 3.1.0,reac… (#5018)

* chore: 更新依赖,tinymce 到 6.1.2,echarts 到 5.3.1,qrcode.react 到 3.1.0,react 到 18.2.0

* 调整一下 tinymce 默认 toolbar

* 调整一下 tinymce 默认 toolbar
This commit is contained in:
吴多益 2022-07-29 18:09:07 +08:00 committed by GitHub
parent 2d849c498f
commit 78955f4ea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 72 additions and 47 deletions

View File

@ -69,7 +69,9 @@ order: 47
## tinymce 自定义配置 ## tinymce 自定义配置
可以设置 options 属性来自定义编辑器的展现,详细配置项请参考[官方文档](https://www.tiny.cloud/docs/general-configuration-guide/basic-setup/)。 可以设置 options 属性来自定义编辑器的展现,详细配置项请参考[官方文档](https://www.tiny.cloud/docs/tinymce/6/basic-setup/)。
> amis 2.1.0 版本升级到了 tinymce 6导致 plugins 的写法有变化
注意在下面的编辑器里修改 JSON 配置后不会实时生效。 注意在下面的编辑器里修改 JSON 配置后不会实时生效。
@ -85,9 +87,7 @@ order: 47
"menubar": false, "menubar": false,
"height": 200, "height": 200,
"plugins": [ "plugins": [
"advlist autolink lists link image charmap print preview anchor", "advlist", "autolink", "link", "image", "lists", "charmap", "preview", "anchor", "pagebreak", "searchreplace", "wordcount", "visualblocks", "visualchars", "code", "fullscreen", "insertdatetime", "media", "nonbreaking", "table", "emoticons", "template", "help"
"searchreplace visualblocks code fullscreen",
"insertdatetime media table paste code help wordcount"
], ],
"toolbar": "undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help" "toolbar": "undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help"
} }
@ -102,11 +102,11 @@ order: 47
```json ```json
{ {
"type": "input-rich-text", "type": "input-rich-text",
"name": "rich", "name": "rich",
"options": { "options": {
"content_css": "/xxx.css" "content_css": "/xxx.css"
} }
} }
``` ```
@ -114,14 +114,15 @@ order: 47
```css ```css
.mce-item-table th { .mce-item-table th {
font-weight: bold; font-weight: bold;
} }
.mce-item-table th, .mce-item-table td { .mce-item-table th,
padding: 6px 13px; .mce-item-table td {
border: 1px solid #ddd; padding: 6px 13px;
border: 1px solid #ddd;
} }
.mce-item-table tr { .mce-item-table tr {
border-top: 1px solid #ccc; border-top: 1px solid #ccc;
} }
``` ```
@ -129,14 +130,15 @@ order: 47
```css ```css
table th { table th {
font-weight: bold; font-weight: bold;
} }
table th, table td { table th,
padding: 6px 13px; table td {
border: 1px solid #ddd; padding: 6px 13px;
border: 1px solid #ddd;
} }
table tr { table tr {
border-top: 1px solid #ccc; border-top: 1px solid #ccc;
} }
``` ```

View File

@ -29,6 +29,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^28.1.0", "@types/jest": "^28.1.0",
"echarts": "5.3.3",
"fis-optimizer-terser": "^1.0.1", "fis-optimizer-terser": "^1.0.1",
"fis-parser-sass": "^1.1.1", "fis-parser-sass": "^1.1.1",
"fis-parser-svgr": "^1.0.0", "fis-parser-svgr": "^1.0.0",
@ -47,7 +48,10 @@
"jest": "^28.1.0", "jest": "^28.1.0",
"jest-environment-jsdom": "^28.1.0", "jest-environment-jsdom": "^28.1.0",
"lerna": "^5.0.0", "lerna": "^5.0.0",
"ts-jest": "^28.0.3" "react": "^18.2.0",
"react-dom": "^18.2.0",
"ts-jest": "^28.0.3",
"zrender": "^5.3.2"
}, },
"jest": { "jest": {
"verbose": true, "verbose": true,

View File

@ -21,8 +21,8 @@
"jest": "^28.1.0", "jest": "^28.1.0",
"jest-environment-jsdom": "^28.1.0", "jest-environment-jsdom": "^28.1.0",
"moment-timezone": "^0.5.34", "moment-timezone": "^0.5.34",
"react": "^18.0.0", "react": "^18.2.0",
"react-dom": "^18.0.0", "react-dom": "^18.2.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rollup": "^2.73.0", "rollup": "^2.73.0",
"rollup-plugin-auto-external": "^2.0.0", "rollup-plugin-auto-external": "^2.0.0",
@ -52,7 +52,7 @@
"mobx": "^4.5.0", "mobx": "^4.5.0",
"mobx-react": "^6.3.1", "mobx-react": "^6.3.1",
"mobx-state-tree": "^3.17.3", "mobx-state-tree": "^3.17.3",
"moment": "^2.19.3", "moment": "^2.19.4",
"papaparse": "^5.3.0", "papaparse": "^5.3.0",
"qs": "6.9.7", "qs": "6.9.7",
"react-json-view": "1.21.3", "react-json-view": "1.21.3",

View File

@ -35,7 +35,7 @@
"homepage": "https://github.com/aisuda/amis-tpl#readme", "homepage": "https://github.com/aisuda/amis-tpl#readme",
"dependencies": { "dependencies": {
"lodash": "^4.17.15", "lodash": "^4.17.15",
"moment": "^2.29.1", "moment": "^2.29.4",
"tslib": "^2.3.1" "tslib": "^2.3.1"
}, },
"devDependencies": { "devDependencies": {
@ -56,7 +56,7 @@
"rollup": "^2.60.2", "rollup": "^2.60.2",
"rollup-plugin-license": "^2.6.0", "rollup-plugin-license": "^2.6.0",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"sass": "^1.36.0", "sass": "^1.54.0",
"sass-loader": "^12.1.0", "sass-loader": "^12.1.0",
"style-loader": "^3.2.1", "style-loader": "^3.2.1",
"stylelint": "^13.0.0", "stylelint": "^13.0.0",

View File

@ -38,7 +38,7 @@
"classnames": "2.3.1", "classnames": "2.3.1",
"codemirror": "^5.63.0", "codemirror": "^5.63.0",
"downshift": "6.1.7", "downshift": "6.1.7",
"echarts": "5.3.1", "echarts": "5.3.3",
"froala-editor": "3.1.1", "froala-editor": "3.1.1",
"hoist-non-react-statics": "^3.3.2", "hoist-non-react-statics": "^3.3.2",
"jsbarcode": "^3.11.5", "jsbarcode": "^3.11.5",
@ -50,7 +50,7 @@
"mobx": "^4.5.0", "mobx": "^4.5.0",
"mobx-react": "^6.3.1", "mobx-react": "^6.3.1",
"mobx-state-tree": "^3.17.3", "mobx-state-tree": "^3.17.3",
"moment": "^2.19.3", "moment": "^2.19.4",
"monaco-editor": "0.30.1", "monaco-editor": "0.30.1",
"prop-types": "^15.6.1", "prop-types": "^15.6.1",
"rc-input-number": "^7.3.4", "rc-input-number": "^7.3.4",
@ -63,7 +63,7 @@
"react-transition-group": "4.4.2", "react-transition-group": "4.4.2",
"react-visibility-sensor": "5.1.1", "react-visibility-sensor": "5.1.1",
"sortablejs": "1.14.0", "sortablejs": "1.14.0",
"tinymce": "^5.10.3", "tinymce": "^6.1.2",
"tslib": "^2.3.1", "tslib": "^2.3.1",
"uncontrollable": "7.2.1" "uncontrollable": "7.2.1"
}, },
@ -83,15 +83,15 @@
"jest-environment-jsdom": "^28.1.0", "jest-environment-jsdom": "^28.1.0",
"moment-timezone": "^0.5.34", "moment-timezone": "^0.5.34",
"postcss-import": "^14.1.0", "postcss-import": "^14.1.0",
"react": "^18.0.0", "react": "^18.2.0",
"react-dom": "^18.0.0", "react-dom": "^18.2.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rollup": "^2.73.0", "rollup": "^2.73.0",
"rollup-plugin-auto-external": "^2.0.0", "rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-license": "^2.7.0", "rollup-plugin-license": "^2.7.0",
"rollup-plugin-postcss": "^4.0.2", "rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-scss": "^3.0.0", "rollup-plugin-scss": "^3.0.0",
"sass": "^1.52.1", "sass": "^1.54.0",
"ts-jest": "^28.0.3", "ts-jest": "^28.0.3",
"typescript": "^4.6.4" "typescript": "^4.6.4"
}, },

View File

@ -6,6 +6,8 @@ import tinymce from 'tinymce/tinymce';
// A theme is also required // A theme is also required
import 'tinymce/icons/default/index'; import 'tinymce/icons/default/index';
import 'tinymce/themes/silver'; import 'tinymce/themes/silver';
import 'tinymce/models/dom/model';
// import 'tinymce/skins/ui/oxide/skin.css'; // import 'tinymce/skins/ui/oxide/skin.css';
// Any plugins you want to use has to be imported // Any plugins you want to use has to be imported
@ -15,7 +17,6 @@ import 'tinymce/plugins/lists';
import 'tinymce/plugins/link'; import 'tinymce/plugins/link';
import 'tinymce/plugins/image'; import 'tinymce/plugins/image';
import 'tinymce/plugins/charmap'; import 'tinymce/plugins/charmap';
import 'tinymce/plugins/print';
import 'tinymce/plugins/preview'; import 'tinymce/plugins/preview';
import 'tinymce/plugins/anchor'; import 'tinymce/plugins/anchor';
import 'tinymce/plugins/searchreplace'; import 'tinymce/plugins/searchreplace';
@ -25,10 +26,8 @@ import 'tinymce/plugins/fullscreen';
import 'tinymce/plugins/insertdatetime'; import 'tinymce/plugins/insertdatetime';
import 'tinymce/plugins/media'; import 'tinymce/plugins/media';
import 'tinymce/plugins/table'; import 'tinymce/plugins/table';
import 'tinymce/plugins/paste';
import 'tinymce/plugins/help'; import 'tinymce/plugins/help';
import 'tinymce/plugins/wordcount'; import 'tinymce/plugins/wordcount';
import 'tinymce/plugins/hr';
import 'tinymce/plugins/pagebreak'; import 'tinymce/plugins/pagebreak';
import 'tinymce/plugins/visualchars'; import 'tinymce/plugins/visualchars';
import 'tinymce/plugins/template'; import 'tinymce/plugins/template';
@ -67,15 +66,35 @@ export default class TinymceEditor extends React.Component<TinymceEditorProps> {
content_css: false, content_css: false,
height: 400, height: 400,
language: !locale || locale === 'zh-CN' ? 'zh_CN' : 'en', language: !locale || locale === 'zh-CN' ? 'zh_CN' : 'en',
branding: false,
plugins: [ plugins: [
'advlist autolink link image lists charmap print preview hr anchor pagebreak', 'advlist',
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking', 'autolink',
'table emoticons template paste help' 'link',
'image',
'lists',
'charmap',
'preview',
'anchor',
'pagebreak',
'searchreplace',
'wordcount',
'visualblocks',
'visualchars',
'code',
'fullscreen',
'insertdatetime',
'media',
'nonbreaking',
'table',
'emoticons',
'template',
'help'
], ],
toolbar: toolbar:
'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | ' + 'undo redo | blocks | bold italic | alignleft aligncenter alignright alignjustify | ' +
'bullist numlist outdent indent | link image | print preview media fullpage | ' + 'bullist numlist outdent indent | link image | preview media | ' +
'forecolor backcolor emoticons | help', 'fontfamily fontsize forecolor backcolor emoticons | print help',
menu: { menu: {
file: { file: {
title: 'File', title: 'File',
@ -98,7 +117,7 @@ export default class TinymceEditor extends React.Component<TinymceEditorProps> {
format: { format: {
title: 'Format', title: 'Format',
items: items:
'bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align | forecolor backcolor | removeformat' 'bold italic underline strikethrough superscript subscript codeformat | styles blocks fontsize align | forecolor backcolor | removeformat'
}, },
tools: { tools: {
title: 'Tools', title: 'Tools',

View File

@ -47,7 +47,7 @@
"blueimp-canvastoblob": "2.1.0", "blueimp-canvastoblob": "2.1.0",
"classnames": "2.3.1", "classnames": "2.3.1",
"downshift": "6.1.7", "downshift": "6.1.7",
"echarts": "5.3.1", "echarts": "5.3.3",
"echarts-stat": "^1.2.0", "echarts-stat": "^1.2.0",
"exceljs": "^4.3.0", "exceljs": "^4.3.0",
"file-saver": "^2.0.2", "file-saver": "^2.0.2",
@ -62,11 +62,11 @@
"mobx": "^4.5.0", "mobx": "^4.5.0",
"mobx-react": "^6.3.1", "mobx-react": "^6.3.1",
"mobx-state-tree": "^3.17.3", "mobx-state-tree": "^3.17.3",
"moment": "^2.19.3", "moment": "^2.19.4",
"monaco-editor": "0.30.1", "monaco-editor": "0.30.1",
"mpegts.js": "^1.6.10", "mpegts.js": "^1.6.10",
"prop-types": "^15.6.1", "prop-types": "^15.6.1",
"qrcode.react": "^3.0.0", "qrcode.react": "^3.1.0",
"rc-overflow": "^1.2.4", "rc-overflow": "^1.2.4",
"react-cropper": "^2.1.8", "react-cropper": "^2.1.8",
"react-dropzone": "^11.4.2", "react-dropzone": "^11.4.2",
@ -111,7 +111,7 @@
"@types/tinymce": "^4.5.24", "@types/tinymce": "^4.5.24",
"axios": "0.25.0", "axios": "0.25.0",
"bce-sdk-js": "^0.2.9", "bce-sdk-js": "^0.2.9",
"concurrently": "^7.0.0", "concurrently": "^7.3.0",
"copy-to-clipboard": "3.3.1", "copy-to-clipboard": "3.3.1",
"core-js": "^3.21.0", "core-js": "^3.21.0",
"css": "3.0.0", "css": "3.0.0",
@ -135,8 +135,8 @@
"prettier": "^2.6.1", "prettier": "^2.6.1",
"pretty-quick": "^3.1.1", "pretty-quick": "^3.1.1",
"prismjs": "^1.25.0", "prismjs": "^1.25.0",
"react": "^18.0.0", "react": "^18.2.0",
"react-dom": "^18.0.0", "react-dom": "^18.2.0",
"react-router": "5.2.1", "react-router": "5.2.1",
"react-router-dom": "5.3.0", "react-router-dom": "5.3.0",
"react-test-renderer": "^18.0.0", "react-test-renderer": "^18.0.0",