@capillarytech/creatives-library 8.0.345-alpha.1 → 8.0.345-alpha.10

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/.npmrx ADDED
@@ -0,0 +1,2 @@
1
+ npm config set scope capillarytech
2
+ //registry.npmjs.org/:_authToken=${NPM_TOKEN}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "8.0.345-alpha.1",
4
+ "version": "8.0.345-alpha.10",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -705,8 +705,27 @@ export function SlideBoxContent(props) {
705
705
  // and getDetails?type=BEE_PLUGIN would never fire. Routing BEE
706
706
  // templates through the direct <Email> path — which is already
707
707
  // battle-tested for the CKEditor flow — sidesteps that entirely.
708
+ const vBase = templateData?.versions?.base;
709
+ const vBaseActiveTab = vBase?.activeTab || vBase?.selectedLanguages?.[0] || 'en';
708
710
  const isBEETemplate = templateData?.base?.is_drag_drop === true
709
- || templateData?.base?.is_drag_drop === 1;
711
+ || templateData?.base?.is_drag_drop === 1
712
+ || vBase?.[vBaseActiveTab]?.is_drag_drop === true
713
+ || vBase?.[vBaseActiveTab]?.is_drag_drop === 1;
714
+ console.log('[SlideBoxContent] BEE routing debug', {
715
+ supportCKEditor,
716
+ 'templateData._id': templateData?._id,
717
+ 'templateData.type': templateData?.type,
718
+ 'templateData.base': templateData?.base,
719
+ 'templateData.base.is_drag_drop': templateData?.base?.is_drag_drop,
720
+ 'templateData.base.drag_drop_id': templateData?.base?.drag_drop_id,
721
+ vBase,
722
+ vBaseActiveTab,
723
+ 'vBase[vBaseActiveTab]': vBase?.[vBaseActiveTab],
724
+ 'vBase[vBaseActiveTab].is_drag_drop': vBase?.[vBaseActiveTab]?.is_drag_drop,
725
+ 'vBase[vBaseActiveTab].drag_drop_id': vBase?.[vBaseActiveTab]?.drag_drop_id,
726
+ isBEETemplate,
727
+ routingTo: (supportCKEditor || isBEETemplate) ? 'Email (direct)' : 'EmailWrapper',
728
+ });
710
729
  if (supportCKEditor || isBEETemplate) {
711
730
  return (
712
731
  <Email
@@ -966,10 +966,13 @@ export class Creatives extends React.Component {
966
966
  case constants.EMAIL:
967
967
  if (template?.value?.base) {
968
968
  let emailBase = template.value.base;
969
- const { html_content } = emailBase || {};
969
+ const { html_content, drag_drop_id: formDragDropId } = emailBase || {};
970
970
  if (!html_content) {
971
971
  emailBase = templateRecords.base;
972
972
  }
973
+ if (!emailBase.drag_drop_id && formDragDropId) {
974
+ emailBase = { ...emailBase, drag_drop_id: formDragDropId };
975
+ }
973
976
  const newHtmlContent = await updateImagesInHtml(html_content);
974
977
  templateData = {
975
978
  ...templateData, ...emailBase, emailBody: newHtmlContent, emailSubject: (emailBase && emailBase.subject) ? emailBase.subject : '',
@@ -224,6 +224,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
224
224
  || _.get(this.props.Templates.BEETemplate, 'versions.base.drag_drop_id')
225
225
  || _.get(this.props.Templates.BEETemplate, 'versions.base.id')
226
226
  || this.props.Templates.BEETemplate?._id;
227
+ console.log('[Rafeeq manzoor] comes here 1');
227
228
  this.props.actions.getCmsSetting(BEE_PLUGIN, dragDropId, 'open', undefined, isBEESupport, isBEEAppEnable);
228
229
  } else if (this.props.location.query.module !== "library" || (this.props.location.query.module === "library" && !this.props.templateData)) {
229
230
  // Extract drag_drop_id - check multiple possible paths
@@ -234,6 +235,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
234
235
  || _.get(this.props.Templates.BEETemplate, 'versions.base.drag_drop_id')
235
236
  || _.get(this.props.Templates.BEETemplate, 'versions.base.id')
236
237
  || this.props.Templates.BEETemplate?._id;
238
+ console.log('[Rafeeq manzoor] comes here 2');
237
239
  this.props.actions.getCmsSetting(BEE_PLUGIN, dragDropId, 'create', undefined, isBEESupport, isBEEAppEnable);
238
240
  }
239
241
  }
@@ -286,8 +288,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
286
288
 
287
289
  if (this.props.params.id) {
288
290
  const activeTabForLang = beeTemplate.versions?.base?.activeTab || 'en';
291
+ console.log('[Rafeeq manzoor] comes here 3');
289
292
  this.props.actions.getCmsSetting(BEE_PLUGIN, dragDropId, 'open', activeTabForLang, isBEESupport, isBEEAppEnable);
290
293
  } else {
294
+ console.log('[Rafeeq manzoor] comes here 4');
291
295
  this.props.actions.getCmsSetting(BEE_PLUGIN, dragDropId, 'create', undefined, isBEESupport, isBEEAppEnable);
292
296
  }
293
297
  }
@@ -331,6 +335,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
331
335
  this.getFormData();
332
336
  }
333
337
  }
338
+ console.log('[Rafeeq manzoor] nextProps', nextProps, _.isEmpty(this.state.formData));
334
339
  if (this.state.languageDataSet && nextProps.Templates.selectedEmailLayout && nextProps.Templates.selectedEmailLayout !== '' && !_.isEqual(this.props.Templates.selectedEmailLayout, nextProps.Templates.selectedEmailLayout )) {
335
340
  this.setNewLanguageContent(nextProps.Templates.selectedEmailLayout);
336
341
  }
@@ -359,6 +364,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
359
364
  }, 0);
360
365
  }
361
366
  if (nextProps.currentOrgDetails && nextProps.currentOrgDetails.basic_details && !_.isEmpty(nextProps.currentOrgDetails.basic_details) && _.isEmpty(this.state.formData)) {
367
+ console.log('[Rafeeq manzoor] if condition');
362
368
  const formData = this.initFormData(nextProps);
363
369
  formData['template-version-options'] = [
364
370
  {
@@ -452,8 +458,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
452
458
  // Extract langId from active tab
453
459
  const activeTabForLang = beeTemplate.versions?.base?.activeTab || 'en';
454
460
  if (hasParamsId) {
461
+ console.log('[Rafeeq manzoor] comes here 5');
455
462
  this.props.actions.getCmsSetting(BEE_PLUGIN, dragDropId, 'open', activeTabForLang, isBEESupport, isBEEAppEnable);
456
463
  } else if (nextProps.location.query.module !== "library" || (nextProps.location.query.module === "library" && !nextProps.templateData)) {
464
+ console.log('[Rafeeq manzoor] comes here 6');
457
465
  this.props.actions.getCmsSetting(BEE_PLUGIN, dragDropId, 'create', undefined, isBEESupport, isBEEAppEnable);
458
466
  }
459
467
  }
@@ -470,6 +478,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
470
478
  }
471
479
  });
472
480
  }
481
+ console.log('[Rafeeq manzoor] here we have data 1', this.state.isEdit, nextProps.location.query.module);
482
+ console.log('[Rafeeq manzoor] here we have data 2', nextProps.templateData, !_.isEmpty(nextProps.templateData), this.props.params.id, nextProps.isGetFormData);
483
+ console.log('[Rafeeq manzoor] here we have data 3', _.isEmpty(_.get(this, `state.formData['template-subject']`)));
484
+
473
485
  if (this.state.isEdit && nextProps.location.query.module === "library" && !_.isEmpty(nextProps.templateData) && !this.props.params.id && !nextProps.isGetFormData && _.isEmpty(_.get(this, `state.formData['template-subject']`))) {
474
486
  this.startTemplateCreation(nextProps.templateData);
475
487
  }
@@ -1238,6 +1250,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1238
1250
  // formData.base.activeTab = language;
1239
1251
  // }
1240
1252
  if (language && editData.versions.base[language].is_drag_drop && isBEEAppEnable) {
1253
+ console.log('[Rafeeq manzoor] comes here 7');
1241
1254
  this.props.actions.getCmsSetting(BEE_PLUGIN, editData._id, 'open', language, isBEESupport, isBEEAppEnable);
1242
1255
  }
1243
1256
  });
@@ -1461,6 +1474,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1461
1474
  const currentTab = this.state.currentTab - 1;
1462
1475
  const baseLanguage = this.props.currentOrgDetails.basic_details.base_language ? this.props.currentOrgDetails.basic_details.base_language : 'en';
1463
1476
  if (formData[currentTab][baseLanguage].is_drag_drop && isBEEAppEnable) {
1477
+ console.log('[Rafeeq manzoor] comes here 8');
1464
1478
  this.props.actions.getCmsSetting(BEE_PLUGIN, formData[currentTab][baseLanguage].drag_drop_id, 'duplicate', baseLanguage, isEdmSupport, isBEEAppEnable);
1465
1479
  }
1466
1480
  });
@@ -1639,6 +1653,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1639
1653
  if (content.id) {
1640
1654
  tmpData.id = content.id;
1641
1655
  }
1656
+ if (content.drag_drop_id) {
1657
+ tmpData.drag_drop_id = content.drag_drop_id;
1658
+ }
1642
1659
  }
1643
1660
  newFormData.base = _.cloneDeep(tmpData);
1644
1661
  newFormData.secondary_templates.push({template_data: tmpData});
@@ -2515,6 +2532,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2515
2532
  const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
2516
2533
  if (templates.drag_drop_id && isBEEAppEnable) {
2517
2534
  tempData.drag_drop_id = templates.drag_drop_id;
2535
+ console.log('[Rafeeq manzoor] comes here 9');
2518
2536
  this.props.actions.getCmsSetting(BEE_PLUGIN, tempData._id, 'open', tempData.iso_code, isEdmSupport, isBEEAppEnable);
2519
2537
  }
2520
2538
  // formData.usingTabContainer = true;
@@ -2535,13 +2553,17 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2535
2553
  });
2536
2554
  this.addLanguage(false, formData, false, additionalLanguages);
2537
2555
  }
2556
+ console.log("[Rafeeq manzoor] comes here lib 1", formData[0])
2538
2557
  formData.base = _.cloneDeep(formData[0]);
2539
2558
  if (formData?.['template-subject'] !== '') {
2559
+ console.log("[Rafeeq manzoor] comes here lib 1 if", formData)
2540
2560
  this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
2541
2561
  // this.setState({tabKey: ''});
2542
2562
  const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
2563
+ console.log("[Rafeeq manzoor] comes here lib 1 isBEEEnable", isBEEEnable)
2543
2564
  _.forEach(formData[0].selectedLanguages, (language) => {
2544
2565
  if (formData[0][language].is_drag_drop && isBEEEnable) {
2566
+ console.log('[Rafeeq manzoor] comes here 10');
2545
2567
  this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport, isBEEEnable);
2546
2568
  }
2547
2569
  });
@@ -2884,6 +2906,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2884
2906
  // let getQuery = '';
2885
2907
  const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
2886
2908
  const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
2909
+ console.log('[Rafeeq manzoor] comes here 11');
2887
2910
  this.props.actions.getCmsSetting(BEE_PLUGIN, data._id, 'create', this.state.formData[this.state.currentTab - 1].activeTab, isEdmSupport, isBEEAppEnable);
2888
2911
  // this.props.templatesActions.setEdmTemplate(data);
2889
2912
  this.toggleEdmEmailTemplateSelection();
@@ -727,7 +727,6 @@ const useEmailWrapper = ({
727
727
  route: { name: 'email' },
728
728
  params: emailParams,
729
729
  isGetFormData,
730
- ...(!isFullMode && { templateData }),
731
730
  getFormdata,
732
731
  getFormSubscriptionData: getFormdata,
733
732
  getDefaultTags: type,