Problem/Motivation
Currently it is not documented how to pass configuration to CKE5 plugins that is not of a datatype natively supported in yaml.
Example:
The wordcount plugin has a config parameter onUpdate that has the datatype function: https://ckeditor.com/docs/ckeditor5/latest/api/module_word-count_wordcou...
It is possible to set this parameter by using
...
onUpdate:
func:
name: some.niceFunction
...
But it is not documented how that works.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 3311239-13.patch | 3.82 KB | wim leers |
Comments
Comment #2
wim leersWow, excellent find!
Comment #3
nod_Just so we're clear, this is not working as of today but it is a proposal on how to encode a reference to a function to be run when needed right?
And the scope for this is CKE5 config, not for other things like drupalSettings or other places where we want a config key to reference a function to run or something?
Comment #4
wim leersActually, JS functions are working as of today. See this example:
See
processConfig()incore/modules/ckeditor5/js/ckeditor5.js. The two "special cases" arefuncandregexp. Are there more we should support?Comment #5
nod_Ohh I see, nice.
Not sure where to document. We don't have accessible/generated JS documentation and we don't have yml documentation at all :/
Comment #6
harlor commented@Wim Leers, HTMLElements maybe? The wordcount plugin seems to use that too: https://ckeditor.com/docs/ckeditor5/latest/api/module_word-count_wordcou...
Comment #9
wim leersThis came up again as a blocker for CKEditor 5 ecosystem adoption: https://drupal.slack.com/archives/C01GWN3QYJD/p1684981833259909?thread_t....
Comment #12
wim leersThanks for surfacing, Bryan & Matt!
Comment #13
wim leersThe reason this was never documented is cited by @nod_:
I propose we are pragmatic and just document it in
ckeditor5.api.php, where the documentation already lives of what theckeditor5.configkey expects as values.