Or maybe the esteemed developers (code owners) of Nocobase could modify the source code (which I can see on GitHub) nocobase/packages/core/client/src/schema-component/antd/rich-text/RichText.tsx at a575de9fce23db9e0825505ba1d2351a24b1ca3c · nocobase/nocobase · GitHub?
As I understand it, this is “undeployed” code that is compiled on the server? Could you change it a little so that it already contains the full version of the Rich Editor, for example, like this (I asked AI to write this version of the code in a file, it may be incorrect and serves as an example):
/**
* This file is part of the NocoBase (R) project.
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
* Authors: NocoBase Team.
*
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
import { connect, mapProps, mapReadPretty } from '@formily/react';
import React from 'react';
import { css } from '@emotion/css';
import classNames from 'classnames';
import { lazy } from '../../../lazy-helper';
import { isVariable } from '../../../variables/utils/isVariable';
import { ReadPretty as InputReadPretty } from '../input';
import { useStyles } from './style';
const ReactQuill = lazy(() => import('react-quill'));
export const RichText = connect(
(props) => {
const { wrapSSR, hashId, componentCls } = useStyles();
const modules = {
toolbar: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block'],
[{ 'header': 1 }, { 'header': 2 }, { 'header': 3 }, { 'header': 4 }, { 'header': 5 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }, { 'indent': '-1' }, { 'indent': '+1' }],
[{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'direction': 'rtl' }, { 'align': [] }],
[{ 'color': [] }, { 'background': [] }],
['link', 'image', 'video'],
['clean']
],
};
const formats = [
'header',
'bold', 'italic', 'underline', 'strike',
'blockquote', 'code-block',
'list', 'bullet', 'indent', 'script',
'direction', 'align',
'color', 'background',
'link', 'image', 'video', 'clean'
];
const { value, defaultValue, onChange, disabled, modules: propsModules, formats: propsFormats } = props;
const resultValue = isVariable(value || defaultValue) ? undefined : value || '';
const quillDisabled = css`
.ql-container.ql-disabled {
background-color: #f5f5f5;
color: #999;
opacity: 0.7;
cursor: not-allowed;
pointer-events: none;
border: 1px solid #d9d9d9;
border-radius: 6px;
}
`;
return wrapSSR(
<ReactQuill
className={classNames(componentCls, hashId, quillDisabled, {
'is-disabled': disabled,
})}
modules={propsModules || modules}
formats={propsFormats || formats}
value={resultValue}
onChange={(value) => {
if (value === '<p><br></p>') {
onChange('');
} else {
onChange(value);
}
}}
readOnly={disabled}
/>,
);
},
mapProps({
initialValue: 'defaultValue',
}),
mapReadPretty((props) => {
return <InputReadPretty.Html {...props} />;
}),
);
I can’t change the code myself because I use a quick installation from Docker on my server (EasyPanel). I’ve already tried different ways to make my own rich text editor, but I can’t get it to work… So I’m asking the developers to make this small change to the platform core… I would be very grateful!