@total_onion/onion-library 1.0.52 → 1.0.54

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.
@@ -0,0 +1,6 @@
1
+ // @use 'Assets/scss/modules/library-modules/core-mixins/core-mixins';
2
+ // @use 'Assets/scss/modules/library-modules/core-functions/core-functions';
3
+ // @use 'Assets/scss/theme/breakpoints';
4
+ @mixin additionalStyles() {
5
+
6
+ }
@@ -0,0 +1,46 @@
1
+ export default function blockinteractionsv3Js(options = {}) {
2
+ try {
3
+ const { block } = options;
4
+
5
+ const blockId = block.dataset.blockid;
6
+ const parentBlockId = block.dataset.parentblockid;
7
+
8
+ const blockCloseButtons = block.querySelectorAll('.block-interactions-v3__block-close-button');
9
+ if (!blockCloseButtons.length) {
10
+ return;
11
+ }
12
+
13
+ blockCloseButtons.forEach(button => {
14
+ const shouldStoreCookie = button?.dataset?.storeCookie === 'true';
15
+ const cookieKey = `blockClosed_${parentBlockId}`;
16
+ const wrappingSection = document.querySelector(`[data-blockid="${parentBlockId}"]`);
17
+
18
+ if (getCookie(cookieKey) === 'true') {
19
+ wrappingSection.remove();
20
+ return;
21
+ }
22
+
23
+ button.addEventListener('click', () => {
24
+ wrappingSection.remove();
25
+ if (shouldStoreCookie) {
26
+ setCookie(cookieKey, 'true', 7);
27
+ }
28
+ });
29
+
30
+ });
31
+
32
+
33
+ function setCookie(name, value, days) {
34
+ const expires = new Date(Date.now() + days * 864e5).toUTCString();
35
+ document.cookie = `${name}=${encodeURIComponent(value)}; expires=${expires}; path=/`;
36
+ }
37
+ function getCookie(name) {
38
+ return document.cookie.split('; ').reduce((result, cookieString) => {
39
+ const [key, val] = cookieString.split('=');
40
+ return key === name ? decodeURIComponent(val) : result;
41
+ }, '');
42
+ }
43
+ } catch (error) {
44
+ console.error('Error in blockinteractionsv3Js:', error);
45
+ }
46
+ }
@@ -0,0 +1,14 @@
1
+ <?php
2
+
3
+ acf_register_block_type(
4
+ array(
5
+ 'name' => 'block-interactions-v3',
6
+ 'title' => __( 'Block Interactions v3', 'Global-theme Admin' ),
7
+ 'render_callback' => 'athena_block_render_post_object',
8
+ 'category' => 'common',
9
+ 'icon' => get_svg_icon_content('brick.svg'),
10
+ 'keywords' => array('content', 'text' ),
11
+ 'mode' => 'preview',
12
+ 'supports' => array( 'align' => false, 'anchor' => true ),
13
+ )
14
+ );
@@ -0,0 +1,25 @@
1
+ @use 'Assets/scss/modules/library-modules/core-mixins/core-mixins';
2
+ @use 'Assets/scss/modules/library-modules/core-functions/core-functions';
3
+ @use 'Assets/scss/theme/breakpoints';
4
+ @use 'Assets/scss/blocks/block-interactions-v3/block-interactions-v3-extra';
5
+ .block-interactions-v3 {
6
+ @include block-interactions-v3-extra.additionalStyles();
7
+
8
+ &__block-close-button {
9
+ cursor: pointer;
10
+ border: unset;
11
+ background: unset;
12
+ }
13
+ &__block-close-button-icon {
14
+ width: core-functions.fluidSize(20, 'mobile');
15
+ height: core-functions.fluidSize(20, 'mobile');
16
+ @include core-mixins.device(breakpoints.$tabPortrait) {
17
+ width: core-functions.fluidSize(30, 'portrait');
18
+ height: core-functions.fluidSize(30, 'portrait');
19
+ }
20
+ @include core-mixins.device(breakpoints.$tabLandscape) {
21
+ width: core-functions.fluidSize(40, 'desktop');
22
+ height: core-functions.fluidSize(40, 'desktop');
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,38 @@
1
+ {% set blockClassName = "block-interactions-v3" %}
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
+ {% set dataAttributeEntryPoint = include('entry-points/entry-point-data-attribute.twig', { fields: fields, block: block }, with_context = false) %}
5
+ {% set styleEntryPoint = include('entry-points/entry-point-style.twig', { fields: fields, block: block, is_preview }, with_context = false) %}
6
+ {% set previewEntryPoint = include('entry-points/entry-point-preview-info.twig', { fields, block, displaytype, is_preview }, with_context = false) %}
7
+ {% set sectionStyles = styleEntryPoint %}
8
+ {{previewEntryPoint}}
9
+ <style>
10
+ .{{blockClassName}}.{{block.id}}{
11
+ {{sectionStyles}}
12
+ }
13
+ </style>
14
+ <section {{block.anchor ? "id=" ~ block.anchor : ''}} class="{{blockClassName}} {{block.className}} {{classNameEntryPoint}} lazy-fade {{block.id}}" {{dataAttributeEntryPoint}} data-blockid="{{block.id}}" data-parentblockid="{{block.videoIdPrefix}}" data-assetkey="{{blockClassName}}">
15
+
16
+ {% set blockInteractionsEnabled = fields.enable_block_interactions %}
17
+ {% set enableInteractionsButton = fields.enable_interactions_button %}
18
+ {% set interactionsButtonType = fields.interactions_button_type %}
19
+
20
+ {% if blockInteractionsEnabled %}
21
+
22
+
23
+ {% if enableInteractionsButton %}
24
+ {% if (interactionsButtonType|ru == 'close-block') %}
25
+ {% set closeButtonIcon = get_image(fields.upload_close_icon) %}
26
+ {% set closeButtonCookie = fields.enable_closed_cookie %}
27
+
28
+ <button class="block-interactions-v3__block-close-button" data-store-cookie="{{closeButtonCookie ? 'true' : 'false' }}">
29
+ <img class="block-interactions-v3__block-close-button-icon" src="{{closeButtonIcon.src}}">
30
+ </button>
31
+ {% endif %}
32
+ {% endif %}
33
+
34
+
35
+ {% endif %}
36
+
37
+ {{htmlEntryPoint}}
38
+ </section>
@@ -0,0 +1,394 @@
1
+ {
2
+ "key": "group_687e1575ba23d",
3
+ "title": "Block: Block Interactions v3",
4
+ "fields": [
5
+ {
6
+ "key": "field_687e1c72b415e",
7
+ "label": "Grid Layout",
8
+ "name": "",
9
+ "aria-label": "",
10
+ "type": "tab",
11
+ "instructions": "",
12
+ "required": 0,
13
+ "conditional_logic": 0,
14
+ "wrapper": {
15
+ "width": "",
16
+ "class": "",
17
+ "id": ""
18
+ },
19
+ "wpml_cf_preferences": 1,
20
+ "placement": "top",
21
+ "endpoint": 0,
22
+ "no_preference": 0,
23
+ "selected": 0
24
+ },
25
+ {
26
+ "key": "field_687e1c8db415f",
27
+ "label": "Grid Layout",
28
+ "name": "grid_layout",
29
+ "aria-label": "",
30
+ "type": "clone",
31
+ "instructions": "",
32
+ "required": 0,
33
+ "conditional_logic": 0,
34
+ "wrapper": {
35
+ "width": "",
36
+ "class": "",
37
+ "id": ""
38
+ },
39
+ "wpml_cf_preferences": 1,
40
+ "clone": [
41
+ "group_6504a81a0623c"
42
+ ],
43
+ "display": "seamless",
44
+ "layout": "block",
45
+ "prefix_label": 0,
46
+ "prefix_name": 0,
47
+ "acfe_seamless_style": 0,
48
+ "acfe_clone_modal": 0,
49
+ "acfe_clone_modal_close": 0,
50
+ "acfe_clone_modal_button": "",
51
+ "acfe_clone_modal_size": "large"
52
+ },
53
+ {
54
+ "key": "field_687e18f8855d0",
55
+ "label": "Content",
56
+ "name": "",
57
+ "aria-label": "",
58
+ "type": "tab",
59
+ "instructions": "",
60
+ "required": 0,
61
+ "conditional_logic": 0,
62
+ "wrapper": {
63
+ "width": "",
64
+ "class": "",
65
+ "id": ""
66
+ },
67
+ "wpml_cf_preferences": 1,
68
+ "placement": "top",
69
+ "endpoint": 0,
70
+ "no_preference": 0,
71
+ "selected": 0
72
+ },
73
+ {
74
+ "key": "field_687e1578d6b61",
75
+ "label": "Enable Block Interactions",
76
+ "name": "enable_block_interactions",
77
+ "aria-label": "",
78
+ "type": "true_false",
79
+ "instructions": "",
80
+ "required": 0,
81
+ "conditional_logic": 0,
82
+ "wrapper": {
83
+ "width": "",
84
+ "class": "",
85
+ "id": ""
86
+ },
87
+ "wpml_cf_preferences": 1,
88
+ "message": "",
89
+ "default_value": 0,
90
+ "style": "",
91
+ "ui_on_text": "",
92
+ "ui_off_text": "",
93
+ "ui": 1
94
+ },
95
+ {
96
+ "key": "field_687e20dd7da49",
97
+ "label": "Enable Interactions Button",
98
+ "name": "enable_interactions_button",
99
+ "aria-label": "",
100
+ "type": "true_false",
101
+ "instructions": "",
102
+ "required": 0,
103
+ "conditional_logic": [
104
+ [
105
+ {
106
+ "field": "field_687e1578d6b61",
107
+ "operator": "==",
108
+ "value": "1"
109
+ }
110
+ ]
111
+ ],
112
+ "wrapper": {
113
+ "width": "",
114
+ "class": "",
115
+ "id": ""
116
+ },
117
+ "wpml_cf_preferences": 1,
118
+ "message": "",
119
+ "default_value": 0,
120
+ "ui_on_text": "",
121
+ "ui_off_text": "",
122
+ "ui": 1,
123
+ "style": ""
124
+ },
125
+ {
126
+ "key": "field_687e4099485e5",
127
+ "label": "Interactions Button Type",
128
+ "name": "interactions_button_type",
129
+ "aria-label": "",
130
+ "type": "select",
131
+ "instructions": "",
132
+ "required": 0,
133
+ "conditional_logic": [
134
+ [
135
+ {
136
+ "field": "field_687e20dd7da49",
137
+ "operator": "==",
138
+ "value": "1"
139
+ }
140
+ ]
141
+ ],
142
+ "wrapper": {
143
+ "width": "",
144
+ "class": "",
145
+ "id": ""
146
+ },
147
+ "wpml_cf_preferences": 1,
148
+ "choices": {
149
+ "__close-block": "Close Block"
150
+ },
151
+ "default_value": false,
152
+ "return_format": "value",
153
+ "multiple": 0,
154
+ "max": "",
155
+ "allow_custom": 0,
156
+ "placeholder": "",
157
+ "search_placeholder": "",
158
+ "prepend": "",
159
+ "append": "",
160
+ "allow_null": 0,
161
+ "ui": 0,
162
+ "ajax": 0,
163
+ "min": ""
164
+ },
165
+ {
166
+ "key": "field_687e40dc485e6",
167
+ "label": "Upload Close Icon",
168
+ "name": "upload_close_icon",
169
+ "aria-label": "",
170
+ "type": "image",
171
+ "instructions": "",
172
+ "required": 0,
173
+ "conditional_logic": [
174
+ [
175
+ {
176
+ "field": "field_687e4099485e5",
177
+ "operator": "==",
178
+ "value": "__close-block"
179
+ }
180
+ ]
181
+ ],
182
+ "wrapper": {
183
+ "width": "",
184
+ "class": "",
185
+ "id": ""
186
+ },
187
+ "wpml_cf_preferences": 1,
188
+ "uploader": "",
189
+ "return_format": "array",
190
+ "library": "all",
191
+ "upload_folder": "",
192
+ "acfe_thumbnail": 0,
193
+ "min_width": "",
194
+ "min_height": "",
195
+ "min_size": "",
196
+ "max_width": "",
197
+ "max_height": "",
198
+ "max_size": "",
199
+ "mime_types": "",
200
+ "preview_size": "medium"
201
+ },
202
+ {
203
+ "key": "field_687e20d17da48",
204
+ "label": "Enable Closed Cookie",
205
+ "name": "enable_closed_cookie",
206
+ "aria-label": "",
207
+ "type": "true_false",
208
+ "instructions": "",
209
+ "required": 0,
210
+ "conditional_logic": [
211
+ [
212
+ {
213
+ "field": "field_687e4099485e5",
214
+ "operator": "==",
215
+ "value": "__close-block"
216
+ }
217
+ ]
218
+ ],
219
+ "wrapper": {
220
+ "width": "",
221
+ "class": "",
222
+ "id": ""
223
+ },
224
+ "wpml_cf_preferences": 1,
225
+ "message": "",
226
+ "default_value": 0,
227
+ "ui_on_text": "",
228
+ "ui_off_text": "",
229
+ "ui": 1,
230
+ "style": ""
231
+ },
232
+ {
233
+ "key": "field_687e48d871084",
234
+ "label": "Block Padding",
235
+ "name": "",
236
+ "aria-label": "",
237
+ "type": "tab",
238
+ "instructions": "",
239
+ "required": 0,
240
+ "conditional_logic": 0,
241
+ "wrapper": {
242
+ "width": "",
243
+ "class": "",
244
+ "id": ""
245
+ },
246
+ "wpml_cf_preferences": 1,
247
+ "placement": "top",
248
+ "endpoint": 0,
249
+ "no_preference": 0,
250
+ "selected": 0
251
+ },
252
+ {
253
+ "key": "field_687e48e571085",
254
+ "label": "Block Padding",
255
+ "name": "block_padding",
256
+ "aria-label": "",
257
+ "type": "clone",
258
+ "instructions": "",
259
+ "required": 0,
260
+ "conditional_logic": 0,
261
+ "wrapper": {
262
+ "width": "",
263
+ "class": "",
264
+ "id": ""
265
+ },
266
+ "wpml_cf_preferences": 1,
267
+ "clone": [
268
+ "group_638f4148bc10b"
269
+ ],
270
+ "display": "seamless",
271
+ "layout": "block",
272
+ "prefix_label": 0,
273
+ "prefix_name": 0,
274
+ "acfe_seamless_style": 0,
275
+ "acfe_clone_modal": 0,
276
+ "acfe_clone_modal_close": 0,
277
+ "acfe_clone_modal_button": "",
278
+ "acfe_clone_modal_size": "large"
279
+ },
280
+ {
281
+ "key": "field_687e19becafaf",
282
+ "label": "Block Settings",
283
+ "name": "",
284
+ "aria-label": "",
285
+ "type": "tab",
286
+ "instructions": "",
287
+ "required": 0,
288
+ "conditional_logic": 0,
289
+ "wrapper": {
290
+ "width": "",
291
+ "class": "",
292
+ "id": ""
293
+ },
294
+ "wpml_cf_preferences": 1,
295
+ "placement": "top",
296
+ "endpoint": 0,
297
+ "no_preference": 0,
298
+ "selected": 0
299
+ },
300
+ {
301
+ "key": "field_687e1d8271485",
302
+ "label": "Block",
303
+ "name": "",
304
+ "aria-label": "",
305
+ "type": "accordion",
306
+ "instructions": "",
307
+ "required": 0,
308
+ "conditional_logic": 0,
309
+ "wrapper": {
310
+ "width": "",
311
+ "class": "",
312
+ "id": ""
313
+ },
314
+ "wpml_cf_preferences": 1,
315
+ "open": 0,
316
+ "multi_expand": 0,
317
+ "endpoint": 0
318
+ },
319
+ {
320
+ "key": "field_687e191c855d2",
321
+ "label": "Block Settings",
322
+ "name": "block_settings",
323
+ "aria-label": "",
324
+ "type": "clone",
325
+ "instructions": "",
326
+ "required": 0,
327
+ "conditional_logic": 0,
328
+ "wrapper": {
329
+ "width": "",
330
+ "class": "",
331
+ "id": ""
332
+ },
333
+ "wpml_cf_preferences": 1,
334
+ "clone": [
335
+ "group_65a45ada4e128"
336
+ ],
337
+ "display": "seamless",
338
+ "layout": "block",
339
+ "prefix_label": 0,
340
+ "prefix_name": 0,
341
+ "acfe_seamless_style": 0,
342
+ "acfe_clone_modal": 0,
343
+ "acfe_clone_modal_close": 0,
344
+ "acfe_clone_modal_button": "",
345
+ "acfe_clone_modal_size": "large"
346
+ },
347
+ {
348
+ "key": "field_687e1d9071486",
349
+ "label": "Block END",
350
+ "name": "",
351
+ "aria-label": "",
352
+ "type": "accordion",
353
+ "instructions": "",
354
+ "required": 0,
355
+ "conditional_logic": 0,
356
+ "wrapper": {
357
+ "width": "",
358
+ "class": "",
359
+ "id": ""
360
+ },
361
+ "wpml_cf_preferences": 1,
362
+ "open": 0,
363
+ "multi_expand": 0,
364
+ "endpoint": 1
365
+ }
366
+ ],
367
+ "location": [
368
+ [
369
+ {
370
+ "param": "block",
371
+ "operator": "==",
372
+ "value": "acf\/block-interactions-v3"
373
+ }
374
+ ]
375
+ ],
376
+ "menu_order": 0,
377
+ "position": "normal",
378
+ "style": "default",
379
+ "label_placement": "left",
380
+ "instruction_placement": "label",
381
+ "hide_on_screen": "",
382
+ "active": false,
383
+ "description": "",
384
+ "show_in_rest": 0,
385
+ "acfe_autosync": [
386
+ "json"
387
+ ],
388
+ "acfml_field_group_mode": "translation",
389
+ "acfe_form": 0,
390
+ "acfe_display_title": "",
391
+ "acfe_meta": "",
392
+ "acfe_note": "",
393
+ "modified": 1753106703
394
+ }
@@ -1817,6 +1817,103 @@
1817
1817
  "acfe_flexible_category": false,
1818
1818
  "acfe_layout_col": "auto",
1819
1819
  "acfe_layout_allowed_col": false
1820
+ },
1821
+ "layout_687e31ec45b21": {
1822
+ "key": "layout_687e31ec45b21",
1823
+ "name": "block_interactions_v3",
1824
+ "label": "Block Interactions V3",
1825
+ "display": "block",
1826
+ "sub_fields": [
1827
+ {
1828
+ "key": "field_687e4a5c9cf90",
1829
+ "label": "Grid Layout",
1830
+ "name": "",
1831
+ "aria-label": "",
1832
+ "type": "tab",
1833
+ "instructions": "",
1834
+ "required": 0,
1835
+ "conditional_logic": 0,
1836
+ "wrapper": {
1837
+ "width": "",
1838
+ "class": "",
1839
+ "id": ""
1840
+ },
1841
+ "wpml_cf_preferences": 3,
1842
+ "placement": "top",
1843
+ "endpoint": 0,
1844
+ "no_preference": 0,
1845
+ "selected": 0
1846
+ },
1847
+ {
1848
+ "key": "field_687e4a719cf91",
1849
+ "label": "grid layout",
1850
+ "name": "grid_layout",
1851
+ "aria-label": "",
1852
+ "type": "clone",
1853
+ "instructions": "",
1854
+ "required": 0,
1855
+ "conditional_logic": 0,
1856
+ "wrapper": {
1857
+ "width": "",
1858
+ "class": "",
1859
+ "id": ""
1860
+ },
1861
+ "wpml_cf_preferences": 3,
1862
+ "clone": [
1863
+ "group_6504a81a0623c"
1864
+ ],
1865
+ "display": "seamless",
1866
+ "layout": "",
1867
+ "prefix_label": 0,
1868
+ "prefix_name": 0,
1869
+ "acfe_seamless_style": 0,
1870
+ "acfe_clone_modal": 0,
1871
+ "acfe_clone_modal_close": 0,
1872
+ "acfe_clone_modal_button": "",
1873
+ "acfe_clone_modal_size": "large"
1874
+ },
1875
+ {
1876
+ "key": "field_687e31f545b25",
1877
+ "label": "Block Interactions",
1878
+ "name": "block_interactions",
1879
+ "aria-label": "",
1880
+ "type": "clone",
1881
+ "instructions": "",
1882
+ "required": 0,
1883
+ "conditional_logic": 0,
1884
+ "wrapper": {
1885
+ "width": "",
1886
+ "class": "",
1887
+ "id": ""
1888
+ },
1889
+ "wpml_cf_preferences": 3,
1890
+ "clone": [
1891
+ "group_687e1575ba23d"
1892
+ ],
1893
+ "display": "seamless",
1894
+ "layout": "block",
1895
+ "prefix_label": 0,
1896
+ "prefix_name": 0,
1897
+ "acfe_seamless_style": 0,
1898
+ "acfe_clone_modal": 0,
1899
+ "acfe_clone_modal_close": 0,
1900
+ "acfe_clone_modal_button": "",
1901
+ "acfe_clone_modal_size": "large"
1902
+ }
1903
+ ],
1904
+ "min": "",
1905
+ "max": "",
1906
+ "acfe_flexible_render_template": false,
1907
+ "acfe_flexible_render_style": false,
1908
+ "acfe_flexible_render_script": false,
1909
+ "acfe_flexible_thumbnail": false,
1910
+ "acfe_flexible_settings": false,
1911
+ "acfe_flexible_settings_size": "medium",
1912
+ "acfe_layout_locations": [],
1913
+ "acfe_flexible_modal_edit_size": false,
1914
+ "acfe_flexible_category": false,
1915
+ "acfe_layout_col": "auto",
1916
+ "acfe_layout_allowed_col": false
1820
1917
  }
1821
1918
  },
1822
1919
  "min": "",
@@ -2189,5 +2286,5 @@
2189
2286
  "acfe_display_title": "",
2190
2287
  "acfe_meta": "",
2191
2288
  "acfe_note": "",
2192
- "modified": 1753104712
2289
+ "modified": 1753107190
2193
2290
  }
@@ -0,0 +1,42 @@
1
+ @use 'Assets/scss/theme/breakpoints';
2
+ @use 'Assets/scss/modules/library-modules/core-mixins/core-mixins';
3
+ @use 'Assets/scss/modules/library-modules/core-functions/core-functions';
4
+
5
+ @mixin blockSettings() {
6
+ .cmpl-block-settings {
7
+ min-height: core-functions.fluidSize(
8
+ var(--block-min-height-mobile),
9
+ 'mobile'
10
+ );
11
+ overflow: var(--block-overflow, hidden);
12
+ border-radius: var(--block-border-radius);
13
+ place-items: center;
14
+ position: var(--block-position-type, relative);
15
+ z-index: var(--block-z-index);
16
+ top: var(--block-position-top);
17
+ right: var(--block-position-right);
18
+ bottom: var(--block-position-bottom);
19
+ left: var(--block-position-left);
20
+ background-color: var(--block-background-colour);
21
+ pointer-events: var(--block-pointer-events);
22
+ aspect-ratio: var(--block-aspect-ratio-mobile);
23
+ .wp-admin & {
24
+ position: relative;
25
+ }
26
+
27
+ @include core-mixins.device(breakpoints.$tabPortrait) {
28
+ aspect-ratio: var(--block-aspect-ratio-portrait);
29
+ min-height: core-functions.fluidSize(
30
+ var(--block-min-height-portrait),
31
+ 'portrait'
32
+ );
33
+ }
34
+ @include core-mixins.device(breakpoints.$tabLandscape) {
35
+ aspect-ratio: var(--block-aspect-ratio);
36
+ min-height: core-functions.fluidSize(
37
+ var(--block-min-height-desktop),
38
+ 'landscape'
39
+ );
40
+ }
41
+ }
42
+ }