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

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.
@@ -49652,6 +49652,9 @@ System.register(["tslib", "@web-atoms/core/dist/core/BindableProperty", "./HtmlP
49652
49652
  const selectedElement = this.selection.element;
49653
49653
  const outerText = selectedElement.outerHTML;
49654
49654
  let fileName = prompt("File Name", "/templates/header.html");
49655
+ if (!fileName) {
49656
+ return;
49657
+ }
49655
49658
  if (fileName.startsWith("/")) {
49656
49659
  fileName = fileName.substring(1);
49657
49660
  }
@@ -49711,6 +49714,24 @@ System.register(["tslib", "@web-atoms/core/dist/core/BindableProperty", "./HtmlP
49711
49714
  }
49712
49715
  setStylerSheet() {
49713
49716
  return __awaiter(this, void 0, void 0, function* () {
49717
+ for (const e of Array.from(this.htmlDocument.querySelectorAll("inject"))) {
49718
+ let src = e.getAttribute("src");
49719
+ if (src.startsWith("/")) {
49720
+ src = src.substring(1);
49721
+ } else {}
49722
+ const file = yield this.cloudFileService.children(this.folder.appFileID, src).firstOrDefault();
49723
+ const text = yield FetchBuilder.get(file.downloadUrl).responseAsText();
49724
+ const parser = new DOMParser();
49725
+ const dom = parser.parseFromString(text, "text/html");
49726
+ const children = Array.from(dom.body.children);
49727
+ for (const iterator of Array.from(e.children)) {
49728
+ iterator.remove();
49729
+ }
49730
+ for (const iterator of children) {
49731
+ iterator.setAttribute("contentEditable", "false");
49732
+ e.appendChild(iterator);
49733
+ }
49734
+ }
49714
49735
  const stylerCSS = yield this.createFile("styler.css", StylerSet.instance.toString());
49715
49736
  yield this.addStyleSheet(stylerCSS);
49716
49737
  let vars = yield this.cloudFileService.children(this.folder.appFileID, "styles/vars.css").firstOrDefault();
@@ -49730,25 +49751,6 @@ System.register(["tslib", "@web-atoms/core/dist/core/BindableProperty", "./HtmlP
49730
49751
  this.htmlDocument.head.appendChild(script);
49731
49752
  }
49732
49753
  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
- }
49752
49754
  });
49753
49755
  }
49754
49756
  addStyleSheet(file) {