Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: 更新 froala 版本,去除 jQuery 依赖;修复 rootClose 不生效问题 #2640

Merged
merged 4 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
deps: 更新 froala 版本,去除 jQuery 依赖;修复 rootClose 不生效问题
  • Loading branch information
nwind committed Sep 30, 2021
commit 5d81c065af01eb6c588c27ff13adeb04e4b51d41
15 changes: 6 additions & 9 deletions docs/zh-CN/components/form/input-rich-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,22 @@ froala 可以通过设置 buttons 参数来控制显示哪些按钮,默认是

```json
[
"undo",
"redo",
"paragraphFormat",
"quote",
"color",
"|",
"textColor",
"backgroundColor",
"bold",
"italic",
"underline",
"strikeThrough",
"|",
"formatOL",
"formatUL",
"align",
"|",
"quote",
"insertLink",
"insertImage",
"insertEmotion",
"insertTable",
"|",
"undo",
"redo",
"html"
]
```
Expand Down
2 changes: 1 addition & 1 deletion examples/components/Components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ export const components = [
)
},
{
label: 'InpuRichText 富文本编辑器',
label: 'InputRichText 富文本编辑器',
path: '/zh-CN/components/form/input-rich-text',
getComponent: () =>
import('../../docs/zh-CN/components/form/input-rich-text.md').then(
Expand Down
1 change: 0 additions & 1 deletion examples/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
const mapping: {
[propName: string]: any;
} = {
'jquery': __moduleId('jquery'),
'react': __moduleId('react'),
'react-dom': __moduleId('react-dom'),
'immutability-helper': __moduleId('immutability-helper'),
Expand Down
12 changes: 6 additions & 6 deletions fis-conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ if (fis.project.currentMedia() === 'publish') {
'!mpegts.js/**',
'!hls.js/**',
'!froala-editor/**',
'!react-froala-wysiwyg/**',
'!tinymce/**',
'!jquery/**',
'!zrender/**',
'!echarts/**',
'!echarts-stat/**',
Expand Down Expand Up @@ -525,7 +525,7 @@ if (fis.project.currentMedia() === 'publish') {
'rich-text.js': [
'src/components/RichText.tsx',
'froala-editor/**',
'jquery/**'
'react-froala-wysiwyg/**'
],

'tinymce.js': ['src/components/Tinymce.tsx', 'tinymce/**'],
Expand Down Expand Up @@ -565,8 +565,8 @@ if (fis.project.currentMedia() === 'publish') {
'!mpegts.js/**',
'!hls.js/**',
'!froala-editor/**',
'!react-froala-wysiwyg/**',
'!src/components/RichText.tsx',
'!jquery/**',
'!zrender/**',
'!echarts/**',
'!papaparse/**',
Expand Down Expand Up @@ -786,8 +786,8 @@ if (fis.project.currentMedia() === 'publish') {
'!mpegts.js/**',
'!hls.js/**',
'!froala-editor/**',
'!react-froala-wysiwyg/**',
'!tinymce/**',
'!jquery/**',
'!zrender/**',
'!echarts/**',
'!echarts-stat/**',
Expand Down Expand Up @@ -820,7 +820,7 @@ if (fis.project.currentMedia() === 'publish') {
'pkg/rich-text.js': [
'src/components/RichText.js',
'froala-editor/**',
'jquery/**'
'react-froala-wysiwyg/**'
],

'pkg/tinymce.js': ['src/components/Tinymce.tsx', 'tinymce/**'],
Expand Down Expand Up @@ -873,8 +873,8 @@ if (fis.project.currentMedia() === 'publish') {
'!mpegts.js/**',
'!hls.js/**',
'!froala-editor/**',
'!react-froala-wysiwyg/**',
'!src/components/RichText.tsx',
'!jquery/**',
'!zrender/**',
'!echarts/**',
'!papaparse/**',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@
"echarts-stat": "^1.2.0",
"exceljs": "^4.3.0",
"file-saver": "^2.0.2",
"froala-editor": "2.9.6",
"froala-editor": "3.1.1",
"hls.js": "1.0.10",
"hoist-non-react-statics": "^3.3.2",
"hotkeys-js": "^3.8.7",
"immutability-helper": "^3.1.1",
"jquery": "^3.2.1",
"keycode": "^2.1.9",
"lodash": "^4.17.15",
"markdown-it": "^12.0.6",
Expand All @@ -77,6 +76,7 @@
"react-datetime": "2.16.2",
"react-dom": "^16.8.6",
"react-dropzone": "^11.4.2",
"react-froala-wysiwyg": "3.1.1",
"react-input-range": "1.3.0",
"react-json-view": "1.21.3",
"react-overlays": "5.1.1",
Expand Down
11 changes: 5 additions & 6 deletions scss/components/form/_rich-text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
max-height: 400px;
box-shadow: none;
overflow: auto;
border-top: 1px solid var(--Form-input-borderColor);
border: none;
}

.second-toolbar {
border: none;
}

.fr-toolbar .fr-command.fr-btn,
Expand Down Expand Up @@ -67,11 +71,6 @@
&.is-focused {
border: var(--Form-input-borderWidth) solid
var(--Form-input-onFocused-borderColor);

.fr-box.fr-basic.fr-top .fr-wrapper {
border-top: var(--Form-input-borderWidth) solid
var(--Form-input-onFocused-borderColor);
}
}

.fr-box.fr-basic .fr-element {
Expand Down
8 changes: 7 additions & 1 deletion src/components/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,13 @@ export default class Overlay extends React.Component<

// This goes after everything else because it adds a wrapping div.
if (rootClose) {
child = <RootClose onRootClose={props.onHide}>{child}</RootClose>;
child = (
<RootClose onRootClose={props.onHide}>
{(ref: any) => {
return <div ref={ref}>{child}</div>;
}}
</RootClose>
);
}

// @ts-ignore
Expand Down
Loading