From 1420c58addd8b0de910f52eb923ebfa74af35c87 Mon Sep 17 00:00:00 2001 From: Ben Tran Date: Wed, 16 Apr 2025 15:20:10 +0930 Subject: [PATCH 1/3] DOC-3181: Update React integration --- .../integrations/react-quick-start.adoc | 81 +++++++++---------- .../partials/integrations/react-tech-ref.adoc | 6 +- 2 files changed, 41 insertions(+), 46 deletions(-) diff --git a/modules/ROOT/partials/integrations/react-quick-start.adoc b/modules/ROOT/partials/integrations/react-quick-start.adoc index 20e60ed330..2e098474f0 100644 --- a/modules/ROOT/partials/integrations/react-quick-start.adoc +++ b/modules/ROOT/partials/integrations/react-quick-start.adoc @@ -18,6 +18,7 @@ This procedure requires https://nodejs.org/[Node.js (and npm)]. + [source,sh] ---- +# npm 7+, extra double-dash is needed npm create vite@5 tinymce-react-demo -- --template react-swc ---- . Change to the newly created directory. @@ -28,11 +29,11 @@ cd tinymce-react-demo ---- ifeval::["{productSource}" == "cloud"] -. Install the `+@tinymce/tinymce-react+` package and save it to your `+package.json+` with `+--save+`. +. Install the `+@tinymce/tinymce-react+` package. + [source,sh] ---- -npm install --save @tinymce/tinymce-react +npm install @tinymce/tinymce-react ---- . Using a text editor, open `+./src/App.jsx+` and replace the contents with: @@ -50,11 +51,12 @@ export default function App() { console.log(editorRef.current.getContent()); } }; + return ( <> editorRef.current = editor} + onInit={ (_evt, editor) => editorRef.current = editor } initialValue="

This is the initial content of the editor.

" init={{ height: 500, @@ -83,11 +85,11 @@ This JavaScript file will create a component "`+App+`" containing a {productname endif::[] ifeval::["{productSource}" == "package-manager"] ifeval::["{productUse}" == "host"] -. Install the `+tinymce+`, `+@tinymce/tinymce-react+` and `+fs-extra+` packages and save them to your `+package.json+` with `+--save+`. +. Install the `+tinymce+`, `+@tinymce/tinymce-react+` and `+fs-extra+` packages. + [source,sh] ---- -npm install --save tinymce @tinymce/tinymce-react fs-extra +npm install tinymce @tinymce/tinymce-react fs-extra ---- . Setup a `postinstall` script to copy {productname} to the public directory for hosting @@ -175,11 +177,11 @@ export default function App() { endif::[] ifeval::["{productUse}" == "bundle"] -. Install the `+tinymce+` and `+@tinymce/tinymce-react+` packages and save them to your `+package.json+` with `+--save+`. +. Install the `+tinymce+` and `+@tinymce/tinymce-react+` packages + [source,sh] ---- -npm install --save tinymce @tinymce/tinymce-react +npm install tinymce @tinymce/tinymce-react ---- . Using a text editor, create `+./src/BundledEditor.jsx+` and set the contents to: @@ -265,6 +267,7 @@ export default function App() { console.log(editorRef.current.getContent()); } }; + return ( <> Date: Wed, 14 May 2025 09:09:32 +1000 Subject: [PATCH 2/3] Update modules/ROOT/partials/integrations/react-quick-start.adoc --- modules/ROOT/partials/integrations/react-quick-start.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/partials/integrations/react-quick-start.adoc b/modules/ROOT/partials/integrations/react-quick-start.adoc index 2e098474f0..6339586930 100644 --- a/modules/ROOT/partials/integrations/react-quick-start.adoc +++ b/modules/ROOT/partials/integrations/react-quick-start.adoc @@ -55,7 +55,7 @@ export default function App() { return ( <> editorRef.current = editor } initialValue="

This is the initial content of the editor.

" init={{ From 2bd4ef923aeb92e22b7d9e432b799af6c9b34aa0 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 14 May 2025 09:56:24 +1000 Subject: [PATCH 3/3] DOC-3181: Replace your-api-key with no-api-key. --- modules/ROOT/partials/integrations/react-tech-ref.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/ROOT/partials/integrations/react-tech-ref.adoc b/modules/ROOT/partials/integrations/react-tech-ref.adoc index 6a5901da2d..aa27ae9b40 100644 --- a/modules/ROOT/partials/integrations/react-tech-ref.adoc +++ b/modules/ROOT/partials/integrations/react-tech-ref.adoc @@ -104,7 +104,7 @@ The `+tinymce-react+` integration will try to source {productname} in the follow These props are used to configure how the editor is sourced: -xref:apikey[`+apiKey+`]:: The {cloudname} API key. When loading from {cloudname}, use this prop to remove the "This domain is not registered..." warning message. +xref:apikey[`+apiKey+`]:: The {cloudname} API key. When loading from {cloudname}, use this prop to remove the "A valid API key is required to continue using TinyMCE. Please alert the admin to check the current API key. Click here to learn more." warning message. xref:licenseKey[`+licenseKey+`]:: The {cloudname} License key. Use this when self-hosting {productname} instead of loading from {cloudname}. @@ -167,7 +167,7 @@ None of the configuration props are *required* for the {productname} React compo {cloudname} API key. -Required for deployments using the {cloudname} to provide the {productname} editor without the warning message "This domain is not registered...". +Required for deployments using the {cloudname} to provide the {productname} editor without the warning message "A valid API key is required to continue using TinyMCE. Please alert the admin to check the current API key. Click here to learn more". include::partial$misc/get-an-api-key.adoc[] @@ -180,7 +180,7 @@ include::partial$misc/get-an-api-key.adoc[] [source,jsx] ---- ---- @@ -229,7 +229,7 @@ Such as: [source,jsx,subs="attributes+"] ----