@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.
@@ -27203,7 +27203,13 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
27203
27203
  }
27204
27204
  const watcher = children.watch((target, event, index, child) => {
27205
27205
  var _a;
27206
- if (event === "add" || event === "set") {
27206
+ if (event === "add") {
27207
+ this.createElement(child, item, index);
27208
+ return;
27209
+ }
27210
+ if (event === "set") {
27211
+ const childElement = this.map.get(child);
27212
+ childElement === null || childElement === void 0 ? void 0 : childElement.dispose();
27207
27213
  this.createElement(child, item, index);
27208
27214
  return;
27209
27215
  }
@@ -32250,6 +32256,13 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "./TreeView", "@web
32250
32256
  }
32251
32257
  file.name = newName;
32252
32258
  yield this.cloudFileService.save(file);
32259
+ const e = this.map.get(file);
32260
+ const {
32261
+ parentItem: {
32262
+ children
32263
+ }
32264
+ } = e;
32265
+ children.set(children.indexOf(file), file);
32253
32266
  });
32254
32267
  }
32255
32268
  loadFolder(folder, accept, cancelToken) {
@@ -32279,6 +32292,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "./TreeView", "@web
32279
32292
  _export("FileTreeView", FileTreeView = class FileTreeView extends FolderTreeView {
32280
32293
  constructor(app, e) {
32281
32294
  super(app, e);
32295
+ this.menuActions = null;
32282
32296
  this.canSelect = item => !item.isFolder;
32283
32297
  this.labelRenderer = x => XNode.create("span", {
32284
32298
  text: x.name,
@@ -32287,34 +32301,38 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "./TreeView", "@web
32287
32301
  });
32288
32302
  this.actionRenderer = item => XNode.create(InlinePopupButton, {
32289
32303
  "data-layout": "icon-button",
32290
- icon: "fa-solid fa-ellipsis-vertical"
32291
- }, XNode.create("div", {
32292
- "data-layout": "vertical-flex",
32293
- "style-width": "200px"
32294
- }, item.isFolder && XNode.create(MenuItem, {
32295
- "data-click-event": "new-folder",
32296
- icon: "fas fa-plus",
32297
- label: "New Folder"
32298
- }), item.isFolder && XNode.create(MenuItem, Object.assign({
32299
- "data-click-event": "none",
32300
- icon: "fas fa-upload",
32301
- label: "Upload File",
32302
- "data-extra": JSON.stringify({
32303
- parentID: item.appFileID
32304
- })
32305
- }, UploadEvent.AttachUploadAction({
32306
- multiple: true,
32307
- folder: true,
32308
- accept: "*/*"
32309
- }))), this.root !== item && XNode.create(MenuItem, {
32310
- "data-click-event": "rename-file",
32311
- icon: "fa-duotone fa-i-cursor",
32312
- label: "Rename"
32313
- }), this.root !== item && XNode.create(MenuItem, {
32314
- "data-click-event": "delete-file",
32315
- icon: "fas fa-trash-can",
32316
- label: "Delete"
32317
- })));
32304
+ icon: "fa-solid fa-ellipsis-vertical",
32305
+ popup: () => {
32306
+ var _a, _b;
32307
+ return XNode.create("div", {
32308
+ "data-layout": "vertical-flex",
32309
+ "style-width": "200px"
32310
+ }, item.isFolder && XNode.create(MenuItem, {
32311
+ "data-click-event": "new-folder",
32312
+ icon: "fas fa-plus",
32313
+ label: "New Folder"
32314
+ }), item.isFolder && XNode.create(MenuItem, Object.assign({
32315
+ "data-click-event": "none",
32316
+ icon: "fas fa-upload",
32317
+ label: "Upload File",
32318
+ "data-extra": JSON.stringify({
32319
+ parentID: item.appFileID
32320
+ })
32321
+ }, UploadEvent.AttachUploadAction({
32322
+ multiple: true,
32323
+ folder: true,
32324
+ accept: "*/*"
32325
+ }))), ...((_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, {
32326
+ "data-click-event": "rename-file",
32327
+ icon: "fa-duotone fa-i-cursor",
32328
+ label: "Rename"
32329
+ }), this.root !== item && XNode.create(MenuItem, {
32330
+ "data-click-event": "delete-file",
32331
+ icon: "fas fa-trash-can",
32332
+ label: "Delete"
32333
+ }));
32334
+ }
32335
+ });
32318
32336
  }
32319
32337
  loadFolder(folder, accept, cancelToken) {
32320
32338
  return __awaiter(this, void 0, void 0, function* () {
@@ -36662,6 +36680,11 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
36662
36680
  accept: "text/html",
36663
36681
  presenter: Bind.presenter(c => this.folderTree = c),
36664
36682
  selectedItem: Bind.twoWaysImmediate(() => this.selectedFile),
36683
+ menuActions: x => !x.isFolder ? /\.(htm|html)$/i.test(x.name) ? [XNode.create(MenuItem, {
36684
+ icon: "fas fa-copy",
36685
+ "data-click-event": "duplicate-html",
36686
+ label: "Duplicate Page"
36687
+ })] : [] : void 0,
36665
36688
  "event-selected-item-changing": ce => {
36666
36689
  if (this.pageContent) {
36667
36690
  if (confirm("Page is modified but not saved, your changes will be lost")) {
@@ -36752,6 +36775,22 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
36752
36775
  this.pageContent = "";
36753
36776
  });
36754
36777
  }
36778
+ duplicateHtml(file) {
36779
+ return __awaiter(this, void 0, void 0, function* () {
36780
+ let {
36781
+ name
36782
+ } = file;
36783
+ name = name.replace(/(\.[^\.]+)$/, ext => " Copy" + ext);
36784
+ file = yield this.cloudFileService.save(Object.assign(Object.assign({}, file), {
36785
+ appFileID: void 0,
36786
+ children: void 0,
36787
+ parent: void 0,
36788
+ name
36789
+ }));
36790
+ this.root.children.add(file);
36791
+ this.selectedFile = file;
36792
+ });
36793
+ }
36755
36794
  hide() {
36756
36795
  this.pageContent = this.htmlEditor.htmlPage;
36757
36796
  super.hide();
@@ -36788,6 +36827,9 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
36788
36827
  __decorate([Action({
36789
36828
  onEvent: "save-page"
36790
36829
  }), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], WebSiteStudioPage.prototype, "savePage", null);
36830
+ __decorate([Action({
36831
+ onEvent: "duplicate-html"
36832
+ }), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Promise)], WebSiteStudioPage.prototype, "duplicateHtml", null);
36791
36833
  }
36792
36834
  };
36793
36835
  });