@retailrocketgroup/retailrocket-edit.transactional-vue-email-template-render 6.0.388429-dev → 6.0.388652

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