diff --git a/addons/html_builder/static/src/core/building_blocks/builder_row.js b/addons/html_builder/static/src/core/building_blocks/builder_row.js index 50fd9810e2da5..012eaa9370499 100644 --- a/addons/html_builder/static/src/core/building_blocks/builder_row.js +++ b/addons/html_builder/static/src/core/building_blocks/builder_row.js @@ -13,7 +13,7 @@ export class BuilderRow extends Component { static components = { BuilderComponent }; static props = { ...basicContainerBuilderComponentProps, - label: String, + label: { type: String, optional: true }, tooltip: { type: String, optional: true }, slots: { type: Object, optional: true }, level: { type: Number, optional: true }, diff --git a/addons/html_builder/static/src/core/building_blocks/builder_row.xml b/addons/html_builder/static/src/core/building_blocks/builder_row.xml index c86ec29967e7e..f0c3e44a77069 100644 --- a/addons/html_builder/static/src/core/building_blocks/builder_row.xml +++ b/addons/html_builder/static/src/core/building_blocks/builder_row.xml @@ -3,17 +3,28 @@ -
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/html_builder/static/src/sidebar/theme_tab.xml b/addons/html_builder/static/src/sidebar/theme_tab.xml index 9aede5d10c247..b9888f0b19252 100644 --- a/addons/html_builder/static/src/sidebar/theme_tab.xml +++ b/addons/html_builder/static/src/sidebar/theme_tab.xml @@ -18,44 +18,6 @@
- - - - TODO - - - - diff --git a/addons/html_builder/static/src/sidebar/theme_tab_plugin.js b/addons/html_builder/static/src/sidebar/theme_tab_plugin.js index 590e7581740e9..c94d5b5e2daa9 100644 --- a/addons/html_builder/static/src/sidebar/theme_tab_plugin.js +++ b/addons/html_builder/static/src/sidebar/theme_tab_plugin.js @@ -6,6 +6,7 @@ import { isCSSColor } from "@web/core/utils/colors"; import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; import { getCSSVariableValue, isColorCombinationName } from "../utils/utils_css"; import { withSequence } from "@html_editor/utils/resource"; +import { ThemeColorsOption } from "./theme_colors_option"; export class ThemeTabPlugin extends Plugin { static id = "themeTab"; @@ -15,11 +16,7 @@ export class ThemeTabPlugin extends Plugin { theme_options: [ withSequence( 10, - this.getThemeOptionBlock( - "theme-colors", - _t("Colors"), - "html_builder.ThemeColorsOption" - ) + this.getThemeOptionBlock("theme-colors", _t("Colors"), null, ThemeColorsOption) ), withSequence( 20, @@ -342,12 +339,21 @@ export class ThemeTabPlugin extends Plugin { } }); } - getThemeOptionBlock(id, name, template) { + getThemeOptionBlock(id, name, template = null, Component = null) { // TODO Have a specific kind of options container that takes the specific parameters like name, no element, no selector... const el = this.document.createElement("div"); el.dataset.name = name; this.document.body.appendChild(el); // Currently editingElement needs to be isConnected + const option = { + selector: "*", + }; + if (template) { + option.template = template; + } else { + option.OptionComponent = Component; + } + return { id: id, element: el, @@ -355,12 +361,7 @@ export class ThemeTabPlugin extends Plugin { headerMiddleButton: false, isClonable: false, isRemovable: false, - options: [ - { - template: template, - selector: "*", - }, - ], + options: [option], optionsContainerTopButtons: [], snippetModel: {}, };