From 0a030366e79476f2357d6f4fb3d6c6a61f0dec13 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Thu, 14 May 2026 12:57:48 +0200 Subject: [PATCH 1/4] deps: replace tinymce with hugerte MIT fork * Replaces tinymce ^6.7.2 with hugerte ^1.0.10 * Replaces @tinymce/tinymce-react ^4.3.0 with @hugerte/hugerte-react ^2.0.2 --- package-lock.json | 68 +++++++++++++++++++++++++++++------------------ package.json | 8 +++--- 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index 161037d8..bce39b8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT", "devDependencies": { "@babel/cli": "^7.5.0", + "@hugerte/hugerte-react": "^2.0.2", "@inveniosoftware/eslint-config-invenio": "^2.0.0", "@rollup/plugin-babel": "^5.0.0", "@rollup/plugin-commonjs": "^11.1.0", @@ -18,7 +19,6 @@ "@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", "ajv": "^8.0.0", "ajv-keywords": "^5.0.0", "axios": "^1.7.7", @@ -27,6 +27,7 @@ "enzyme-adapter-react-16": "^1.15.0", "expect": "^26.0.0", "formik": "^2.1.0", + "hugerte": "^1.0.10", "json": "^10.0.0", "lodash": "^4.17.0", "luxon": "^1.23.0", @@ -42,7 +43,6 @@ "rollup-plugin-url": "^3.0.0", "semantic-ui-css": "^2.4.0", "semantic-ui-react": "^2.1.0", - "tinymce": "^6.7.2", "typescript": "^4.9.5", "yup": "^0.32.11" }, @@ -51,10 +51,11 @@ }, "peerDependencies": { "@babel/runtime": "^7.26.10", + "@hugerte/hugerte-react": "^2.0.2", "@semantic-ui-react/css-patch": "^1.0.0", - "@tinymce/tinymce-react": "^4.3.0", "axios": "^1.8.2", "formik": "^2.1.0", + "hugerte": "^1.0.10", "lodash": "^4.17.0", "luxon": "^1.23.0", "query-string": "^7.0.0", @@ -63,7 +64,6 @@ "react-overridable": "^1.0.0", "semantic-ui-css": "^2.4.0", "semantic-ui-react": "^2.1.0", - "tinymce": "^6.7.2", "yup": "^0.32.11" } }, @@ -2689,6 +2689,34 @@ "react-dom": "^16.8.0 || ^17 || ^18" } }, + "node_modules/@hugerte/framework-integration-shared": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@hugerte/framework-integration-shared/-/framework-integration-shared-1.2.0.tgz", + "integrity": "sha512-ogcvVO0dFcb/HQAY7itj8xnmeMcHZmtMaOj9uC34ZYopnvj12TGWnfRQwbt8jZMlmoZk2z1TTLmJgvQBuH013A==", + "dev": true, + "peerDependencies": { + "hugerte": "^1.0.4" + } + }, + "node_modules/@hugerte/hugerte-react": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@hugerte/hugerte-react/-/hugerte-react-2.0.2.tgz", + "integrity": "sha512-vIVEX2mpxX/Vl9pvzhOd4bKEktS2sSOrd8smS6lIqgqETsuWTfLbjvXWni99i2a+VEMfWvK+nLqP8AmYhcELBQ==", + "dev": true, + "dependencies": { + "@hugerte/framework-integration-shared": "^1.1.0" + }, + "peerDependencies": { + "hugerte": "^1.0.6", + "react": "^19.0.0 || ^18.0.0 || ^17.0.1 || ^16.7.0", + "react-dom": "^19.0.0 || ^18.0.0 || ^17.0.1 || ^16.7.0" + }, + "peerDependenciesMeta": { + "hugerte": { + "optional": true + } + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", @@ -4896,21 +4924,6 @@ "@testing-library/dom": ">=5" } }, - "node_modules/@tinymce/tinymce-react": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tinymce/tinymce-react/-/tinymce-react-4.3.2.tgz", - "integrity": "sha512-wJHZhPf2Mk3yTtdVC/uIGh+kvDgKuTw/qV13uzdChTNo68JI1l7jYMrSQOpyimDyn5LHAw0E1zFByrm1WHAVeA==", - "dev": true, - "license": "MIT", - "dependencies": { - "prop-types": "^15.6.2", - "tinymce": "^6.0.0 || ^5.5.1" - }, - "peerDependencies": { - "react": "^18.0.0 || ^17.0.1 || ^16.7.0", - "react-dom": "^18.0.0 || ^17.0.1 || ^16.7.0" - } - }, "node_modules/@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", @@ -12201,6 +12214,16 @@ "node": ">= 6" } }, + "node_modules/hugerte": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/hugerte/-/hugerte-1.0.10.tgz", + "integrity": "sha512-Uk7drnB4mqJUuXCtgDLDmBNSHNp7CH5juM3MGXE8HVJZwySW77xcdRaPss23vzneXY+dDoRABQcuFsBoa6s4CQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/hugerte" + } + }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -22787,13 +22810,6 @@ "dev": true, "license": "MIT" }, - "node_modules/tinymce": { - "version": "6.8.6", - "resolved": "https://registry.npmjs.org/tinymce/-/tinymce-6.8.6.tgz", - "integrity": "sha512-++XYEs8lKWvZxDCjrr8Baiw7KiikraZ5JkLMg6EdnUVNKJui0IsrAADj5MsyUeFkcEryfn2jd3p09H7REvewyg==", - "dev": true, - "license": "MIT" - }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", diff --git a/package.json b/package.json index b869ca4b..2dc567e9 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" }, @@ -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", @@ -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" }, From 356603c5888d3f8e4aaff706f08eaf4824071e74 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Thu, 14 May 2026 13:01:59 +0200 Subject: [PATCH 2/4] editor: migrate RichEditor from TinyMCE to HugeRTE * Replaces tinymce/* imports with hugerte/* equivalents * Replaces @tinymce/tinymce-react with @hugerte/hugerte-react --- src/lib/forms/RichEditor.js | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/lib/forms/RichEditor.js b/src/lib/forms/RichEditor.js index 64d7d459..dbac2e9d 100644 --- a/src/lib/forms/RichEditor.js +++ b/src/lib/forms/RichEditor.js @@ -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; From f9482c23415b7ba06f8caec5267a606aeef2e565 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Thu, 14 May 2026 13:02:49 +0200 Subject: [PATCH 3/4] fix: pass string directly to RichEditor inputValue prop * Removes unnecessary function wrapper around value prop --- src/lib/forms/RichInputField.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/forms/RichInputField.js b/src/lib/forms/RichInputField.js index 2965b485..fcf40322 100644 --- a/src/lib/forms/RichInputField.js +++ b/src/lib/forms/RichInputField.js @@ -51,7 +51,7 @@ export class RichInputField extends Component { ) : ( value} // () => To avoid re-rendering + inputValue={value} optimized={optimized} editorConfig={editorConfig} onBlur={(event, editor) => { From 66556532b392a570b1f0a0ed1a18c5209b1ba8e1 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Mon, 18 May 2026 11:53:56 +0200 Subject: [PATCH 4/4] editor: add base_url HugeRTE to fix skin loading * Adds explicit base_url to RichEditor config, so HugeRTE resolves skin CSS paths correctly, when bundled inside Webpack/Rspack chunks. Without base_url, HugeRTE's auto-detection fails, because hugerte script is inside a dynamic chunk, not a standalone