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