@retailrocketgroup/retailrocket-edit.transactional-vue-email-template-render 3.0.377566 → 5.0.384530

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/editTransactionalEmailTemplateApp.d.ts +0 -0
  6. package/dist/httpClient/TransactionalWysiwygTemplateEditorClient.d.ts +2 -0
  7. package/dist/implementation/AppSettingsModifierPlugin/transactionalDataAppSettingsModifierPluginFactory.d.ts +6 -0
  8. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/transactionalComponentSectionItemFactory.d.ts +4 -0
  9. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/transactionalEmailComponentFactory.d.ts +4 -0
  10. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/transactionalComponentLibraryFactory.d.ts +4 -0
  11. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/transactionalSectionFactory.d.ts +4 -0
  12. package/dist/implementation/DataSources/ListDataExpressionSource/transactionalListExpressionDataSourceEvaluatorFactory.d.ts +9 -0
  13. package/dist/implementation/DataSources/NumberExpressionDataSource/transactionalNumberExpressionDataSourceEvaluatorFactory.d.ts +5 -0
  14. package/dist/implementation/DataSources/StringExpressionDataSource/transactionalEvaluateStringExpressionDataSource.d.ts +9 -0
  15. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/TransactionalProductShelfDataSourceExpressionBuilderModal/transactionalProductShelfDataSourceExpressionBuilderModalDepsFactory.d.ts +11 -0
  16. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/transactionalProductShelfDataSourceExpressionBuilderDepsFactory.d.ts +11 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.html +36 -0
  19. package/env.d.ts +1 -0
  20. package/index.html +2 -3
  21. package/package.json +1 -1
  22. package/src/editTransactionalEmailTemplateApp.ts +426 -0
  23. package/src/httpClient/TransactionalWysiwygTemplateEditorClient.ts +5 -0
  24. package/src/implementation/AppSettingsModifierPlugin/transactionalDataAppSettingsModifierPluginFactory.ts +41 -0
  25. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/transactionalComponentSectionItemFactory.ts +30 -0
  26. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/transactionalEmailComponentFactory.ts +26 -0
  27. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/transactionalComponentLibraryFactory.ts +29 -0
  28. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/transactionalSectionFactory.ts +32 -0
  29. package/src/implementation/DataSources/ListDataExpressionSource/transactionalListExpressionDataSourceEvaluatorFactory.ts +115 -0
  30. package/src/implementation/DataSources/NumberExpressionDataSource/transactionalNumberExpressionDataSourceEvaluatorFactory.ts +35 -0
  31. package/src/implementation/DataSources/StringExpressionDataSource/transactionalEvaluateStringExpressionDataSource.ts +55 -0
  32. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/TransactionalProductShelfDataSourceExpressionBuilderModal/transactionalProductShelfDataSourceExpressionBuilderModalDepsFactory.ts +127 -0
  33. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/transactionalProductShelfDataSourceExpressionBuilderDepsFactory.ts +35 -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 -211
  42. package/favicon.ico +0 -0
@@ -0,0 +1,41 @@
1
+ import { defineComponent, h } from 'vue';
2
+ import type {
3
+ DataType,
4
+ LocaleKey
5
+ } from '@easy-wizzy/core';
6
+ import type {
7
+ AppSettingsModifierPlugin, AppSettingsModifierPluginEmits, AppSettingsModifierPluginProps,
8
+ } from '@easy-wizzy/core';
9
+ import { TransactionalDataAppSettingsModifier } from '@easy-wizzy/retailrocket-transactional';
10
+
11
+ export const transactionalDataAppSettingsModifierPluginFactory = (
12
+ arg: {
13
+ localeKey: LocaleKey;
14
+ getTransactionTemplateData: () => DataType,
15
+ updateTransactionTemplateData: (data: DataType) => void
16
+ }
17
+ ): AppSettingsModifierPlugin => {
18
+ return defineComponent<
19
+ AppSettingsModifierPluginProps,
20
+ AppSettingsModifierPluginEmits
21
+ >(
22
+ (_, ctx) => {
23
+ return () => h(
24
+ TransactionalDataAppSettingsModifier,
25
+ {
26
+ localeKey: arg.localeKey,
27
+ getTransactionTemplateData: arg.getTransactionTemplateData,
28
+ onTransactionTemplateDataUpdated: (transactionTemplateData: DataType) => {
29
+ arg.updateTransactionTemplateData(transactionTemplateData);
30
+ ctx.emit('onSettingsUpdated');
31
+ }
32
+ },
33
+ )
34
+ },
35
+ {
36
+ emits: {
37
+ onSettingsUpdated: () => true
38
+ }
39
+ },
40
+ )
41
+ }
@@ -0,0 +1,30 @@
1
+ import type {
2
+ ComponentLibrarySectionItem,
3
+ } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
4
+ import {
5
+ transactionalEmailComponentFactory
6
+ } from '@/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/transactionalEmailComponentFactory';
7
+ import type {
8
+ TransactionalStringExpressionDataSource
9
+ } from '@easy-wizzy/retailrocket-transactional';
10
+ import type {
11
+ TransactionalNumberExpressionDataSource
12
+ } from '@easy-wizzy/retailrocket-transactional';
13
+ import type {
14
+ TransactionalListExpressionDataSource
15
+ } from '@easy-wizzy/retailrocket-transactional';
16
+ import type { CustomComponentSectionItemType } from '@easy-wizzy/core';
17
+
18
+ export const transactionalComponentSectionItemFactory = (
19
+ componentLibrarySectionItem: ComponentLibrarySectionItem,
20
+ ): CustomComponentSectionItemType<
21
+ TransactionalListExpressionDataSource,
22
+ TransactionalNumberExpressionDataSource,
23
+ TransactionalStringExpressionDataSource
24
+ > => {
25
+ return {
26
+ sectionItemId: componentLibrarySectionItem.sectionItemId,
27
+ sectionItemName: componentLibrarySectionItem.sectionItemName,
28
+ componentTemplate: transactionalEmailComponentFactory(componentLibrarySectionItem.component),
29
+ };
30
+ };
@@ -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
+ TransactionalStringExpressionDataSource
7
+ } from '@easy-wizzy/retailrocket-transactional';
8
+ import type {
9
+ TransactionalListExpressionDataSource
10
+ } from '@easy-wizzy/retailrocket-transactional';
11
+ import type {
12
+ TransactionalNumberExpressionDataSource
13
+ } from '@easy-wizzy/retailrocket-transactional';
14
+
15
+ export const transactionalEmailComponentFactory = (
16
+ component: Component
17
+ ): EmailComponentType<
18
+ TransactionalListExpressionDataSource,
19
+ TransactionalNumberExpressionDataSource,
20
+ TransactionalStringExpressionDataSource
21
+ > =>
22
+ {
23
+ return component.transactional
24
+ ? JSON.parse(component.transactional.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
+ TransactionalListExpressionDataSource
9
+ } from '@easy-wizzy/retailrocket-transactional';
10
+ import type {
11
+ TransactionalNumberExpressionDataSource
12
+ } from '@easy-wizzy/retailrocket-transactional';
13
+ import type {
14
+ TransactionalStringExpressionDataSource
15
+ } from '@easy-wizzy/retailrocket-transactional';
16
+ import {
17
+ transactionalSectionFactory
18
+ } from '@/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/transactionalSectionFactory';
19
+
20
+ export const transactionalComponentLibraryFactory = (
21
+ componentLibrary: Array<ComponentLibrarySection>
22
+ ): CustomComponentLibraryType<
23
+ TransactionalListExpressionDataSource,
24
+ TransactionalNumberExpressionDataSource,
25
+ TransactionalStringExpressionDataSource
26
+ > => {
27
+ return componentLibrary
28
+ .map(section => transactionalSectionFactory(section))
29
+ }
@@ -0,0 +1,32 @@
1
+ import type {
2
+ ComponentLibrarySection,
3
+ } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
4
+ import type { CustomComponentSectionType } from '@easy-wizzy/core';
5
+ import type {
6
+ TransactionalListExpressionDataSource,
7
+ } from '@easy-wizzy/retailrocket-transactional';
8
+ import type {
9
+ TransactionalNumberExpressionDataSource,
10
+ } from '@easy-wizzy/retailrocket-transactional';
11
+ import type {
12
+ TransactionalStringExpressionDataSource,
13
+ } from '@easy-wizzy/retailrocket-transactional';
14
+ import {
15
+ transactionalComponentSectionItemFactory,
16
+ } from '@/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/transactionalComponentSectionItemFactory';
17
+
18
+ export const transactionalSectionFactory = (
19
+ section: ComponentLibrarySection,
20
+ ): CustomComponentSectionType<
21
+ TransactionalListExpressionDataSource,
22
+ TransactionalNumberExpressionDataSource,
23
+ TransactionalStringExpressionDataSource
24
+ > => {
25
+ return {
26
+ sectionId: section.sectionId,
27
+ sectionName: section.sectionName,
28
+ componentList: section
29
+ .sectionItems
30
+ .map(component => transactionalComponentSectionItemFactory(component)),
31
+ };
32
+ };
@@ -0,0 +1,115 @@
1
+ import type { ListExpressionDataSourceBffClient } from '@easy-wizzy/common-app';
2
+ import type { ListExpressionDataSourceEvaluatorDelegate } from '@easy-wizzy/core';
3
+ import { getProductList } from '@easy-wizzy/common-app';
4
+ import { getRelatedProducts } from '@easy-wizzy/common-app';
5
+ import { getAlternativeProducts } from '@easy-wizzy/common-app';
6
+ import { getPopularProductsInCategories } from '@easy-wizzy/common-app';
7
+ import { getPopularProducts } from '@easy-wizzy/common-app';
8
+ import type { Product } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.listexpressiondatasource';
9
+ import type { TransactionalListExpressionDataSource } from '@easy-wizzy/retailrocket-transactional';
10
+ import { transactionalListExpressionDataSourceMatcher } from '@easy-wizzy/retailrocket-transactional';
11
+ import { query } from '@easy-wizzy/core';
12
+ import { stockIdFactory } from '@easy-wizzy/common-app';
13
+ import type {
14
+ DataListType
15
+ } from '@easy-wizzy/core';
16
+ import type {
17
+ DataType
18
+ } from '@easy-wizzy/core';
19
+ import { getLatestProducts } from '@easy-wizzy/common-app';
20
+ import { getSaleByPopularProducts } from '@easy-wizzy/common-app';
21
+ import { getSaleByLatestProducts } from '@easy-wizzy/common-app';
22
+
23
+ export const transactionalListExpressionDataSourceEvaluatorFactory = (arg: {
24
+ partnerId: string;
25
+ getTransactionalTemplateData: () => DataType;
26
+ listExpressionDataSourceBffClient: ListExpressionDataSourceBffClient;
27
+ customerStockId: string | undefined;
28
+ }): ListExpressionDataSourceEvaluatorDelegate<TransactionalListExpressionDataSource> => {
29
+ const transactionalTemplateData = arg.getTransactionalTemplateData();
30
+ let productCache: { [key: string]: Product } = {};
31
+
32
+ return (asyncDataSource: TransactionalListExpressionDataSource) =>
33
+ transactionalListExpressionDataSourceMatcher(asyncDataSource).Match<Promise<DataListType>>({
34
+ ListFromTransactionalTemplateData: (x) => {
35
+ return query(transactionalTemplateData, x.Path);
36
+ },
37
+ ProductList: ({ ProductIds, StockSource }) =>
38
+ getProductList({
39
+ partnerId: arg.partnerId,
40
+ productIDs: ProductIds,
41
+ stockId: stockIdFactory({
42
+ stockSource: StockSource,
43
+ customerStockId: arg.customerStockId,
44
+ }),
45
+ productCache: productCache,
46
+ getProductsByIDsHttpClient: arg.listExpressionDataSourceBffClient.postGetProductsByIds,
47
+ }),
48
+ RelatedProductsFor: ({ ProductIds, StockSource }) =>
49
+ getRelatedProducts({
50
+ partnerId: arg.partnerId,
51
+ productIDs: ProductIds,
52
+ stockId: stockIdFactory({
53
+ stockSource: StockSource,
54
+ customerStockId: arg.customerStockId,
55
+ }),
56
+ getRelatedProducts: arg.listExpressionDataSourceBffClient.postGetRelatedRecommendations,
57
+ }),
58
+ AlternativeProductsFor: ({ ProductIds, StockSource }) =>
59
+ getAlternativeProducts({
60
+ partnerId: arg.partnerId,
61
+ productIDs: ProductIds,
62
+ stockId: stockIdFactory({
63
+ stockSource: StockSource,
64
+ customerStockId: arg.customerStockId,
65
+ }),
66
+ getAlternativeProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetAlternativeRecommendations,
67
+ }),
68
+ PopularProductsInCategories: ({ CategoryIds, StockSource }) =>
69
+ getPopularProductsInCategories({
70
+ partnerId: arg.partnerId,
71
+ categoryIds: CategoryIds,
72
+ stockId: stockIdFactory({
73
+ stockSource: StockSource,
74
+ customerStockId: arg.customerStockId,
75
+ }),
76
+ getPopularProductsInCategoriesHttpClient: arg.listExpressionDataSourceBffClient.postGetPopularInCategoriesRecommendations,
77
+ }),
78
+ Popular: ({ StockSource }) =>
79
+ getPopularProducts({
80
+ partnerId: arg.partnerId,
81
+ stockId: stockIdFactory({
82
+ stockSource: StockSource,
83
+ customerStockId: arg.customerStockId,
84
+ }),
85
+ getPopularProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetPopularRecommendations,
86
+ }),
87
+ Latest: ({ StockSource }) =>
88
+ getLatestProducts({
89
+ partnerId: arg.partnerId,
90
+ stockId: stockIdFactory({
91
+ stockSource: StockSource,
92
+ customerStockId: arg.customerStockId,
93
+ }),
94
+ getLatestProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetLatestRecommendations,
95
+ }),
96
+ SaleByPopular: ({ StockSource }) =>
97
+ getSaleByPopularProducts({
98
+ partnerId: arg.partnerId,
99
+ stockId: stockIdFactory({
100
+ stockSource: StockSource,
101
+ customerStockId: arg.customerStockId,
102
+ }),
103
+ getSaleByPopularProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetSaleByPopularRecommendations,
104
+ }),
105
+ SaleByLatest: ({ StockSource }) =>
106
+ getSaleByLatestProducts({
107
+ partnerId: arg.partnerId,
108
+ stockId: stockIdFactory({
109
+ stockSource: StockSource,
110
+ customerStockId: arg.customerStockId,
111
+ }),
112
+ getSaleByLatestProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetSaleByLatestRecommendations,
113
+ }),
114
+ });
115
+ };
@@ -0,0 +1,35 @@
1
+ import type {
2
+ TransactionalNumberExpressionDataSource
3
+ } from '@easy-wizzy/retailrocket-transactional';
4
+ import type {
5
+ NumberExpressionDataSourceEvaluatorDelegate
6
+ } from '@easy-wizzy/core';
7
+ import type { DataType } from '@easy-wizzy/core';
8
+ import {
9
+ transactionalNumberExpressionDataSourceMatcher
10
+ } from '@easy-wizzy/retailrocket-transactional';
11
+ import {
12
+ pathValueGetNumberValue
13
+ } from '@easy-wizzy/core';
14
+
15
+ export const transactionalNumberExpressionDataSourceEvaluatorFactory = (arg: {
16
+ getTransactionalTemplateData: () => DataType
17
+ }): NumberExpressionDataSourceEvaluatorDelegate<
18
+ TransactionalNumberExpressionDataSource
19
+ > => {
20
+ const transactionalTemplateData = arg.getTransactionalTemplateData();
21
+
22
+ return (a: {
23
+ numberExpressionDataSource: TransactionalNumberExpressionDataSource,
24
+ context: DataType
25
+ }) => transactionalNumberExpressionDataSourceMatcher(a.numberExpressionDataSource)
26
+ .Match({
27
+ NumberFromTransactionalTemplateData: x => Promise
28
+ .resolve(
29
+ pathValueGetNumberValue(
30
+ x.Path,
31
+ transactionalTemplateData
32
+ )
33
+ )
34
+ })
35
+ }
@@ -0,0 +1,55 @@
1
+ import type {
2
+ DataType
3
+ } from '@easy-wizzy/core';
4
+ import {
5
+ transactionalStringExpressionDataSourceMatcher
6
+ } from '@easy-wizzy/retailrocket-transactional';
7
+ import { query } from '@easy-wizzy/core';
8
+ import type {
9
+ StringExpressionDataSourceEvaluatorDelegate
10
+ } from '@easy-wizzy/core';
11
+ import type {
12
+ TransactionalStringExpressionDataSource
13
+ } from '@easy-wizzy/retailrocket-transactional';
14
+ import type {
15
+ TransactionalNumberExpressionDataSource
16
+ } from '@easy-wizzy/retailrocket-transactional';
17
+ import type {
18
+ TransactionalListExpressionDataSource
19
+ } from '@easy-wizzy/retailrocket-transactional';
20
+ import type {
21
+ ProductImageUrlBuilderExpressionEvaluatorDelegate
22
+ } from '@easy-wizzy/common-app';
23
+ import type { NextCouponFromBatchType } from '@easy-wizzy/retailrocket-common';
24
+
25
+ export const transactionalStringExpressionDataSourceEvaluatorFactory = (arg: {
26
+ getTransactionalTemplateData: () => DataType,
27
+ productImageUrlBuilderExpressionEvaluator: ProductImageUrlBuilderExpressionEvaluatorDelegate<
28
+ TransactionalListExpressionDataSource,
29
+ TransactionalNumberExpressionDataSource
30
+ >
31
+ nextCouponFromBatch: NextCouponFromBatchType
32
+ }): StringExpressionDataSourceEvaluatorDelegate<
33
+ TransactionalStringExpressionDataSource
34
+ > => (
35
+ a: {
36
+ stringExpressionDataSource: TransactionalStringExpressionDataSource,
37
+ context: DataType
38
+ }) => {
39
+ const transactionalTemplateData = arg.getTransactionalTemplateData();
40
+
41
+ return transactionalStringExpressionDataSourceMatcher(a.stringExpressionDataSource)
42
+ .Match({
43
+ StringFromTransactionalTemplateData: x => Promise.resolve(
44
+ query(
45
+ transactionalTemplateData,
46
+ x.Path
47
+ )
48
+ ),
49
+ ProductImageUrlBuilderExpression: e => arg.productImageUrlBuilderExpressionEvaluator({
50
+ expression: e,
51
+ context: a.context
52
+ }),
53
+ NextCouponFromBatch: () => Promise.resolve('Coupon')
54
+ })
55
+ }
@@ -0,0 +1,127 @@
1
+ import type { LocaleKey } from '@easy-wizzy/core';
2
+ import {
3
+ categoryListComposerModalWindowDepsFactory
4
+ } from '@easy-wizzy/common-app';
5
+ import {
6
+ alternativeProductListShelfBuilderDepsFactory
7
+ } from '@easy-wizzy/common-app';
8
+ import {
9
+ relatedProductListShelfBuilderDepsFactory
10
+ } from '@easy-wizzy/common-app';
11
+ import {
12
+ productListShelfBuilderDepsFactory
13
+ } from '@easy-wizzy/common-app';
14
+ import {
15
+ popularFromCategoryListShelfBuilderDepsFactory
16
+ } from '@easy-wizzy/common-app';
17
+ import type {
18
+ TransactionalProductShelfDataSourceExpressionBuilderModalDeps
19
+ } from '@easy-wizzy/retailrocket-transactional';
20
+ import {
21
+ popularProductListShelfBuilderDepsFactory
22
+ } from '@easy-wizzy/common-app';
23
+ import type { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
24
+ import {
25
+ productListComposerModalWindowDepsFactory
26
+ } from '@easy-wizzy/common-app';
27
+
28
+ import type { ProductPickerModalWindowBffClient } from '@easy-wizzy/common-app';
29
+ import {
30
+ latestProductListShelfBuilderDepsFactory
31
+ } from '@easy-wizzy/common-app';
32
+ import {
33
+ saleByPopularProductListShelfBuilderDepsFactory
34
+ } from '@easy-wizzy/common-app';
35
+ import {
36
+ saleByLatestProductListShelfBuilderDepsFactory
37
+ } from '@easy-wizzy/common-app';
38
+ import type {
39
+ ProductCategoryPickerModalWindowBffClient
40
+ } from '@easy-wizzy/common-app';
41
+
42
+ export const transactionalProductShelfDataSourceExpressionBuilderModalDepsFactory = (
43
+ arg: {
44
+ localeKey: LocaleKey;
45
+ partnerId: string,
46
+ customerStockId: string | undefined,
47
+ productShelfBuilderModalWindowBffClient: ProductShelfBuilderModalWindowBffClient,
48
+ productCategoryPickerModalWindowBffClient: ProductCategoryPickerModalWindowBffClient,
49
+ productPickerModalWindowBffClient: ProductPickerModalWindowBffClient
50
+ }
51
+ ): TransactionalProductShelfDataSourceExpressionBuilderModalDeps => {
52
+
53
+ const productCache = {};
54
+ const categoryCache = {};
55
+
56
+ const productListComposerModalWindowDeps = productListComposerModalWindowDepsFactory({
57
+ localeKey: arg.localeKey,
58
+ partnerId: arg.partnerId,
59
+ customerStockId: arg.customerStockId,
60
+ productPickerModalWindowBffClient: arg.productPickerModalWindowBffClient
61
+ });
62
+
63
+ return {
64
+ localeKey: arg.localeKey,
65
+ ProductListComposerModalWindowDeps: productListComposerModalWindowDeps,
66
+ CategoryListComposerModalWindowDeps: categoryListComposerModalWindowDepsFactory({
67
+ localeKey: arg.localeKey,
68
+ partnerId: arg.partnerId,
69
+ productCategoryPickerModalWindowBffClient: arg.productCategoryPickerModalWindowBffClient
70
+ }),
71
+ AlternativeProductListShelfBuilderDeps: alternativeProductListShelfBuilderDepsFactory({
72
+ localeKey: arg.localeKey,
73
+ partnerId: arg.partnerId,
74
+ customerStockId: arg.customerStockId,
75
+ productCache: productCache,
76
+ getProductsByIDsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetProductsByIds,
77
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds,
78
+ productListComposerModalWindowDeps: productListComposerModalWindowDeps
79
+ }),
80
+ RelatedProductListShelfBuilderDeps: relatedProductListShelfBuilderDepsFactory({
81
+ localeKey: arg.localeKey,
82
+ partnerId: arg.partnerId,
83
+ customerStockId: arg.customerStockId,
84
+ productCache: productCache,
85
+ getProductsByIDsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetProductsByIds,
86
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds,
87
+ productListComposerModalWindowDeps: productListComposerModalWindowDeps
88
+ }),
89
+ ProductListShelfBuilderDeps: productListShelfBuilderDepsFactory({
90
+ localeKey: arg.localeKey,
91
+ partnerId: arg.partnerId,
92
+ customerStockId: arg.customerStockId,
93
+ productCache: productCache,
94
+ getProductsByIDsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetProductsByIds,
95
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds,
96
+ productListComposerModalWindowDeps: productListComposerModalWindowDeps
97
+ }),
98
+ PopularFromCategoryListShelfBuilderDeps: popularFromCategoryListShelfBuilderDepsFactory({
99
+ localeKey: arg.localeKey,
100
+ partnerId: arg.partnerId,
101
+ categoryCache: categoryCache,
102
+ getCategoriesByIDsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetProductCategoriesByIds,
103
+ productCategoryPickerModalWindowBffClient: arg.productCategoryPickerModalWindowBffClient,
104
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
105
+ }),
106
+ PopularProductListShelfBuilderDeps: popularProductListShelfBuilderDepsFactory({
107
+ localeKey: arg.localeKey,
108
+ partnerId: arg.partnerId,
109
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
110
+ }),
111
+ LatestProductListShelfBuilderDeps: latestProductListShelfBuilderDepsFactory({
112
+ localeKey: arg.localeKey,
113
+ partnerId: arg.partnerId,
114
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
115
+ }),
116
+ SaleByPopularProductListShelfBuilderDeps: saleByPopularProductListShelfBuilderDepsFactory({
117
+ localeKey: arg.localeKey,
118
+ partnerId: arg.partnerId,
119
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
120
+ }),
121
+ SaleByLatestProductListShelfBuilderDeps: saleByLatestProductListShelfBuilderDepsFactory({
122
+ localeKey: arg.localeKey,
123
+ partnerId: arg.partnerId,
124
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
125
+ })
126
+ }
127
+ }
@@ -0,0 +1,35 @@
1
+ import type { LocaleKey } from '@easy-wizzy/core';
2
+ import type {
3
+ TransactionalProductShelfDataSourceExpressionBuilderDeps
4
+ } from '@easy-wizzy/retailrocket-transactional';
5
+ import {
6
+ transactionalProductShelfDataSourceExpressionBuilderModalDepsFactory
7
+ } from '@/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/TransactionalProductShelfDataSourceExpressionBuilderModal/transactionalProductShelfDataSourceExpressionBuilderModalDepsFactory';
8
+ import type { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
9
+
10
+ import type { ProductPickerModalWindowBffClient } from '@easy-wizzy/common-app';
11
+ import type {
12
+ ProductCategoryPickerModalWindowBffClient
13
+ } from '@easy-wizzy/common-app';
14
+
15
+ export const transactionalProductShelfDataSourceExpressionBuilderDepsFactory = (
16
+ arg: {
17
+ localeKey: LocaleKey;
18
+ partnerId: string,
19
+ customerStockId: string | undefined,
20
+ productShelfBuilderModalWindowBffClient: ProductShelfBuilderModalWindowBffClient,
21
+ productCategoryPickerModalWindowBffClient: ProductCategoryPickerModalWindowBffClient,
22
+ productPickerModalWindowBffClient: ProductPickerModalWindowBffClient
23
+ }
24
+ ): TransactionalProductShelfDataSourceExpressionBuilderDeps => {
25
+ return {
26
+ transactionalProductShelfDataSourceExpressionBuilderModalDeps: transactionalProductShelfDataSourceExpressionBuilderModalDepsFactory({
27
+ localeKey: arg.localeKey,
28
+ partnerId: arg.partnerId,
29
+ customerStockId: arg.customerStockId,
30
+ productShelfBuilderModalWindowBffClient: arg.productShelfBuilderModalWindowBffClient,
31
+ productCategoryPickerModalWindowBffClient: arg.productCategoryPickerModalWindowBffClient,
32
+ productPickerModalWindowBffClient: arg.productPickerModalWindowBffClient
33
+ })
34
+ }
35
+ }
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
+ })