@social-mail/social-mail-client 1.9.56 → 1.9.57

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.
@@ -60705,9 +60705,8 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
60705
60705
  }));
60706
60706
  });
60707
60707
  }
60708
- changeFile() {
60708
+ changeFile(file = this.folderTree.selectedItem) {
60709
60709
  var _a;
60710
- const file = this.folderTree.selectedItem;
60711
60710
  const folder = (_a = this.cloudFileService.getFilePath(this.root, file)) !== null && _a !== void 0 ? _a : "";
60712
60711
  SiteEditorCommands.editWebSite.dispatch({
60713
60712
  id: this.parameters.id,
@@ -60817,6 +60816,15 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
60817
60816
  name
60818
60817
  } = file;
60819
60818
  name = name.replace(/(\.[^\.]+)$/, ext => " Copy" + ext);
60819
+ name = name.replace(/\.html$/, "");
60820
+ name = prompt("Name of the file", name);
60821
+ if (!name) {
60822
+ return;
60823
+ }
60824
+ name = name + ".html";
60825
+ if (this.root.children.find(f => f.name === name)) {
60826
+ throw new Error("File with same name already exists");
60827
+ }
60820
60828
  file = yield this.cloudFileService.save(Object.assign(Object.assign({}, file), {
60821
60829
  appFileID: void 0,
60822
60830
  children: void 0,
@@ -60824,7 +60832,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
60824
60832
  name
60825
60833
  }));
60826
60834
  this.root.children.add(file);
60827
- this.selectedFile = file;
60835
+ this.changeFile(file);
60828
60836
  });
60829
60837
  }
60830
60838
  fileHistory(file) {