@retailrocketgroup/retailrocket-edit.abandoned-basket-price-drop-vue-email-template-render 3.0.381747 → 5.0.384700

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 (42) hide show
  1. package/.turbo/turbo-build.log +25 -0
  2. package/dist/assets/index.css +1 -0
  3. package/dist/assets/index.js +379 -0
  4. package/dist/assets/index.js.map +1 -0
  5. package/dist/editAbandonedBasketPriceDropEmailTemplate.d.ts +0 -0
  6. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/abandonedBasketPriceDropComponentSectionItemFactory.d.ts +4 -0
  7. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/abandonedBasketPriceDropEmailComponentFactory.d.ts +4 -0
  8. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/abandonedBasketPriceDropComponentLibraryFactory.d.ts +4 -0
  9. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/abandonedBasketPriceDropSectionFactory.d.ts +4 -0
  10. package/dist/implementation/DataSources/ListDataExpressionSource/abandonedBasketPriceDropEvaluateListExpressionDataSourceFactory.d.ts +8 -0
  11. package/dist/implementation/DataSources/NumberExpressionDataSource/abandonedBasketPriceDropEvaluateNumberExpressionDataSourceFactory.d.ts +2 -0
  12. package/dist/implementation/DataSources/StringExpressionDataSource/abandonedBasketPriceDropEvaluateStringExpressionDataSource.d.ts +9 -0
  13. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/abandonedBasketPriceDropProductListShelfBuilderDepsFactory.d.ts +8 -0
  14. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/alternativeProductsForAbandonedBasketPriceDropProductListShelfBuilderDepsFactory.d.ts +8 -0
  15. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModal/abandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModalDepsFactory.d.ts +11 -0
  16. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/abandonedBasketPriceDropProductShelfDataSourceExpressionBuilderDepsFactory.d.ts +11 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.html +35 -0
  19. package/env.d.ts +1 -0
  20. package/index.html +2 -2
  21. package/package.json +1 -1
  22. package/src/editAbandonedBasketPriceDropEmailTemplate.ts +408 -0
  23. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/abandonedBasketPriceDropComponentSectionItemFactory.ts +32 -0
  24. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/abandonedBasketPriceDropEmailComponentFactory.ts +26 -0
  25. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/abandonedBasketPriceDropComponentLibraryFactory.ts +29 -0
  26. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/abandonedBasketPriceDropSectionFactory.ts +34 -0
  27. package/src/implementation/DataSources/ListDataExpressionSource/abandonedBasketPriceDropEvaluateListExpressionDataSourceFactory.ts +125 -0
  28. package/src/implementation/DataSources/NumberExpressionDataSource/abandonedBasketPriceDropEvaluateNumberExpressionDataSourceFactory.ts +10 -0
  29. package/src/implementation/DataSources/StringExpressionDataSource/abandonedBasketPriceDropEvaluateStringExpressionDataSource.ts +56 -0
  30. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/abandonedBasketPriceDropProductListShelfBuilderDepsFactory.ts +33 -0
  31. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/alternativeProductsForAbandonedBasketPriceDropProductListShelfBuilderDepsFactory.ts +33 -0
  32. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModal/abandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModalDepsFactory.ts +142 -0
  33. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/abandonedBasketPriceDropProductShelfDataSourceExpressionBuilderDepsFactory.ts +34 -0
  34. package/src/index.ts +0 -0
  35. package/tsconfig.app.json +19 -0
  36. package/tsconfig.json +14 -0
  37. package/tsconfig.node.json +11 -0
  38. package/tsconfig.test.json +11 -0
  39. package/vite.config.ts +36 -0
  40. package/assets/main.css +0 -1
  41. package/assets/main.js +0 -217
  42. package/favicon.ico +0 -0
@@ -0,0 +1,26 @@
1
+ import type { EmailComponentType } from '@easy-wizzy/core';
2
+ import type {
3
+ Component,
4
+ } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.addcomponentlibrarysectionitemmodalwindow/main';
5
+ import type {
6
+ AbandonedBasketPriceDropListExpressionDataSource
7
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
8
+ import type {
9
+ AbandonedBasketPriceDropNumberExpressionDataSource
10
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
11
+ import type {
12
+ AbandonedBasketPriceDropStringExpressionDataSource
13
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
14
+
15
+ export const abandonedBasketPriceDropEmailComponentFactory = (
16
+ component: Component
17
+ ): EmailComponentType<
18
+ AbandonedBasketPriceDropListExpressionDataSource,
19
+ AbandonedBasketPriceDropNumberExpressionDataSource,
20
+ AbandonedBasketPriceDropStringExpressionDataSource
21
+ > =>
22
+ {
23
+ return component.triggerAbandonedBasketPriceDrop
24
+ ? JSON.parse(component.triggerAbandonedBasketPriceDrop.componentJson)
25
+ : JSON.parse(component.common!.componentJson)
26
+ }
@@ -0,0 +1,29 @@
1
+ import type {
2
+ ComponentLibrarySection,
3
+ } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
4
+ import type {
5
+ CustomComponentLibraryType
6
+ } from '@easy-wizzy/core';
7
+ import type {
8
+ AbandonedBasketPriceDropListExpressionDataSource
9
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
10
+ import type {
11
+ AbandonedBasketPriceDropNumberExpressionDataSource
12
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
13
+ import type {
14
+ AbandonedBasketPriceDropStringExpressionDataSource
15
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
16
+ import {
17
+ abandonedBasketPriceDropSectionFactory
18
+ } from '@/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/abandonedBasketPriceDropSectionFactory';
19
+
20
+ export const abandonedBasketPriceDropComponentLibraryFactory = (
21
+ componentLibrary: Array<ComponentLibrarySection>
22
+ ): CustomComponentLibraryType<
23
+ AbandonedBasketPriceDropListExpressionDataSource,
24
+ AbandonedBasketPriceDropNumberExpressionDataSource,
25
+ AbandonedBasketPriceDropStringExpressionDataSource
26
+ > => {
27
+ return componentLibrary
28
+ .map(section => abandonedBasketPriceDropSectionFactory(section))
29
+ }
@@ -0,0 +1,34 @@
1
+ import type {
2
+ ComponentLibrarySection,
3
+ } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
4
+ import type {
5
+ CustomComponentSectionType
6
+ } from '@easy-wizzy/core';
7
+ import type {
8
+ AbandonedBasketPriceDropListExpressionDataSource
9
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
10
+ import type {
11
+ AbandonedBasketPriceDropNumberExpressionDataSource
12
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
13
+ import type {
14
+ AbandonedBasketPriceDropStringExpressionDataSource
15
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
16
+ import {
17
+ abandonedBasketPriceDropComponentSectionItemFactory
18
+ } from '@/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/abandonedBasketPriceDropComponentSectionItemFactory';
19
+
20
+ export const abandonedBasketPriceDropSectionFactory = (
21
+ section: ComponentLibrarySection,
22
+ ): CustomComponentSectionType<
23
+ AbandonedBasketPriceDropListExpressionDataSource,
24
+ AbandonedBasketPriceDropNumberExpressionDataSource,
25
+ AbandonedBasketPriceDropStringExpressionDataSource
26
+ > => {
27
+ return {
28
+ sectionId: section.sectionId,
29
+ sectionName: section.sectionName,
30
+ componentList: section
31
+ .sectionItems
32
+ .map(component => abandonedBasketPriceDropComponentSectionItemFactory(component)),
33
+ };
34
+ };
@@ -0,0 +1,125 @@
1
+ import type {
2
+ DataListType
3
+ } from '@easy-wizzy/core';
4
+ import type { ListExpressionDataSourceBffClient } from '@easy-wizzy/common-app';
5
+ import type { ListExpressionDataSourceEvaluatorDelegate } from '@easy-wizzy/core';
6
+ import { getPopularProducts } from '@easy-wizzy/common-app';
7
+ import { stockIdFactory } from '@easy-wizzy/common-app';
8
+ import type { AbandonedBasketPriceDropListExpressionDataSource } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
9
+ import { abandonedBasketPriceDropListExpressionDataSourceMatcher } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
10
+ import { getProductList } from '@easy-wizzy/common-app';
11
+ import { getRelatedProducts } from '@easy-wizzy/common-app';
12
+ import { getAlternativeProducts } from '@easy-wizzy/common-app';
13
+ import { getPopularProductsInCategories } from '@easy-wizzy/common-app';
14
+ import type { Product } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.listexpressiondatasource';
15
+ import { getLatestProducts } from '@easy-wizzy/common-app';
16
+ import { getSaleByPopularProducts } from '@easy-wizzy/common-app';
17
+ import { getSaleByLatestProducts } from '@easy-wizzy/common-app';
18
+ import { getSampleProductsForPreview } from '@easy-wizzy/common-app';
19
+
20
+ export const abandonedBasketPriceDropEvaluateListExpressionDataSourceFactory = (arg: {
21
+ partnerId: string;
22
+ listExpressionDataSourceBffClient: ListExpressionDataSourceBffClient;
23
+ customerStockId: string | undefined;
24
+ }): ListExpressionDataSourceEvaluatorDelegate<AbandonedBasketPriceDropListExpressionDataSource> => {
25
+ let productCache: { [key: string]: Product } = {};
26
+
27
+ return (asyncDataSource: AbandonedBasketPriceDropListExpressionDataSource) =>
28
+ abandonedBasketPriceDropListExpressionDataSourceMatcher(asyncDataSource).Match<Promise<DataListType>>({
29
+ AbandonedBasketPriceDropProductList: ({ StockSource }) =>
30
+ getSampleProductsForPreview({
31
+ partnerId: arg.partnerId,
32
+ stockId: stockIdFactory({
33
+ stockSource: StockSource,
34
+ customerStockId: arg.customerStockId,
35
+ }),
36
+ getSampleProductsForPreviewHttpClient: arg.listExpressionDataSourceBffClient.postGetSampleProductsForPreview,
37
+ }),
38
+ AlternativeProductsForAbandonedBasketPriceDropProductList: ({ StockSource }) =>
39
+ getSampleProductsForPreview({
40
+ partnerId: arg.partnerId,
41
+ stockId: stockIdFactory({
42
+ stockSource: StockSource,
43
+ customerStockId: arg.customerStockId,
44
+ }),
45
+ getSampleProductsForPreviewHttpClient: arg.listExpressionDataSourceBffClient.postGetSampleProductsForPreview,
46
+ }),
47
+ ProductList: ({ ProductIds, StockSource }) =>
48
+ getProductList({
49
+ partnerId: arg.partnerId,
50
+ productIDs: ProductIds,
51
+ stockId: stockIdFactory({
52
+ stockSource: StockSource,
53
+ customerStockId: arg.customerStockId,
54
+ }),
55
+ productCache: productCache,
56
+ getProductsByIDsHttpClient: arg.listExpressionDataSourceBffClient.postGetProductsByIds,
57
+ }),
58
+ RelatedProductsFor: ({ ProductIds, StockSource }) =>
59
+ getRelatedProducts({
60
+ partnerId: arg.partnerId,
61
+ productIDs: ProductIds,
62
+ stockId: stockIdFactory({
63
+ stockSource: StockSource,
64
+ customerStockId: arg.customerStockId
65
+ }),
66
+ getRelatedProducts: arg.listExpressionDataSourceBffClient.postGetRelatedRecommendations,
67
+ }),
68
+ AlternativeProductsFor: ({ ProductIds, StockSource }) =>
69
+ getAlternativeProducts({
70
+ partnerId: arg.partnerId,
71
+ productIDs: ProductIds,
72
+ stockId: stockIdFactory({
73
+ stockSource: StockSource,
74
+ customerStockId: arg.customerStockId,
75
+ }),
76
+ getAlternativeProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetAlternativeRecommendations,
77
+ }),
78
+ PopularProductsInCategories: ({ CategoryIds, StockSource }) =>
79
+ getPopularProductsInCategories({
80
+ partnerId: arg.partnerId,
81
+ categoryIds: CategoryIds,
82
+ stockId: stockIdFactory({
83
+ stockSource: StockSource,
84
+ customerStockId: arg.customerStockId,
85
+ }),
86
+ getPopularProductsInCategoriesHttpClient: arg.listExpressionDataSourceBffClient.postGetPopularInCategoriesRecommendations,
87
+ }),
88
+ Popular: ({ StockSource }) =>
89
+ getPopularProducts({
90
+ partnerId: arg.partnerId,
91
+ stockId: stockIdFactory({
92
+ stockSource: StockSource,
93
+ customerStockId: arg.customerStockId,
94
+ }),
95
+ getPopularProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetPopularRecommendations,
96
+ }),
97
+ Latest: ({ StockSource }) =>
98
+ getLatestProducts({
99
+ partnerId: arg.partnerId,
100
+ stockId: stockIdFactory({
101
+ stockSource: StockSource,
102
+ customerStockId: arg.customerStockId,
103
+ }),
104
+ getLatestProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetLatestRecommendations,
105
+ }),
106
+ SaleByPopular: ({ StockSource }) =>
107
+ getSaleByPopularProducts({
108
+ partnerId: arg.partnerId,
109
+ stockId: stockIdFactory({
110
+ stockSource: StockSource,
111
+ customerStockId: arg.customerStockId,
112
+ }),
113
+ getSaleByPopularProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetSaleByPopularRecommendations,
114
+ }),
115
+ SaleByLatest: ({ StockSource }) =>
116
+ getSaleByLatestProducts({
117
+ partnerId: arg.partnerId,
118
+ stockId: stockIdFactory({
119
+ stockSource: StockSource,
120
+ customerStockId: arg.customerStockId,
121
+ }),
122
+ getSaleByLatestProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetSaleByLatestRecommendations,
123
+ }),
124
+ });
125
+ };
@@ -0,0 +1,10 @@
1
+ import type {
2
+ NumberExpressionDataSourceEvaluatorDelegate
3
+ } from '@easy-wizzy/core';
4
+
5
+ export const abandonedBasketPriceDropEvaluateNumberExpressionDataSourceFactory = <
6
+ TNumberExpressionDataSource
7
+ >():
8
+ NumberExpressionDataSourceEvaluatorDelegate<TNumberExpressionDataSource> => {
9
+ return () => Promise.resolve(0);
10
+ }
@@ -0,0 +1,56 @@
1
+ import type {
2
+ StringExpressionDataSourceEvaluatorDelegate
3
+ } from '@easy-wizzy/core';
4
+ import type { ContactCustomData } from '@easy-wizzy/retailrocket-common';
5
+ import type {
6
+ ProductImageUrlBuilderExpressionEvaluatorDelegate
7
+ } from '@easy-wizzy/common-app';
8
+ import type {
9
+ DataType
10
+ } from '@easy-wizzy/core';
11
+ import type {
12
+ AbandonedBasketPriceDropListExpressionDataSource
13
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
14
+ import type {
15
+ AbandonedBasketPriceDropNumberExpressionDataSource
16
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
17
+ import type {
18
+ AbandonedBasketPriceDropStringExpressionDataSource
19
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
20
+ import {
21
+ abandonedBasketPriceDropStringExpressionDataSourceMatcher
22
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
23
+ import type { NextCouponFromBatchType } from '@easy-wizzy/retailrocket-common';
24
+
25
+ export const abandonedBasketPriceDropStringExpressionDataSourceEvaluatorFactory = (arg: {
26
+ productImageUrlBuilderExpressionEvaluator: ProductImageUrlBuilderExpressionEvaluatorDelegate<
27
+ AbandonedBasketPriceDropListExpressionDataSource,
28
+ AbandonedBasketPriceDropNumberExpressionDataSource
29
+ >
30
+ contactCustomData: ContactCustomData
31
+ nextCouponFromBatch: NextCouponFromBatchType
32
+ }): StringExpressionDataSourceEvaluatorDelegate<
33
+ AbandonedBasketPriceDropStringExpressionDataSource
34
+ > => {
35
+ const abandonedBasketPriceDropContactCustomData = arg.contactCustomData;
36
+
37
+ return (a: {
38
+ stringExpressionDataSource: AbandonedBasketPriceDropStringExpressionDataSource,
39
+ context: DataType
40
+ }) => abandonedBasketPriceDropStringExpressionDataSourceMatcher(
41
+ a.stringExpressionDataSource
42
+ )
43
+ .Match({
44
+ StringFromContactCustomData: (x) => Promise.resolve(abandonedBasketPriceDropContactCustomData[x.FieldName] as string),
45
+ StringFromContactCustomDataWithFallback: (x) => Promise.resolve(
46
+ x.FieldName in abandonedBasketPriceDropContactCustomData && typeof abandonedBasketPriceDropContactCustomData[x.FieldName] === 'string'
47
+ ? abandonedBasketPriceDropContactCustomData[x.FieldName] as string
48
+ : x.FallbackValue
49
+ ),
50
+ ProductImageUrlBuilderExpression: e => arg.productImageUrlBuilderExpressionEvaluator({
51
+ expression: e,
52
+ context: a.context
53
+ }),
54
+ NextCouponFromBatch: () => Promise.resolve('Coupon')
55
+ });
56
+ }
@@ -0,0 +1,33 @@
1
+ import type { LocaleKey } from '@easy-wizzy/core';
2
+ import type { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
3
+ import {
4
+ getAllStockIdsFactory
5
+ } from '@easy-wizzy/common-app';
6
+ import type {
7
+ AbandonedBasketPriceDropProductListShelfBuilderDeps
8
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
9
+
10
+ export const abandonedBasketPriceDropProductListShelfBuilderDepsFactory = (
11
+ arg: {
12
+ localeKey: LocaleKey;
13
+ partnerId: string,
14
+ getAllStockIdsHttpClient: ProductShelfBuilderModalWindowBffClient['postGetAllStockIds']
15
+ }
16
+ ): AbandonedBasketPriceDropProductListShelfBuilderDeps => {
17
+ return {
18
+ localeKey: arg.localeKey,
19
+ getAllStockIds: getAllStockIdsFactory({
20
+ partnerId: arg.partnerId,
21
+ getAllStockIdsHttpClient: arg.getAllStockIdsHttpClient
22
+ }),
23
+ stockSelectorDeps: {
24
+ localeKey: arg.localeKey,
25
+ stockSourceSelectorDeps: {
26
+ localeKey: arg.localeKey
27
+ }
28
+ },
29
+ productListShelfLimiterDeps: {
30
+ localeKey: arg.localeKey
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,33 @@
1
+ import type { LocaleKey } from '@easy-wizzy/core';
2
+ import type { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
3
+ import {
4
+ getAllStockIdsFactory
5
+ } from '@easy-wizzy/common-app';
6
+ import type {
7
+ AlternativeProductsForAbandonedBasketPriceDropProductListShelfBuilderDeps
8
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
9
+
10
+ export const alternativeProductsForAbandonedProductListShelfBuilderDepsFactory = (
11
+ arg: {
12
+ localeKey: LocaleKey;
13
+ partnerId: string,
14
+ getAllStockIdsHttpClient: ProductShelfBuilderModalWindowBffClient['postGetAllStockIds']
15
+ }
16
+ ): AlternativeProductsForAbandonedBasketPriceDropProductListShelfBuilderDeps => {
17
+ return {
18
+ localeKey: arg.localeKey,
19
+ getAllStockIds: getAllStockIdsFactory({
20
+ partnerId: arg.partnerId,
21
+ getAllStockIdsHttpClient: arg.getAllStockIdsHttpClient
22
+ }),
23
+ stockSelectorDeps: {
24
+ localeKey: arg.localeKey,
25
+ stockSourceSelectorDeps: {
26
+ localeKey: arg.localeKey
27
+ }
28
+ },
29
+ productListShelfLimiterDeps: {
30
+ localeKey: arg.localeKey
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,142 @@
1
+ import type { LocaleKey } from '@easy-wizzy/core';
2
+ import {
3
+ popularProductListShelfBuilderDepsFactory
4
+ } from '@easy-wizzy/common-app';
5
+ import type { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
6
+ import type {
7
+ AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModalDeps
8
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
9
+ import {
10
+ alternativeProductsForAbandonedProductListShelfBuilderDepsFactory
11
+ } from '@/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/alternativeProductsForAbandonedBasketPriceDropProductListShelfBuilderDepsFactory';
12
+ import {
13
+ abandonedBasketPriceDropProductListShelfBuilderDepsFactory
14
+ } from '@/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/abandonedBasketPriceDropProductListShelfBuilderDepsFactory';
15
+ import {
16
+ latestProductListShelfBuilderDepsFactory
17
+ } from '@easy-wizzy/common-app';
18
+ import {
19
+ saleByPopularProductListShelfBuilderDepsFactory
20
+ } from '@easy-wizzy/common-app';
21
+ import {
22
+ saleByLatestProductListShelfBuilderDepsFactory
23
+ } from '@easy-wizzy/common-app';
24
+ import {
25
+ productListComposerModalWindowDepsFactory
26
+ } from '@easy-wizzy/common-app';
27
+ import type {
28
+ ProductCategoryPickerModalWindowBffClient
29
+ } from '@easy-wizzy/common-app';
30
+ import type { ProductPickerModalWindowBffClient } from '@easy-wizzy/common-app';
31
+ import {
32
+ categoryListComposerModalWindowDepsFactory
33
+ } from '@easy-wizzy/common-app';
34
+ import {
35
+ alternativeProductListShelfBuilderDepsFactory
36
+ } from '@easy-wizzy/common-app';
37
+ import {
38
+ relatedProductListShelfBuilderDepsFactory
39
+ } from '@easy-wizzy/common-app';
40
+ import {
41
+ productListShelfBuilderDepsFactory
42
+ } from '@easy-wizzy/common-app';
43
+ import {
44
+ popularFromCategoryListShelfBuilderDepsFactory
45
+ } from '@easy-wizzy/common-app';
46
+
47
+ export const abandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModalDepsFactory = (
48
+ arg: {
49
+ localeKey: LocaleKey;
50
+ partnerId: string,
51
+ customerStockId: string | undefined,
52
+ productShelfBuilderModalWindowBffClient: ProductShelfBuilderModalWindowBffClient,
53
+ productCategoryPickerModalWindowBffClient: ProductCategoryPickerModalWindowBffClient,
54
+ productPickerModalWindowBffClient: ProductPickerModalWindowBffClient,
55
+ }
56
+ ): AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModalDeps => {
57
+
58
+ const productCache = {};
59
+ const categoryCache = {};
60
+
61
+ const productListComposerModalWindowDeps = productListComposerModalWindowDepsFactory({
62
+ localeKey: arg.localeKey,
63
+ partnerId: arg.partnerId,
64
+ customerStockId: arg.customerStockId,
65
+ productPickerModalWindowBffClient: arg.productPickerModalWindowBffClient,
66
+ });
67
+
68
+ return {
69
+ localeKey: arg.localeKey,
70
+ ProductListComposerModalWindowDeps: productListComposerModalWindowDeps,
71
+ CategoryListComposerModalWindowDeps: categoryListComposerModalWindowDepsFactory({
72
+ localeKey: arg.localeKey,
73
+ partnerId: arg.partnerId,
74
+ productCategoryPickerModalWindowBffClient: arg.productCategoryPickerModalWindowBffClient
75
+ }),
76
+ AbandonedBasketPriceDropProductListShelfBuilderDeps: abandonedBasketPriceDropProductListShelfBuilderDepsFactory({
77
+ localeKey: arg.localeKey,
78
+ partnerId: arg.partnerId,
79
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
80
+ }),
81
+ AlternativeProductsForAbandonedBasketPriceDropProductListShelfBuilderDeps: alternativeProductsForAbandonedProductListShelfBuilderDepsFactory({
82
+ localeKey: arg.localeKey,
83
+ partnerId: arg.partnerId,
84
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
85
+ }),
86
+ ProductListShelfBuilderDeps: productListShelfBuilderDepsFactory({
87
+ localeKey: arg.localeKey,
88
+ partnerId: arg.partnerId,
89
+ customerStockId: arg.customerStockId,
90
+ productCache: productCache,
91
+ getProductsByIDsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetProductsByIds,
92
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds,
93
+ productListComposerModalWindowDeps: productListComposerModalWindowDeps
94
+ }),
95
+ RelatedProductListShelfBuilderDeps: relatedProductListShelfBuilderDepsFactory({
96
+ localeKey: arg.localeKey,
97
+ partnerId: arg.partnerId,
98
+ customerStockId: arg.customerStockId,
99
+ productCache: productCache,
100
+ getProductsByIDsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetProductsByIds,
101
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds,
102
+ productListComposerModalWindowDeps: productListComposerModalWindowDeps
103
+ }),
104
+ AlternativeProductListShelfBuilderDeps: alternativeProductListShelfBuilderDepsFactory({
105
+ localeKey: arg.localeKey,
106
+ partnerId: arg.partnerId,
107
+ customerStockId: arg.customerStockId,
108
+ productCache: productCache,
109
+ getProductsByIDsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetProductsByIds,
110
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds,
111
+ productListComposerModalWindowDeps: productListComposerModalWindowDeps
112
+ }),
113
+ PopularFromCategoryListShelfBuilderDeps: popularFromCategoryListShelfBuilderDepsFactory({
114
+ localeKey: arg.localeKey,
115
+ partnerId: arg.partnerId,
116
+ categoryCache: categoryCache,
117
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds,
118
+ getCategoriesByIDsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetProductCategoriesByIds,
119
+ productCategoryPickerModalWindowBffClient: arg.productCategoryPickerModalWindowBffClient
120
+ }),
121
+ PopularProductListShelfBuilderDeps: popularProductListShelfBuilderDepsFactory({
122
+ localeKey: arg.localeKey,
123
+ partnerId: arg.partnerId,
124
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
125
+ }),
126
+ LatestProductListShelfBuilderDeps: latestProductListShelfBuilderDepsFactory({
127
+ localeKey: arg.localeKey,
128
+ partnerId: arg.partnerId,
129
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
130
+ }),
131
+ SaleByPopularProductListShelfBuilderDeps: saleByPopularProductListShelfBuilderDepsFactory({
132
+ localeKey: arg.localeKey,
133
+ partnerId: arg.partnerId,
134
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
135
+ }),
136
+ SaleByLatestProductListShelfBuilderDeps: saleByLatestProductListShelfBuilderDepsFactory({
137
+ localeKey: arg.localeKey,
138
+ partnerId: arg.partnerId,
139
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
140
+ })
141
+ }
142
+ }
@@ -0,0 +1,34 @@
1
+ import type { LocaleKey } from '@easy-wizzy/core';
2
+ import type { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
3
+ import type {
4
+ AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderDeps
5
+ } from '@easy-wizzy/retailrocket-abandoned-basket-price-drop';
6
+ import {
7
+ abandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModalDepsFactory
8
+ } from '@/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModal/abandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModalDepsFactory';
9
+ import type {
10
+ ProductCategoryPickerModalWindowBffClient
11
+ } from '@easy-wizzy/common-app';
12
+ import type { ProductPickerModalWindowBffClient } from '@easy-wizzy/common-app';
13
+
14
+ export const abandonedBasketPriceDropProductShelfDataSourceExpressionBuilderDepsFactory = (
15
+ arg: {
16
+ localeKey: LocaleKey;
17
+ partnerId: string,
18
+ customerStockId: string | undefined,
19
+ productShelfBuilderModalWindowBffClient: ProductShelfBuilderModalWindowBffClient,
20
+ productCategoryPickerModalWindowBffClient: ProductCategoryPickerModalWindowBffClient,
21
+ productPickerModalWindowBffClient: ProductPickerModalWindowBffClient
22
+ }
23
+ ): AbandonedBasketPriceDropProductShelfDataSourceExpressionBuilderDeps => {
24
+ return {
25
+ abandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModalDeps: abandonedBasketPriceDropProductShelfDataSourceExpressionBuilderModalDepsFactory({
26
+ localeKey: arg.localeKey,
27
+ partnerId: arg.partnerId,
28
+ customerStockId: arg.customerStockId,
29
+ productShelfBuilderModalWindowBffClient: arg.productShelfBuilderModalWindowBffClient,
30
+ productCategoryPickerModalWindowBffClient: arg.productCategoryPickerModalWindowBffClient,
31
+ productPickerModalWindowBffClient: arg.productPickerModalWindowBffClient
32
+ })
33
+ }
34
+ }
package/src/index.ts ADDED
File without changes
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "@easy-wizzy/ts-config/app.json",
3
+ "include": [
4
+ "env.d.ts",
5
+ "src/**/*.ts",
6
+ "src/**/*.vue"
7
+ ],
8
+ "exclude": [
9
+ "src/**/*.spec.ts"
10
+ ],
11
+ "compilerOptions": {
12
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
13
+ "paths": {
14
+ "@/*": [
15
+ "./src/*"
16
+ ]
17
+ }
18
+ }
19
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.node.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.app.json"
9
+ },
10
+ {
11
+ "path": "./tsconfig.test.json"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "@easy-wizzy/ts-config/node.json",
3
+ "include": [
4
+ "vite.config.*",
5
+ "vitest.config.*",
6
+ "eslint.config.*"
7
+ ],
8
+ "compilerOptions": {
9
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo"
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "./tsconfig.app.json",
3
+ "include": [
4
+ "env.d.ts",
5
+ "src/**/*.spec.ts"
6
+ ],
7
+ "exclude": [],
8
+ "compilerOptions": {
9
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.test.tsbuildinfo"
10
+ }
11
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,36 @@
1
+ import vue from '@vitejs/plugin-vue';
2
+ import { fileURLToPath, URL } from 'node:url';
3
+ import { defineConfig } from 'vite';
4
+ import dts from 'vite-plugin-dts';
5
+
6
+ export default defineConfig({
7
+ build: {
8
+ rollupOptions: {
9
+ input: fileURLToPath(new URL('./index.html', import.meta.url)),
10
+ output: {
11
+ entryFileNames: 'assets/[name].js',
12
+ chunkFileNames: 'assets/[name].js',
13
+ assetFileNames: 'assets/[name].[ext]',
14
+ },
15
+ },
16
+ sourcemap: true,
17
+ },
18
+ plugins: [
19
+ vue({
20
+ template: {
21
+ compilerOptions: {
22
+ isCustomElement: tag => ['center'].includes(tag)
23
+ }
24
+ }
25
+ }),
26
+ dts({
27
+ insertTypesEntry: true,
28
+ tsconfigPath: './tsconfig.app.json',
29
+ })
30
+ ],
31
+ resolve: {
32
+ alias: {
33
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
34
+ },
35
+ },
36
+ })