@social-mail/social-mail-client 1.9.98 → 1.9.99
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/css-for-email.js +4 -8
- package/package.json +1 -1
package/css-for-email.js
CHANGED
|
@@ -26,14 +26,10 @@ const te = new TextEncoder();
|
|
|
26
26
|
|
|
27
27
|
function encodeTo36(text) {
|
|
28
28
|
const buffer = te.encode(text);
|
|
29
|
-
|
|
30
|
-
for(const byte of buffer) {
|
|
31
|
-
n = (n << 8n) | BigInt(byte);
|
|
32
|
-
}
|
|
33
|
-
return n.toString(36);
|
|
29
|
+
return window.crypto.subtle.digest("SHA-1", buffer);
|
|
34
30
|
}
|
|
35
31
|
|
|
36
|
-
function flattenStyler() {
|
|
32
|
+
async function flattenStyler() {
|
|
37
33
|
|
|
38
34
|
const replaceList = [];
|
|
39
35
|
|
|
@@ -48,7 +44,7 @@ function flattenStyler() {
|
|
|
48
44
|
const value = e.getAttribute(name);
|
|
49
45
|
const cssValue = CSS.escape(value);
|
|
50
46
|
const rule = `[${name}=${cssValue}]`;
|
|
51
|
-
const className = encodeTo36(rule);
|
|
47
|
+
const className = await encodeTo36(rule);
|
|
52
48
|
e.classList.add(className);
|
|
53
49
|
replaceList.push({ rule, className: "." + className});
|
|
54
50
|
}
|
|
@@ -71,7 +67,7 @@ function flattenStyler() {
|
|
|
71
67
|
|
|
72
68
|
await flattenStyleSheets();
|
|
73
69
|
|
|
74
|
-
flattenStyler();
|
|
70
|
+
await flattenStyler();
|
|
75
71
|
|
|
76
72
|
currentScript.remove();
|
|
77
73
|
|