@capillarytech/creatives-library 7.9.11 → 7.9.13

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.9.11",
4
+ "version": "7.9.13",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -205,7 +205,27 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
205
205
  //this.editorInstance.name = this.id;
206
206
 
207
207
  //Register listener for custom events if any
208
- this.editorInstance.on('change', this.handleContentChange);
208
+ // this.editorInstance.on('change', this.handleContentChange);
209
+
210
+ // mode event is fired whenever mode is toggled from normal to source mode or vice versa
211
+ // change event works only in wysiwyg(non-source) mode, key event works in both source & wysiwyg(non-source) mode but,
212
+ // key event doesn't get fired up while setting text to bold,italic etc..
213
+ this.editorInstance.on('mode',()=>{
214
+ if(this.editorInstance.mode==="source"){
215
+ this.editorInstance.on('key',this.handleContentChange)
216
+ }
217
+ else{
218
+ if(this.editorInstance.hasListeners("key")){
219
+ /*Removing the 'key' listener is necessary. If not removed and the mode is switched in the following manner :
220
+ source mode -> Non-source mode -> source mode,
221
+ then under this scenario both 'key' and 'change' listener will get fired on entering text. Except that 'key' listener will not get fired when setting text to 'bold', 'italic' etc.
222
+ */
223
+ this.editorInstance.removeListener("key",this.handleContentChange)
224
+ }
225
+ this.editorInstance.on('change',this.handleContentChange)
226
+ }
227
+ })
228
+
209
229
  _.forEach(this.props.events, (event, index) => {
210
230
  this.editorInstance.on(index, event);
211
231
  });
@@ -11,9 +11,9 @@ export const LOGOUT_SUCCESS_V2 = 'cap/LOGOUT_SUCCESS_V2';
11
11
  export const LOGOUT_FAILURE_V2 = 'cap/LOGOUT_FAILURE_V2';
12
12
  export const ADD_MESSAGE = 'cap/ADD_MESSAGE';
13
13
  export const REMOVE_MESSAGE = 'cap/REMOVE_MESSAGE';
14
- export const GET_USER_DATA_REQUEST = 'cap/GET_USER_DATA_REQUEST';
15
- export const GET_USER_DATA_SUCCESS = 'cap/GET_USER_DATA_SUCCESS';
16
- export const GET_USER_DATA_FAILURE = 'cap/GET_USER_DATA_FAILURE';
14
+ export const GET_USER_DATA_REQUEST = 'cap/GET_USER_DATA_REQUEST_V2';
15
+ export const GET_USER_DATA_SUCCESS = 'cap/GET_USER_DATA_SUCCESS_V2';
16
+ export const GET_USER_DATA_FAILURE = 'cap/GET_USER_DATA_FAILURE_V2';
17
17
 
18
18
  export const GET_SCHEMA_FOR_ENTITY_FAILURE = 'cap/GET_SCHEMA_FOR_ENTITY_FAILURE';
19
19
  export const GET_SCHEMA_FOR_ENTITY_REQUEST = 'cap/GET_SCHEMA_FOR_ENTITY_REQUEST';
@@ -214,14 +214,15 @@ function SlideBoxContent(props) {
214
214
  stickerId,
215
215
  packageId,
216
216
  baseUrl,
217
- video: {
217
+ video,
218
+ template,
219
+ }) => {
220
+ const {
218
221
  originalContentUrl,
219
222
  externalLink: {
220
223
  linkUri,
221
224
  } = {},
222
- } = {},
223
- template,
224
- }) => {
225
+ } = video || {};
225
226
  const previewContent = {};
226
227
  previewContent.messageContent = text;
227
228
  previewContent.previewImageUrl = previewImageUrl;
@@ -2179,7 +2179,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2179
2179
  } else {
2180
2180
  this.setState({injectedTags: data.tags});
2181
2181
  }
2182
- data.tags && this.props.globalActions.setInjectedTags(data.tags);
2182
+ this.props.globalActions.setInjectedTags(data.tags);
2183
2183
  }
2184
2184
 
2185
2185
  startLoading = (ifEdit) => {
@@ -810,7 +810,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
810
810
  { [WECHAT, MOBILE_PUSH].includes(currentChannel) && this.showAccountName() }
811
811
  {filterContent}
812
812
  <CapSpin spinning={isLoading} tip={loadingTip} style={{width: '100%'}}>
813
- {!isLoading && <div>
813
+ {<div>
814
814
  {!isEmpty(filteredTemplates) || !isEmpty(this.state.searchText) || !isEmpty(this.props.Templates.templateError) ? (
815
815
  <div className={!isEmpty(this.state.searchText) && isEmpty(cardDataList) ? '' : "pagination-container"}>
816
816
  <CapCustomCardList
@@ -821,7 +821,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
821
821
  fbType={"list"}
822
822
  />
823
823
  </div>)
824
- : ['sms', "email"].includes(this.state.channel.toLowerCase()) && <CapIllustration buttonClassName={`create-new-${channelLowerCase}`} {...this.getChannelTypeIllustrationInfo(currentChannel)} />
824
+ : ['sms', "email"].includes(this.state.channel.toLowerCase()) && !isLoading && <CapIllustration buttonClassName={`create-new-${channelLowerCase}`} {...this.getChannelTypeIllustrationInfo(currentChannel)} />
825
825
  }
826
826
 
827
827
  {(this.state.selectedAccount === '' && isEmpty(this.props.Templates.selectedWeChatAccount)) && (this.state.channel.toLowerCase() === 'wechat' || this.state.channel.toLowerCase() === "mobilepush") &&