@total_onion/onion-library 2.0.263 → 3.0.0
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-carousel-multi-layout-v3/carousel-multi-layout-v3.js +13 -1
- package/components/component-responsive-image-v3/responsive-image-v3.scss +1 -0
- package/components/webc-post-filter-module/dev-content/dev-content.js +10 -0
- package/components/webc-post-filter-module/dev-content/dev-contentlocal.js +10 -0
- package/components/webc-post-filter-module/dev-content/mephy-dreams-of-mice.webp +0 -0
- package/onion-utils.mjs +0 -49
- package/package.json +10 -18
- package/components/block-post-type-filter-grid-v3/group_64690c62487bc.json +0 -4389
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/better-reviews-widget.vue +0 -15
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/buy-now-widget.vue +0 -72
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/divider-widget.vue +0 -11
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/global-image-widget.vue +0 -23
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/media-widget.vue +0 -23
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-author-widget.vue +0 -15
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-category-widget.vue +0 -20
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-component.vue +0 -73
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-headline-widget.vue +0 -16
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-image-widget.vue +0 -60
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-info-description.vue +0 -15
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-info-subtitle.vue +0 -15
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-link-widget.vue +0 -47
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-publish-widget.vue +0 -44
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-tags-widget.vue +0 -19
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-text-alternative-style.vue +0 -18
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-title-widget.vue +0 -20
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/pre-render-posts-html.twig +0 -17
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/ptfg-posts.twig +0 -474
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/ptfg-utils.vue +0 -41
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/shopify-add-to-cart.vue +0 -25
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/spacer-widget.vue +0 -13
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/text-search.vue +0 -10
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3.js +0 -14
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3.php +0 -17
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3.scss +0 -762
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3.twig +0 -139
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3.vue +0 -811
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/better-reviews-widget.vue
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement, textEditorStyles } from "./ptfg-utils.vue";
|
|
3
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
4
|
-
|
|
5
|
-
const props = defineProps(["post", "element"]);
|
|
6
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
7
|
-
const textEditorStylesString = textEditorStyles(props);
|
|
8
|
-
|
|
9
|
-
</script>
|
|
10
|
-
<template>
|
|
11
|
-
<div :class="`${blockClassname}__better-reviews ${blockClassname}__info-item`"
|
|
12
|
-
:style="`${gridLayoutString} ${textEditorStylesString}`">
|
|
13
|
-
<div v-html="props.post.rating"></div>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/buy-now-widget.vue
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement } from "./ptfg-utils.vue";
|
|
3
|
-
const props = defineProps(["post", "element", "ctaIcons", "blockClassname"]);
|
|
4
|
-
|
|
5
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
6
|
-
|
|
7
|
-
const blockClassname = props.blockClassname;
|
|
8
|
-
const ctaIcons = props.ctaIcons;
|
|
9
|
-
const element = props.element;
|
|
10
|
-
const ctaStyle = element.cta_style.replace('__', '');
|
|
11
|
-
|
|
12
|
-
const post = props.post;
|
|
13
|
-
|
|
14
|
-
const click2buyPimId = post.post_data.click_to_buy_pim_id;
|
|
15
|
-
const debrainId = post.post_data.debrain_pim_id;
|
|
16
|
-
const productDebrainSkuId = post.post_data.debrain_sku_id;
|
|
17
|
-
const directLinkURL = post.product_buynow_direct_link;
|
|
18
|
-
|
|
19
|
-
const productEANs = post.post_data.mikmak_ean_ids;
|
|
20
|
-
const mikmakDrawerWidgetID = post.mikmak_drawer_widget_ID;
|
|
21
|
-
const relatedProductEANs = post.related_product_eans;
|
|
22
|
-
|
|
23
|
-
let totalProductEANs = '';
|
|
24
|
-
if (productEANs !== '') {
|
|
25
|
-
totalProductEANs = productEANs + (relatedProductEANs !== '' ? ',' + relatedProductEANs : '');
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
</script>
|
|
29
|
-
<template>
|
|
30
|
-
<div :class="`${blockClassname}__product-buy-now ${blockClassname}__info-item`"
|
|
31
|
-
:style="`--post-colour: ${postColour}; --post-text-colour-style: ${postTextColourStyle}; ${gridLayoutString}`">
|
|
32
|
-
<a href="#"
|
|
33
|
-
:class="`${blockClassname}__cta cmpl-cta-style-${ctaStyle} ${blockClassname}__cta-animation-style-${ctaAnimationStyle} ctb`"
|
|
34
|
-
v-if="element.buy_now_text && post.post_data.buy_now_option_select.replace('__', '') == 'ctb'" data-ctbuy
|
|
35
|
-
:data-ctbuy-variant="click2buyPimId">
|
|
36
|
-
<span :class="`${blockClassname}__cta-span`">{{ element.buy_now_text }}</span>
|
|
37
|
-
<span :class="`${blockClassname}__cta-icon`" v-if="element.enable_cta_icon">
|
|
38
|
-
<img :class="`${blockClassname}__icon-image style-svg`" :src="ctaIcons.cta_link_icon">
|
|
39
|
-
</span>
|
|
40
|
-
</a>
|
|
41
|
-
<a href="#"
|
|
42
|
-
:class="`dloc-link ${blockClassname}__cta cmpl-cta-style-${ctaStyle} ${blockClassname}__cta-animation-style-${ctaAnimationStyle} wtb`"
|
|
43
|
-
v-if="element.buy_now_text && post.post_data.buy_now_option_select.replace('__', '') == 'wtb'" data-ctbuy
|
|
44
|
-
:data-filter="debrainId" data-action="where-to-buy">
|
|
45
|
-
<span :class="`${blockClassname}__cta-span`">{{ element.buy_now_text }}</span>
|
|
46
|
-
<span :class="`${blockClassname}__cta-icon`" v-if="element.enable_cta_icon">
|
|
47
|
-
<img :class="`${blockClassname}__icon-image style-svg`" :src="ctaIcons.cta_link_icon">
|
|
48
|
-
</span>
|
|
49
|
-
</a>
|
|
50
|
-
<a :href="directLinkURL[0]"
|
|
51
|
-
:class="`${blockClassname}__cta cmpl-cta-style-${ctaStyle} ${blockClassname}__cta-animation-style-${ctaAnimationStyle} link`"
|
|
52
|
-
v-if="element.buy_now_text && post.post_data.buy_now_option_select.replace('__', '') == 'link'"
|
|
53
|
-
:target="(directLinkURL[2] !== '' ? directLinkURL[2] : '_blank')">
|
|
54
|
-
<span :class="`${blockClassname}__cta-span`">{{ element.buy_now_text }}</span>
|
|
55
|
-
<span :class="`${blockClassname}__cta-icon`" v-if="element.enable_cta_icon">
|
|
56
|
-
<img :class="`${blockClassname}__icon-image style-svg`" :src="ctaIcons.cta_link_icon">
|
|
57
|
-
</span>
|
|
58
|
-
</a>
|
|
59
|
-
<wtb-button v-if="post.post_data.buy_now_option_select.replace('__', '') == 'wtb-v2' && productDebrainSkuId"
|
|
60
|
-
:sku="productDebrainSkuId"></wtb-button>
|
|
61
|
-
<a href="#" :data-mm-wtbid="`${mikmakDrawerWidgetID}`" :data-mm-ids="`${totalProductEANs}`"
|
|
62
|
-
:data-mm-default-id="`${productEANs}`"
|
|
63
|
-
:class="`${blockClassname}__cta cmpl-cta-style-${ctaStyle} ${blockClassname}__cta-animation-style-${ctaAnimationStyle} mikmak-buy-now`"
|
|
64
|
-
v-if="element.buy_now_text && post.post_data.buy_now_option_select.replace('__', '') == 'mikmak'"
|
|
65
|
-
:data-filter="debrainId">
|
|
66
|
-
<span :class="`${blockClassname}__cta-span`">{{ element.buy_now_text }}</span>
|
|
67
|
-
<span :class="`${blockClassname}__cta-icon`" v-if="element.enable_cta_icon">
|
|
68
|
-
<img :class="`${blockClassname}__icon-image style-svg`" :src="ctaIcons.cta_link_icon">
|
|
69
|
-
</span>
|
|
70
|
-
</a>
|
|
71
|
-
</div>
|
|
72
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/divider-widget.vue
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement } from "./ptfg-utils.vue";
|
|
3
|
-
const props = defineProps(["post", "element"]);
|
|
4
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
5
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
6
|
-
|
|
7
|
-
</script>
|
|
8
|
-
<template>
|
|
9
|
-
<div :class="`${blockClassname}__post-divider ${blockClassname}__info-item`" :style="`${gridLayoutString}`">
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/global-image-widget.vue
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement } from "./ptfg-utils.vue";
|
|
3
|
-
|
|
4
|
-
const props = defineProps(["post", "element", "fields", "globalImages"]);
|
|
5
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
6
|
-
const imageSelect = props.element.image_select?.replace('__', '');
|
|
7
|
-
let globalImage = '';
|
|
8
|
-
if (props.globalImages[imageSelect]) {
|
|
9
|
-
globalImage = props.globalImages[imageSelect]['global_image'];
|
|
10
|
-
}
|
|
11
|
-
let globalImageWidthString = `--global-image-width-mobile: ${props.element.global_image_width}%; --global-image-width-desktop: ${props.element.global_image_width}%;`;
|
|
12
|
-
const globalImageStyles = `--global-image-z-index: ${props.element.global_image_zindex}; --global-image-position: ${props.element.global_image_position.replace('__', '')}; --global-image-fit-style: ${props.element.global_image_fit_style.replace('__', '')}; --global-image-max-width-desktop: ${props.element.global_image_max_width_desktop}%; --global-image-max-width-mobile: ${props.element.global_image_max_width_mobile}%;`
|
|
13
|
-
let sizes = "(min-width: 1440px) 50vw, (min-width: 1024px) 50vw, (min-width: 768px) 768px') 100vw";
|
|
14
|
-
|
|
15
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
16
|
-
|
|
17
|
-
</script>
|
|
18
|
-
<template>
|
|
19
|
-
<img v-if="globalImage.url"
|
|
20
|
-
:class="`${blockClassname}__info-item ${blockClassname}__global-image ${blockClassname}__global-image--1`"
|
|
21
|
-
loading="lazy" :src="globalImage.url" :width="globalImage.width" :height="globalImage.height" :sizes=sizes
|
|
22
|
-
:alt="globalImage.alt" :style="`${gridLayoutString} ${globalImageStyles}`" />
|
|
23
|
-
</template>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement } from "./ptfg-utils.vue";
|
|
3
|
-
|
|
4
|
-
const props = defineProps(["post", "element", "fields"]);
|
|
5
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
6
|
-
const imageType = 'image';
|
|
7
|
-
let postType = props.post.post_data.post_type;
|
|
8
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
9
|
-
|
|
10
|
-
</script>
|
|
11
|
-
<template>
|
|
12
|
-
<div :class="`${blockClassname}__media-image-container ${blockClassname}__info-item`" :href="props.post.link"
|
|
13
|
-
:style="`${gridLayoutString}`">
|
|
14
|
-
<img :class="`${blockClassname}__post-image ${blockClassname}__media-${imageType}`" loading="lazy"
|
|
15
|
-
:src="props.post.post_images['post_' + imageType + '_src']"
|
|
16
|
-
:width="props.post.post_images['post_' + imageType + '_width']"
|
|
17
|
-
:height="props.post.post_images['post_' + imageType + '_height']"
|
|
18
|
-
:srcset="props.post.post_images['post_' + imageType + '_srcset']"
|
|
19
|
-
sizes="(max-width: 414px) 100px, (max-width: 768px) 150px, (max-width: 1024px) 200px, (max-width: 1440px) 275px, (max-width: 1800px) 300px"
|
|
20
|
-
:alt="props.post.post_images['post_' + imageType + '_alt_text']"
|
|
21
|
-
:style="`--post-image-width: ${element.post_image_width}%;`" />
|
|
22
|
-
</div>
|
|
23
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-author-widget.vue
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement } from "./ptfg-utils.vue";
|
|
3
|
-
|
|
4
|
-
const props = defineProps(["post", "element"]);
|
|
5
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
6
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
7
|
-
const textEditorStylesString = textEditorStyles(props);
|
|
8
|
-
|
|
9
|
-
</script>
|
|
10
|
-
<template>
|
|
11
|
-
<p :class="`${blockClassname}__post-author ${blockClassname}__info-item ${element.text_style?.typography_style.replace('__', '')}`"
|
|
12
|
-
:style="`${gridLayoutString} ${textEditorStylesString}`">
|
|
13
|
-
{{ post.author_display_name }}
|
|
14
|
-
</p>
|
|
15
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-category-widget.vue
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement, textEditorStyles } from "./ptfg-utils.vue";
|
|
3
|
-
|
|
4
|
-
const props = defineProps(["post", "element"]);
|
|
5
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
6
|
-
|
|
7
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
8
|
-
const textEditorStylesString = textEditorStyles(props);
|
|
9
|
-
|
|
10
|
-
</script>
|
|
11
|
-
<template>
|
|
12
|
-
<div :class="`${blockClassname}__post-category ${blockClassname}__info-item`"
|
|
13
|
-
:style="`${gridLayoutString} ${textEditorStylesString}`">
|
|
14
|
-
<template v-for="(category, index) in props.post.categories" :key="index">
|
|
15
|
-
<p v-if="category.taxonomy != 'translation_priority'" v-html="category.name"
|
|
16
|
-
:class="`${blockClassname}__post-category--item ${element.text_style?.typography_style.replace('__', '')}`">
|
|
17
|
-
</p>
|
|
18
|
-
</template>
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-component.vue
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import PostAuthor from "./post-author-widget.vue";
|
|
3
|
-
import PostImage from "./post-image-widget.vue";
|
|
4
|
-
import GlobalImage from "./global-image-widget.vue";
|
|
5
|
-
import PostCategories from "./post-category-widget.vue";
|
|
6
|
-
import PostTags from "./post-tags-widget.vue";
|
|
7
|
-
import Divider from "./divider-widget.vue";
|
|
8
|
-
import PostHeadline from "./post-headline-widget.vue";
|
|
9
|
-
import PostLink from "./post-link-widget.vue";
|
|
10
|
-
import PostPublishDate from "./post-publish-widget.vue";
|
|
11
|
-
import PostTitle from "./post-title-widget.vue";
|
|
12
|
-
import Spacer from "./spacer-widget.vue";
|
|
13
|
-
import PostInfoDescription from "./post-info-description.vue";
|
|
14
|
-
import PostInfoSubtitle from "./post-info-subtitle.vue";
|
|
15
|
-
import PostTextAlternativeStyle from "./post-text-alternative-style.vue";
|
|
16
|
-
import MediaImage from "./media-widget.vue";
|
|
17
|
-
import BetterReviews from "./better-reviews-widget.vue";
|
|
18
|
-
import BuyNow from "./buy-now-widget.vue";
|
|
19
|
-
import ShopifyAddToCart from "./shopify-add-to-cart.vue";
|
|
20
|
-
const widgetComponents = {
|
|
21
|
-
PostAuthor,
|
|
22
|
-
PostImage,
|
|
23
|
-
PostCategories,
|
|
24
|
-
PostTags,
|
|
25
|
-
Divider,
|
|
26
|
-
PostHeadline,
|
|
27
|
-
PostLink,
|
|
28
|
-
PostPublishDate,
|
|
29
|
-
PostTitle,
|
|
30
|
-
Spacer,
|
|
31
|
-
PostInfoDescription,
|
|
32
|
-
PostTextAlternativeStyle,
|
|
33
|
-
MediaImage,
|
|
34
|
-
GlobalImage,
|
|
35
|
-
BetterReviews,
|
|
36
|
-
BuyNow,
|
|
37
|
-
PostInfoSubtitle,
|
|
38
|
-
ShopifyAddToCart,
|
|
39
|
-
};
|
|
40
|
-
const widgetNames = [];
|
|
41
|
-
const props = defineProps([
|
|
42
|
-
"postDataConfig",
|
|
43
|
-
"post",
|
|
44
|
-
"ctaIcons",
|
|
45
|
-
"mappedIcons",
|
|
46
|
-
"ctaStyles",
|
|
47
|
-
"globalImages",
|
|
48
|
-
"gradientOverlayColour",
|
|
49
|
-
"fields",
|
|
50
|
-
"options",
|
|
51
|
-
"imageSizesAttribute"
|
|
52
|
-
]);
|
|
53
|
-
props.postDataConfig?.forEach((widget) => {
|
|
54
|
-
let nameArr = widget.acf_fc_layout.split("_");
|
|
55
|
-
let name = "";
|
|
56
|
-
nameArr.forEach((part) => {
|
|
57
|
-
const caps = part.charAt(0).toUpperCase() + part.slice(1);
|
|
58
|
-
name += caps;
|
|
59
|
-
});
|
|
60
|
-
widgetNames.push(name);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
64
|
-
</script>
|
|
65
|
-
|
|
66
|
-
<template>
|
|
67
|
-
<template v-for="(widget, index) in widgetNames" :key="index">
|
|
68
|
-
<component :is="widgetComponents[widget]" :post="props.post" :fields="fields" :options="options"
|
|
69
|
-
:element="props.postDataConfig[index]" :blockClassname="blockClassname" :ctaIcons="ctaIcons"
|
|
70
|
-
:ctaStyles="ctaStyles" :mappedIcons="mappedIcons" :globalImages="globalImages"
|
|
71
|
-
:imageSizesAttribute="props.imageSizesAttribute" />
|
|
72
|
-
</template>
|
|
73
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-headline-widget.vue
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement, textEditorStyles } from "./ptfg-utils.vue";
|
|
3
|
-
|
|
4
|
-
const props = defineProps(["post", "element"]);
|
|
5
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
6
|
-
|
|
7
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
8
|
-
const textEditorStylesString = textEditorStyles(props);
|
|
9
|
-
|
|
10
|
-
</script>
|
|
11
|
-
<template>
|
|
12
|
-
<h3 :class="`${blockClassname}__post-headline ${blockClassname}__info-item ${element.text_style?.typography_style.replace('__', '')}`"
|
|
13
|
-
:style="`${gridLayoutString} ${textEditorStylesString}`">
|
|
14
|
-
{{ element.headline_text }}
|
|
15
|
-
</h3>
|
|
16
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-image-widget.vue
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement } from "./ptfg-utils.vue";
|
|
3
|
-
|
|
4
|
-
const props = defineProps(["post", "element", "fields", "imageSizesAttribute"]);
|
|
5
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
6
|
-
const imageType = props.element?.image_select?.replace('__', '');
|
|
7
|
-
const imageTypeSecondary = 'image_alt';
|
|
8
|
-
const setAsBackgroundImage = props.element?.set_as_background_image;
|
|
9
|
-
let positioningString = '';
|
|
10
|
-
let postImageWidthString = `--post-image-width-mobile: ${props.element.post_image_width_mobile || props.element.post_image_width}%; --post-image-width-portrait: ${props.element.post_image_width_portrait || props.element.post_image_width}%; --post-image-width-desktop: ${props.element.post_image_width}%;`;
|
|
11
|
-
if (imageType === 'image_accent') {
|
|
12
|
-
const elementPositioning = props.element?.post_image_positioning.element_positioning;
|
|
13
|
-
positioningString = `
|
|
14
|
-
--element-rotation-desktop: ${elementPositioning.desktop_positioning.element_rotation_desktop}deg;
|
|
15
|
-
--element-rotation-mobile: ${elementPositioning.desktop_positioning.element_rotation_desktop}deg;
|
|
16
|
-
--element-z-index: ${elementPositioning.element_z_index};
|
|
17
|
-
--element-horizontal-offset-mobile: ${elementPositioning.mobile_positioning.horizontal_offset}%;
|
|
18
|
-
--element-vertical-offset-mobile: ${elementPositioning.mobile_positioning.vertical_offset}%;
|
|
19
|
-
--element-horizontal-offset-desktop: ${elementPositioning.desktop_positioning.horizontal_offset}%;
|
|
20
|
-
--element-vertical-offset-desktop: ${elementPositioning.desktop_positioning.vertical_offset}%;
|
|
21
|
-
--mobile-horizontal-placement: ${elementPositioning.mobile_positioning.horizontal_snap?.replace('__', '')};
|
|
22
|
-
--mobile-vertical-placement: ${elementPositioning.mobile_positioning.vertical_snap?.replace('__', '')};
|
|
23
|
-
--desktop-horizontal-placement: ${elementPositioning.desktop_positioning.horizontal_snap?.replace('__', '')};
|
|
24
|
-
--desktop-vertical-placement: ${elementPositioning.desktop_positioning.vertical_snap?.replace('__', '')};
|
|
25
|
-
--element-position: ${elementPositioning.element_position};
|
|
26
|
-
|
|
27
|
-
`;
|
|
28
|
-
postImageWidthString = `--post-image-width-mobile: calc( ${props.element.post_image_width_mobile_px} / var(--mobile-design-reference) * var(--screen-width-mobile)); --post-image-width-desktop: calc(${props.element.post_image_width_desktop_px} / var(--desktop-design-reference) * var(--screen-width-desktop));`;
|
|
29
|
-
}
|
|
30
|
-
console.log(props.imageSizesAttribute);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
34
|
-
|
|
35
|
-
const styleString = `--post-image-border-radius: ${props.fields.post_image_border_radius};`
|
|
36
|
-
let postType = props.post.post_data.post_type;
|
|
37
|
-
let sizes = props.imageSizesAttribute || "(min-width: 1440px) 50vw, (min-width: 1024px) 50vw, (min-width: 768px) 768px') 100vw";
|
|
38
|
-
|
|
39
|
-
</script>
|
|
40
|
-
<template>
|
|
41
|
-
<a :class="`${blockClassname}__post-image-container-link ${blockClassname}__info-item ${blockClassname}__post-image-container--${imageType} ${blockClassname}__post-image-container-link--${props.fields.show_alt_image_on_hover ? 'show-alt-image-on-hover' : 'no-hover'} ${setAsBackgroundImage ? blockClassname + '__post-image-container-link--set-as-background-image' : ''}`"
|
|
42
|
-
:href="props.post.link" :aria-label="props.post.post_title" :style="`${gridLayoutString}`">
|
|
43
|
-
<img v-if="props.post.post_images['post_' + imageType + '_src']"
|
|
44
|
-
:class="`${blockClassname}__post-image ${blockClassname}__post-${imageType} ${blockClassname}__post-image--${imageType}`"
|
|
45
|
-
loading="lazy" :src="props.post.post_images['post_' + imageType + '_src']"
|
|
46
|
-
:width="props.post.post_images['post_' + imageType + '_width']"
|
|
47
|
-
:height="props.post.post_images['post_' + imageType + '_height']"
|
|
48
|
-
:srcset="props.post.post_images['post_' + imageType + '_srcset']" :sizes=sizes
|
|
49
|
-
:alt="props.post.post_images['post_' + imageType + '_alt_text']"
|
|
50
|
-
:style="`${styleString} ${positioningString} ${postImageWidthString}`" />
|
|
51
|
-
<img v-if="props.fields.show_alt_image_on_hover"
|
|
52
|
-
:class="`${blockClassname}__post-image--secondary ${blockClassname}__post-${imageTypeSecondary}`"
|
|
53
|
-
loading="lazy" :src="props.post.post_images['post_' + imageTypeSecondary + '_src']"
|
|
54
|
-
:width="props.post.post_images['post_' + imageTypeSecondary + '_width']"
|
|
55
|
-
:height="props.post.post_images['post_' + imageTypeSecondary + '_height']"
|
|
56
|
-
:srcset="props.post.post_images['post_' + imageTypeSecondary + '_srcset']" :sizes=sizes
|
|
57
|
-
:alt="props.post.post_images['post_' + imageTypeSecondary + '_alt_text']"
|
|
58
|
-
:style="`${postImageWidthString}`" />
|
|
59
|
-
</a>
|
|
60
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-info-description.vue
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement, textEditorStyles } from "./ptfg-utils.vue";
|
|
3
|
-
|
|
4
|
-
const props = defineProps(["post", "element"]);
|
|
5
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
6
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
7
|
-
const textEditorStylesString = textEditorStyles(props);
|
|
8
|
-
</script>
|
|
9
|
-
<template>
|
|
10
|
-
<div :class="`${blockClassname}__post-info-description ${blockClassname}__info-item`"
|
|
11
|
-
:style="`${gridLayoutString} ${textEditorStylesString}`">
|
|
12
|
-
<p :class="`${element.text_style?.typography_style.replace('__', '')}`">{{ post.post_data.post_info_description
|
|
13
|
-
}}</p>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-info-subtitle.vue
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement, textEditorStyles } from "./ptfg-utils.vue";
|
|
3
|
-
|
|
4
|
-
const props = defineProps(["post", "element"]);
|
|
5
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
6
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
7
|
-
const textEditorStylesString = textEditorStyles(props);
|
|
8
|
-
</script>
|
|
9
|
-
<template>
|
|
10
|
-
<div :class="`${blockClassname}__post-info-subtitle ${blockClassname}__info-item`"
|
|
11
|
-
:style="`${gridLayoutString} ${textEditorStylesString}`">
|
|
12
|
-
<p :class="`${element.text_style?.typography_style.replace('__', '')}`">{{ post.post_data.post_info_subtitle }}
|
|
13
|
-
</p>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-link-widget.vue
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement } from "./ptfg-utils.vue";
|
|
3
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
4
|
-
const props = defineProps(["post", "element", "mappedIcons", "ctaStyles", "blockClassname", "options"]);
|
|
5
|
-
const postColour = props.post.post_data.post_colour;
|
|
6
|
-
const postTextColourStyle = props.post.post_data?.post_text_colour_style?.replace('__', '');
|
|
7
|
-
let ctaStyle = '';
|
|
8
|
-
if (typeof props.element.cta_style == 'string') {
|
|
9
|
-
ctaStyle = props.element?.cta_style?.replace("__", '');
|
|
10
|
-
} else {
|
|
11
|
-
ctaStyle = props.element?.cta_style;
|
|
12
|
-
}
|
|
13
|
-
let postCtaStyle = ctaStyle;
|
|
14
|
-
let postCtaStyleValue = '';
|
|
15
|
-
let ctaAnimationStyle = '';
|
|
16
|
-
if (props.element?.cta_style_select) {
|
|
17
|
-
if (props.element?.cta_style_select?.replace('__', '') == 'post-colour') {
|
|
18
|
-
postCtaStyle = 'post-colour';
|
|
19
|
-
postCtaStyleValue = `color: ${postColour};--post-text-colour-style: ${postColour};`;
|
|
20
|
-
}
|
|
21
|
-
if (props.element?.cta_style_select?.replace('__', '') == 'post-text-colour-style') {
|
|
22
|
-
postCtaStyle = 'post-text-colour-style';
|
|
23
|
-
postCtaStyleValue = `color: ${postTextColourStyle};--post-text-colour-style: ${postTextColourStyle};`;
|
|
24
|
-
}
|
|
25
|
-
if (props.ctaStyles) {
|
|
26
|
-
ctaAnimationStyle = props.ctaStyles[ctaStyle - 1]?.cta_settings?.cta_animation_style;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
let iconImage = '';
|
|
30
|
-
if (props.mappedIcons['cta_link_icon']) {
|
|
31
|
-
iconImage = props.mappedIcons['cta_link_icon']['type'] == 'image/svg+xml' ? props.mappedIcons['cta_link_icon']['image'] : '<img src="' + props.mappedIcons['cta_link_icon']['image'] + '">';
|
|
32
|
-
}
|
|
33
|
-
const enableCtaIcon = props.ctaStyles[ctaStyle - 1]?.cta_settings?.include_cta_icon;
|
|
34
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
35
|
-
</script>
|
|
36
|
-
<template>
|
|
37
|
-
<div :class="`${blockClassname}__post-link ${blockClassname}__info-item`" :style="`${gridLayoutString}`">
|
|
38
|
-
<a :href="post?.link" :style="`${postCtaStyleValue}`"
|
|
39
|
-
:class="`${blockClassname}__cta ${blockClassname}__cta-style-${postCtaStyle} cmpl-cta-style-${postCtaStyle} cmpl-cta-animation-style-${ctaAnimationStyle}`"
|
|
40
|
-
v-if="element.post_link_text">
|
|
41
|
-
<span :class="`${blockClassname}__cta-span`">{{ element.post_link_text }}</span>
|
|
42
|
-
<span :class="`${blockClassname}__cta-icon cmpl-cta-icon ${blockClassname}__icon-image`"
|
|
43
|
-
v-if="enableCtaIcon" v-html="iconImage">
|
|
44
|
-
</span>
|
|
45
|
-
</a>
|
|
46
|
-
</div>
|
|
47
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-publish-widget.vue
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
import { gridLayoutElement, textEditorStyles } from "./ptfg-utils.vue";
|
|
4
|
-
|
|
5
|
-
const props = defineProps(["post", "element"]);
|
|
6
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
7
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
8
|
-
const textEditorStylesString = textEditorStyles(props);
|
|
9
|
-
|
|
10
|
-
const dateWithoutTime = computed(() => {
|
|
11
|
-
if (props.post.post_date) {
|
|
12
|
-
const dateArray = props.post.post_date.split(' ');
|
|
13
|
-
const dateDMY = dateArray[0].split('-');
|
|
14
|
-
const dateObject = new Date(Date.UTC(
|
|
15
|
-
parseInt(dateDMY[0]), // year
|
|
16
|
-
parseInt(dateDMY[1]) - 1, // month (0-based)
|
|
17
|
-
parseInt(dateDMY[2]) // day
|
|
18
|
-
));
|
|
19
|
-
|
|
20
|
-
const url = window.location.href;
|
|
21
|
-
const parts = url.split("/");
|
|
22
|
-
let formattedDate;
|
|
23
|
-
|
|
24
|
-
parts.forEach((part) => {
|
|
25
|
-
if (part === "en-us") {
|
|
26
|
-
formattedDate = new Intl.DateTimeFormat("en-US").format(
|
|
27
|
-
dateObject
|
|
28
|
-
);
|
|
29
|
-
} else {
|
|
30
|
-
formattedDate = new Intl.DateTimeFormat("en-GB").format(
|
|
31
|
-
dateObject
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return formattedDate;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
</script>
|
|
39
|
-
<template>
|
|
40
|
-
<p :class="`${blockClassname}__post-publish-date ${blockClassname}__info-item ${element.text_style?.typography_style.replace('__', '')}`"
|
|
41
|
-
:style="`${gridLayoutString} ${textEditorStylesString}`">
|
|
42
|
-
{{ dateWithoutTime }}
|
|
43
|
-
</p>
|
|
44
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-tags-widget.vue
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement, textEditorStyles } from "./ptfg-utils.vue";
|
|
3
|
-
|
|
4
|
-
const props = defineProps(["post", "element", "ctaStyles"]);
|
|
5
|
-
const blockClassname = "post-type-filter-grid-v3";
|
|
6
|
-
|
|
7
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
8
|
-
let ctaStyle = props.element?.cta_style?.replace("__", '');
|
|
9
|
-
|
|
10
|
-
</script>
|
|
11
|
-
<template>
|
|
12
|
-
<div :class="`${blockClassname}__post-tags ${blockClassname}__info-item `" :style="`${gridLayoutString}`">
|
|
13
|
-
<template v-for="(tag, index) in props.post.tags" :key="index">
|
|
14
|
-
<div v-html="tag.name"
|
|
15
|
-
:class="`${blockClassname}__post-tag ${blockClassname}__cta cmpl-cta-style-${ctaStyle}`">
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
</div>
|
|
19
|
-
</template>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement } from "./ptfg-utils.vue";
|
|
3
|
-
|
|
4
|
-
const props = defineProps(["post", "element", "ctaIcons", "blockClassname"]);
|
|
5
|
-
const blockClassname = props.blockClassname;
|
|
6
|
-
|
|
7
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
</script>
|
|
11
|
-
<template>
|
|
12
|
-
<div :href="props.post.link" :class="`${blockClassname}__post-text-alternative-style ${blockClassname}__info-item`"
|
|
13
|
-
:style="`${gridLayoutString}`">
|
|
14
|
-
<h3 :class="`${blockClassname}__post-text-alternative-style-text`"
|
|
15
|
-
v-html="post.post_data.post_text_alternative_style">
|
|
16
|
-
</h3>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3/post-title-widget.vue
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { gridLayoutElement, textEditorStyles } from "./ptfg-utils.vue";
|
|
3
|
-
|
|
4
|
-
const props = defineProps(["post", "element", "ctaIcons", "blockClassname"]);
|
|
5
|
-
const blockClassname = props.blockClassname;
|
|
6
|
-
|
|
7
|
-
const gridLayoutString = gridLayoutElement(props);
|
|
8
|
-
const textEditorStylesString = textEditorStyles(props);
|
|
9
|
-
|
|
10
|
-
</script>
|
|
11
|
-
<template>
|
|
12
|
-
<a :href="props.post.link" :class="`${blockClassname}__post-title ${blockClassname}__info-item`"
|
|
13
|
-
:style="`${gridLayoutString}`">
|
|
14
|
-
<h3 :class="`${element.text_style?.typography_style.replace('__', '')}`" :style="`${textEditorStylesString}`"
|
|
15
|
-
v-html="post.post_title">
|
|
16
|
-
</h3>
|
|
17
|
-
<img :class="`${blockClassname}__post-title-icon`" v-if="element.enable_icon" :src="ctaIcons.cta_load_more_icon"
|
|
18
|
-
alt="title icon">
|
|
19
|
-
</a>
|
|
20
|
-
</template>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<div class="{{blockClassName}}__no-js-content lazy-fade js-enabled-hide" style="width: 100%; padding: var(--global-inline-spacing)">
|
|
2
|
-
<div class="{{blockClassName}}__posts-container" style="width: 100%; display: grid; grid-template-columns: repeat(auto-fill,minmax(250px, 1fr)); gap: 20px;">
|
|
3
|
-
{% for post in updatedPosts.posts %}
|
|
4
|
-
{% set postImage = get_image(post.post_images.post_image) %}
|
|
5
|
-
|
|
6
|
-
<div class="{{blockClassName}}__post-container">
|
|
7
|
-
<a href="{{post.link}}"><img class="js-enabled-hide" src="{{postImage.src}}" srcset="{{postImage.srcset}}" alt="{{post.post_images.post_image_alt_text}}" loading='lazy' class=""></a>
|
|
8
|
-
{% if post.post_title is not empty %}
|
|
9
|
-
<h2 class="">{{post.post_title}}</h2>
|
|
10
|
-
{% endif %}
|
|
11
|
-
{% if post.post_info_description is not empty %}
|
|
12
|
-
<p class="">{{post.post_info_description}}</p>
|
|
13
|
-
{% endif %}
|
|
14
|
-
</div>
|
|
15
|
-
{% endfor %}
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|