From 0b36185ead3e4aa3529e920e0facd7ef3ce2acb4 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 29 Jan 2021 07:42:45 +0100 Subject: [PATCH] Move plugins warning in the logger --- src/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 47a03c8c2..3a87ba697 100644 --- a/src/index.js +++ b/src/index.js @@ -50,6 +50,7 @@ export default { config = { ...defaultConfig, ...config, grapesjs: this }; config.el = isElement(els) ? els : document.querySelector(els); const editor = new Editor(config).init(); + const em = editor.getModel(); // Load plugins config.plugins.forEach(pluginId => { @@ -67,14 +68,17 @@ export default { } else if (isFunction(pluginId)) { pluginId(editor, plgOptions); } else { - console.warn(`Plugin ${pluginId} not found`); + em.logWarning(`Plugin ${pluginId} not found`, { + context: 'plugins', + plugin: pluginId + }); } }); // Execute `onLoad` on modules once all plugins are initialized. // A plugin might have extended/added some custom type so this // is a good point to load stuff like components, css rules, etc. - editor.getModel().loadOnStart(); + em.loadOnStart(); config.autorender && editor.render(); editors.push(editor);