@social-mail/social-mail-client 1.9.69 → 1.9.70
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.
- package/dist/site-editor/editor/HtmlPageEditor.d.ts.map +1 -1
- package/dist/site-editor/editor/HtmlPageEditor.js +91 -89
- package/dist/site-editor/editor/HtmlPageEditor.js.map +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.js +93 -91
- package/dist/site-editor-app/SiteEditorApp.pack.js.map +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.min.js +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.min.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/site-editor/editor/HtmlPageEditor.tsx +105 -101
|
@@ -57562,6 +57562,9 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
57562
57562
|
}
|
|
57563
57563
|
setSelection(element, commit = true) {
|
|
57564
57564
|
var _a;
|
|
57565
|
+
if (element.tagName === "HTML") {
|
|
57566
|
+
element = element.querySelector("body > *:nth-child(1)");
|
|
57567
|
+
}
|
|
57565
57568
|
const old = (_a = this.selection) === null || _a === void 0 ? void 0 : _a.element;
|
|
57566
57569
|
if (old === null || old === void 0 ? void 0 : old.draggable) {
|
|
57567
57570
|
old.removeAttribute("draggable");
|
|
@@ -57791,105 +57794,104 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
57791
57794
|
clone.head.appendChild(stylerCss);
|
|
57792
57795
|
}
|
|
57793
57796
|
this.undoRedo = new UndoRedo(this.htmlDocument, this);
|
|
57794
|
-
|
|
57795
|
-
|
|
57796
|
-
|
|
57797
|
-
|
|
57798
|
-
|
|
57799
|
-
|
|
57800
|
-
|
|
57801
|
-
|
|
57802
|
-
|
|
57803
|
-
|
|
57804
|
-
|
|
57805
|
-
|
|
57806
|
-
|
|
57807
|
-
|
|
57808
|
-
|
|
57809
|
-
}
|
|
57797
|
+
yield sleep(10);
|
|
57798
|
+
if (clone.querySelector(`[styler-layout="component"]`)) {
|
|
57799
|
+
let componentScript = clone.querySelector("[styler-component-script]");
|
|
57800
|
+
if (!componentScript) {
|
|
57801
|
+
componentScript = this.htmlDocument.createElement("script");
|
|
57802
|
+
componentScript.setAttribute("styler-component-script", "component-script");
|
|
57803
|
+
const head = clone.querySelector("head");
|
|
57804
|
+
head.appendChild(componentScript);
|
|
57805
|
+
const scripts = clone.querySelectorAll("script[src]");
|
|
57806
|
+
for (let index = 0; index < scripts.length; index++) {
|
|
57807
|
+
const script = scripts[index];
|
|
57808
|
+
const srcScript = script.getAttribute("src");
|
|
57809
|
+
if (srcScript.includes("@social-mail/social-mail-client/") || srcScript.includes("/component.js")) {
|
|
57810
|
+
script.remove();
|
|
57811
|
+
break;
|
|
57810
57812
|
}
|
|
57811
57813
|
}
|
|
57812
|
-
|
|
57813
|
-
|
|
57814
|
-
|
|
57815
|
-
|
|
57816
|
-
}
|
|
57817
|
-
|
|
57818
|
-
|
|
57819
|
-
|
|
57820
|
-
|
|
57821
|
-
|
|
57822
|
-
|
|
57823
|
-
|
|
57824
|
-
|
|
57825
|
-
|
|
57826
|
-
|
|
57827
|
-
|
|
57828
|
-
|
|
57829
|
-
|
|
57830
|
-
|
|
57831
|
-
|
|
57832
|
-
|
|
57833
|
-
|
|
57834
|
-
|
|
57835
|
-
|
|
57836
|
-
|
|
57837
|
-
|
|
57838
|
-
|
|
57839
|
-
|
|
57840
|
-
|
|
57841
|
-
|
|
57842
|
-
|
|
57843
|
-
|
|
57844
|
-
|
|
57845
|
-
if (attributeName.includes("-desktop-")) {
|
|
57846
|
-
const a = attributeName.replace("-desktop-", "-");
|
|
57847
|
-
node.removeAttribute(attributeName);
|
|
57848
|
-
node.setAttribute(a, av);
|
|
57849
|
-
continue;
|
|
57850
|
-
}
|
|
57851
|
-
const s = editorSuggestions[attributeName];
|
|
57852
|
-
if (s) {
|
|
57853
|
-
const cv = s.find(x => x.label === av);
|
|
57854
|
-
if (cv && cv.value !== av) {
|
|
57855
|
-
av = cv.value;
|
|
57856
|
-
node.setAttribute(attributeName, av);
|
|
57857
|
-
}
|
|
57858
|
-
}
|
|
57859
|
-
if (attributeName.startsWith("styler-all-child")) {
|
|
57860
|
-
node.removeAttribute(attributeName);
|
|
57861
|
-
node.setAttribute(attributeName.replace("styler-all-", "styler-"), av);
|
|
57862
|
-
}
|
|
57814
|
+
}
|
|
57815
|
+
const src = socialMailComponentPath;
|
|
57816
|
+
if (componentScript.getAttribute("src") !== src) {
|
|
57817
|
+
componentScript.setAttribute("src", src);
|
|
57818
|
+
}
|
|
57819
|
+
}
|
|
57820
|
+
let wc = clone.querySelector("script[web-components]");
|
|
57821
|
+
if (!wc) {
|
|
57822
|
+
wc = this.htmlDocument.createElement("script");
|
|
57823
|
+
wc.setAttribute("web-components", "social");
|
|
57824
|
+
wc.setAttribute("async", "true");
|
|
57825
|
+
wc.setAttribute("defer", "true");
|
|
57826
|
+
clone.head.appendChild(doc.createTextNode("\n"));
|
|
57827
|
+
clone.head.appendChild(wc);
|
|
57828
|
+
clone.head.appendChild(doc.createTextNode("\n"));
|
|
57829
|
+
}
|
|
57830
|
+
const wcs = `${WebComponents.path}/dist/main.js`;
|
|
57831
|
+
if (wc.getAttribute("src") !== wcs) {
|
|
57832
|
+
wc.setAttribute("src", wcs);
|
|
57833
|
+
}
|
|
57834
|
+
const sc = "//cdn.jsdelivr.net/npm/@social-mail/social-mail-client@latest/styler-lite/styler.css";
|
|
57835
|
+
const oldStylerCss = stylerCss.getAttribute("href");
|
|
57836
|
+
if (oldStylerCss !== sc) {
|
|
57837
|
+
stylerCss.setAttribute("href", sc);
|
|
57838
|
+
}
|
|
57839
|
+
for (const node of descendentElementIterator(clone.documentElement)) {
|
|
57840
|
+
const style = node.style;
|
|
57841
|
+
if (style) {
|
|
57842
|
+
for (const attributeName of node.getAttributeNames()) {
|
|
57843
|
+
let av = node.getAttribute(attributeName);
|
|
57844
|
+
if (av === "null") {
|
|
57845
|
+
node.removeAttribute(attributeName);
|
|
57846
|
+
continue;
|
|
57863
57847
|
}
|
|
57864
|
-
|
|
57865
|
-
|
|
57866
|
-
|
|
57867
|
-
|
|
57868
|
-
|
|
57869
|
-
|
|
57870
|
-
|
|
57871
|
-
|
|
57848
|
+
if (attributeName.includes("-desktop-")) {
|
|
57849
|
+
const a = attributeName.replace("-desktop-", "-");
|
|
57850
|
+
node.removeAttribute(attributeName);
|
|
57851
|
+
node.setAttribute(a, av);
|
|
57852
|
+
continue;
|
|
57853
|
+
}
|
|
57854
|
+
const s = editorSuggestions[attributeName];
|
|
57855
|
+
if (s) {
|
|
57856
|
+
const cv = s.find(x => x.label === av);
|
|
57857
|
+
if (cv && cv.value !== av) {
|
|
57858
|
+
av = cv.value;
|
|
57859
|
+
node.setAttribute(attributeName, av);
|
|
57872
57860
|
}
|
|
57873
57861
|
}
|
|
57874
|
-
|
|
57875
|
-
|
|
57862
|
+
if (attributeName.startsWith("styler-all-child")) {
|
|
57863
|
+
node.removeAttribute(attributeName);
|
|
57864
|
+
node.setAttribute(attributeName.replace("styler-all-", "styler-"), av);
|
|
57876
57865
|
}
|
|
57877
57866
|
}
|
|
57878
|
-
|
|
57879
|
-
|
|
57880
|
-
|
|
57881
|
-
|
|
57882
|
-
|
|
57883
|
-
|
|
57884
|
-
|
|
57885
|
-
|
|
57886
|
-
|
|
57887
|
-
stylerCss.setAttribute("href", UMD.resolvePath("@social-mail/social-mail-client/styler-lite/styler.css"));
|
|
57888
|
-
if (!clone.body.hasAttribute("styler-expansion-enabled")) {
|
|
57889
|
-
clone.body.setAttribute("styler-expansion-enabled", "true");
|
|
57867
|
+
const remove = [];
|
|
57868
|
+
for (let index = 0; index < style.length; index++) {
|
|
57869
|
+
const styleName = style[index];
|
|
57870
|
+
if (styleName.startsWith("--styler-")) {
|
|
57871
|
+
const stylerName = styleName.substring(2);
|
|
57872
|
+
if (node.getAttribute(stylerName) !== "custom") {
|
|
57873
|
+
remove.push(styleName);
|
|
57874
|
+
}
|
|
57875
|
+
}
|
|
57890
57876
|
}
|
|
57891
|
-
|
|
57892
|
-
|
|
57877
|
+
for (const n of remove) {
|
|
57878
|
+
style.removeProperty(n);
|
|
57879
|
+
}
|
|
57880
|
+
}
|
|
57881
|
+
}
|
|
57882
|
+
if (!clone.querySelector(`meta[charset]`)) {
|
|
57883
|
+
clone.head.appendChild(doc.createTextNode("\n\t"));
|
|
57884
|
+
clone.head.appendChild(ElementBuilder.create("meta", clone).attr("charset", "utf-8").element);
|
|
57885
|
+
clone.head.appendChild(doc.createTextNode("\n"));
|
|
57886
|
+
}
|
|
57887
|
+
yield sleep(5);
|
|
57888
|
+
this.undoRedo.pause();
|
|
57889
|
+
stylerCss.setAttribute("original-href", sc);
|
|
57890
|
+
stylerCss.setAttribute("href", UMD.resolvePath("@social-mail/social-mail-client/styler-lite/styler.css"));
|
|
57891
|
+
if (!clone.body.hasAttribute("styler-expansion-enabled")) {
|
|
57892
|
+
clone.body.setAttribute("styler-expansion-enabled", "true");
|
|
57893
|
+
}
|
|
57894
|
+
this.setSelection(this.htmlDocument.querySelector("body > *:nth-child(1)"));
|
|
57893
57895
|
});
|
|
57894
57896
|
}
|
|
57895
57897
|
updateEditable(doc) {
|