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