File tree Expand file tree Collapse file tree 2 files changed +40
-20
lines changed
addons/html_builder/static/src
website_builder/plugins/options Expand file tree Collapse file tree 2 files changed +40
-20
lines changed Original file line number Diff line number Diff line change @@ -3,17 +3,37 @@ import {
3
3
getDefaultShadow ,
4
4
shadowToString ,
5
5
} from "@html_builder/plugins/shadow_option_plugin" ;
6
- import { after , SNIPPET_SPECIFIC_NEXT } from "@html_builder/utils/option_sequence" ;
6
+ import {
7
+ SNIPPET_SPECIFIC_END ,
8
+ SNIPPET_SPECIFIC_NEXT ,
9
+ splitBetween ,
10
+ } from "@html_builder/utils/option_sequence" ;
7
11
import { Plugin } from "@html_editor/plugin" ;
8
12
import { withSequence } from "@html_editor/utils/resource" ;
9
13
import { registry } from "@web/core/registry" ;
10
14
import { HeaderBorderOption } from "./header_border_option" ;
11
15
12
- export const HEADER_TEMPLATE = SNIPPET_SPECIFIC_NEXT ;
13
- export const HEADER_TEMPLATE_SECONDARY_OPTIONS = after ( HEADER_TEMPLATE ) ;
14
- export const HEADER_SCROLL_EFFECT = after ( HEADER_TEMPLATE_SECONDARY_OPTIONS ) ;
15
- export const HEADER_ELEMENT = after ( HEADER_SCROLL_EFFECT ) ;
16
- export const HEADER_BORDER = after ( HEADER_ELEMENT ) ;
16
+ const [
17
+ HEADER_TEMPLATE ,
18
+ HEADER_TEMPLATE_SECONDARY_OPTIONS ,
19
+ HEADER_BORDER ,
20
+ HEADER_SCROLL_EFFECT ,
21
+ HEADER_ELEMENT ,
22
+ HEADER_END ,
23
+ ...__ERROR_CHECK__
24
+ ] = splitBetween ( SNIPPET_SPECIFIC_NEXT , SNIPPET_SPECIFIC_END , 6 ) ;
25
+ if ( __ERROR_CHECK__ . length > 0 ) {
26
+ console . error ( "Wrong count in header option split" ) ;
27
+ }
28
+
29
+ export {
30
+ HEADER_TEMPLATE ,
31
+ HEADER_TEMPLATE_SECONDARY_OPTIONS ,
32
+ HEADER_BORDER ,
33
+ HEADER_SCROLL_EFFECT ,
34
+ HEADER_ELEMENT ,
35
+ HEADER_END ,
36
+ } ;
17
37
18
38
class HeaderOptionPlugin extends Plugin {
19
39
static id = "headerOption" ;
Original file line number Diff line number Diff line change
1
+ import { HEADER_END } from "@html_builder/website_builder/plugins/options/header_option_plugin" ;
1
2
import { Plugin } from "@html_editor/plugin" ;
2
3
import { withSequence } from "@html_editor/utils/resource" ;
3
- import { _t } from "@web/core/l10n/translation" ;
4
4
import { registry } from "@web/core/registry" ;
5
5
6
6
class WebsiteSaleShowEmptyOptionPlugin extends Plugin {
7
- static id = "showEmptyOption" ;
8
- resources = {
9
- builder_options : [
10
- withSequence ( 100 , {
11
- template : "website_sale.ShowEmptyOption" ,
12
- selector : "#wrapwrap > header" ,
13
- editableOnly : false ,
14
- groups : [ "website.group_website_designer" ] ,
15
- } ) ,
16
- ] ,
17
- } ;
7
+ static id = "showEmptyOption" ;
8
+ resources = {
9
+ builder_options : [
10
+ withSequence ( HEADER_END , {
11
+ template : "website_sale.ShowEmptyOption" ,
12
+ selector : "#wrapwrap > header" ,
13
+ editableOnly : false ,
14
+ groups : [ "website.group_website_designer" ] ,
15
+ } ) ,
16
+ ] ,
17
+ } ;
18
18
}
19
19
20
20
registry
21
- . category ( "website-plugins" )
22
- . add ( WebsiteSaleShowEmptyOptionPlugin . id , WebsiteSaleShowEmptyOptionPlugin ) ;
21
+ . category ( "website-plugins" )
22
+ . add ( WebsiteSaleShowEmptyOptionPlugin . id , WebsiteSaleShowEmptyOptionPlugin ) ;
You can’t perform that action at this time.
0 commit comments