From 637b1a05c9f4f0abd9983a47a0fd86dccfbe1a0f Mon Sep 17 00:00:00 2001 From: zhou999 Date: Thu, 2 Mar 2023 16:07:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dinput-rich-text?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=8F=90=E6=B5=8B=E9=97=AE=E9=A2=98=20amis-s?= =?UTF-8?q?aas-9971=20amis-saas-9977=20amis-saas-9968=20amis-saas-9968=20a?= =?UTF-8?q?mis-saas-10058?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic90dba0bd88c5ea7107293cf27d96237a452ae4b --- .../src/plugin/Form/InputRichText.tsx | 69 +++++++++---------- 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/packages/amis-editor/src/plugin/Form/InputRichText.tsx b/packages/amis-editor/src/plugin/Form/InputRichText.tsx index db2e1f6e1..e3ec8a765 100644 --- a/packages/amis-editor/src/plugin/Form/InputRichText.tsx +++ b/packages/amis-editor/src/plugin/Form/InputRichText.tsx @@ -11,6 +11,31 @@ import {ValidatorTag} from '../../validator'; const tinymceToolbarsDelimiter = ' '; +const tinymceOptions = [ + 'advlist', + 'autolink', + 'link', + 'image', + 'lists', + 'charmap', + 'preview', + 'anchor', + 'pagebreak', + 'searchreplace', + 'wordcount', + 'visualblocks', + 'visualchars', + 'code', + 'fullscreen', + 'insertdatetime', + 'media', + 'nonbreaking', + 'table', + 'emoticons', + 'template', + 'help' +]; + const tinymceToolbars = [ 'undo', 'redo', @@ -105,7 +130,6 @@ const tinymceToolbars = [ const froalaOptions = [ 'paragraphFormat', 'quote', - 'color', 'bold', 'italic', 'underline', @@ -115,7 +139,6 @@ const froalaOptions = [ 'align', 'insertLink', 'insertImage', - 'insertEmotion', 'insertTable', 'undo', 'redo', @@ -226,36 +249,13 @@ export class RichTextControlPlugin extends BasePlugin { '查看 https://www.tiny.cloud/docs/general-configuration-guide/basic-setup/ 文档'), name: 'options.plugins', visibleOn: 'data.vendor === "tinymce"', - defaultCheckAll: true, + value: [...tinymceOptions].join(','), maxTagCount: 5, overflowTagPopover: { title: '插件', offset: [0, 5] }, - options: [ - 'advlist', - 'autolink', - 'link', - 'image', - 'lists', - 'charmap', - 'preview', - 'anchor', - 'pagebreak', - 'searchreplace', - 'wordcount', - 'visualblocks', - 'visualchars', - 'code', - 'fullscreen', - 'insertdatetime', - 'media', - 'nonbreaking', - 'table', - 'emoticons', - 'template', - 'help' - ] + options: tinymceOptions }, { type: 'select', @@ -298,7 +298,7 @@ export class RichTextControlPlugin extends BasePlugin { '工具栏-大屏', '屏幕宽度≥1200px,参考文档:https://froala.com/wysiwyg-editor/docs/options/' ), - defaultCheckAll: true, + value: [...froalaOptions], joinValues: false, extractValue: true, options: [...froalaOptions], @@ -381,7 +381,9 @@ export class RichTextControlPlugin extends BasePlugin { }), getSchemaTpl('labelRemark'), getSchemaTpl('remark'), - getSchemaTpl('placeholder'), + getSchemaTpl('placeholder', { + visibleOn: 'data.vendor !== "tinymce"' + }), getSchemaTpl('description'), ] }, @@ -414,14 +416,7 @@ export class RichTextControlPlugin extends BasePlugin { ] }, getSchemaTpl('style:formItem', { - renderer: context.info.renderer, - schema: [ - getSchemaTpl('switch', { - label: '内联模式', - name: 'inline', - pipeIn: defaultValue(false) - }), - ] + renderer: context.info.renderer }), getSchemaTpl('style:classNames') ])