@total_onion/onion-library 2.0.129 → 2.0.131

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,12 @@
1
+ // LIBRARY FILE - Do not modify/override here as your changes will be lost when the package is updated.
2
+ export default function backtotopbuttonJs(options = {}) {
3
+ try {
4
+ const {block} = options;
5
+ const button = block.querySelector('.back-to-top-button__button');
6
+ button.addEventListener('click', () =>
7
+ window.scrollTo({top: 0, behavior: 'smooth'})
8
+ );
9
+ } catch (error) {
10
+ console.error(error);
11
+ }
12
+ }
@@ -0,0 +1,67 @@
1
+ @use 'NodeModules/@total_onion/onion-library/components/fields-core-mixins-v3/core-mixins-v3';
2
+ @use 'NodeModules/@total_onion/onion-library/components/fields-core-functions-v3/core-functions-v3';
3
+ @use 'NodeModules/@total_onion/onion-library/breakpoints';
4
+
5
+ .back-to-top-button {
6
+ position: relative;
7
+ width: 100%;
8
+ z-index: 50;
9
+ overflow: unset;
10
+
11
+ &__arrow {
12
+ --arrow-colour: black;
13
+ position: absolute;
14
+ border-style: solid;
15
+ border-color: var(--arrow-colour);
16
+ border-width: 0 2px 2px 0;
17
+ display: inline-block;
18
+ transform: rotate(-135deg);
19
+ height: 20%;
20
+ width: 20%;
21
+ }
22
+
23
+ &__button {
24
+ --bg-colour: white;
25
+ display: flex;
26
+ justify-content: center;
27
+ align-items: center;
28
+ position: fixed;
29
+ cursor: pointer;
30
+ height: core-functions-v3.fluidSize(50, 'static');
31
+ width: core-functions-v3.fluidSize(50, 'static');
32
+ border: none;
33
+ border-radius: 50px;
34
+ padding: core-functions-v3.fluidSize(18, 'static');
35
+ background-color: var(--bg-colour);
36
+ right: core-functions-v3.fluidSize(10, 'mobile');
37
+ border-radius: var(--button-border-radius);
38
+
39
+ @include core-mixins-v3.device(breakpoints.$tabPortrait) {
40
+ right: core-functions-v3.fluidSize(30, 'portrait');
41
+ }
42
+
43
+ @include core-mixins-v3.device(breakpoints.$tabLandscape) {
44
+ right: core-functions-v3.fluidSize(60, 'desktop');
45
+ }
46
+
47
+ &--fixed {
48
+ position: fixed;
49
+ bottom: core-functions-v3.fluidSize(60, 'static');
50
+ }
51
+
52
+ &--absolute {
53
+ position: absolute;
54
+ translate: 0 -50%;
55
+ }
56
+
57
+ .wp-admin & {
58
+ position: absolute;
59
+ translate: 0 0;
60
+ bottom: 0;
61
+ }
62
+ }
63
+
64
+ &__image {
65
+ width: core-functions-v3.fluidSize(var(--image-size), 'static');
66
+ }
67
+ }
@@ -0,0 +1,37 @@
1
+ {# Do not edit this file outside of the component library as your changes will be lost with future updates. #}
2
+ {% set blockClassName = "back-to-top-button" %}
3
+ {% set classNameEntryPoint = include('entry-points/entry-point-classes.twig', { fields, block }, with_context = false) %}
4
+ {% set htmlEntryPoint = include('entry-points/entry-point-html.twig', { fields, block, blockClassName, options, environment, is_preview, nav_menus }, with_context = false) %}
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) %}
7
+ {% set previewEntryPoint = include('entry-points/entry-point-preview-info.twig', { fields, block, displaytype, is_preview }, with_context = false) %}
8
+
9
+
10
+ {% set buttonBorderRadius = '--button-border-radius: ' ~ fields.btt_border_radius ~ ';' %}
11
+ {% set imageSize = '--image-size: ' ~ fields.image_size ~ ';' %}
12
+
13
+ {% set buttonImage = get_image(fields.btt_image) %}
14
+ {% set enabled = fields.enable_btt_button %}
15
+ {% set bgColour = fields.btt_background_colour %}
16
+ {% set arrowColour = fields.btt_arrow_colour %}
17
+ {% set position = fields.btt_position|ru %}
18
+
19
+ {% set sectionStyles = styleEntryPoint ~ buttonBorderRadius ~ imageSize %}
20
+ <style>
21
+ .{{blockClassName}}.{{block.id}}{
22
+ {{sectionStyles}}
23
+ }
24
+ </style>
25
+
26
+ {% if enabled %}
27
+ <section {{block.anchor ? "id=" ~ block.anchor : ''}} class="back-to-top-button {{blockClassName}} {{block.className}} {{classNameEntryPoint}} lazy-fade {{block.id}}" {{dataAttributeEntryPoint}} data-assetkey="back-to-top-button">
28
+ <button aria-label="back to the top button" class="back-to-top-button__button back-to-top-button__button--{{position}}" style="--bg-colour: {{bgColour}}">
29
+ {% if fields.enable_custom_image %}
30
+ <img class="back-to-top-button__image" width="{{buttonImage.width}}" height="{{buttonImage.height}}" src="{{ buttonImage.src }}" alt="{{buttonImage.alt}}">
31
+ {% else %}
32
+ <span class="back-to-top-button__arrow" style="--arrow-colour: {{arrowColour}}"></span>
33
+ {% endif %}
34
+ </button>
35
+ {{htmlEntryPoint}}
36
+ </section>
37
+ {% endif %}
@@ -0,0 +1,323 @@
1
+ {
2
+ "key": "group_63e24e04a1e61",
3
+ "title": "Block: Back To Top Button v3",
4
+ "fields": [
5
+ {
6
+ "key": "field_63e24e0734d7c",
7
+ "label": "Enable Back To Top Button",
8
+ "name": "enable_btt_button",
9
+ "aria-label": "",
10
+ "type": "true_false",
11
+ "instructions": "",
12
+ "required": 0,
13
+ "conditional_logic": 0,
14
+ "wrapper": {
15
+ "width": "",
16
+ "class": "",
17
+ "id": ""
18
+ },
19
+ "wpml_cf_preferences": 3,
20
+ "message": "",
21
+ "default_value": 0,
22
+ "ui_on_text": "",
23
+ "ui_off_text": "",
24
+ "ui": 1,
25
+ "style": ""
26
+ },
27
+ {
28
+ "key": "field_63e2505208af7",
29
+ "label": "Background Colour",
30
+ "name": "btt_background_colour",
31
+ "aria-label": "",
32
+ "type": "color_picker",
33
+ "instructions": "",
34
+ "required": 0,
35
+ "conditional_logic": [
36
+ [
37
+ {
38
+ "field": "field_63e24e0734d7c",
39
+ "operator": "==",
40
+ "value": "1"
41
+ }
42
+ ]
43
+ ],
44
+ "wrapper": {
45
+ "width": "",
46
+ "class": "",
47
+ "id": ""
48
+ },
49
+ "wpml_cf_preferences": 3,
50
+ "default_value": "",
51
+ "enable_opacity": 0,
52
+ "return_format": "string",
53
+ "display": "default",
54
+ "button_label": "Select Color",
55
+ "color_picker": true,
56
+ "absolute": false,
57
+ "input": true,
58
+ "allow_null": true,
59
+ "theme_colors": false,
60
+ "colors": [],
61
+ "custom_palette_source": "",
62
+ "palette_colors": "",
63
+ "show_color_wheel": true
64
+ },
65
+ {
66
+ "key": "field_63e3cd0cddfce",
67
+ "label": "Arrow Colour",
68
+ "name": "btt_arrow_colour",
69
+ "aria-label": "",
70
+ "type": "color_picker",
71
+ "instructions": "",
72
+ "required": 0,
73
+ "conditional_logic": [
74
+ [
75
+ {
76
+ "field": "field_63e24e0734d7c",
77
+ "operator": "==",
78
+ "value": "1"
79
+ },
80
+ {
81
+ "field": "field_651bfc5788b2f",
82
+ "operator": "!=",
83
+ "value": "1"
84
+ }
85
+ ]
86
+ ],
87
+ "wrapper": {
88
+ "width": "",
89
+ "class": "",
90
+ "id": ""
91
+ },
92
+ "wpml_cf_preferences": 3,
93
+ "user_roles": [
94
+ "all"
95
+ ],
96
+ "default_value": "",
97
+ "enable_opacity": 0,
98
+ "return_format": "string",
99
+ "display": "default",
100
+ "button_label": "Select Color",
101
+ "color_picker": true,
102
+ "absolute": false,
103
+ "input": true,
104
+ "allow_null": true,
105
+ "theme_colors": false,
106
+ "colors": [],
107
+ "custom_palette_source": "",
108
+ "palette_colors": "",
109
+ "show_color_wheel": true
110
+ },
111
+ {
112
+ "key": "field_63e29a05da971",
113
+ "label": "Position",
114
+ "name": "btt_position",
115
+ "aria-label": "",
116
+ "type": "select",
117
+ "instructions": "",
118
+ "required": 0,
119
+ "conditional_logic": [
120
+ [
121
+ {
122
+ "field": "field_63e24e0734d7c",
123
+ "operator": "==",
124
+ "value": "1"
125
+ }
126
+ ]
127
+ ],
128
+ "wrapper": {
129
+ "width": "",
130
+ "class": "",
131
+ "id": ""
132
+ },
133
+ "wpml_cf_preferences": 3,
134
+ "user_roles": [
135
+ "all"
136
+ ],
137
+ "choices": {
138
+ "__absolute": "Absolute",
139
+ "__fixed": "Fixed"
140
+ },
141
+ "default_value": false,
142
+ "return_format": "value",
143
+ "multiple": 0,
144
+ "allow_null": 0,
145
+ "ui": 0,
146
+ "ajax": 0,
147
+ "placeholder": "",
148
+ "allow_custom": 0,
149
+ "search_placeholder": "",
150
+ "prepend": "",
151
+ "append": "",
152
+ "min": "",
153
+ "max": "",
154
+ "create_options": 0,
155
+ "save_options": 0
156
+ },
157
+ {
158
+ "key": "field_651bf7e10a797",
159
+ "label": "Button Border Radius",
160
+ "name": "btt_border_radius",
161
+ "aria-label": "",
162
+ "type": "text",
163
+ "instructions": "",
164
+ "required": 0,
165
+ "conditional_logic": [
166
+ [
167
+ {
168
+ "field": "field_63e24e0734d7c",
169
+ "operator": "==",
170
+ "value": "1"
171
+ }
172
+ ]
173
+ ],
174
+ "wrapper": {
175
+ "width": "",
176
+ "class": "",
177
+ "id": ""
178
+ },
179
+ "wpml_cf_preferences": 2,
180
+ "user_roles": [
181
+ "all"
182
+ ],
183
+ "default_value": "0px",
184
+ "maxlength": "",
185
+ "placeholder": "",
186
+ "prepend": "",
187
+ "append": ""
188
+ },
189
+ {
190
+ "key": "field_651bfc5788b2f",
191
+ "label": "Enable Custom Image",
192
+ "name": "enable_custom_image",
193
+ "aria-label": "",
194
+ "type": "true_false",
195
+ "instructions": "",
196
+ "required": 0,
197
+ "conditional_logic": [
198
+ [
199
+ {
200
+ "field": "field_63e24e0734d7c",
201
+ "operator": "==",
202
+ "value": "1"
203
+ }
204
+ ]
205
+ ],
206
+ "wrapper": {
207
+ "width": "",
208
+ "class": "",
209
+ "id": ""
210
+ },
211
+ "wpml_cf_preferences": 3,
212
+ "user_roles": [
213
+ "all"
214
+ ],
215
+ "message": "",
216
+ "default_value": 0,
217
+ "ui_on_text": "",
218
+ "ui_off_text": "",
219
+ "ui": 1,
220
+ "style": ""
221
+ },
222
+ {
223
+ "key": "field_651c00fe13e1f",
224
+ "label": "Button Image",
225
+ "name": "btt_image",
226
+ "aria-label": "",
227
+ "type": "image",
228
+ "instructions": "",
229
+ "required": 0,
230
+ "conditional_logic": [
231
+ [
232
+ {
233
+ "field": "field_651bfc5788b2f",
234
+ "operator": "==",
235
+ "value": "1"
236
+ }
237
+ ]
238
+ ],
239
+ "wrapper": {
240
+ "width": "",
241
+ "class": "",
242
+ "id": ""
243
+ },
244
+ "wpml_cf_preferences": 3,
245
+ "user_roles": [
246
+ "all"
247
+ ],
248
+ "return_format": "array",
249
+ "library": "all",
250
+ "min_width": "",
251
+ "min_height": "",
252
+ "min_size": "",
253
+ "max_width": "",
254
+ "max_height": "",
255
+ "max_size": "",
256
+ "mime_types": "",
257
+ "preview_size": "medium",
258
+ "uploader": "",
259
+ "acfe_thumbnail": 0,
260
+ "upload_folder": ""
261
+ },
262
+ {
263
+ "key": "field_65251a3817f08",
264
+ "label": "Image Size",
265
+ "name": "image_size",
266
+ "aria-label": "",
267
+ "type": "range",
268
+ "instructions": "",
269
+ "required": 0,
270
+ "conditional_logic": [
271
+ [
272
+ {
273
+ "field": "field_651bfc5788b2f",
274
+ "operator": "==",
275
+ "value": "1"
276
+ }
277
+ ]
278
+ ],
279
+ "wrapper": {
280
+ "width": "",
281
+ "class": "",
282
+ "id": ""
283
+ },
284
+ "wpml_cf_preferences": 3,
285
+ "user_roles": [
286
+ "all"
287
+ ],
288
+ "default_value": 30,
289
+ "min": 0,
290
+ "max": 50,
291
+ "step": "",
292
+ "prepend": "",
293
+ "append": ""
294
+ }
295
+ ],
296
+ "location": [
297
+ [
298
+ {
299
+ "param": "block",
300
+ "operator": "==",
301
+ "value": "all"
302
+ }
303
+ ]
304
+ ],
305
+ "menu_order": 0,
306
+ "position": "normal",
307
+ "style": "default",
308
+ "label_placement": "top",
309
+ "instruction_placement": "label",
310
+ "hide_on_screen": "",
311
+ "active": false,
312
+ "description": "Library version - Do not modify in this project as any changes will be overwritten by future updates.",
313
+ "show_in_rest": 0,
314
+ "display_title": "",
315
+ "acfe_autosync": [
316
+ "json"
317
+ ],
318
+ "acfe_form": 0,
319
+ "acfe_display_title": "",
320
+ "acfe_meta": "",
321
+ "acfe_note": "",
322
+ "modified": 1762954117
323
+ }
@@ -1301,7 +1301,7 @@
1301
1301
  {
1302
1302
  "key": "field_68719944c8675",
1303
1303
  "label": "grid layout",
1304
- "name": "grid_layout_copy",
1304
+ "name": "grid_layout_fields",
1305
1305
  "aria-label": "",
1306
1306
  "type": "clone",
1307
1307
  "instructions": "",
@@ -1312,12 +1312,11 @@
1312
1312
  "class": "",
1313
1313
  "id": ""
1314
1314
  },
1315
- "wpml_cf_preferences": 3,
1316
1315
  "clone": [
1317
1316
  "group_68822860bda9f"
1318
1317
  ],
1319
1318
  "display": "seamless",
1320
- "layout": "block",
1319
+ "layout": "",
1321
1320
  "prefix_label": 0,
1322
1321
  "prefix_name": 0,
1323
1322
  "acfe_seamless_style": 0,
@@ -1340,9 +1339,102 @@
1340
1339
  "class": "",
1341
1340
  "id": ""
1342
1341
  },
1343
- "wpml_cf_preferences": 3,
1344
1342
  "clone": [
1345
- "group_65ca55f45368c"
1343
+ "group_687192c28b7eb"
1344
+ ],
1345
+ "display": "seamless",
1346
+ "layout": "",
1347
+ "prefix_label": 0,
1348
+ "prefix_name": 0,
1349
+ "acfe_seamless_style": 0,
1350
+ "acfe_clone_modal": 0,
1351
+ "acfe_clone_modal_close": 0,
1352
+ "acfe_clone_modal_button": "",
1353
+ "acfe_clone_modal_size": "large"
1354
+ }
1355
+ ],
1356
+ "min": "",
1357
+ "max": "",
1358
+ "acfe_flexible_render_template": false,
1359
+ "acfe_flexible_render_style": false,
1360
+ "acfe_flexible_render_script": false,
1361
+ "acfe_flexible_thumbnail": false,
1362
+ "acfe_flexible_settings": false,
1363
+ "acfe_flexible_settings_size": "medium",
1364
+ "acfe_layout_locations": [],
1365
+ "acfe_flexible_modal_edit_size": false,
1366
+ "acfe_flexible_category": false,
1367
+ "acfe_layout_col": "auto",
1368
+ "acfe_layout_allowed_col": false
1369
+ },
1370
+ "layout_69148c091a90e": {
1371
+ "key": "layout_69148c091a90e",
1372
+ "name": "back_to_top_button_v3",
1373
+ "label": "Back to top button v3",
1374
+ "display": "block",
1375
+ "sub_fields": [
1376
+ {
1377
+ "key": "field_69148c091a911",
1378
+ "label": "Grid Layout",
1379
+ "name": "",
1380
+ "aria-label": "",
1381
+ "type": "tab",
1382
+ "instructions": "",
1383
+ "required": 0,
1384
+ "conditional_logic": 0,
1385
+ "wrapper": {
1386
+ "width": "",
1387
+ "class": "",
1388
+ "id": ""
1389
+ },
1390
+ "placement": "top",
1391
+ "endpoint": 0,
1392
+ "no_preference": 0,
1393
+ "selected": 0
1394
+ },
1395
+ {
1396
+ "key": "field_69148c091a912",
1397
+ "label": "grid layout",
1398
+ "name": "grid_layout_fields",
1399
+ "aria-label": "",
1400
+ "type": "clone",
1401
+ "instructions": "",
1402
+ "required": 0,
1403
+ "conditional_logic": 0,
1404
+ "wrapper": {
1405
+ "width": "",
1406
+ "class": "",
1407
+ "id": ""
1408
+ },
1409
+ "clone": [
1410
+ "group_68822860bda9f"
1411
+ ],
1412
+ "display": "seamless",
1413
+ "layout": "block",
1414
+ "prefix_label": 0,
1415
+ "prefix_name": 0,
1416
+ "acfe_seamless_style": 0,
1417
+ "acfe_clone_modal": 0,
1418
+ "acfe_clone_modal_close": 0,
1419
+ "acfe_clone_modal_button": "",
1420
+ "acfe_clone_modal_size": "large"
1421
+ },
1422
+ {
1423
+ "key": "field_69148c091a913",
1424
+ "label": "top button fields",
1425
+ "name": "top_button_fields",
1426
+ "aria-label": "",
1427
+ "type": "clone",
1428
+ "instructions": "",
1429
+ "required": 0,
1430
+ "conditional_logic": 0,
1431
+ "wrapper": {
1432
+ "width": "",
1433
+ "class": "",
1434
+ "id": ""
1435
+ },
1436
+ "clone": [
1437
+ "group_63e24e04a1e61"
1346
1438
  ],
1347
1439
  "display": "seamless",
1348
1440
  "layout": "block",
@@ -2994,8 +3086,8 @@
2994
3086
  },
2995
3087
  {
2996
3088
  "key": "field_68961544e75a2",
2997
- "label": "Raw HTML",
2998
- "name": "raw_html",
3089
+ "label": "Raw HTML fields",
3090
+ "name": "raw_html_fields",
2999
3091
  "aria-label": "",
3000
3092
  "type": "clone",
3001
3093
  "instructions": "",
@@ -3006,7 +3098,6 @@
3006
3098
  "class": "",
3007
3099
  "id": ""
3008
3100
  },
3009
- "wpml_cf_preferences": 3,
3010
3101
  "clone": [
3011
3102
  "group_686ba68d603a2"
3012
3103
  ],
@@ -3034,6 +3125,100 @@
3034
3125
  "acfe_flexible_category": false,
3035
3126
  "acfe_layout_col": "auto",
3036
3127
  "acfe_layout_allowed_col": false
3128
+ },
3129
+ "layout_6912744a00a04": {
3130
+ "key": "layout_6912744a00a04",
3131
+ "name": "advanced_wysiwyg_editor",
3132
+ "label": "Advanced WYSIWYG editor",
3133
+ "display": "block",
3134
+ "sub_fields": [
3135
+ {
3136
+ "key": "field_6912744a00a07",
3137
+ "label": "Grid Layout",
3138
+ "name": "",
3139
+ "aria-label": "",
3140
+ "type": "tab",
3141
+ "instructions": "",
3142
+ "required": 0,
3143
+ "conditional_logic": 0,
3144
+ "wrapper": {
3145
+ "width": "",
3146
+ "class": "",
3147
+ "id": ""
3148
+ },
3149
+ "placement": "top",
3150
+ "endpoint": 0,
3151
+ "no_preference": 0,
3152
+ "selected": 0
3153
+ },
3154
+ {
3155
+ "key": "field_6912744a00a08",
3156
+ "label": "grid layout",
3157
+ "name": "grid_layout",
3158
+ "aria-label": "",
3159
+ "type": "clone",
3160
+ "instructions": "",
3161
+ "required": 0,
3162
+ "conditional_logic": 0,
3163
+ "wrapper": {
3164
+ "width": "",
3165
+ "class": "",
3166
+ "id": ""
3167
+ },
3168
+ "clone": [
3169
+ "group_68822860bda9f"
3170
+ ],
3171
+ "display": "seamless",
3172
+ "layout": "block",
3173
+ "prefix_label": 0,
3174
+ "prefix_name": 0,
3175
+ "acfe_seamless_style": 0,
3176
+ "acfe_clone_modal": 0,
3177
+ "acfe_clone_modal_close": 0,
3178
+ "acfe_clone_modal_button": "",
3179
+ "acfe_clone_modal_size": "large"
3180
+ },
3181
+ {
3182
+ "key": "field_6912744a00a09",
3183
+ "label": "advanced fields",
3184
+ "name": "advanced_fields",
3185
+ "aria-label": "",
3186
+ "type": "clone",
3187
+ "instructions": "",
3188
+ "required": 0,
3189
+ "conditional_logic": 0,
3190
+ "wrapper": {
3191
+ "width": "",
3192
+ "class": "",
3193
+ "id": ""
3194
+ },
3195
+ "clone": [
3196
+ "group_68dc1008c3eb7"
3197
+ ],
3198
+ "display": "seamless",
3199
+ "layout": "block",
3200
+ "prefix_label": 0,
3201
+ "prefix_name": 0,
3202
+ "acfe_seamless_style": 0,
3203
+ "acfe_clone_modal": 0,
3204
+ "acfe_clone_modal_close": 0,
3205
+ "acfe_clone_modal_button": "",
3206
+ "acfe_clone_modal_size": "large"
3207
+ }
3208
+ ],
3209
+ "min": "",
3210
+ "max": "",
3211
+ "acfe_flexible_render_template": false,
3212
+ "acfe_flexible_render_style": false,
3213
+ "acfe_flexible_render_script": false,
3214
+ "acfe_flexible_thumbnail": false,
3215
+ "acfe_flexible_settings": false,
3216
+ "acfe_flexible_settings_size": "medium",
3217
+ "acfe_layout_locations": [],
3218
+ "acfe_flexible_modal_edit_size": false,
3219
+ "acfe_flexible_category": false,
3220
+ "acfe_layout_col": "auto",
3221
+ "acfe_layout_allowed_col": false
3037
3222
  }
3038
3223
  },
3039
3224
  "min": "",
@@ -3588,5 +3773,5 @@
3588
3773
  "acfe_display_title": "",
3589
3774
  "acfe_meta": "",
3590
3775
  "acfe_note": "",
3591
- "modified": 1762792840
3776
+ "modified": 1762954327
3592
3777
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@total_onion/onion-library",
3
- "version": "2.0.129",
3
+ "version": "2.0.131",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "scripts": {