Skip to content

Commit bf455b9

Browse files
tiny-ben-tranmetricjskemister85
authored
Improve React, Vuejs and Angular integration pages (#3948)
* Various changes and remove instructions related to premium plugins from the bundling with webpack guide * more changes * Update quick start cloud * Update cloud and bundle docs of react * More updates to React guides * Update angular docs * Fix syntax * Correct instructions for Angular zip package * Another go at React docs * Add a page for angular zip bundle * Update vue.js integration docs * Small changes * Update modules/ROOT/pages/introduction-to-bundling-tinymce.adoc Co-authored-by: Millie <millie.macdonald@tiny.cloud> * Resolve comments * Update modules/ROOT/pages/angular-pm-bundle.adoc Co-authored-by: Karl Kemister-Sheppard <karlkemistersheppard@gmail.com> * Update modules/ROOT/pages/angular-zip-bundle.adoc Co-authored-by: Karl Kemister-Sheppard <karlkemistersheppard@gmail.com> * Update modules/ROOT/pages/angular-zip-bundle.adoc Co-authored-by: Karl Kemister-Sheppard <karlkemistersheppard@gmail.com> * Update modules/ROOT/pages/angular-zip-bundle.adoc Co-authored-by: Karl Kemister-Sheppard <karlkemistersheppard@gmail.com> * Update modules/ROOT/pages/angular-zip.adoc Co-authored-by: Karl Kemister-Sheppard <karlkemistersheppard@gmail.com> * Accept suggestions * Resolve more comments * More * Lowercase npm * Remove the commented license key info --------- Co-authored-by: Millie <millie.macdonald@tiny.cloud> Co-authored-by: Karl Kemister-Sheppard <karlkemistersheppard@gmail.com>
1 parent 2f22884 commit bf455b9

37 files changed

Lines changed: 556 additions & 645 deletions

modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
****** xref:react-zip-bundle.adoc[Using a .zip package with bundling]
5858
***** Angular
5959
****** xref:angular-zip.adoc[Using a .zip package]
60+
****** xref:angular-zip-bundle.adoc[Bundle TinyMCE from a .zip package]
6061
***** Vue.js
6162
****** xref:vue-zip.adoc[Using a .zip package]
6263
***** Blazor
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
= Using {productname} from the Tiny Cloud CDN with the Angular framework
1+
= Using {productname} from Tiny Cloud in Angular
22
:navtitle: Angular
3-
:description: A guide on integrating TinyMCE from the Tiny Cloud into the Angular framework.
3+
:description: A guide on using TinyMCE from the Tiny Cloud in an Angular project.
44
:keywords: integration, integrate, angular
55
:productSource: cloud
66

7+
This guide shows how to integrate {productname} from Tiny Cloud into an Angular application using the link:https://github.com/tinymce/tinymce-angular[{productname} Angular component].
8+
9+
710
include::partial$integrations/angular-quick-start.adoc[]
Lines changed: 18 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,41 @@
1-
= Bundling TinyMCE with an Angular application
1+
= Bundling TinyMCE in Angular
22
:navtitle: Using a package manager with bundling
3-
:description: A guide on bundling TinyMCE with an Angular application using Vite.
3+
:description: A guide on bundling TinyMCE in an Angular application.
44
:keywords: integration, integrate, angular, bundle, vite, npm, tinymce
55
:productSource: package-manager
66
:packageName: @tinymce/tinymce-angular
77

8-
The https://github.com/tinymce/tinymce-angular[Official {productname} Angular component] integrates {productname} into Angular projects. This procedure creates a https://angular.dev/tools/cli/setup-local[basic Angular application] containing a bundled {productname} editor.
9-
10-
For examples of the {productname} Angular integration, visit https://tinymce.github.io/tinymce-angular/[the tinymce-angular storybook].
8+
This guide shows how to integrate {productname} in an Angular application using the link:https://github.com/tinymce/tinymce-angular[{productname} Angular component].
119

1210
== Prerequisites
1311

1412
This procedure requires https://nodejs.org/[Node.js (and NPM)].
1513

1614
== Procedure
1715

18-
. On a command line or command prompt, install the link:https://angular.dev/tools/cli[Angular CLI Tool] package.
16+
. From a terminal or command prompt, install the link:https://angular.dev/tools/cli[Angular CLI Tool^] globally.
1917
+
2018
[source,sh]
2119
----
2220
npm install -g @angular/cli
2321
----
22+
2423
. Create a new Angular project named `+tinymce-angular-demo+`.
2524
+
2625
[source,sh]
2726
----
2827
ng new --defaults --skip-git tinymce-angular-demo
2928
----
30-
. Change into the newly created directory.
31-
+
32-
[source,sh]
33-
----
34-
cd tinymce-angular-demo
35-
----
36-
. Install the `+tinymce+` and `+@tinymce/tinymce-angular+` packages.
29+
30+
. Navigate to the newly project directory and install `+tinymce+` and `+@tinymce/tinymce-angular+`.
3731
+
3832
[source,sh]
3933
----
40-
npm install tinymce @tinymce/tinymce-angular
34+
cd tinymce-angular-demo && npm install tinymce @tinymce/tinymce-angular
4135
----
42-
+
43-
include::partial$integrations/premium-plugins-install-step-link.adoc[]
44-
+
45-
[NOTE]
46-
====
47-
For information on configuring premium plugins when bundling, see: xref:bundling-plugins.adoc#using-premium-plugins[Using premium plugins].
48-
====
49-
+
50-
. Using a text editor, create `+src/app/editor.component.ts+` and set the contents to:
36+
37+
38+
. Create `+src/app/editor.component.ts+`.
5139
+
5240
[source,ts]
5341
----
@@ -74,11 +62,10 @@ import 'tinymce/plugins/lists';
7462
import 'tinymce/plugins/table';
7563
import 'tinymce/plugins/code';
7664
import 'tinymce/plugins/help';
77-
import 'tinymce/plugins/help/js/en.js';
65+
// Include resources that a plugin lazy-loads at the run-time
66+
import 'tinymce/plugins/help/js/i18n/keynav/en.js';
7867
import 'tinymce/plugins/wordcount';
7968
80-
include::partial$integrations/premium-plugins-bundling.adoc[]
81-
8269
// Content styles, including inline UI like fake cursors
8370
import 'tinymce/skins/content/default/content.js';
8471
import 'tinymce/skins/ui/oxide/content.js';
@@ -103,7 +90,8 @@ export class MyEditorComponent {
10390
}
10491
----
10592
+
106-
. Using a text editor, open `+src/app/app.component.ts+` and update it to use the editor component:
93+
94+
. Open `+app.component.ts+` and import `+MyEditorComponent+`.
10795
+
10896
[source,ts]
10997
----
@@ -121,32 +109,12 @@ import { MyEditorComponent } from './editor.component';
121109
})
122110
export class AppComponent {}
123111
----
124-
+
125-
. Run `+ng serve+` to start a dev server
126-
+
127-
[source,sh]
128-
----
129-
ng serve
130-
----
131-
+
132112

133-
. Build the application for production:
113+
. Run the Angular development server
134114
+
135115
[source,sh]
136116
----
137-
ng build
117+
ng serve
138118
----
139-
+
140-
This command creates an optimized production bundle in the `+dist+` directory.
141-
142-
. If premium plugins are included, update the `+licenseKey+` option in the editor component and include your xref:license-key.adoc[License Key].
143-
144-
== Next Steps
145119

146-
* For information on bundling, see: xref:introduction-to-bundling-tinymce.adoc[]
147-
* For examples of the {productname} integration, see: https://tinymce.github.io/tinymce-angular/[the tinymce-angular storybook].
148-
* For information on customizing:
149-
** {productname} integration, see: xref:angular-ref.adoc[Angular framework Technical Reference].
150-
** {productname}, see: xref:basic-setup.adoc[Basic setup].
151-
** The Angular application, see: https://angular.dev[the Angular documentation].
152-
* For a complete example, see: https://github.com/tinymce/tinymce-angular-integration-examples/tree/self-hosted-with-npm-premium-plugins[the Angular bundling example repository].
120+
include::partial$integrations/angular-other-resources.adoc[]

modules/ROOT/pages/angular-pm.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
= Using the {productname} package with the Angular framework
1+
= Lazy-loading {productname} in Angular
22
:navtitle: Using a package manager
3-
:description: A guide on integrating the TinyMCE package into the Angular framework.
3+
:description: A guide on integrating the TinyMCE package into an Angular application.
44
:keywords: integration, integrate, angular
55
:productSource: package-manager
66

7+
This guide shows how to integrate {productname} in an Angular application using the link:https://github.com/tinymce/tinymce-angular[{productname} Angular component].
8+
79
include::partial$integrations/angular-quick-start.adoc[]
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
= Bundling TinyMCE from a .zip package in Angular
2+
:navtitle: Using a package manager with bundling
3+
:description: A guide on bundling TinyMCE from a .zip package in an Angular application.
4+
:keywords: integration, integrate, angular, bundle, vite, npm, tinymce
5+
:productSource: package-manager
6+
:packageName: @tinymce/tinymce-angular
7+
8+
This guide shows how to integrate {productname} from a `.zip` package in an Angular application using the link:https://github.com/tinymce/tinymce-angular[{productname} Angular component^].
9+
10+
== Prerequisites
11+
12+
This procedure requires link:https://nodejs.org/[Node.js (and NPM)^].
13+
14+
== Procedure
15+
16+
. From a terminal or command prompt, install the link:https://angular.dev/tools/cli[Angular CLI Tool^] globally.
17+
+
18+
[source,sh]
19+
----
20+
npm install -g @angular/cli
21+
----
22+
23+
. Create a new Angular project named `+tinymce-angular-demo+`.
24+
+
25+
[source,sh]
26+
----
27+
ng new --defaults --skip-git tinymce-angular-demo
28+
----
29+
30+
. Navigate to the new project directory and `+@tinymce/tinymce-angular+`.
31+
+
32+
[source,sh]
33+
----
34+
cd tinymce-angular-demo && npm install @tinymce/tinymce-angular
35+
----
36+
37+
. Unzip the content of the `+tinymce/js+` folder from the link:{download-enterprise}[{productname} zip] into the `+src+` folder.
38+
39+
. Create `+src/app/editor.component.ts+` with the following:
40+
+
41+
[source,ts]
42+
----
43+
import { Component } from '@angular/core';
44+
import { EditorComponent } from '@tinymce/tinymce-angular';
45+
46+
// Ensure you import TinyMCE to register the global variable required by other components
47+
import '../tinymce/tinymce';
48+
// DOM model
49+
import '../tinymce/models/dom/model';
50+
// Theme
51+
import '../tinymce/themes/silver';
52+
// Toolbar icons
53+
import '../tinymce/icons/default';
54+
// Editor styles
55+
import '../tinymce/skins/ui/oxide/skin.js';
56+
// Content styles, including inline UI like fake cursors
57+
import '../tinymce/skins/content/default/content.js';
58+
import '../tinymce/skins/ui/oxide/content.js';
59+
60+
// Import plugins
61+
import '../tinymce/plugins/advlist';
62+
import '../tinymce/plugins/autolink';
63+
import '../tinymce/plugins/link';
64+
import '../tinymce/plugins/image';
65+
import '../tinymce/plugins/lists';
66+
import '../tinymce/plugins/table';
67+
import '../tinymce/plugins/code';
68+
import '../tinymce/plugins/help';
69+
// Include resources that a plugin lazy-loads at the run-time
70+
import '../tinymce/plugins/help/js/i18n/keynav/en.js';
71+
import '../tinymce/plugins/wordcount';
72+
73+
@Component({
74+
selector: 'app-editor',
75+
standalone: true,
76+
imports: [EditorComponent],
77+
template: `
78+
<editor
79+
[init]="init"
80+
licenseKey="gpl"
81+
/>
82+
`
83+
})
84+
export class MyEditorComponent {
85+
init: EditorComponent['init'] = {
86+
height: 500,
87+
plugins: 'advlist autolink lists link image table code help wordcount',
88+
toolbar: 'undo redo | blocks | bold italic | alignleft aligncenter alignright | bullist numlist | help'
89+
};
90+
}
91+
----
92+
93+
. Update `+app.component.ts+` to import `MyEditorComponent`.
94+
+
95+
[source,ts]
96+
----
97+
import { Component } from '@angular/core';
98+
import { MyEditorComponent } from './editor.component';
99+
100+
@Component({
101+
selector: 'app-root',
102+
standalone: true,
103+
imports: [MyEditorComponent],
104+
template: `
105+
<h1>TinyMCE Angular Demo</h1>
106+
<app-editor />
107+
`
108+
})
109+
export class AppComponent {}
110+
----
111+
112+
. Run the Angular development server
113+
+
114+
[source,sh]
115+
----
116+
ng serve
117+
----
118+
119+
include::partial$integrations/angular-other-resources.adoc[]
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
= Using the {productname} .zip package with the Angular framework
1+
= Lazy-loading {productname} from a .zip package in Angular
22
:navtitle: Using a .zip package
3-
:description: A guide on integrating a .zip version of TinyMCE into the Angular framework.
3+
:description: A guide on integrating a .zip version of TinyMCE into an Angular application.
44
:keywords: integration, integrate, angular
55
:productSource: zip
66

7+
This guide shows how to self-host and lazy-load {productname} from a `.zip` package into an Angular application using the link:https://github.com/tinymce/tinymce-angular[{productname} Angular component^].
8+
79
include::partial$integrations/angular-quick-start.adoc[]

modules/ROOT/pages/cloud-quick-start.adoc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
1-
= Quick start: {productname} with {cloudname}
1+
= Quick start: {productname} from {cloudname}
22
:navtitle: Quick start: Cloud
33
:description_short: Setup a basic {productname} {productmajorversion} editor using the {cloudname}.
44
:description: Get an instance of {productname} {productmajorversion} up and running using the {cloudname}.
55
:keywords: tinymce, script, textarea
66
:productSource: cloud
77

8-
== Install {productname} using the {cloudname}
98

109
{productname} {productmajorversion} is a powerful and flexible rich text editor that can be embedded in web applications. This quick start covers how to add a {productname} editor to a web page using the {cloudname}.
1110

1211
include::partial$misc/admon-account-creation-and-social-option.adoc[]
1312

1413
== Include the {productname} script
1514

16-
Include the following line of code in the `+<head>+` of a HTML page:
15+
Include the following script tag in the `+<head>+` of a HTML file:
1716

1817
[source,html,subs="attributes+"]
1918
----
2019
<script src="{cdnurl}" referrerpolicy="origin" crossorigin="anonymous"></script>
2120
----
2221

23-
== Initialize {productname} as part of a web form
22+
== Initialize {productname}
2423

2524
include::partial$install/initialize-editor-cloud.adoc[]
2625

27-
Adding this content to an HTML file and opening it in a web browser will load a {productname} editor, such as:
26+
Adding this content to the HTML file and opening it in a web browser will load a {productname} editor, such as:
2827

2928
liveDemo::default[]
3029

31-
== Update the "no-api-key" placeholder with your API key
30+
== Update the "no-api-key" placeholder
3231

33-
To remove the notice:
32+
Update the `+no-api-key+` placeholder in the source script URL (`+<script src=https://.../no-api-key/tinymce/{productmajorversion}/tinymce.min.js+/>`) with your {cloudname} API key, which is created when signing up to the link:{accountsignup}/[{cloudname}].
33+
34+
Providing a valid API key also removes the notice:
3435

3536
[WARNING]
3637
====
3738
**This domain is not registered with {cloudname}. Please see the quick start guide or create an account.**
3839
====
3940

40-
Update the `+no-api-key+` placeholder in the source script (`+<script src=...+`) with your {cloudname} API key, which is created when signing up to the link:{accountsignup}/[{cloudname}].
41-
4241
Signing up for a {cloudname} API key will also provide a trial of the xref:plugins.adoc#premium-plugins[Premium Plugins].
4342

4443
include::partial$install/save-content.adoc[]

modules/ROOT/pages/introduction-to-bundling-tinymce.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:description: Introduction to bundling TinyMCE with Webpack, Rollup.js, or Browserify.
55
:keywords: webpack, browserify, es6, rollup, commonjs, modules, tinymce, es2015
66

7-
The following guides and reference pages assist with bundling {productname} using a module loader, such as Webpack, Rollup.js, and Browserify. {productname} is a modular platform that is designed to lazy-load libraries when they are required. This allows developers to only bundle the components of {productname} that are required and keep the resulting bundle as small as possible.
7+
The following guides and reference pages assist with bundling {productname} into your project using a module bundler, such as Webpack, Rollup.js, and Browserify.
88

99
== Webpack
1010

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
= Using TinyMCE from the Tiny Cloud CDN with the React framework
1+
= Using TinyMCE from Tiny Cloud in React
22
:navtitle: React
3-
:description: A guide on integrating TinyMCE from the Tiny Cloud into the React framework.
4-
:keywords: integration, integrate, react, reactjs, vite, tinymce-react
3+
:description: A guide on integrating TinyMCE from the Tiny Cloud into React.
4+
:keywords: integration, integrate, react, reactjs, vite, tinymce-react, tinymce
55
:productSource: cloud
66

7+
8+
This guide shows how to integrate TinyMCE from Tiny Cloud into a React application using the link:https://github.com/tinymce/tinymce-react[{productname} React component].
9+
710
include::partial$integrations/react-quick-start.adoc[]
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
= Bundle with TinyMCE and the React framework
2-
:navtitle: Using a package manager with bundling
3-
:description: A guide on integrating the TinyMCE package into the React framework by bundling it.
1+
= Bundling TinyMCE in React
2+
:navtitle: Bundle TinyMCE in a React application
3+
:description: A guide on integrating the TinyMCE package into React by bundling it.
44
:keywords: integration, integrate, react, reactjs, vite, tinymce-react, bundle
55
:productSource: package-manager
66
:productUse: bundle
77

8+
This guide shows how to bundle TinyMCE in a React application with the link:https://github.com/tinymce/tinymce-react[{productname} React component^].
9+
810
include::partial$integrations/react-quick-start.adoc[]

0 commit comments

Comments
 (0)