@designcrowd/library.brand-page 5.15.1 → 5.15.2

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