core/editor/utils/normalizerootsconfig
Functions
normalizeMultiRootEditorConstructorParams( sourceElementOrDataOrConfig, editorConfig ) → objectinternalmodule:core/editor/utils/normalizerootsconfig~normalizeMultiRootEditorConstructorParamsNormalizes the parameters passed to the editor constructor when a multi root is used. It supports both of the following signatures:
new Editor( editorConfig: EditorConfig ); new Editor( sourceElementsOrData: Record<string, string> | Record<string, HTMLElement>, editorConfig: EditorConfig );Copy codeParameters
sourceElementOrDataOrConfig : Record<string, string> | Record<string, HTMLElement>editorConfig : EditorConfig
Returns
object
normalizeRootsConfig( sourceElementsOrData, config, defaultRootName, separateAttachTo ) → voidinternalmodule:core/editor/utils/normalizerootsconfig~normalizeRootsConfigNormalizes the editor roots configuration. It ensures that all root configurations are defined in
config.rootsand that they haveinitialDatadefined.It normalizes a single-root configuration (where
config.rootis used) to a multi-root configuration (where all roots are defined inconfig.roots). This is considered a standard configuration format, so the editor features can always expect roots to be defined inconfig.roots.It also handles legacy configuration options, such as
config.initialData,config.placeholder, andconfig.label.Parameters
sourceElementsOrData : string | HTMLElement | Record<string, string> | Record<string, HTMLElement>config : Config<EditorConfig>defaultRootName : string | falseDefaults to
'main'separateAttachTo : booleanDefaults to
false
Returns
void
normalizeSingleRootEditorConstructorParams( sourceElementOrDataOrConfig, editorConfig ) → objectinternalmodule:core/editor/utils/normalizerootsconfig~normalizeSingleRootEditorConstructorParamsNormalizes the parameters passed to the editor constructor when a single root is used. It supports both of the following signatures:
new Editor( editorConfig: EditorConfig ); new Editor( sourceElementOrData: HTMLElement | string, editorConfig: EditorConfig );Copy codeParameters
sourceElementOrDataOrConfig : string | HTMLElement | EditorConfigeditorConfig : EditorConfig
Returns
object