@total_onion/onion-library 2.0.33 → 2.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,6 +81,9 @@
81
81
  "layout": "block",
82
82
  "acfe_seamless_style": 0,
83
83
  "acfe_group_modal": 0,
84
+ "acfe_group_modal_close": 0,
85
+ "acfe_group_modal_button": "",
86
+ "acfe_group_modal_size": "large",
84
87
  "sub_fields": [
85
88
  {
86
89
  "key": "field_686644fafc821",
@@ -110,10 +113,7 @@
110
113
  "acfe_clone_modal_button": "",
111
114
  "acfe_clone_modal_size": "large"
112
115
  }
113
- ],
114
- "acfe_group_modal_close": 0,
115
- "acfe_group_modal_button": "",
116
- "acfe_group_modal_size": "large"
116
+ ]
117
117
  },
118
118
  {
119
119
  "key": "field_686642953d7a0",
@@ -1044,8 +1044,11 @@
1044
1044
  },
1045
1045
  "wpml_cf_preferences": 3,
1046
1046
  "choices": {
1047
- "1": "White text",
1048
- "2": "test"
1047
+ "1": "Bally 1",
1048
+ "2": "Bally 2",
1049
+ "3": "Bally 3",
1050
+ "4": "Bally 4",
1051
+ "5": "Bally 5"
1049
1052
  },
1050
1053
  "default_value": 1,
1051
1054
  "return_format": "value",
@@ -1398,7 +1401,7 @@
1398
1401
  },
1399
1402
  "wpml_cf_preferences": 3,
1400
1403
  "clone": [
1401
- "group_6504a81a0623c"
1404
+ "group_68822860bda9f"
1402
1405
  ],
1403
1406
  "display": "seamless",
1404
1407
  "layout": "block",
@@ -2089,6 +2092,144 @@
2089
2092
  "acfe_flexible_category": false,
2090
2093
  "acfe_layout_col": "auto",
2091
2094
  "acfe_layout_allowed_col": false
2095
+ },
2096
+ "layout_68e788a097347": {
2097
+ "key": "layout_68e788a097347",
2098
+ "name": "social_networks",
2099
+ "label": "Social Networks",
2100
+ "display": "block",
2101
+ "sub_fields": [
2102
+ {
2103
+ "key": "field_68e788a19734a",
2104
+ "label": "Grid Layout",
2105
+ "name": "",
2106
+ "aria-label": "",
2107
+ "type": "tab",
2108
+ "instructions": "",
2109
+ "required": 0,
2110
+ "conditional_logic": 0,
2111
+ "wrapper": {
2112
+ "width": "",
2113
+ "class": "",
2114
+ "id": ""
2115
+ },
2116
+ "wpml_cf_preferences": 3,
2117
+ "placement": "top",
2118
+ "endpoint": 0,
2119
+ "no_preference": 0,
2120
+ "selected": 0
2121
+ },
2122
+ {
2123
+ "key": "field_68e788a19734b",
2124
+ "label": "Grid layout",
2125
+ "name": "grid_layout",
2126
+ "aria-label": "",
2127
+ "type": "clone",
2128
+ "instructions": "",
2129
+ "required": 0,
2130
+ "conditional_logic": 0,
2131
+ "wrapper": {
2132
+ "width": "",
2133
+ "class": "",
2134
+ "id": ""
2135
+ },
2136
+ "wpml_cf_preferences": 3,
2137
+ "clone": [
2138
+ "group_68822860bda9f"
2139
+ ],
2140
+ "display": "seamless",
2141
+ "layout": "block",
2142
+ "prefix_label": 0,
2143
+ "prefix_name": 0,
2144
+ "acfe_seamless_style": 0,
2145
+ "acfe_clone_modal": 0,
2146
+ "acfe_clone_modal_close": 0,
2147
+ "acfe_clone_modal_button": "",
2148
+ "acfe_clone_modal_size": "large"
2149
+ },
2150
+ {
2151
+ "key": "field_68e788a19734c",
2152
+ "label": "Social Settings",
2153
+ "name": "",
2154
+ "aria-label": "",
2155
+ "type": "tab",
2156
+ "instructions": "",
2157
+ "required": 0,
2158
+ "conditional_logic": 0,
2159
+ "wrapper": {
2160
+ "width": "",
2161
+ "class": "",
2162
+ "id": ""
2163
+ },
2164
+ "wpml_cf_preferences": 3,
2165
+ "placement": "top",
2166
+ "endpoint": 0,
2167
+ "no_preference": 0,
2168
+ "selected": 0
2169
+ },
2170
+ {
2171
+ "key": "field_68e7985cacd8e",
2172
+ "label": "Share Label",
2173
+ "name": "share_label",
2174
+ "aria-label": "",
2175
+ "type": "text",
2176
+ "instructions": "",
2177
+ "required": 0,
2178
+ "conditional_logic": 0,
2179
+ "wrapper": {
2180
+ "width": "",
2181
+ "class": "",
2182
+ "id": ""
2183
+ },
2184
+ "wpml_cf_preferences": 2,
2185
+ "default_value": "",
2186
+ "maxlength": "",
2187
+ "placeholder": "",
2188
+ "prepend": "",
2189
+ "append": ""
2190
+ },
2191
+ {
2192
+ "key": "field_68e7bbf14e510",
2193
+ "label": "Text Editor Settings Fields",
2194
+ "name": "text_editor_settings_fields",
2195
+ "aria-label": "",
2196
+ "type": "clone",
2197
+ "instructions": "",
2198
+ "required": 0,
2199
+ "conditional_logic": 0,
2200
+ "wrapper": {
2201
+ "width": "",
2202
+ "class": "",
2203
+ "id": ""
2204
+ },
2205
+ "wpml_cf_preferences": 0,
2206
+ "clone": [
2207
+ "group_687a4e2334e37"
2208
+ ],
2209
+ "display": "seamless",
2210
+ "layout": "block",
2211
+ "prefix_label": 0,
2212
+ "prefix_name": 0,
2213
+ "acfe_seamless_style": 0,
2214
+ "acfe_clone_modal": 0,
2215
+ "acfe_clone_modal_close": 0,
2216
+ "acfe_clone_modal_button": "",
2217
+ "acfe_clone_modal_size": "large"
2218
+ }
2219
+ ],
2220
+ "min": "",
2221
+ "max": "",
2222
+ "acfe_flexible_render_template": false,
2223
+ "acfe_flexible_render_style": false,
2224
+ "acfe_flexible_render_script": false,
2225
+ "acfe_flexible_thumbnail": false,
2226
+ "acfe_flexible_settings": false,
2227
+ "acfe_flexible_settings_size": "medium",
2228
+ "acfe_layout_locations": [],
2229
+ "acfe_flexible_modal_edit_size": false,
2230
+ "acfe_flexible_category": false,
2231
+ "acfe_layout_col": "auto",
2232
+ "acfe_layout_allowed_col": false
2092
2233
  }
2093
2234
  },
2094
2235
  "min": "",
@@ -2394,5 +2535,5 @@
2394
2535
  "acfe_display_title": "",
2395
2536
  "acfe_meta": "",
2396
2537
  "acfe_note": "",
2397
- "modified": 1756718523
2538
+ "modified": 1760017434
2398
2539
  }
@@ -1,5 +1,5 @@
1
1
  {% set gridLayoutElement = include('components/grid-layout-element-v3.twig', { fields: field, block: block }, with_context = false) %}
2
- {% set textStyle = include('components/text-style.twig', {field, post}) %}
2
+ {# {% set textStyle = include('components/text-style.twig', {field, post}) %} #}
3
3
  {% set elementStyles = gridLayoutElement ~ textStyle %}
4
4
  <style>
5
5
  .{{blockClassName}}__bazaarvoice.{{block.id}}{
@@ -21,7 +21,7 @@
21
21
  {{positionVars}}
22
22
  }
23
23
  </style>
24
- <a href="{{post.link}}" data-pattern-post-info="link" data-image-select="{{ imageSelect }}" class="{{blockClassName}}__post-image-container {{blockClassName}}__info-item {{blockClassName}}__info-item--{{postType}} {{blockClassName}}__post-image-container--{{imageSelect|replace({'_':'-'})}} {{block.id}}">
24
+ <a aria-label="{{post.title}}" href="{{post.link}}" data-pattern-post-info="link" data-image-select="{{ imageSelect }}" class="{{blockClassName}}__post-image-container {{blockClassName}}__info-item {{blockClassName}}__info-item--{{postType}} {{blockClassName}}__post-image-container--{{imageSelect|replace({'_':'-'})}} {{block.id}}">
25
25
  {% set imageSizes = imageSizes|default('(min-width: 1440px) 50vw, (min-width: 768px) 50vw, (min-width: 500px) 50vw, 100vw') %}
26
26
  {% set imageFields = [] %}
27
27
  {% set imageFields = imageFields|merge({'enable_image' : true}) %}
@@ -1,4 +1,4 @@
1
- {% set gridLayoutElement = include('components/grid-layout-element.twig-v3', { fields: field, block: block }, with_context = false) %}
1
+ {% set gridLayoutElement = include('components/grid-layout-element-v3.twig', { fields: field, block: block }, with_context = false) %}
2
2
  {% set textEditorStyleVars = include('components/text-editor-settings-variables-v3.twig', { fields: field, block, blockClassName, is_preview }, with_context = false) %}
3
3
  {% set textEditorContainerClasses = include('components/text-editor-settings-container-classes-v3.twig', { fields: field, block, blockClassName, is_preview }, with_context = false) %}
4
4
  {% set textEditorElementClasses = include('components/text-editor-settings-element-classes-v3.twig', { fields: field, block, blockClassName, is_preview }, with_context = false) %}
@@ -16,7 +16,12 @@
16
16
  {% set videoDesktop = attribute(post, videoSelect) %}
17
17
 
18
18
  <div class="{{blockClassName}}__post-video-container {{blockClassName}}__info-item {{block.id}}" data-pattern-post-info="post_video" data-video-select={{videoSelect}}>
19
- <video class="{{blockClassName}}__post-video {{block.id}}" playsinline width="{{videoDesktop.width}}" height="{{videoDesktop.height}}" autoplay loop muted>
19
+ {# <video class="{{blockClassName}}__post-video {{block.id}}" playsinline width="{{videoDesktop.width}}" height="{{videoDesktop.height}}" autoplay loop muted>
20
20
  <source src="{{gt_video_mainsrc(videoDesktop['url'])}}" type="video/mp4">
21
- </video>
21
+ </video> #}
22
+ {# {% set videoDesktop = gt_video_mainsrc(videoDesktop['url']) %} #}
23
+
24
+ {% set videoData = { enable_video : true, video_type : 'upload', video_desktop : gt_video_mainsrc(videoDesktop['url']), autoplay : true, } %}
25
+
26
+ {{ include('components/video-component-v3.twig', { fields: videoData, block: block }, with_context = false) }}
22
27
  </div>
@@ -0,0 +1,33 @@
1
+ {% set gridLayoutElement = include('components/grid-layout-element-v3.twig', { fields: field, block: block }, with_context = false) %}
2
+ <style>
3
+ .{{blockClassName}}__social-networks.{{block.id}}, .{{blockClassName}}__content-container.{{block.id}}{
4
+ {{gridLayoutElement}}
5
+ }
6
+ </style>
7
+
8
+ <div class="{{blockClassName}}__content-container {{block.id}} {{blockClassName}}__info-item">
9
+ <div class="{{blockClassName}}__social-networks-inner-container">
10
+ {% if field.share_label is defined and field.share_label is not empty %}
11
+ <p class="{{blockClassName}}__social-networks-share-label">{{field.share_label}}</p>
12
+ {% endif %}
13
+ <div class="{{blockClassName}}__social-networks-links-container">
14
+ {% for social in options.social_networks.networks %}
15
+ {% if social.enabled %}
16
+ {% set image = options.cta_icons[social.social_network] %}
17
+
18
+ {% set isSVG = image.post_mime_type == 'image/svg+xml' %}
19
+
20
+ {% set target = social.social_link.target is not empty ? social.social_link.target : "_self" %}
21
+
22
+ <a class="{{blockClassName}}__social-networks-link-container" href="{{social.social_link.url}}" aria-label="social-network-link-{{social.social_network}}" target="{{target}}">
23
+ {% if isSVG and false %}
24
+ {{get_raw_svg(image.id)}}
25
+ {% else %}
26
+ <img class="{{blockClassName}}__social-networks-image style-svg" src="{{image.src}}" loading="lazy" width="30" height="30" alt="{{ image.alt }}">
27
+ {% endif %}
28
+ </a>
29
+ {% endif %}
30
+ {% endfor %}
31
+ </div>
32
+ </div>
33
+ </div>
@@ -0,0 +1,4 @@
1
+ @mixin additionalStyles {
2
+ .post-info-v3 {
3
+ }
4
+ }
@@ -188,4 +188,37 @@
188
188
  width: auto;
189
189
  @include grid-layout-element-v3.gridLayoutElement();
190
190
  }
191
+ &__social-networks-inner-container {
192
+ display: flex;
193
+ flex-direction: column;
194
+ gap: core-functions-v3.fluidSize(10);
195
+ @include core-mixins-v3.device(breakpoints.$tabLandscape) {
196
+ flex-direction: row;
197
+ gap: core-functions-v3.fluidSize(20);
198
+ }
199
+ }
200
+ &__social-networks-links-container {
201
+ display: flex;
202
+ gap: core-functions-v3.fluidSize(20);
203
+ }
204
+ &__social-networks-link-container {
205
+ img {
206
+ width: core-functions-v3.fluidSize(30);
207
+ height: core-functions-v3.fluidSize(30);
208
+ }
209
+ }
210
+ &__social-networks-share-label {
211
+ --default-font-weight: 700;
212
+ line-height: var(--paragraph-line-height);
213
+ letter-spacing: var(--paragraph-letter-spacing);
214
+ font-family: var(--paragraph-font-family);
215
+ font-weight: var(--default-font-weight);
216
+ font-size: core-functions-v3.fontSize(18, 'mobile');
217
+ @include core-mixins-v3.device(breakpoints.$tabPortrait) {
218
+ font-size: core-functions-v3.fontSize(18, 'portrait');
219
+ }
220
+ @include core-mixins-v3.device(breakpoints.$tabLandscape) {
221
+ font-size: core-functions-v3.fontSize(22, 'desktop');
222
+ }
223
+ }
191
224
  }
@@ -3,7 +3,7 @@
3
3
  {% set classNameEntryPoint = include('entry-points/entry-point-classes.twig', { fields, block }, with_context = false) %}
4
4
  {% set htmlEntryPoint = include('entry-points/entry-point-html-v3.twig', { fields, block, blockClassName, options, environment, is_preview, cta_styles, nav_menus }, with_context = false) %}
5
5
  {% set dataAttributeEntryPoint = include('entry-points/entry-point-data-attribute.twig', { fields, block }, with_context = false) %}
6
- {% set styleEntryPoint = include('entry-points/entry-point-style.twig', { fields, block, displaytype, is_preview }, with_context = false) %}
6
+ {% set styleEntryPoint = include('entry-points/entry-point-style-v3.twig', { fields, block, displaytype, is_preview }, with_context = false) %}
7
7
  {% set previewEntryPoint = include('entry-points/entry-point-preview-info.twig', { fields, block, displaytype, is_preview }, with_context = false) %}
8
8
 
9
9
  {% set layoutType = fields.layout_type|ru|default('grid') %}
@@ -6,14 +6,14 @@ export default function scrollingbannerv3Js(options = {}) {
6
6
  console.error(error);
7
7
  }
8
8
  }
9
- //import {resizeDebouncer} from '@pernod-ricard-global-cms/jsutils';
9
+
10
10
  const initializedBanners = new WeakMap(); // key = element, value = { animations } //cleaner way
11
11
  function scrollingbannerJs(block) {
12
12
  if (!block) {
13
13
  return;
14
14
  }
15
15
 
16
- const bannerElement = block.querySelector('.scrolling-banner');
16
+ const bannerElement = block.querySelector('.scrolling-banner-v3');
17
17
  if (!bannerElement) {
18
18
  return;
19
19
  }
@@ -27,7 +27,7 @@ function scrollingbannerJs(block) {
27
27
  // resize observer instead of resizeDebouncer because the later
28
28
  // caused the issue mentionned in MLDB-7
29
29
  const wrapper = bannerElement.querySelector(
30
- '.scrolling-banner__wrapper'
30
+ '.scrolling-banner-v3__wrapper'
31
31
  );
32
32
  if (wrapper) {
33
33
  if (window.ResizeObserver) {
@@ -55,12 +55,14 @@ function scrollingbannerJs(block) {
55
55
  // console.log('bannerInit');
56
56
 
57
57
  const container = bannerElement.querySelector(
58
- '.scrolling-banner__container'
58
+ '.scrolling-banner-v3__container'
59
59
  );
60
60
  const wrapper = bannerElement.querySelector(
61
- '.scrolling-banner__wrapper'
61
+ '.scrolling-banner-v3__wrapper'
62
+ );
63
+ const inner = bannerElement.querySelector(
64
+ '.scrolling-banner-v3__inner'
62
65
  );
63
- const inner = bannerElement.querySelector('.scrolling-banner__inner');
64
66
  const speed = bannerElement.dataset.speed ?? 5;
65
67
 
66
68
  const wrapperWidth = wrapper.clientWidth;
@@ -97,7 +99,7 @@ function scrollingbannerJs(block) {
97
99
  iterations: Infinity
98
100
  };
99
101
  const containers = bannerElement.querySelectorAll(
100
- '.scrolling-banner__container'
102
+ '.scrolling-banner-v3__container'
101
103
  );
102
104
 
103
105
  const anim1 = containers[0].animate(animation, timing);
@@ -118,12 +120,12 @@ function scrollingbannerJs(block) {
118
120
 
119
121
  bannerElement
120
122
  .querySelectorAll(
121
- '.scrolling-banner__container.clone, .scrolling-banner__inner.clone'
123
+ '.scrolling-banner-v3__container.clone, .scrolling-banner-v3__inner.clone'
122
124
  )
123
125
  .forEach((el) => el.remove());
124
126
 
125
127
  bannerElement
126
- .querySelector('.scrolling-banner__wrapper')
128
+ .querySelector('.scrolling-banner-v3__wrapper')
127
129
  .removeAttribute('style');
128
130
  }
129
131
  }
@@ -1,6 +1,5 @@
1
1
  {% set blockClassName = "scrolling-banner-v3" %}
2
2
  {% set classNameEntryPoint = include('entry-points/entry-point-classes.twig', { fields: fields, block: block }, with_context = false) %}
3
- {# {% set htmlEntryPoint = include('entry-points/entry-point-html-v3.twig', { fields: fields, block: block, blockClassName, blockClassName }, with_context = false) %} #}
4
3
  {% set dataAttributeEntryPoint = include('entry-points/entry-point-data-attribute.twig', { fields: fields, block: block }, with_context = false) %}
5
4
  {% set styleEntryPoint = include('entry-points/entry-point-style-v3.twig', { fields: fields, block: block, is_preview }, with_context = false) %}
6
5
  {% set previewEntryPoint = include('entry-points/entry-point-preview-info.twig', { fields, block, displaytype, is_preview }, with_context = false) %}
@@ -13,9 +12,8 @@
13
12
  {{sectionStyles}}
14
13
  }
15
14
  </style>
16
- <section {{block.anchor ? "id=" ~ block.anchor : ''}} class="{{blockClassName}} {{block.className}} {{classNameEntryPoint}} {{block.id}} lazy-fade" {{dataAttributeEntryPoint}} data-blockid="{{block.id}}" data-assetkey="{{blockClassName}}">
15
+ <section {{block.anchor ? "id=" ~ block.anchor : ''}} class="{{blockClassName}} {{classNameEntryPoint}} {{block.id}} lazy-fade" {{dataAttributeEntryPoint}} data-blockid="{{block.id}}" data-assetkey="{{blockClassName}}">
17
16
 
18
- {% set className = 'scrolling-banner' %}
19
17
  {% set bannerText = fields.scrolling_banner_text %}
20
18
  {% set enableScrolling = fields.enable_scrolling_banner %}
21
19
  {% set bannerSpeed = fields.scrolling_banner_speed %}
@@ -28,23 +26,19 @@
28
26
  {% set bannerTextStyles = textSizeDesktop ~ textSizePortrait ~ textSizeMobile ~ positioning ~ textColour %}
29
27
 
30
28
  {% if fields.enable_text_shadow %}
31
- {% set textShadowClassName = className ~ "--text-shadow" %}
29
+ {% set textShadowClassName = blockClassName ~ "--text-shadow" %}
32
30
  {% set textShadowStyle = "--text-shadow-offset-x:" ~ (fields.text_shadow_horizontal_offset|default(0)) ~ "; --text-shadow-offset-y: " ~ (fields.text_shadow_vertical_offset|default(0)) ~ "; --text-shadow-blur: " ~ (fields.text_shadow_blur|default(0)) ~ "; --text-shadow-colour: " ~ (fields.text_shadow_colour|default("#000000")) ~ ";" %}
33
31
  {% endif %}
34
-
35
32
  {% if enableScrolling %}
36
- <div class="{{className}}" data-speed="{{bannerSpeed}}" style="{{bannerTextStyles ~ textShadowStyle}}">
37
- <div class="{{className}}__wrapper">
38
- <div class="{{className}}__container">
39
- <div class="{{className}}__inner">
40
- <span class="{{className}}__separator"></span>
41
- <span class="{{className}}__text {{textShadowClassName}}">{{bannerText}}</span>
33
+ <div class="{{blockClassName}}" data-speed="{{bannerSpeed}}" style="{{bannerTextStyles ~ textShadowStyle}}">
34
+ <div class="{{blockClassName}}__wrapper">
35
+ <div class="{{blockClassName}}__container">
36
+ <div class="{{blockClassName}}__inner">
37
+ <span class="{{blockClassName}}__separator"></span>
38
+ <span class="{{blockClassName}}__text {{textShadowClassName}}">{{bannerText}}</span>
42
39
  </div>
43
40
  </div>
44
41
  </div>
45
42
  </div>
46
43
  {% endif %}
47
-
48
-
49
- {# {{htmlEntryPoint}} #}
50
44
  </section>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@total_onion/onion-library",
3
- "version": "2.0.33",
3
+ "version": "2.0.35",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "scripts": {