From b7b05a2d1c1d54380364e7a7d10a7e6a69bce27e Mon Sep 17 00:00:00 2001 From: "Mathieu (mano)" Date: Thu, 4 May 2023 10:56:38 +0000 Subject: [PATCH] [IMP] web_editor: new shapes full height menu This commit replaces the `we-select-pager` for a full-height version allowing better sorting and visibility of the shapes and background shapes. The new UI now has a navbar inside the pager which allows to scroll to anchors inside the menu. To do so a new attribute `data-scroll-to` is added on the button element allowing to scroll to the class contained in the attribute with the new function `_onClickScrollPage`. Thanks to ard the Selection widget now activates the corresponding menu section of the new pager whenever the data-scroll matches a section that has passed the middle of the container. The menu being full width, the angle with the class `.o_pager_nav_angle` triggers the `_onClickCloseMenu` to close the menu. To avoid duplication, the label for the devices now uses the same Js logic as the Animated label for the shapes. This frees the :before and :after which allows to use the alpha-background extended class on the we-button for both types of shapes. The devices label information now shows an aspect ratio rather than full dimensions. For the new pager to appear full-height and the content being scrollable inside the proper section of the menu, two new containers are added one for the pager's navigation (`o_pager_nav`) and one for the shapes pages (`o_pager_container`). This allows to have the parent div in fixed positioning and keeping a scrollable section on the `o_pager_container` under its inner navigation. The previous shapes are back to their original ratio of 800x600 since switching them in square makes them less recognizable. Finally, in the `we-toggler` when no elements are selected or when it is empty, we now display `None` instead of `/`. task-3266751 closes odoo/odoo#118253 Related: odoo/design-themes#653 Signed-off-by: Quentin Smetz (qsm) --- .../composition/composition_line_1.svg | 2 +- .../composition/composition_line_2.svg | 2 +- .../composition/composition_line_3.svg | 2 +- .../composition/composition_mixed_1.svg | 2 +- .../composition/composition_mixed_2.svg | 2 +- .../composition/composition_organic_line.svg | 2 +- .../composition/composition_oval_line.svg | 2 +- .../composition/composition_planet_1.svg | 2 +- .../composition/composition_planet_2.svg | 2 +- .../composition/composition_square_1.svg | 2 +- .../composition/composition_square_2.svg | 2 +- .../composition/composition_square_3.svg | 2 +- .../composition/composition_square_4.svg | 2 +- .../composition/composition_square_line.svg | 2 +- .../composition/composition_triangle_line.svg | 2 +- .../image_shapes/geometric/geo_square_1.svg | 2 +- .../image_shapes/geometric/geo_square_2.svg | 2 +- .../image_shapes/geometric/geo_square_3.svg | 2 +- .../image_shapes/geometric/geo_square_4.svg | 2 +- .../image_shapes/geometric/geo_square_5.svg | 2 +- .../image_shapes/geometric/geo_square_6.svg | 2 +- .../geometric_round/geo_round_blob_hard.svg | 2 +- .../geometric_round/geo_round_blob_medium.svg | 2 +- .../geometric_round/geo_round_blob_soft.svg | 2 +- .../geometric_round/geo_round_square_1.svg | 2 +- .../geometric_round/geo_round_square_2.svg | 2 +- .../image_shapes/pattern/pattern_circuit.svg | 2 +- .../pattern/pattern_labyrinth.svg | 2 +- .../pattern/pattern_line_star.svg | 2 +- .../image_shapes/pattern/pattern_line_sun.svg | 2 +- .../pattern/pattern_organic_caps.svg | 2 +- .../pattern/pattern_organic_cross.svg | 2 +- .../pattern/pattern_organic_dot.svg | 2 +- .../pattern/pattern_oval_zebra.svg | 2 +- .../image_shapes/pattern/pattern_point.svg | 2 +- .../image_shapes/pattern/pattern_wave_1.svg | 2 +- .../image_shapes/pattern/pattern_wave_2.svg | 2 +- .../image_shapes/pattern/pattern_wave_3.svg | 2 +- .../image_shapes/pattern/pattern_wave_4.svg | 2 +- .../image_shapes/solid/solid_blob_1.svg | 2 +- .../image_shapes/solid/solid_blob_2.svg | 2 +- .../image_shapes/solid/solid_blob_3.svg | 2 +- .../image_shapes/solid/solid_blob_4.svg | 2 +- .../image_shapes/solid/solid_blob_5.svg | 2 +- .../solid/solid_blob_shadow_1.svg | 2 +- .../solid/solid_blob_shadow_2.svg | 2 +- .../image_shapes/solid/solid_square_1.svg | 2 +- .../image_shapes/solid/solid_square_2.svg | 2 +- .../image_shapes/solid/solid_square_3.svg | 2 +- .../image_shapes/special/special_filter.svg | 2 +- .../image_shapes/special/special_flag.svg | 2 +- .../image_shapes/special/special_layered.svg | 2 +- .../image_shapes/special/special_organic.svg | 2 +- .../image_shapes/special/special_rain.svg | 2 +- .../image_shapes/special/special_snow.svg | 2 +- .../image_shapes/special/special_speed.svg | 2 +- .../static/src/js/editor/snippets.options.js | 134 ++-- .../static/src/scss/web_editor.variables.scss | 1 + .../static/src/scss/wysiwyg_snippets.scss | 229 +++--- addons/web_editor/views/snippets.xml | 675 ++++++++++-------- 60 files changed, 600 insertions(+), 551 deletions(-) diff --git a/addons/web_editor/static/image_shapes/composition/composition_line_1.svg b/addons/web_editor/static/image_shapes/composition/composition_line_1.svg index c98a19dc48f..80f30dfeb77 100644 --- a/addons/web_editor/static/image_shapes/composition/composition_line_1.svg +++ b/addons/web_editor/static/image_shapes/composition/composition_line_1.svg @@ -1,4 +1,4 @@ - + diff --git a/addons/web_editor/static/image_shapes/composition/composition_line_2.svg b/addons/web_editor/static/image_shapes/composition/composition_line_2.svg index 8a45067131e..96354a04bb6 100644 --- a/addons/web_editor/static/image_shapes/composition/composition_line_2.svg +++ b/addons/web_editor/static/image_shapes/composition/composition_line_2.svg @@ -1,4 +1,4 @@ - + diff --git a/addons/web_editor/static/image_shapes/composition/composition_line_3.svg b/addons/web_editor/static/image_shapes/composition/composition_line_3.svg index 8db96bf0f07..51eedb256b9 100644 --- a/addons/web_editor/static/image_shapes/composition/composition_line_3.svg +++ b/addons/web_editor/static/image_shapes/composition/composition_line_3.svg @@ -1,4 +1,4 @@ - + diff --git a/addons/web_editor/static/image_shapes/composition/composition_mixed_1.svg b/addons/web_editor/static/image_shapes/composition/composition_mixed_1.svg index 3219c4e51c1..7556a4fb3ec 100644 --- a/addons/web_editor/static/image_shapes/composition/composition_mixed_1.svg +++ b/addons/web_editor/static/image_shapes/composition/composition_mixed_1.svg @@ -1,4 +1,4 @@ - +
+
+
+ + + +
+ +
+
+ Origins + + + + + + + + + + + + + + + Bold + + + + + + + + + + + + + + + Blobs + + + + + + + + + + + + + + +
+
+ Airy & Zigs + + + + + + + + + + + + + + + + + + + + + + +
+
+ Wavy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Block & Rainy + + + + + + + + + + + + + + + + + Floating shapes + + + + + + + + + + + + + + + + +
+
- + @@ -461,188 +493,221 @@ data-selector="img">
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
+
+
+
+ + + +
+
+
+
+ Geometrics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Geometrics Rounded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + Geometrics Panels + + + + + + + + + - - - - - - - + Composites + + + + + + + +
+
+ Brushed + + + + + + - - - - - - + Composition + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + Patterns + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + Solids + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Specials + + + + + + + + + +
+
+ Devices + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
- +
@@ -653,11 +718,9 @@
- - - + Reset @@ -666,6 +729,8 @@ + + Default 25%