Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
68 changes: 42 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"peerDependencies": {
"@babel/runtime": "^7.26.10",
"@semantic-ui-react/css-patch": "^1.0.0",
"@tinymce/tinymce-react": "^4.3.0",
"@hugerte/hugerte-react": "^2.0.2",
"axios": "^1.8.2",
"formik": "^2.1.0",
"lodash": "^4.17.0",
Expand All @@ -35,7 +35,7 @@
"react-dom": "^16.13.0",
"semantic-ui-css": "^2.4.0",
"semantic-ui-react": "^2.1.0",
"tinymce": "^6.7.2",
"hugerte": "^1.0.10",
"react-overridable": "^1.0.0",
"yup": "^0.32.11"
},
Expand All @@ -49,7 +49,7 @@
"@testing-library/jest-dom": "^4.2.0",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.0",
"@tinymce/tinymce-react": "^4.3.0",
"@hugerte/hugerte-react": "^2.0.2",
"ajv": "^8.0.0",
"ajv-keywords": "^5.0.0",
"axios": "^1.7.7",
Expand All @@ -73,7 +73,7 @@
"rollup-plugin-url": "^3.0.0",
"semantic-ui-css": "^2.4.0",
"semantic-ui-react": "^2.1.0",
"tinymce": "^6.7.2",
"hugerte": "^1.0.10",
"typescript": "^4.9.5",
"yup": "^0.32.11"
},
Expand Down
33 changes: 16 additions & 17 deletions src/lib/forms/RichEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,29 @@
// React-Invenio-Forms is free software; you can redistribute it and/or modify it
// under the terms of the MIT License; see LICENSE file for more details.
import React, { Component } from "react";
import { Editor } from "@tinymce/tinymce-react";
import "tinymce/tinymce";
import "tinymce/models/dom/model";
import "tinymce/themes/silver";
import "tinymce/icons/default";
import "tinymce/plugins/table";
import "tinymce/plugins/autoresize";
import "tinymce/plugins/code";
import "tinymce/plugins/codesample";
import "tinymce/plugins/image";
import "tinymce/plugins/link";
import "tinymce/plugins/lists";
import "tinymce/plugins/wordcount";
import "tinymce/plugins/preview";
import { Editor } from "@hugerte/hugerte-react";
import "hugerte/hugerte";
import "hugerte/models/dom/model";
import "hugerte/themes/silver";
import "hugerte/icons/default";
import "hugerte/plugins/table";
import "hugerte/plugins/autoresize";
import "hugerte/plugins/code";
import "hugerte/plugins/codesample";
import "hugerte/plugins/image";
import "hugerte/plugins/link";
import "hugerte/plugins/lists";
import "hugerte/plugins/wordcount";
import "hugerte/plugins/preview";
import PropTypes from "prop-types";
import { Button, Message } from "semantic-ui-react";
import { FilesList } from "./FilesList";

// Make content inside the editor look identical to how we will render it across the site.
// TinyMCE runs within an iframe, so we cannot style it with page-wide CSS styles as normal.
// HugeRTE runs within an iframe, so we cannot style it with page-wide CSS styles as normal.
//
// TinyMCE overrides blockquotes with custom styles, so we need to use !important to override
// HugeRTE overrides blockquotes with custom styles, so we need to use !important to override
// the overrides in a consistent and reliable way.
// https://github.com/tinymce/tinymce-dist/blob/8d7491f2ee341c201b68cc7c3701d54703edd474/skins/content/tinymce-5/content.css#L61-L70
const editorContentStyle = (disabled) => `
body {
font-size: 14px;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/forms/RichInputField.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class RichInputField extends Component {
) : (
<RichEditor
initialValue={initialValue}
inputValue={() => value} // () => To avoid re-rendering
inputValue={value}
optimized={optimized}
editorConfig={editorConfig}
onBlur={(event, editor) => {
Expand Down
Loading