@designcrowd/library.brand-page 5.15.2 → 5.15.4

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.
Files changed (41) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-CC0IFuTS.js → CreatedOnBrandCrowd-de-de-D-JqIBXF.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-DHSPJreq.js → CreatedOnBrandCrowd-en-us-rj1RdP3D.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-D0Z2Ftc8.js → CreatedOnBrandCrowd-es-es-CQjoXEVn.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-B5m-vPKs.js → CreatedOnBrandCrowd-fr-ca-BLfDC22k.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-B5m-vPKs.js → CreatedOnBrandCrowd-fr-fr-BLfDC22k.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-BUldaocW.js → CreatedOnBrandCrowd-pt-br-DA4HMlpw.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-BUldaocW.js → CreatedOnBrandCrowd-pt-pt-DA4HMlpw.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-FfVsOpHR.js → CreatedOnDcom-de-de-DcSzC02I.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-D-MPmkgN.js → CreatedOnDcom-en-us-Cj099v1g.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-CNC_3nv0.js → CreatedOnDcom-es-es-BLMAaoWm.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-DzqdFn7y.js → CreatedOnDcom-fr-ca-DT5jxd5X.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-rBYGR5It.js → CreatedOnDcom-fr-fr-BVT8h3pj.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-CDu8WIMK.js → CreatedOnDcom-pt-br-DP4jKxkV.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-Dx-OKM33.js → CreatedOnDcom-pt-pt-B6K9BtIo.js} +1 -1
  15. package/lib/src/brand-page/utils/migration/migration-07.js +2 -1
  16. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +3 -1
  17. package/lib/src/brand-page-maker/constants/config-settings-constant.js +1 -1
  18. package/lib/src/css/library.brand-page-brandCrowd.min.css +22 -22
  19. package/lib/src/css/library.brand-page-brandPage.min.css +22 -22
  20. package/lib/src/css/library.brand-page-designCom.min.css +22 -22
  21. package/lib/src/css/library.brand-page-preview.min.css +22 -22
  22. package/lib/src/index.mjs +1 -1
  23. package/lib/src/{lib-BreGHBnl.js → lib-DV-z72zv.js} +5715 -5672
  24. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +3 -1
  25. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.js +3 -1
  26. package/lib/src/shared/ecommerce-settings/store/shop-settings-store.d.ts +3 -1
  27. package/lib/src/shared/ecommerce-settings/store/shop-settings-store.js +2 -2
  28. package/package.json +1 -1
  29. package/src/brand-page/components/logo/LogoRender.vue +1 -0
  30. package/src/brand-page/components/shop/FeaturedDisplay.vue +6 -7
  31. package/src/brand-page/components/shop/PaymentModal.vue +2 -0
  32. package/src/brand-page/components/shop/ProductDetailModal.vue +1 -2
  33. package/src/brand-page/components/shop/Shop.vue +31 -12
  34. package/src/brand-page/components/shop/TextDisplay.vue +6 -7
  35. package/src/brand-page/components/shop/ThumbnailDisplay.vue +6 -7
  36. package/src/brand-page/utils/migration/migration-07.ts +2 -1
  37. package/src/brand-page-maker/components/shop/AddOrEditProductContainer.vue +8 -3
  38. package/src/brand-page-maker/constants/config-settings-constant.ts +1 -1
  39. package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.ts +3 -1
  40. package/src/shared/ecommerce-settings/components/product-config-field/ProductConfigOption.vue +2 -4
  41. package/src/shared/ecommerce-settings/store/shop-settings-store.ts +4 -2
@@ -359,7 +359,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
359
359
  paymentConfig: BrandPagePaymentConfig | undefined;
360
360
  pages: import("../../../../brand-page").PageModel[];
361
361
  }): void;
362
- setPaymentConfig(value: BrandPagePaymentConfig): void;
362
+ setPaymentConfig(payload: {
363
+ paymentConfig: BrandPagePaymentConfig | undefined;
364
+ }): void;
363
365
  getProductById(id: string): import("../../../../brand-page/models/shop.model").ProductModel | undefined;
364
366
  addProduct(product: import("../../../../brand-page/models/shop.model").ProductModel): void;
365
367
  updateProduct(id: string, updatedProduct: import("../../../../brand-page/models/shop.model").ProductModel): void;
@@ -117,7 +117,9 @@ export default defineComponent({
117
117
  return;
118
118
  }
119
119
  if (this.isShop) {
120
- this.shopConfigStore.setPaymentConfig(paymentConfig);
120
+ this.shopConfigStore.setPaymentConfig({
121
+ paymentConfig: paymentConfig,
122
+ });
121
123
  }
122
124
  this.selectedPaymentConfig = paymentConfig;
123
125
  const value = {
@@ -99,7 +99,9 @@ export declare const useShopConfigStore: import("pinia").StoreDefinition<"shopCo
99
99
  paymentConfig: BrandPagePaymentConfig | undefined;
100
100
  pages: PageModel[];
101
101
  }): void;
102
- setPaymentConfig(value: BrandPagePaymentConfig): void;
102
+ setPaymentConfig(payload: {
103
+ paymentConfig: BrandPagePaymentConfig | undefined;
104
+ }): void;
103
105
  getProductById(id: string): ProductModel | undefined;
104
106
  addProduct(product: ProductModel): void;
105
107
  updateProduct(id: string, updatedProduct: ProductModel): void;
@@ -40,8 +40,8 @@ export const useShopConfigStore = defineStore('shopConfig', {
40
40
  Object.assign($state, newState);
41
41
  });
42
42
  },
43
- setPaymentConfig(value) {
44
- this.paymentConfig = value;
43
+ setPaymentConfig(payload) {
44
+ this.paymentConfig = payload.paymentConfig;
45
45
  },
46
46
  getProductById(id) {
47
47
  return this.products.find((x) => x.id === id);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@designcrowd/library.brand-page",
3
3
  "description": "A collection of Maker/Designer applications",
4
- "version": "5.15.2",
4
+ "version": "5.15.4",
5
5
  "author": "Design.com Eng",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -110,6 +110,7 @@ const logoStyle = computed(() => {
110
110
  : ({
111
111
  width: '100%',
112
112
  height: '100%',
113
+ 'max-width': '20rem',
113
114
  } as any);
114
115
  });
115
116
 
@@ -65,10 +65,6 @@ import TextWrapper from '../text-wrapper/TextWrapper.vue';
65
65
  import { type PropType } from 'vue';
66
66
  import type { ShopViewModel } from '../../view-models';
67
67
  import type { ProductModel } from '../../models/shop.model';
68
- import { useShopConfigStore } from '../../../shared/ecommerce-settings/store/shop-settings-store';
69
- import { computed } from 'vue';
70
-
71
- const shopSettingStore = useShopConfigStore();
72
68
 
73
69
  const props = defineProps({
74
70
  context: {
@@ -79,6 +75,11 @@ const props = defineProps({
79
75
  type: Object as PropType<ShopViewModel>,
80
76
  required: true,
81
77
  },
78
+ currencySymbol: {
79
+ type: String,
80
+ required: false,
81
+ default: '$',
82
+ },
82
83
  aspectRatio: {
83
84
  type: String,
84
85
  required: true,
@@ -94,13 +95,11 @@ const props = defineProps({
94
95
  },
95
96
  });
96
97
 
97
- const currencySymbol = computed(() => shopSettingStore.currencySymbol);
98
-
99
98
  const renderCurrencyAmount = (product: ProductModel): string => {
100
99
  const variantPrice = product.variant?.[0]?.options?.[0]?.price;
101
100
  const finalPrice = variantPrice ?? product.defaultPrice ?? '0';
102
101
 
103
- return `${currencySymbol.value} ${finalPrice}`;
102
+ return `${props.currencySymbol} ${finalPrice}`;
104
103
  };
105
104
 
106
105
  const emit = defineEmits(['on-product-detail']);
@@ -145,6 +145,7 @@ const paymentState = {
145
145
  interface Props {
146
146
  context: BrandPageContext;
147
147
  isVisible: boolean;
148
+ currencySymbol: string;
148
149
  buttonStyle: ButtonStyles;
149
150
  shopPaymentConfig: BrandPagePaymentConfig;
150
151
  descriptionStyle: TextStyleDeclaration | undefined;
@@ -153,6 +154,7 @@ interface Props {
153
154
 
154
155
  const props = withDefaults(defineProps<Props>(), {
155
156
  isVisible: true,
157
+ currencySymbol: '$',
156
158
  });
157
159
 
158
160
  const uniformDescriptionStyle = computed<TextStyleDeclaration>(() => ({
@@ -30,7 +30,7 @@
30
30
  {{ currentProduct.name }}
31
31
  </h1>
32
32
  <p class="tw-text-left tw-text-md tw-text-grayscale-800">
33
- {{ currencySymbol }} {{ itemPrice }}
33
+ {{ shopSettingStore.currencySymbol }} {{ itemPrice }}
34
34
  </p>
35
35
  <div v-if="currentProduct.hasVariants">
36
36
  <div
@@ -185,7 +185,6 @@ const cartSettingsStore = useCartStore();
185
185
  const shopSettingStore = useShopConfigStore();
186
186
 
187
187
  const products = computed(() => shopSettingStore.products);
188
- const currencySymbol = computed(() => shopSettingStore.currencySymbol);
189
188
  const currentProduct = computed(() => {
190
189
  // Use the first product if currentProduct is not found
191
190
  return (
@@ -32,6 +32,7 @@
32
32
  :view-model="viewModel"
33
33
  :context="context"
34
34
  :item-style="itemStyle"
35
+ :currency-symbol="data.defaultCurrencySymbol"
35
36
  @on-product-detail="onShowProductDetailModal"
36
37
  />
37
38
  <ThumbnailDisplay
@@ -40,6 +41,7 @@
40
41
  :context="context"
41
42
  :aspect-ratio="aspectRatio"
42
43
  :item-style="itemStyle"
44
+ :currency-symbol="data.defaultCurrencySymbol"
43
45
  :content-index="contentIndex"
44
46
  @on-product-detail="onShowProductDetailModal"
45
47
  />
@@ -49,6 +51,7 @@
49
51
  :context="context"
50
52
  :aspect-ratio="aspectRatio"
51
53
  :item-style="itemStyle"
54
+ :currency-symbol="data.defaultCurrencySymbol"
52
55
  :content-index="contentIndex"
53
56
  @on-product-detail="onShowProductDetailModal"
54
57
  />
@@ -88,6 +91,7 @@
88
91
  class="modal-product-detail"
89
92
  :product="data.product"
90
93
  :button-style="buttonStyle"
94
+ :currency-symbol="currencySymbol"
91
95
  @on-close="onClose"
92
96
  @on-show-success="onShowSuccess"
93
97
  />
@@ -95,6 +99,7 @@
95
99
  class="modal-cart"
96
100
  :is-visible="data.isCartModalVisible"
97
101
  :button-style="buttonStyle"
102
+ :currency-symbol="currencySymbol"
98
103
  @on-close="onCloseCart"
99
104
  @on-show-payment="onShowPaymentModal"
100
105
  />
@@ -104,6 +109,7 @@
104
109
  :is-visible="data.isPaymentModalVisible"
105
110
  :button-style="buttonStyle"
106
111
  :description-style="viewModel.descriptionStyle"
112
+ :currency-symbol="currencySymbol"
107
113
  :shop-payment-config="shopPaymentConfig"
108
114
  :context="context"
109
115
  :success-message="viewModel.successMessage"
@@ -134,18 +140,24 @@ import PaymentModal from './PaymentModal.vue';
134
140
  import brandPageClient from '../../clients/brand-page.client';
135
141
  import raygunUtil from '../../utils/raygun.util';
136
142
  import { shopTr } from '../../../composables/useTranslate';
137
- import { useShopConfigStore } from '../../../shared/ecommerce-settings/store/shop-settings-store';
138
143
 
139
- const props = withDefaults(
140
- defineProps<{
141
- context: BrandPageContext;
142
- viewModel: ShopViewModel;
143
- contentIndex: number;
144
- }>(),
145
- {},
146
- );
144
+ const props = defineProps({
145
+ context: {
146
+ type: Object as PropType<BrandPageContext>,
147
+ required: true,
148
+ },
149
+ viewModel: {
150
+ type: Object as PropType<ShopViewModel>,
151
+ required: true,
152
+ },
153
+ contentIndex: {
154
+ type: Number,
155
+ required: false,
156
+ default: undefined,
157
+ },
158
+ });
159
+
147
160
  const cartSettingsStore = useCartStore();
148
- const shopSettingStore = useShopConfigStore();
149
161
 
150
162
  const cart = computed(() => cartSettingsStore.cartItems);
151
163
 
@@ -189,6 +201,9 @@ const data = reactive({
189
201
  isAddCartSuccess: false,
190
202
  product: {} as ProductModel,
191
203
  isActivePaymentProvider: false,
204
+ defaultCurrencySymbol:
205
+ props.viewModel.shopPaymentConfig?.paymentConfig?.defaultCurrencySymbol ??
206
+ '$',
192
207
  });
193
208
 
194
209
  const viewCartText = computed(() => {
@@ -259,11 +274,15 @@ const backgroundStyle = computed((): any => {
259
274
  return props.viewModel.backgroundStyle;
260
275
  });
261
276
 
277
+ const currencySymbol = computed((): any => {
278
+ return props.viewModel.shopPaymentConfig.paymentConfig?.defaultCurrencySymbol;
279
+ });
280
+
262
281
  const shopPaymentConfig = computed((): BrandPagePaymentConfig => {
263
- if (!shopSettingStore.paymentConfig) {
282
+ if (!props.viewModel.shopPaymentConfig.paymentConfig) {
264
283
  throw new Error('No Payment Config found');
265
284
  }
266
- return shopSettingStore.paymentConfig;
285
+ return props.viewModel.shopPaymentConfig.paymentConfig;
267
286
  });
268
287
 
269
288
  const isTextDisplayStyle = computed(() => {
@@ -34,10 +34,6 @@ import TextWrapper from '../text-wrapper/TextWrapper.vue';
34
34
  import type { PropType } from 'vue';
35
35
  import type { ShopViewModel } from '../../view-models';
36
36
  import type { ProductModel } from '../../models/shop.model';
37
- import { useShopConfigStore } from '../../../shared/ecommerce-settings/store/shop-settings-store';
38
- import { computed } from 'vue';
39
-
40
- const shopSettingStore = useShopConfigStore();
41
37
 
42
38
  const props = defineProps({
43
39
  context: {
@@ -48,19 +44,22 @@ const props = defineProps({
48
44
  type: Object as PropType<ShopViewModel>,
49
45
  required: true,
50
46
  },
47
+ currencySymbol: {
48
+ type: String,
49
+ required: false,
50
+ default: '$',
51
+ },
51
52
  itemStyle: {
52
53
  type: Object,
53
54
  required: true,
54
55
  },
55
56
  });
56
57
 
57
- const currencySymbol = computed(() => shopSettingStore.currencySymbol);
58
-
59
58
  const renderCurrencyAmount = (product: ProductModel): string => {
60
59
  const variantPrice = product.variant?.[0]?.options?.[0]?.price;
61
60
  const finalPrice = variantPrice ?? product.defaultPrice ?? '0';
62
61
 
63
- return `${currencySymbol.value} ${finalPrice}`;
62
+ return `${props.currencySymbol} ${finalPrice}`;
64
63
  };
65
64
 
66
65
  const emit = defineEmits(['on-product-detail']);
@@ -51,10 +51,6 @@ import TextWrapper from '../text-wrapper/TextWrapper.vue';
51
51
  import type { PropType } from 'vue';
52
52
  import type { ShopViewModel } from '../../view-models';
53
53
  import type { ProductModel } from '../../models/shop.model';
54
- import { useShopConfigStore } from '../../../shared/ecommerce-settings/store/shop-settings-store';
55
- import { computed } from 'vue';
56
-
57
- const shopSettingStore = useShopConfigStore();
58
54
 
59
55
  const props = defineProps({
60
56
  context: {
@@ -65,6 +61,11 @@ const props = defineProps({
65
61
  type: Object as PropType<ShopViewModel>,
66
62
  required: true,
67
63
  },
64
+ currencySymbol: {
65
+ type: String,
66
+ required: false,
67
+ default: '$',
68
+ },
68
69
  aspectRatio: {
69
70
  type: String,
70
71
  required: true,
@@ -80,13 +81,11 @@ const props = defineProps({
80
81
  },
81
82
  });
82
83
 
83
- const currencySymbol = computed(() => shopSettingStore.currencySymbol);
84
-
85
84
  const renderCurrencyAmount = (product: ProductModel): string => {
86
85
  const variantPrice = product.variant?.[0]?.options?.[0]?.price;
87
86
  const finalPrice = variantPrice ?? product.defaultPrice ?? '0';
88
87
 
89
- return `${currencySymbol.value} ${finalPrice}`;
88
+ return `${props.currencySymbol} ${finalPrice}`;
90
89
  };
91
90
 
92
91
  const emit = defineEmits(['on-product-detail']);
@@ -99,7 +99,8 @@ export const migration07 = async (
99
99
  !logoData &&
100
100
  (sectionName === 'pageFooterDesktop' ||
101
101
  sectionName === 'pageFooterMobile' ||
102
- sectionName === 'pageHeaderMobile')
102
+ sectionName === 'pageHeaderMobile' ||
103
+ sectionName === 'pageHeaderDesktop')
103
104
  ) {
104
105
  const currentMaxHeight = config.logoImageHeight || DEFAULT_LOGO_HEIGHT;
105
106
  const heightValue = parseFloat(currentMaxHeight);
@@ -153,23 +153,28 @@ import {
153
153
  import { computed } from 'vue';
154
154
  import ProductItemField from './ProductItemField.vue';
155
155
  import { useProductConfigStore } from '../../../brand-page-maker/stores/product-config/product-config-store';
156
- import { useShopConfigStore } from '../../../shared/ecommerce-settings/store/shop-settings-store';
157
156
  import NumberInput from '../../../shared/common/NumberInput.vue';
158
157
  import { errorTr } from '../../../composables/useTranslate';
159
158
  import { productTr } from '../../../composables/useTranslate';
160
159
 
161
160
  const productSettingStore = useProductConfigStore();
162
- const shopConfigStore = useShopConfigStore();
163
161
  const imageUrl = computed(() => productSettingStore.productImageUrl);
164
162
  const MAX_PAYMENT_DESCRIPTION_LENGTH = 255;
165
163
  const MAX_PAYMENT_TITLE_LENGTH = 100;
166
164
  const MAX_PAYMENT_DESCRIPTION_REACHED_MSG = () =>
167
165
  errorTr('maxCharactersDescription');
168
166
  const MAX_PAYMENT_TITLE_REACHED_MSG = () => errorTr('maxCharactersTitle');
167
+ interface Props {
168
+ currencySymbol: string;
169
+ }
170
+
171
+ // TODO: currency need to be from productConfigStore
172
+ const props = withDefaults(defineProps<Props>(), {
173
+ currencySymbol: '$',
174
+ });
169
175
 
170
176
  const enableNotes = computed(() => productSettingStore.productEnableNotes);
171
177
  const hasVariants = computed(() => productSettingStore.productHasVariants);
172
- const currencySymbol = computed(() => shopConfigStore.currencySymbol);
173
178
 
174
179
  const emit = defineEmits(['update:modelValue']);
175
180
 
@@ -2993,7 +2993,7 @@ export const SHOP_SECTION_SETTINGS_CONFIG = (): ContentSettingsConfig<
2993
2993
  shouldRender: false,
2994
2994
  },
2995
2995
  paymentConfig: {
2996
- type: 'shop-payment-config',
2996
+ type: 'payment-config',
2997
2997
  groupId: REQUEST_PAYMENT_GROUPS.settings,
2998
2998
  overrideValueFieldName: 'shopPaymentConfig',
2999
2999
  },
@@ -135,7 +135,9 @@ export default defineComponent({
135
135
  }
136
136
 
137
137
  if (this.isShop) {
138
- this.shopConfigStore.setPaymentConfig(paymentConfig);
138
+ this.shopConfigStore.setPaymentConfig({
139
+ paymentConfig: paymentConfig,
140
+ });
139
141
  }
140
142
 
141
143
  this.selectedPaymentConfig = paymentConfig;
@@ -29,7 +29,7 @@
29
29
  <div class="tw-flex tw-flex-col tw-break-all">
30
30
  <div class="tw-text-md tw-font-sans">{{ product.item.name }}</div>
31
31
  <div class="tw-text-sm tw-text-grayscale-600">
32
- {{ currencySymbol }}{{ displayPrice(product) }}
32
+ {{ shopSettingStore.currencySymbol }}{{ displayPrice(product) }}
33
33
  </div>
34
34
  </div>
35
35
  </template>
@@ -56,7 +56,7 @@ import ItemsField from '../../../content-settings/components/items-field/ItemsFi
56
56
  import type { PaymentOption } from '../../../../brand-page/models';
57
57
  import { useShopConfigStore } from '../../store/shop-settings-store';
58
58
  import type { ProductModel } from '../../../../brand-page/models/shop.model';
59
- import { computed, reactive } from 'vue';
59
+ import { reactive } from 'vue';
60
60
  import type { DebounceHandle } from 'lodash.debounce';
61
61
  import cloneDeep from 'lodash.clonedeep';
62
62
  import type { UpdateItemValuePayload } from '../../../../shared/content-settings/models';
@@ -83,8 +83,6 @@ const data = reactive({
83
83
  const shopSettingStore = useShopConfigStore();
84
84
  const productSettingStore = useProductConfigStore();
85
85
 
86
- const currencySymbol = computed(() => shopSettingStore.currencySymbol);
87
-
88
86
  const onAddNewProduct = () => {
89
87
  productSettingStore.openModal(undefined);
90
88
  };
@@ -68,8 +68,10 @@ export const useShopConfigStore = defineStore('shopConfig', {
68
68
  Object.assign($state, newState);
69
69
  });
70
70
  },
71
- setPaymentConfig(value: BrandPagePaymentConfig): void {
72
- this.paymentConfig = value;
71
+ setPaymentConfig(payload: {
72
+ paymentConfig: BrandPagePaymentConfig | undefined;
73
+ }): void {
74
+ this.paymentConfig = payload.paymentConfig;
73
75
  },
74
76
  getProductById(id: string): ProductModel | undefined {
75
77
  return this.products.find((x) => x.id === id);