@social-mail/social-mail-client 1.2.167 → 1.2.168

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.
@@ -43774,10 +43774,10 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
43774
43774
 
43775
43775
  AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/page/files/media/ChooseMediaPage");
43776
43776
 
43777
- System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "@web-atoms/core/dist/core/XNode", "../common/controls/buttons/IconButton", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/view-model/Action", "@web-atoms/core/dist/core/InjectProperty", "../web/page/files/service/CloudFileService", "@web-atoms/core/dist/services/FetchBuilder", "./MonacoService"], function (_export, _context) {
43777
+ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "@web-atoms/core/dist/core/XNode", "../common/controls/buttons/IconButton", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/view-model/Action", "@web-atoms/core/dist/core/InjectProperty", "../web/page/files/service/CloudFileService", "./MonacoService"], function (_export, _context) {
43778
43778
  "use strict";
43779
43779
 
43780
- var __awaiter, __decorate, __metadata, ContentPage, XNode, SaveIconTextButton, Bind, Action, InjectProperty, CloudFileService, FetchBuilder, MonacoService, CodeEditorPage;
43780
+ var __awaiter, __decorate, __metadata, ContentPage, XNode, SaveIconTextButton, Bind, Action, InjectProperty, CloudFileService, MonacoService, CodeEditorPage;
43781
43781
  _export("default", void 0);
43782
43782
  return {
43783
43783
  setters: [function (_tslib) {
@@ -43798,8 +43798,6 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
43798
43798
  InjectProperty = _webAtomsCoreDistCoreInjectProperty.default;
43799
43799
  }, function (_webPageFilesServiceCloudFileService) {
43800
43800
  CloudFileService = _webPageFilesServiceCloudFileService.default;
43801
- }, function (_webAtomsCoreDistServicesFetchBuilder) {
43802
- FetchBuilder = _webAtomsCoreDistServicesFetchBuilder.default;
43803
43801
  }, function (_MonacoService) {
43804
43802
  MonacoService = _MonacoService.default;
43805
43803
  }],
@@ -43811,8 +43809,8 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
43811
43809
  }
43812
43810
  init() {
43813
43811
  return __awaiter(this, void 0, void 0, function* () {
43814
- this.title = this.parameters.name;
43815
- this.file = this.parameters;
43812
+ this.file = this.parameters.file;
43813
+ this.title = this.file.name;
43816
43814
  this.renderer = XNode.create("div", {
43817
43815
  "data-display": "grid",
43818
43816
  "data-align-items": "stretch",
@@ -43823,12 +43821,12 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
43823
43821
  "style-display": Bind.oneWay(() => this.modified, false)
43824
43822
  }, XNode.create(SaveIconTextButton, {
43825
43823
  "data-click-event": "save-file",
43826
- text: "Save"
43824
+ text: "Close"
43827
43825
  }));
43828
43826
  const file = this.file;
43829
43827
  const iframe = this.element.querySelector("iframe");
43830
43828
  this.monacoService = yield MonacoService.createEditor(this, iframe);
43831
- this.content = yield FetchBuilder.get(file.downloadUrl).responseAsText();
43829
+ this.content = this.parameters.content;
43832
43830
  this.monacoService.setCodeModel(this, this.content, `http://a/${file.name}`);
43833
43831
  });
43834
43832
  }
@@ -43841,21 +43839,9 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
43841
43839
  saveFile() {
43842
43840
  return __awaiter(this, void 0, void 0, function* () {
43843
43841
  const {
43844
- file: {
43845
- appFileID,
43846
- name,
43847
- contentType
43848
- },
43849
43842
  content
43850
43843
  } = this;
43851
- yield this.cloudFileService.saveFile({
43852
- content: new File([content], name, {
43853
- type: contentType
43854
- }),
43855
- appFileID
43856
- });
43857
- this.modified = false;
43858
- return yield this.cloudFileService.getFile(appFileID);
43844
+ return content;
43859
43845
  });
43860
43846
  }
43861
43847
  hide() {
@@ -43883,10 +43869,10 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
43883
43869
 
43884
43870
  AmdLoader.instance.setup("@social-mail/social-mail-client/dist/code-editor/CodeEditorPage");
43885
43871
 
43886
- System.register(["tslib", "@web-atoms/core/dist/core/BindableProperty", "./HtmlPageEditor", "../../web/page/files/media/ChooseMediaPage", "@web-atoms/web-controls/dist/PageNavigator", "../styler/StylerSet", "@web-atoms/core/dist/core/InjectProperty", "../../web/page/files/service/CloudFileService", "@web-atoms/core/dist/view-model/Action", "../../code-editor/CodeEditorPage", "../../common/apiPath"], function (_export, _context) {
43872
+ System.register(["tslib", "@web-atoms/core/dist/core/BindableProperty", "./HtmlPageEditor", "../../web/page/files/media/ChooseMediaPage", "@web-atoms/web-controls/dist/PageNavigator", "../styler/StylerSet", "@web-atoms/core/dist/core/InjectProperty", "../../web/page/files/service/CloudFileService", "@web-atoms/core/dist/view-model/Action", "../../code-editor/CodeEditorPage", "../../common/apiPath", "@web-atoms/core/dist/services/FetchBuilder"], function (_export, _context) {
43887
43873
  "use strict";
43888
43874
 
43889
- var __awaiter, __decorate, __metadata, BindableProperty, HtmlPageEditor, ChooseMediaPage, PageNavigator, StylerSet, InjectProperty, CloudFileService, Action, CodeEditorPage, apiPath, WebSitePageEditor;
43875
+ var __awaiter, __decorate, __metadata, BindableProperty, HtmlPageEditor, ChooseMediaPage, PageNavigator, StylerSet, InjectProperty, CloudFileService, Action, CodeEditorPage, apiPath, FetchBuilder, WebSitePageEditor;
43890
43876
  _export("default", void 0);
43891
43877
  return {
43892
43878
  setters: [function (_tslib) {
@@ -43913,6 +43899,8 @@ System.register(["tslib", "@web-atoms/core/dist/core/BindableProperty", "./HtmlP
43913
43899
  CodeEditorPage = _codeEditorCodeEditorPage.default;
43914
43900
  }, function (_commonApiPath) {
43915
43901
  apiPath = _commonApiPath.apiPath;
43902
+ }, function (_webAtomsCoreDistServicesFetchBuilder) {
43903
+ FetchBuilder = _webAtomsCoreDistServicesFetchBuilder.default;
43916
43904
  }],
43917
43905
  execute: function () {
43918
43906
  _export("default", WebSitePageEditor = class WebSitePageEditor extends HtmlPageEditor {
@@ -43935,9 +43923,23 @@ System.register(["tslib", "@web-atoms/core/dist/core/BindableProperty", "./HtmlP
43935
43923
  }
43936
43924
  openVariables() {
43937
43925
  return __awaiter(this, void 0, void 0, function* () {
43938
- const file = yield this.cloudFileService.children(this.folder.appFileID, "styles/vars.css").firstOrDefault();
43939
- const changedFile = yield PageNavigator.pushPageForResult(CodeEditorPage, file);
43940
- yield this.addStyleSheet(changedFile);
43926
+ let file = yield this.cloudFileService.children(this.folder.appFileID, "styles/vars.css").firstOrDefault();
43927
+ let content = yield FetchBuilder.get(file.downloadUrl).responseAsText();
43928
+ const modifiedContent = yield PageNavigator.pushPageForResult(CodeEditorPage, {
43929
+ file,
43930
+ content
43931
+ });
43932
+ if (modifiedContent !== content) {
43933
+ content = modifiedContent;
43934
+ yield this.cloudFileService.saveFile({
43935
+ content: new File([content], file.name, {
43936
+ type: file.contentType
43937
+ }),
43938
+ appFileID: file.appFileID
43939
+ });
43940
+ file = yield this.cloudFileService.getFile(file.appFileID);
43941
+ }
43942
+ yield this.addStyleSheet(file);
43941
43943
  });
43942
43944
  }
43943
43945
  setStylerSheet() {
@@ -44500,11 +44502,12 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
44500
44502
  }
44501
44503
  editCode() {
44502
44504
  return __awaiter(this, void 0, void 0, function* () {
44503
- const file = yield PageNavigator.pushPageForResult(CodeEditorPage, this.selectedFile);
44504
- this.selectedFile.fileContentID = file.fileContentID;
44505
- this.selectedFile.url = file.url;
44506
- this.selectedFile.downloadUrl = file.downloadUrl;
44507
- this.htmlEditor.htmlPage = yield FetchBuilder.get(file.url).responseAsText();
44505
+ const content = yield PageNavigator.pushPageForResult(CodeEditorPage, {
44506
+ file: this.selectedFile,
44507
+ content: this.htmlEditor.htmlPage
44508
+ });
44509
+ this.pageContent = content;
44510
+ this.htmlEditor.htmlPage = content;
44508
44511
  });
44509
44512
  }
44510
44513
  openFolder(file) {