@social-mail/social-mail-client 1.2.4 → 1.2.5

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.
@@ -24432,7 +24432,7 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
24432
24432
  _export("acceptDocumentAndMedia", acceptDocumentAndMedia = ".doc, .docx, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, video/*, application/pdf, .pdf, .txt, audio/*, image/*, .csv, text/csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/plain, text/html");
24433
24433
  styled.css`
24434
24434
  display: inline-grid;
24435
- grid-template-rows: auto auto;
24435
+ grid-template-rows: auto auto auto;
24436
24436
 
24437
24437
  & > [data-element=file-name] {
24438
24438
  grid-row: 1;
@@ -24441,10 +24441,14 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
24441
24441
  text-overflow: ellipsis;
24442
24442
  }
24443
24443
 
24444
- & > [data-element=progress] {
24444
+ & > progress {
24445
24445
  grid-row: 2;
24446
24446
  width: 100%;
24447
24447
  }
24448
+ & > [data-element=error] {
24449
+ grid-row: 3;
24450
+ width: 100%;
24451
+ }
24448
24452
 
24449
24453
  `.installGlobal("[data-attachment-file]");
24450
24454
  LocalFileService = class LocalFileService extends TaskManager {
@@ -24567,20 +24571,36 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
24567
24571
  const upload = {
24568
24572
  total: 0,
24569
24573
  tasks,
24570
- progress: 0
24574
+ progress: 0,
24575
+ error: ""
24571
24576
  };
24572
24577
  for (const file of files) {
24573
24578
  upload.total += file.size;
24574
24579
  const uploadFile = {
24575
24580
  name: file.name,
24581
+ error: "",
24576
24582
  progress: 0
24577
24583
  };
24578
24584
  uploadFile.promise = this.run(() => __awaiter(this, void 0, void 0, function* () {
24579
- uploadFile.progress = 0.01;
24580
- const r = yield this.uploadFile(file, extra, ct, n => uploadFile.progress = n);
24581
- upload.progress += r.file.size;
24582
- setTimeout(() => tasks.remove(uploadFile), 500);
24583
- return r;
24585
+ var _a, _b;
24586
+ let lastError;
24587
+ for (let i = 0; i < 3; i++) {
24588
+ try {
24589
+ uploadFile.progress = 0.01;
24590
+ const r = yield this.uploadFile(file, extra, ct, n => uploadFile.progress = n);
24591
+ upload.progress += r.file.size;
24592
+ setTimeout(() => tasks.remove(uploadFile), 500);
24593
+ upload.error = "";
24594
+ lastError = null;
24595
+ return r;
24596
+ } catch (error) {
24597
+ lastError = `${(_a = file.webkitRelativePath) !== null && _a !== void 0 ? _a : ""}/${file.name} failed to upload.\n${(_b = error.stack) !== null && _b !== void 0 ? _b : error}`;
24598
+ uploadFile.error = lastError;
24599
+ }
24600
+ }
24601
+ if (lastError) {
24602
+ upload.error += "\n" + lastError;
24603
+ }
24584
24604
  }));
24585
24605
  tasks.push(uploadFile);
24586
24606
  }
@@ -24634,6 +24654,10 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
24634
24654
  min: 0,
24635
24655
  max: 1,
24636
24656
  value: Bind.source(file, x => x.source.progress)
24657
+ }), XNode.create("div", {
24658
+ "data-element": "error",
24659
+ "data-color": "red",
24660
+ text: Bind.source(file, x => x.source.error)
24637
24661
  }))
24638
24662
  })));
24639
24663
  try {