From cc87cba5c3554381f86594e61a0a7893e320a215 Mon Sep 17 00:00:00 2001 From: Felipe Simoes Date: Mon, 19 Aug 2024 18:16:59 +0200 Subject: [PATCH] Send master config --- blocks/header/header.editor.js | 51 ++++++++++++++++++++++++++++++++++ scripts/editor.js | 8 ++++-- 2 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 blocks/header/header.editor.js diff --git a/blocks/header/header.editor.js b/blocks/header/header.editor.js new file mode 100644 index 00000000..50e4d1cd --- /dev/null +++ b/blocks/header/header.editor.js @@ -0,0 +1,51 @@ +export default function config() { + return { + attributes: { + data: { + type: { + type: 'select', + options: [ + { + label: 'Default', + value: 'default', + }, + { + label: 'Primary', + value: 'primary', + }, + { + label: 'Secondary', + value: 'secondary', + }, + { + label: 'Success', + value: 'success', + }, + { + label: 'Danger', + value: 'danger', + }, + { + label: 'Warning', + value: 'warning', + }, + { + label: 'Info', + value: 'info', + }, + { + label: 'Light', + value: 'light', + }, + { + label: 'Dark', + value: 'dark', + }, + ], + label: 'Type', + helpText: 'The type of the header.', + }, + }, + }, + }; +} diff --git a/scripts/editor.js b/scripts/editor.js index 5c5e1152..b75057a3 100644 --- a/scripts/editor.js +++ b/scripts/editor.js @@ -44,7 +44,6 @@ export function updateComponent(component) { } export function getComponentValues(dialog, element) { - console.log('get', dialog, element); const html = element.innerHTML; window.document.body.style.height = 'auto'; const domRect = element.getBoundingClientRect(); @@ -102,7 +101,12 @@ export default function initEditor(listeners = true) { publish( MessagesEvents.loaded, - { components: window.raqnEditor, bodyRect, baseURL: getBaseUrl() }, + { + components: window.raqnEditor, + bodyRect, + baseURL: getBaseUrl(), + masterConfig: window.raqnComponentsMasterConfig, + }, { usePostMessage: true, targetOrigin: '*' }, );