@capillarytech/creatives-library 2.0.18 → 2.0.20

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.
@@ -50,3 +50,9 @@ export function fetchSchemaForEntity(queryParams) {
50
50
  type: types.GET_SCHEMA_FOR_ENTITY_REQUEST, queryParams,
51
51
  };
52
52
  }
53
+
54
+ export function clearMetaEntities() {
55
+ return {
56
+ type: types.CLEAR_META_ENTITIES,
57
+ };
58
+ }
@@ -24,7 +24,7 @@ import * as charCount from '../../../utils/smsCharCount';
24
24
  import { checkUnicode} from '../../../utils/smsCharCountV2';
25
25
  import * as globalActions from '../../../containers/Cap/actions';
26
26
  import {getMessageObject} from '../../../utils/messageUtils';
27
- import callNativeEvent from '../../../utils/callNativeEvent';
27
+ // import callNativeEvent from '../../../utils/callNativeEvent';
28
28
 
29
29
  export class Create extends React.Component { // eslint-disable-line react/prefer-stateless-function
30
30
  constructor(props) {
@@ -219,7 +219,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
219
219
  onTagSelect(data, currentTab) {
220
220
  console.log('parent data tag', data, currentTab);
221
221
  const editorId = currentTab > 1 ? `sms-editor${currentTab}` : 'sms-editor';
222
- this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`);
222
+ this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
223
223
  document.getElementById(editorId).focus();
224
224
  }
225
225
 
@@ -740,7 +740,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
740
740
  return false;
741
741
  }
742
742
 
743
- insertAtCursor(field, myValue) {
743
+ insertAtCursor(field, myValue, currentTab) {
744
744
  //IE support
745
745
  const myField = field;
746
746
  if (document.selection) {
@@ -758,8 +758,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
758
758
  } else {
759
759
  myField.value += myValue;
760
760
  }
761
- const event = new Event('input', { bubbles: true });
762
- callNativeEvent({field, value: myField.value, event});
761
+ const formData = _.cloneDeep(this.state.formData);
762
+ formData[currentTab - 1][field.id] = myField.value;
763
+ this.setState({formData});
764
+ // const event = new Event('input', { bubbles: true });
765
+ // callNativeEvent({field, value: myField.value, event});
763
766
  }
764
767
 
765
768
  startTemplateCreation(data) {
@@ -24,7 +24,7 @@ import '../Create/_smsCreate.scss';
24
24
  import messages from './messages';
25
25
  import * as globalActions from '../../../containers/Cap/actions';
26
26
  import {getMessageObject} from '../../../utils/messageUtils';
27
- import callNativeEvent from '../../../utils/callNativeEvent';
27
+ // import callNativeEvent from '../../../utils/callNativeEvent';
28
28
 
29
29
  export class Edit extends React.Component { // eslint-disable-line react/prefer-stateless-function
30
30
  constructor(props) {
@@ -217,7 +217,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
217
217
  onTagSelect(data, currentTab) {
218
218
  console.log('parent data tag', data, currentTab);
219
219
  const editorId = currentTab > 1 ? `sms-editor${currentTab}` : 'sms-editor';
220
- this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`);
220
+ this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
221
221
  document.getElementById(editorId).focus();
222
222
  }
223
223
 
@@ -755,7 +755,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
755
755
  }
756
756
  }
757
757
  }
758
- insertAtCursor(field, myValue) {
758
+ insertAtCursor(field, myValue, currentTab) {
759
759
  //IE support
760
760
  const myField = field;
761
761
  if (document.selection) {
@@ -773,8 +773,11 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
773
773
  } else {
774
774
  myField.value += myValue;
775
775
  }
776
- const event = new Event('input', { bubbles: true });
777
- callNativeEvent({field, value: myField.value, event});
776
+ const formData = _.cloneDeep(this.state.formData);
777
+ formData[currentTab - 1][field.id] = myField.value;
778
+ this.setState({formData});
779
+ // const event = new Event('input', { bubbles: true });
780
+ // callNativeEvent({field, value: myField.value, event});
778
781
  }
779
782
 
780
783
  handleFrameTasks = (e) => {
@@ -349,6 +349,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
349
349
  console.log('removed listener templates');
350
350
  window.removeEventListener("message", this.handleFrameTasks);
351
351
  this.props.actions.resetTemplateStoreData();
352
+ this.props.globalActions.clearMetaEntities();
352
353
  // this.setState({defaultAccount: false});
353
354
  }
354
355
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "2.0.18",
4
+ "version": "2.0.20",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",