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