@lancom/shared 0.0.332 → 0.0.334

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.
@@ -108,5 +108,5 @@ export const getLayerModel = async ({ type, colorId, top, left, isEditMode, url,
108
108
  };
109
109
 
110
110
  export const cloneLayerModel = layer => {
111
- return { ...layer, createdAt: Date.now() };
111
+ return { ...layer, createdAt: Date.now(), guid: generateGUID() };
112
112
  };
@@ -133,6 +133,11 @@ body {
133
133
  display: none !important;
134
134
  }
135
135
  }
136
+ .hidden-mini-and-down {
137
+ @media (max-width: $bp-mini-max) {
138
+ display: none !important;
139
+ }
140
+ }
136
141
  .hidden-extra-small {
137
142
  @media (max-width: $bp-extra-small-max) {
138
143
  display: none !important;
@@ -10,3 +10,6 @@ $bp-small-max: 1023px;
10
10
  $bp-small-min: 768px;
11
11
 
12
12
  $bp-extra-small-max: 767px;
13
+ $bp-extra-small-min: 450px;
14
+
15
+ $bp-mini-max: 449px;
@@ -147,11 +147,9 @@
147
147
  <div class="ContactUs__contacts-row">
148
148
  <div class="ContactUs__contacts-entity">
149
149
  <i class="icon-mail-alt ContactUs__contacts-entity-icon"></i>
150
- <a
151
- :href="`mailto:${contacts.email}`"
152
- class="ContactUs__contacts-entity-value">
153
- {{ contacts.email }}
154
- </a>
150
+ <email-link
151
+ :email="contacts.email"
152
+ class="ContactUs__contacts-entity-value" />
155
153
  </div>
156
154
  <div class="ContactUs__contacts-entity">
157
155
  <i class="icon-phone ContactUs__contacts-entity-icon"></i>
@@ -171,9 +169,13 @@
171
169
  import { mapGetters } from 'vuex';
172
170
  import api from '@lancom/shared/assets/js/api';
173
171
  import gtm from '@lancom/shared/assets/js/utils/gtm';
172
+ import EmailLink from '@lancom/shared/components/email_link/email-link';
174
173
 
175
174
  export default {
176
175
  name: 'LancomContactUs',
176
+ components: {
177
+ EmailLink
178
+ },
177
179
  props: {
178
180
  btnClass: {
179
181
  type: String,
@@ -8,7 +8,7 @@
8
8
  <span v-if="country">
9
9
  <img
10
10
  v-if="checkedCountry"
11
- :src="checkedCountry.icon" />
11
+ :src="checkedCountry.icon | staticLink" />
12
12
  <i
13
13
  v-else
14
14
  class="icon-globe"></i>
@@ -75,12 +75,16 @@
75
75
 
76
76
  <script>
77
77
  import { mapGetters } from 'vuex';
78
+ import { staticLink } from '@lancom/shared/assets/js/utils/filters';
78
79
  import CheckedIcon from '@lancom/shared/components/common/checked-icon';
79
80
 
80
81
  const Cookie = process.client ? require('js-cookie') : undefined;
81
82
 
82
83
  export default {
83
84
  name: 'ClientSettings',
85
+ filters: {
86
+ staticLink
87
+ },
84
88
  components: {
85
89
  CheckedIcon
86
90
  },
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <a ref="link"></a>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: 'EmailLink',
8
+ props: {
9
+ email: {
10
+ type: Array | String,
11
+ required: true
12
+ }
13
+ },
14
+ mounted() {
15
+ if (process.client) {
16
+ const email = (Array.isArray(this.email) ? this.email : [this.email]).join('@');
17
+ const linkEl = this.$refs.link;
18
+ linkEl.href = `mailto:${email}`;
19
+ linkEl.textContent = email;
20
+ }
21
+ }
22
+ };
23
+ </script>
@@ -11,7 +11,7 @@
11
11
  }
12
12
  &__item-wrapper {
13
13
  width: 270px;
14
- height: 450px;
14
+ height: 490px;
15
15
  margin: 0 0 15px 15px;
16
16
  position: relative;
17
17
  z-index: 1;
@@ -73,7 +73,7 @@
73
73
  transition: opacity 0.35s ease-in-out;
74
74
  opacity: 1;
75
75
  position: absolute;
76
- top: 30px;
76
+ // top: 30px;
77
77
  max-width: 250px;
78
78
  }
79
79
  &__cover-hover {
@@ -81,14 +81,14 @@
81
81
  z-index: 2;
82
82
  opacity: 0;
83
83
  position: absolute;
84
- top: 30px;
84
+ // top: 30px;
85
85
  max-width: 250px;
86
86
  }
87
87
  &__link {
88
88
  position: relative;
89
89
  transition: background-color 0.5s ease;
90
90
  background-color: white;
91
- height: 300px;
91
+ height: 340px;
92
92
  width: 270px;
93
93
  display: flex;
94
94
  align-items: center;
@@ -42,7 +42,8 @@ async function googleShoppingFeed(axios, config, availableStores, country, isEdi
42
42
  const backImages = filterImagesByType('back');
43
43
  const additionalImages = filterImagesByType('additional_image_link');
44
44
  const catalogFrontImages = (product.images || []).filter(i => (i.types || []).includes('catalog_front')).map(i => i.image);
45
- const image = spliceFirstImage(feedImages) || spliceFirstImage(frontImages) || spliceFirstImage(catalogFrontImages) || spliceFirstImage(backImages) || null;
45
+ const feedImage = spliceFirstImage(feedImages);
46
+ const image = feedImage || spliceFirstImage(frontImages) || spliceFirstImage(catalogFrontImages) || spliceFirstImage(backImages) || null;
46
47
  const images = [
47
48
  ...additionalImages,
48
49
  ...((!backImages?.includes(image) && getImages(backImages)) || (!frontImages?.includes(image) && getImages(frontImages)) || [])
@@ -78,8 +79,8 @@ async function googleShoppingFeed(axios, config, availableStores, country, isEdi
78
79
  'g:condition': { _text: 'new' },
79
80
  'g:mpn': { _text: sp.SKU },
80
81
  'g:color': { _text: sp.color.name },
81
- 'g:image_link': { _text: sp.image || image },
82
- 'g:additional_image_link': (sp.image ? [image, ...images] : images).map(i => ({ _text: i })),
82
+ 'g:image_link': { _text: staticLink(feedImage || sp.image || image, config) },
83
+ 'g:additional_image_link': ((sp.image || feedImage) ? [image, ...images] : images).map(i => ({ _text: staticLink(i, config) })),
83
84
  'g:price': { _text: `${(sp.price || 0)} ${sp.currencyCode || 'AUD'}` },
84
85
  'g:availability': { _text: sp.quantityStock > 0 ? 'in_stock' : 'out_of_stock' },
85
86
  'g:google_product_category': { _text: product.feedGoogleProductCategory || 2047 },
@@ -159,7 +160,7 @@ async function googleShoppingFeed(axios, config, availableStores, country, isEdi
159
160
  }
160
161
 
161
162
  if (product.feedLifestyleImage) {
162
- info['g:lifestyle_image_link'] = { _text: product.feedLifestyleImage };
163
+ info['g:lifestyle_image_link'] = { _text: staticLink(product.feedLifestyleImage, config) };
163
164
  }
164
165
 
165
166
  return info;
@@ -208,8 +209,24 @@ function generateProductLink(product, color, toEditor) {
208
209
  return `${link}${color ? `?color=${color.alias || color}` : ''}`;
209
210
  }
210
211
 
212
+ export const staticLink = (link, config) => {
213
+ const { PROD_S3_BUCKET, DEV_S3_BUCKET, PROD_CDN_URL, DEV_CDN_URL, STATIC_URL } = config || {};
214
+ if ((link || '').startsWith('http')) {
215
+ if (PROD_S3_BUCKET && PROD_CDN_URL) {
216
+ link = link.replace(new RegExp(`https://${PROD_S3_BUCKET}[a-z\-\.0-9]+.amazonaws.com`), PROD_CDN_URL);
217
+ }
218
+ if (DEV_S3_BUCKET && PROD_CDN_URL) {
219
+ link = link.replace(new RegExp(`https://${DEV_S3_BUCKET}[a-z\-\.0-9]+.amazonaws.com`), DEV_CDN_URL);
220
+ }
221
+ return link;
222
+ } else {
223
+ return `${STATIC_URL || ''}${link}`;
224
+ };
225
+ }
226
+
211
227
 
212
228
  module.exports = {
213
229
  googleShoppingFeed,
214
- googleLocalShoppingFeed
230
+ googleLocalShoppingFeed,
231
+ generateProductLink
215
232
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.332",
3
+ "version": "0.0.334",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {