kr15t14ns
11/23/2023, 11:35 AMimplementation(npm("tinymce", "6.8.0"))
and then in my component I used thisone implementation:
package com.dsmp.app.views.templates.parts
import androidx.compose.runtime.*
import org.jetbrains.compose.web.dom.*
import org.w3c.dom.HTMLElement
@Composable
fun TinyMCEEditor(
content: String,
onContentChange: (String) -> Unit
) {
val elementRef = remember { mutableStateOf<HTMLElement?>(null) }
Div(
attrs = {
ref { domElement ->
val element = domElement
js("""
tinymce.init({
target: element,
setup: function(editor) {
editor.on('Change', function() {
onContentChange(editor.getContent())
})
}
})
""")
onDispose {
js("tinymce.remove(element)")
}
}
}
) {
Text(content)
}
}
That seems to work, and also in console I can see that something is loaded ... after that I used kotlin require in my App:
kotlinext.js.require("tinymce")
but Iˇm missing still a lof of JS files and CSS stylesheets ...
is this possible somehow to achieve, or can you help me with?