Skip to content

Commit a27f091

Browse files
DOC-3180: Update the web component integration doc pages (#3703)
* DOC-3180: Update web component integration doc * DOC-3180: Group powerpaste applicable settings * Update modules/ROOT/partials/integrations/webcomponent-quick-start.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * DOC-3180: Replace your-tiny-cloud-api-key with no-api-key. --------- Co-authored-by: Karl Kemister-Sheppard <[email protected]>
1 parent 12f7d17 commit a27f091

File tree

4 files changed

+42
-63
lines changed

4 files changed

+42
-63
lines changed

antora.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ asciidoc:
1212
tdcdnurl: https://cdn.tiny.cloud/1/_your_api_key_/tinydrive/7/tinydrive.min.js
1313
tinymce_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/7/tinymce.min.js
1414
tinydrive_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinydrive/7/tinydrive.min.js
15-
webcomponent_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-webcomponent@2/dist/tinymce-webcomponent.min.js
16-
jquery_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-jquery/dist/tinymce-jquery.min.js
15+
webcomponent_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-webcomponent/dist/tinymce-webcomponent.min.js
16+
jquery_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-jquery@2/dist/tinymce-jquery.min.js
1717
openai_proxy_url: https://openai.ai-demo-proxy.tiny.cloud/v1/chat/completions
1818
openai_proxy_token: eyJhbGciOiJFUzM4NCJ9.eyJhdWQiOlsiaHR0cHM6Ly9vcGVuYWkuYWktZGVtby1wcm94eS50aW55LmNsb3VkLyJdLCJleHAiOjE3NTEzMjgwMDAsImh0dHBzOi8vb3BlbmFpLmFpLWRlbW8tcHJveHkudGlueS5jbG91ZC9yb2xlIjoicHVibGljLWRlbW8iLCJpc3MiOiJodHRwczovL2FpLWRlbW8tcHJveHkudGlueS5jbG91ZC8iLCJqdGkiOiJmOGFmY2EyNC1mN2FhLTQxMjktYTc2Yy02YThlZDU3YjAyZjYiLCJzdWIiOiJhaS1hc3Npc3RhbnQtZGVtbyJ9.Xu0apHCbxgmRQTeTqrTIDFFhh2CgKeARRXa3mCxSGoCwZqkoQaFRZBCzDo8Xz7DuUa5mW2XHl-HYcYiXJM9ly16d0oY7lJefHBeLlmJEBE1CSttHBkCRWZS8eFLCasL6
1919
default_meta_keywords: tinymce, documentation, docs, plugins, customizable skins, configuration, examples, html, php, java, javascript, image editor, inline editor, distraction-free editor, classic editor, wysiwyg

modules/ROOT/examples/live-demos/web-component/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

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

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,12 @@ The https://github.com/tinymce/tinymce-webcomponent[Official {productname} Web C
66

77
To add a {productname} editor to a web page using the {productname} Web Component:
88

9-
. Add the `+DOCTYPE+` element to the target page, such as:
9+
. Add the following meta tags to the head section of the page:
1010
+
1111
[source,html]
1212
----
13-
<!DOCTYPE html>
14-
----
15-
+
16-
The `+DOCTYPE+` declaration is required for the editor to function correctly.
17-
. Add the following `+meta+` elements to the head of page:
18-
+
19-
[source,html]
20-
----
21-
<head>
2213
<meta charset="UTF-8">
2314
<meta name="viewport" content="width=device-width, initial-scale=1">
24-
</head>
2515
----
2616
+
2717
The second `+meta+` element is required for the editor to function correctly on mobile devices. For information on the viewport `+meta+` element, see: https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag#viewport_basics[MDN Web Docs - Using the viewport meta tag to control layout on mobile browsers].
@@ -52,7 +42,7 @@ npm install tinymce @tinymce/tinymce-webcomponent
5242
include::partial$integrations/bundling-integration.adoc[]
5343
--
5444

55-
. Add a `+script+` element sourcing {productname}, such as:
45+
. Add a `+script+` element sourcing the output file, such as:
5646
+
5747
[source,html]
5848
----
@@ -63,7 +53,7 @@ If a `script` element sourcing {productname} is not provided, the {productname}
6353

6454
endif::[]
6555
ifeval::["{productSource}" == "zip"]
66-
. Add a `+script+` element sourcing the {productname} Web Component (`+tinymce-webcomponent.js+`), such as:
56+
. Add a `+script+` element sourcing the {productname} Web Component (`+tinymce-webcomponent.min.js+`), such as:
6757
+
6858
[source,html,subs="attributes+"]
6959
----
@@ -80,28 +70,35 @@ The `tinymce-webcomponent` can also be sourced from link:https://www.npmjs.com/p
8070
----
8171
+
8272
If a `+script+` element sourcing {productname} is not provided, the {productname} Web Component will load {productname} from the {cloudname}. For information on the available options for sourcing {productname}, see: xref:webcomponent-ref.adoc#loading-tinymce[Loading {productname}].
73+
8374
endif::[]
75+
8476
ifeval::["{productSource}" == "cloud"]
8577
. Add a `+tinymce-editor+` element where the editor should appear and include your {cloudname} API key from link:{accountpageurl}/[{accountpage}].
8678
+
8779
[source,html]
8880
----
8981
<tinymce-editor
90-
api-key="your-tiny-cloud-api-key"
82+
api-key="no-api-key"
9183
></tinymce-editor>
9284
----
9385
endif::[]
86+
9487
ifeval::["{productSource}" != "cloud"]
9588
. Add a `+tinymce-editor+` element where the editor should appear.
9689
+
9790
[source,html,subs="attributes+"]
9891
----
99-
<tinymce-editor></tinymce-editor>
92+
<tinymce-editor license-key="your-license-key"></tinymce-editor>
10093
----
101-
endif::[]
102-
+
10394
The default {productname} editor will load at this location if the page is opened in a web browser.
10495

96+
+
97+
. Update the `+license-key+` option in the editor element and include your xref:license-key.adoc[License Key].
98+
+
99+
endif::[]
100+
101+
ifeval::["{productSource}" == "cloud"]
105102
== Example: adding the TinyMCE Web Component to an HTML page
106103

107104
The following example shows the {productname} Web Component in an HTML page, with:
@@ -110,6 +107,7 @@ The following example shows the {productname} Web Component in an HTML page, wit
110107
* {productname} sourced from the {cloudname}.
111108

112109
liveDemo::web-component[tab="html"]
110+
endif::[]
113111

114112
== Next Steps
115113

modules/ROOT/partials/integrations/webcomponent-tech-ref.adoc

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ To add the {productname} Web Component integration to a JavaScript project, on c
5555
+
5656
[source,sh]
5757
----
58-
npm i --save @tinymce/tinymce-webcomponent
58+
npm i @tinymce/tinymce-webcomponent
5959
----
6060
* Yarn users:
6161
+
@@ -189,13 +189,6 @@ To set the menus shown on the editor menu bar, add the `+menubar+` attribute. Fo
189189
<tinymce-editor menubar="file edit insert view format table tools help"></tinymce-editor>
190190
----
191191

192-
To disable or remove the menu bar, set the `+menubar+` attribute to `+"false"+`. For example:
193-
194-
[source,html]
195-
----
196-
<tinymce-editor menubar="false"></tinymce-editor>
197-
----
198-
199192
To change the menu items shown in the menus, or define custom menus, set the `+menu+` configuration option using the `+config+` attribute.
200193

201194
For information on:
@@ -214,13 +207,6 @@ To change the context menu sections that can be shown in the editor context menu
214207
<tinymce-editor plugins="link image table" contextmenu="link image table"></tinymce-editor>
215208
----
216209

217-
To disable the context menu, set the `+contextmenu+` attribute to `+"false"+`. For example:
218-
219-
[source,html]
220-
----
221-
<tinymce-editor contextmenu="false"></tinymce-editor>
222-
----
223-
224210
For a list of available context menu sections, see: xref:editor-context-menu-identifiers.adoc[Available context menu sections]. For information on context menus, see: xref:menus-configuration-options.adoc#contextmenu[User interface options - `+contextmenu+`].
225211

226212
[[setting-the-quick-insert-toolbar]]
@@ -308,10 +294,11 @@ To apply a small set of CSS styles to the editor, use the `+content_style+` attr
308294

309295
For information on the `+content_style+` option, see: xref:add-css-options.adoc#content_style[Content appearance options - `+content_style+`].
310296

311-
[[setting-powerpastes-word-import-method]]
312-
=== Setting PowerPaste's word import method
297+
=== Settings for when PowerPaste plugin enabled
298+
NOTE: These settings only apply if the PowerPaste plugin (`+powerpaste+`) is enabled.
313299

314-
This setting only applies if the PowerPaste plugin (`+powerpaste+`) is enabled.
300+
[[setting-powerpastes-word-import-method]]
301+
==== PowerPaste's word import method
315302

316303
To control how content pasted from Microsoft Word is filtered, use the `+powerpaste_word_import+` attribute. For example:
317304

@@ -323,9 +310,7 @@ To control how content pasted from Microsoft Word is filtered, use the `+powerpa
323310
For information on the `+powerpaste_word_import+` option, including supported values, see: xref:powerpaste-options.adoc#powerpaste_word_import[The PowerPaste plugin - `+powerpaste_word_import+`].
324311

325312
[[setting-powerpastes-html-import-method]]
326-
=== Setting PowerPaste's html import method
327-
328-
This setting only applies if the PowerPaste plugin (`+powerpaste+`) is enabled.
313+
==== PowerPaste's html import method
329314

330315
To control how content pasted from sources other than Microsoft Word is filtered, use the `+powerpaste_html_import+` attribute. For example:
331316

@@ -337,9 +322,8 @@ To control how content pasted from sources other than Microsoft Word is filtered
337322
For information on the `+powerpaste_html_import+` option, including supported values, see: xref:powerpaste-options.adoc#powerpaste_html_import[The PowerPaste plugin - `+powerpaste_html_import+`].
338323

339324
[[setting-powerpaste-to-allow-local-images]]
340-
=== Setting PowerPaste to allow local images
325+
==== PowerPaste to allow local images
341326

342-
This setting only applies if the PowerPaste plugin (`+powerpaste+`) is enabled.
343327

344328
To prevent Base64 encoded images with a data URI from being pasted into the editor, set `+powerpaste_allow_local_images+` to `+"false"+`. For example:
345329

@@ -379,11 +363,11 @@ To execute a javascript callback before the editor instance is rendered, use the
379363
[source,html]
380364
----
381365
<script>
382-
function setupEditor(editor) {
383-
editor.on('click', function () {
384-
console.log('Editor was clicked');
385-
});
386-
}
366+
function setupEditor(editor) {
367+
editor.on('click', function () {
368+
console.log('Editor was clicked');
369+
});
370+
}
387371
</script>
388372
<tinymce-editor setup="setupEditor"></tinymce-editor>
389373
----
@@ -520,11 +504,11 @@ To configure any {productname} option that does not have a corresponding attribu
520504
[source,html]
521505
----
522506
<script>
523-
window.myConfig = {
524-
height: 500,
525-
spellchecker_dialog: true,
526-
spellchecker_ignore_list: ['Ephox', 'Moxiecode']
527-
};
507+
window.myConfig = {
508+
height: 500,
509+
spellchecker_dialog: true,
510+
spellchecker_ignore_list: ['Ephox', 'Moxiecode']
511+
};
528512
</script>
529513
<tinymce-editor
530514
config="myConfig"
@@ -546,11 +530,11 @@ There are two methods to bind events for the TinyMCE Web Component.
546530
[source,html]
547531
----
548532
<script>
549-
function setupEditor(editor) {
550-
editor.on('click', function () {
551-
console.log('Editor was clicked');
552-
});
553-
}
533+
function setupEditor(editor) {
534+
editor.on('click', function () {
535+
console.log('Editor was clicked');
536+
});
537+
}
554538
</script>
555539
<tinymce-editor setup="setupEditor"/>
556540
----
@@ -559,9 +543,9 @@ function setupEditor(editor) {
559543
[source,html]
560544
----
561545
<script>
562-
function changeHandler(evt) {
563-
console.log('The ' + evt['type'] + ' event was fired.');
564-
}
546+
function changeHandler(evt) {
547+
console.log('The ' + evt['type'] + ' event was fired.');
548+
}
565549
</script>
566550
<tinymce-editor on-Change="changeHandler"/>
567551
----

0 commit comments

Comments
 (0)