codenotch-react 1.0.66 → 1.0.67

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.
@@ -13,7 +13,9 @@ interface ICodeEditorProps {
13
13
  export default class CodeEditor extends React.Component<ICodeEditorProps> {
14
14
  private isIframeReady;
15
15
  private onChangeTimeoutHandle;
16
+ private onMessageHandler;
16
17
  refFrame: React.RefObject<HTMLIFrameElement>;
18
+ constructor(props: ICodeEditorProps);
17
19
  setValue(value: string): void;
18
20
  componentDidMount(): void;
19
21
  componentWillUnmount(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../src/components/CodeEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,gBAAgB;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC;IACrE,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,qBAAqB,CAAa;IAC1C,QAAQ,qCAAwC;IAEhD,QAAQ,CAAC,KAAK,EAAE,MAAM;IAStB,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAI5B,kBAAkB,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI;IAoBrD,OAAO,CAAC,aAAa;IAgCrB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,WAAW;IA4EnB,MAAM;CAeT"}
1
+ {"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../src/components/CodeEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,gBAAgB;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC;IACrE,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,qBAAqB,CAAa;IAC1C,OAAO,CAAC,gBAAgB,CAAM;IAC9B,QAAQ,qCAAwC;gBAEpC,KAAK,EAAE,gBAAgB;IAKnC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAStB,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAI5B,kBAAkB,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI;IAoBrD,OAAO,CAAC,aAAa;IAgCrB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,WAAW;IA4EnB,MAAM;CAeT"}
@@ -9,11 +9,12 @@ const __1 = require("..");
9
9
  * Light version of Monaco Editor in an iframe.
10
10
  */
11
11
  class CodeEditor extends react_1.default.Component {
12
- constructor() {
13
- super(...arguments);
12
+ constructor(props) {
13
+ super(props);
14
14
  this.isIframeReady = false;
15
15
  this.onChangeTimeoutHandle = null;
16
16
  this.refFrame = react_1.default.createRef();
17
+ this.onMessageHandler = this.handleMessage.bind(this);
17
18
  }
18
19
  setValue(value) {
19
20
  if (this.isIframeReady) {
@@ -24,11 +25,11 @@ class CodeEditor extends react_1.default.Component {
24
25
  }
25
26
  }
26
27
  componentDidMount() {
27
- window.addEventListener('message', this.handleMessage);
28
+ window.addEventListener('message', this.onMessageHandler);
28
29
  this.writeIframe();
29
30
  }
30
31
  componentWillUnmount() {
31
- window.removeEventListener('message', this.handleMessage);
32
+ window.removeEventListener('message', this.onMessageHandler);
32
33
  }
33
34
  componentDidUpdate(prevProps) {
34
35
  const changed = (prevProps.value !== this.props.value ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codenotch-react",
3
- "version": "1.0.66",
3
+ "version": "1.0.67",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Codenotch SA",