@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.
- package/dist/site-editor-app/SiteEditorApp.pack.js +11 -3
- package/dist/site-editor-app/SiteEditorApp.pack.js.map +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.min.js +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.min.js.map +1 -1
- package/dist/site-editor-app/pages/websites/studio/WebSiteStudioPage.d.ts +1 -1
- package/dist/site-editor-app/pages/websites/studio/WebSiteStudioPage.d.ts.map +1 -1
- package/dist/site-editor-app/pages/websites/studio/WebSiteStudioPage.js +11 -3
- package/dist/site-editor-app/pages/websites/studio/WebSiteStudioPage.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/site-editor-app/pages/websites/studio/WebSiteStudioPage.tsx +17 -3
package/package.json
CHANGED
|
@@ -282,8 +282,7 @@ export default class WebSiteStudioPage extends ContentPage {
|
|
|
282
282
|
</div>;
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
changeFile() {
|
|
286
|
-
const file = this.folderTree.selectedItem as IAppFile;
|
|
285
|
+
changeFile(file = this.folderTree.selectedItem as IAppFile) {
|
|
287
286
|
const folder = this.cloudFileService.getFilePath(this.root, file) ?? "";
|
|
288
287
|
SiteEditorCommands.editWebSite.dispatch({ id: this.parameters.id, page: folder + file.name });
|
|
289
288
|
}
|
|
@@ -384,6 +383,21 @@ export default class WebSiteStudioPage extends ContentPage {
|
|
|
384
383
|
async duplicateHtml(file: IAppFile) {
|
|
385
384
|
let { name } = file;
|
|
386
385
|
name = name.replace(/(\.[^\.]+)$/, (ext) => " Copy" + ext);
|
|
386
|
+
|
|
387
|
+
name = name.replace(/\.html$/, "");
|
|
388
|
+
|
|
389
|
+
name = prompt("Name of the file", name);
|
|
390
|
+
if (!name) {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
name = name + ".html";
|
|
395
|
+
|
|
396
|
+
// check if name already exists...
|
|
397
|
+
if(this.root.children.find((f) => f.name === name)) {
|
|
398
|
+
throw new Error("File with same name already exists");
|
|
399
|
+
}
|
|
400
|
+
|
|
387
401
|
file = await this.cloudFileService.save({ ... file,
|
|
388
402
|
appFileID: void 0,
|
|
389
403
|
children: void 0,
|
|
@@ -391,7 +405,7 @@ export default class WebSiteStudioPage extends ContentPage {
|
|
|
391
405
|
name
|
|
392
406
|
});
|
|
393
407
|
this.root.children.add(file);
|
|
394
|
-
this.
|
|
408
|
+
this.changeFile(file);
|
|
395
409
|
}
|
|
396
410
|
|
|
397
411
|
@Action({ onEvent: "file-history"})
|