@bobfrankston/rmfmail 1.0.677 → 1.0.679
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/bin/build-spellcheck-dict.js +25 -0
- package/client/app.bundle.js +11 -18
- package/client/app.bundle.js.map +2 -2
- package/client/app.js +34 -22
- package/client/app.js.map +1 -1
- package/client/app.ts +34 -24
- package/client/compose/compose.bundle.js +1355 -4
- package/client/compose/compose.bundle.js.map +4 -4
- package/client/compose/compose.css +28 -2
- package/client/compose/compose.js +23 -1
- package/client/compose/compose.js.map +1 -1
- package/client/compose/compose.ts +21 -1
- package/client/compose/spellcheck.js +403 -0
- package/client/compose/spellcheck.js.map +1 -0
- package/client/compose/spellcheck.ts +383 -0
- package/client/lib/dict/en.aff +205 -0
- package/client/lib/dict/en.dic +49569 -0
- package/client/lib/rmf-tiny.js +3 -2
- package/docs/accounts.md +9 -1
- package/package.json +10 -4
- package/packages/mailx-service/index.d.ts +1 -0
- package/packages/mailx-service/index.d.ts.map +1 -1
- package/packages/mailx-service/index.js +26 -6
- package/packages/mailx-service/index.js.map +1 -1
- package/packages/mailx-service/index.ts +24 -4
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Copy `dictionary-en/index.aff` + `index.dic` into `client/lib/dict/`
|
|
4
|
+
* so the compose iframe can `fetch()` them via msger's custom protocol
|
|
5
|
+
* (msger only serves files under `contentDir = client/`). Done at build
|
|
6
|
+
* time rather than runtime so a fresh install doesn't need to read the
|
|
7
|
+
* dictionary from node_modules — the published package ships the dict.
|
|
8
|
+
*/
|
|
9
|
+
import fs from "node:fs";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
|
|
12
|
+
const root = path.resolve(import.meta.dirname, "..");
|
|
13
|
+
const src = path.join(root, "node_modules", "dictionary-en");
|
|
14
|
+
const dst = path.join(root, "client", "lib", "dict");
|
|
15
|
+
|
|
16
|
+
if (!fs.existsSync(path.join(src, "index.aff"))) {
|
|
17
|
+
console.error(`build-spellcheck-dict: source not found at ${src} — run npm install first`);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
fs.mkdirSync(dst, { recursive: true });
|
|
21
|
+
for (const name of ["index.aff", "index.dic"]) {
|
|
22
|
+
const dstName = name.replace("index", "en");
|
|
23
|
+
fs.copyFileSync(path.join(src, name), path.join(dst, dstName));
|
|
24
|
+
}
|
|
25
|
+
console.log(`build-spellcheck-dict: copied dictionary-en → ${path.relative(root, dst)}/{en.aff,en.dic}`);
|
package/client/app.bundle.js
CHANGED
|
@@ -6423,25 +6423,18 @@ function addComposeResizeHandles(wrapper, frame) {
|
|
|
6423
6423
|
}
|
|
6424
6424
|
}
|
|
6425
6425
|
function sanitizeQuotedBody(msg) {
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
body = body.replace(
|
|
6431
|
-
/<(?!img\b)([^>]*?)\s+(width|height|align|valign|bgcolor|cellpadding|cellspacing|border)="[^"]*"([^>]*)>/gi,
|
|
6432
|
-
(_m, before, _attr, after) => `<${before}${after}>`
|
|
6433
|
-
);
|
|
6434
|
-
let prev = "";
|
|
6435
|
-
while (prev !== body) {
|
|
6436
|
-
prev = body;
|
|
6437
|
-
body = body.replace(
|
|
6438
|
-
/<(?!img\b)([^>]*?)\s+(width|height|align|valign|bgcolor|cellpadding|cellspacing|border)="[^"]*"([^>]*)>/gi,
|
|
6439
|
-
(_m, before, _attr, after) => `<${before}${after}>`
|
|
6440
|
-
);
|
|
6426
|
+
const isPlainText = !msg.bodyHtml;
|
|
6427
|
+
if (isPlainText) {
|
|
6428
|
+
const escaped = String(msg.bodyText || "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
6429
|
+
return `<div style="white-space:pre-wrap;font-family:inherit;margin:0">${escaped}</div>`;
|
|
6441
6430
|
}
|
|
6442
|
-
body =
|
|
6443
|
-
body = body.replace(/<
|
|
6444
|
-
body = body.replace(/<
|
|
6431
|
+
let body = msg.bodyHtml;
|
|
6432
|
+
body = body.replace(/<script[^>]*>[\s\S]*?<\/script>/gi, "");
|
|
6433
|
+
body = body.replace(/<style[^>]*>[\s\S]*?<\/style>/gi, "");
|
|
6434
|
+
body = body.replace(/<link[^>]*>/gi, "");
|
|
6435
|
+
body = body.replace(/<base[^>]*>/gi, "");
|
|
6436
|
+
body = body.replace(/\s+on\w+="[^"]*"/gi, "");
|
|
6437
|
+
body = body.replace(/\s+on\w+='[^']*'/gi, "");
|
|
6445
6438
|
return body;
|
|
6446
6439
|
}
|
|
6447
6440
|
function quoteBody(msg) {
|