-
Notifications
You must be signed in to change notification settings - Fork 220
DOC-3329: Premium Plugins Installation and Bundling Documentation for NPM #3928
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
Changes from 20 commits
a47e2f4
a2885b8
eaaa7df
ba1ed37
62b078c
24f2750
fcbd052
7b36fac
4935be6
18b4deb
118db3e
ba98d11
85a88c5
edbb1cc
c8e6540
4b64a8d
bde8c19
42ce924
a101b9e
dd8a4e7
80b8b69
2b3ae1e
3fe2719
9020ea8
130fcf5
5d9cb21
d9a88a1
37ad7e9
66b672b
f11e533
43b3903
d16fa32
b845996
a45442b
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 |
|---|---|---|
|
|
@@ -3,51 +3,174 @@ | |
| :description_short: Information on bundling plugins | ||
| :description: Information on bundling TinyMCE plugins using module loading | ||
|
|
||
| == Overview | ||
|
|
||
| {productname} plugins can be bundled using module loaders such as Webpack, Rollup, or Vite. This guide covers how to include both community and premium plugins in your application bundle. | ||
|
kemister85 marked this conversation as resolved.
Outdated
|
||
|
|
||
| {productname} includes both community and premium plugins: | ||
|
|
||
| * **Community plugins**: Available with all {productname} installations | ||
| * **Premium plugins**: Available with paid {productname} subscriptions via the `+tinymce-premium+` package | ||
|
|
||
| :editorcomponent: plugin | ||
| include::partial$module-loading/bundling-ref-example.adoc[] | ||
|
kemister85 marked this conversation as resolved.
|
||
| :!editorcomponent: | ||
|
|
||
| [NOTE] | ||
| If using {productname} 7.0.1 or earlier, please refer to link:https://www.tiny.cloud/docs/tinymce/6/bundling-plugins/[Bundling {productname} plugins using module loading] from the {productname} v6 documentation guide. | ||
|
|
||
| include::partial$plugin-files/plugin-file-index.js.adoc[] | ||
|
|
||
| == Bundling syntax examples | ||
|
|
||
| Example syntax for including the example "<plugincode>" plugin in a bundle using `content.js`for bundling: | ||
| The following examples show the syntax for including plugins in a bundle. The examples use a placeholder `+<plugincode>+` to represent any plugin name: | ||
|
|
||
| [cols='1,1,4'] | ||
| [cols='1,2,3'] | ||
| |=== | ||
| |Module Syntax |Source |Example | ||
|
|
||
| .2+|ES6+ | ||
| |npm | ||
| .4+|ES6+ | ||
| |npm (community plugins) | ||
| a| | ||
| [source, js] | ||
| ---- | ||
| import 'tinymce/plugins/<plugincode>'; | ||
| ---- | ||
|
|
||
| |`.zip` | ||
| |npm (premium plugins) | ||
| a| | ||
| [source, js] | ||
| ---- | ||
| import 'tinymce-premium/plugins/<plugincode>'; | ||
| ---- | ||
|
|
||
| |`.zip` (community plugins) | ||
| a| | ||
| [source, js] | ||
| ---- | ||
| import '<path_to_tinymce_zip>/plugins/<plugincode>'; | ||
| ---- | ||
|
|
||
| |`.zip` (premium plugins) | ||
| a| | ||
| [source, js] | ||
| ---- | ||
| import '../tinymce/plugins/<plugincode>'; | ||
| import '<path_to_tinymce_premium_zip>/plugins/<plugincode>'; | ||
| ---- | ||
|
|
||
| .2+|Common JS | ||
| |npm | ||
| .4+|Common JS | ||
| |npm (community plugins) | ||
| a| | ||
| [source, js] | ||
| ---- | ||
| require('tinymce/plugins/<plugincode>'); | ||
| ---- | ||
|
|
||
| |`.zip` | ||
| |npm (premium plugins) | ||
| a| | ||
| [source, js] | ||
| ---- | ||
| require('tinymce-premium/plugins/<plugincode>'); | ||
| ---- | ||
|
|
||
| |`.zip` (community plugins) | ||
| a| | ||
| [source, js] | ||
| ---- | ||
| require('../tinymce/plugins/<plugincode>'); | ||
| require('<path_to_tinymce_zip>/plugins/<plugincode>'); | ||
| ---- | ||
|
|
||
| |`.zip` (premium plugins) | ||
| a| | ||
| [source, js] | ||
| ---- | ||
| require('<path_to_tinymce_premium_zip>/plugins/<plugincode>'); | ||
| ---- | ||
| |=== | ||
|
|
||
|
|
||
| [[using-premium-plugins]] | ||
| == Using premium plugins | ||
|
|
||
| After installing the `+tinymce-premium+` package, you need to configure the plugins in your editor. There are two main approaches: | ||
|
|
||
| [IMPORTANT] | ||
| ==== | ||
| *License Key Manager Requirement:* | ||
|
|
||
| When using premium plugins with a commercial license, you must include the `+licensekeymanager+` plugin. The editor will not function properly without it. For more information, see: xref:license-key.adoc[License Key]. | ||
|
Comment on lines
+93
to
+97
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. Could this be moved to the end of this section? It kinda breaks the flow
Contributor
Author
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. As much as this kinda breaks the flow, product requested this to be positioned here for clear visibility. |
||
|
|
||
| *xref:bundling-plugins.adoc#bundling-recommended[When bundling]:* | ||
| [source,js] | ||
| ---- | ||
| import 'tinymce-premium/plugins/licensekeymanager'; | ||
| ---- | ||
|
|
||
| *xref:bundling-plugins.adoc#using-external-plugins[When using `+external_plugins+`]:* | ||
| [source,js] | ||
| ---- | ||
| external_plugins: { | ||
| 'licensekeymanager': '<path_to_premium_plugins>/licensekeymanager/plugin.min.js' | ||
| } | ||
| ---- | ||
| ==== | ||
|
|
||
| [[bundling-recommended]] | ||
| === Bundling (Recommended) | ||
|
|
||
| For most modern applications, bundling premium plugins is recommended. This includes the plugin code directly in your application bundle. | ||
|
kemister85 marked this conversation as resolved.
|
||
|
|
||
| . Import the premium plugins you need: | ||
|
kemister85 marked this conversation as resolved.
|
||
| + | ||
| [source,js] | ||
| ---- | ||
| import 'tinymce-premium/plugins/advcode'; | ||
| import 'tinymce-premium/plugins/tinycomments'; | ||
| // Always include the licensekeymanager plugin when using premium plugins with a commercial license. | ||
| import 'tinymce-premium/plugins/licensekeymanager'; | ||
| ---- | ||
|
|
||
| . Add the plugins to your editor configuration: | ||
| + | ||
| [source,js] | ||
| ---- | ||
| tinymce.init({ | ||
| selector: 'textarea', | ||
| license_key: 'T8LK:...', // Your commercial license key | ||
| plugins: 'advcode tinycomments', | ||
| // ... other configuration | ||
| }); | ||
| ---- | ||
|
|
||
| For complete bundling examples, see the <<premium-plugins,Premium plugins>> and <<community-plugins,Community plugins>> sections below. | ||
|
|
||
| [[using-external-plugins]] | ||
| === Using external_plugins (Non-bundling) | ||
|
|
||
| When bundling is not available or you want to lazy-load plugins, use the `+external_plugins+` option: | ||
|
|
||
| [source,js] | ||
| ---- | ||
| tinymce.init({ | ||
| selector: 'textarea', | ||
| license_key: 'T8LK:...', // Your commercial license key | ||
| external_plugins: { | ||
| 'advcode': '<path_to_premium_plugins>/advcode/plugin.min.js', | ||
| 'tinycomments': '<path_to_premium_plugins>/tinycomments/plugin.min.js', | ||
| // Always include the licensekeymanager plugin when using premium plugins with a commercial license. | ||
| 'licensekeymanager': '<path_to_premium_plugins>/licensekeymanager/plugin.min.js' | ||
|
kemister85 marked this conversation as resolved.
Outdated
|
||
| }, | ||
| plugins: 'advcode tinycomments', | ||
| // ... other configuration | ||
| }); | ||
| ---- | ||
|
|
||
| [NOTE] | ||
| ==== | ||
| The `+external_plugins+` option supports three URL formats: | ||
|
|
||
| * Absolute URLs (e.g., `+https://cdn.example.com/...`) | ||
| * Relative to web-server root (e.g., `+/node_modules/...`) | ||
| * Relative to {productname} `+base_url+` (e.g., `+../../node_modules/...`) | ||
|
kemister85 marked this conversation as resolved.
Outdated
|
||
|
|
||
| For more information, see: xref:editor-important-options.adoc#external_plugins[`+external_plugins+` configuration option]. | ||
| ==== | ||
|
|
||
| include::partial$module-loading/bundling-plugin-files.adoc[] | ||
Uh oh!
There was an error while loading. Please reload this page.