Skip to content

Commit 24f2750

Browse files
committed
DOC-3329: Add key details to icons, skins, lang files for how to use tinymce-premium/file with examples ect.
1 parent 62b078c commit 24f2750

21 files changed

+228
-122
lines changed

modules/ROOT/pages/bundling-icons.adoc

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,20 @@ The following examples show how to bundle icon packs using different module synt
2727
|Module Syntax |Source |Example
2828

2929
.2+|ES6+
30-
|npm
30+
|npm (community)
3131
a|
3232
[source, js]
3333
----
3434
import 'tinymce/icons/material';
3535
----
3636

37+
|npm (premium)
38+
a|
39+
[source, js]
40+
----
41+
import 'tinymce-premium/icons/material';
42+
----
43+
3744
|`.zip`
3845
a|
3946
[source, js]
@@ -42,13 +49,20 @@ import '../tinymce/icons/material/icons';
4249
----
4350

4451
.2+|Common JS
45-
|npm
52+
|npm (community)
4653
a|
4754
[source, js]
4855
----
4956
require('tinymce/icons/material');
5057
----
5158

59+
|npm (premium)
60+
a|
61+
[source, js]
62+
----
63+
require('tinymce-premium/icons/material');
64+
----
65+
5266
|`.zip`
5367
a|
5468
[source, js]
@@ -57,6 +71,33 @@ require('../tinymce/icons/material/icons.js');
5771
----
5872
|====
5973

74+
[[premium-icon-packs-npm]]
75+
== Premium icon packs from `+tinymce-premium+` (NPM)
76+
77+
The `+tinymce-premium+` NPM package ships all premium icon packs in `+tinymce-premium/icons/+`. Choose one of the following patterns depending on how {productname} is deployed:
78+
79+
*Bundling (recommended for modern build tools)*
80+
81+
* Import the required icon pack so the module bundler adds it to the application bundle. For example:
82+
+
83+
[source,js]
84+
----
85+
import 'tinymce/icons/default'; // Always required
86+
import 'tinymce-premium/icons/material';
87+
// ... other TinyMCE imports
88+
----
89+
* After bundling, set `+icons: 'material'+` (or any imported icon pack) in the editor configuration.
90+
91+
*Non-bundling with file layering*
92+
93+
* When hosting directly from `+node_modules+`, copy `+node_modules/tinymce-premium/icons/+` into `+node_modules/tinymce/icons/+` as part of the build or deployment step (for example, in a `+postinstall+` script).
94+
* Once copied, premium icon packs live beside the core files, so setting `+icons+` works without extra configuration.
95+
96+
*Non-bundling with `+icons_url+`*
97+
98+
* Leave the premium icon packs in `+node_modules/tinymce-premium/icons/+` and configure xref:editor-icons.adoc#icons_url[`+icons_url+`] to point at the required icon pack file.
99+
* This approach avoids moving files and is useful when the `+node_modules+` directory is web-accessible (or when copying only the specific icon pack to a public folder).
100+
60101
== Available icon packs
61102

62103
include::partial$module-loading/bundling-icon-files.adoc[]

modules/ROOT/pages/bundling-localization.adoc

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ include::partial$misc/using-community-lang-packs.adoc[leveloffset=+1]
2222
include::partial$module-loading/bundling-ref-example.adoc[leveloffset=+1]
2323
:!editorcomponent:
2424

25+
Premium language packs are available from ZIP downloads or the `+tinymce-premium+` NPM package. When using the NPM package, import language packs from `+tinymce-premium/langs/+` instead of `+tinymce/langs/+`.
26+
2527
The following table shows examples of the syntax used to bundle the following example localization file:
2628

2729
....
@@ -33,13 +35,20 @@ The following table shows examples of the syntax used to bundle the following ex
3335
|Module Syntax |Source |Example
3436

3537
.2+|ES6+
36-
|npm
38+
|npm (community)
3739
a|
3840
[source, js]
3941
----
4042
import 'tinymce/langs/sv_SE';
4143
----
4244

45+
|npm (premium)
46+
a|
47+
[source, js]
48+
----
49+
import 'tinymce-premium/langs/sv_SE';
50+
----
51+
4352
|`.zip`
4453
a|
4554
[source, js]
@@ -48,13 +57,20 @@ import '../tinymce/langs/sv_SE';
4857
----
4958

5059
.2+|Common JS
51-
|npm
60+
|npm (community)
5261
a|
5362
[source, js]
5463
----
5564
require('tinymce/langs/sv_SE');
5665
----
5766

67+
|npm (premium)
68+
a|
69+
[source, js]
70+
----
71+
require('tinymce-premium/langs/sv_SE');
72+
----
73+
5874
|`.zip`
5975
a|
6076
[source, js]
@@ -63,6 +79,11 @@ require('../tinymce/langs/sv_SE.js');
6379
----
6480
|===
6581

82+
[NOTE]
83+
====
84+
For complete information on using premium language packs from the NPM package, including non-bundling approaches, see: xref:ui-localization.adoc#premium-language-packs-npm[Providing premium language packs from `+tinymce-premium+`].
85+
====
86+
6687
:forModuleLoaders: true
6788
include::partial$misc/ui-languages.adoc[leveloffset=+1]
6889
:forModuleLoaders: false

modules/ROOT/pages/bundling-skins.adoc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,32 @@ const contentUiSkinInlineCss = require('../tinymce/skins/ui/example/content.inli
6666
////
6767

6868
include::partial$module-loading/bundling-skin-files.adoc[]
69+
70+
[[premium-skins-npm]]
71+
== Premium skins from `+tinymce-premium+` (NPM)
72+
73+
The `+tinymce-premium+` NPM package ships all premium skins in `+tinymce-premium/skins/+`. Choose one of the following patterns depending on how {productname} is deployed:
74+
75+
*Bundling (recommended for modern build tools)*
76+
77+
* Import the required skin files so the module bundler adds them to the application bundle. For example:
78+
+
79+
[source,js]
80+
----
81+
import 'tinymce-premium/skins/ui/oxide/skin.css';
82+
import contentUiSkinCss from 'tinymce-premium/skins/ui/oxide/content.css';
83+
// ... other TinyMCE imports
84+
----
85+
* After bundling, set `+skin: false+` and `+content_css: false+` in the editor configuration, then use `+content_style+` to inject the bundled CSS.
86+
87+
*Non-bundling with file layering*
88+
89+
* When hosting directly from `+node_modules+`, copy `+node_modules/tinymce-premium/skins/+` into `+node_modules/tinymce/skins/+` as part of the build or deployment step (for example, in a `+postinstall+` script).
90+
* Once copied, premium skins live beside the core files, so setting `+skin+` works without extra configuration.
91+
92+
*Non-bundling with `+skin_url+`*
93+
94+
* Leave the premium skins in `+node_modules/tinymce-premium/skins/+` and configure xref:editor-skin.adoc#skin_url[`+skin_url+`] to point at the required skin directory.
95+
* This approach avoids moving files and is useful when the `+node_modules+` directory is web-accessible (or when copying only the specific skin to a public folder).
96+
97+
Document the chosen approach in deployment scripts to keep upgrades predictable.

modules/ROOT/pages/npm-projects.adoc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,9 @@ Install the `+tinymce-premium+` package using npm:
6060
npm install tinymce-premium@^8.3
6161
----
6262

63-
include::partial$install/npm-premium-version-note.adoc[]
64-
6563
[NOTE]
6664
====
67-
* For {productname} 8.3, the `+tinymce-premium+` package is only published to the NPM registry. Other package manager registries (Packagist/Composer, NuGet etc.) may be considered for future releases.
68-
* Yarn can also install packages from the NPM registry, so `+yarn add tinymce-premium@^8.3+` will work.
69-
* The `+tinymce-premium+` package version aligns with the `+tinymce+` package version. **Always** use compatible versions of both packages (e.g., both at 8.3.0 or later).
65+
The `+tinymce-premium+` package is available for {productname} 8.3 onwards and is currently only published to the NPM registry (Yarn can also install from NPM). The package version must align with the `+tinymce+` package version—always use compatible versions of both packages (e.g., both at 8.3.0 or later).
7066
====
7167

7268
=== Package contents

modules/ROOT/partials/configuration/icons_url.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,23 @@ tinymce.init({
111111
});
112112
----
113113

114+
=== Example: loading premium icons from `+tinymce-premium+` (NPM)
115+
116+
When installing the `+tinymce-premium+` NPM package, premium icon packs are stored in `+node_modules/tinymce-premium/icons/+`. Configure `+icons_url+` to point at the desired icon pack file. For example:
117+
118+
[source,js]
119+
----
120+
tinymce.init({
121+
selector: 'textarea',
122+
icons_url: '/node_modules/tinymce-premium/icons/material/icons.js',
123+
icons: 'material'
124+
});
125+
----
126+
127+
[NOTE]
128+
====
129+
* Ensure the `+node_modules+` directory (or a copy of the icon pack file) is accessible to the browser. Many projects copy the required icon pack into a public folder (such as `+/public/icons/material/icons.js+`) during their build step and update `+icons_url+` accordingly.
130+
* Combine this with the approaches listed in xref:bundling-icons.adoc#premium-icon-packs-npm[Premium icon packs from `+tinymce-premium+`] to match the deployment strategy.
131+
====
132+
114133
endif::[]

modules/ROOT/partials/configuration/language.adoc

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,40 @@ tinymce.init({
3232
[[using-the-premium-language-packs]]
3333
=== Using the premium language packs
3434

35-
The following professionally localized language packs are provided to paid {cloudname} and premium self-hosted deployments. To use these language packs, set the `+language+` option to the corresponding language code in RFC5646 format. No additional configuration is required.
35+
The following professionally localized language packs are provided to paid {cloudname} and premium self-hosted deployments. To use these language packs, set the `+language+` option to the corresponding language code in RFC5646 format.
36+
37+
For {cloudname} and ZIP-based deployments, no additional configuration is required. When using the `+tinymce-premium+` NPM package, see xref:ui-localization.adoc#premium-language-packs-npm[Providing premium language packs from `+tinymce-premium+`] for configuration options.
38+
39+
The following table lists the available premium language packs:
3640

3741
include::partial$misc/ui-languages.adoc[leveloffset=+2]
3842

43+
[[premium-language-packs-npm]]
44+
==== Providing premium language packs from `+tinymce-premium+` (NPM)
45+
46+
The `+tinymce-premium+` NPM package ships all paid translations in `+tinymce-premium/langs/+`. Choose one of the following patterns depending on how {productname} is deployed:
47+
48+
*Bundling (recommended for modern build tools)*
49+
50+
* Import the required language files so the module bundler adds them to the application bundle. For example:
51+
+
52+
[source,js]
53+
----
54+
import 'tinymce/langs/en_GB';
55+
import 'tinymce-premium/langs/fi';
56+
// ... other TinyMCE imports
57+
----
58+
* After bundling, set `+language: 'fi'+` (or any imported locale) and no extra HTTP requests are required.
59+
60+
*Non-bundling with file layering*
61+
62+
* When hosting directly from `+node_modules+`, copy `+node_modules/tinymce-premium/langs/+` into `+node_modules/tinymce/langs/+` as part of the build or deployment step (for example, in a `+postinstall+` script).
63+
* Once copied, premium language packs live beside the core files, so setting `+language+` works without extra configuration.
64+
65+
*Non-bundling with `+language_url+`*
66+
67+
* Leave the premium packs in `+node_modules/tinymce-premium/langs/+` and configure xref:ui-localization.adoc#language_url[`+language_url+`] to point at the required file.
68+
* This approach avoids moving files and is useful when the `+node_modules+` directory is web-accessible (or when copying only the specific file to a public folder).
69+
70+
3971
include::partial$misc/using-community-lang-packs.adoc[leveloffset=+1]

modules/ROOT/partials/configuration/language_url.adoc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,29 @@ Also, the `+language+` option must also be set and must be set to the name of th
1616
----
1717
tinymce.init({
1818
selector: 'textarea', // change this value according to your HTML
19-
language_url: '/path/to/language/pack/fi.js', // path from the root of your web application — / — to the language pack(s)
19+
language_url: '/<path_to_language_pack>/fi.js', // path from the root of your web application — / — to the language pack(s)
2020
language: 'fi' // the name of the language pack file
2121
});
2222
----
2323

2424
You can find and download languages link:{gettiny}/language-packages/[here].
25+
26+
=== Example: loading premium languages from `+tinymce-premium+` (NPM)
27+
28+
When installing the `+tinymce-premium+` NPM package, each paid translation is stored in `+node_modules/tinymce-premium/langs/+`. Configure `+language_url+` to point at the desired file.
29+
30+
.Example
31+
[source,js]
32+
----
33+
tinymce.init({
34+
selector: 'textarea',
35+
language_url: '/<path_to_tinymce-premium>/langs/pt_BR.js',
36+
language: 'pt-BR'
37+
});
38+
----
39+
40+
[NOTE]
41+
====
42+
* Ensure the `+node_modules+` directory (or a copy of the language file) is accessible to the browser. Many projects copy the required file into a public folder (such as `+/public/langs/pt_BR.js+`) during their build step and update `+language_url+` accordingly.
43+
* Combine this with the approaches listed in xref:ui-localization.adoc#premium-language-packs-npm[Providing premium language packs from `+tinymce-premium+`] to match the deployment strategy.
44+
====

modules/ROOT/partials/configuration/skin_url.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,22 @@ tinymce.init({
1414
skin_url: '/css/my{prodnamecode}skin'
1515
});
1616
----
17+
18+
=== Example: loading premium skins from `+tinymce-premium+` (NPM)
19+
20+
When installing the `+tinymce-premium+` NPM package, premium skins are stored in `+node_modules/tinymce-premium/skins/+`. Configure `+skin_url+` to point at the desired skin directory. For example:
21+
22+
[source,js]
23+
----
24+
tinymce.init({
25+
selector: 'textarea',
26+
skin_url: '/node_modules/tinymce-premium/skins/ui/oxide',
27+
skin: 'oxide'
28+
});
29+
----
30+
31+
[NOTE]
32+
====
33+
* Ensure the `+node_modules+` directory (or a copy of the skin directory) is accessible to the browser. Many projects copy the required skin into a public folder (such as `+/public/skins/ui/oxide+`) during their build step and update `+skin_url+` accordingly.
34+
* Combine this with the approaches listed in xref:bundling-skins.adoc#premium-skins-npm[Premium skins from `+tinymce-premium+`] to match the deployment strategy.
35+
====

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ ifeval::["{productSource}" == "package-manager"]
3838
npm install tinymce @tinymce/tinymce-angular
3939
----
4040
+
41-
include::partial$integrations/premium-plugins-install-step.adoc[]
42-
41+
include::partial$integrations/premium-plugins-install-step-link.adoc[]
4342
endif::[]
4443
ifeval::["{productSource}" != "package-manager"]
4544
. Install the `+tinymce-angular+` package.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ifeval::["{productSource}" == "package-manager"]
2929

3030
. To use the self-hosted version of `{productname}`, install the `{productname}` package from the Command Palette.
3131
+
32-
include::partial$integrations/premium-plugins-install-step-blazor.adoc[]
32+
include::partial$integrations/premium-plugins-install-step-link.adoc[]
3333
endif::[]
3434

3535
[[using-visual-studio]]
@@ -105,8 +105,7 @@ ifeval::["{productSource}" == "package-manager"]
105105
dotnet add package TinyMCE
106106
----
107107

108-
include::partial$integrations/premium-plugins-install-step-blazor.adoc[]
109-
108+
include::partial$integrations/premium-plugins-install-step-link.adoc[]
110109
endif::[]
111110

112111
. Test the application using the .NET development server.

0 commit comments

Comments
 (0)