@social-mail/social-mail-client 1.2.111 → 1.2.113

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.
Files changed (28) hide show
  1. package/component.js +7 -0
  2. package/dist/admin/AdminAppIndex.pack.js +42 -15
  3. package/dist/admin/AdminAppIndex.pack.js.map +1 -1
  4. package/dist/admin/AdminAppIndex.pack.min.js +4 -4
  5. package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
  6. package/dist/common/pages/websites/studio/WebSiteStudioPage.js +2 -1
  7. package/dist/common/pages/websites/studio/WebSiteStudioPage.js.map +1 -1
  8. package/dist/public/channel/ChannelView.pack.js +6 -2
  9. package/dist/public/channel/ChannelView.pack.js.map +1 -1
  10. package/dist/public/channel/ChannelView.pack.min.js +1 -1
  11. package/dist/public/channel/ChannelView.pack.min.js.map +1 -1
  12. package/dist/tsconfig.tsbuildinfo +1 -1
  13. package/dist/web/AppIndex.pack.js +42 -15
  14. package/dist/web/AppIndex.pack.js.map +1 -1
  15. package/dist/web/AppIndex.pack.min.js +4 -4
  16. package/dist/web/AppIndex.pack.min.js.map +1 -1
  17. package/dist/web/page/mails/mini-compose/MiniComposeBox.d.ts +3 -0
  18. package/dist/web/page/mails/mini-compose/MiniComposeBox.d.ts.map +1 -1
  19. package/dist/web/page/mails/mini-compose/MiniComposeBox.js +34 -12
  20. package/dist/web/page/mails/mini-compose/MiniComposeBox.js.map +1 -1
  21. package/dist/web/page/mails/service/ConversationService.d.ts +1 -1
  22. package/dist/web/page/mails/service/ConversationService.d.ts.map +1 -1
  23. package/dist/web/page/mails/service/ConversationService.js +6 -2
  24. package/dist/web/page/mails/service/ConversationService.js.map +1 -1
  25. package/package.json +1 -1
  26. package/src/common/pages/websites/studio/WebSiteStudioPage.tsx +1 -1
  27. package/src/web/page/mails/mini-compose/MiniComposeBox.tsx +31 -8
  28. package/src/web/page/mails/service/ConversationService.tsx +6 -4
@@ -18612,12 +18612,16 @@ System.register(["tslib", "@web-atoms/core/dist/di/DISingleton", "@web-atoms/cor
18612
18612
  mailboxID,
18613
18613
  emailAddressID,
18614
18614
  email
18615
- }, create = false) {
18615
+ }, create = false, saveAttachments = true, cancelToken) {
18616
18616
  var _a, _b, _c;
18617
18617
  return __awaiter(this, void 0, void 0, function* () {
18618
18618
  if (email === null || email === void 0 ? void 0 : email.emailID) {
18619
18619
  email.subject || (email.subject = "");
18620
- const cloner = this.entityService.cloner(email).include(x => x.attachments).include(x => x.recipients);
18620
+ email.dateUpdated = DateTime.now;
18621
+ let cloner = this.entityService.cloner(Object.assign({}, email));
18622
+ if (saveAttachments) {
18623
+ cloner = cloner.include(x => x.attachments);
18624
+ }
18621
18625
  yield this.entityService.save(cloner.copy);
18622
18626
  return email;
18623
18627
  }
@@ -26079,10 +26083,10 @@ System.register(["@web-atoms/core/dist/core/XNode", "@web-atoms/web-controls/dis
26079
26083
 
26080
26084
  AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/page/mails/mini-compose/Attach");
26081
26085
 
26082
- System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/style/styled", "@web-atoms/core/dist/web/controls/AtomControl", "../../../../model/model", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/view-model/Action", "../../../../common/controls/audio/AudioRecorder", "../service/ConversationService", "@web-atoms/web-controls/dist/basic/AtomRepeater", "@web-atoms/core/dist/core/InjectProperty", "../../../../common/events/CommonEvents", "../service/MailService", "@web-atoms/date-time/dist/DateTime", "@web-atoms/core/dist/core/sleep", "../../../../common/controls/html/InlineHtmlEditorWithToolbar", "@web-atoms/web-controls/dist/html-editor/AtomHtmlEditor", "@web-atoms/web-controls/dist/html-editor/commands/Align", "@web-atoms/web-controls/dist/html-editor/commands/Bold", "@web-atoms/web-controls/dist/html-editor/commands/Italic", "@web-atoms/web-controls/dist/html-editor/commands/StrikeThrough", "@web-atoms/web-controls/dist/html-editor/commands/Underline", "@web-atoms/web-controls/dist/html-editor/commands/AddLink", "@web-atoms/web-controls/dist/html-editor/commands/Unlink", "@web-atoms/web-controls/dist/html-editor/commands/Separator", "./Insert", "@web-atoms/date-time/dist/TimeSpan", "./Attach"], function (_export, _context) {
26086
+ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/style/styled", "@web-atoms/core/dist/web/controls/AtomControl", "../../../../model/model", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/view-model/Action", "../../../../common/controls/audio/AudioRecorder", "../service/ConversationService", "@web-atoms/web-controls/dist/basic/AtomRepeater", "@web-atoms/core/dist/core/InjectProperty", "../../../../common/events/CommonEvents", "../service/MailService", "@web-atoms/date-time/dist/DateTime", "@web-atoms/core/dist/core/sleep", "../../../../common/controls/html/InlineHtmlEditorWithToolbar", "@web-atoms/web-controls/dist/html-editor/AtomHtmlEditor", "@web-atoms/web-controls/dist/html-editor/commands/Align", "@web-atoms/web-controls/dist/html-editor/commands/Bold", "@web-atoms/web-controls/dist/html-editor/commands/Italic", "@web-atoms/web-controls/dist/html-editor/commands/StrikeThrough", "@web-atoms/web-controls/dist/html-editor/commands/Underline", "@web-atoms/web-controls/dist/html-editor/commands/AddLink", "@web-atoms/web-controls/dist/html-editor/commands/Unlink", "@web-atoms/web-controls/dist/html-editor/commands/Separator", "./Insert", "@web-atoms/date-time/dist/TimeSpan", "./Attach", "@web-atoms/core/dist/core/types"], function (_export, _context) {
26083
26087
  "use strict";
26084
26088
 
26085
- var __awaiter, __decorate, __metadata, XNode, styled, AtomControl, AppFile, Email, Bind, Action, AudioRecorder, ConversationService, AtomRepeater, InjectProperty, CommonEvents, MailService, DateTime, sleep, MailHtmlEditor, Toolbar, Align, Bold, Italic, StrikeThrough, Underline, AddLink, Unlink, Separator, Insert, TimeSpan, Attach, MiniComposeBox, css, defaultEmailBody;
26089
+ var __awaiter, __decorate, __metadata, XNode, styled, AtomControl, AppFile, Email, Bind, Action, AudioRecorder, ConversationService, AtomRepeater, InjectProperty, CommonEvents, MailService, DateTime, sleep, MailHtmlEditor, Toolbar, Align, Bold, Italic, StrikeThrough, Underline, AddLink, Unlink, Separator, Insert, TimeSpan, Attach, CancelToken, MiniComposeBox, css, defaultEmailBody;
26086
26090
  _export("default", void 0);
26087
26091
  return {
26088
26092
  setters: [function (_tslib) {
@@ -26144,6 +26148,8 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
26144
26148
  TimeSpan = _webAtomsDateTimeDistTimeSpan.default;
26145
26149
  }, function (_Attach) {
26146
26150
  Attach = _Attach.default;
26151
+ }, function (_webAtomsCoreDistCoreTypes) {
26152
+ CancelToken = _webAtomsCoreDistCoreTypes.CancelToken;
26147
26153
  }],
26148
26154
  execute: function () {
26149
26155
  css = styled.css`
@@ -26193,6 +26199,8 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
26193
26199
  this.draft = null;
26194
26200
  this.typedMessage = "";
26195
26201
  this.active = false;
26202
+ this.savedSubject = void 0;
26203
+ this.savedBody = void 0;
26196
26204
  this.element.className = css;
26197
26205
  this.app.runAsync(() => this.init());
26198
26206
  }
@@ -26340,9 +26348,6 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
26340
26348
  if (!((_a = this.editor) === null || _a === void 0 ? void 0 : _a.htmlTextContent)) {
26341
26349
  return;
26342
26350
  }
26343
- if (this.prevSave) {
26344
- yield this.prevSave;
26345
- }
26346
26351
  (_b = this.draft) !== null && _b !== void 0 ? _b : this.draft = Email.create({
26347
26352
  attachments: []
26348
26353
  });
@@ -26350,10 +26355,17 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
26350
26355
  html,
26351
26356
  text
26352
26357
  } = this.editor.htmlTextContent;
26358
+ if (this.savedSubject === this.draft.subject && this.savedBody === html) {
26359
+ return;
26360
+ }
26361
+ if (this.prevSave) {
26362
+ yield this.prevSave;
26363
+ }
26364
+ this.savedSubject = this.draft.subject;
26365
+ this.savedBody = html;
26353
26366
  this.draft.htmlBody = html;
26354
26367
  this.draft.textBody = text;
26355
- this.prevSave = this.save();
26356
- yield this.prevSave;
26368
+ yield this.save(false);
26357
26369
  });
26358
26370
  }
26359
26371
  onEmailUnscheduled(mce) {
@@ -26379,6 +26391,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
26379
26391
  yield this.save();
26380
26392
  this.draft.status = "scheduled";
26381
26393
  this.draft.dateSent = DateTime.now.add(TimeSpan.fromSeconds(30));
26394
+ this.draft.dateUpdated = DateTime.now;
26382
26395
  yield this.mailService.send(this.draft);
26383
26396
  this.draft = Email.create({
26384
26397
  subject: "",
@@ -26394,7 +26407,6 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
26394
26407
  this.ensureDraft();
26395
26408
  this.draft.textBody = this.typedMessage;
26396
26409
  yield this.addFiles(uploadedFile);
26397
- yield this.save();
26398
26410
  });
26399
26411
  }
26400
26412
  addFiles(...files) {
@@ -26404,6 +26416,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
26404
26416
  for (const file of files) {
26405
26417
  attachments.add(this.createAppFile(file));
26406
26418
  }
26419
+ yield this.save();
26407
26420
  });
26408
26421
  }
26409
26422
  createAppFile(file) {
@@ -26424,11 +26437,24 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
26424
26437
  });
26425
26438
  (_b = (_c = this.draft).attachments) !== null && _b !== void 0 ? _b : _c.attachments = [];
26426
26439
  }
26427
- save() {
26440
+ save(saveAttachments = true) {
26428
26441
  return __awaiter(this, void 0, void 0, function* () {
26429
- this.draft = yield this.conversationService.draft(Object.assign(Object.assign({}, this.mailboxContact), {
26430
- email: this.draft
26431
- }), true);
26442
+ const {
26443
+ prevSave,
26444
+ saveCancelToken
26445
+ } = this;
26446
+ saveCancelToken === null || saveCancelToken === void 0 ? void 0 : saveCancelToken.cancel();
26447
+ const ct = this.saveCancelToken = new CancelToken();
26448
+ this.prevSave = (() => __awaiter(this, void 0, void 0, function* () {
26449
+ try {
26450
+ if (prevSave) {
26451
+ yield prevSave;
26452
+ }
26453
+ this.draft = yield this.conversationService.draft(Object.assign(Object.assign({}, this.mailboxContact), {
26454
+ email: this.draft
26455
+ }), true, saveAttachments, ct);
26456
+ } catch (_a) {}
26457
+ }))().catch(console.error);
26432
26458
  });
26433
26459
  }
26434
26460
  });
@@ -40588,7 +40614,8 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
40588
40614
  });
40589
40615
  }
40590
40616
  hide() {
40591
- this.pageContent = this.htmlEditor.htmlPage;
40617
+ var _a;
40618
+ this.pageContent = (_a = this.htmlEditor) === null || _a === void 0 ? void 0 : _a.htmlPage;
40592
40619
  super.hide();
40593
40620
  }
40594
40621
  show() {