@total_onion/onion-library 1.0.247 → 1.0.250
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.
- package/components/block-lottie-content-v3/lottie-content-v3.js +24 -13
- package/components/component-content-container-v3/content-container-v3.js +19 -76
- package/components/fields-block-editor-assets-v3/block-editor-assets-v3.php +2 -2
- package/components/fields-core-wordpress-block-editor-preview-v3/core-wordpress-block-editor-preview-v3.js +4 -5
- package/package.json +1 -1
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} catch ( error ) {
|
|
12
|
-
console.error( error );
|
|
1
|
+
import lottie from 'lottie-web';
|
|
2
|
+
export default function lottiecontentv3Js(block) {
|
|
3
|
+
const lottieElement = block.querySelector('.lottie-animations');
|
|
4
|
+
if (!lottieElement) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
const lottieData = lottieElement.dataset;
|
|
8
|
+
const filePath = lottieData.lottiefile;
|
|
9
|
+
if (!filePath) {
|
|
10
|
+
return;
|
|
13
11
|
}
|
|
14
|
-
|
|
12
|
+
const loop = parseInt(lottieData.loop) ? true : false;
|
|
13
|
+
const autoplay = parseInt(lottieData.autoplay) ? true : false;
|
|
14
|
+
lottie.loadAnimation({
|
|
15
|
+
container: lottieElement,
|
|
16
|
+
renderer: 'svg',
|
|
17
|
+
loop: loop,
|
|
18
|
+
autoplay: autoplay,
|
|
19
|
+
path: filePath,
|
|
20
|
+
rendererSettings: {
|
|
21
|
+
preserveAspectRatio: 'xMidYMid slice',
|
|
22
|
+
progressiveLoad: true
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import shop from 'Assets/js/modules/library-modules/shopify/shop';
|
|
2
|
-
|
|
3
1
|
export default function contentContainerJs(block) {
|
|
4
2
|
if (!block) {
|
|
5
3
|
return;
|
|
6
4
|
}
|
|
7
|
-
|
|
8
5
|
const blockClassName = block.dataset.assetkey;
|
|
9
6
|
const formContainerElement = block.querySelector('.form-container');
|
|
10
7
|
const modalFormContainerElement = block.querySelector(
|
|
@@ -12,85 +9,31 @@ export default function contentContainerJs(block) {
|
|
|
12
9
|
);
|
|
13
10
|
const countdownElement = block.querySelector('.countdowndate');
|
|
14
11
|
const socialMediaElement = block.querySelector('.social-media-share-popup');
|
|
15
|
-
const accordionV2Element = block.querySelector(
|
|
16
|
-
`.${blockClassName}__accordion-v2`
|
|
17
|
-
);
|
|
18
|
-
const marketSelector = block.querySelector('.market-selector');
|
|
19
|
-
const shopifySelector = block.querySelector('.shopify__cart');
|
|
20
|
-
const contentTooltip = block.querySelector('.content-tooltip-wrapper');
|
|
21
|
-
const spotifyEmbed = block.querySelector('.spotify-embed');
|
|
22
|
-
const truncatedText = block.querySelector('.truncated-text');
|
|
23
12
|
// const accordionV3Element = block.querySelector(
|
|
24
13
|
// '.standard-content-v2__accordion-v3'
|
|
25
14
|
// );
|
|
26
15
|
|
|
27
|
-
if (formContainerElement || modalFormContainerElement) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (countdownElement) {
|
|
36
|
-
import('Assets/js/modules/library-modules/countdown/countdown.js').then(
|
|
37
|
-
(module) => {
|
|
38
|
-
module.default(block);
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (socialMediaElement) {
|
|
44
|
-
import(
|
|
45
|
-
'Assets/js/modules/library-modules/social-media-share/social-media-share.js'
|
|
46
|
-
).then((module) => {
|
|
47
|
-
module.default(block);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (accordionV2Element) {
|
|
52
|
-
import(
|
|
53
|
-
'Assets/js/modules/library-modules/accordion-v2/accordion-v2.js'
|
|
54
|
-
).then((module) => {
|
|
55
|
-
module.default(block);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
16
|
+
// if (formContainerElement || modalFormContainerElement) {
|
|
17
|
+
// import(
|
|
18
|
+
// 'Assets/js/modules/library-modules/form-selection/form-selection.js'
|
|
19
|
+
// ).then((module) => {
|
|
20
|
+
// module.default(block);
|
|
21
|
+
// });
|
|
22
|
+
// }
|
|
58
23
|
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
if (shopifySelector) {
|
|
67
|
-
shop.loadShops();
|
|
68
|
-
}
|
|
69
|
-
if (contentTooltip) {
|
|
70
|
-
import(
|
|
71
|
-
'Assets/js/modules/library-modules/content-tooltip/content-tooltip.js'
|
|
72
|
-
).then((module) => {
|
|
73
|
-
module.default(block);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
if (spotifyEmbed) {
|
|
77
|
-
import(
|
|
78
|
-
'Assets/js/modules/library-modules/spotify-embed/spotify-embed.js'
|
|
79
|
-
).then((module) => {
|
|
80
|
-
module.default(block);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
if (truncatedText) {
|
|
84
|
-
import(
|
|
85
|
-
'Assets/js/modules/library-modules/truncated-text/truncated-text.js'
|
|
86
|
-
).then((module) => {
|
|
87
|
-
module.default(block);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
24
|
+
// if (countdownElement) {
|
|
25
|
+
// import('Assets/js/modules/library-modules/countdown/countdown.js').then(
|
|
26
|
+
// (module) => {
|
|
27
|
+
// module.default(block);
|
|
28
|
+
// }
|
|
29
|
+
// );
|
|
30
|
+
// }
|
|
90
31
|
|
|
91
|
-
// if (
|
|
92
|
-
// import(
|
|
32
|
+
// if (socialMediaElement) {
|
|
33
|
+
// import(
|
|
34
|
+
// 'Assets/js/modules/library-modules/social-media-share/social-media-share.js'
|
|
35
|
+
// ).then((module) => {
|
|
93
36
|
// module.default(block);
|
|
94
|
-
// })
|
|
37
|
+
// });
|
|
95
38
|
// }
|
|
96
39
|
}
|
|
@@ -3,9 +3,9 @@ add_action('enqueue_block_assets', 'add_block_editor_assets_v3', 10, true);
|
|
|
3
3
|
function add_block_editor_assets_v3(): void
|
|
4
4
|
{
|
|
5
5
|
if (is_admin()) {
|
|
6
|
-
wp_enqueue_style('
|
|
6
|
+
wp_enqueue_style('block-editor-preview', gtp_get_asset_uri('blockeditorpreviewcss.css'), array(), null);
|
|
7
7
|
wp_enqueue_script('editorstyles', gtp_get_asset_uri('corewordpressblockeditorpreview.js'), array(), null, true);
|
|
8
|
-
wp_localize_script('editorstyles', 'previewvars',
|
|
8
|
+
wp_localize_script('editorstyles', 'previewvars', core_design_system_v3());
|
|
9
9
|
wp_localize_script('editorstyles', 'corecta', core_cta());
|
|
10
10
|
wp_localize_script('editorstyles', 'coretypography', core_typography_v3());
|
|
11
11
|
wp_localize_script('editorstyles', 'corefontmodifiers', core_font_modifiers());
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
// LIBRARY FILE - Do not modify/override here as your changes will be lost when the package is updated.
|
|
2
1
|
import wppreview from '@pernod-ricard-global-cms/wordpresspreview';
|
|
3
2
|
import colourPalettes from '@pernod-ricard-global-cms/cblcolourpalettes';
|
|
4
|
-
import ctaStyles from 'Assets/js/modules/library-modules/core-editor-cta-style-select/core-editor-cta-style-select.js';
|
|
5
|
-
import themeNames from 'Assets/js/modules/library-modules/core-editor-theme-select/core-editor-theme-select.js';
|
|
3
|
+
// import ctaStyles from 'Assets/js/modules/library-modules/core-editor-cta-style-select/core-editor-cta-style-select.js';
|
|
4
|
+
// import themeNames from 'Assets/js/modules/library-modules/core-editor-theme-select/core-editor-theme-select.js';
|
|
6
5
|
import jQuery from 'jquery';
|
|
7
6
|
const $ = jQuery;
|
|
8
7
|
|
|
@@ -53,8 +52,8 @@ $(document).ready(function ($) {
|
|
|
53
52
|
const themeSelectNames = ['page_theme'];
|
|
54
53
|
const colourData = globalThis.colourconfig;
|
|
55
54
|
colourPalettes(colourData);
|
|
56
|
-
ctaStyles(ctaSelectNames);
|
|
57
|
-
themeNames(themeSelectNames);
|
|
55
|
+
// ctaStyles(ctaSelectNames);
|
|
56
|
+
// themeNames(themeSelectNames);
|
|
58
57
|
wppreview({lazyloaderFilepath: 'js/blocks/'});
|
|
59
58
|
|
|
60
59
|
document.documentElement.insertAdjacentHTML('afterbegin', previewvars[0]);
|