@@ -2,30 +2,27 @@ import manifest from '@neos-project/neos-ui-extensibility';
22import { getCkeditorPlugin , getCkeditorPluginConfig , getRichtextToolbarConfig } from './CkeditorPluginUtils' ;
33import backend from '@neos-project/neos-ui-backend-connector' ;
44
5- manifest ( 'Breadlesscode.SimpleEditorExtend:UiPlugin' , { } , globalRegistry => {
5+ manifest ( 'Breadlesscode.SimpleEditorExtend:UiPlugin' , { } , ( globalRegistry , { frontendConfiguration } ) => {
66 const richtextToolbar = globalRegistry . get ( 'ckEditor5' ) . get ( 'richtextToolbar' ) ;
7- const config = globalRegistry . get ( 'ckEditor5' ) . get ( 'config' ) ;
8- const { getJsonResource } = backend . get ( ) . endpoints ;
9- const configUri = '/breadlesscode/editor-config' ;
7+ const ckEditorConfig = globalRegistry . get ( 'ckEditor5' ) . get ( 'config' ) ;
8+ const buttonConfig = frontendConfiguration [ 'Breadlesscode.SimpleEditorExtend:Buttons' ] ;
109
11- getJsonResource ( configUri ) . then ( ( buttonConfig ) => {
12- Object . keys ( buttonConfig ) . forEach ( ( formattingName ) => {
13- const options = buttonConfig [ formattingName ] ;
14- const commandName = options . extensionName + 'Command' ;
10+ Object . keys ( buttonConfig ) . forEach ( ( formattingName ) => {
11+ const options = buttonConfig [ formattingName ] ;
12+ const commandName = options . extensionName + 'Command' ;
1513
16- richtextToolbar . set (
17- options . extensionName ,
18- getRichtextToolbarConfig ( commandName , formattingName , options . icon , options . tooltip ) ,
19- options . position
20- ) ;
21-
22- config . set (
23- options . extensionName ,
24- getCkeditorPluginConfig (
25- formattingName ,
26- getCkeditorPlugin ( options . extensionName , commandName , options . formatting )
27- )
28- ) ;
29- } ) ;
14+ richtextToolbar . set (
15+ options . extensionName ,
16+ getRichtextToolbarConfig ( commandName , formattingName , options . icon , options . tooltip ) ,
17+ options . position
18+ ) ;
19+
20+ ckEditorConfig . set (
21+ options . extensionName ,
22+ getCkeditorPluginConfig (
23+ formattingName ,
24+ getCkeditorPlugin ( options . extensionName , commandName , options . formatting )
25+ )
26+ ) ;
3027 } ) ;
3128} ) ;
0 commit comments