Skip to content

Commit f6f8f47

Browse files
DOC-3411 - Update Svelte integration docs for tinymce-svelte 4.x / Svelte 5 (v7 backport) (#4065)
* DOC-3411: Update Svelte integration docs for tinymce-svelte 4.x / Svelte 5 Update the Svelte technical reference to reflect breaking changes in @tinymce/tinymce-svelte 4.0.0 (Svelte 5 support): - Add supported versions table (4.x → Svelte 5+, 3.x → Svelte 4) - Update event binding: remove on: directive prefix (Svelte 5 syntax) - Add complete event binding example with handler signature - Fix mixed-case event names to lowercase (matching actual prop names) * Update modules/ROOT/partials/integrations/svelte-tech-ref.adoc Co-authored-by: tiny-ben-tran <ben.tran@tiny.cloud> * Update modules/ROOT/partials/integrations/svelte-tech-ref.adoc Co-authored-by: tiny-ben-tran <ben.tran@tiny.cloud> * Update modules/ROOT/partials/integrations/svelte-tech-ref.adoc Co-authored-by: tiny-ben-tran <ben.tran@tiny.cloud> * Update modules/ROOT/partials/integrations/svelte-tech-ref.adoc Co-authored-by: tiny-ben-tran <ben.tran@tiny.cloud> --------- Co-authored-by: tiny-ben-tran <ben.tran@tiny.cloud>
1 parent 19de2ce commit f6f8f47

1 file changed

Lines changed: 27 additions & 8 deletions

File tree

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

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Covered in this section:
22

3-
* xref:configuring-the-tinymce-svelte-integration[Configuring the TinyMCE Svelte integration]
3+
* xref:configuring-the-tinymce-svelte-integration[Configuring the {productname} Svelte integration]
44
** xref:apikey[apiKey]
55
** xref:licensekey[licenseKey]
66
** xref:channel[channel]
@@ -13,6 +13,7 @@ Covered in this section:
1313
* xref:component-binding[Component binding]
1414
* xref:event-binding[Event binding]
1515
16+
1617
[[configuring-the-tinymce-svelte-integration]]
1718
== Configuring the TinyMCE Svelte integration
1819

@@ -254,9 +255,9 @@ let text = '';
254255

255256
Functions can be bound to editor events, such as:
256257

257-
[source,jsx]
258+
[source,svelte]
258259
----
259-
<Editor on:resizeeditor={this.handlerFunction} />
260+
<Editor resizeeditor={handlerFunction} />
260261
----
261262

262263
When the handler is called (*handlerFunction* in this example), it is called with two arguments:
@@ -265,8 +266,26 @@ When the handler is called (*handlerFunction* in this example), it is called wit
265266

266267
`+editor+`:: A reference to the editor.
267268

269+
=== Example of event binding
270+
271+
[source,svelte]
272+
----
273+
<script>
274+
import Editor from '@tinymce/tinymce-svelte';
275+
276+
function eventHandler(event, editor) {
277+
console.log('Editor event:', event);
278+
console.log('Editor instance:', editor);
279+
}
280+
</script>
281+
282+
<main>
283+
<Editor resizeeditor={this.eventHandler} />
284+
</main>
285+
----
286+
268287
[TIP]
269-
Ensure event names are specified in lower-case (event names are case-sensitive).
288+
Specify event names in lower-case (event names are case-sensitive).
270289

271290
The following events are available:
272291

@@ -282,10 +301,10 @@ The following events are available:
282301
* `+change+`
283302
* `+clearundos+`
284303
* `+click+`
285-
* `+CommentChange+`
286-
* `+CompositionEnd+`
287-
* `+CompositionStart+`
288-
* `+CompositionUpdate+`
304+
* `+commentchange+`
305+
* `+compositionend+`
306+
* `+compositionstart+`
307+
* `+compositionupdate+`
289308
* `+contextmenu+`
290309
* `+copy+`
291310
* `+cut+`

0 commit comments

Comments
 (0)