@capillarytech/creatives-library 7.17.98 → 7.17.100

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.17.98",
4
+ "version": "7.17.100",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -297,6 +297,7 @@ const CapDeviceContent = (props) => {
297
297
  options={BUTTON_RADIO_OPTIONS}
298
298
  value={buttonType}
299
299
  onChange={onChangeButtonType}
300
+ disabled={!isAndroid}
300
301
  className="inapp-btn-radio-group"
301
302
  />
302
303
  {isBtnTypeCta && (
@@ -50,7 +50,7 @@
50
50
  .dragger-button.re-upload {
51
51
  top: 13rem;
52
52
  position: absolute;
53
- right: $CAP_SPACE_20;
53
+ right: -1rem;
54
54
  color: $FONT_COLOR_05;
55
55
  }
56
56
  }
@@ -73,7 +73,7 @@ export default defineMessages({
73
73
  },
74
74
  btnDesc: {
75
75
  id: `${prefix}.btnDesc`,
76
- defaultMessage: 'These will be show clickable buttons below your message.',
76
+ defaultMessage: 'These will be shown as clickable buttons below your message.',
77
77
  },
78
78
  optional: {
79
79
  id: `${prefix}.optional`,
@@ -131,9 +131,9 @@ export const CapInAppCTA = (props) => {
131
131
  >
132
132
  <CapRow className="inapp-cta-row">
133
133
  <CapColumn>
134
- <CapIcon size="s" type={'launch'} />
134
+ <CapIcon size="s" type={'launch'} className="btn-icon" />
135
135
  </CapColumn>
136
- <CapColumn>
136
+ <CapColumn className="btn-text">
137
137
  <CapLabel type="label2" className="inapp-saved-cta-button-text">
138
138
  {text}
139
139
  </CapLabel>
@@ -90,4 +90,10 @@
90
90
  }
91
91
  .cta-del-icon {
92
92
  padding-left: 1rem;
93
+ }
94
+ .btn-text {
95
+ margin-left: $CAP_SPACE_08;
96
+ }
97
+ .btn-icon {
98
+ color: $CAP_G06;
93
99
  }
@@ -929,7 +929,8 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
929
929
  }
930
930
  // Check if template subject present in form data from Loyalty, DVS, Timeline
931
931
  if (index === 'template-subject' && type.toLowerCase() === 'embedded' && (currentModule.toLowerCase() === 'loyalty' || currentModule.toLowerCase() === 'dvs' || currentModule.toLowerCase() === 'timeline' || currentModule.toLowerCase() === 'library')) {
932
- if (data && data.trim() === '') {
932
+ //checking email subject name validation
933
+ if (!data?.trim()) {
933
934
  errorData[index] = true;
934
935
  isValid = false;
935
936
  } else {
@@ -2069,7 +2069,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2069
2069
  formData[0].selectedLanguages = [];
2070
2070
  let tabKey;
2071
2071
  if ((this.props.location.query.isLanguageSupport === undefined || this.props.location.query.isLanguageSupport === 'false')) {
2072
- formData['template-subject'] = data.base.subject ? data.base.subject : '';
2072
+ // If formData['template-subject'] is empty, assign an empty string; otherwise, retain its current value or use data.base.subject.
2073
+ formData['template-subject'] = formData?.['template-subject'] === '' ? '' : (data?.base?.subject || '');
2073
2074
  const baseLanguage = this.props.currentOrgDetails.basic_details.base_language;
2074
2075
  let languageIndex = _.findIndex(this.supportedLanguages, {iso_code: baseLanguage});
2075
2076
 
@@ -2134,16 +2135,17 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2134
2135
  this.addLanguage(false, formData, false, additionalLanguages);
2135
2136
  }
2136
2137
  formData.base = _.cloneDeep(formData[0]);
2137
-
2138
- this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
2139
- // this.setState({tabKey: ''});
2140
- const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
2141
- _.forEach(formData[0].selectedLanguages, (language) => {
2142
- if (formData[0][language].is_drag_drop && isBEEEnable) {
2143
- this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport, isBEEEnable);
2144
- }
2138
+ if (formData?.['template-subject'] !== '') {
2139
+ this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
2140
+ // this.setState({tabKey: ''});
2141
+ const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
2142
+ _.forEach(formData[0].selectedLanguages, (language) => {
2143
+ if (formData[0][language].is_drag_drop && isBEEEnable) {
2144
+ this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport, isBEEEnable);
2145
+ }
2146
+ });
2145
2147
  });
2146
- });
2148
+ }
2147
2149
  } else {
2148
2150
  this.setState({injectedTags: data.tags});
2149
2151
  }
@@ -428,35 +428,17 @@ export const InApp = (props) => {
428
428
  const createModeContent = (
429
429
  <CapRow>
430
430
  {/* template name */}
431
- <CapRow>
432
- <CapHeading type="h4">
433
- <FormattedMessage {...messages.creativeName} />
434
- </CapHeading>
435
- <CapInput
436
- id="inapp-template-name-input"
437
- className="inapp-template-name-input"
438
- onChange={onTemplateNameChange}
439
- placeholder={formatMessage(globalMessages.templateNamePlaceholder)}
440
- value={templateName}
441
- size="default"
431
+ <CapHeading type="h4">
432
+ <FormattedMessage {...messages.creativeName} />
433
+ </CapHeading>
434
+ <CapInput
435
+ id="inapp-template-name-input"
436
+ className="inapp-template-name-input"
437
+ onChange={onTemplateNameChange}
438
+ placeholder={formatMessage(globalMessages.templateNamePlaceholder)}
439
+ value={templateName}
440
+ size="default"
442
441
  />
443
- </CapRow>
444
- {/* Creative layout type*/}
445
- <CapRow className="inapp-creative-layout">
446
- <CapHeading type="h4">
447
- <FormattedMessage {...messages.creativeLayout} />
448
- </CapHeading>
449
- <CapHeading type="h6" className="inapp-creative-layout-desc">
450
- <FormattedMessage {...messages.creativeLayoutDesc} />
451
- </CapHeading>
452
- </CapRow>
453
- <CapRadioGroup
454
- id="inapp-layout-radio"
455
- options={LAYOUT_RADIO_OPTIONS}
456
- value={templateLayoutType}
457
- onChange={onTemplateLayoutTypeChange}
458
- className="inapp-layout-radio"
459
- />
460
442
  </CapRow>
461
443
  );
462
444
  //create methods end
@@ -716,9 +698,29 @@ export const InApp = (props) => {
716
698
  <CapRow className="cap-inapp-creatives">
717
699
  <CapColumn span={14}>
718
700
  {isFullMode && createModeContent}
701
+ {/* Creative layout type*/}
702
+ {(isFullMode || !isEditFlow) && (
703
+ <>
704
+ <CapRow className="inapp-creative-layout">
705
+ <CapHeading type="h4">
706
+ <FormattedMessage {...messages.creativeLayout} />
707
+ </CapHeading>
708
+ <CapHeading type="h6" className="inapp-creative-layout-desc">
709
+ <FormattedMessage {...messages.creativeLayoutDesc} />
710
+ </CapHeading>
711
+ </CapRow><CapRadioGroup
712
+ id="inapp-layout-radio"
713
+ options={LAYOUT_RADIO_OPTIONS}
714
+ value={templateLayoutType}
715
+ onChange={onTemplateLayoutTypeChange}
716
+ className="inapp-layout-radio" />
717
+ </>)
718
+ }
719
719
  {/* device tab */}
720
720
  <CapTab
721
- panes={PANES.filter((devicePane) => devicePane?.isSupported === true)}
721
+ panes={PANES.filter(
722
+ (devicePane) => devicePane?.isSupported === true
723
+ )}
722
724
  onChange={(value) => {
723
725
  setPanes(value);
724
726
  }}
@@ -746,12 +748,10 @@ export const InApp = (props) => {
746
748
  ) : (
747
749
  <FormattedMessage {...globalMessages.done} />
748
750
  )
751
+ ) : isFullMode ? (
752
+ <FormattedMessage {...messages.create} />
749
753
  ) : (
750
- isFullMode ? (
751
- <FormattedMessage {...messages.create} />
752
- ) : (
753
- <FormattedMessage {...globalMessages.done} />
754
- )
754
+ <FormattedMessage {...globalMessages.done} />
755
755
  )}
756
756
  </CapButton>
757
757
  </>