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