@bobfrankston/rmfmail 1.2.333 → 1.2.335

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.
Files changed (34) hide show
  1. package/client/android-bootstrap.bundle.js +8 -0
  2. package/client/android-bootstrap.bundle.js.map +2 -2
  3. package/client/app.bundle.js +2 -1
  4. package/client/app.bundle.js.map +2 -2
  5. package/client/components/message-viewer.js +6 -1
  6. package/client/components/message-viewer.js.map +1 -1
  7. package/client/components/message-viewer.ts +6 -1
  8. package/client/compose/compose.bundle.js +42 -5
  9. package/client/compose/compose.bundle.js.map +4 -4
  10. package/client/compose/compose.js +7 -2
  11. package/client/compose/compose.js.map +1 -1
  12. package/client/compose/compose.ts +7 -2
  13. package/client/package.json +1 -1
  14. package/package.json +5 -5
  15. package/packages/mailx-imap/package-lock.json +2 -2
  16. package/packages/mailx-imap/package.json +1 -1
  17. package/packages/mailx-service/index.d.ts.map +1 -1
  18. package/packages/mailx-service/index.js +7 -1
  19. package/packages/mailx-service/index.js.map +1 -1
  20. package/packages/mailx-service/index.ts +7 -1
  21. package/packages/mailx-service/package.json +1 -1
  22. package/packages/mailx-service/sync-queue.d.ts +7 -0
  23. package/packages/mailx-service/sync-queue.d.ts.map +1 -1
  24. package/packages/mailx-service/sync-queue.js +9 -0
  25. package/packages/mailx-service/sync-queue.js.map +1 -1
  26. package/packages/mailx-service/sync-queue.ts +10 -0
  27. package/packages/mailx-settings/package.json +1 -1
  28. package/packages/mailx-store/package.json +1 -1
  29. package/packages/mailx-store-web/package.json +1 -1
  30. package/packages/mailx-types/index.d.ts.map +1 -1
  31. package/packages/mailx-types/index.js +14 -0
  32. package/packages/mailx-types/index.js.map +1 -1
  33. package/packages/mailx-types/index.ts +13 -0
  34. package/packages/mailx-types/package.json +1 -1
@@ -5387,6 +5387,43 @@ function keepTypingOutsideLinks(native) {
5387
5387
  // client/compose/compose.ts
5388
5388
  init_api_client();
5389
5389
  init_edit_commands();
5390
+
5391
+ // packages/mailx-types/log-changes.js
5392
+ var RESTATE_AFTER_MS = 60 * 60 * 1e3;
5393
+
5394
+ // packages/mailx-types/reminder-state.js
5395
+ var DISMISSED_RETENTION_MS = 30 * 864e5;
5396
+ var SNOOZED_RETENTION_MS = 7 * 864e5;
5397
+
5398
+ // packages/mailx-types/index.js
5399
+ function htmlToPlainText(html) {
5400
+ if (!html)
5401
+ return "";
5402
+ let s = html;
5403
+ s = s.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi, "");
5404
+ s = s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, "");
5405
+ s = s.replace(/<br\s*\/?\s*>/gi, "\n");
5406
+ s = s.replace(/<\/(p|div|li|tr|h[1-6]|blockquote|pre|section|article)\s*>/gi, "\n");
5407
+ s = s.replace(/<li\b[^>]*>/gi, " \u2022 ");
5408
+ s = s.replace(/<a\b[^>]*href\s*=\s*(['"])([^'"]*)\1[^>]*>([\s\S]*?)<\/a>/gi, (_m, _q, href, text) => {
5409
+ const t = text.replace(/<[^>]+>/g, "").trim();
5410
+ return t && t !== href ? `${t} (${href})` : href;
5411
+ });
5412
+ s = s.replace(/<img\b[^>]*>/gi, (tag) => {
5413
+ const src = (tag.match(/\bsrc\s*=\s*(['"])([^'"]*)\1/i) || [])[2]?.trim() || "";
5414
+ const alt = (tag.match(/\balt\s*=\s*(['"])([^'"]*)\1/i) || [])[2]?.trim() || "";
5415
+ const remote = /^https?:\/\//i.test(src);
5416
+ if (remote)
5417
+ return alt ? `[image: ${alt}] (${src})` : `(${src})`;
5418
+ return alt ? `[image: ${alt}]` : "[image]";
5419
+ });
5420
+ s = s.replace(/<[^>]+>/g, "");
5421
+ s = s.replace(/&nbsp;/gi, " ").replace(/&amp;/gi, "&").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&quot;/gi, '"').replace(/&#39;/gi, "'").replace(/&apos;/gi, "'").replace(/&mdash;/gi, "\u2014").replace(/&ndash;/gi, "\u2013").replace(/&hellip;/gi, "\u2026").replace(/&#(\d+);/g, (_m, n) => String.fromCodePoint(parseInt(n, 10))).replace(/&#x([0-9a-f]+);/gi, (_m, h) => String.fromCodePoint(parseInt(h, 16)));
5422
+ s = s.replace(/[ \t]+/g, " ").split("\n").map((l) => l.replace(/^[ \t]+|[ \t]+$/g, "")).join("\n").replace(/\n{3,}/g, "\n\n").trim();
5423
+ return s;
5424
+ }
5425
+
5426
+ // client/compose/compose.ts
5390
5427
  init_context_menu();
5391
5428
  installConsoleCapture();
5392
5429
  connectEvents();
@@ -5964,7 +6001,7 @@ function setupAutocomplete(input) {
5964
6001
  before = before.replace(/[ \t,]+$/, "");
5965
6002
  if (contact) {
5966
6003
  const haystack = `${contact.name} ${contact.email}`.toLowerCase();
5967
- const stripStranded = (s) => splitRecipients(s).map((p) => p.trim()).filter((p) => p.length > 0 && (p.includes("@") || !haystack.includes(p.toLowerCase()))).join(", ");
6004
+ const stripStranded = (s) => splitRecipients2(s).map((p) => p.trim()).filter((p) => p.length > 0 && (p.includes("@") || !haystack.includes(p.toLowerCase()))).join(", ");
5968
6005
  if (before) before = stripStranded(before);
5969
6006
  const afterCore = after.replace(/^[\s,]+/, "").replace(/[\s,]+$/, "");
5970
6007
  if (afterCore) {
@@ -6118,7 +6155,7 @@ for (const field of [toInput, ccInput, bccInput, subjectInput]) {
6118
6155
  smartTab(field);
6119
6156
  });
6120
6157
  }
6121
- function splitRecipients(s) {
6158
+ function splitRecipients2(s) {
6122
6159
  const raw = [];
6123
6160
  let cur = "", inQuote = false;
6124
6161
  for (const c of s) {
@@ -6166,7 +6203,7 @@ function formatAddrs(addrs) {
6166
6203
  }
6167
6204
  function parseAddrs(s) {
6168
6205
  if (!s.trim()) return [];
6169
- return splitRecipients(s).map((p) => p.trim()).filter((p) => p.length > 0).map((part) => {
6206
+ return splitRecipients2(s).map((p) => p.trim()).filter((p) => p.length > 0).map((part) => {
6170
6207
  const match = part.match(/^(.+?)\s*<(.+?)>$/);
6171
6208
  if (match) {
6172
6209
  let name = match[1].trim();
@@ -6478,7 +6515,7 @@ async function saveDraft2() {
6478
6515
  from: getFromAddress(),
6479
6516
  subject: subjectInput.value,
6480
6517
  bodyHtml: editor.getHtml(),
6481
- bodyText: editor.getText(),
6518
+ bodyText: htmlToPlainText(editor.getHtml()),
6482
6519
  to: toInput.value,
6483
6520
  cc: ccInput.value,
6484
6521
  bcc: bccInput.value,
@@ -6749,7 +6786,7 @@ document.getElementById("btn-send")?.addEventListener("click", async () => {
6749
6786
  bcc: parseAddrs(bccExpanded),
6750
6787
  subject: subjectInput.value,
6751
6788
  bodyHtml: editor.getHtml(),
6752
- bodyText: editor.getText(),
6789
+ bodyText: htmlToPlainText(editor.getHtml()),
6753
6790
  attachments: attachments.map((a) => ({ filename: a.filename, mimeType: a.mimeType, dataBase64: a.dataBase64 })),
6754
6791
  // Threading headers — daemon writes In-Reply-To and References into
6755
6792
  // the outgoing MIME from these. Without them every reply lands as a