@social-mail/social-mail-client 1.2.41 → 1.2.42

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.
@@ -19319,7 +19319,13 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
19319
19319
  }
19320
19320
  const watcher = children.watch((target, event, index, child) => {
19321
19321
  var _a;
19322
- if (event === "add" || event === "set") {
19322
+ if (event === "add") {
19323
+ this.createElement(child, item, index);
19324
+ return;
19325
+ }
19326
+ if (event === "set") {
19327
+ const childElement = this.map.get(child);
19328
+ childElement === null || childElement === void 0 ? void 0 : childElement.dispose();
19323
19329
  this.createElement(child, item, index);
19324
19330
  return;
19325
19331
  }
@@ -35689,6 +35695,13 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "./TreeView", "@web
35689
35695
  }
35690
35696
  file.name = newName;
35691
35697
  yield this.cloudFileService.save(file);
35698
+ const e = this.map.get(file);
35699
+ const {
35700
+ parentItem: {
35701
+ children
35702
+ }
35703
+ } = e;
35704
+ children.set(children.indexOf(file), file);
35692
35705
  });
35693
35706
  }
35694
35707
  loadFolder(folder, accept, cancelToken) {
@@ -35718,6 +35731,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "./TreeView", "@web
35718
35731
  _export("FileTreeView", FileTreeView = class FileTreeView extends FolderTreeView {
35719
35732
  constructor(app, e) {
35720
35733
  super(app, e);
35734
+ this.menuActions = null;
35721
35735
  this.canSelect = item => !item.isFolder;
35722
35736
  this.labelRenderer = x => XNode.create("span", {
35723
35737
  text: x.name,
@@ -35726,34 +35740,38 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "./TreeView", "@web
35726
35740
  });
35727
35741
  this.actionRenderer = item => XNode.create(InlinePopupButton, {
35728
35742
  "data-layout": "icon-button",
35729
- icon: "fa-solid fa-ellipsis-vertical"
35730
- }, XNode.create("div", {
35731
- "data-layout": "vertical-flex",
35732
- "style-width": "200px"
35733
- }, item.isFolder && XNode.create(MenuItem, {
35734
- "data-click-event": "new-folder",
35735
- icon: "fas fa-plus",
35736
- label: "New Folder"
35737
- }), item.isFolder && XNode.create(MenuItem, Object.assign({
35738
- "data-click-event": "none",
35739
- icon: "fas fa-upload",
35740
- label: "Upload File",
35741
- "data-extra": JSON.stringify({
35742
- parentID: item.appFileID
35743
- })
35744
- }, UploadEvent.AttachUploadAction({
35745
- multiple: true,
35746
- folder: true,
35747
- accept: "*/*"
35748
- }))), this.root !== item && XNode.create(MenuItem, {
35749
- "data-click-event": "rename-file",
35750
- icon: "fa-duotone fa-i-cursor",
35751
- label: "Rename"
35752
- }), this.root !== item && XNode.create(MenuItem, {
35753
- "data-click-event": "delete-file",
35754
- icon: "fas fa-trash-can",
35755
- label: "Delete"
35756
- })));
35743
+ icon: "fa-solid fa-ellipsis-vertical",
35744
+ popup: () => {
35745
+ var _a, _b;
35746
+ return XNode.create("div", {
35747
+ "data-layout": "vertical-flex",
35748
+ "style-width": "200px"
35749
+ }, item.isFolder && XNode.create(MenuItem, {
35750
+ "data-click-event": "new-folder",
35751
+ icon: "fas fa-plus",
35752
+ label: "New Folder"
35753
+ }), item.isFolder && XNode.create(MenuItem, Object.assign({
35754
+ "data-click-event": "none",
35755
+ icon: "fas fa-upload",
35756
+ label: "Upload File",
35757
+ "data-extra": JSON.stringify({
35758
+ parentID: item.appFileID
35759
+ })
35760
+ }, UploadEvent.AttachUploadAction({
35761
+ multiple: true,
35762
+ folder: true,
35763
+ accept: "*/*"
35764
+ }))), ...((_b = (_a = this.menuActions) === null || _a === void 0 ? void 0 : _a.call(this, item)) !== null && _b !== void 0 ? _b : []), this.root !== item && XNode.create(MenuItem, {
35765
+ "data-click-event": "rename-file",
35766
+ icon: "fa-duotone fa-i-cursor",
35767
+ label: "Rename"
35768
+ }), this.root !== item && XNode.create(MenuItem, {
35769
+ "data-click-event": "delete-file",
35770
+ icon: "fas fa-trash-can",
35771
+ label: "Delete"
35772
+ }));
35773
+ }
35774
+ });
35757
35775
  }
35758
35776
  loadFolder(folder, accept, cancelToken) {
35759
35777
  return __awaiter(this, void 0, void 0, function* () {
@@ -39951,6 +39969,11 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
39951
39969
  accept: "text/html",
39952
39970
  presenter: Bind.presenter(c => this.folderTree = c),
39953
39971
  selectedItem: Bind.twoWaysImmediate(() => this.selectedFile),
39972
+ menuActions: x => !x.isFolder ? /\.(htm|html)$/i.test(x.name) ? [XNode.create(MenuItem, {
39973
+ icon: "fas fa-copy",
39974
+ "data-click-event": "duplicate-html",
39975
+ label: "Duplicate Page"
39976
+ })] : [] : void 0,
39954
39977
  "event-selected-item-changing": ce => {
39955
39978
  if (this.pageContent) {
39956
39979
  if (confirm("Page is modified but not saved, your changes will be lost")) {
@@ -40041,6 +40064,22 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
40041
40064
  this.pageContent = "";
40042
40065
  });
40043
40066
  }
40067
+ duplicateHtml(file) {
40068
+ return __awaiter(this, void 0, void 0, function* () {
40069
+ let {
40070
+ name
40071
+ } = file;
40072
+ name = name.replace(/(\.[^\.]+)$/, ext => " Copy" + ext);
40073
+ file = yield this.cloudFileService.save(Object.assign(Object.assign({}, file), {
40074
+ appFileID: void 0,
40075
+ children: void 0,
40076
+ parent: void 0,
40077
+ name
40078
+ }));
40079
+ this.root.children.add(file);
40080
+ this.selectedFile = file;
40081
+ });
40082
+ }
40044
40083
  hide() {
40045
40084
  this.pageContent = this.htmlEditor.htmlPage;
40046
40085
  super.hide();
@@ -40077,6 +40116,9 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
40077
40116
  __decorate([Action({
40078
40117
  onEvent: "save-page"
40079
40118
  }), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], WebSiteStudioPage.prototype, "savePage", null);
40119
+ __decorate([Action({
40120
+ onEvent: "duplicate-html"
40121
+ }), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Promise)], WebSiteStudioPage.prototype, "duplicateHtml", null);
40080
40122
  }
40081
40123
  };
40082
40124
  });