@social-mail/social-mail-client 1.8.299 → 1.8.300

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.
@@ -35582,6 +35582,14 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
35582
35582
  }
35583
35583
  };
35584
35584
  _export("default", MiniComposeBox = class MiniComposeBox extends AtomControl {
35585
+ get isEmpty() {
35586
+ var _a, _b;
35587
+ const {
35588
+ text
35589
+ } = this.editor.htmlTextContent;
35590
+ const isEmpty = !(text === null || text === void 0 ? void 0 : text.trim()) && !((_b = (_a = this.draft) === null || _a === void 0 ? void 0 : _a.attachments) === null || _b === void 0 ? void 0 : _b.length);
35591
+ return isEmpty;
35592
+ }
35585
35593
  constructor(app, e) {
35586
35594
  super(app, e);
35587
35595
  this.mailboxContacts = [];
@@ -35878,17 +35886,14 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
35878
35886
  }
35879
35887
  sendEmail() {
35880
35888
  return __awaiter(this, void 0, void 0, function* () {
35881
- var _a, _b;
35882
35889
  const {
35883
35890
  html,
35884
35891
  text
35885
35892
  } = this.editor.htmlTextContent;
35886
35893
  this.draft.htmlBody = html;
35887
35894
  this.draft.textBody = text;
35888
- if (!(text === null || text === void 0 ? void 0 : text.trim())) {
35889
- if (!((_b = (_a = this.draft) === null || _a === void 0 ? void 0 : _a.attachments) === null || _b === void 0 ? void 0 : _b.length)) {
35890
- throw new Error("Cannot send empty email");
35891
- }
35895
+ if (this.isEmpty) {
35896
+ throw new Error("Cannot send empty email");
35892
35897
  }
35893
35898
  yield this.save();
35894
35899
  const {
@@ -38500,10 +38505,10 @@ System.register(["@web-atoms/core/dist/core/XNode"], function (_export, _context
38500
38505
 
38501
38506
  AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/page/mails/mini-compose/MiniComposePage");
38502
38507
 
38503
- System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "../../../../model/model", "@web-atoms/email-dom/dist/DomToString", "@web-atoms/core/dist/core/XNode", "../../../../common/controls/email-recipients/EmailLabel", "./MiniComposeBox", "@web-atoms/core/dist/core/Bind", "../../../../common/controls/buttons/IconButton", "@web-atoms/core/dist/view-model/Action", "../../../../services/EntityService", "@web-atoms/core/dist/core/InjectProperty"], function (_export, _context) {
38508
+ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "../../../../model/model", "@web-atoms/email-dom/dist/DomToString", "@web-atoms/core/dist/core/XNode", "../../../../common/controls/email-recipients/EmailLabel", "./MiniComposeBox", "@web-atoms/core/dist/core/Bind", "../../../../common/controls/buttons/IconButton", "@web-atoms/core/dist/view-model/Action", "../../../../services/EntityService", "@web-atoms/core/dist/core/InjectProperty", "@web-atoms/core/dist/web/services/PopupWindow"], function (_export, _context) {
38504
38509
  "use strict";
38505
38510
 
38506
- var __awaiter, __decorate, __metadata, PopupWindowPage, AppFile, Email, EmailRecipient, DomToString, XNode, EmailLabel, MiniComposeBox, defaultMessageBodyStyle, Bind, EmailIconTextButton, SaveIconTextButton, Action, EntityService, InjectProperty, MiniComposePage;
38511
+ var __awaiter, __decorate, __metadata, PopupWindowPage, AppFile, Email, EmailRecipient, DomToString, XNode, EmailLabel, MiniComposeBox, defaultMessageBodyStyle, Bind, EmailIconTextButton, SaveIconTextButton, Action, EntityService, InjectProperty, ConfirmPopup, MiniComposePage;
38507
38512
  _export("default", void 0);
38508
38513
  return {
38509
38514
  setters: [function (_tslib) {
@@ -38536,6 +38541,8 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
38536
38541
  EntityService = _servicesEntityService.default;
38537
38542
  }, function (_webAtomsCoreDistCoreInjectProperty) {
38538
38543
  InjectProperty = _webAtomsCoreDistCoreInjectProperty.default;
38544
+ }, function (_webAtomsCoreDistWebServicesPopupWindow) {
38545
+ ConfirmPopup = _webAtomsCoreDistWebServicesPopupWindow.ConfirmPopup;
38539
38546
  }],
38540
38547
  execute: function () {
38541
38548
  _export("default", MiniComposePage = class MiniComposePage extends PopupWindowPage {
@@ -38597,6 +38604,24 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
38597
38604
  })));
38598
38605
  });
38599
38606
  }
38607
+ requestCancel() {
38608
+ const _super = Object.create(null, {
38609
+ requestCancel: {
38610
+ get: () => super.requestCancel
38611
+ }
38612
+ });
38613
+ return __awaiter(this, void 0, void 0, function* () {
38614
+ if (!this.composer.isEmpty) {
38615
+ const result = yield ConfirmPopup.confirm({
38616
+ message: "Are you sure you want to cancel the compose?"
38617
+ });
38618
+ if (!result) {
38619
+ return;
38620
+ }
38621
+ }
38622
+ return _super.requestCancel.call(this);
38623
+ });
38624
+ }
38600
38625
  sendEmail() {
38601
38626
  return __awaiter(this, arguments, void 0, function* (send = false) {
38602
38627
  if (send) {