-
Notifications
You must be signed in to change notification settings - Fork 221
Improvements on React and Angular integration pages #3948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: tinymce/8
Are you sure you want to change the base?
Changes from all commits
9498f66
47921c1
414b426
1c50bb7
6135b00
cf797bf
080c4b6
367992d
867a2e1
fa1a313
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| = Using {productname} from the Tiny Cloud CDN with the Angular framework | ||
| = Using {productname} from Tiny Cloud in Angular | ||
| :navtitle: Angular | ||
| :description: A guide on integrating TinyMCE from the Tiny Cloud into the Angular framework. | ||
| :description: A guide on using TinyMCE from the Tiny Cloud in a Angular project. | ||
| :keywords: integration, integrate, angular | ||
| :productSource: cloud | ||
|
|
||
| This guide shows how to integrate {productname} from Tiny Cloud into an Angular application using https://github.com/tinymce/tinymce-angular[{productname} Angular component]. | ||
|
|
||
|
|
||
| include::partial$integrations/angular-quick-start.adoc[] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,53 +1,41 @@ | ||
| = Bundling TinyMCE with an Angular application | ||
| = Bundling TinyMCE from NPM in an Angular application | ||
| :navtitle: Using a package manager with bundling | ||
| :description: A guide on bundling TinyMCE with an Angular application using Vite. | ||
| :description: A guide on bundling TinyMCE in an Angular application using Vite. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heading is NPM, this says Vite? |
||
| :keywords: integration, integrate, angular, bundle, vite, npm, tinymce | ||
| :productSource: package-manager | ||
| :packageName: @tinymce/tinymce-angular | ||
|
|
||
| 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. | ||
|
|
||
| For examples of the {productname} Angular integration, visit https://tinymce.github.io/tinymce-angular/[the tinymce-angular storybook]. | ||
| This guide shows how to integrate the NPM version of {productname} in an Angular application. | ||
|
|
||
| == Prerequisites | ||
|
|
||
| This procedure requires https://nodejs.org/[Node.js (and NPM)]. | ||
|
|
||
| == Procedure | ||
|
|
||
| . On a command line or command prompt, install the link:https://angular.dev/tools/cli[Angular CLI Tool] package. | ||
| . From a terminal or command prompt, install the link:https://angular.dev/tools/cli[Angular CLI Tool] globally. | ||
| + | ||
| [source,sh] | ||
| ---- | ||
| npm install -g @angular/cli | ||
| ---- | ||
|
|
||
| . Create a new Angular project named `+tinymce-angular-demo+`. | ||
| + | ||
| [source,sh] | ||
| ---- | ||
| ng new --defaults --skip-git tinymce-angular-demo | ||
| ---- | ||
| . Change into the newly created directory. | ||
| + | ||
| [source,sh] | ||
| ---- | ||
| cd tinymce-angular-demo | ||
| ---- | ||
| . Install the `+tinymce+` and `+@tinymce/tinymce-angular+` packages. | ||
|
|
||
| . Go to the newly project directory and install `+tinymce+` and `+@tinymce/tinymce-angular+`. | ||
| + | ||
| [source,sh] | ||
| ---- | ||
| npm install tinymce @tinymce/tinymce-angular | ||
| cd tinymce-angular-demo && npm install tinymce @tinymce/tinymce-angular | ||
| ---- | ||
| + | ||
| include::partial$integrations/premium-plugins-install-step-link.adoc[] | ||
| + | ||
| [NOTE] | ||
| ==== | ||
| For information on configuring premium plugins when bundling, see: xref:bundling-plugins.adoc#using-premium-plugins[Using premium plugins]. | ||
| ==== | ||
| + | ||
| . Using a text editor, create `+src/app/editor.component.ts+` and set the contents to: | ||
|
|
||
|
|
||
| . Create `+src/app/editor.component.ts+`. | ||
| + | ||
| [source,ts] | ||
| ---- | ||
|
|
@@ -74,11 +62,10 @@ import 'tinymce/plugins/lists'; | |
| import 'tinymce/plugins/table'; | ||
| import 'tinymce/plugins/code'; | ||
| import 'tinymce/plugins/help'; | ||
| import 'tinymce/plugins/help/js/en.js'; | ||
| // Include resources that a plugin lazy-loads at the run-time | ||
| import 'tinymce/plugins/help/js/i18n/keynav/en.js'; | ||
| import 'tinymce/plugins/wordcount'; | ||
|
|
||
| include::partial$integrations/premium-plugins-bundling.adoc[] | ||
|
|
||
| // Content styles, including inline UI like fake cursors | ||
| import 'tinymce/skins/content/default/content.js'; | ||
| import 'tinymce/skins/ui/oxide/content.js'; | ||
|
|
@@ -103,7 +90,8 @@ export class MyEditorComponent { | |
| } | ||
| ---- | ||
| + | ||
| . Using a text editor, open `+src/app/app.component.ts+` and update it to use the editor component: | ||
|
|
||
| . Open `+src/app/app.component.ts+` and update it to use `MyEditorComponent`: | ||
| + | ||
| [source,ts] | ||
| ---- | ||
|
|
@@ -121,32 +109,12 @@ import { MyEditorComponent } from './editor.component'; | |
| }) | ||
| export class AppComponent {} | ||
| ---- | ||
| + | ||
| . Run `+ng serve+` to start a dev server | ||
| + | ||
| [source,sh] | ||
| ---- | ||
| ng serve | ||
| ---- | ||
| + | ||
|
|
||
| . Build the application for production: | ||
| . Run the Angular development server | ||
| + | ||
| [source,sh] | ||
| ---- | ||
| ng build | ||
| ng serve | ||
| ---- | ||
| + | ||
| This command creates an optimized production bundle in the `+dist+` directory. | ||
|
|
||
| . If premium plugins are included, update the `+licenseKey+` option in the editor component and include your xref:license-key.adoc[License Key]. | ||
|
|
||
| == Next Steps | ||
|
|
||
| * For information on bundling, see: xref:introduction-to-bundling-tinymce.adoc[] | ||
| * For examples of the {productname} integration, see: https://tinymce.github.io/tinymce-angular/[the tinymce-angular storybook]. | ||
| * For information on customizing: | ||
| ** {productname} integration, see: xref:angular-ref.adoc[Angular framework Technical Reference]. | ||
| ** {productname}, see: xref:basic-setup.adoc[Basic setup]. | ||
| ** The Angular application, see: https://angular.dev[the Angular documentation]. | ||
| * 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]. | ||
| include::partial$integrations/angular-other-resources.adoc[] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| = Using the {productname} package with the Angular framework | ||
| = Using {productname} from NPM in Angular | ||
| :navtitle: Using a package manager | ||
| :description: A guide on integrating the TinyMCE package into the Angular framework. | ||
| :description: A guide on integrating the TinyMCE package into an Angular application. | ||
| :keywords: integration, integrate, angular | ||
| :productSource: package-manager | ||
|
|
||
| This guide shows how to integrate the NPM version of {productname} in an Angular application. | ||
|
|
||
| include::partial$integrations/angular-quick-start.adoc[] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,119 @@ | ||||||
| = Bundling TinyMCE from .zip package in Angular | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| :navtitle: Using a package manager with bundling | ||||||
| :description: A guide on bundling TinyMCE from a .zip package in an Angular application. | ||||||
| :keywords: integration, integrate, angular, bundle, vite, npm, tinymce | ||||||
| :productSource: package-manager | ||||||
| :packageName: @tinymce/tinymce-angular | ||||||
|
|
||||||
| This guide shows how to integrate {productname} from a `.zip` package in an Angular application. | ||||||
|
|
||||||
| == Prerequisites | ||||||
|
|
||||||
| This procedure requires https://nodejs.org/[Node.js (and NPM)]. | ||||||
|
|
||||||
| == Procedure | ||||||
|
|
||||||
| . From a terminal or command prompt, install the link:https://angular.dev/tools/cli[Angular CLI Tool] globally. | ||||||
| + | ||||||
| [source,sh] | ||||||
| ---- | ||||||
| npm install -g @angular/cli | ||||||
| ---- | ||||||
|
|
||||||
| . Create a new Angular project named `+tinymce-angular-demo+`. | ||||||
| + | ||||||
| [source,sh] | ||||||
| ---- | ||||||
| ng new --defaults --skip-git tinymce-angular-demo | ||||||
| ---- | ||||||
|
|
||||||
| . Go to the new project directory and `+@tinymce/tinymce-angular+`. | ||||||
| + | ||||||
| [source,sh] | ||||||
| ---- | ||||||
| cd tinymce-angular-demo && npm install @tinymce/tinymce-angular | ||||||
| ---- | ||||||
|
|
||||||
| . Unzip the content of the `+tinymce/js+` folder from the link:{download-enterprise}[{productname} zip] into the `+src+` folder. | ||||||
|
|
||||||
| . Create `+src/app/editor.component.ts+` with the following: | ||||||
| + | ||||||
| [source,ts] | ||||||
| ---- | ||||||
| import { Component } from '@angular/core'; | ||||||
| import { EditorComponent } from '@tinymce/tinymce-angular'; | ||||||
| // Ensure you import TinyMCE to register the global variable required by other components | ||||||
| import '../tinymce/tinymce'; | ||||||
| // DOM model | ||||||
| import '../tinymce/models/dom/model'; | ||||||
| // Theme | ||||||
| import '../tinymce/themes/silver'; | ||||||
| // Toolbar icons | ||||||
| import '../tinymce/icons/default'; | ||||||
| // Editor styles | ||||||
| import '../tinymce/skins/ui/oxide/skin.js'; | ||||||
| // Content styles, including inline UI like fake cursors | ||||||
| import '../tinymce/skins/content/default/content.js'; | ||||||
| import '../tinymce/skins/ui/oxide/content.js'; | ||||||
| // Import plugins | ||||||
| import '../tinymce/plugins/advlist'; | ||||||
| import '../tinymce/plugins/autolink'; | ||||||
| import '../tinymce/plugins/link'; | ||||||
| import '../tinymce/plugins/image'; | ||||||
| import '../tinymce/plugins/lists'; | ||||||
| import '../tinymce/plugins/table'; | ||||||
| import '../tinymce/plugins/code'; | ||||||
| import '../tinymce/plugins/help'; | ||||||
| // Include resources that a plugin lazy-loads at the run-time | ||||||
| import '../tinymce/plugins/help/js/i18n/keynav/en.js'; | ||||||
| import '../tinymce/plugins/wordcount'; | ||||||
| @Component({ | ||||||
| selector: 'app-editor', | ||||||
| standalone: true, | ||||||
| imports: [EditorComponent], | ||||||
| template: ` | ||||||
| <editor | ||||||
| [init]="init" | ||||||
| licenseKey="gpl" | ||||||
| /> | ||||||
| ` | ||||||
| }) | ||||||
| export class MyEditorComponent { | ||||||
| init: EditorComponent['init'] = { | ||||||
| height: 500, | ||||||
| plugins: 'advlist autolink lists link image table code help wordcount', | ||||||
| toolbar: 'undo redo | blocks | bold italic | alignleft aligncenter alignright | bullist numlist | help' | ||||||
| }; | ||||||
| } | ||||||
| ---- | ||||||
|
|
||||||
| . Update `+src/app/app.component.ts+` to use `MyEditorComponent`. | ||||||
| + | ||||||
| [source,ts] | ||||||
| ---- | ||||||
| import { Component } from '@angular/core'; | ||||||
| import { MyEditorComponent } from './editor.component'; | ||||||
| @Component({ | ||||||
| selector: 'app-root', | ||||||
| standalone: true, | ||||||
| imports: [MyEditorComponent], | ||||||
| template: ` | ||||||
| <h1>TinyMCE Angular Demo</h1> | ||||||
| <app-editor /> | ||||||
| ` | ||||||
| }) | ||||||
| export class AppComponent {} | ||||||
| ---- | ||||||
|
|
||||||
| . Run the Angular development server | ||||||
| + | ||||||
| [source,sh] | ||||||
| ---- | ||||||
| ng serve | ||||||
| ---- | ||||||
|
|
||||||
| include::partial$integrations/angular-other-resources.adoc[] | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,9 @@ | ||||||
| = Using the {productname} .zip package with the Angular framework | ||||||
| = Lazy-load {productname} from .zip package in Angular | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| :navtitle: Using a .zip package | ||||||
| :description: A guide on integrating a .zip version of TinyMCE into the Angular framework. | ||||||
| :description: A guide on integrating a .zip version of TinyMCE into an Angular application. | ||||||
| :keywords: integration, integrate, angular | ||||||
| :productSource: zip | ||||||
|
|
||||||
| This guide shows how to self-host and lazy-load {productname} from a `.zip` package into an Angular application. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
? |
||||||
|
|
||||||
| include::partial$integrations/angular-quick-start.adoc[] | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |||||
| :description: Introduction to bundling TinyMCE with Webpack, Rollup.js, or Browserify. | ||||||
| :keywords: webpack, browserify, es6, rollup, commonjs, modules, tinymce, es2015 | ||||||
|
|
||||||
| 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. | ||||||
| The following guides and reference pages assists you bundle {productname} into your project using a module bundler, such as Webpack, Rollup.js, and Browserify. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
tripped over "assists your bundle" when reading, so. |
||||||
|
|
||||||
| == Webpack | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,10 @@ | ||||||
| = Using TinyMCE from the Tiny Cloud CDN with the React framework | ||||||
| = Using TinyMCE from Tiny Cloud in React | ||||||
| :navtitle: React | ||||||
| :description: A guide on integrating TinyMCE from the Tiny Cloud into the React framework. | ||||||
| :keywords: integration, integrate, react, reactjs, vite, tinymce-react | ||||||
| :description: A guide on integrating TinyMCE from the Tiny Cloud into React. | ||||||
| :keywords: integration, integrate, react, reactjs, vite, tinymce-react, tinymce | ||||||
| :productSource: cloud | ||||||
|
|
||||||
|
|
||||||
| This guide shows how to integrate TinyMCE from Tiny Cloud into a React application using link:https://github.com/tinymce/tinymce-react[{productname} React component]. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
? |
||||||
|
|
||||||
| include::partial$integrations/react-quick-start.adoc[] | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,8 +1,10 @@ | ||||||
| = Bundle with TinyMCE and the React framework | ||||||
| :navtitle: Using a package manager with bundling | ||||||
| :description: A guide on integrating the TinyMCE package into the React framework by bundling it. | ||||||
| = Bundle TinyMCE in React | ||||||
| :navtitle: Bundle TinyMCE in a React project using a module bundler | ||||||
| :description: A guide on integrating the TinyMCE package into React by bundling it. | ||||||
| :keywords: integration, integrate, react, reactjs, vite, tinymce-react, bundle | ||||||
| :productSource: package-manager | ||||||
| :productUse: bundle | ||||||
|
|
||||||
| This guide shows how to integrate TinyMCE in a React application with link:https://github.com/tinymce/tinymce-react[{productname} React component]. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
? |
||||||
|
|
||||||
| include::partial$integrations/react-quick-start.adoc[] | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,9 +1,11 @@ | ||||||
| = Lazy load TinyMCE with the React framework | ||||||
| = Self-host TinyMCE in React | ||||||
| :page-aliases: react-pm.adoc | ||||||
| :navtitle: Using a package manager with hosting | ||||||
| :description: A guide on integrating the TinyMCE package into the React framework by self-hosting it. | ||||||
| :navtitle: Self-host TinyMCE in React | ||||||
| :description: A guide on integrating TinyMCE into React by self-hosting it. | ||||||
| :keywords: integration, integrate, react, reactjs, vite, tinymce-react, host | ||||||
| :productSource: package-manager | ||||||
| :productUse: host | ||||||
|
|
||||||
| This guide shows how to self-host TinyMCE in a React application using link:https://github.com/tinymce/tinymce-react[{productname} React component]. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
? |
||||||
|
|
||||||
| include::partial$integrations/react-quick-start.adoc[] | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.