Skip to content

Commit 6135b00

Browse files
committed
More updates to React guides
1 parent 1c50bb7 commit 6135b00

File tree

3 files changed

+29
-123
lines changed

3 files changed

+29
-123
lines changed

modules/ROOT/pages/react-zip-bundle.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
= Bundling the TinyMCE .zip package with the React framework
2-
:navtitle: Using a .zip package with bundling
3-
:description: A guide on integrating a .zip version of TinyMCE into the React framework by bundling it.
1+
= Bundling TinyMCE from .zip package in React
2+
:navtitle: Using a .zip package with a module bundler
3+
:description: A guide on integrating a .zip version of TinyMCE in a React project by bundling it.
44
:keywords: integration, integrate, react, reactjs, vite, tinymce-react, bundle
55
:productSource: zip
66
:productUse: bundle

modules/ROOT/pages/react-zip-host.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
= Hosting the TinyMCE .zip package with the React framework
1+
= Self-host TinyMCE from .zip package in React
22
:page-aliases: react-zip.adoc
3-
:navtitle: Using a .zip package with hosting
4-
:description: A guide on integrating a .zip version of TinyMCE into the React framework by self-hosting it.
3+
:navtitle: Using a TinyMCE .zip package in React
4+
:description: A guide on self-hosting a .zip version of TinyMCE into React.
55
:keywords: integration, integrate, react, reactjs, vite, tinymce-react, host
66
:productSource: zip
77
:productUse: host

modules/ROOT/partials/integrations/react-quick-start.adoc

Lines changed: 23 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ npm run postinstall
129129
----
130130
+
131131

132-
. Add `Editor` component to `+./src/App.jsx+` and update `tinymceScriptSrc` as below:
132+
. Add `Editor` component to `+./src/App.jsx+` and point `tinymceScriptSrc` the `tinymce` location.
133133
+
134134
[source,jsx]
135135
----
@@ -247,51 +247,25 @@ endif::[]
247247
endif::[]
248248
ifeval::["{productSource}" == "zip"]
249249
ifeval::["{productUse}" == "host"]
250-
. Install the `+@tinymce/tinymce-react+` package.
251-
+
252-
[source,sh]
253-
----
254-
npm install @tinymce/tinymce-react
255-
----
256-
+
257-
. Unzip the content of the `+tinymce/js+` folder from the link:{download-enterprise}[{productname} zip] into the `+public+` folder. Afterwards the directory listing should be similar to below:
258-
+
259-
.> `tree -L 2 public`
260-
[source,text]
261-
----
262-
public
263-
├── favicon.ico
264-
├── index.html
265-
├── logo192.png
266-
├── logo512.png
267-
├── manifest.json
268-
├── robots.txt
269-
└── tinymce
270-
├── icons
271-
├── langs
272-
├── license.txt
273-
├── models
274-
├── plugins
275-
├── skins
276-
├── themes
277-
├── tinymce.d.ts
278-
└── tinymce.min.js
279-
----
250+
251+
. Unzip the content of the `+tinymce/js+` folder from the link:{download-enterprise}[{productname} zip] into the `+public+` folder
280252
+
281-
. Using a text editor, open `+./eslint.config.js` and add `+'src/tinymce'+` to the `+ignores+` array.
253+
254+
. Add `+'public/tinymce'+` to the `+ignores+` array to `+./eslint.config.js` file.
282255
+
283256
.Diff of `.eslint.config.js`
284257
[source,patch]
285258
----
286259
export default tseslint.config(
287260
- { ignores: ['dist'] },
288-
+ { ignores: ['dist', 'src/tinymce'] },
261+
+ { ignores: ['dist', 'public/tinymce'] },
289262
{
290263
extends: [js.configs.recommended, ...tseslint.configs.recommended],
291264
files: ['**/*.{ts,tsx}'],
292265
----
293266
+
294-
. Using a text editor, open `+./src/App.jsx+` and replace the contents with:
267+
268+
. Update `+./src/App.jsx+` as below. *Note*: Remember to point `tinymceScriptSrc` the `tinymce` location.
295269
+
296270
[source,jsx]
297271
----
@@ -334,44 +308,21 @@ export default function App() {
334308
}
335309
----
336310
+
311+
337312
. Update the `+licenseKey+` option in the editor element and include your xref:license-key.adoc[License Key].
338313
endif::[]
339314
ifeval::["{productUse}" == "bundle"]
340315

341-
. Install the `+@tinymce/tinymce-react+` and `+script-loader+` packages.
316+
. Install `+script-loader+` package.
342317
+
343318
[source,sh]
344319
----
345-
npm install @tinymce/tinymce-react script-loader
320+
npm install script-loader
346321
----
347322
+
348-
. Unzip the content of the `+tinymce/js+` folder from the link:{download-enterprise}[{productname} zip] into the `+src+` folder. Afterwards the directory listing should be similar to below:
349-
+
350-
.> `tree -L 2 src`
351-
[source,text]
352-
----
353-
src
354-
├── App.css
355-
├── App.js
356-
├── App.test.js
357-
├── index.css
358-
├── index.js
359-
├── logo.svg
360-
├── reportWebVitals.js
361-
├── setupTests.js
362-
└── tinymce
363-
├── icons
364-
├── langs
365-
├── license.txt
366-
├── models
367-
├── plugins
368-
├── skins
369-
├── themes
370-
├── tinymce.d.ts
371-
└── tinymce.min.js
372-
----
373-
+
374-
. Using a text editor, open `+./eslint.config.js+` and add `+'src/tinymce'+` to the `+ignores+` array.
323+
. Unzip the content of the `+tinymce/js+` folder from the link:{download-enterprise}[{productname} zip] into the `+src+` folder.
324+
325+
. Add `+'src/tinymce'+` to the `+ignores+` array to `+./eslint.config.js` file.
375326
+
376327
.Diff of `.eslint.config.js`
377328
[source,patch]
@@ -391,60 +342,13 @@ index 092408a..1ab8db4 100644
391342
files: ['**/*.{ts,tsx}'],
392343
----
393344
+
394-
. Using a text editor, create `+./src/BundledEditor.jsx+` and set the contents to:
345+
346+
. Create `+./src/BundledEditor.jsx+` and set the contents to:
395347
+
396348
[source,jsx]
397349
----
398350
import { Editor } from '@tinymce/tinymce-react';
399-
400-
// TinyMCE so the global var exists
401-
import './tinymce/tinymce.min.js';
402-
// DOM model
403-
import './tinymce/models/dom/model.min.js'
404-
// Theme
405-
import './tinymce/themes/silver/theme.min.js';
406-
// Toolbar icons
407-
import './tinymce/icons/default/icons.min.js';
408-
// Editor styles
409-
import './tinymce/skins/ui/oxide/skin.min.js';
410-
411-
// importing the plugin index.js file.
412-
// if you use a plugin that is not listed here the editor will fail to load
413-
import './tinymce/plugins/advlist';
414-
import './tinymce/plugins/anchor';
415-
import './tinymce/plugins/autolink';
416-
import './tinymce/plugins/autoresize';
417-
import './tinymce/plugins/autosave';
418-
import './tinymce/plugins/charmap';
419-
import './tinymce/plugins/code';
420-
import './tinymce/plugins/codesample';
421-
import './tinymce/plugins/directionality';
422-
import './tinymce/plugins/emoticons';
423-
import './tinymce/plugins/fullscreen';
424-
import './tinymce/plugins/help';
425-
import './tinymce/plugins/image';
426-
import './tinymce/plugins/importcss';
427-
import './tinymce/plugins/insertdatetime';
428-
import './tinymce/plugins/link';
429-
import './tinymce/plugins/lists';
430-
import './tinymce/plugins/media';
431-
import './tinymce/plugins/nonbreaking';
432-
import './tinymce/plugins/pagebreak';
433-
import './tinymce/plugins/preview';
434-
import './tinymce/plugins/quickbars';
435-
import './tinymce/plugins/save';
436-
import './tinymce/plugins/searchreplace';
437-
import './tinymce/plugins/table';
438-
import './tinymce/plugins/visualblocks';
439-
import './tinymce/plugins/visualchars';
440-
import './tinymce/plugins/wordcount';
441-
442-
// importing plugin resources
443-
import './tinymce/plugins/emoticons/js/emojis.js';
444-
445-
// Content styles, including inline UI like fake cursors
446-
import './tinymce/skins/content/default/content.js';
447-
import './tinymce/skins/ui/oxide/content.js';
351+
include::partial$integrations/import-tinymce-statements.adoc[]
448352
449353
export default function BundledEditor(props) {
450354
return (
@@ -456,8 +360,9 @@ export default function BundledEditor(props) {
456360
}
457361
----
458362
+
459-
. Update the `+licenseKey+` option in the editor element and include your xref:license-key.adoc[License Key].
460-
. Using a text editor, open `+./src/App.jsx+` and replace the contents with:
363+
. Update the `+licenseKey+` option to include your xref:license-key.adoc[License Key].
364+
365+
. Add `BundleEditor` component into `+./src/App.jsx+` as the following:
461366
+
462367
[source,jsx]
463368
----
@@ -481,8 +386,9 @@ export default function App() {
481386
height: 500,
482387
menubar: false,
483388
plugins: [
484-
'advlist', 'anchor', 'autolink', 'help', 'image', 'link', 'lists',
485-
'searchreplace', 'table', 'wordcount'
389+
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap',
390+
'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
391+
'insertdatetime', 'media', 'table', 'preview', 'help', 'wordcount'
486392
],
487393
toolbar: 'undo redo | blocks | ' +
488394
'bold italic forecolor | alignleft aligncenter ' +

0 commit comments

Comments
 (0)