@social-mail/social-mail-client 1.2.35 → 1.2.36

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-client",
3
- "version": "1.2.35",
3
+ "version": "1.2.36",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,6 +24,7 @@ export default class CodeEditorPage extends ContentPage<IAppFile> {
24
24
 
25
25
  async init() {
26
26
  this.title = this.parameters.name;
27
+ this.file = this.parameters;
27
28
 
28
29
  this.renderer = <div data-display="grid" data-align-items="stretch" data-justify-items="stretch">
29
30
  <iframe
@@ -38,14 +39,20 @@ export default class CodeEditorPage extends ContentPage<IAppFile> {
38
39
  text="Save"/>
39
40
  </div>;
40
41
 
41
- const file = this.parameters;
42
+ const file = this.file;
42
43
  const iframe = this.element.querySelector("iframe");
43
44
 
44
45
  this.monacoService = await MonacoService.createEditor(this, iframe);
45
46
 
46
- const code = await FetchBuilder.get(file.downloadUrl).responseAsText();
47
+ this.content = await FetchBuilder.get(file.downloadUrl).responseAsText();
47
48
 
48
- this.monacoService.setCodeModel(this, code, `http://a/${file.name}`);
49
+ this.monacoService.setCodeModel(this, this.content, `http://a/${file.name}`);
50
+ }
51
+
52
+ @Action({ onEvent: "code-changed"})
53
+ codeChanged({ code }) {
54
+ this.modified ||= this.content !== code;
55
+ this.content = code;
49
56
  }
50
57
 
51
58
  @Action({ onEvent: "save-file", close: true})
@@ -55,6 +62,7 @@ export default class CodeEditorPage extends ContentPage<IAppFile> {
55
62
  content: new File([content], name, { type: contentType}),
56
63
  appFileID
57
64
  });
65
+ this.modified = false;
58
66
  return await this.cloudFileService.getFile(appFileID);
59
67
  }
60
68