@retailrocketgroup/retailrocket-create.abandoned-view-price-drop-vue-email-template-render 3.0.381747 → 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 (44) 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/createAbandonedViewPriceDropEmailTemplateApp.d.ts +0 -0
  6. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/abandonedViewPriceDropComponentSectionItemFactory.d.ts +4 -0
  7. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/abandonedViewPriceDropEmailComponentFactory.d.ts +4 -0
  8. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/abandonedViewPriceDropComponentLibraryFactory.d.ts +4 -0
  9. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/abandonedViewPriceDropSectionFactory.d.ts +4 -0
  10. package/dist/implementation/DataSources/ListDataExpressionSource/abandonedViewPriceDropEvaluateListExpressionDataSourceFactory.d.ts +8 -0
  11. package/dist/implementation/DataSources/NumberExpressionDataSource/abandonedViewPriceDropEvaluateNumberExpressionDataSourceFactory.d.ts +2 -0
  12. package/dist/implementation/DataSources/StringExpressionDataSource/abandonedViewPriceDropEvaluateStringExpressionDataSource.d.ts +9 -0
  13. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedViewPriceDropProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/abandonedViewPriceDropProductListShelfBuilderDepsFactory.d.ts +8 -0
  14. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedViewPriceDropProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/alternativeProductsForAbandonedViewPriceDropProductListShelfBuilderDepsFactory.d.ts +8 -0
  15. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedViewPriceDropProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/relatedProductsForAbandonedViewPriceDropProductListShelfBuilderDepsFactory.d.ts +8 -0
  16. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedViewPriceDropProductShelfDataSourceExpressionBuilderModal/abandonedViewPriceDropProductShelfDataSourceExpressionBuilderModalDepsFactory.d.ts +11 -0
  17. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/abandonedViewPriceDropProductShelfDataSourceExpressionBuilderDepsFactory.d.ts +11 -0
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.html +35 -0
  20. package/env.d.ts +1 -0
  21. package/index.html +1 -2
  22. package/package.json +1 -1
  23. package/src/createAbandonedViewPriceDropEmailTemplateApp.ts +295 -0
  24. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/abandonedViewPriceDropComponentSectionItemFactory.ts +30 -0
  25. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/abandonedViewPriceDropEmailComponentFactory.ts +26 -0
  26. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/abandonedViewPriceDropComponentLibraryFactory.ts +29 -0
  27. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/abandonedViewPriceDropSectionFactory.ts +32 -0
  28. package/src/implementation/DataSources/ListDataExpressionSource/abandonedViewPriceDropEvaluateListExpressionDataSourceFactory.ts +134 -0
  29. package/src/implementation/DataSources/NumberExpressionDataSource/abandonedViewPriceDropEvaluateNumberExpressionDataSourceFactory.ts +10 -0
  30. package/src/implementation/DataSources/StringExpressionDataSource/abandonedViewPriceDropEvaluateStringExpressionDataSource.ts +56 -0
  31. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedViewPriceDropProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/abandonedViewPriceDropProductListShelfBuilderDepsFactory.ts +33 -0
  32. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedViewPriceDropProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/alternativeProductsForAbandonedViewPriceDropProductListShelfBuilderDepsFactory.ts +33 -0
  33. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedViewPriceDropProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/relatedProductsForAbandonedViewPriceDropProductListShelfBuilderDepsFactory.ts +33 -0
  34. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/AbandonedViewPriceDropProductShelfDataSourceExpressionBuilderModal/abandonedViewPriceDropProductShelfDataSourceExpressionBuilderModalDepsFactory.ts +151 -0
  35. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/abandonedViewPriceDropProductShelfDataSourceExpressionBuilderDepsFactory.ts +35 -0
  36. package/src/index.ts +0 -0
  37. package/tsconfig.app.json +19 -0
  38. package/tsconfig.json +14 -0
  39. package/tsconfig.node.json +11 -0
  40. package/tsconfig.test.json +11 -0
  41. package/vite.config.ts +36 -0
  42. package/assets/main.css +0 -1
  43. package/assets/main.js +0 -185
  44. package/favicon.ico +0 -0
@@ -0,0 +1,4 @@
1
+ import { ComponentLibrarySectionItem } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
2
+ import { CustomComponentSectionItemType } from '@easy-wizzy/core';
3
+ import { AbandonedViewPriceDropListExpressionDataSource, AbandonedViewPriceDropNumberExpressionDataSource, AbandonedViewPriceDropStringExpressionDataSource } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
4
+ export declare const abandonedViewPriceDropComponentSectionItemFactory: (componentLibrarySectionItem: ComponentLibrarySectionItem) => CustomComponentSectionItemType<AbandonedViewPriceDropListExpressionDataSource, AbandonedViewPriceDropNumberExpressionDataSource, AbandonedViewPriceDropStringExpressionDataSource>;
@@ -0,0 +1,4 @@
1
+ import { EmailComponentType } from '@easy-wizzy/core';
2
+ import { Component } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.addcomponentlibrarysectionitemmodalwindow/main';
3
+ import { AbandonedViewPriceDropListExpressionDataSource, AbandonedViewPriceDropNumberExpressionDataSource, AbandonedViewPriceDropStringExpressionDataSource } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
4
+ export declare const abandonedViewPriceDropEmailComponentFactory: (component: Component) => EmailComponentType<AbandonedViewPriceDropListExpressionDataSource, AbandonedViewPriceDropNumberExpressionDataSource, AbandonedViewPriceDropStringExpressionDataSource>;
@@ -0,0 +1,4 @@
1
+ import { ComponentLibrarySection } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
2
+ import { CustomComponentLibraryType } from '@easy-wizzy/core';
3
+ import { AbandonedViewPriceDropListExpressionDataSource, AbandonedViewPriceDropNumberExpressionDataSource, AbandonedViewPriceDropStringExpressionDataSource } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
4
+ export declare const abandonedViewPriceDropComponentLibraryFactory: (componentLibrary: Array<ComponentLibrarySection>) => CustomComponentLibraryType<AbandonedViewPriceDropListExpressionDataSource, AbandonedViewPriceDropNumberExpressionDataSource, AbandonedViewPriceDropStringExpressionDataSource>;
@@ -0,0 +1,4 @@
1
+ import { ComponentLibrarySection } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
2
+ import { CustomComponentSectionType } from '@easy-wizzy/core';
3
+ import { AbandonedViewPriceDropListExpressionDataSource, AbandonedViewPriceDropNumberExpressionDataSource, AbandonedViewPriceDropStringExpressionDataSource } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
4
+ export declare const abandonedViewPriceDropSectionFactory: (section: ComponentLibrarySection) => CustomComponentSectionType<AbandonedViewPriceDropListExpressionDataSource, AbandonedViewPriceDropNumberExpressionDataSource, AbandonedViewPriceDropStringExpressionDataSource>;
@@ -0,0 +1,8 @@
1
+ import { ListExpressionDataSourceBffClient } from '@easy-wizzy/common-app';
2
+ import { ListExpressionDataSourceEvaluatorDelegate } from '@easy-wizzy/core';
3
+ import { AbandonedViewPriceDropListExpressionDataSource } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
4
+ export declare const abandonedViewPriceDropEvaluateListExpressionDataSourceFactory: (arg: {
5
+ partnerId: string;
6
+ listExpressionDataSourceBffClient: ListExpressionDataSourceBffClient;
7
+ customerStockId: string | undefined;
8
+ }) => ListExpressionDataSourceEvaluatorDelegate<AbandonedViewPriceDropListExpressionDataSource>;
@@ -0,0 +1,2 @@
1
+ import { NumberExpressionDataSourceEvaluatorDelegate } from '@easy-wizzy/core';
2
+ export declare const abandonedViewPriceDropEvaluateNumberExpressionDataSourceFactory: <TNumberExpressionDataSource>() => NumberExpressionDataSourceEvaluatorDelegate<TNumberExpressionDataSource>;
@@ -0,0 +1,9 @@
1
+ import { StringExpressionDataSourceEvaluatorDelegate } from '@easy-wizzy/core';
2
+ import { ContactCustomData, NextCouponFromBatchType } from '@easy-wizzy/retailrocket-common';
3
+ import { ProductImageUrlBuilderExpressionEvaluatorDelegate } from '@easy-wizzy/common-app';
4
+ import { AbandonedViewPriceDropListExpressionDataSource, AbandonedViewPriceDropNumberExpressionDataSource, AbandonedViewPriceDropStringExpressionDataSource } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
5
+ export declare const abandonedViewPriceDropStringExpressionDataSourceEvaluatorFactory: (arg: {
6
+ productImageUrlBuilderExpressionEvaluator: ProductImageUrlBuilderExpressionEvaluatorDelegate<AbandonedViewPriceDropListExpressionDataSource, AbandonedViewPriceDropNumberExpressionDataSource>;
7
+ contactCustomData: ContactCustomData;
8
+ nextCouponFromBatch: NextCouponFromBatchType;
9
+ }) => StringExpressionDataSourceEvaluatorDelegate<AbandonedViewPriceDropStringExpressionDataSource>;
@@ -0,0 +1,8 @@
1
+ import { LocaleKey } from '@easy-wizzy/core';
2
+ import { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
3
+ import { AbandonedViewPriceDropProductListShelfBuilderDeps } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
4
+ export declare const abandonedViewPriceDropProductListShelfBuilderDepsFactory: (arg: {
5
+ localeKey: LocaleKey;
6
+ partnerId: string;
7
+ getAllStockIdsHttpClient: ProductShelfBuilderModalWindowBffClient["postGetAllStockIds"];
8
+ }) => AbandonedViewPriceDropProductListShelfBuilderDeps;
@@ -0,0 +1,8 @@
1
+ import { LocaleKey } from '@easy-wizzy/core';
2
+ import { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
3
+ import { AlternativeProductsForAbandonedViewPriceDropProductListShelfBuilderDeps } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
4
+ export declare const alternativeProductsForAbandonedProductListShelfBuilderDepsFactory: (arg: {
5
+ localeKey: LocaleKey;
6
+ partnerId: string;
7
+ getAllStockIdsHttpClient: ProductShelfBuilderModalWindowBffClient["postGetAllStockIds"];
8
+ }) => AlternativeProductsForAbandonedViewPriceDropProductListShelfBuilderDeps;
@@ -0,0 +1,8 @@
1
+ import { LocaleKey } from '@easy-wizzy/core';
2
+ import { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
3
+ import { RelatedProductsForAbandonedViewPriceDropProductListShelfBuilderDeps } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
4
+ export declare const relatedProductsForAbandonedProductListShelfBuilderDepsFactory: (arg: {
5
+ localeKey: LocaleKey;
6
+ partnerId: string;
7
+ getAllStockIdsHttpClient: ProductShelfBuilderModalWindowBffClient["postGetAllStockIds"];
8
+ }) => RelatedProductsForAbandonedViewPriceDropProductListShelfBuilderDeps;
@@ -0,0 +1,11 @@
1
+ import { LocaleKey } from '@easy-wizzy/core';
2
+ import { ProductShelfBuilderModalWindowBffClient, ProductPickerModalWindowBffClient, ProductCategoryPickerModalWindowBffClient } from '@easy-wizzy/common-app';
3
+ import { AbandonedViewPriceDropProductShelfDataSourceExpressionBuilderModalDeps } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
4
+ export declare const abandonedViewPriceDropProductShelfDataSourceExpressionBuilderModalDepsFactory: (arg: {
5
+ localeKey: LocaleKey;
6
+ partnerId: string;
7
+ customerStockId: string | undefined;
8
+ productShelfBuilderModalWindowBffClient: ProductShelfBuilderModalWindowBffClient;
9
+ productCategoryPickerModalWindowBffClient: ProductCategoryPickerModalWindowBffClient;
10
+ productPickerModalWindowBffClient: ProductPickerModalWindowBffClient;
11
+ }) => AbandonedViewPriceDropProductShelfDataSourceExpressionBuilderModalDeps;
@@ -0,0 +1,11 @@
1
+ import { LocaleKey } from '@easy-wizzy/core';
2
+ import { ProductShelfBuilderModalWindowBffClient, ProductPickerModalWindowBffClient, ProductCategoryPickerModalWindowBffClient } from '@easy-wizzy/common-app';
3
+ import { AbandonedViewPriceDropProductShelfDataSourceExpressionBuilderDeps } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
4
+ export declare const abandonedViewPriceDropProductShelfDataSourceExpressionBuilderDepsFactory: (arg: {
5
+ localeKey: LocaleKey;
6
+ partnerId: string;
7
+ customerStockId: string | undefined;
8
+ productShelfBuilderModalWindowBffClient: ProductShelfBuilderModalWindowBffClient;
9
+ productCategoryPickerModalWindowBffClient: ProductCategoryPickerModalWindowBffClient;
10
+ productPickerModalWindowBffClient: ProductPickerModalWindowBffClient;
11
+ }) => AbandonedViewPriceDropProductShelfDataSourceExpressionBuilderDeps;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,35 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <link rel="icon" href="/favicon.ico">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link
10
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap"
11
+ rel="stylesheet"
12
+ />
13
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Lato:wght@100;300;400;700;900&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
14
+ <title>Vite App</title>
15
+ <script type="module" crossorigin src="/assets/index.js"></script>
16
+ <link rel="stylesheet" crossorigin href="/assets/index.css">
17
+ </head>
18
+ <body>
19
+ <div
20
+ id="app"
21
+ data-partner-id="5df72bdc97a52507605e4cc1"
22
+ data-wysiwyg-template-editor-bff-base-url="https://my.retailrocket.ru/5db801c197a52821e86b0d45/TransactionalEmailCampaign/6757225a5520d1ae575e7f0e/CampaignWizard/Step2/WysiwygTemplateEditorBff"
23
+ data-wysiwyg-bff-proxy-base-url="https://k8s-b1.retailrocket.ru/"
24
+ data-anti-forgery-header-token-name="data-anti-forgery-header-token-name"
25
+ data-anti-forgery-header-token-value="data-anti-forgery-header-token-value"
26
+ data-anti-forgery-form-token-name="data-anti-forgery-form-token-name"
27
+ data-anti-forgery-form-token-value="data-anti-forgery-form-token-value"
28
+ data-initial-abandoned-view-price-drop-template=""
29
+ data-abandoned-view-price-drop-favorites-templates="[]"
30
+ data-create-email-template-submit-url="data-create-email-template-submit-url"
31
+ data-common-favorites-templates="[]"
32
+ data-exit-link="#"
33
+ ></div>
34
+ </body>
35
+ </html>
package/env.d.ts ADDED
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
package/index.html CHANGED
@@ -12,8 +12,6 @@
12
12
  />
13
13
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Lato:wght@100;300;400;700;900&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
14
14
  <title>Vite App</title>
15
- <script type="module" crossorigin src="/assets/main.js"></script>
16
- <link rel="stylesheet" crossorigin href="/assets/main.css">
17
15
  </head>
18
16
  <body>
19
17
  <div
@@ -31,5 +29,6 @@
31
29
  data-common-favorites-templates="[]"
32
30
  data-exit-link="#"
33
31
  ></div>
32
+ <script type="module" src="/src/createAbandonedViewPriceDropEmailTemplateApp.ts"></script>
34
33
  </body>
35
34
  </html>
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@retailrocketgroup/retailrocket-create.abandoned-view-price-drop-vue-email-template-render",
3
- "version": "3.0.381747",
3
+ "version": "5.0.384530",
4
4
  "private": false
5
5
  }
@@ -0,0 +1,295 @@
1
+ import 'bootstrap';
2
+ import '@easy-wizzy/core/index.css';
3
+
4
+ import { createApp } from 'vue';
5
+ import { createVuetify } from 'vuetify';
6
+ import { ClickOutside } from 'vuetify/directives';
7
+
8
+ import { CreateEmailTemplateApp } from '@easy-wizzy/core';
9
+ import { createSimpleDataForm, matcherFactory } from '@easy-wizzy/core';
10
+ import type { GeneralStringExpressionDataSource } from '@easy-wizzy/retailrocket-common';
11
+ import { expressionEvaluatorFactory } from '@easy-wizzy/core';
12
+ import { listExpressionEvaluatorFactory } from '@easy-wizzy/core';
13
+ import { numberExpressionEvaluatorDelegate } from '@easy-wizzy/core';
14
+ import { stringExpressionEvaluatorFactory } from '@easy-wizzy/core';
15
+ import { dataStructBuilderExpressionEvaluatorFactory } from '@easy-wizzy/core';
16
+
17
+ import type { EmailTemplateType } from '@easy-wizzy/core';
18
+ import type { EmailTemplatePreviewTileComponent } from '@easy-wizzy/core';
19
+ import type { LocaleKey } from '@easy-wizzy/core';
20
+ import type { StringExpressionEvaluatorDelegate } from '@easy-wizzy/core';
21
+
22
+ import { createEmailTemplateAppDepsFactory } from '@easy-wizzy/common-app';
23
+ import { emailTemplatePreviewTileComponentFactory } from '@easy-wizzy/common-app';
24
+ import { emailTemplatePreviewTileDepsFactory } from '@easy-wizzy/common-app';
25
+ import { productImageUrlBuilderExpressionEvaluatorFactory } from '@easy-wizzy/common-app';
26
+ import { defaultTemplateLibraryFactory } from '@easy-wizzy/common-app';
27
+ import { apiMachineFetchFactory } from '@easy-wizzy/common-app';
28
+ import { variableSelectorDepsFactory } from '@easy-wizzy/common-app';
29
+
30
+ import type { ApiMachineFetchDelegate } from '@easy-wizzy/common-app';
31
+
32
+ import { stringExpressionBuilderPluginFactory, richTextToolbarPluginFactory, VariableSelector } from '@easy-wizzy/retailrocket-common';
33
+
34
+ import type { ContactCustomData } from '@easy-wizzy/retailrocket-common';
35
+ import type { NextCouponFromBatchType } from '@easy-wizzy/retailrocket-common';
36
+
37
+ import type { AbandonedViewPriceDropListExpressionDataSource } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
38
+ import type { AbandonedViewPriceDropNumberExpressionDataSource } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
39
+ import type { AbandonedViewPriceDropStringExpressionDataSource } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
40
+
41
+ import { initialEmailTemplateRu } from '@easy-wizzy/template-library';
42
+ import { initialEmailTemplateEn } from '@easy-wizzy/template-library';
43
+
44
+ import { abandonedViewPriceDropEvaluateListExpressionDataSourceFactory } from '@/implementation/DataSources/ListDataExpressionSource/abandonedViewPriceDropEvaluateListExpressionDataSourceFactory';
45
+ import { abandonedViewPriceDropEvaluateNumberExpressionDataSourceFactory } from '@/implementation/DataSources/NumberExpressionDataSource/abandonedViewPriceDropEvaluateNumberExpressionDataSourceFactory';
46
+ import { abandonedViewPriceDropStringExpressionDataSourceEvaluatorFactory } from '@/implementation/DataSources/StringExpressionDataSource/abandonedViewPriceDropEvaluateStringExpressionDataSource';
47
+
48
+ import { createApi as listExpressionDataSourceBffClientFactory } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.listexpressiondatasource';
49
+
50
+ const appTagId = '#app';
51
+ const appTag = document.querySelector(appTagId);
52
+
53
+ const params = {
54
+ partnerId: appTag!.getAttribute('data-partner-id')!,
55
+ wysiwygTemplateEditorBffBaseUrl: appTag!.getAttribute('data-wysiwyg-template-editor-bff-base-url')!,
56
+ wysiwygBffProxyBaseUrl: appTag!.getAttribute('data-wysiwyg-bff-proxy-base-url')!,
57
+ antiForgeryHeaderTokenName: appTag!.getAttribute('data-anti-forgery-header-token-name')!,
58
+ antiForgeryHeaderTokenValue: appTag!.getAttribute('data-anti-forgery-header-token-value')!,
59
+ antiForgeryFormTokenName: appTag!.getAttribute('data-anti-forgery-form-token-name')!,
60
+ antiForgeryFormTokenValue: appTag!.getAttribute('data-anti-forgery-form-token-value')!,
61
+ createEmailTemplateSubmitUrl: appTag!.getAttribute('data-create-email-template-submit-url')!,
62
+ initialEmailTemplateJson: appTag!.getAttribute('data-initial-abandoned-view-price-drop-template')!,
63
+ abandonedViewPriceDropFavoritesTemplates: JSON.parse(appTag!.getAttribute('data-abandoned-view-price-drop-favorites-templates')!) as [{ templateId: string, templateJson: string, favoriteTemplateName: string }],
64
+ commonFavoritesTemplates: JSON.parse(appTag!.getAttribute('data-common-favorites-templates')!) as [{ templateId: string, templateJson: string, favoriteTemplateName: string }],
65
+ exitLink: appTag!.getAttribute('data-exit-link')!,
66
+ localeKey: appTag!.getAttribute('data-locale-key') as LocaleKey || 'en'
67
+ };
68
+
69
+ const _apiMachineFetchFactory = (arg: {
70
+ baseUrl: string
71
+ }): ApiMachineFetchDelegate => apiMachineFetchFactory({
72
+ baseUrl: arg.baseUrl,
73
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
74
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
75
+ });
76
+
77
+ const listExpressionDataSourceBffClient = listExpressionDataSourceBffClientFactory(
78
+ _apiMachineFetchFactory({
79
+ baseUrl: params.wysiwygBffProxyBaseUrl
80
+ })
81
+ );
82
+
83
+ const createTemplate = <
84
+ TListExpressionDataSource,
85
+ TNumberExpressionDataSource,
86
+ TStringExpressionDataSource>(arg: {
87
+ template: EmailTemplateType<
88
+ TListExpressionDataSource,
89
+ TNumberExpressionDataSource,
90
+ TStringExpressionDataSource>
91
+ }): void => {
92
+ const formData = new FormData();
93
+ formData.append(
94
+ params.antiForgeryFormTokenName,
95
+ params.antiForgeryFormTokenValue);
96
+ formData.append(
97
+ 'template',
98
+ JSON.stringify(arg.template));
99
+
100
+ const form = createSimpleDataForm({
101
+ method: 'POST',
102
+ action: params.createEmailTemplateSubmitUrl,
103
+ formData: formData
104
+ });
105
+
106
+ document.body.appendChild(form);
107
+ form.submit();
108
+ };
109
+
110
+ const contactCustomData: ContactCustomData = {};
111
+ const nextCouponFromBatch: NextCouponFromBatchType = {
112
+ BatchId: ''
113
+ };
114
+
115
+ const createEmailTemplatePreviewTile = (arg: {
116
+ template: EmailTemplateType<
117
+ AbandonedViewPriceDropListExpressionDataSource,
118
+ AbandonedViewPriceDropNumberExpressionDataSource,
119
+ AbandonedViewPriceDropStringExpressionDataSource
120
+ >;
121
+ templateName: string;
122
+ }): EmailTemplatePreviewTileComponent => {
123
+
124
+ const listExpressionDataSourceEvaluator = abandonedViewPriceDropEvaluateListExpressionDataSourceFactory({
125
+ partnerId: params.partnerId,
126
+ listExpressionDataSourceBffClient: listExpressionDataSourceBffClient,
127
+ customerStockId: undefined
128
+ });
129
+
130
+ const listExpressionEvaluator = listExpressionEvaluatorFactory({
131
+ listExpressionDataSourceEvaluator: listExpressionDataSourceEvaluator
132
+ });
133
+
134
+ const numberExpressionDataSourceEvaluator = abandonedViewPriceDropEvaluateNumberExpressionDataSourceFactory();
135
+
136
+ const numberExpressionEvaluator = numberExpressionEvaluatorDelegate({
137
+ listExpressionEvaluator: listExpressionEvaluator,
138
+ numberExpressionDataSourceEvaluator: numberExpressionDataSourceEvaluator
139
+ })
140
+
141
+ const stringExpressionEvaluator: StringExpressionEvaluatorDelegate<
142
+ AbandonedViewPriceDropListExpressionDataSource,
143
+ AbandonedViewPriceDropNumberExpressionDataSource,
144
+ AbandonedViewPriceDropStringExpressionDataSource
145
+ > = stringExpressionEvaluatorFactory({
146
+ listExpressionEvaluator: listExpressionEvaluator,
147
+ numberExpressionEvaluator: numberExpressionEvaluator,
148
+ stringExpressionDataSourceEvaluatorFactory: () => abandonedViewPriceDropStringExpressionDataSourceEvaluatorFactory({
149
+ productImageUrlBuilderExpressionEvaluator: productImageUrlBuilderExpressionEvaluatorFactory({
150
+ partnerId: params.partnerId,
151
+ numberExpressionEvaluator: numberExpressionEvaluator
152
+ }),
153
+ contactCustomData: contactCustomData,
154
+ nextCouponFromBatch: nextCouponFromBatch
155
+ })
156
+ });
157
+
158
+ const expressionEvaluator = expressionEvaluatorFactory({
159
+ listExpressionEvaluator: listExpressionEvaluator,
160
+ numberExpressionEvaluator: numberExpressionEvaluator,
161
+ stringExpressionEvaluator: stringExpressionEvaluator,
162
+ dataStructBuilderExpressionEvaluatorFactory: expressionEvaluator => dataStructBuilderExpressionEvaluatorFactory({
163
+ expressionEvaluator: expressionEvaluator
164
+ })
165
+ });
166
+
167
+ const dataStructExpressionEvaluator = dataStructBuilderExpressionEvaluatorFactory({
168
+ expressionEvaluator: expressionEvaluator
169
+ });
170
+
171
+ const stringExpressionBuilderPlugin = stringExpressionBuilderPluginFactory({
172
+ localeKey: params.localeKey
173
+ });
174
+
175
+ return emailTemplatePreviewTileComponentFactory<
176
+ AbandonedViewPriceDropListExpressionDataSource,
177
+ AbandonedViewPriceDropNumberExpressionDataSource,
178
+ AbandonedViewPriceDropStringExpressionDataSource
179
+ >({
180
+ template: arg.template,
181
+ templateName: arg.templateName,
182
+ emailTemplatePreviewTileDeps: emailTemplatePreviewTileDepsFactory<
183
+ AbandonedViewPriceDropListExpressionDataSource,
184
+ AbandonedViewPriceDropNumberExpressionDataSource,
185
+ AbandonedViewPriceDropStringExpressionDataSource
186
+ >({
187
+ localeKey: params.localeKey,
188
+ dataSourceFieldNameDelegate: ({ dataSource }) => {
189
+ return matcherFactory(dataSource as GeneralStringExpressionDataSource).Match({
190
+ StringFromContactCustomData: (customData) => customData.FieldName,
191
+ StringFromContactCustomDataWithFallback: (customDataWithFallback) => customDataWithFallback.FallbackValue,
192
+ ProductImageUrlBuilderExpression: () => 'ImageResizer',
193
+ NextCouponFromBatch: () => 'Coupon'
194
+ });
195
+ },
196
+ richTextToolbarPlugins: [
197
+ richTextToolbarPluginFactory({
198
+ richTextToolbarPluginComponent: VariableSelector,
199
+ deps: variableSelectorDepsFactory({
200
+ localeKey: params.localeKey,
201
+ stringExpressionBuilderPlugin: stringExpressionBuilderPlugin
202
+ })
203
+ })
204
+ ],
205
+ listExpressionEvaluator: listExpressionEvaluator,
206
+ numberExpressionEvaluator: numberExpressionEvaluator,
207
+ stringExpressionEvaluator: stringExpressionEvaluator,
208
+ dataStructExpressionEvaluator: dataStructExpressionEvaluator,
209
+ expressionEvaluator: expressionEvaluator,
210
+ stringExpressionBuilderPlugin: stringExpressionBuilderPlugin,
211
+ }),
212
+ onFavoriteTemplateSelected: () => {
213
+ createTemplate({
214
+ template: arg.template
215
+ });
216
+ },
217
+ });
218
+ };
219
+
220
+ const initialEmailTemplate = params.localeKey === 'ru'
221
+ ? initialEmailTemplateRu
222
+ : initialEmailTemplateEn;
223
+
224
+ const app = createApp(
225
+ CreateEmailTemplateApp,
226
+ {
227
+ onInitialTemplateSelected: () => {
228
+ createTemplate({
229
+ template: params.initialEmailTemplateJson.length
230
+ ? JSON.parse(params.initialEmailTemplateJson)
231
+ : initialEmailTemplate,
232
+ });
233
+ },
234
+ deps:
235
+ createEmailTemplateAppDepsFactory<
236
+ AbandonedViewPriceDropListExpressionDataSource,
237
+ AbandonedViewPriceDropNumberExpressionDataSource,
238
+ AbandonedViewPriceDropStringExpressionDataSource
239
+ >({
240
+ partnerId: params.partnerId,
241
+ localeKey: params.localeKey,
242
+ emailTemplatePreviews:
243
+ {
244
+ custom: [
245
+ ...params
246
+ .commonFavoritesTemplates
247
+ .map(o => ({
248
+ templateName: o.favoriteTemplateName,
249
+ previewTileComponent: createEmailTemplatePreviewTile({
250
+ template: JSON.parse(o.templateJson),
251
+ templateName: o.favoriteTemplateName
252
+ })
253
+ })),
254
+ ...params
255
+ .abandonedViewPriceDropFavoritesTemplates
256
+ .map(o => ({
257
+ templateName: o.favoriteTemplateName,
258
+ previewTileComponent: createEmailTemplatePreviewTile({
259
+ template: JSON.parse(o.templateJson),
260
+ templateName: o.favoriteTemplateName
261
+ })
262
+ }))
263
+ ],
264
+ default: [
265
+ ...defaultTemplateLibraryFactory(params.localeKey)
266
+ .map(o => ({
267
+ templateName: o.favoriteTemplateName,
268
+ previewTileComponent: createEmailTemplatePreviewTile({
269
+ template: o.defaultTemplate as EmailTemplateType<
270
+ AbandonedViewPriceDropListExpressionDataSource,
271
+ AbandonedViewPriceDropNumberExpressionDataSource,
272
+ AbandonedViewPriceDropStringExpressionDataSource
273
+ >,
274
+ templateName: o.favoriteTemplateName
275
+ })
276
+ }))
277
+ ]
278
+ },
279
+ initialEmailTemplate: params.initialEmailTemplateJson.length
280
+ ? JSON.parse(params.initialEmailTemplateJson)
281
+ : initialEmailTemplate,
282
+ exitLink: params.exitLink
283
+ }
284
+ )
285
+ }
286
+ );
287
+
288
+ app.use(createVuetify({
289
+ theme: false,
290
+ directives: {
291
+ ClickOutside
292
+ }
293
+ }));
294
+
295
+ app.mount(appTagId);
@@ -0,0 +1,30 @@
1
+ import type {
2
+ ComponentLibrarySectionItem,
3
+ } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
4
+ import type { CustomComponentSectionItemType } from '@easy-wizzy/core';
5
+ import type {
6
+ AbandonedViewPriceDropListExpressionDataSource
7
+ } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
8
+ import type {
9
+ AbandonedViewPriceDropNumberExpressionDataSource
10
+ } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
11
+ import type {
12
+ AbandonedViewPriceDropStringExpressionDataSource
13
+ } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
14
+ import {
15
+ abandonedViewPriceDropEmailComponentFactory
16
+ } from '@/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/abandonedViewPriceDropEmailComponentFactory';
17
+
18
+ export const abandonedViewPriceDropComponentSectionItemFactory = (
19
+ componentLibrarySectionItem: ComponentLibrarySectionItem,
20
+ ): CustomComponentSectionItemType<
21
+ AbandonedViewPriceDropListExpressionDataSource,
22
+ AbandonedViewPriceDropNumberExpressionDataSource,
23
+ AbandonedViewPriceDropStringExpressionDataSource
24
+ > => {
25
+ return {
26
+ sectionItemId: componentLibrarySectionItem.sectionItemId,
27
+ sectionItemName: componentLibrarySectionItem.sectionItemName,
28
+ componentTemplate: abandonedViewPriceDropEmailComponentFactory(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
+ AbandonedViewPriceDropListExpressionDataSource
7
+ } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
8
+ import type {
9
+ AbandonedViewPriceDropNumberExpressionDataSource
10
+ } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
11
+ import type {
12
+ AbandonedViewPriceDropStringExpressionDataSource
13
+ } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
14
+
15
+ export const abandonedViewPriceDropEmailComponentFactory = (
16
+ component: Component
17
+ ): EmailComponentType<
18
+ AbandonedViewPriceDropListExpressionDataSource,
19
+ AbandonedViewPriceDropNumberExpressionDataSource,
20
+ AbandonedViewPriceDropStringExpressionDataSource
21
+ > =>
22
+ {
23
+ return component.triggerAbandonedViewPriceDrop
24
+ ? JSON.parse(component.triggerAbandonedViewPriceDrop.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
+ AbandonedViewPriceDropListExpressionDataSource
9
+ } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
10
+ import type {
11
+ AbandonedViewPriceDropNumberExpressionDataSource
12
+ } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
13
+ import type {
14
+ AbandonedViewPriceDropStringExpressionDataSource
15
+ } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
16
+ import {
17
+ abandonedViewPriceDropSectionFactory
18
+ } from '@/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/abandonedViewPriceDropSectionFactory';
19
+
20
+ export const abandonedViewPriceDropComponentLibraryFactory = (
21
+ componentLibrary: Array<ComponentLibrarySection>
22
+ ): CustomComponentLibraryType<
23
+ AbandonedViewPriceDropListExpressionDataSource,
24
+ AbandonedViewPriceDropNumberExpressionDataSource,
25
+ AbandonedViewPriceDropStringExpressionDataSource
26
+ > => {
27
+ return componentLibrary
28
+ .map(section => abandonedViewPriceDropSectionFactory(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
+ AbandonedViewPriceDropListExpressionDataSource
7
+ } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
8
+ import type {
9
+ AbandonedViewPriceDropNumberExpressionDataSource
10
+ } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
11
+ import type {
12
+ AbandonedViewPriceDropStringExpressionDataSource
13
+ } from '@easy-wizzy/retailrocket-abandoned-view-price-drop';
14
+ import {
15
+ abandonedViewPriceDropComponentSectionItemFactory
16
+ } from '@/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/abandonedViewPriceDropComponentSectionItemFactory';
17
+
18
+ export const abandonedViewPriceDropSectionFactory = (
19
+ section: ComponentLibrarySection,
20
+ ): CustomComponentSectionType<
21
+ AbandonedViewPriceDropListExpressionDataSource,
22
+ AbandonedViewPriceDropNumberExpressionDataSource,
23
+ AbandonedViewPriceDropStringExpressionDataSource
24
+ > => {
25
+ return {
26
+ sectionId: section.sectionId,
27
+ sectionName: section.sectionName,
28
+ componentList: section
29
+ .sectionItems
30
+ .map(component => abandonedViewPriceDropComponentSectionItemFactory(component)),
31
+ };
32
+ };