@social-mail/social-mail-web-server 1.8.490 → 1.8.492
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/server/services/files/web-content/WebContentTranspileService.d.ts.map +1 -1
- package/dist/server/services/files/web-content/WebContentTranspileService.js +0 -1
- package/dist/server/services/files/web-content/WebContentTranspileService.js.map +1 -1
- package/dist/server/services/html/HtmlForEmailService.js +13 -0
- package/dist/server/services/html/HtmlForEmailService.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/server/services/files/web-content/WebContentTranspileService.ts +0 -1
- package/src/server/services/html/HtmlForEmailService.ts +16 -1
package/package.json
CHANGED
|
@@ -348,7 +348,6 @@ export default class WebContentTranspileService
|
|
|
348
348
|
const contentService = ServiceProvider.resolve(this, WebSiteContentService);
|
|
349
349
|
const fileInfo = await contentService.getFileInfo(siteFolder.snapshotFolderID, ... rewritePath.split("/"));
|
|
350
350
|
if (!fileInfo) {
|
|
351
|
-
console.warn(JSON.stringify({ value, rewritePath, error: "File not found", currentPath }));
|
|
352
351
|
return value;
|
|
353
352
|
}
|
|
354
353
|
const eFileContentID = this.ecs.general.encrypt(fileInfo.fileContentID.toString());
|
|
@@ -136,6 +136,19 @@ async function inlineCSS(window, document: Document){
|
|
|
136
136
|
return result;
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
+
function changeImageType(e: Element, names = ["src", "large-src"]) {
|
|
140
|
+
for(const name of names) {
|
|
141
|
+
const value = e.getAttribute(name);
|
|
142
|
+
if (!value) {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
const replaced = value.replace("/webp", "/jpg").replace(".webp", ".jpg");
|
|
146
|
+
if (replaced !== value) {
|
|
147
|
+
e.setAttribute(name, replaced);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
139
152
|
|
|
140
153
|
async function flattenStyleSheets() {
|
|
141
154
|
const includes = document.querySelectorAll(`link[rel="stylesheet"]`);
|
|
@@ -173,6 +186,7 @@ async function inlineCSS(window, document: Document){
|
|
|
173
186
|
}
|
|
174
187
|
}
|
|
175
188
|
}
|
|
189
|
+
changeImageType(e);
|
|
176
190
|
}
|
|
177
191
|
adoptedStyle.textContent = styles.join("\n");
|
|
178
192
|
document.head.appendChild(adoptedStyle);
|
|
@@ -181,6 +195,7 @@ async function inlineCSS(window, document: Document){
|
|
|
181
195
|
return () => remove.forEach((x)=>x.remove());
|
|
182
196
|
}
|
|
183
197
|
|
|
198
|
+
|
|
184
199
|
async function flattenStyler(rules) {
|
|
185
200
|
|
|
186
201
|
const stylerPrefix = "styler-";
|
|
@@ -243,4 +258,4 @@ async function inlineCSS(window, document: Document){
|
|
|
243
258
|
s.remove();
|
|
244
259
|
}
|
|
245
260
|
|
|
246
|
-
}
|
|
261
|
+
}
|