@retailrocketgroup/retailrocket-edit.welcome-sequence-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 (38) 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/editWelcomeSequenceEmailTemplate.d.ts +0 -0
  6. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/welcomeSequenceComponentSectionItemFactory.d.ts +4 -0
  7. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/welcomeSequenceEmailComponentFactory.d.ts +4 -0
  8. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/welcomeSequenceComponentLibraryFactory.d.ts +4 -0
  9. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/welcomeSequenceSectionFactory.d.ts +4 -0
  10. package/dist/implementation/DataSources/ListDataExpressionSource/welcomeSequenceEvaluateListExpressionDataSourceFactory.d.ts +8 -0
  11. package/dist/implementation/DataSources/NumberExpressionDataSource/welcomeSequenceEvaluateNumberExpressionDataSourceFactory.d.ts +2 -0
  12. package/dist/implementation/DataSources/StringExpressionDataSource/welcomeSequenceEvaluateStringExpressionDataSource.d.ts +9 -0
  13. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/WelcomeSequenceProductShelfDataSourceExpressionBuilderModal/welcomeSequenceProductShelfDataSourceExpressionBuilderModalDepsFactory.d.ts +11 -0
  14. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/welcomeSequenceProductShelfDataSourceExpressionBuilderDepsFactory.d.ts +11 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.html +35 -0
  17. package/env.d.ts +1 -0
  18. package/index.html +1 -2
  19. package/package.json +1 -1
  20. package/src/editWelcomeSequenceEmailTemplate.ts +410 -0
  21. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/welcomeSequenceComponentSectionItemFactory.ts +30 -0
  22. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/welcomeSequenceEmailComponentFactory.ts +26 -0
  23. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/welcomeSequenceComponentLibraryFactory.ts +29 -0
  24. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/welcomeSequenceSectionFactory.ts +34 -0
  25. package/src/implementation/DataSources/ListDataExpressionSource/welcomeSequenceEvaluateListExpressionDataSourceFactory.ts +106 -0
  26. package/src/implementation/DataSources/NumberExpressionDataSource/welcomeSequenceEvaluateNumberExpressionDataSourceFactory.ts +10 -0
  27. package/src/implementation/DataSources/StringExpressionDataSource/welcomeSequenceEvaluateStringExpressionDataSource.ts +56 -0
  28. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/WelcomeSequenceProductShelfDataSourceExpressionBuilderModal/welcomeSequenceProductShelfDataSourceExpressionBuilderModalDepsFactory.ts +125 -0
  29. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/welcomeSequenceProductShelfDataSourceExpressionBuilderDepsFactory.ts +33 -0
  30. package/src/index.ts +0 -0
  31. package/tsconfig.app.json +19 -0
  32. package/tsconfig.json +14 -0
  33. package/tsconfig.node.json +11 -0
  34. package/tsconfig.test.json +11 -0
  35. package/vite.config.ts +36 -0
  36. package/assets/main.css +0 -1
  37. package/assets/main.js +0 -217
  38. package/favicon.ico +0 -0
File without changes
@@ -0,0 +1,4 @@
1
+ import { WelcomeSequenceListExpressionDataSource, WelcomeSequenceNumberExpressionDataSource, WelcomeSequenceStringExpressionDataSource } from '@easy-wizzy/retailrocket-welcome-sequence';
2
+ import { ComponentLibrarySectionItem } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
3
+ import { CustomComponentSectionItemType } from '@easy-wizzy/core';
4
+ export declare const welcomeSequenceComponentSectionItemFactory: (componentLibrarySectionItem: ComponentLibrarySectionItem) => CustomComponentSectionItemType<WelcomeSequenceListExpressionDataSource, WelcomeSequenceNumberExpressionDataSource, WelcomeSequenceStringExpressionDataSource>;
@@ -0,0 +1,4 @@
1
+ import { EmailComponentType } from '@easy-wizzy/core';
2
+ import { WelcomeSequenceListExpressionDataSource, WelcomeSequenceNumberExpressionDataSource, WelcomeSequenceStringExpressionDataSource } from '@easy-wizzy/retailrocket-welcome-sequence';
3
+ import { Component } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.addcomponentlibrarysectionitemmodalwindow/main';
4
+ export declare const welcomeSequenceEmailComponentFactory: (component: Component) => EmailComponentType<WelcomeSequenceListExpressionDataSource, WelcomeSequenceNumberExpressionDataSource, WelcomeSequenceStringExpressionDataSource>;
@@ -0,0 +1,4 @@
1
+ import { WelcomeSequenceListExpressionDataSource, WelcomeSequenceNumberExpressionDataSource, WelcomeSequenceStringExpressionDataSource } from '@easy-wizzy/retailrocket-welcome-sequence';
2
+ import { ComponentLibrarySection } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
3
+ import { CustomComponentLibraryType } from '@easy-wizzy/core';
4
+ export declare const welcomeSequenceComponentLibraryFactory: (componentLibrary: Array<ComponentLibrarySection>) => CustomComponentLibraryType<WelcomeSequenceListExpressionDataSource, WelcomeSequenceNumberExpressionDataSource, WelcomeSequenceStringExpressionDataSource>;
@@ -0,0 +1,4 @@
1
+ import { WelcomeSequenceListExpressionDataSource, WelcomeSequenceNumberExpressionDataSource, WelcomeSequenceStringExpressionDataSource } from '@easy-wizzy/retailrocket-welcome-sequence';
2
+ import { ComponentLibrarySection } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
3
+ import { CustomComponentSectionType } from '@easy-wizzy/core';
4
+ export declare const welcomeSequenceSectionFactory: (section: ComponentLibrarySection) => CustomComponentSectionType<WelcomeSequenceListExpressionDataSource, WelcomeSequenceNumberExpressionDataSource, WelcomeSequenceStringExpressionDataSource>;
@@ -0,0 +1,8 @@
1
+ import { WelcomeSequenceListExpressionDataSource } from '@easy-wizzy/retailrocket-welcome-sequence';
2
+ import { ListExpressionDataSourceBffClient } from '@easy-wizzy/common-app';
3
+ import { ListExpressionDataSourceEvaluatorDelegate } from '@easy-wizzy/core';
4
+ export declare const welcomeSequenceEvaluateListExpressionDataSourceFactory: (arg: {
5
+ partnerId: string;
6
+ listExpressionDataSourceBffClient: ListExpressionDataSourceBffClient;
7
+ customerStockId: string | undefined;
8
+ }) => ListExpressionDataSourceEvaluatorDelegate<WelcomeSequenceListExpressionDataSource>;
@@ -0,0 +1,2 @@
1
+ import { NumberExpressionDataSourceEvaluatorDelegate } from '@easy-wizzy/core';
2
+ export declare const welcomeSequenceEvaluateNumberExpressionDataSourceFactory: <TNumberExpressionDataSource>() => NumberExpressionDataSourceEvaluatorDelegate<TNumberExpressionDataSource>;
@@ -0,0 +1,9 @@
1
+ import { WelcomeSequenceStringExpressionDataSource, WelcomeSequenceListExpressionDataSource, WelcomeSequenceNumberExpressionDataSource } from '@easy-wizzy/retailrocket-welcome-sequence';
2
+ import { StringExpressionDataSourceEvaluatorDelegate } from '@easy-wizzy/core';
3
+ import { ContactCustomData, NextCouponFromBatchType } from '@easy-wizzy/retailrocket-common';
4
+ import { ProductImageUrlBuilderExpressionEvaluatorDelegate } from '@easy-wizzy/common-app';
5
+ export declare const welcomeSequenceStringExpressionDataSourceEvaluatorFactory: (arg: {
6
+ productImageUrlBuilderExpressionEvaluator: ProductImageUrlBuilderExpressionEvaluatorDelegate<WelcomeSequenceListExpressionDataSource, WelcomeSequenceNumberExpressionDataSource>;
7
+ contactCustomData: ContactCustomData;
8
+ nextCouponFromBatch: NextCouponFromBatchType;
9
+ }) => StringExpressionDataSourceEvaluatorDelegate<WelcomeSequenceStringExpressionDataSource>;
@@ -0,0 +1,11 @@
1
+ import { LocaleKey } from '@easy-wizzy/core';
2
+ import { WelcomeSequenceProductShelfDataSourceExpressionBuilderModalDeps } from '@easy-wizzy/retailrocket-welcome-sequence';
3
+ import { ProductShelfBuilderModalWindowBffClient, ProductPickerModalWindowBffClient, ProductCategoryPickerModalWindowBffClient } from '@easy-wizzy/common-app';
4
+ export declare const welcomeSequenceProductShelfDataSourceExpressionBuilderModalDepsFactory: (arg: {
5
+ localeKey: LocaleKey;
6
+ partnerId: string;
7
+ customerStockId: string | undefined;
8
+ productShelfBuilderModalWindowBffClient: ProductShelfBuilderModalWindowBffClient;
9
+ productCategoryPickerModalWindowBffClient: ProductCategoryPickerModalWindowBffClient;
10
+ productPickerModalWindowBffClient: ProductPickerModalWindowBffClient;
11
+ }) => WelcomeSequenceProductShelfDataSourceExpressionBuilderModalDeps;
@@ -0,0 +1,11 @@
1
+ import { LocaleKey } from '@easy-wizzy/core';
2
+ import { WelcomeSequenceProductShelfDataSourceExpressionBuilderDeps } from '@easy-wizzy/retailrocket-welcome-sequence';
3
+ import { ProductShelfBuilderModalWindowBffClient, ProductPickerModalWindowBffClient, ProductCategoryPickerModalWindowBffClient } from '@easy-wizzy/common-app';
4
+ export declare const welcomeSequenceProductShelfDataSourceExpressionBuilderDepsFactory: (arg: {
5
+ localeKey: LocaleKey;
6
+ partnerId: string;
7
+ customerStockId: string | undefined;
8
+ productShelfBuilderModalWindowBffClient: ProductShelfBuilderModalWindowBffClient;
9
+ productCategoryPickerModalWindowBffClient: ProductCategoryPickerModalWindowBffClient;
10
+ productPickerModalWindowBffClient: ProductPickerModalWindowBffClient;
11
+ }) => WelcomeSequenceProductShelfDataSourceExpressionBuilderDeps;
@@ -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-email-template-json='{"Subject": "","Preheader": "","Theme": {"BodyWidth": 600,"IsResponsiveWidth": true,"FontFamily": "Arial","Colors": {"EmailBackgroundColor": "#EEEEEE","BodyColor": "#FFFFFF","PrimaryColor": "#557aff","PrimaryTextColor": "#ffffff","SecondaryColor": "#E4EAFF","SecondaryTextColor": "#557aff","CardBackgroundColor": "#F6F6F6","HeadingColor": "#2F2F2F","TitleColor": "#2F2F2F","SubHeadingColor": "#2F2F2F","LargeTextColor": "#2F2F2F","NormalTextColor": "#2F2F2F","DescriptionTextColor": "#999999","LinkColor": "#65A0FA","ButtonTextColor": "#ffffff"},"BorderRadius": {"TopLeft": 20,"TopRight": 20,"BottomLeft": 20,"BottomRight": 20},"BorderRadiusCard": {"TopLeft": 16,"TopRight": 16,"BottomLeft": 16,"BottomRight": 16},"BorderRadiusButton": {"TopLeft": 6,"TopRight": 6,"BottomLeft": 6,"BottomRight": 6},"BorderRadiusBanner": {"TopLeft": 0,"TopRight": 0,"BottomLeft": 0,"BottomRight": 0},"BodyPaddings": {"Left": 20,"Right": 20,"Top": 10,"Bottom": 10},"ComponentPaddings": {"Small": 8,"Medium": 16,"Large": 24,"Huge": 24},"ButtonPaddings": {"TopBottom": 12,"LeftRight": 14},"FontSettingsPresets": {"Title": {"FontSize": 24,"LineHeight": 28,"IsBold": true,"IsItalic": false,"Decoration": "None"},"Heading": {"FontSize": 20,"LineHeight": 24,"IsBold": true,"IsItalic": false,"Decoration": "None"},"SubHeading": {"FontSize": 14,"LineHeight": 16,"IsBold": true,"IsItalic": false,"Decoration": "None"},"LargeText": {"FontSize": 14,"LineHeight": 18,"IsBold": false,"IsItalic": false,"Decoration": "None"},"NormalText": {"FontSize": 12,"LineHeight": 15,"IsBold": false,"IsItalic": false,"Decoration": "None"},"DescriptionText": {"FontSize": 10,"LineHeight": 13,"IsBold": false,"IsItalic": false,"Decoration": "None"},"Button": {"FontSize": 12,"LineHeight": 14,"IsBold": true,"IsItalic": false,"Decoration": "None"},"Link": {"FontSize": 12,"LineHeight": 14,"IsBold": false,"IsItalic": false,"Decoration": "None"}}},"Components": [{"IsRequired": false,"BorderRadius": {"TopLeft": {"Discriminator": "CustomBorderRadius","CustomValue": 0},"TopRight": {"Discriminator": "CustomBorderRadius","CustomValue": 0},"BottomRight": {"Discriminator": "CustomBorderRadius","CustomValue": 0},"BottomLeft": {"Discriminator": "CustomBorderRadius","CustomValue": 0}},"InnerBgColor": {"Discriminator": "BodyColor","CustomValue": "#000000"},"Paddings": {"Top": {"ThemePadding": "ThemePaddingsLarge"},"Bottom": {"ThemePadding": "ThemePaddingsLarge"}},"FullWidth": false,"BodyRowList": [{"MultipleColumnBodyRow": {"ColumnSpacerSize": {"CustomValue": 0},"DirectionRtl": false,"Paddings": {"Left": {"CustomValue": 0},"Top": {"CustomValue": 0},"Right": {"CustomValue": 0},"Bottom": {"CustomValue": 0}},"Border": {"Left": {"Width": 0,"Style": "None","Color": {"Discriminator": "Custom","CustomValue": "#FFFFFF"}},"Top": {"Width": 0,"Style": "None","Color": {"Discriminator": "Custom","CustomValue": "#FFFFFF"}},"Right": {"Width": 0,"Style": "None","Color": {"Discriminator": "Custom","CustomValue": "#FFFFFF"}},"Bottom": {"Width": 0,"Style": "None","Color": {"Discriminator": "Custom","CustomValue": "#FFFFFF"}}},"BorderRadius": {"TopLeft": {"Discriminator": "CustomBorderRadius","CustomValue": 0},"TopRight": {"Discriminator": "CustomBorderRadius","CustomValue": 0},"BottomRight": {"Discriminator": "CustomBorderRadius","CustomValue": 0},"BottomLeft": {"Discriminator": "CustomBorderRadius","CustomValue": 0}},"BgColor": {"Discriminator": "None","CustomValue": "#ffffff"},"ContainerAlign": "Center","Columns": [{"VerticalAlign": "Top","BgColor": {"Discriminator": "None","CustomValue": "#ffffff"},"Paddings": {"Top": {"CustomValue": 0},"Right": {"CustomValue": 0},"Bottom": {"CustomValue": 0},"Left": {"CustomValue": 0}},"Border": {"Left": {"Width": 0,"Style": "None","Color": {"Discriminator": "Custom","CustomValue": "#FFFFFF"}},"Top": {"Width": 0,"Style": "None","Color": {"Discriminator": "Custom","CustomValue": "#FFFFFF"}},"Right": {"Width": 0,"Style": "None","Color": {"Discriminator": "Custom","CustomValue": "#FFFFFF"}},"Bottom": {"Width": 0,"Style": "None","Color": {"Discriminator": "Custom","CustomValue": "#FFFFFF"}}},"BorderRadius": {"TopLeft": {"Discriminator": "CustomBorderRadius","CustomValue": 0},"TopRight": {"Discriminator": "CustomBorderRadius","CustomValue": 0},"BottomRight": {"Discriminator": "CustomBorderRadius","CustomValue": 0},"BottomLeft": {"Discriminator": "CustomBorderRadius","CustomValue": 0}},"ContainerAlign": "Center","Elements": [{"RichText": {"ImageVerticalAlign": "Baseline","MinHeight": 1,"ContentAlign": "Center","Text": {"Content": [{"ParagraphNode": {"Content": [{"TextNode": {"Text": "Сервис создания электронных писем","TextStyle": {"ThemeName": "Heading","Style": {}}}}]}}]}}},{"Spacer": {"Height": {"ThemePadding": "ThemePaddingsLarge"},"Weight": 0,"Color": {"Discriminator": "None","CustomValue": "#FFFFFF"}}},{"RichText": {"ImageVerticalAlign": "Baseline","MinHeight": 1,"ContentAlign": "Center","Text": {"Content": [{"ParagraphNode": {"Content": [{"TextNode": {"Text": "Мы рады представить вам наш новый продукт - сервис создания электронных писем. С помощью этого удобного и интуитивно понятного инструмента, вы сможете легко создавать красивые и профессиональные письма всего в несколько простых шагов.","TextStyle": {"ThemeName": "LargeText","Style": {}}}}]}}]}}}],"Width": {"JustifyWidth": {"WidthInPixels": 560}}}]}}]}]}'
25
+ data-create-email-template-submit-url="data-create-email-template-submit-url"
26
+ data-anti-forgery-header-token-name="data-anti-forgery-header-token-name"
27
+ data-anti-forgery-header-token-value="data-anti-forgery-header-token-value"
28
+ data-anti-forgery-form-token-name="data-anti-forgery-form-token-name"
29
+ data-anti-forgery-form-token-value="data-anti-forgery-form-token-value"
30
+ data-reset-template-form-url="https://webhook.site/a85a171c-bb86-4693-9552-d209a59a7e6a"
31
+ data-exit-link="ya.ru"
32
+ data-locale-key="en"
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-exit-link="ya.ru"
32
30
  data-locale-key="en"
33
31
  ></div>
32
+ <script type="module" src="/src/editWelcomeSequenceEmailTemplate.ts"></script>
34
33
  </body>
35
34
  </html>
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@retailrocketgroup/retailrocket-edit.welcome-sequence-vue-email-template-render",
3
- "version": "3.0.381747",
3
+ "version": "5.0.384530",
4
4
  "private": false
5
5
  }
@@ -0,0 +1,410 @@
1
+ import 'bootstrap';
2
+ import '@easy-wizzy/retailrocket-common/index.css';
3
+ import '@easy-wizzy/core/index.css';
4
+
5
+ import { createApp } from 'vue';
6
+ import { createVuetify } from 'vuetify';
7
+ import { ClickOutside } from 'vuetify/directives';
8
+
9
+ import { createSimpleDataForm, matcherFactory } from '@easy-wizzy/core';
10
+ import { EditEmailTemplateApp } from '@easy-wizzy/core';
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 { LocaleKey } from '@easy-wizzy/core';
18
+ import type { StringExpressionEvaluatorDelegate } from '@easy-wizzy/core';
19
+
20
+ import { defaultThemeLibraryFactory } from '@easy-wizzy/theme-library';
21
+ import { defaultComponentLibraryFactory } from '@easy-wizzy/component-library';
22
+
23
+ import type { ApiMachineFetchDelegate } from '@easy-wizzy/common-app';
24
+
25
+ import { apiMachineFetchFactory } from '@easy-wizzy/common-app';
26
+ import { editEmailTemplateAppDepsFactory } from '@easy-wizzy/common-app';
27
+ import { productImageUrlBuilderExpressionEvaluatorFactory } from '@easy-wizzy/common-app';
28
+ import { wysiwygTemplateEditorBffClientFactory } from '@easy-wizzy/common-app';
29
+ import { variableSelectorDepsFactory } from '@easy-wizzy/common-app';
30
+
31
+ import { productShelfDataSourceExpressionBuilderPluginFactory } from '@easy-wizzy/retailrocket-common';
32
+ import { stringExpressionBuilderPluginFactory, richTextToolbarPluginFactory, VariableSelector } from '@easy-wizzy/retailrocket-common';
33
+
34
+ import type { ContactCustomData, GeneralStringExpressionDataSource, NextCouponFromBatchType } from '@easy-wizzy/retailrocket-common';
35
+
36
+ import type { WelcomeSequenceListExpressionDataSource } from '@easy-wizzy/retailrocket-welcome-sequence';
37
+ import type { WelcomeSequenceNumberExpressionDataSource } from '@easy-wizzy/retailrocket-welcome-sequence';
38
+ import type { WelcomeSequenceStringExpressionDataSource } from '@easy-wizzy/retailrocket-welcome-sequence';
39
+
40
+ import { WelcomeSequenceProductShelfDataSourceExpressionBuilder } from '@easy-wizzy/retailrocket-welcome-sequence';
41
+
42
+ import { welcomeSequenceEvaluateListExpressionDataSourceFactory } from '@/implementation/DataSources/ListDataExpressionSource/welcomeSequenceEvaluateListExpressionDataSourceFactory';
43
+ import { welcomeSequenceEvaluateNumberExpressionDataSourceFactory } from '@/implementation/DataSources/NumberExpressionDataSource/welcomeSequenceEvaluateNumberExpressionDataSourceFactory';
44
+ import { welcomeSequenceStringExpressionDataSourceEvaluatorFactory } from '@/implementation/DataSources/StringExpressionDataSource/welcomeSequenceEvaluateStringExpressionDataSource';
45
+ import { welcomeSequenceComponentLibraryFactory } from '@/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/welcomeSequenceComponentLibraryFactory';
46
+ import { welcomeSequenceProductShelfDataSourceExpressionBuilderDepsFactory } from '@/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/welcomeSequenceProductShelfDataSourceExpressionBuilderDepsFactory';
47
+
48
+ import { createApi as createTriggerWelcomeSequenceWysiwygTemplateEditorClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.triggerwelcomesequencewysiwygtemplateeditor';
49
+ import {
50
+ type Component,
51
+ createApi as createAddComponentLibrarySectionItemModalWindowBffClient
52
+ } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.addcomponentlibrarysectionitemmodalwindow';
53
+ import { createApi as listExpressionDataSourceBffClientFactory } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.listexpressiondatasource';
54
+ import { createApi as createProductShelfBuilderModalWindowBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.productshelfmodalwindow';
55
+ import { createApi as createThemeLibraryBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.themelibrary';
56
+ import { createApi as createComponentLibraryBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary';
57
+ import { createApi as createAddThemeLibrarySectionItemModalWindowBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.addthemelibrarysectionitemmodalwindow';
58
+ import { createApi as createDeleteThemeLibrarySectionItemModalWindowBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.deletethemelibrarysectionitemmodalwindow';
59
+ import { createApi as createDeleteThemeLibrarySectionModalWindowBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.deletethemelibrarysectionmodalwindow';
60
+ import { createApi as createEditThemeLibrarySectionItemModalWindowBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.editthemelibrarysectionitemmodalwindow';
61
+ import { createApi as createAddComponentLibrarySectionModalWindowBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.addcomponentlibrarysectionmodalwindow';
62
+ import { createApi as createEditComponentLibrarySectionItemModalWindowBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.editcomponentlibrarysectionitemmodalwindow';
63
+ import { createApi as createDeleteComponentLibrarySectionItemModalWindowBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.deletecomponentlibrarysectionitemmodalwindow';
64
+ import { createApi as createThemeLibrarySectionModalWindowBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.addthemelibrarysectionmodalwindow';
65
+ import { createApi as createDeleteComponentLibrarySectionModalWindowBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.deletecomponentlibrarysectionmodalwindow';
66
+ import { createApi as createProductCategoryPickerModalWindowBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.productcategorypickermodalwindow';
67
+ import { createApi as createProductPickerModalWindowBffClient } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.productpickermodalwindow';
68
+ import { createApi as saveFavoriteTemplate } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.savefavoritetemplatemodalwindow';
69
+
70
+ const appTagId = '#app';
71
+ const appTag = document.querySelector(appTagId);
72
+
73
+ const params = {
74
+ partnerId: appTag!.getAttribute('data-partner-id')!,
75
+ wysiwygBffProxyBaseUrl: appTag!.getAttribute('data-wysiwyg-bff-proxy-base-url')!,
76
+ wysiwygTemplateEditorBffBaseUrl: appTag!.getAttribute('data-wysiwyg-template-editor-bff-base-url')!,
77
+ antiForgeryHeaderTokenName: appTag!.getAttribute('data-anti-forgery-header-token-name')!,
78
+ antiForgeryHeaderTokenValue: appTag!.getAttribute('data-anti-forgery-header-token-value')!,
79
+ antiForgeryFormTokenName: appTag!.getAttribute('data-anti-forgery-form-token-name')!,
80
+ antiForgeryFormTokenValue: appTag!.getAttribute('data-anti-forgery-form-token-value')!,
81
+ emailTemplateJson: appTag!.getAttribute('data-email-template-json')!,
82
+ previewTemplateDataJson: appTag!.getAttribute('data-preview-template-data-json')!,
83
+ resetTemplateFormUrl: appTag!.getAttribute('data-reset-template-form-url')!,
84
+ exitLink: appTag!.getAttribute('data-exit-link')!,
85
+ localeKey: appTag!.getAttribute('data-locale-key') as LocaleKey || 'en'
86
+ };
87
+
88
+ const _apiMachineFetchFactory = (arg: {
89
+ baseUrl: string
90
+ }): ApiMachineFetchDelegate => apiMachineFetchFactory({
91
+ baseUrl: arg.baseUrl,
92
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
93
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
94
+ });
95
+
96
+ const welcomeSequenceMainPageBffClient = createTriggerWelcomeSequenceWysiwygTemplateEditorClient(
97
+ apiMachineFetchFactory({
98
+ baseUrl: params.wysiwygTemplateEditorBffBaseUrl,
99
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
100
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
101
+ })
102
+ );
103
+
104
+
105
+ const createFavoriteTemplateBffClient = saveFavoriteTemplate(
106
+ _apiMachineFetchFactory({
107
+ baseUrl: params.wysiwygBffProxyBaseUrl
108
+ })
109
+ );
110
+
111
+ const resetTemplate = (): void => {
112
+ const formData = new FormData();
113
+ formData.append(
114
+ params.antiForgeryFormTokenName,
115
+ params.antiForgeryFormTokenValue);
116
+
117
+ const form = createSimpleDataForm({
118
+ method: 'POST',
119
+ action: params.resetTemplateFormUrl,
120
+ formData: formData
121
+ });
122
+
123
+ document.body.appendChild(form);
124
+ form.submit();
125
+ };
126
+
127
+ let contactCustomData: ContactCustomData = {};
128
+ let nextCouponFromBatch: NextCouponFromBatchType = {
129
+ BatchId: ''
130
+ };
131
+
132
+ const listExpressionDataSourceBffClient = listExpressionDataSourceBffClientFactory(
133
+ _apiMachineFetchFactory({
134
+ baseUrl: params.wysiwygBffProxyBaseUrl
135
+ })
136
+ );
137
+
138
+ const listExpressionDataSourceEvaluator = welcomeSequenceEvaluateListExpressionDataSourceFactory({
139
+ partnerId: params.partnerId,
140
+ listExpressionDataSourceBffClient: listExpressionDataSourceBffClient,
141
+ customerStockId: undefined
142
+ });
143
+
144
+ const listExpressionEvaluator = listExpressionEvaluatorFactory({
145
+ listExpressionDataSourceEvaluator: listExpressionDataSourceEvaluator
146
+ });
147
+
148
+ const numberExpressionDataSourceEvaluator = welcomeSequenceEvaluateNumberExpressionDataSourceFactory();
149
+
150
+ const numberExpressionEvaluator = numberExpressionEvaluatorDelegate({
151
+ listExpressionEvaluator: listExpressionEvaluator,
152
+ numberExpressionDataSourceEvaluator: numberExpressionDataSourceEvaluator
153
+ })
154
+
155
+ const stringExpressionEvaluator: StringExpressionEvaluatorDelegate<
156
+ WelcomeSequenceListExpressionDataSource,
157
+ WelcomeSequenceNumberExpressionDataSource,
158
+ WelcomeSequenceStringExpressionDataSource
159
+ > = stringExpressionEvaluatorFactory({
160
+ listExpressionEvaluator: listExpressionEvaluator,
161
+ numberExpressionEvaluator: numberExpressionEvaluator,
162
+ stringExpressionDataSourceEvaluatorFactory: () => welcomeSequenceStringExpressionDataSourceEvaluatorFactory({
163
+ productImageUrlBuilderExpressionEvaluator: productImageUrlBuilderExpressionEvaluatorFactory({
164
+ partnerId: params.partnerId,
165
+ numberExpressionEvaluator: numberExpressionEvaluator
166
+ }),
167
+ contactCustomData: contactCustomData,
168
+ nextCouponFromBatch: nextCouponFromBatch
169
+ })
170
+ });
171
+
172
+ const expressionEvaluator = expressionEvaluatorFactory({
173
+ listExpressionEvaluator: listExpressionEvaluator,
174
+ numberExpressionEvaluator: numberExpressionEvaluator,
175
+ stringExpressionEvaluator: stringExpressionEvaluator,
176
+ dataStructBuilderExpressionEvaluatorFactory: expressionEvaluator => dataStructBuilderExpressionEvaluatorFactory({
177
+ expressionEvaluator: expressionEvaluator
178
+ })
179
+ });
180
+
181
+ const dataStructExpressionEvaluator = dataStructBuilderExpressionEvaluatorFactory({
182
+ expressionEvaluator: expressionEvaluator
183
+ });
184
+
185
+ const app = createApp(
186
+ EditEmailTemplateApp,
187
+ {
188
+ onTemplateReset: () => {
189
+ //eslint-disable-next-line no-console
190
+ console.log('onTemplateReset');
191
+ resetTemplate();
192
+ },
193
+ deps:
194
+ editEmailTemplateAppDepsFactory<
195
+ WelcomeSequenceListExpressionDataSource,
196
+ WelcomeSequenceNumberExpressionDataSource,
197
+ WelcomeSequenceStringExpressionDataSource
198
+ >({
199
+ partnerId: params.partnerId,
200
+ localeKey: params.localeKey,
201
+ exitLink: params.exitLink,
202
+ dataSourceFieldNameDelegate: ({ dataSource }) => {
203
+ return matcherFactory(dataSource as GeneralStringExpressionDataSource).Match({
204
+ StringFromContactCustomData: (customData) => customData.FieldName,
205
+ StringFromContactCustomDataWithFallback: (customDataWithFallback) => customDataWithFallback.FallbackValue,
206
+ ProductImageUrlBuilderExpression: () => 'ImageResizer',
207
+ NextCouponFromBatch: () => 'Coupon'
208
+ });
209
+ },
210
+ richTextToolbarPlugins: [
211
+ richTextToolbarPluginFactory({
212
+ richTextToolbarPluginComponent: VariableSelector,
213
+ deps: variableSelectorDepsFactory({
214
+ localeKey: params.localeKey,
215
+ stringExpressionBuilderPlugin: stringExpressionBuilderPluginFactory({
216
+ localeKey: params.localeKey
217
+ })
218
+ })
219
+ })
220
+ ],
221
+ defaultThemeLibrary: defaultThemeLibraryFactory({
222
+ localeKey: params.localeKey
223
+ }),
224
+ defaultComponentLibrary: defaultComponentLibraryFactory({
225
+ localeKey: params.localeKey
226
+ }),
227
+ saveEmailTemplate: async arg => {
228
+ const result = await welcomeSequenceMainPageBffClient
229
+ .postSaveTemplate({
230
+ body: {
231
+ partnerId: params.partnerId,
232
+ templateJson: JSON.stringify(arg.emailTemplate)
233
+ }
234
+ })
235
+
236
+ return result.status === 200
237
+ ? 'Success'
238
+ : 'Fail'
239
+ },
240
+ createFavoriteTemplate: async arg => {
241
+ const result = await createFavoriteTemplateBffClient
242
+ .postCreateFavoriteTriggerWelcomeSequenceTemplate({
243
+ body: {
244
+ partnerId: params.partnerId,
245
+ templateJson: JSON.stringify(arg.emailTemplate),
246
+ favoriteTemplateName: 'Favorite template'
247
+ }
248
+ });
249
+
250
+ return result.status === 200
251
+ ? 'Success'
252
+ : 'Fail';
253
+ },
254
+ listExpressionEvaluator: listExpressionEvaluator,
255
+ numberExpressionEvaluator: numberExpressionEvaluator,
256
+ stringExpressionEvaluator: stringExpressionEvaluator,
257
+ dataStructExpressionEvaluator: dataStructExpressionEvaluator,
258
+ expressionEvaluator: expressionEvaluator,
259
+ getComponentLibraryFactory: x => () =>
260
+ x.getComponentLibraryHttpClient(
261
+ {
262
+ body: {
263
+ partnerId: x.partnerId,
264
+ componentTypes: [
265
+ { triggerWelcomeSequence: {} },
266
+ { common: {} }
267
+ ]
268
+ }
269
+ }
270
+ )
271
+ .then(x => welcomeSequenceComponentLibraryFactory(x.body.sections)),
272
+ canProductShelfDataSourceBeConverted: () => false,
273
+ httpClientComponentFactoryDelegate: (emailComponent): Component => {
274
+ return {
275
+ triggerWelcomeSequence: {
276
+ componentJson: JSON.stringify(emailComponent)
277
+ }
278
+ }
279
+ },
280
+ stringExpressionBuilderPlugin: stringExpressionBuilderPluginFactory({
281
+ localeKey: params.localeKey
282
+ }),
283
+ emailComponentSettingsModifierPlugin: productShelfDataSourceExpressionBuilderPluginFactory({
284
+ productShelfDataSourceExpressionBuilderComponent: WelcomeSequenceProductShelfDataSourceExpressionBuilder,
285
+ deps: welcomeSequenceProductShelfDataSourceExpressionBuilderDepsFactory({
286
+ localeKey: params.localeKey,
287
+ partnerId: params.partnerId,
288
+ customerStockId: 'customerStockId',
289
+ productShelfBuilderModalWindowBffClient: createProductShelfBuilderModalWindowBffClient(
290
+ apiMachineFetchFactory({
291
+ baseUrl: params.wysiwygBffProxyBaseUrl,
292
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
293
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
294
+ })
295
+ ),
296
+ productCategoryPickerModalWindowBffClient: createProductCategoryPickerModalWindowBffClient(
297
+ apiMachineFetchFactory({
298
+ baseUrl: params.wysiwygBffProxyBaseUrl,
299
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
300
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
301
+ })
302
+ ),
303
+ productPickerModalWindowBffClient: createProductPickerModalWindowBffClient(
304
+ apiMachineFetchFactory({
305
+ baseUrl: params.wysiwygBffProxyBaseUrl,
306
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
307
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
308
+ })
309
+ )
310
+ })
311
+ }),
312
+ initialEmailTemplate: JSON.parse(params.emailTemplateJson),
313
+ wysiwygTemplateEditorBffClient: wysiwygTemplateEditorBffClientFactory({
314
+ themeLibraryBffClient: createThemeLibraryBffClient(
315
+ apiMachineFetchFactory({
316
+ baseUrl: params.wysiwygBffProxyBaseUrl,
317
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
318
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
319
+ })
320
+ ),
321
+ componentLibraryBffClient: createComponentLibraryBffClient(
322
+ apiMachineFetchFactory({
323
+ baseUrl: params.wysiwygBffProxyBaseUrl,
324
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
325
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
326
+ })
327
+ )
328
+ }),
329
+ addThemeLibrarySectionItemModalWindowBffClient: createAddThemeLibrarySectionItemModalWindowBffClient(
330
+ apiMachineFetchFactory({
331
+ baseUrl: params.wysiwygBffProxyBaseUrl,
332
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
333
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
334
+ })
335
+ ),
336
+ addComponentLibrarySectionItemModalWindowBffClient: createAddComponentLibrarySectionItemModalWindowBffClient(
337
+ apiMachineFetchFactory({
338
+ baseUrl: params.wysiwygBffProxyBaseUrl,
339
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
340
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
341
+ })
342
+ ),
343
+ deleteThemeLibrarySectionItemModalWindowBffClient: createDeleteThemeLibrarySectionItemModalWindowBffClient(
344
+ apiMachineFetchFactory({
345
+ baseUrl: params.wysiwygBffProxyBaseUrl,
346
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
347
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
348
+ })
349
+ ),
350
+ deleteThemeLibrarySectionModalWindowBffClient: createDeleteThemeLibrarySectionModalWindowBffClient(
351
+ apiMachineFetchFactory({
352
+ baseUrl: params.wysiwygBffProxyBaseUrl,
353
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
354
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
355
+ })
356
+ ),
357
+ editThemeLibrarySectionItemModalWindowBffClient: createEditThemeLibrarySectionItemModalWindowBffClient(
358
+ apiMachineFetchFactory({
359
+ baseUrl: params.wysiwygBffProxyBaseUrl,
360
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
361
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
362
+ })
363
+ ),
364
+ createComponentLibrarySectionModalWindowBffClient: createAddComponentLibrarySectionModalWindowBffClient(
365
+ apiMachineFetchFactory({
366
+ baseUrl: params.wysiwygBffProxyBaseUrl,
367
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
368
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
369
+ })
370
+ ),
371
+ editComponentLibrarySectionItemModalWindowBffClient: createEditComponentLibrarySectionItemModalWindowBffClient(
372
+ apiMachineFetchFactory({
373
+ baseUrl: params.wysiwygBffProxyBaseUrl,
374
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
375
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
376
+ })
377
+ ),
378
+ deleteComponentLibrarySectionItemModalWindowBffClient: createDeleteComponentLibrarySectionItemModalWindowBffClient(
379
+ apiMachineFetchFactory({
380
+ baseUrl: params.wysiwygBffProxyBaseUrl,
381
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
382
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
383
+ })
384
+ ),
385
+ createThemeLibrarySectionModalWindowBffClient: createThemeLibrarySectionModalWindowBffClient(
386
+ apiMachineFetchFactory({
387
+ baseUrl: params.wysiwygBffProxyBaseUrl,
388
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
389
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
390
+ })
391
+ ),
392
+ deleteComponentLibrarySectionModalWindowBffClient: createDeleteComponentLibrarySectionModalWindowBffClient(
393
+ apiMachineFetchFactory({
394
+ baseUrl: params.wysiwygBffProxyBaseUrl,
395
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
396
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
397
+ })
398
+ )
399
+ })
400
+ }
401
+ );
402
+
403
+ app.use(createVuetify({
404
+ theme: false,
405
+ directives: {
406
+ ClickOutside
407
+ }
408
+ }));
409
+
410
+ app.mount(appTagId);
@@ -0,0 +1,30 @@
1
+ import type {
2
+ WelcomeSequenceListExpressionDataSource,
3
+ } from '@easy-wizzy/retailrocket-welcome-sequence';
4
+ import type {
5
+ WelcomeSequenceNumberExpressionDataSource,
6
+ } from '@easy-wizzy/retailrocket-welcome-sequence';
7
+ import type {
8
+ WelcomeSequenceStringExpressionDataSource,
9
+ } from '@easy-wizzy/retailrocket-welcome-sequence';
10
+ import {
11
+ welcomeSequenceEmailComponentFactory,
12
+ } from '@/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/welcomeSequenceEmailComponentFactory';
13
+ import type {
14
+ ComponentLibrarySectionItem,
15
+ } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
16
+ import type { CustomComponentSectionItemType } from '@easy-wizzy/core';
17
+
18
+ export const welcomeSequenceComponentSectionItemFactory = (
19
+ componentLibrarySectionItem: ComponentLibrarySectionItem,
20
+ ): CustomComponentSectionItemType<
21
+ WelcomeSequenceListExpressionDataSource,
22
+ WelcomeSequenceNumberExpressionDataSource,
23
+ WelcomeSequenceStringExpressionDataSource
24
+ > => {
25
+ return {
26
+ sectionItemId: componentLibrarySectionItem.sectionItemId,
27
+ sectionItemName: componentLibrarySectionItem.sectionItemName,
28
+ componentTemplate: welcomeSequenceEmailComponentFactory(componentLibrarySectionItem.component),
29
+ };
30
+ };
@@ -0,0 +1,26 @@
1
+ import type { EmailComponentType } from '@easy-wizzy/core';
2
+ import type {
3
+ WelcomeSequenceListExpressionDataSource,
4
+ } from '@easy-wizzy/retailrocket-welcome-sequence';
5
+ import type {
6
+ WelcomeSequenceNumberExpressionDataSource,
7
+ } from '@easy-wizzy/retailrocket-welcome-sequence';
8
+ import type {
9
+ WelcomeSequenceStringExpressionDataSource,
10
+ } from '@easy-wizzy/retailrocket-welcome-sequence';
11
+ import type {
12
+ Component,
13
+ } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.addcomponentlibrarysectionitemmodalwindow/main';
14
+
15
+ export const welcomeSequenceEmailComponentFactory = (
16
+ component: Component
17
+ ): EmailComponentType<
18
+ WelcomeSequenceListExpressionDataSource,
19
+ WelcomeSequenceNumberExpressionDataSource,
20
+ WelcomeSequenceStringExpressionDataSource
21
+ > =>
22
+ {
23
+ return component.triggerWelcomeSequence
24
+ ? JSON.parse(component.triggerWelcomeSequence.componentJson)
25
+ : JSON.parse(component.common!.componentJson)
26
+ }