@retailrocketgroup/retailrocket-create.transactional-vue-email-template-render 6.0.388652 → 6.0.388803

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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@retailrocketgroup/retailrocket-create.transactional-vue-email-template-render",
3
- "version": "6.0.388652",
3
+ "version": "6.0.388803",
4
4
  "private": false
5
5
  }
@@ -22,7 +22,7 @@ import type { EmailTemplateType } from '@easy-wizzy/core';
22
22
  import type { LocaleKey } from '@easy-wizzy/core';
23
23
  import type { StringExpressionEvaluatorDelegate } from '@easy-wizzy/core';
24
24
 
25
- import { templatesGalleryDepsFactory } from '@easy-wizzy/common-app';
25
+ import { defaultTemplateLibraryFactory, templatesGalleryDepsFactory } from '@easy-wizzy/common-app';
26
26
  import { productImageUrlBuilderExpressionEvaluatorFactory } from '@easy-wizzy/common-app';
27
27
  import { apiMachineFetchFactory } from '@easy-wizzy/common-app';
28
28
  import { variableSelectorDepsFactory } from '@easy-wizzy/common-app';
@@ -70,6 +70,7 @@ const params = {
70
70
  antiForgeryFormTokenValue: appTag!.getAttribute('data-anti-forgery-form-token-value')!,
71
71
  createEmailTemplateSubmitUrl: appTag!.getAttribute('data-create-email-template-submit-url')!,
72
72
  initialEmailTemplateJson: appTag!.getAttribute('data-initial-transactional-template')!,
73
+ productImageResizerUrl: appTag!.getAttribute('data-product-image-resizer-url')!,
73
74
  transactionalFavoritesTemplates: JSON
74
75
  .parse(
75
76
  appTag!.getAttribute('data-transactional-favorites-templates')!
@@ -172,7 +173,8 @@ const _templatePreviewCardDepsFactory = (arg: {
172
173
  stringExpressionDataSourceEvaluatorFactory: () => transactionalStringExpressionDataSourceEvaluatorFactory({
173
174
  productImageUrlBuilderExpressionEvaluator: productImageUrlBuilderExpressionEvaluatorFactory({
174
175
  partnerId: params.partnerId,
175
- numberExpressionEvaluator: numberExpressionEvaluator
176
+ numberExpressionEvaluator: numberExpressionEvaluator,
177
+ productImageResizerUrl: params.productImageResizerUrl
176
178
  }),
177
179
  getTransactionalTemplateData: () => arg.templateData,
178
180
  nextCouponFromBatch: arg.nextCouponFromBatch
@@ -244,26 +246,37 @@ const app = createApp(
244
246
  template: template
245
247
  });
246
248
  },
247
- commonFavoriteTemplates: params
248
- .commonFavoritesTemplates
249
- .map(t => ({
250
- template: JSON.parse(t.templateJson) as EmailTemplateType<
249
+ commonFavoriteTemplates: defaultTemplateLibraryFactory(params.localeKey)
250
+ .map(o => ({
251
+ templateName: o.favoriteTemplateName,
252
+ template: o.defaultTemplate as EmailTemplateType<
251
253
  GeneralListExpressionDataSource,
252
254
  GeneralNumberExpressionDataSource,
253
255
  GeneralStringExpressionDataSource
254
- >,
255
- templateName: t.favoriteTemplateName
256
- })),
257
- customFavoriteTemplates: params
258
- .transactionalFavoritesTemplates
259
- .map(t => ({
260
- template: JSON.parse(t.templateJson) as EmailTemplateType<
261
- TransactionalListExpressionDataSource,
262
- TransactionalNumberExpressionDataSource,
263
- TransactionalStringExpressionDataSource
264
- >,
265
- templateName: t.favoriteTemplateName
256
+ >
266
257
  })),
258
+ customFavoriteTemplates: [
259
+ ...params
260
+ .transactionalFavoritesTemplates
261
+ .map(t => ({
262
+ template: JSON.parse(t.templateJson) as EmailTemplateType<
263
+ TransactionalListExpressionDataSource,
264
+ TransactionalNumberExpressionDataSource,
265
+ TransactionalStringExpressionDataSource
266
+ >,
267
+ templateName: t.favoriteTemplateName
268
+ })),
269
+ ...params
270
+ .commonFavoritesTemplates
271
+ .map(t => ({
272
+ template: JSON.parse(t.templateJson) as EmailTemplateType<
273
+ GeneralListExpressionDataSource,
274
+ GeneralNumberExpressionDataSource,
275
+ GeneralStringExpressionDataSource
276
+ >,
277
+ templateName: t.favoriteTemplateName
278
+ })),
279
+ ],
267
280
  deps: templatesGalleryDepsFactory<
268
281
  TransactionalListExpressionDataSource,
269
282
  TransactionalNumberExpressionDataSource,