@retailrocketgroup/retailrocket-edit.abandoned-basket-vue-email-template-render 6.0.388330-dev → 6.0.388648-dev

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-edit.abandoned-basket-vue-email-template-render",
3
- "version": "6.0.388330-dev",
3
+ "version": "6.0.388648-dev",
4
4
  "private": false
5
5
  }
@@ -182,219 +182,220 @@ const dataStructExpressionEvaluator = dataStructBuilderExpressionEvaluatorFactor
182
182
  expressionEvaluator: expressionEvaluator
183
183
  });
184
184
 
185
- const app = createApp(
186
- WysiwygTemplateEditor,
187
- {
188
- onTemplateReset: () => {
189
- resetTemplate();
185
+ const deps = wysiwygTemplateEditorDepsFactory<
186
+ AbandonedBasketListExpressionDataSource,
187
+ AbandonedBasketNumberExpressionDataSource,
188
+ AbandonedBasketStringExpressionDataSource
189
+ >({
190
+ dataSourceFieldNameDelegate: ({ dataSource }) => {
191
+ return matcherFactory(dataSource as GeneralStringExpressionDataSource).Match({
192
+ StringFromContactCustomData: (customData) => customData.FieldName,
193
+ StringFromContactCustomDataWithFallback: (customDataWithFallback) => customDataWithFallback.FallbackValue,
194
+ ProductImageUrlBuilderExpression: () => 'ImageResizer',
195
+ NextCouponFromBatch: () => 'Coupon'
196
+ });
190
197
  },
191
- deps:
192
- wysiwygTemplateEditorDepsFactory<
193
- AbandonedBasketListExpressionDataSource,
194
- AbandonedBasketNumberExpressionDataSource,
195
- AbandonedBasketStringExpressionDataSource
196
- >({
197
- dataSourceFieldNameDelegate: ({ dataSource }) => {
198
- return matcherFactory(dataSource as GeneralStringExpressionDataSource).Match({
199
- StringFromContactCustomData: (customData) => customData.FieldName,
200
- StringFromContactCustomDataWithFallback: (customDataWithFallback) => customDataWithFallback.FallbackValue,
201
- ProductImageUrlBuilderExpression: () => 'ImageResizer',
202
- NextCouponFromBatch: () => 'Coupon'
203
- });
204
- },
205
- richTextToolbarPlugins: [
206
- richTextToolbarPluginFactory({
207
- richTextToolbarPluginComponent: VariableSelector,
208
- deps: variableSelectorDepsFactory({
209
- localeKey: params.localeKey,
210
- stringExpressionBuilderPlugin: stringExpressionBuilderPluginFactory({
211
- localeKey: params.localeKey
212
- })
198
+ richTextToolbarPlugins: [
199
+ richTextToolbarPluginFactory({
200
+ richTextToolbarPluginComponent: VariableSelector,
201
+ deps: variableSelectorDepsFactory({
202
+ localeKey: params.localeKey,
203
+ stringExpressionBuilderPlugin: stringExpressionBuilderPluginFactory({
204
+ localeKey: params.localeKey
213
205
  })
214
206
  })
215
- ],
216
- partnerId: params.partnerId,
217
- exitLink: params.exitLink,
218
- localeKey: params.localeKey,
219
- defaultThemeLibrary: defaultThemeLibraryFactory({
220
- localeKey: params.localeKey
221
- }),
222
- defaultComponentLibrary: defaultComponentLibraryFactory({
223
- localeKey: params.localeKey
224
- }),
225
- saveEmailTemplate: async arg => {
226
- const result = await abandonedBasketMainPageBffClient
227
- .postSaveTemplate({
228
- body: {
229
- partnerId: params.partnerId,
230
- templateJson: JSON.stringify(arg.emailTemplate)
231
- }
232
- })
207
+ })
208
+ ],
209
+ partnerId: params.partnerId,
210
+ exitLink: params.exitLink,
211
+ localeKey: params.localeKey,
212
+ defaultThemeLibrary: defaultThemeLibraryFactory({
213
+ localeKey: params.localeKey
214
+ }),
215
+ defaultComponentLibrary: defaultComponentLibraryFactory({
216
+ localeKey: params.localeKey
217
+ }),
218
+ saveEmailTemplate: async arg => {
219
+ const result = await abandonedBasketMainPageBffClient
220
+ .postSaveTemplate({
221
+ body: {
222
+ partnerId: params.partnerId,
223
+ templateJson: JSON.stringify(arg.emailTemplate)
224
+ }
225
+ })
233
226
 
234
- return result.status === 200
235
- ? 'Success'
236
- : 'Fail'
237
- },
238
- createFavoriteTemplate: async arg => {
239
- const result = await createFavoriteTemplateBffClient
240
- .postCreateFavoriteTriggerAbandonedBasketTemplate({
241
- body: {
242
- partnerId: params.partnerId,
243
- templateJson: JSON.stringify(arg.emailTemplate),
244
- favoriteTemplateName: 'Favorite template'
245
- }
246
- });
247
-
248
- return result.status === 200
249
- ? 'Success'
250
- : 'Fail';
251
- },
252
- listExpressionEvaluator: listExpressionEvaluator,
253
- numberExpressionEvaluator: numberExpressionEvaluator,
254
- stringExpressionEvaluator: stringExpressionEvaluator,
255
- dataStructExpressionEvaluator: dataStructExpressionEvaluator,
256
- expressionEvaluator: expressionEvaluator,
257
- getComponentLibraryFactory: x => () =>
258
- x.getComponentLibraryHttpClient(
259
- {
260
- body: {
261
- partnerId: x.partnerId,
262
- componentTypes: [
263
- { triggerAbandonedBasket: {} },
264
- { common: {} }
265
- ]
266
- }
227
+ return result.status === 200
228
+ ? 'Success'
229
+ : 'Fail'
230
+ },
231
+ createFavoriteTemplate: async arg => {
232
+ const result = await createFavoriteTemplateBffClient
233
+ .postCreateFavoriteTriggerAbandonedBasketTemplate({
234
+ body: {
235
+ partnerId: params.partnerId,
236
+ templateJson: JSON.stringify(arg.emailTemplate),
237
+ favoriteTemplateName: 'Favorite template'
267
238
  }
268
- )
269
- .then(x => abandonedBasketComponentLibraryFactory(x.body.sections)),
270
- canProductShelfDataSourceBeConverted: () => false,
271
- httpClientComponentFactoryDelegate: (emailComponent): Component => {
272
- return {
273
- triggerAbandonedBasket: {
274
- componentJson: JSON.stringify(emailComponent)
239
+ });
240
+
241
+ return result.status === 200
242
+ ? 'Success'
243
+ : 'Fail';
244
+ },
245
+ listExpressionEvaluator: listExpressionEvaluator,
246
+ numberExpressionEvaluator: numberExpressionEvaluator,
247
+ stringExpressionEvaluator: stringExpressionEvaluator,
248
+ dataStructExpressionEvaluator: dataStructExpressionEvaluator,
249
+ expressionEvaluator: expressionEvaluator,
250
+ getComponentLibraryFactory: x => () =>
251
+ x.getComponentLibraryHttpClient(
252
+ {
253
+ body: {
254
+ partnerId: x.partnerId,
255
+ componentTypes: [
256
+ { triggerAbandonedBasket: {} },
257
+ { common: {} }
258
+ ]
275
259
  }
276
260
  }
277
- },
278
- stringExpressionBuilderPlugin: stringExpressionBuilderPluginFactory({
279
- localeKey: params.localeKey
280
- }),
281
- emailComponentSettingsModifierPlugin: productShelfDataSourceExpressionBuilderPluginFactory({
282
- productShelfDataSourceExpressionBuilderComponent: AbandonedBasketProductShelfDataSourceExpressionBuilder,
283
- deps: abandonedBasketProductShelfDataSourceExpressionBuilderDepsFactory({
284
- localeKey: params.localeKey,
285
- partnerId: params.partnerId,
286
- customerStockId: 'customerStockId',
287
- productShelfBuilderModalWindowBffClient: createProductShelfBuilderModalWindowBffClient(
288
- apiMachineFetchFactory({
289
- baseUrl: params.wysiwygBffProxyBaseUrl,
290
- antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
291
- antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
292
- })
293
- ),
294
- productCategoryPickerModalWindowBffClient: createProductCategoryPickerModalWindowBffClient(
295
- apiMachineFetchFactory({
296
- baseUrl: params.wysiwygBffProxyBaseUrl,
297
- antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
298
- antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
299
- })
300
- ),
301
- productPickerModalWindowBffClient: createProductPickerModalWindowBffClient(
302
- apiMachineFetchFactory({
303
- baseUrl: params.wysiwygBffProxyBaseUrl,
304
- antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
305
- antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
306
- })
307
- )
308
- })
309
- }),
310
- initialEmailTemplate: JSON.parse(params.emailTemplateJson),
311
- wysiwygTemplateEditorBffClient: wysiwygTemplateEditorBffClientFactory({
312
- themeLibraryBffClient: createThemeLibraryBffClient(
261
+ )
262
+ .then(x => abandonedBasketComponentLibraryFactory(x.body.sections)),
263
+ canProductShelfDataSourceBeConverted: () => false,
264
+ httpClientComponentFactoryDelegate: (emailComponent): Component => {
265
+ return {
266
+ triggerAbandonedBasket: {
267
+ componentJson: JSON.stringify(emailComponent)
268
+ }
269
+ }
270
+ },
271
+ stringExpressionBuilderPlugin: stringExpressionBuilderPluginFactory({
272
+ localeKey: params.localeKey
273
+ }),
274
+ emailComponentSettingsModifierPlugin: productShelfDataSourceExpressionBuilderPluginFactory({
275
+ productShelfDataSourceExpressionBuilderComponent: AbandonedBasketProductShelfDataSourceExpressionBuilder,
276
+ deps: abandonedBasketProductShelfDataSourceExpressionBuilderDepsFactory({
277
+ localeKey: params.localeKey,
278
+ partnerId: params.partnerId,
279
+ customerStockId: 'customerStockId',
280
+ productShelfBuilderModalWindowBffClient: createProductShelfBuilderModalWindowBffClient(
313
281
  apiMachineFetchFactory({
314
282
  baseUrl: params.wysiwygBffProxyBaseUrl,
315
283
  antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
316
284
  antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
317
285
  })
318
286
  ),
319
- componentLibraryBffClient: createComponentLibraryBffClient(
287
+ productCategoryPickerModalWindowBffClient: createProductCategoryPickerModalWindowBffClient(
288
+ apiMachineFetchFactory({
289
+ baseUrl: params.wysiwygBffProxyBaseUrl,
290
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
291
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
292
+ })
293
+ ),
294
+ productPickerModalWindowBffClient: createProductPickerModalWindowBffClient(
320
295
  apiMachineFetchFactory({
321
296
  baseUrl: params.wysiwygBffProxyBaseUrl,
322
297
  antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
323
298
  antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
324
299
  })
325
300
  )
326
- }),
327
- addThemeLibrarySectionItemModalWindowBffClient: createAddThemeLibrarySectionItemModalWindowBffClient(
328
- apiMachineFetchFactory({
329
- baseUrl: params.wysiwygBffProxyBaseUrl,
330
- antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
331
- antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
332
- })
333
- ),
334
- addComponentLibrarySectionItemModalWindowBffClient: createAddComponentLibrarySectionItemModalWindowBffClient(
335
- apiMachineFetchFactory({
336
- baseUrl: params.wysiwygBffProxyBaseUrl,
337
- antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
338
- antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
339
- })
340
- ),
341
- deleteThemeLibrarySectionItemModalWindowBffClient: createDeleteThemeLibrarySectionItemModalWindowBffClient(
342
- apiMachineFetchFactory({
343
- baseUrl: params.wysiwygBffProxyBaseUrl,
344
- antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
345
- antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
346
- })
347
- ),
348
- deleteThemeLibrarySectionModalWindowBffClient: createDeleteThemeLibrarySectionModalWindowBffClient(
349
- apiMachineFetchFactory({
350
- baseUrl: params.wysiwygBffProxyBaseUrl,
351
- antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
352
- antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
353
- })
354
- ),
355
- editThemeLibrarySectionItemModalWindowBffClient: createEditThemeLibrarySectionItemModalWindowBffClient(
356
- apiMachineFetchFactory({
357
- baseUrl: params.wysiwygBffProxyBaseUrl,
358
- antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
359
- antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
360
- })
361
- ),
362
- createComponentLibrarySectionModalWindowBffClient: createAddComponentLibrarySectionModalWindowBffClient(
363
- apiMachineFetchFactory({
364
- baseUrl: params.wysiwygBffProxyBaseUrl,
365
- antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
366
- antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
367
- })
368
- ),
369
- editComponentLibrarySectionItemModalWindowBffClient: createEditComponentLibrarySectionItemModalWindowBffClient(
370
- apiMachineFetchFactory({
371
- baseUrl: params.wysiwygBffProxyBaseUrl,
372
- antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
373
- antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
374
- })
375
- ),
376
- deleteComponentLibrarySectionItemModalWindowBffClient: createDeleteComponentLibrarySectionItemModalWindowBffClient(
377
- apiMachineFetchFactory({
378
- baseUrl: params.wysiwygBffProxyBaseUrl,
379
- antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
380
- antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
381
- })
382
- ),
383
- createThemeLibrarySectionModalWindowBffClient: createThemeLibrarySectionModalWindowBffClient(
301
+ })
302
+ }),
303
+ template: JSON.parse(params.emailTemplateJson),
304
+ wysiwygTemplateEditorBffClient: wysiwygTemplateEditorBffClientFactory({
305
+ themeLibraryBffClient: createThemeLibraryBffClient(
384
306
  apiMachineFetchFactory({
385
307
  baseUrl: params.wysiwygBffProxyBaseUrl,
386
308
  antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
387
309
  antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
388
310
  })
389
311
  ),
390
- deleteComponentLibrarySectionModalWindowBffClient: createDeleteComponentLibrarySectionModalWindowBffClient(
312
+ componentLibraryBffClient: createComponentLibraryBffClient(
391
313
  apiMachineFetchFactory({
392
314
  baseUrl: params.wysiwygBffProxyBaseUrl,
393
315
  antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
394
316
  antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
395
317
  })
396
318
  )
397
- })
319
+ }),
320
+ addThemeLibrarySectionItemModalWindowBffClient: createAddThemeLibrarySectionItemModalWindowBffClient(
321
+ apiMachineFetchFactory({
322
+ baseUrl: params.wysiwygBffProxyBaseUrl,
323
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
324
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
325
+ })
326
+ ),
327
+ addComponentLibrarySectionItemModalWindowBffClient: createAddComponentLibrarySectionItemModalWindowBffClient(
328
+ apiMachineFetchFactory({
329
+ baseUrl: params.wysiwygBffProxyBaseUrl,
330
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
331
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
332
+ })
333
+ ),
334
+ deleteThemeLibrarySectionItemModalWindowBffClient: createDeleteThemeLibrarySectionItemModalWindowBffClient(
335
+ apiMachineFetchFactory({
336
+ baseUrl: params.wysiwygBffProxyBaseUrl,
337
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
338
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
339
+ })
340
+ ),
341
+ deleteThemeLibrarySectionModalWindowBffClient: createDeleteThemeLibrarySectionModalWindowBffClient(
342
+ apiMachineFetchFactory({
343
+ baseUrl: params.wysiwygBffProxyBaseUrl,
344
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
345
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
346
+ })
347
+ ),
348
+ editThemeLibrarySectionItemModalWindowBffClient: createEditThemeLibrarySectionItemModalWindowBffClient(
349
+ apiMachineFetchFactory({
350
+ baseUrl: params.wysiwygBffProxyBaseUrl,
351
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
352
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
353
+ })
354
+ ),
355
+ createComponentLibrarySectionModalWindowBffClient: createAddComponentLibrarySectionModalWindowBffClient(
356
+ apiMachineFetchFactory({
357
+ baseUrl: params.wysiwygBffProxyBaseUrl,
358
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
359
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
360
+ })
361
+ ),
362
+ editComponentLibrarySectionItemModalWindowBffClient: createEditComponentLibrarySectionItemModalWindowBffClient(
363
+ apiMachineFetchFactory({
364
+ baseUrl: params.wysiwygBffProxyBaseUrl,
365
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
366
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
367
+ })
368
+ ),
369
+ deleteComponentLibrarySectionItemModalWindowBffClient: createDeleteComponentLibrarySectionItemModalWindowBffClient(
370
+ apiMachineFetchFactory({
371
+ baseUrl: params.wysiwygBffProxyBaseUrl,
372
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
373
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
374
+ })
375
+ ),
376
+ createThemeLibrarySectionModalWindowBffClient: createThemeLibrarySectionModalWindowBffClient(
377
+ apiMachineFetchFactory({
378
+ baseUrl: params.wysiwygBffProxyBaseUrl,
379
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
380
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
381
+ })
382
+ ),
383
+ deleteComponentLibrarySectionModalWindowBffClient: createDeleteComponentLibrarySectionModalWindowBffClient(
384
+ apiMachineFetchFactory({
385
+ baseUrl: params.wysiwygBffProxyBaseUrl,
386
+ antiForgeryTokenHeaderName: params.antiForgeryHeaderTokenName,
387
+ antiForgeryTokenValue: params.antiForgeryHeaderTokenValue
388
+ })
389
+ )
390
+ });
391
+
392
+ const app = createApp(
393
+ WysiwygTemplateEditor,
394
+ {
395
+ deps: deps,
396
+ onOnTemplateReset: () => {
397
+ resetTemplate();
398
+ }
398
399
  }
399
400
  );
400
401