@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.
@@ -46042,6 +46042,25 @@ System.register(["tslib", "@web-atoms/core/dist/core/BindableProperty", "./HtmlP
46042
46042
  this.htmlDocument.head.appendChild(script);
46043
46043
  }
46044
46044
  script.setAttribute("src", "//cdn.jsdelivr.net/npm/@social-mail/web-components@1.0.54/dist/components.webpack.js");
46045
+ for (const e of Array.from(this.htmlDocument.querySelectorAll("inject"))) {
46046
+ let src = e.getAttribute("src");
46047
+ if (src.startsWith("/")) {
46048
+ src = src.substring(1);
46049
+ } else {}
46050
+ const file = yield this.cloudFileService.children(this.folder.appFileID, src).firstOrDefault();
46051
+ const text = yield FetchBuilder.get(file.downloadUrl).responseAsText();
46052
+ const parser = new DOMParser();
46053
+ const dom = parser.parseFromString(text, "text/html");
46054
+ const children = Array.from(dom.body.children);
46055
+ for (const iterator of Array.from(e.children)) {
46056
+ iterator.remove();
46057
+ }
46058
+ for (const iterator of children) {
46059
+ iterator.setAttribute("contentEditable", "false");
46060
+ iterator.remove();
46061
+ e.appendChild(iterator);
46062
+ }
46063
+ }
46045
46064
  });
46046
46065
  }
46047
46066
  addStyleSheet(file) {
@@ -46761,26 +46780,8 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
46761
46780
  }
46762
46781
  downloadHtml(file, cancelToken) {
46763
46782
  return __awaiter(this, void 0, void 0, function* () {
46764
- let text = yield FetchBuilder.get(file.downloadUrl).cancelToken(cancelToken).responseAsText(true);
46765
- const parser = new DOMParser();
46766
- const doc = parser.parseFromString(text, "text/html");
46767
- const injects = Array.from(doc.documentElement.querySelectorAll("inject"));
46768
- for (const e of injects) {
46769
- let src = e.getAttribute("src");
46770
- if (src.startsWith("/")) {
46771
- src = src.substring(1);
46772
- } else {}
46773
- const injectedFile = yield this.cloudFileService.children(this.root.appFileID, src).firstOrDefault();
46774
- text = yield FetchBuilder.get(injectedFile.downloadUrl).responseAsText();
46775
- const dom = parser.parseFromString(text, "text/html");
46776
- const children = Array.from(dom.body.children);
46777
- e.innerHTML = "";
46778
- for (const iterator of children) {
46779
- iterator.setAttribute("contentEditable", "false");
46780
- e.appendChild(iterator);
46781
- }
46782
- }
46783
- return doc.documentElement.outerHTML;
46783
+ const text = yield FetchBuilder.get(file.downloadUrl).cancelToken(cancelToken).responseAsText(true);
46784
+ return text;
46784
46785
  });
46785
46786
  }
46786
46787
  createIndexHtml() {