Skip to content

Commit cc12cff

Browse files
DOC-2228: Updates new bundling with js feature, additional copy edits to bundling with es6 vite documentation. (#3020)
* DOC-2228: Updates to bundling with js, to bundling with es6+vite. * DOC-2228: add changelog entry. * DOC-2228: update js code blocks for various files. * DOC-2228: add example 2 to bundling-plugins.adoc update bundling-plugins-that-cant-bundle.adoc message. * DOC-2228: Various updates including.. removal of example 1 from bundling-plugins.adoc condensing of css and js to css or bundled css * Update bundling-plugins.adoc Co-authored-by: Hamza Benkhaldoun <[email protected]> * DOC-2228: update admon-building-plugin-langs.adoc to include links. --------- Co-authored-by: Hamza Benkhaldoun <[email protected]>
1 parent 94248c9 commit cc12cff

File tree

57 files changed

+342
-552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+342
-552
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/
66

77
### Unreleased
88

9+
- DOC-2228: Updates new bundling with `js` feature, `additional` copy edits to bundling with es6 vite documentation.
910
- DOC-2215: add new feature `mce-clipboard` to 6.8.1 release project for AdvTemplate.
1011
- DOC-2216: add new single `js` bundling feature example for `Bundling an npm version of TinyMCE with ES6 and Vite`.
1112
- DOC-2202: add new `bespoke` button text updates to `events.adoc` file.

modules/ROOT/pages/bundling-plugins.adoc

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ The following table shows examples of the syntax used to bundle the following pl
1111

1212
Required files for an example plugin:
1313

14-
....
15-
./plugins/example/content.css
14+
[source, js]
15+
----
16+
./plugins/example/content.js // or './plugins/example/content_css.js'
1617
./plugins/example/plugin.js
17-
....
18+
----
1819

19-
Example syntax for including the example "plugin" in a bundle:
20+
Example syntax for including the example "plugin" in a bundle using `content.js` or `content_css.js` files for bundling:
2021

2122
[cols='1,1,4']
2223
|===
@@ -27,15 +28,17 @@ Example syntax for including the example "plugin" in a bundle:
2728
a|
2829
[source, js]
2930
----
30-
import pluginCss from 'tinymce/plugins/example/content.css';
31+
import pluginCss from 'tinymce/plugins/example/content.js';
32+
//import pluginCss from 'tinymce/plugins/example/content_css.js';
3133
import 'tinymce/plugins/example';
3234
----
3335

3436
|`.zip`
3537
a|
3638
[source, js]
3739
----
38-
import pluginCss from '../tinymce/plugins/example/content.css';
40+
import '../tinymce/plugins/example/content.js';
41+
//import '../tinymce/plugins/example/content_css.js';
3942
import '../tinymce/plugins/example/plugin';
4043
----
4144

@@ -44,19 +47,19 @@ import '../tinymce/plugins/example/plugin';
4447
a|
4548
[source, js]
4649
----
47-
const pluginCss = require('tinymce/plugins/example/content.css');
50+
const pluginCss = require('tinymce/plugins/example/content.js');
51+
//require('tinymce/plugins/example/content_css.js');
4852
require('tinymce/plugins/example');
4953
----
5054

5155
|`.zip`
5256
a|
5357
[source, js]
5458
----
55-
const pluginCss = require('../tinymce/plugins/example/content.css');
59+
const pluginCss = require('../tinymce/plugins/example/content.js');
60+
//require('../tinymce/plugins/example/content_css.js');
5661
require('../tinymce/plugins/example/plugin.js');
5762
----
5863
|===
5964

60-
IMPORTANT: The handling of content CSS files (such as `+content.css+` or `+content.min.css+`) varies between bundling tools. View the relevant guide for the required syntax at xref:introduction-to-bundling-tinymce.adoc[Bundling {productname} with a module loader].
61-
62-
include::partial$module-loading/bundling-plugin-files.adoc[]
65+
include::partial$module-loading/bundling-plugin-files.adoc[]

modules/ROOT/pages/vite-es6-npm.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ include::partial$module-loading/webpack-dev-dependencies.adoc[]
2525

2626
include::partial$module-loading/bundling-vite-es6-npm_editor.adoc[]
2727

28-
NOTE: If using {productname} premium skins, run **`@tiny-premium/oxide-premium-skins`** to install the dependency's.
29-
3028
include::partial$module-loading/bundling-vite-es6-npm_config.adoc[]
3129

3230
. Import the index.js file in the index.html page, such as:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
NOTE: The plugin language files (such as `+./plugins/plugin/langs/sv_SE.js+`) are required where the editor user interface is localized using the xref:ui-localization.adoc#language[`+language+` option].
1+
NOTE: The plugin language files (such as `+./plugins/plugin/langs/sv_SE.js+`) are required where the editor user interface is localized using the xref:ui-localization.adoc#language[language option]. Please prefer to xref:bundling-plugins.adoc#plugin-language-files[plugin-language-files]

modules/ROOT/partials/module-loading/bundling-plugin-files.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,9 @@ include::partial$plugin-files/plugin-file-list-visualchars.adoc[]
326326
=== Word Count (`+wordcount+`)
327327

328328
include::partial$plugin-files/plugin-file-list-wordcount.adoc[]
329+
330+
331+
[[plugin-language-files]]
332+
== Plugin language files
333+
334+
include::partial$module-loading/bundling-plugin-language-files.adoc[]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
IMPORTANT: Replace `<plugin-name>` with the specific plugin name when adding the plugin language files to your config.
2+
3+
[source, js]
4+
----
5+
./plugins/<plugin-name>/langs/ar.js
6+
./plugins/<plugin-name>/langs/bg_BG.js
7+
./plugins/<plugin-name>/langs/ca.js
8+
./plugins/<plugin-name>/langs/cs.js
9+
./plugins/<plugin-name>/langs/da.js
10+
./plugins/<plugin-name>/langs/de.js
11+
./plugins/<plugin-name>/langs/el.js
12+
./plugins/<plugin-name>/langs/es.js
13+
./plugins/<plugin-name>/langs/eu.js
14+
./plugins/<plugin-name>/langs/fa.js
15+
./plugins/<plugin-name>/langs/fi.js
16+
./plugins/<plugin-name>/langs/fr_FR.js
17+
./plugins/<plugin-name>/langs/he_IL.js
18+
./plugins/<plugin-name>/langs/hi.js
19+
./plugins/<plugin-name>/langs/hr.js
20+
./plugins/<plugin-name>/langs/hu_HU.js
21+
./plugins/<plugin-name>/langs/id.js
22+
./plugins/<plugin-name>/langs/it.js
23+
./plugins/<plugin-name>/langs/ja.js
24+
./plugins/<plugin-name>/langs/kk.js
25+
./plugins/<plugin-name>/langs/ko_KR.js
26+
./plugins/<plugin-name>/langs/ms.js
27+
./plugins/<plugin-name>/langs/nb_NO.js
28+
./plugins/<plugin-name>/langs/nl.js
29+
./plugins/<plugin-name>/langs/pl.js
30+
./plugins/<plugin-name>/langs/pt_BR.js
31+
./plugins/<plugin-name>/langs/pt_PT.js
32+
./plugins/<plugin-name>/langs/ro.js
33+
./plugins/<plugin-name>/langs/ru.js
34+
./plugins/<plugin-name>/langs/sk.js
35+
./plugins/<plugin-name>/langs/sl_SI.js
36+
./plugins/<plugin-name>/langs/sv_SE.js
37+
./plugins/<plugin-name>/langs/th_TH.js
38+
./plugins/<plugin-name>/langs/tr.js
39+
./plugins/<plugin-name>/langs/uk.js
40+
./plugins/<plugin-name>/langs/vi.js
41+
./plugins/<plugin-name>/langs/zh_CN.js
42+
./plugins/<plugin-name>/langs/zh_TW.js
43+
----

modules/ROOT/partials/module-loading/bundling-plugins-that-cant-bundle.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[IMPORTANT]
22
====
3-
The following premium plugins *can not* be bundled at this time:
3+
The following premium plugins *can not* be bundled if the {productname} version is earlier than **6.8.0**. However, if the {productname} version is equivalent to **v6.8.0** or **later**, the following premium plugins can be bundled:
44
55
* Accessibility Checker (`+a11ychecker+`)
66
* Advanced Code (`+advcode+`)

modules/ROOT/partials/module-loading/bundling-vite-es6-npm_editor.adoc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
. Create a new source file for importing the required components from {productname} and configuring the editor.
22
+
33
include::partial$module-loading/bundling-required-components.adoc[]
4-
+
4+
5+
NOTE: This example will only work for {productname} 6.8.0 and later.
6+
57
Example `+src/editor.js+`
68
+
79
[source,js]
@@ -40,19 +42,14 @@ import contentUiSkinCss from 'tinymce/skins/ui/oxide/content.js';
4042
/* The default content CSS can be changed or replaced with appropriate CSS for the editor content. */
4143
import contentCss from 'tinymce/skins/content/default/content.js';
4244
43-
/* Import Premium Skins can be changes by uncommenting the below example and updating the skin_url and content_css values */
44-
/* import '@tiny-premium/oxide-premium-skins/build/skins/ui/material-outline/skin.js' */
45-
/* import '@tiny-premium/oxide-premium-skins/build/skins/ui/material-outline/content.js' */
46-
/* import '@tiny-premium/oxide-premium-skins/build/skins/content/material-outline/content.js' */
47-
4845
/* Initialize TinyMCE */
4946
export function render () {
5047
tinymce.init({
5148
selector: 'textarea#editor',
5249
plugins: 'advlist code emoticons link lists table',
5350
toolbar: 'bold italic | bullist numlist | link emoticons',
54-
skin_url: 'default', /* material-outline */
55-
content_css: 'default', /* material-outline */
51+
skin_url: 'default',
52+
content_css: 'default',
5653
});
5754
};
58-
----
55+
----
Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,12 @@
1-
....
2-
./plugins/a11ychecker/css/annotations.css
3-
./plugins/a11ychecker/langs/ar.js
4-
./plugins/a11ychecker/langs/bg_BG.js
5-
./plugins/a11ychecker/langs/ca.js
6-
./plugins/a11ychecker/langs/cs.js
7-
./plugins/a11ychecker/langs/da.js
8-
./plugins/a11ychecker/langs/de.js
9-
./plugins/a11ychecker/langs/el.js
10-
./plugins/a11ychecker/langs/es.js
11-
./plugins/a11ychecker/langs/eu.js
12-
./plugins/a11ychecker/langs/fa.js
13-
./plugins/a11ychecker/langs/fi.js
14-
./plugins/a11ychecker/langs/fr_FR.js
15-
./plugins/a11ychecker/langs/he_IL.js
16-
./plugins/a11ychecker/langs/hi.js
17-
./plugins/a11ychecker/langs/hr.js
18-
./plugins/a11ychecker/langs/hu_HU.js
19-
./plugins/a11ychecker/langs/id.js
20-
./plugins/a11ychecker/langs/it.js
21-
./plugins/a11ychecker/langs/ja.js
22-
./plugins/a11ychecker/langs/kk.js
23-
./plugins/a11ychecker/langs/ko_KR.js
24-
./plugins/a11ychecker/langs/ms.js
25-
./plugins/a11ychecker/langs/nb_NO.js
26-
./plugins/a11ychecker/langs/nl.js
27-
./plugins/a11ychecker/langs/pl.js
28-
./plugins/a11ychecker/langs/pt_BR.js
29-
./plugins/a11ychecker/langs/pt_PT.js
30-
./plugins/a11ychecker/langs/ro.js
31-
./plugins/a11ychecker/langs/ru.js
32-
./plugins/a11ychecker/langs/sk.js
33-
./plugins/a11ychecker/langs/sl_SI.js
34-
./plugins/a11ychecker/langs/sv_SE.js
35-
./plugins/a11ychecker/langs/th_TH.js
36-
./plugins/a11ychecker/langs/tr.js
37-
./plugins/a11ychecker/langs/uk.js
38-
./plugins/a11ychecker/langs/vi.js
39-
./plugins/a11ychecker/langs/zh_CN.js
40-
./plugins/a11ychecker/langs/zh_TW.js
1+
.Base js file.
2+
[source, js]
3+
----
414
./plugins/a11ychecker/plugin.js
42-
....
5+
----
6+
7+
.css or bundled css
8+
[source, js]
9+
----
10+
./plugins/a11ychecker/css/annotations.css // or
11+
./plugins/a11ychecker/css/annotations.js // bundling requires v6.8.0 or later.
12+
----
Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
....
2-
./plugins/advcode/codemirror.min.css
1+
.Base js file
2+
[source, js]
3+
----
4+
./plugins/advcode/plugin.js
5+
----
6+
7+
.css or bundled css
8+
[source, js]
9+
----
10+
./plugins/advcode/codemirror.min.css //or
11+
./plugins/advcode/codemirror_css.js // bundling requires v6.8.0 or later.
12+
----
13+
14+
.other js files
15+
[source, js]
16+
----
317
./plugins/advcode/codemirror.min.js
418
./plugins/advcode/customeditor.js
5-
./plugins/advcode/plugin.js
6-
....
19+
----

0 commit comments

Comments
 (0)