@social-mail/social-mail-client 1.2.283 → 1.2.285

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.
@@ -49730,6 +49730,25 @@ System.register(["tslib", "@web-atoms/core/dist/core/BindableProperty", "./HtmlP
49730
49730
  this.htmlDocument.head.appendChild(script);
49731
49731
  }
49732
49732
  script.setAttribute("src", "//cdn.jsdelivr.net/npm/@social-mail/web-components@1.0.54/dist/components.webpack.js");
49733
+ for (const e of Array.from(this.htmlDocument.querySelectorAll("inject"))) {
49734
+ let src = e.getAttribute("src");
49735
+ if (src.startsWith("/")) {
49736
+ src = src.substring(1);
49737
+ } else {}
49738
+ const file = yield this.cloudFileService.children(this.folder.appFileID, src).firstOrDefault();
49739
+ const text = yield FetchBuilder.get(file.downloadUrl).responseAsText();
49740
+ const parser = new DOMParser();
49741
+ const dom = parser.parseFromString(text, "text/html");
49742
+ const children = Array.from(dom.body.children);
49743
+ for (const iterator of Array.from(e.children)) {
49744
+ iterator.remove();
49745
+ }
49746
+ for (const iterator of children) {
49747
+ iterator.setAttribute("contentEditable", "false");
49748
+ iterator.remove();
49749
+ e.appendChild(iterator);
49750
+ }
49751
+ }
49733
49752
  });
49734
49753
  }
49735
49754
  addStyleSheet(file) {
@@ -50449,26 +50468,8 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
50449
50468
  }
50450
50469
  downloadHtml(file, cancelToken) {
50451
50470
  return __awaiter(this, void 0, void 0, function* () {
50452
- let text = yield FetchBuilder.get(file.downloadUrl).cancelToken(cancelToken).responseAsText(true);
50453
- const parser = new DOMParser();
50454
- const doc = parser.parseFromString(text, "text/html");
50455
- const injects = Array.from(doc.documentElement.querySelectorAll("inject"));
50456
- for (const e of injects) {
50457
- let src = e.getAttribute("src");
50458
- if (src.startsWith("/")) {
50459
- src = src.substring(1);
50460
- } else {}
50461
- const injectedFile = yield this.cloudFileService.children(this.root.appFileID, src).firstOrDefault();
50462
- text = yield FetchBuilder.get(injectedFile.downloadUrl).responseAsText();
50463
- const dom = parser.parseFromString(text, "text/html");
50464
- const children = Array.from(dom.body.children);
50465
- e.innerHTML = "";
50466
- for (const iterator of children) {
50467
- iterator.setAttribute("contentEditable", "false");
50468
- e.appendChild(iterator);
50469
- }
50470
- }
50471
- return doc.documentElement.outerHTML;
50471
+ const text = yield FetchBuilder.get(file.downloadUrl).cancelToken(cancelToken).responseAsText(true);
50472
+ return text;
50472
50473
  });
50473
50474
  }
50474
50475
  createIndexHtml() {